This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

What version of FEniCS do the example problems natively work in?

0 votes

Hi there,

I am beginning to work through the examples in the FEniCS book and it looks like the first example (d1_p2D.py) contains deprecated source code. Since I don't want to spend a lot of time finding and fixing errors in the examples, does anyone know if there is a set of examples that are consistent with version 1.2? If not, then which version of FEniCS do the examples work with natively?

I'll post the error below for reference.

Thanks

poisson$ python d1_p2D.py
Reading DOLFIN parameters from file "dolfin_parameters.xml".
*** -------------------------------------------------------------------------
*** Warning: UnitSquare has been deprecated in DOLFIN version 1.1.0.
*** The class UnitSquare has been replaced by UnitSquareMesh.
*** -------------------------------------------------------------------------

Traceback (most recent call last):
File "d1_p2D.py", line 15, in
V = FunctionSpace(mesh, 'Lagrange', 1)
File "/Applications/FEniCS.app/Contents/Resources/lib/python2.7/site-packages/dolfin/functions/functionspace.py", line 390, in init
FunctionSpaceBase.init(self, mesh, element, constrained_domain)
File "/Applications/FEniCS.app/Contents/Resources/lib/python2.7/site-packages/dolfin/functions/functionspace.py", line 84, in init
ufc_element, ufc_dofmap = jit(self._ufl_element)
File "/Applications/FEniCS.app/Contents/Resources/lib/python2.7/site-packages/dolfin/compilemodules/jit.py", line 66, in mpi_jit
return local_jit(*args, **kwargs)
File "/Applications/FEniCS.app/Contents/Resources/lib/python2.7/site-packages/dolfin/compilemodules/jit.py", line 102, in jit
raise OSError, "Could not find swig installation. Pass an existing "\
OSError: Could not find swig installation. Pass an existing swig binary or install SWIG version 2.0 or higher.

poisson$

asked Dec 27, 2013 by AN6U5 FEniCS Novice (120 points)
edited Dec 28, 2013 by AN6U5
OSError: Could not find swig installation. Pass an existing swig binary or install SWIG version 2.0 or higher.

Primarily there is a problem with your installation. These issues are being answered at list fenics-support@fenicsproject.org.

For testing functionality and playing around, run rather demos supplied in share/dolfin/demo dir of your installation. These are maintained in working state.

This is actually not a problem with the installation. It is caused by the following line in dolfin_parameters.xml:

<parameter key="swig_binary" type="string" value="swig2.0" />

This will only work on some of the more recent versions of Debian (and derivatives) and it should never have been included in that file. Removing the line should fix the problem.

1 Answer

0 votes

As Jan says, the demo programs that are supplied with your installation run with the given version as described here:

http://fenicsproject.org/documentation/demos.html#finding-demos

The examples in the FEniCS book (and the tutorial) corresponds to FEniCS 1.0.

Changes in the interface between versions are described in the release notes, see:

http://fenicsproject.org/releases/

answered Jan 13, 2014 by Marie E. Rognes FEniCS User (5,380 points)
...