changeset 206:72633d939a81

Remove the documentation. Now the pdf file of the documentation and of the presentation given at MOX are available from the fem-fenics page on the octave wiki.
author gedeone-octave <marcovass89@hotmail.it>
date Fri, 31 Jan 2014 00:32:47 +0100
parents 17b92c718a2b
children b67de1926ed0
files doc/API/BilinearForm.tex doc/API/Constant.tex doc/API/DirichletBC.tex doc/API/Expression.tex doc/API/Function.tex doc/API/FunctionSpace.tex doc/API/Functional.tex doc/API/JacobianForm.tex doc/API/LinearForm.tex doc/API/Mesh.tex doc/API/ResidualForm.tex doc/API/SubSpace.tex doc/API/assemble.tex doc/API/assemble_system.tex doc/API/feval.tex doc/API/import_ufl_BilinearForm.tex doc/API/import_ufl_FunctionSpace.tex doc/API/import_ufl_Functional.tex doc/API/import_ufl_LinearForm.tex doc/API/import_ufl_Problem.tex doc/API/plot.tex doc/API/plot_m.tex doc/API/save.tex doc/Fem-fenics_poisson.png doc/HyperElasticity.png doc/code_layout.png doc/doc.bib doc/doc.pdf doc/doc.tex doc/mesh_1.png doc/presentation/Mox_30_01/Makefile doc/presentation/Mox_30_01/beamerthemeOctave.sty doc/presentation/Mox_30_01/esempi/classe.cc doc/presentation/Mox_30_01/esempi/func.cc doc/presentation/Mox_30_01/esempi/generate_fs.m doc/presentation/Mox_30_01/esempi/import_ufl_FunctionSpace.m doc/presentation/Mox_30_01/fem-library.tex doc/presentation/Mox_30_01/func.png doc/presentation/Mox_30_01/hyper.png doc/presentation/Mox_30_01/inst.png doc/presentation/Mox_30_01/mixed.png doc/presentation/Mox_30_01/ns.png doc/presentation/Mox_30_01/octave-header.png doc/presentation/Mox_30_01/octfem.png doc/presentation/Mox_30_01/pois.png doc/presentation/Mox_30_01/pois2.png doc/presentation/Mox_30_01/wiki.png
diffstat 47 files changed, 0 insertions(+), 3191 deletions(-) [+]
line wrap: on
line diff
--- a/doc/API/BilinearForm.tex	Thu Jan 30 09:14:35 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-% This file was converted from HTML to LaTeX with
-% gnuhtml2latex program
-% (c) Tomasz Wegrzanowski <maniek@beer.com> 1999
-% (c) Gunnar Wolf <gwolf@gwolf.org> 2005-2010
-% Version : 0.4.
-
-
-\par  Function File: [\textit{a}] \textbf{=}\textit{ BilinearForm }(\textit{my\_problem, U, V, coefficient\_1, coefficient\_2,...})\textit{}\\
-\begin{quotation}
-        \par Construct a BilinearForm previously imported from ufl.
-
-        \par The compulsory arguments are:
-          \begin{itemize}
- \item \textit{my\_problem} the name of the problem to solve. 
- \item the FunctionSpace \textit{U} and \textit{V} where the problem is defined. 
- \end{itemize}
-
-        \par The optional arguments are the \textit{coefficient\_1}, \textit{coefficient\_2}
- which specify the parameters for the BilinearForm as stated in the ufl file. 
- They can be either a Constant, a Function or an Expression.
-
-     \par \textbf{See also:} import\_ufl\_BilinearForm, import\_ufl\_Problem, FunctionSpace,
- LinearForm, ResidualForm.
-
-        \end{quotation}
--- a/doc/API/Constant.tex	Thu Jan 30 09:14:35 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-% This file was converted from HTML to LaTeX with
-% gnuhtml2latex program
-% (c) Tomasz Wegrzanowski <maniek@beer.com> 1999
-% (c) Gunnar Wolf <gwolf@gwolf.org> 2005-2010
-% Version : 0.4.
-
-\par  Function File: [\textit{c}] \textbf{=}\textit{ Constant }(\textit{name, value})\textit{}\\
-\begin{quotation}
-        \par Create a constatnt object over all the mesh elements with the value
- specified.
-
-        \par This function takes as input the \textit{name} of the Constant that has
- to be created and its \textit{value}, which can be either a scalar or a vector.
-
-     \par \textbf{See also:} Expression, Function.
-
-        \end{quotation}
--- a/doc/API/DirichletBC.tex	Thu Jan 30 09:14:35 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-% This file was converted from HTML to LaTeX with
-% gnuhtml2latex program
-% (c) Tomasz Wegrzanowski <maniek@beer.com> 1999
-% (c) Gunnar Wolf <gwolf@gwolf.org> 2005-2010
-% Version : 0.4.
-
-\par  Function File: [\textit{bc}] \textbf{=}\textit{ DirichletBC }(\textit{FunctionSpace, Boundary\_Label, Function\_handle})\textit{}\\
-\begin{quotation}\par Specify essential boundary condition on a specific side. 
-The input parameters are
-          \begin{itemize}
-\item \textit{FunctionSpace} is the fem-fenics space where we want to apply the BC
-\item \textit{Function\_handle} is a function handle which contains the expression that we want to apply as a BC. If we have a Vector field, we can just use a
-vector of function handles: \textit{Function handle} = [@(x, y) f1, @(x, y) f2, ...] 
-\item \textit{Boundary\_Label} is an Array which contains the label(s) of the side(s) where the BC has to be applied. 
-\end{itemize}
-        The output \textit{bc} is an object which contains the boundary conditions
-
-     \par \textbf{See also:} Mesh, FunctionSpace.
-
-        \end{quotation}
-
--- a/doc/API/Expression.tex	Thu Jan 30 09:14:35 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-% This file was converted from HTML to LaTeX with
-% gnuhtml2latex program
-% (c) Tomasz Wegrzanowski <maniek@beer.com> 1999
-% (c) Gunnar Wolf <gwolf@gwolf.org> 2005-2010
-% Version : 0.4.
-
-
-\par  Function File: [\textit{f}] \textbf{=}\textit{ Expression }(\textit{name, Function\_handle})\textit{}\\
-\begin{quotation}\par Create an object with the value specified as a function handle. 
-The input parameters are
-          \begin{itemize}
-\item \textit{name} is the name of the coefficient as it is declared in the ufl file
-\item \textit{Function\_handle} is a function handle which specify the expression to apply for our coefficient
-\end{itemize}
-        The output \textit{f} is an object which contains a representation of the function
-
-     \par \textbf{See also:} Constant, Function.
-
-        \end{quotation}
--- a/doc/API/Function.tex	Thu Jan 30 09:14:35 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-% This file was converted from HTML to LaTeX with
-% gnuhtml2latex program
-% (c) Tomasz Wegrzanowski <maniek@beer.com> 1999
-% (c) Gunnar Wolf <gwolf@gwolf.org> 2005-2010
-% Version : 0.4.
-
-
-\par  Function File: [\textit{func}] \textbf{=}\textit{ Function }(\textit{name, FunctionSpace }(\textit{or Function})\textit{,Vector }(\textit{or index}))\textit{}\\
-\begin{quotation}\par Initialize an object with the values specified in a vector or extracting a component from a vectorial field. 
-This function can be used in two different ways
-          \begin{itemize}
-\item To create a function from a vector. In this case, the arguments are:
-               \begin{itemize}
-\item \textit{name} is a string representing the name of the function
-\item \textit{FunctionSpace} is the fem-fenics function space where the vector is defined
-\item \textit{Vector} specifies the values of the coefficients for each basic function of the \textit{FunctioSpace}
-\end{itemize}
-          \item To extract a scalar field from a vectorial one
-               \begin{itemize}
-\item \textit{name} is a string representing the name of the function
-\item \textit{Function} is the vector valued Function
-\item \textit{Index} contains the index of the scalar field to extract.Index starts from 1. 
-\end{itemize}
-          \end{itemize}
-        The output \textit{func} is an object which contains a representation of the function \textit{Vector} which can be plotted or saved or passed as argument for a variational problem.
-
-     \par \textbf{See also:} Constant, Expression, plot, save.
-
-        \end{quotation}
-
--- a/doc/API/FunctionSpace.tex	Thu Jan 30 09:14:35 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-% This file was converted from HTML to LaTeX with
-% gnuhtml2latex program
-% (c) Tomasz Wegrzanowski <maniek@beer.com> 1999
-% (c) Gunnar Wolf <gwolf@gwolf.org> 2005-2010
-% Version : 0.4.
-
-\par  Function File: \textit{V} \textbf{=}\textit{ FunctionSpace }(\textit{myproblem, mesh})\textit{}\\
-\begin{quotation}
-        \par Generate a FunctionSpace on a specific mesh.
-
-        \par This function takes as input the name \textit{myproblem} of the ufl file where
- the FunctionSpace is defined and the \textit{mesh} where it has to be
- created.
-
-     \par \textbf{See also:} FunctionSpace, SubSpace, import\_ufl\_FunctionSpace.
-
-        \end{quotation}
-
--- a/doc/API/Functional.tex	Thu Jan 30 09:14:35 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-% This file was converted from HTML to LaTeX with
-% gnuhtml2latex program
-% (c) Tomasz Wegrzanowski <maniek@beer.com> 1999
-% (c) Gunnar Wolf <gwolf@gwolf.org> 2005-2010
-% Version : 0.4.
-
-
-\par  Function File: [\textit{L}] \textbf{=}\textit{ Functional }(\textit{my\_problem, U, coefficient\_1, coefficient\_2,...})\textit{}\\
-\begin{quotation}
-        \par Construct a Functional previously imported from a ufl file.
-
-        \par The compulsory arguments are:
-          \begin{itemize}
- \item \textit{my\_problem} the name of the problem to solve. 
- \item the FunctionSpace \textit{U} where the problem is defined. 
- \end{itemize}
-
-        \par The optional arguments are the \textit{coefficient\_1}, \textit{coefficient\_2}
- which specify the parameters for the Functional with the same name which
- was used in the ufl file. 
- They can be either a Constant, a Function or an Expression.
-
-     \par \textbf{See also:} import\_ufl\_Functional, LinearForm, ResidualForm, BilinearForm.
-
-        \end{quotation}
--- a/doc/API/JacobianForm.tex	Thu Jan 30 09:14:35 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-
-\par  Function File: [\textit{J}] \textbf{=}\textit{ Functional }(\textit{my\_problem, U, V, coefficient\_1, coefficient\_2,...})\textit{}\\
-\begin{quotation}
-        \par Construct a JacobianForm previously imported from a ufl file with the
- function import\_ufl\_BilinearForm.
-
-        \par The compulsory arguments are:
-          \begin{itemize}
- \item \textit{my\_problem} the name of the problem to solve. 
- \item the FunctionSpace \textit{U} and \textit{V} where the problem is defined. 
- \end{itemize}
-
-        \par The optional arguments are the \textit{coefficient\_1}, \textit{coefficient\_2}
- which specify the parameters for the JacobianForm with the same name which
- was used in the ufl file. 
- They can be either a Constant, a Function or an Expression.
-
-     \par \textbf{See also:} import\_ufl\_BilinearForm, LinearForm, ResidualForm, BilinearForm.
-
-        \end{quotation}
--- a/doc/API/LinearForm.tex	Thu Jan 30 09:14:35 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-% This file was converted from HTML to LaTeX with
-% gnuhtml2latex program
-% (c) Tomasz Wegrzanowski <maniek@beer.com> 1999
-% (c) Gunnar Wolf <gwolf@gwolf.org> 2005-2010
-% Version : 0.4.
-
-\par  Function File: [\textit{L}] \textbf{=}\textit{ LinearForm }(\textit{my\_problem, U, coefficient\_1, coefficient\_2,...})\textit{}\\
-\begin{quotation}
-        \par Construct a Functional previously imported from a ufl file.
-
-        \par The compulsory arguments are:
-          \begin{itemize}
- \item \textit{my\_problem} the name of the problem to solve. 
- \item the FunctionSpace \textit{U} where the problem is defined. 
- \end{itemize}
-
-        \par The optional arguments are the \textit{coefficient\_1}, \textit{coefficient\_2}
- which specify the parameters for the LinearForm with the same name which
- was used in the ufl file. 
- They can be either a Constant, a Function or an Expression.
-
-     \par \textbf{See also:} import\_ufl\_LinearForm, import\_ufl\_Problem, BilinearForm,
- ResidualForm, BilinearForm.
-
-        \end{quotation}
-
-
--- a/doc/API/Mesh.tex	Thu Jan 30 09:14:35 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-% This file was converted from HTML to LaTeX with
-% gnuhtml2latex program
-% (c) Tomasz Wegrzanowski <maniek@beer.com> 1999
-% (c) Gunnar Wolf <gwolf@gwolf.org> 2005-2010
-% Version : 0.4.
-
-\par  Function File: [\textit{mesh\_out}] \textbf{=}\textit{ Mesh }(\textit{mesh\_in})\textit{}\\
-\begin{quotation}\par Construct a mesh from file or from (p, e, t) format. 
-The \textit{mesh\_in} should be either
-          \begin{itemize}
-\item a string containing the name of the file where the mesh is stored in .xml file
-If the file is not a .xml file you can try to use the command dolfin-convert directly from the terminal. 
-\item a PDE-tool like structure with matrix fields (p,e,t)\end{itemize}
-        The output \textit{mesh\_out} is a representation of the \textit{mesh\_in} which is compatible with fem-fenics. 
-The easiest way for dealing with meshes is using the msh pkg.
-
-     \par \textbf{See also:} FunctionSpace.
-
-        \end{quotation}
\ No newline at end of file
--- a/doc/API/ResidualForm.tex	Thu Jan 30 09:14:35 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-
-
-\par  Function File: [\textit{L}] \textbf{=}\textit{ LinearForm }(\textit{my\_problem, U, coefficient\_1, coefficient\_2,...})\textit{}\\
-\begin{quotation}
-        \par Construct a ResidualForm previously imported from a ufl file with the
- function import\_ufl\_LinearForm.
-
-        \par The compulsory arguments are:
-          \begin{itemize}
- \item \textit{my\_problem} the name of the problem to solve. 
- \item the FunctionSpace \textit{U} where the problem is defined. 
- \end{itemize}
-
-        \par The optional arguments are the \textit{coefficient\_1}, \textit{coefficient\_2}
- which specify the parameters for the ResidualForm with the same name which
- was used in the ufl file. 
- They can be either a Constant, a Function or an Expression.
-
-     \par \textbf{See also:} import\_ufl\_LinearForm, import\_ufl\_Problem, BilinearForm,
- ResidualForm, BilinearForm.
-
-        \end{quotation}
--- a/doc/API/SubSpace.tex	Thu Jan 30 09:14:35 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-% This file was converted from HTML to LaTeX with
-% gnuhtml2latex program
-% (c) Tomasz Wegrzanowski <maniek@beer.com> 1999
-% (c) Gunnar Wolf <gwolf@gwolf.org> 2005-2010
-% Version : 0.4.
-
-\par  Function File: [\textit{V1}] \textbf{=}\textit{ SubSpace }(\textit{V, index})\textit{}\\
-\begin{quotation}\par Extract a SubSpace from an object of type FunctionSpace. 
-The input arguments are
-          \begin{itemize}
-\item \textit{V} which is a FunctionalSpace
-\item \textit{index} is a positive integer number which represents the SubSpace which has to be extracted. 
-\end{itemize}
-        The output \textit{V1} is the SubSpace needed.
-
-     \par \textbf{See also:} FunctionSpace.
-
-        \end{quotation}
--- a/doc/API/assemble.tex	Thu Jan 30 09:14:35 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-% This file was converted from HTML to LaTeX with
-% gnuhtml2latex program
-% (c) Tomasz Wegrzanowski <maniek@beer.com> 1999
-% (c) Gunnar Wolf <gwolf@gwolf.org> 2005-2010
-% Version : 0.4.
-
-\par  Function File: [\textit{A}], [\textit{x}(Optional)] \textbf{=}\textit{ assemble }(\textit{form\_a, DirichletBC})\textit{}\\
-\begin{quotation}\par Construct the discretization of a Form and apply essential BC. 
-The input arguments are
-          \begin{itemize}
-\item \textit{form\_a} which is the form to assemble. 
-It can be a form of rank 2 (BilinearForm or JacobianForm), a form of rank 1 (LinearForm or ResidualForm) or a form of rank 0 (Functional). 
-\item \textit{DirichletBC} represents the optional BC applied to the system. 
-\end{itemize}
-        The output \textit{A} is a discretized representation of the \textit{form\_a}:
-          \begin{itemize}
-\item \textit{A} is a sparse Matrix if \textit{form\_a} is a bilinear form
-\item \textit{A} is a Vector if \textit{form\_a} is a linear form
-\item \textit{A} is a Double if \textit{form\_a} is a functional
-\end{itemize}
-        If a boundary condition has to be applied to a vector for a nonlinear problem then it should be provided as 2nd argument and it will be given back as the second output argument. For an example of this situation, please refer to the HyperElasticity example.
-
-     \par \textbf{See also:} BilinearForm, LinearForm, ResidualForm, JacobianForm, Functional.
-
-        \end{quotation}
-
--- a/doc/API/assemble_system.tex	Thu Jan 30 09:14:35 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-% This file was converted from HTML to LaTeX with
-% gnuhtml2latex program
-% (c) Tomasz Wegrzanowski <maniek@beer.com> 1999
-% (c) Gunnar Wolf <gwolf@gwolf.org> 2005-2010
-% Version : 0.4.
-
-\par  Function File: [\textit{A}], [\textit{b}], [\textit{x}(Optional)] \textbf{=}\textit{ assemble\_system }(\textit{form\_a, form\_L, DirichletBC})\textit{}\\
-\begin{quotation}\par Construct the discretization of a system and apply essential BC. 
-The input arguments are
-          \begin{itemize}
-\item \textit{form\_a} which is the BilinearForm to assemble. 
-\item \textit{form\_L} which is the LinearForm to assemble. 
-\item \textit{DirichletBC} represents the optional BC applied to the system. 
-\end{itemize}
-        The output \textit{A} is a matrix representing the \textit{form\_a} while \textit{b} represents \textit{form\_L}. 
-If boundary conditions have to be applied to a vector for a nonlinear problem then it should be provide as 3rd argument and it will be given back as the 3rd output argument. For an example of this situation, please refer to the HyperElasticity example.
-
-     \par \textbf{See also:} BilinearForm, LinearForm, ResidualForm, JacobianForm, Functional.
-
-        \end{quotation}
-
--- a/doc/API/feval.tex	Thu Jan 30 09:14:35 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-% This file was converted from HTML to LaTeX with
-% gnuhtml2latex program
-% (c) Tomasz Wegrzanowski <maniek@beer.com> 1999
-% (c) Gunnar Wolf <gwolf@gwolf.org> 2005-2010
-% Version : 0.4.
-
-\par  Function File: [\textit{value}] \textbf{=}\textit{ feval }(\textit{function\_name, Coordinate})\textit{}\\
-\begin{quotation}\par Evaluate a function at a specific point of the domain and return the value. 
-The input parameters are the function and the point where it has to be evaluated.
-
-     \par \textbf{See also:} Function.
-
-        \end{quotation}
-
--- a/doc/API/import_ufl_BilinearForm.tex	Thu Jan 30 09:14:35 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-% This file was converted from HTML to LaTeX with
-% gnuhtml2latex program
-% (c) Tomasz Wegrzanowski <maniek@beer.com> 1999
-% (c) Gunnar Wolf <gwolf@gwolf.org> 2005-2010
-% Version : 0.4.
-
-
-
-\par  Function File:  \textbf{=}\textit{ import\_ufl\_BilinearForm }(\textit{myproblem})\textit{}\\
-\begin{quotation}\par  Import a BilinearForm from a ufl file.
-
-        \par \textit{myproblem} is the name of the ufl file where
- the BilinearForm is defined.
-
-        \par This function creates in the pwd a file called
- \textit{myproblem\_BilinearForm.oct}.
-
-     \par \textbf{See also:} import\_ufl\_Problem, FunctionSpace, BilinearForm, LinearForm,
- Functional.
-
-        \end{quotation}
--- a/doc/API/import_ufl_FunctionSpace.tex	Thu Jan 30 09:14:35 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-% This file was converted from HTML to LaTeX with
-% gnuhtml2latex program
-% (c) Tomasz Wegrzanowski <maniek@beer.com> 1999
-% (c) Gunnar Wolf <gwolf@gwolf.org> 2005-2010
-% Version : 0.4.
-
-
-\par  Function File:  \textbf{=}\textit{ import\_ufl\_FunctionSpace }(\textit{myproblem})\textit{}\\
-\begin{quotation}\par  Import a FunctionSpace from a ufl file.
-
-        \par \textit{myproblem} is the name of the ufl file where
- the FunctionSpace is defined. This function creates in the pwd a file
- called \textit{myproblem\_FunctionSpace.oct}.
-
-     \par \textbf{See also:} import\_ufl\_Problem, FunctionSpace, BilinearForm, LinearForm,
- Functional.
-
-        \end{quotation}
-
--- a/doc/API/import_ufl_Functional.tex	Thu Jan 30 09:14:35 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-% This file was converted from HTML to LaTeX with
-% gnuhtml2latex program
-% (c) Tomasz Wegrzanowski <maniek@beer.com> 1999
-% (c) Gunnar Wolf <gwolf@gwolf.org> 2005-2010
-% Version : 0.4.
-
-
-
-\par  Function File:  \textbf{=}\textit{ import\_ufl\_Functional }(\textit{myproblem})\textit{}\\
-\begin{quotation}\par  Import a Functional from a ufl file.
-
-        \par \textit{myproblem} is the name of the ufl file where
- the Functional is defined. This function creates in the pwd a file
- called \textit{myproblem\_Functional.oct}.
-
-     \par \textbf{See also:} import\_ufl\_Problem, FunctionSpace, BilinearForm, LinearForm,
- Functional.
-
-        \end{quotation}
-
--- a/doc/API/import_ufl_LinearForm.tex	Thu Jan 30 09:14:35 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-% This file was converted from HTML to LaTeX with
-% gnuhtml2latex program
-% (c) Tomasz Wegrzanowski <maniek@beer.com> 1999
-% (c) Gunnar Wolf <gwolf@gwolf.org> 2005-2010
-% Version : 0.4.
-
-
-\par  Function File:  \textbf{=}\textit{ import\_ufl\_LinearForm }(\textit{myproblem})\textit{}\\
-\begin{quotation}\par  Import a LinearForm from a ufl file.
-
-        \par \textit{myproblem} is the name of the ufl file where
- the LinearForm is defined. This function creates in the pwd a file
- called \textit{myproblem\_LinearForm.oct}.
-
-     \par \textbf{See also:} import\_ufl\_Problem, FunctionSpace, BilinearForm, LinearForm,
- Functional.
-
-        \end{quotation}
-
--- a/doc/API/import_ufl_Problem.tex	Thu Jan 30 09:14:35 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-% This file was converted from HTML to LaTeX with
-% gnuhtml2latex program
-% (c) Tomasz Wegrzanowski <maniek@beer.com> 1999
-% (c) Gunnar Wolf <gwolf@gwolf.org> 2005-2010
-% Version : 0.4.
-
-\par  Function File:  \textbf{=}\textit{ import\_ufl\_Problem }(\textit{myproblem})\textit{}\\
-\begin{quotation}\par  Import a Variational Problem from a ufl file.
-
-        \par \textit{myproblem} is the name of the ufl file where
- the BilinearForm, the LinearForm and the FunctionSpace are defined.
-
-     \par \textbf{See also:} import\_ufl\_BilinearForm, FunctionSpace, BilinearForm, LinearForm,
- Functional.
-
-        \end{quotation}
-
--- a/doc/API/plot.tex	Thu Jan 30 09:14:35 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-% This file was converted from HTML to LaTeX with
-% gnuhtml2latex program
-% (c) Tomasz Wegrzanowski <maniek@beer.com> 1999
-% (c) Gunnar Wolf <gwolf@gwolf.org> 2005-2010
-% Version : 0.4.
-
-\par  Function File: plot \textbf{(}\textit{Function})\textit{}\\
-\begin{quotation}\par Plot a Function.
-
-     \par \textbf{See also:} Function, Save.
-
-        \end{quotation}
-   
--- a/doc/API/plot_m.tex	Thu Jan 30 09:14:35 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-% This file was converted from HTML to LaTeX with
-% gnuhtml2latex program
-% (c) Tomasz Wegrzanowski <maniek@beer.com> 1999
-% (c) Gunnar Wolf <gwolf@gwolf.org> 2005-2010
-% Version : 0.4.
-
-\par  Function File: plot \textbf{(}\textit{Mesh, Nodal\_Values}(\textit{OPTIONAL}))\textit{}\\
-\begin{quotation}\par Plot a Mesh. 
-The input parameter is the Mesh and optionally also a vector representing the values of a function at each node.
-
-     \par \textbf{See also:} Mesh, save.
-
-        \end{quotation}
--- a/doc/API/save.tex	Thu Jan 30 09:14:35 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-% This file was converted from HTML to LaTeX with
-% gnuhtml2latex program
-% (c) Tomasz Wegrzanowski <maniek@beer.com> 1999
-% (c) Gunnar Wolf <gwolf@gwolf.org> 2005-2010
-% Version : 0.4.
-
-\par  Function File: fem\_save \textbf{(}\textit{Function, Name})\textit{}\\
-\begin{quotation}\par Save a function in vtu format. 
-The input parameters are
-          \begin{itemize}
-\item \textit{Function} is the function that you want to save
-\item \textit{Name} is a string for the output name
-\end{itemize}
-        The output is a file in format .vtu
-
-     \par \textbf{See also:} plot, Function.
-
-        \end{quotation}
\ No newline at end of file
Binary file doc/Fem-fenics_poisson.png has changed
Binary file doc/HyperElasticity.png has changed
Binary file doc/code_layout.png has changed
--- a/doc/doc.bib	Thu Jan 30 09:14:35 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
-\begin{thebibliography}{9}
-
-
-@Unpublished{ufl,
- title = {\url{http://fenicsproject.org/documentation/ufl/1.2.0/user/user_manual.html}},
-}
-
-@Unpublished{instfenics,
- title = {\url{http://fenicsproject.org/download/}},
-}
-
-@Unpublished{instoctave,
- title = {\url{http://www.gnu.org/software/octave/download.html}},
-}
-
-@Unpublished{msh,
- title = {\url{http://octave.sourceforge.net/msh/index.html}},
-}
-
-@Unpublished{fpl,
- title = {\url{http://octave.sourceforge.net/fpl/index.html}},
-}
-
-@Unpublished{secs1d,
- title = {\url{http://octave.sourceforge.net/secs1d/index.html}},
-}
-
-@Unpublished{bim,
- title = {\url{http://octave.sourceforge.net/bim/index.html}},
-}
-
-@Unpublished{api,
- title = {\url{http://octave.sourceforge.net/fem-fenics/overview.html}},
-}
-
-@Unpublished{meshfunction,
- title = {\url{http://fenicsproject.org/documentation/dolfin/1.2.0/cpp/programmers-reference/mesh/MeshFunction.html}},
-}
-
-@Unpublished{meshvalue,
- title = {\url{http://fenicsproject.org/documentation/dolfin/1.2.0/cpp/programmers-reference/mesh/MeshValueCollection.html}},
-}
-
-@Unpublished{meshdomain,
- title = {\url{http://fenicsproject.org/documentation/dolfin/1.2.0/cpp/programmers-reference/mesh/MeshDomain.html}},
-}
-
-@Unpublished{meshdata,
- title = {\url{http://fenicsproject.org/documentation/dolfin/1.2.0/cpp/programmers-reference/mesh/MeshData.html}},
-}
-
-@Unpublished{whatoctave,
- title = {\url{http://jordi.platinum.linux.pl/octave/what-is-octave.pdf}},
-}
-
-@Unpublished{refine,
- title = {\url{http://gedeone-gsoc.blogspot.co.uk/2013/06/update-4.html}},
-}
-
-@Unpublished{mixedpois,
- title = {\url{http://fenicsproject.org/documentation/dolfin/1.2.0/python/demo/pde/mixed-poisson/python/documentation.html}},
-}
-
-@Unpublished{navierstokes,
- title = {\url{http://fenicsproject.org/documentation/dolfin/1.2.0/python/demo/pde/navier-stokes/python/documentation.html}},
-}
-
-@Unpublished{hyperelasticity,
- title = {\url{http://fenicsproject.org/documentation/dolfin/1.2.0/python/demo/pde/hyperelasticity/python/documentation.html}},
-}
-
-
-@Article{Formaggia_smart,
- author = {Formaggia, Luca},
- title = {Advanced Programming for Scientific Computing. Lecture title: Smart Pointers},
- year = {2012},
-}
-
-@Article{Formaggia_matr,
- author = {Formaggia, Luca},
- title = {Advanced Programming for Scientific Computing. Lecture title: Storing techniques for sparse matrices},
- year = {2012},
-}
-
-@book{logg2012automated,
-  title={Automated solution of differential equations by the finite element method: The fenics book},
-  author={Logg, Anders and Mardal, Kent-Andre and Wells, Garth},
-  volume={84},
-  year={2012},
-  publisher={Springer}
-}
-
-\end{thebibliography} 
\ No newline at end of file
Binary file doc/doc.pdf has changed
--- a/doc/doc.tex	Thu Jan 30 09:14:35 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2175 +0,0 @@
-\documentclass[a4paper,11pt]{book}
-\usepackage[utf8x]{inputenc}
-\usepackage{graphicx}
-\usepackage{amsmath}
-\usepackage{amssymb}
-\usepackage{caption}
-\usepackage{subcaption}
-\usepackage{cclicenses}
-\usepackage{url}
-\usepackage{listings}
-\usepackage{hyperref}
-\usepackage{listings}
-\usepackage[cmyk]{xcolor}
-\usepackage{import}
-\usepackage[english]{babel}
-\usepackage[T1]{fontenc}
-\usepackage[framemethod=TikZ]{mdframed}
-\usepackage{parcolumns}
-\usepackage[strict]{changepage}
-
-\definecolor{dkgreen}{rgb}{0,0.6,0}
-\definecolor{gray}{rgb}{0.5,0.5,0.5}
-\definecolor{mauve}{rgb}{0.58,0,0.82}
-\definecolor{BlueLUH}{cmyk}{1.0,0.7,0,0}
-\colorlet{LightBlue}{BlueLUH!7!white}
-\lstset{
-  backgroundcolor=\color{LightBlue},
-  basicstyle={\small\ttfamily},
-  language=C++,
-  aboveskip=3mm,
-  belowskip=3mm,
-  showstringspaces=false,
-  columns=flexible,
-  numbers=left,
-  numberstyle=\tiny\color{gray},
-  keywordstyle=\color{blue},
-  commentstyle=\color{dkgreen},
-  stringstyle=\color{mauve},
-  breaklines=true,
-  breakatwhitespace=true
-  tabsize=2
-}
-
-\def\changemargin#1#2{\list{}{\rightmargin#2\leftmargin#1}\item[]}
-\let\endchangemargin=\endlist
-\begin{document}
-
-\begin{titlepage}
-\begin{center}
-
-% Upper part of the page. The '~' is needed because \\
-% only works if a paragraph has started.
-
-\textsc{\LARGE Google Summer of Code 2013}\\[0.5cm]
-
-\textsc{\Large GNU-Octave}\\[2.5cm]
-
-%\includegraphics[width=1.\textwidth]{./octave-header.png}~\\[1.5cm]
-
-{ \huge \bfseries Fem-fenics \\[0.5cm] }
-{ \Large \bfseries Genaral Purpose Finite Element Library for GNU-Octave \\[2.4cm] }
-% Author and supervisor
-%\begin{minipage}{0.4\textwidth}
-%\begin{flushleft} \large
-%\emph{Author:}\\
-Marco \textsc{Vassallo}\\[0.5cm]
-%matr. 780787
-%\end{flushleft}
-%\end{minipage}
-%\begin{minipage}{0.4\textwidth}
-%\begin{flushright} \large
-%\emph{Supervisor:} \\
-%Dr.~Carlo \textsc{de Falco}
-%\end{flushright}
-%\end{minipage}
-
-\vfill
-
-% Bottom of the page
-{\large Version 0.0 \\[0.5cm]}
-{\large \today}
-
-\end{center}
-\end{titlepage}
-
-\frontmatter
-
-\tableofcontents
-
-\mainmatter
-
-\chapter{Introduction}
-Fem-fenics is an open source package (pkg) for the resolution of partial differential equations with Octave.
-The project has been developed during the Google Summer of Code 2013 with the help and the sustain of the GNU-Octave 
-community under the supervision of prof. De Falco.
-
-The report is structured as follows:
-\begin{itemize}
-  \item in chapter \ref{intr} we provide a simple reference guide for beginners
-  \item in chapter \ref{impl} is presented a detailed explanation of the relevant parts of the program. In this way, the 
-  interested reader can see what there is ``behind'' and expecially anyone interested in it can learn quickly how
-  it is possible to extend the code and contribute to the project.
-  \item in chapter \ref{exem} more examples are provided. For a lot of them, we present the octave script 
-  alongside the code for Fenics (in C++ and/or Python) in order to provide the user with a quick reference
-  guide.
-\end{itemize}
-
-If you think that going inside the report could be boring, it is available a wiki at
-\begin{center}
-\url{http://wiki.octave.org/Fem-fenics}
-\end{center}
-while if you want to see how the project has grown during the time you can give a look at
-\begin{center}
-\url{http://gedeone-gsoc.blogspot.com/}
-\end{center}
-The API is available as Appendix \ref{app} but also at the following address
-\begin{center}
-\url{http://octave.sourceforge.net/fem-fenics/overview.html}
-\end{center}
-and if you would like to contribute to the project or give a look to the source code
-you can clone it from the following repository using Mercurial
-\begin{center}
-\url{http://sourceforge.net/p/octave/fem-fenics/} .
-\end{center}
-The pkg is provided with an example function \texttt{femfenics\_examples} 
-which allows the user to select and run one of the examples provided with the pkg.
-
-\chapter{Introduction to Fem-fenics}\label{intr} 
-
-\section{Installation}
-Fem-fenics is an external package for Octave, which means that it can be installed only once that Octave has been
-successfully installed  on the PC. Furthermore, as Fem-fenics is based on Fenics,
-it is also needed a running version of the latter. They can be easily installed following the guidelines provided
-on the official Octave \cite{instoctave} and Fenics \cite{instfenics} websites.
-Once that Octave and Fenics are correctly installed, to install Fem-fenics open Octave (which now is provided with a new
-amazing GUI) and type
-
-\begin{verbatim}
- >> pkg install fem-fenics -forge
-\end{verbatim}
-
-That's all! For any problem during the installation don't hesitate to contact us.
-To be sure that everything is working fine, load the fem-fenics pkg and run
-one of the examples provided within the package:
-
-\begin{verbatim}
- >> pkg load fem-fenics
- >> femfenics_examples()
-\end{verbatim}
-
-For a description of the examples, look at chapter \ref{exem}.
-
-
-\paragraph*{NOTE} For completing the installation process successfully,
-the form compiler FFC and the header file dolfin.h should also be available on the machine.
-They are managed automatically by Fenics if it is installed as a binary package or with Dorsal.
-If it has been done manually, please be sure that they are available before starting the
-installation of Fem-fenics.
-
-\section{General layout and first example}\label{genlayout}
-
-A generic problem has to be solved in two steps:
-\begin{enumerate}
-\item a \textbf{.ufl file} where the abstract problem is described: this file has to be written in Unified Form Language (UFL),
-       which is a domain specific language for defining discrete variational forms and functionals in a notation 
-       close to pen-and-paper formulation. UFL is easy to learn, and the User manual provides explanations
-       and examples \cite{ufl}.
-\item a script file \textbf{.m} where the abstract problem is imported and a specific problem is implemented and solved:
-      this is the script file where the fem-fenics functions described in the following chapters are used.
-\end{enumerate}
-
-We provide immediately a simple example in order to familiarize the user with the code.
-
-\paragraph{The Poisson equation}
-In this example, we show how it is possible to solve the Poisson equation with mixed Boundary Conditions.
-If we indicate with $\Omega$ the domain and with $\Gamma = \Gamma_{N} \cup \Gamma_{D}$ the
-boundaries, the problem can be expressed as
-\begin{align*}
-  \Delta u &= f \qquad \text{on } \Omega \\
-  u &= 0 \qquad \text{on } \Gamma_{D} \\
-  \nabla u \cdot n &= g \qquad \text{on } \Gamma_{N}
-\end{align*}
-where $f, \, g$ are data which represent the source and the flux
-of the scalar variable $u$.
-A possible variational formulation of the problem is: \\
-find $u \in H_{0, \Gamma_{D}}^{1} :$
-\begin{align*}
-  a(u, v) &= L(v) \qquad \forall v \in H_{0, \Gamma_{D}}^{1} \\
-  a(u, v) &= \int_{\Omega} \nabla u \cdot \nabla v \\
-  L(v)    &= \int_{\Omega} f v + \int_{\Gamma_{N}} g v \\
-\end{align*}
-
-The abstract problem can thus be written in the \verb|Poisson.ufl| file immediately.
-The only thing that has to be specified at this stage is the space of Finite Elements
-used for the discretization of $H_{0, \Gamma_{D}}^{1}$. In this example,
-we choose the space of continuous lagrangian polynomial of degree one
-\begin{lstlisting}[numbers=none]
- FiniteElement("Lagrange", triangle, 1)
-\end{lstlisting}
-but many more possibilities are available.
-\subparagraph{Poisson.ufl}
-
-\begin{lstlisting}
-element = FiniteElement("Lagrange", triangle, 1)
-
-u = TrialFunction(element)
-v = TestFunction(element)
-
-f = Coefficient(element)
-g = Coefficient(element)
-
-a = inner(grad(u), grad(v))*dx
-L = f*v*dx + g*v*ds
-\end{lstlisting}
-
-It is always a good idea to check if the ufl code is correctly written before importing it into Octave. Typing
-\begin{lstlisting}[numbers=none, language = Octave]
- >> ffc -l dolfin Poisson.ufl
-\end{lstlisting} 
-in the shell shouldn't produce any error.
-
-We can now implement and solve a specific instance of the Poisson problem with Octave.
-The parameters are set as follow
-\begin{itemize}
- \item $\Omega = [0, 1]\times[0, 1]$
- \item $\Gamma_{D} = {(0, y) \cup(1, y)} \ \subset \partial\Omega$
- \item $\Gamma_{N} = {(x, 0) \cup(x, 1)} \ \subset \partial\Omega$
- \item $f = 10 \exp \dfrac{(x-0.5)^{2} + (y-0.5)^{2}}{0.02}$
- \item $g = \sin(5x)$
-\end{itemize}
-
-As a first thing we need to load into Octave the pkgs previously installed
-\begin{lstlisting}[numbers=none, language = Octave]
-    pkg load fem-fenics msh
-\end{lstlisting}
-The ufl file can thus be imported inside Octave. For every specific element defined inside the ufl file
-there is a specific function which stores it for later use
-\begin{itemize}
-    \item \verb$ufl_import_FunctionSpace ('Poisson')$ is a function which looks for the finite element 
-    space defined inside the file called Poisson.ufl; if everything is ok, it generates a function
-    which we will use later
-    \item \verb$ufl_import_BilinearForm ('Poisson')$ is a function which looks for the rhs of the 
-    equation, i.e. for the bilinear form defined inside Poisson.ufl
-    \item \verb$ufl_import_LinearForm ('Poisson')$ is a function which looks for the linear 
-    form.
-\end{itemize}
-
-In some cases one could be interested in using these functions separately but if, 
-as in our example, all the three elements are defined in the same ufl file (and only in this case), 
-the \verb$import_ufl_Problem ('Poisson')$ can be used, which generates at once all 
-the three functions described above
-
-\begin{lstlisting}[numbers=none, language = Octave]
-    ufl_import_Problem ('Poisson');
-\end{lstlisting}
-
-To set the concrete elements which define the problem, 
-the first things to do is to create a mesh. 
-It can be managed easily using the msh pkg. For a structured squared mesh
-\begin{lstlisting}[numbers=none, language = Octave]
-    x = y = linspace (0, 1, 33);
-    msho = msh2m_structured_mesh (x, y, 1, 1:4);
-\end{lstlisting}
-Once that the mesh is available, we can thus initialize the 
-Fem-fenics mesh using the function \verb$Mesh ()$:
-\begin{lstlisting}[numbers=none, language = Octave]
-    mesh = Mesh (msho);
-\end{lstlisting}
-
-To initialize the functional space, we have to specify as argument only the fem-fenics mesh,
-because the finite element type and the polynomial degree have already been specified in the ufl file:
-\begin{lstlisting}[numbers=none, language = Octave]
-    V = FunctionSpace('Poisson', mesh);
-\end{lstlisting}
-Essential BC can now be applied using \verb$DirichletBC ()$; this function receives as argument the functional space,
-a function handle which specifies the value to set, and the label of the sides where the BC applies.
-In this case, homogenous boundary conditions hold on the left and right side of the square
-\begin{lstlisting}[numbers=none, language = Octave]
-    bc = DirichletBC(V, @(x, y) 0.0, [2; 4]);
-\end{lstlisting}
-The last thing to do before solving the problem, is to set the coefficients specified
-in the ufl file. 
-To set them, the function \verb$Expression ()$ can be used passing as argument a string 
-which specifies the name of the coefficient
-(it is important that they are called in the same way as in the ufl file: 
-the source term 'f' and the normal flux 'g'),
-and a function handle with the value prescribed:
-\begin{lstlisting}[numbers=none, language = Octave]
-    ff = Expression ('f', 
-          @(x,y) 10*exp(-((x - 0.5)^2 + (y - 0.5)^2) / 0.02));
-    gg = Expression ('g', @(x,y) sin (5.0 * x));
-\end{lstlisting}
-Another possibility for dealing with the coefficients defined in the ufl file would be to use 
-the function \verb$Constant ()$ or \verb$Function ()$.
-The coefficients can thus be used together with the FunctionSpace to set 
-the Bilinear and the Linear form
-\begin{lstlisting}[numbers=none, language = Octave]
-    a = BilinearForm ('Poisson', V, V);
-    L = LinearForm ('Poisson', V, ff, gg);
-\end{lstlisting}
-The discretized representation of our operator is obtained using the 
-functions \verb$assemble ()$ or \verb$assemble_system ()$, which also allow
-to specify the BC(s) to apply
-\begin{lstlisting}[numbers=none, language = Octave]
-    [A, b] = assemble_system (a, L, bc);
-\end{lstlisting}
-Here A is a sparse matrix and b is a column vector. All the 
-functionalities available within Octave can now be exploited to solve the linear system. 
-The easisest possibility is the backslash command:
-\begin{lstlisting}[numbers=none, language = Octave]
-    u = A \ b;
-\end{lstlisting}
-Once that the solution has been obtained, the \verb$u$ vector is converted into a 
-Fem-fenics function and plotted \verb$plot ()$ or saved \verb$save ()$ in the vtu
-format
-\begin{lstlisting}[numbers=none, language = Octave]
-    u = Function ('u', V, sol);
-    save (u, 'poisson')
-    plot (u);
-\end{lstlisting}
-
-The complete code for the Poisson problem is reported below, while
-in figure \ref{Poissonfig} is presented the output.
-\begin{figure}
- \begin{center}
-  \includegraphics[height=7 cm,keepaspectratio=true]{./Fem-fenics_poisson.png}
-   \caption{The result for the Poisson equation}
-   \label{Poissonfig}
-  \end{center}
-\end{figure}
-
-\subparagraph{Poisson.m}
-\begin{lstlisting}[language=Octave]
-#load the pkg and import the ufl problem
-pkg load fem-fenics msh
-import_ufl_Problem ('Poisson')
- 
-# Create the mesh and define function space
-x = y = linspace (0, 1, 33);
-mesh = Mesh(msh2m_structured_mesh (x, y, 1, 1:4));
-V = FunctionSpace('Poisson', mesh);
-
-# Define boundary condition and source term
-bc = DirichletBC(V, @(x, y) 0.0, [2;4]);
-ff = Expression ('f', @(x,y) 10*exp(-((x - 0.5)^2 + (y - 0.5)^2) / 0.02));
-gg = Expression ('g', @(x,y) sin (5.0 * x));
-
-#Create the Bilinear and the Linear form
-a = BilinearForm ('Poisson', V, V);
-L = LinearForm ('Poisson', V, ff, gg);
- 
-#Extract the matrix and compute the solution
-[A, b] = assemble_system (a, L, bc);
-sol = A \ b;
-u = Function ('u', V, sol);
- 
-# Save solution in VTK format and plot it
-save (u, 'poisson')
-plot (u);
-
-\end{lstlisting}
-
-
-
-\chapter{Implementation}\label{impl} 
-
-Fem-fenics aims to fill a gap in Octave: even if there are packages for the creation of mesh \cite{msh},
-for the postprocessing of data \cite{fpl} and for the resolution of some specific pde \cite{secs1d} \cite{bim},
-no general purpose finite element library is available.
-
-The goal of the project is thus to provide a package which can be used to solve user defined problems 
-and which is able to exploit the functionality provided with Octave.
-
-\begin{figure}
- \begin{center}
-  \includegraphics[height=10 cm,keepaspectratio=true]{./code_layout.png}
-   \caption{General layout of the package}
-   \label{Codelayout}
-  \end{center}
-\end{figure}
-
-Instead of writing a library starting from scratch, an interface to one of the finite element library
-which are already available has been created.
-Among the many libraries taken into account, the one which was best suited for our
-purposes seemed to be the FEniCS project. It ``is a collection of free, open source, software
-components with the common goal to enable automated solution of pde.''
-In particular, Dolfin is the C++/Python interface of FEniCS, providing a consistent Problem
-Solving Environment for ODE and PDE. The idea has been to create wrappers in Octave for C++ Dolfin,
-in a similar way to what it has been done for Python.
-This is a very natural choice, because Octave is mainly written in script language 
-and in C++. It is in fact possible to implement an Octave interpreter function in C++ through the
-native oct-file interface or, conversely, to use Octave's Matrix/Array Classes in a C++ application
-\cite{whatoctave}. 
-
-The works can be summarized as follows (fig. \ref{Codelayout}):
-
-the elements already available in Octave for the resolution of PDE (Mesh and Linear
-Algebra) have been exploited, and wrappers to the other FEniCS functions added.
-To allow exchanges between these programs, the necessary functions
-for converting an Octave mesh/matrix into a FEniCS one and viceversa have been written.
-
-Two main ideas have guided us throughout the realization of the pkg:
-\begin{itemize}
-  \item keep the syntax as close as possible to the original one in Fenics (Python)
-  \item make the interface as simple as possible.
-\end{itemize}
-
-\section{General layout of a class}\label{class}
-Seven new classes are implemented for dealing with FEniCS objects and for using them inside Octave:
-\begin{itemize}
-  \item \textbf{boundarycondition} stores and builds a dolfin::DirichletBC
-  \item \textbf{coefficient} stores an expression object which is used for the
-  evaluation of user defined values
-  \item \textbf{expression} is needed for internal use only as explained below
-  \item \textbf{form} stores a general dolfin::Form and can be used both for
-  a dolfn::BilinearForm and for a dolfin::LinearForm
-  \item \textbf{function} for the dolfin::Function objects
-  \item \textbf{functionspace} stores the user defined FunctionSpace
-  \item \textbf{mesh} converts a PDE-tool like mesh structure in a dolfin::Mesh
-\end{itemize}
-
-The classes are written with the ``usual'' C++ style, but they need to be derived publicly
-from octave\_base\_value and to be added to the Octave interpreter \cite{whatoctave}.
-When a type is used for the first time during a session, it is also temporarily
-registered in the interpreter after all the other basic types (int, double, ...).
-
-The general layout of a class can thus be kept simple and with the main purpose of storing
-the associated FEniCS objects, which is done throughout 
-boost::shared\_ptr< > to the corresponding FEniCS type. 
-All the classes also implement at least two constructors: 
-a default one which is necessary to register a type in the Octave interpreter,
-and a constructor which takes as argument the corresponding dolfin type.
-
-As an example, the form class implementation follows, while classes which differ from the general
-layout are presented below in more details.
-
-\begin{lstlisting}
-#ifndef _FORM_OCTAVE_
-#define _FORM_OCTAVE_
-
-#include <memory>
-#include <vector>
-#include <dolfin.h>
-#include <octave/oct.h>
-
-class form : public octave_base_value
-{
-
- public:
-
-  form () : octave_base_value () {}
-
-  form (const dolfin::Form _frm)
-    : octave_base_value (), frm (new dolfin::Form (_frm)) {}
-
-  form (boost::shared_ptr <const dolfin::Form> _frm)
-    : octave_base_value (), frm (_frm) {}
-
-  void
-  print (std::ostream& os, bool pr_as_read_syntax = false) const
-    {  
-       os << "Form " << ": is a form of rank " << frm->rank ()
-       << " with " << frm->num_coefficients () 
-       << " coefficients" << std::endl; 
-    }
-
-  ~form(void) {}
-
-  bool is_defined (void) const { return true; }
-
-  const dolfin::Form & get_form (void) const { return (*frm); }
-
-  const boost::shared_ptr <const dolfin::Form> & 
-  get_pform (void) const { return frm; }
-
- private:
-
-  boost::shared_ptr <const dolfin::Form> frm;
-
-  DECLARE_OCTAVE_ALLOCATOR;
-  DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA;
-
-};
-
-static bool form_type_loaded = false;
-
-DEFINE_OCTAVE_ALLOCATOR (form);
-DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (form, "form", "form");
-#endif
-
-\end{lstlisting}
-
-\subsection{Shared pointer}
-In all the classes presented above, the private members are stored using 
-a boost::shared\_ptr< >  to the corresponding FEniCS type.
-This is done because we have to refer in several places to resources which are built dynamically 
- and we want that they are destroyed only
-when the last reference is destroyed \cite{Formaggia_smart}.
-For example, if we have two different functional spaces in the same problem, 
-like with Navier-Stokes for the velocity and the pressure, the mesh is shared between 
-them and no one has its own copy.
-Furthermore, they are widely supported inside DOLFIN, and it can thus be avoided to have a copy of the
-same object for FEniCS and another one for DOLFIN: there is just one copy which is shared between DOLFIN
-and FEniCS.
-
-
-\subsection{The mesh class}
-In addition to usual methods, the mesh class implemens functionalities which allow to deal with meshes 
-as they are currently available with the msh pkg, i.e. in the (p, e, t) format, and in Fenics, i.e. 
-in the xml Dolfin format.
-It is therefore necessary to have two different constructors
-\begin{lstlisting}[numbers=none]
- mesh (Array<double>& p, Array<octave_idx_type>& e, 
-       Array<octave_idx_type>& t);
-       
- mesh (std::string _filename)
-    : octave_base_value (), pmsh (new dolfin::Mesh(_filename)) {}
-\end{lstlisting}
-
-where the first one accepts as input a mesh in (p, e, t) format and converts it into a xml one, while
-the latter loads the mesh stored in the \_filename.xml file.
-
-The constructors are used within the Mesh () function, which therefore accepts as argument 
-either a mesh generated within the msh pkg or a string with the name of the file
-where the dolfin mesh is stored.
-
-Furthermore, if a mesh is stored in another different format,
-the program dolfin-convert can try to convert it to the dolfin xml format.
-For example, for a mesh generated with Metis:
-\begin{lstlisting}[numbers=none, language=bash]
-    Shell:
-      >> dolfin-convert msh.gra msh.xml
-\end{lstlisting}
-and then inside the Octave script:
-\begin{lstlisting}[numbers=none, language=Octave]
-    mesh = Mesh ('msh.xml');
-\end{lstlisting}
-Before exploring the code in more details, the main differences between the two storing formats are presented using 
-the very simple, but rather instructive, example of a unit square mesh with just two elements, fig. \ref{mesh}.
-
-\paragraph{pet}
-
-\begin{figure}
- \begin{center}
-  \includegraphics[height=5 cm,keepaspectratio=true]{./mesh_1.png}
-   \caption{The (very) simple mesh for our example}
-   \label{mesh}
-  \end{center}
-\end{figure}
-
-A mesh is represented using the three matrices $p$, $e$, $t$, and, using msh, 
-we can easily obtain the mesh for our example typing
-\begin{lstlisting}[numbers=none, language=octave]
- mesh = msh2m_structured_mesh ([0 1], [0 1], 1, [11 12 12 13])
-\end{lstlisting}
-
-The matrix $p$ stores information about the coordinates of the vertices
-\begin{mdframed}[backgroundcolor=LightBlue, outerlinewidth=0.25pt,linecolor=LightBlue]
-\begin{lstlisting}[numbers=none, language=octave]
- >> mesh.p 
-\end{lstlisting}
-
-$
-\begin{array}{rrrrl}
-           \; 0  & 0 &  1 &  1 & \quad \text{x-coordinates} \\
-           \; 0  & 1 &  0 &  1 & \quad \text{y-coordinates} \\
-\end{array}
-$
-\end{mdframed}
-Thus the vertex in the $n^{th}$ column is labelled as the vertex number $n$, and so on.
-     
-The matrix $t$ stores information about the connectivity
-\begin{mdframed}[backgroundcolor=LightBlue, outerlinewidth=0.25pt,linecolor=LightBlue]
-\begin{lstlisting}[numbers=none, language=octave]
- >> mesh.t
-\end{lstlisting}
-
-$
-\begin{array}{rrl}
-          \; 1  & 1 &  \quad \text{number of the first vertex of the element}  \\
-          \; 3  & 4 &  \quad \text{number of the second vertex of the element}  \\
-          \; 4  & 2 &  \quad \text{number of the third vertex of the element}  \\
-          \; 0  & 0 &   \\           
-\end{array}
-$
-\end{mdframed}                       
-The first element is thus the one obtained connecting vertices 1-3-4 and so on.
-
-The matrix $e$ stores information related to every side edge, 
-like the number of the vertices of the boundary elements,  
-and the number of the geometrical border containing the edge,
-which is a convenient way to deal with boundary conditions in a problem.
-\begin{mdframed}[backgroundcolor=LightBlue, outerlinewidth=0.25pt,linecolor=LightBlue]
-\begin{lstlisting}[numbers=none, language=octave]
- >> mesh.e
-\end{lstlisting} 
-$
-\begin{array}{rrrrl}
-           \; 1  & 3 & 2 & 1 & \quad \text{first vertex of the side edge}   \\
-           \; 3  & 4 & 4 & 2 & \quad \text{second vertex of the side edge} \\
-           \; 0  & 0 & 0 & 0 &   \text{} \\
-           \; 0  & 0 & 0 & 0 &    \text{} \\
-           \; 11  & 12 & 12 & 13 & \quad \text{label of the geometrical border containing the edge}  \\
-           \; 0  & 0 & 0 & 0 &  \text{}\\
-           \; 1  & 1 & 1 & 1 &  \text{} \\
-\end{array}
-$
-\end{mdframed}
-The side edge between vertex 1-3 is labelled 11, between 3-4 is 12...
-
-\paragraph{dolfin xml} A mesh is an object of the dolfin::Mesh class which stores information only about
-the coordinates of the vertices (like $p$) and the information about the connectivity (like $t$). 
-A mesh can thus be manipulated using the functions and the methods of the class, which are presented below.
-Instead, the information about boundaries is not directly stored in the mesh.
-The mesh used in the example is stored as
-
-\begin{lstlisting}[numbers=none, language=xml]
-<?xml version="1.0"?>
-<dolfin xmlns:dolfin="http://fenicsproject.org">
-  <mesh celltype="triangle" dim="2">
-    <vertices size="4">
-      <vertex index="0" x="0.000e+00" y="0.000e+00" />
-      <vertex index="1" x="0.000e+00" y="1.000e+00" />
-      <vertex index="2" x="1.000e+00" y="0.000e+00" />
-      <vertex index="3" x="1.000e+00" y="1.000e+00" />
-    </vertices>
-    <cells size="2">
-      <triangle index="0" v0="0" v1="2" v2="3" />
-      <triangle index="1" v0="0" v1="1" v2="3" />
-    </cells>
-  </mesh>
-</dolfin>
-\end{lstlisting}
-
-\paragraph{Conversion between the formats}
-The first necessary step in our way to a package which links Octave and FEniCS
-is to convert a mesh from the $(p, e, t)$ format
-into the dolfin xml one. 
-Furthermore, as dolfin provides methods and functions which 
-allow to manipulate a mesh and which don't have a conterpart in the msh pkg,
-we have also created wrappers for them (specifically for mesh::refine).
-
-As it has been shown above, the main difference between $(p, e, t)$ and DOLFIN $xml$ 
-is the way in which the boundaries are distinguished.
-The former stores all the information in the $e$ matrix, while the latter uses
-the functions and the methods of the dolfin::mesh class to set/get information about a mesh.
-The most useful classes available in dolfin are recalled
-\begin{itemize}
-\item \textbf{MeshIterator}
-To know whether an edge belongs or not to the boundary, we can iterate over all the
-edges of our mesh using the classes provided by DOLFIN:
-\begin{lstlisting}[numbers=none]
-  for (dolfin::FacetIterator f (mesh); ! f.end (); ++f)
-    {
-      if ((*f).exterior () == true)
-        {
-          //do something with the boundary cells
-        }  
-    }
-\end{lstlisting}
-
-\item \textbf{MeshFunction}
-To store data related to a mesh, dolfin provides the template class MeshFunctions.
-"A MeshFunction is a function that can be evaluated at a set of mesh entities. 
-A MeshFunction is discrete and is only defined at the set of mesh entities of a fixed topological dimension.
-A MeshFunction may for example be used to store a global numbering scheme for the entities of a (parallel) mesh,
-marking sub domains or boolean markers for mesh refinement." \cite{meshfunction}
-For example, in the function \verb$mshm_refine$ of the msh package, the list of cells to be refined 
-is stored as a MeshFunction, which for every cell says whether or not it has to be refined:
-\begin{lstlisting}[numbers=none]
-  dolfin::CellFunction<bool> cell_markers (mesh);
-  cell_markers.set_all (false);
-
-  for (octave_idx_type i = 0;
-       i < cells_to_refine.length (); ++i)
-    cell_markers.set_value (cells_to_refine (i) , true);
-\end{lstlisting}
-
-
-\item \textbf{MeshValueCollection} "It differs from the MeshFunction class in two ways. 
-First, data do not need to be associated with all entities (only a subset). 
-Second, data are associated with entities through the corresponding cell index and local entity number
-(relative to the cell), not by global entity index, which means that data may be stored robustly to file."\cite{meshvalue}
-It is thus obvious that it is better to use the MeshValueCollection whenever saving or writing a mesh.
-\end{itemize}
-
-The container classes presented above can be used by their own, 
-but to set/get data from a mesh it is better to use the methods provided by the classes:
-\begin{itemize}
-\item \textbf{MeshDomains} "The class MeshDomains stores the division of a Mesh into subdomains.
-For each topological dimension 0 <= d <= D, where D is the topological dimension of the Mesh, 
-a set of integer markers are stored for a subset of the entities of dimension d, 
-indicating for each entity in the subset the number of the subdomain. 
-It should be noted that the subset does not need to contain all entities of any given dimension;
-entities not contained in the subset are “unmarked”." \cite{meshdomain}
-\item \textbf{MeshData} "The class MeshData is a container for auxiliary mesh data,
-represented either as MeshFunction over topological mesh entities, arrays or maps.
-Each dataset is identified by a unique user-specified string." \cite{meshdata}
-\end{itemize}
-
-\subparagraph{Geometry from (p, e, t) to dolfin xml}
-Converting the vertices and cells from (p, e, t) in the xml format can be done using the
-dolfin editor, while caution has to be taken for storing information associated with boundaries
-and subdomains, as presented in the next paragraph.
-\begin{lstlisting}[numbers=none]
-      dolfin::MeshEditor editor;
-      boost::shared_ptr<dolfin::Mesh> msh (new dolfin::Mesh ());
-      editor.open (*msh, D, D);
-      editor.init_vertices (p.cols ());
-      editor.init_cells (t.cols ());
-
-      if (D == 2)
-        {
-          for (uint i = 0; i < p.cols (); ++i)
-            editor.add_vertex (i,
-                               p.xelem (0, i),
-                               p.xelem (1, i));
-
-          for (uint i = 0; i < t.cols (); ++i)
-            editor.add_cell (i,
-                             t.xelem (0, i) - 1,
-                             t.xelem (1, i) - 1,
-                             t.xelem (2, i) - 1);
-        }
-
-      if (D == 3)
-        {
-          ...
-        }
-
-      editor.close ();
-
-\end{lstlisting}
-
-\subparagraph{Subdomain markers: from (p, e, t) to dolfin xml}
-There are no fundamental differences between the 2D and 3D case,
-and they are thus treated together referring to the 
-general dimension D.
-The subdomain information is contained in the t matrix,
-and it is temporarily copied to a MeshValueCollection.
-For every column of the $t$ matrix, i.e. for every element of the mesh, 
-we have to look for the corresponding element in the DOLFIN mesh. 
-We use the class MeshIterator for moving around on the DOLFIN mesh:
-
-\begin{lstlisting}[numbers=none]
-  dolfin::MeshValueCollection<uint> my_cell_marker (D);
-  
-  for (uint i = 0; i < num_cells; ++i)
-    dolfin::Vertex v (mesh, t(0, i));
-      for (dolfin::CellIterator f (v); ! f.end (); ++f)
-        {
-          if ((*f) == all_vertices_in_the_ith_column)
-            {
-              my_cell_marker.set_value
-                ((*f).index (), t(last_row, i), mesh);
-              break;
-            }
-         }
-\end{lstlisting}
-
-The \verb$all_vertices_in_the_ith_column$ is just like a pseudo code: 
-we have to be sure that the Cell pointed by f is the one corresponding 
-to the $i^{th}$ column of the matrix, checking the vertices one-by-one:
-
-in $2D$ the cell is a triangle, and we thus have to check $3$ vertices. 
-As we don't know the order in which vertices are visited, we have to check all the $3! = 6$ 
-different combinations:
-\begin{lstlisting}[numbers=none]
-          ...
-          if ((*f).entities(0)[0] == t(0, i)
-              && (*f).entities(0)[1] == t(1, i) 
-              && (*f).entities(0)[2] == t(2, i)
-              || ...  check the other 5 possibilities... )
-         ....
-\end{lstlisting}
-
-where the \verb$entities(std::size_t dim)$ method returns an array with the indexes of the elements
-of dimension dim. Thus we use $dim = 0$ as we are looking for vertices.
-
-In the $3D$ case, our cell is a tetrahedron, and we have to check all the $4! = 24$ possibilities,
-each of which is composed by $4$ assertions; in total we have almost one hundred conditions!
-
-Now that the information is stored in our function, it can be associated to the mesh
-
-\begin{lstlisting}[numbers=none]
-    *(mesh.domains ().markers (D)) = my_marked_cell;
-\end{lstlisting}
-
-\subparagraph{Subdomain markers: from dolfin xml to (p, e, t)}
-
-In the DOLFIN .xml file, the information is stored like:
-\begin{lstlisting}[numbers=none]
- ...
-<mesh_value_collection name="m" type="uint" dim="2" size="2">
-     <value cell_index="0" local_entity="0" value="1"/>
-     <value cell_index="1" local_entity="0" value="2"/>
- ...
-\end{lstlisting}
-
-When the file is read using DOLFIN, the information is automatically associated with the mesh 
-as a MeshValueCollection named \verb$cell_domains$, which can be accessed to extract the information
-using the MeshDomains class.
-Obviously we have to be sure that the information is available within 
-the file that we are reading, and that it is related to Cell, i.e. to elements of dimension D,
-before it is associated to the last row of the $t$ matrix:
-
-\begin{lstlisting}[numbers=none]
-  dolfin::MeshFunction<uint> my_cell_marker;
-  if (! mesh.domains ().is_empty ())
-    if (mesh.domains ().num_marked (D) != 0)
-      my_cell_marker = *(mesh.domains ().cell_domains ());
-      
-    for (j = 0; j < t.cols (); ++j)
-      t(D + 1, j) = my_cell_marker[j];
-\end{lstlisting}
-
-\subparagraph{Boundary Markers}
-For boundary markers, things work in a similar way, as long as we remember that we are working with objects of 
-dimension D - 1.
-In this case, the main difference is in the .xml file: it is no longer enough to say 
-to what cell element the label is referred to, but we have to specify to which $D - 1$ 
-entity (a side or a face) the label is referred.
-For example:
-
-\begin{lstlisting}[numbers=none]
-    ....
-    mesh_value_collection name="m" type="uint" dim="1" size="4">
-         <value cell_index="0" local_entity="0" value="12"/>
-         <value cell_index="0" local_entity="2" value="11"/>
-         <value cell_index="1" local_entity="0" value="12"/>
-         <value cell_index="1" local_entity="2" value="13"/>  
-    ...
-\end{lstlisting}
-
-The cell number $"0"$ is a triangle, 
-and to the \verb$local_entity$ number $"0"$, i.e. to the side number $"0"$, 
-is associated the label $"12"$, while to the side number $"2"$ is associated the label $"11"$.
-To the side number $"1"$, there are no labels associated.
-The number of the \verb$local_entity$ refers to the enumeration of the reference element.
-In any case, it is DOLFIN which takes care of the conversion of indeces from this format to the usual one,
-and we can thus use methods and functions as explained for the subdomain markers.
-
-\subparagraph{Mesh refine}
-Now that it is possible to convert meshes between Octave and DOLFIN,
-the functions available in the dolfin::mesh class can be used to improve the 
-functionality of the msh package.
-For the moment, it has been added the possibility of refining a mesh,
-either uniformly or specifying the list of the vertices we want to be refined.
-The function is now part of the msh pkg\cite{msh}, and a more detailed desciption has been 
-provided previously \cite{refine}.
-
-
-
-\subsection{The functionspace class}
-A dolfin::FunctionSpace is defined by specifying a mesh and the type of the finite element which we want to use. 
-The mesh is handled as presented above, while the FE are specified inside the .ufl file. Possible choices are
-\cite{logg2012automated}:
-
-\begin{center}
-\begin{tabular}{  l | l }
-  \hline
-    \textbf{Finite Element Space} & \textbf{Symbol} \\ \hline \hline
-   
-
-    Argyris                  &    ARG * \\ \hline
-    Arnold–Winther           &    AW * \\ \hline
-    Brezzi–Douglas–Marini    & BDM\\ \hline
-    Crouzeix–Raviart         &      CR\\ \hline
-    Discontinuous Lagrange   & DG\\ \hline
-    Hermite                  &        HER*\\ \hline
-    Lagrange                 &        CG\\ \hline
-    Mardal–Tai–Winther       &  MTW *\\ \hline
-    Morley                   &            MOR*\\ \hline
-    Nédélec 1st kind H (curl)   &  N1curl\\ \hline
-    Nédélec 2nd kind H (curl)   & N2curl\\ \hline
-    Raviart–Thomas              &    RT\\
-\end{tabular} 
-
-\end{center}
-
-where the Finite Elements denoted with * are not yet fully supported inside FEniCS.
-
-\section{General layout of a function}
-There are two general kinds of functions in the code: functions which create an abstract problem
-(wrappers to UFL) and
-functions which create the specific instance of a problem and discretize it (wrapper to DOLFIN).
-\section{Wrappers to UFL}
-As stated in section \ref{genlayout}, a problem is divided in two files: a \texttt{.ufl} file 
-where the abstract problem is described in Unified Form Language (UFL),
-and a script file \texttt{.m} where a specific problem is implemented and solved.
-We suppose that they are called \texttt{Poisson.ufl} and \texttt{Poisson.m} .
-In order to use the information stored in the UFL file, i.e. the bilinear and the linear form, 
-they have to be ``imported'' inside Octave. This is done using the 
-functions \texttt{import\_ufl\_BilinearForm, import\_ufl\_LinearForm, ...} .
-\subsection{Generation of code on the fly}
-When a UFL file is compiled using the ffc compiler, a header file \texttt{Poisson.h} is generated.
-In this header file, it is defined the Poisson class, which derives from dolfin::Form,
-and the constructor for the bilinear and linear form are set.
-This file is thus available only at compilation time, but it has to be included somehow
-in the wrapper function for the Bilinear and the Linear form.
-An easy solution would have been to write a set of pre established problems where the user could only
-change the values of the coefficient for a specific problem; 
-but, as we want to let the user free to write his own 
-variational problem, a different approach has been adopted.
-The \texttt{ufl} file is compiled at run time and generates its header file.
-Then, a Poisson.cc file is written from a template which takes as input the name 
-of the header file and is compiled including the Poisson.h file;
-now the corresponding Octave functions for the specific problem are available and
-will be later used from
-\texttt{BilinearForm, LinearForm, FunctionSpace, ...} .
-As an example it is presented the import\_ufl\_BilinearForm function.
-
-\begin{lstlisting}[language=Octave]
- function import_ufl_BilinearForm (var_prob)
-
- ...
- 
-  %the function which writes the var_prob.cc file (see below)
-  generate_rhs (var_prob);
-  
-  %the function which writes the makefile
-  generate_makefile (var_prob, private);
-
-  % the makefile is executed in a terminal:
-  % 1) generate the header file from ufl
-  %  ffc -l dolfin var_prob.ufl
-  % 2) compile the var_prob.cc
-  %  mkoctfile var_prob.cc -I.
-  system (sprintf ("make -f Makefile_%s rhs", var_prob));
-  
-  ...
-
-endfunction
-\end{lstlisting}
-
-\begin{lstlisting}[language=Octave]
-function output = generate_rhs (ufl_name)
-
-  STRING ="
-  #include "@@UFL_NAME@@.h"
-
-  ...
-
-  DEFUN_DLD (@@UFL_NAME@@_BilinearForm, args, , ""A = fem_rhs_@@UFL_NAME@@ (FUNCTIONAL SPACE, COEFF)"")
-  {
-    ...
-    
-    const functionspace & fspo1
-      = static_cast<const functionspace&> (args(0).get_rep ());
-    const functionspace & fspo2
-      = static_cast<const functionspace&> (args(1).get_rep ());
-
-    const dolfin::FunctionSpace & U = fspo1.get_fsp ();
-    const dolfin::FunctionSpace & V = fspo2.get_fsp ();
-    @@UFL_NAME@@::BilinearForm a (U, V);
-
-    ...
-    
-
-  }";
-
-  STRING =  strrep (STRING, "@@UFL_NAME@@", ufl_name);
-
-  fid = fopen (sprintf ("%s_BilinearForm.cc", ufl_name), 'w');
-  fputs (fid, STRING);
-  output = fclose (fid);
-
-endfunction
-\end{lstlisting}
-
-
-\section{Wrappers to DOLFIN}
-The general layout of a function is very simple and it is composed of 4 steps which we describe using an example:
-\begin{lstlisting}
-DEFUN_DLD (FunctionSpace, args, , "initialize a FunctionSpace from a mesh")
-{
-          // 1 read data
-          const mesh & msho = static_cast<const mesh&> (args(0).get_rep ());
-          
-          // 2 extract the data stored in the Octave class as a DOLFIN object
-          const dolfin::Mesh & mshd = msho.get_msh ();
-          
-          // 3 build a new object or extract the information needed using DOLFIN
-          boost::shared_ptr <const dolfin::FunctionSpace> g (new Laplace::FunctionSpace (mshd));
-          
-          // 4 convert the new object from DOLFIN to Octave and return it
-          octave_value retval = new functionspace(g);
-          return retval;
-}
-\end{lstlisting}
-All the functions presented above follow this general structure, and thus here we present 
-in detail only functions which present some differences.
-
-\subsection{DirichletBC and Coefficient}
- These two functions take as input a function handle which cannot be directly evaluated by
- a dolfin function to set, respectively, the value on the boundary or the value of the coefficient. 
- It has thus been derived from dolfin::Expression a class "expression" which has as private member 
- an octave function handle and which  overloads the function eval(). In this way, an object of 
- the class expression can be initialized throughout a function handle and can be used inside dolfin because 
- "it is" a dolfin::Expression
-\begin{lstlisting}
-class expression : public dolfin::Expression
-{
-  ...
-  
-  void 
-  eval (dolfin::Array<double>& values,
-        const dolfin::Array<double>& x) const
-    {
-      octave_value_list b;
-      b.resize (x.size ());
-      for (std::size_t i = 0; i < x.size (); ++i)
-        b(i) = x[i];
-      octave_value_list tmp = feval (f->function_value (), b);
-      Array<double> res = tmp(0).array_value ();
-
-      for (std::size_t i = 0; i < values.size (); ++i)
-        values[i] = res(i);
-    }
-
- private:
-  octave_fcn_handle * f;
-};
-
-
-\end{lstlisting}
-
-\paragraph{DirichletBC}
-The BC are imposed directly to the mesh setting to zero all the off diagonal elements 
-in the corresponding line. This means that we could loose the symmetry of the matrix, if any. 
-To avoid this problem, instead of the method \verb$apply()$ it is possible to use the
-function \verb$assemble_system()$ , which preserves the symmetry of the system but which needs to build 
-together the lhs and the rhs.
-
-\paragraph{Coefficient}
-The coefficient of the variational problem can be specified using either a Coefficient 
-or a Function. They are different objects which behave in different ways: a Coefficient, as exlained above, 
-overloads the \verb$eval()$ method of the  dolfin::Expression class and it is evaluated at 
-run time using the octave function \verb$feval()$. A Function instead doesn't need to be evaluated 
-because it is assembled copying element-by-element the values contained in the input vector.
-
-\subsection{Sparse Matrices}
-The \texttt{assemble} function discretizes the continuos problem and
-returns a matrix. To deal with problems of big size, the matrices are stored
-using a compressed technique \cite{Formaggia_matr} both in DOLFIN and in Octave.
-Unfortunately, DOLFIN uses row major orientation while Octave uses 
-column major orientation. They have thus to be converted efficiently from
-one type to the other.
-\begin{lstlisting}[language=C++]
- 
-#include "form.h"
-#include "boundarycondition.h"
-
-DEFUN_DLD (assemble, args, nargout, " ")
-{
-  int nargin = args.length ();
-  octave_value_list retval;
-
-  if (! boundarycondition_type_loaded)
-    {
-      boundarycondition::register_type ();
-      boundarycondition_type_loaded = true;
-      mlock ();
-    }
-
-  if (! form_type_loaded)
-    {
-      form::register_type ();
-      form_type_loaded = true;
-      mlock ();
-    }
-
-  ...
-  
-  // Extract form object from the input
-  const form & frm = static_cast<const form&> (args(0).get_rep ());
-
-  const dolfin::Form & a = frm.get_form ();
-  a.check ();
-
-  ...
-  
-  // Assemble the Matrix in DOLFIN
-  dolfin::parameters["linear_algebra_backend"] = "uBLAS";
-  dolfin::Matrix A;
-  dolfin::assemble (A, a);
-
-  // Extract BC from input and apply BC
-  ...
-  const boundarycondition & bc
-    = static_cast<const boundarycondition&> (args(i).get_rep ());
-
-  const std::vector<boost::shared_ptr <const dolfin::DirichletBC> > 
-    & pbc = bc.get_bc ();
-
-  for (std::size_t j = 0; j < pbc.size (); ++j)
-    pbc[j]->apply(A);
-
-
-  // Get capacity of the dolfin sparse matrix
-  boost::tuples::tuple<const std::size_t*, 
-		       const std::size_t*, 
-	               const double*, int> 
-    aa = A.data ();
-
-  // Create the Matrix for Octave
-
-  ...
-  
-  for (std::size_t i = 0; i < nr; ++i)
-    {
-      A.getrow (i, cidx_tmp, data_tmp);
-      nz += cidx_tmp.size ();
-
-      for (octave_idx_type j = 0; 
-	  j < cidx_tmp.size (); ++j)
-	{
-	  orow [ii + j] = i;
-	  oc [ii + j] = cidx_tmp [j];
-	  ov [ii + j] = data_tmp [j];
-	}
-
-      ii = nz;
-    }
-
-  dims(0) = ii;
-  ridx.resize (dims);
-  cidx.resize (dims);
-  data.resize (dims);
-
-  SparseMatrix sm (data, ridx, cidx, nr, nc);
-  retval(0) = sm;
-
-  ...
-  
-  return retval;
-}
-\end{lstlisting}
-
-
-\subsection{Polymorphism}
-The objects which belong to the new classes presented in section \ref{class}
-have to overload some of the methods already available in Octave.
-For example, we want to be able to \texttt{plot} a \texttt{Mesh} or a \texttt{function}, to \texttt{save} it
-and to evaluate it at a specific point in the space (\texttt{feval}).
-As Octave is a dynamically typed language it could be a difficult task to achieve, but hopefully
-the Octave interpreter takes care of it and it is enough to put the polymorphic function
-in a folder named as the type. For example, in the \texttt{@function} folder
-inside the Fem-fenics directory we can find the \texttt{plot, save, feval} functions.
-
-\iffalse
-
-\paragraph{other function}
-
-
-    SubSpace allows to extract a subspace from a vectorial one. 
-    For example, if our space is P2 x P0 we can extract the one or 
-    the other and then apply BC only where it is necessary.
-    \verb$fem_eval$ takes as input a Function and a coordinate and returns a 
-    vector representing the value of the function at this point.
-    for dealing with form of rank 0, i.e. with functional, we have now 
-    added the functions \verb$fem_create_functional$ to create it from a .ufl file. 
-    We have thus extended the function assemble which returns the corresponding double value.
-    \verb$plot_2d$ and \verb$plot_3d$: these functions allow us to plot a function specifying 
-    a mesh and the value of the function at every node of the mesh. 
-    This is something which could be useful also outside of fem-fenics.
-
-\section{Implementation Details}
-The relevant implementation details which the user should know are:
-
-     We have split the construction of the form into two steps:
-
-        We set all the coefficients of the form using the function which we create on the fly. 
-        They will be named \verb$ProblemName_BilinearForm$ or \verb$ProblemName_LinearForm$.
-        Then we apply specific BC to the form using the assemble() function and we get back the matrix. 
-        If we are assembling the whole system and we want to keep the symmetry of the matrix (if any), 
-        we can instead use the command \verb$assemble_system$ (). Finally, if we are solving a non-linear problem 
-        and we need to apply essential BC, we should provide to the function also the vector with the 
-        tentative solution in order to modify the entries corresponding to the boundary values. 
-        This will be illustrated below in the HyperElasticity example.
-\fi
-
-
-\chapter{More Advanced Examples}\label{exem}
-In this chapter more examples are provided.
-At the beginning of each section, the problem is briefly presented and then
-the Octave script for the resolution of the problem using Fem-fenics is presented alongside the code 
-written in C++ or in Python.
-For each problem, we refer the reader to the complete desciption on the FEniCS website.
-\iffalse
-In the following examples we can see directly in action the classes and the functions presented in the 
-chapters before. A comparison with DOLFIN is given only for the first example, while more extensive case can
-be found online. We do not report the code for all the examples but only the relevant parts.
-
- With the following examples, we can see directly in action the new features and understand how they work.
-
-    Navier-Stokes: we learn how to deal with a vector-field problem and how we can save the solution using the 
-    \verb$fem_save$ () function. We also use the fem pkg to generate a mesh using gmesh.
-    Mixed-Poisson: we solve the Poisson problem presented in the previous posts using a mixed formulation, 
-    and we see how we can extract a scalar field from a vector one.
-    HyperElasticity: we exploit the fsolve () command to solve a non-linear problem. In particular, 
-    we see how to use the assemble() function to apply BC also in this situation.
-    Advection-Diffusion: we solve a time dependent problem using the lsode () command and save 
-    the solution using the pkg flp.
-
-or bim web-page, 
-while here we highlight only the  implementation detail relevant for our pkg.
-\fi
-\section{Mixed Formulation for the Poisson Equation}
-In this example the Poisson equation is solved with a 
-''mixed approach'': it is used the stable FE space obtained using Brezzi-Douglas-Marini 
-polynomial of order 1 and Dicontinuos element of order 0.
-\begin{align*}
--\mathrm{div}\ ( \mathbf{\sigma} (x, y) ) ) &= f (x, y) & \quad \mbox{ in } \Omega \\
-\sigma (x, y) &= \nabla u (x, y) & \quad \mbox{ in } \Omega \\
-u(x, y) &= 0 & \quad \mbox{ on } \Gamma_D \\
-(\sigma (x, y) )  \cdot \mathbf{n} &= \sin (5x) & \quad \mbox{ on } \Gamma_N
-\end{align*}
-
-A complete description of the problem is avilable on the Fenics website \cite{mixedpois}.
-\begin{changemargin}{-1.5cm}{-1.5cm}
-$\phantom {u}$
-\begin{parcolumns}[colwidths={1=0.65\textwidth,2=0.65\textwidth}]{2}
-\colchunk{\begin{lstlisting}[caption=Fem-fenics, language=Octave, numbers=none]{Name}
-pkg load fem-fenics msh
-import_ufl_Problem ('MixedPoisson')
-
-# Create mesh
-x = y = linspace (0, 1, 33);
-mesh = Mesh(msh2m_structured_mesh (x, y, 1, 1:4));
-
-# File MixedPoisson.ufl
-#  BDM = FiniteElement("BDM", triangle, 1)
-#  DG  = FiniteElement("DG", triangle, 0)
-#  W = BDM * DG
-V = FunctionSpace('MixedPoisson', mesh);
-
-# Define trial and test function
-# File MixedPoisson.ufl
-#  (sigma, u) = TrialFunctions(W)
-#  (tau, v)   = TestFunctions(W)
-#  CG = FiniteElement("CG", triangle, 1)
-#  f = Coefficient(CG)
-f = Expression ('f', 
-      @(x,y) 10*exp(-((x - 0.5)^2 + (y - 0.5)^2) / 0.02));
-
-# Define variational form
-# File MixedPoisson.ufl
-#  a = (dot(sigma, tau) + div(tau)*u + div(sigma)*v)*dx
-#  L = - f*v*dx
-a = BilinearForm ('MixedPoisson', V, V);
-L = LinearForm ('MixedPoisson', V, f);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# Define essential boundary
-
-bc1 = DirichletBC (SubSpace (V, 1), @(x,y) [0; -sin(5.0*x)], 1);
-bc2 = DirichletBC (SubSpace (V, 1), @(x,y) [0;  sin(5.0*x)], 3);
-
-# Compute solution
-[A, b] = assemble_system (a, L, bc1, bc2);
-sol = A \ b;
-func = Function ('func', V, sol);
-
-sigma = Function ('sigma', func, 1);
-u = Function ('u', func, 2);
-
-# Plot solution
-plot (sigma);
-plot (u);
-
-
-#
-\end{lstlisting}}
-
-\colchunk{\begin{lstlisting}[caption=Python, language=Python, numbers=none]{Name}
-from dolfin import *
-
-
-# Create mesh
-mesh = UnitSquareMesh(32, 32)
-
-
-# Define function spaces and mixed (product) space
-BDM = FunctionSpace(mesh, "BDM", 1)
-DG = FunctionSpace(mesh, "DG", 0)
-W = BDM * DG
-
-
-
-# Define trial and test functions
-(sigma, u) = TrialFunctions(W)
-(tau, v) = TestFunctions(W)
-
-
-f = Expression
-    ("10*exp(-(pow(x[0] - 0.5, 2) + pow(x[1] - 0.5, 2)) / 0.02)")
-
-# Define variational form
-
-a = (dot(sigma, tau) + div(tau)*u + div(sigma)*v)*dx
-L = - f*v*dx
-
-
-
-# Define function G such that G \cdot n = g
-class BoundarySource(Expression):
-    def __init__(self, mesh):
-        self.mesh = mesh
-    def eval_cell(self, values, x, ufc_cell):
-        cell = Cell(self.mesh, ufc_cell.index)
-        n = cell.normal(ufc_cell.local_facet)
-        g = sin(5*x[0])
-        values[0] = g*n[0]
-        values[1] = g*n[1]
-    def value_shape(self):
-        return (2,)
-
-G = BoundarySource(mesh)
-
-# Define essential boundary
-def boundary(x):
-    return x[1] < DOLFIN_EPS or x[1] > 1.0 - DOLFIN_EPS
-
-bc = DirichletBC(W.sub(0), G, boundary)
-
-# Compute solution
-w = Function(W)
-solve(a == L, w, bc)
-
-
-(sigma, u) = w.split()
-
-
-# Plot sigma and u
-plot(sigma)
-plot(u)
-interactive()
-
-# Copyright 2011, The FEniCS Project
-\end{lstlisting}}
-
-\colplacechunks
-\end{parcolumns}
-\end{changemargin} 
-
-\section{Incompressible Navier-Stokes equation}
-In this example the incompressible Navier-Stokes equation
-\begin{align*}
-\dfrac{\partial u}{\partial t} + (\mathbf u \cdot \mathrm{\nabla})  \mathbf u - \nu \Delta \mathbf u 
-  + \nabla p &= f & \quad \mbox{ in } \Omega \\
-\mathrm{\nabla} \cdot \mathbf u &= 0 & \quad \mbox{ in } \Omega \\
-\end{align*}
-are solved using the Chorin-Temam algorithm. The L-shaped domain $\Omega$ can be obtained using
-the msh pkg.
-\begin{lstlisting}[language=Octave]
-name = [tmpnam ".geo"];
-fid = fopen (name, "w");
-fputs (fid,"Point (1)  = {0, 0, 0, 0.1};\n");
-fputs (fid,"Point (2)  = {1, 0, 0, 0.1};\n");
-fputs (fid,"Point (3)  = {1, 0.5, 0, 0.1};\n");
-fputs (fid,"Point (4)  = {0.5, 0.5, 0, 0.1};\n");
-fputs (fid,"Point (5) = {0.5, 1, 0, 0.1};\n");
-fputs (fid,"Point (6) = {0, 1, 0,0.1};\n");
- 
-fputs (fid,"Line (1)  = {5, 6};\n");
-fputs (fid,"Line (2) = {2, 3};\n");
- 
-fputs (fid,"Line(3) = {6,1,2};\n");
-fputs (fid,"Line(4) = {5,4,3};\n");
-fputs (fid,"Line Loop(7) = {3,2,-4,1};\n");
-fputs (fid,"Plane Surface(8) = {7};\n");
-fclose (fid);
-msho = msh2m_gmsh (canonicalize_file_name (name)(1:end-4),...
-                   "scale", 1,"clscale", .2);
-unlink (canonicalize_file_name (name));
-\end{lstlisting}
-
-The flow is driven by an oscillating pressure $p_{in}(t) = \sin 3t$ at the inflow 
-while the pressure is kept constant $p_{out} = 0$ at the outflow.
-A complete description of the problem is avilable on the Fenics website \cite{navierstokes}.
-
-\begin{changemargin}{-1.5cm}{-1.5cm}
-$\phantom {u}$
-\begin{parcolumns}[colwidths={1=0.65\textwidth,2=0.65\textwidth}]{2}
-\colchunk{\begin{lstlisting}[caption=Fem-fenics, language=Octave, numbers=none]{Name}
-pkg load fem-fenics msh
-import_ufl_Problem ("TentativeVelocity");
-import_ufl_Problem ("VelocityUpdate");
-import_ufl_Problem ("PressureUpdate");
-
-# We can either load the mesh from the file as in Dolfin but 
-# we can also use the msh pkg to generate the L-shape domain
-# as showed above
-
-mesh = Mesh ('lshape.xml');
-
-# Define function spaces (P2-P1). UFL file
-#  V = VectorElement("CG", triangle, 2)
-#  Q = FiniteElement("CG", triangle, 1)
-V = FunctionSpace ('VelocityUpdate', mesh);
-Q = FunctionSpace ('PressureUpdate', mesh);
-
-# Define trial and test functions. From ufl file
-#  u = TrialFunction(V)
-#  p = TrialFunction(Q)
-#  v = TestFunction(V)
-#  q = TestFunction(Q)
-
-# Set parameter values. From ufl file
-#  nu = 0.01
-dt = 0.01;
-T = 3.;
-
-
-
-
-# Define boundary conditions
-noslip = DirichletBC (V, @(x,y) [0; 0], [3, 4]);
-
-
-
-
-
-
-outflow = DirichletBC (Q, @(x,y) 0, 2);
-
-
-
-
-# Create functions
-u0 = Expression ('u0', @(x,y) [0; 0]);
-
-
-
-# Define coefficients
-k = Constant ('k', dt);
-f = Constant ('f', [0; 0]);
-
-# Tentative velocity step. From ufl file
-#  eq = (1/k)*inner(u - u0, v)*dx + inner(grad(u0)*u0, v)*dx \
-#       + nu*inner(grad(u), grad(v))*dx - inner(f, v)*dx
-a1 = BilinearForm ('TentativeVelocity', V, V, k);
-
-# Pressure update. From ufl file
-#  a = inner(grad(p), grad(q))*dx
-#  L = -(1/k)*div(u1)*q*dx
-a2 = BilinearForm ('PressureUpdate', Q, Q);
-
-# Velocity update
-#  a = inner(u, v)*dx
-#  L = inner(u1, v)*dx - k*inner(grad(p1), v)*dx
-a3 = BilinearForm ('VelocityUpdate', V, V);
-
-# Assemble matrices
-A1 = assemble (a1, noslip);
-
-A3 = assemble (a3, noslip);
-
-
-
-
-
-
-
-
-
-
-# Time-stepping
-t = dt; i = 0;
-while t < T
-
-  # Update pressure boundary condition
-  inflow = DirichletBC (Q, @(x,y) sin(3.0*t), 1);
-
-  # Compute tentative velocity step
-  "Computing tentative velocity"
-  L1 = LinearForm ('TentativeVelocity', V, k, u0, f);
-  b1 = assemble (L1, noslip);
-  utmp = A1 \ b1;
-  u1 = Function ('u1', V, utmp);
-
-  # Pressure correction
-  "Computing pressure correction"
-  L2 = LinearForm ('PressureUpdate', Q, u1, k);
-  [A2, b2] = assemble_system (a2, L2, inflow, outflow);
-  ptmp = A2 \ b2;
-  p1 = Function ('p1', Q, ptmp);
-
-  # Velocity correction
-  "Computing velocity correction"
-  L3 = LinearForm ('VelocityUpdate', V, k, u1, p1);
-  b3 = assemble (L3, noslip);
-  ut = A3 \ b3;
-  u1 = Function ('u0', V, ut);
-
-  # Plot solution
-  plot (p1);
-  plot (u1);
-
-  # Save to file
-  save (p1, sprintf ("p_%3.3d", ++i));
-  save (u1, sprintf ("u_%3.3d", i));
-
-  # Move to next time step
-  u0 = u1;
-  t += dt
-
-end
-
-
-
-#
-\end{lstlisting}}
-
-\colchunk{\begin{lstlisting}[caption=Python, language=Python, numbers=none]{Name}
-from dolfin import *
-
-
-
-
-# Load mesh from file
-
-
-
-
-
-mesh = Mesh("lshape.xml")
-
-# Define function spaces (P2-P1)
-
-
-V = VectorFunctionSpace(mesh, "CG", 2)
-Q = FunctionSpace(mesh, "CG", 1)
-
-# Define trial and test functions
-
-u = TrialFunction(V)
-p = TrialFunction(Q)
-v = TestFunction(V)
-q = TestFunction(Q)
-
-# Set parameter values
-nu = 0.01
-dt = 0.01
-T = 3
-
-# Define time-dependent pressure BC
-p_in = Expression("sin(3.0*t)", t=0.0)
-
-# Define boundary conditions
-noslip  = DirichletBC(V, (0, 0),
-           "on_boundary && \
-           (x[0] < DOLFIN_EPS | x[1] < DOLFIN_EPS | \
-           (x[0] > 0.5 - DOLFIN_EPS && x[1] > 0.5 - DOLFIN_EPS))")
-inflow  = DirichletBC(Q, p_in, "x[1] > 1.0 - DOLFIN_EPS")
-outflow = DirichletBC(Q, 0, "x[0] > 1.0 - DOLFIN_EPS")
-bcu = [noslip]
-bcp = [inflow, outflow]
-
-# Create functions
-u0 = Function(V)
-u1 = Function(V)
-p1 = Function(Q)
-
-# Define coefficients
-k = Constant(dt)
-f = Constant((0, 0))
-
-# Tentative velocity step
-F1 = (1/k)*inner(u - u0, v)*dx + inner(grad(u0)*u0, v)*dx \
-     + nu*inner(grad(u), grad(v))*dx - inner(f, v)*dx
-a1 = lhs(F1)
-L1 = rhs(F1)
-
-# Pressure update
-a2 = inner(grad(p), grad(q))*dx
-L2 = -(1/k)*div(u1)*q*dx
-
-
-# Velocity update
-a3 = inner(u, v)*dx
-L3 = inner(u1, v)*dx - k*inner(grad(p1), v)*dx
-
-
-# Assemble matrices
-A1 = assemble(a1)
-A2 = assemble(a2)
-A3 = assemble(a3)
-
-# Use amg preconditioner if available
-prec = "amg" if has_krylov_solver_preconditioner("amg") 
-             else "default"
-
-# Create files for storing solution
-ufile = File("results/velocity.pvd")
-pfile = File("results/pressure.pvd")
-
-# Time-stepping
-t = dt
-while t < T + DOLFIN_EPS:
-
-    # Update pressure boundary condition
-    p_in.t = t
-
-    
-    # Compute tentative velocity step
-    begin("Computing tentative velocity")
-    b1 = assemble(L1)
-    [bc.apply(A1, b1) for bc in bcu]
-    solve(A1, u1.vector(), b1, "gmres", "default")
-    end()
-
-    # Pressure correction
-    begin("Computing pressure correction")
-    b2 = assemble(L2)
-    [bc.apply(A2, b2) for bc in bcp]
-    solve(A2, p1.vector(), b2, "gmres", prec)
-    end()
-
-    
-    # Velocity correction
-    begin("Computing velocity correction")
-    b3 = assemble(L3)
-    [bc.apply(A3, b3) for bc in bcu]
-    solve(A3, u1.vector(), b3, "gmres", "default")
-    end()
-
-    # Plot solution
-    plot(p1, title="Pressure", rescale=True)
-    plot(u1, title="Velocity", rescale=True)
-
-    # Save to file
-    ufile << u1
-    pfile << p1
-
-    # Move to next time step
-    u0.assign(u1)
-    t += dt
-    print "t =", t
-
-# Hold plot
-interactive()
-
-# Copyright 2011, The FEniCS Project
-\end{lstlisting}}
-
-\colplacechunks
-\end{parcolumns}
-\end{changemargin}
-
-\section{HyperElasticity}
-This time we compare the code with the C++ version of DOLFIN. 
-The problem for an elastic material can be expressed as a minimization problem
-\begin{align*}
-\min_{u \in V} \Pi\\
-\Pi &= \int_{\Omega} \psi(u) \, {\rm d} x - \int_{\Omega} B \cdot u \, {\rm d} x - \int_{\partial\Omega} T \cdot u \, 
-{\rm d} s\\
-\end{align*}
-where $\Pi$  is the total potential energy, $\psi$ is the elastic stored energy, $B$  is a body force and $T$
-is a traction force.
-
-A complete description of the problem is avilable on the Fenics website \cite{hyperelasticity}.
-The final solution will look like figure \ref{Hyp}.
-\begin{figure}
- \begin{center}
-  \includegraphics[height=6 cm,keepaspectratio=true]{./HyperElasticity.png}
-   \caption{Solution of the HyperElasticity problem}
-   \label{Hyp}
-  \end{center}
-\end{figure}
-
-\begin{lstlisting}[caption=UFL code, language=Python, numbers=none]
-# Function spaces
-element = VectorElement("Lagrange", tetrahedron, 1)
-
-# Trial and test functions
-du = TrialFunction(element)     # Incremental displacement
-v  = TestFunction(element)      # Test function
-
-# Functions
-u = Coefficient(element)        # Displacement from previous iteration
-B = Coefficient(element)        # Body force per unit volume
-T = Coefficient(element)        # Traction force on the boundary
-
-# Kinematics
-I = Identity(element.cell().d)  # Identity tensor
-F = I + grad(u)                 # Deformation gradient
-C = F.T*F                       # Right Cauchy-Green tensor
-
-# Invariants of deformation tensors
-Ic = tr(C)
-J  = det(F)
-
-# Elasticity parameters
-mu    = Constant(tetrahedron)
-lmbda = Constant(tetrahedron)
-
-# Stored strain energy density (compressible neo-Hookean model)
-psi = (mu/2)*(Ic - 3) - mu*ln(J) + (lmbda/2)*(ln(J))**2
-
-# Total potential energy
-Pi = psi*dx - inner(B, u)*dx - inner(T, u)*ds
-
-# First variation of Pi (directional derivative about u in the direction of v)
-F = derivative(Pi, u, v)
-
-# Compute Jacobian of F
-J = derivative(F, u, du)
-
-# Copyright 2011, The FEniCS Project
-\end{lstlisting}
-
-\begin{changemargin}{-1.5cm}{-1.5cm}
-$\phantom {u}$
-\begin{parcolumns}[colwidths={1=0.65\textwidth,2=0.65\textwidth}]{2}
-\colchunk{\begin{lstlisting}[caption=Fem-fenics, language=Octave, numbers=none]{Name}
-pkg load fem-fenics msh
-problem = 'HyperElasticity';
-import_ufl_Problem (problem);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Rotation = @(x,y,z) ...
- [0; ...
- 0.5*(0.5 + (y - 0.5)*cos(pi/3) - (z-0.5)*sin(pi/3) - y);...
- 0.5*(0.5 + (y - 0.5)*sin(pi/3) + (z-0.5)*cos(pi/3) - z)];
-
-
-
-
-
-
-# Create mesh and define function space
-x = y = z = linspace (0, 1, 17);
-mshd = Mesh (msh3m_structured_mesh (x, y, z, 1, 1:6));
-V  = FunctionSpace (problem, mshd);
-
-
-
-
-
-
-
-# Create Dirichlet boundary conditions
-bcl = DirichletBC (V, @(x,y,z) [0; 0; 0], 1);
-bcr = DirichletBC (V, Rotation, 2);
-bcs = {bcl, bcr};
-
-# Define source and boundary traction functions
-B = Constant ('B', [0.0; -0.5; 0.0]);
-T = Constant ('T', [0.1; 0.0; 0.0]);
-
-
-
-
-# Set material parameters
-E = 10.0;
-nu = 0.3;
-mu = Constant ('mu', E./(2*(1+nu)));
-lmbda = Constant ('lmbda', E*nu./((1+nu)*(1-2*nu)));
-u = Expression ('u', @(x,y,z) [0; 0; 0]);
-
-# Create (linear) form defining (nonlinear) variational problem
-L = ResidualForm (problem, V, mu, lmbda, B, T, u);
-
-
-
-
-
-
-
-# Solve nonlinear variational problem F(u; v) = 0
-u0 = assemble (L, bcs{:});
-# Create function for the resolution of the NL problem
-function [y, jac] = f (problem, xx, V, bc1, bc2, B, T, mu, lmbda)
-  u = Function ('u', V, xx);
-  a = JacobianForm (problem, V, mu, lmbda, u);
-  L = ResidualForm (problem, V, mu, lmbda, B, T, u);
-  if (nargout == 1)
-    [y, xx] = assemble (L, xx, bc1, bc2);
-  elseif (nargout == 2)
-    [jac, y, xx] = assemble_system (a, L, xx, bc1, bc2);
-  endif
-endfunction
-
-fs = @(xx) f (problem, xx, V, bcl, bcr, B, T, mu, lmbda);
-[x, fval, info] = fsolve (fs, u0, optimset ("jacobian", "on"));
-func = Function ('u', V, x);
-
-# Save solution in VTK format
-save (func, 'displacement');
-
-
-# Plot solution
-plot (func);
-
-
-
-
-#
-\end{lstlisting}}
-
-\colchunk{\begin{lstlisting}[caption=C++, language=C++, numbers=none]{Name}
-#include <dolfin.h>
-#include "HyperElasticity.h"
-
-using namespace dolfin;
-
-// Sub domain for clamp at left end
-class Left : public SubDomain
-{
-  bool inside(const Array<double>& x, bool on_boundary) const
-  {
-    return (std::abs(x[0]) < DOLFIN_EPS) && on_boundary;
-  }
-};
-
-// Sub domain for rotation at right end
-class Right : public SubDomain
-{
-  bool inside(const Array<double>& x, bool on_boundary) const
-  {
-    return (std::abs(x[0] - 1.0) < DOLFIN_EPS) && on_boundary;
-  }
-};
-
-// Dirichlet boundary condition for clamp at left end
-class Clamp : public Expression
-{
-public:
-
-  Clamp() : Expression(3) {}
-
-  void eval(Array<double>& values, const Array<double>& x) const
-  {
-    values[0] = 0.0;
-    values[1] = 0.0;
-    values[2] = 0.0;
-  }
-
-};
-
-// Dirichlet boundary condition for rotation at right end
-class Rotation : public Expression
-{
-public:
-
-  Rotation() : Expression(3) {}
-
-  void eval(Array<double>& values, const Array<double>& x) const
-  {
-    const double scale = 0.5;
-
-    // Center of rotation
-    const double y0 = 0.5;
-    const double z0 = 0.5;
-
-    // Large angle of rotation (60 degrees)
-    double theta = 1.04719755;
-
-    // New coordinates
-    double y = y0 + (x[1]-y0)*cos(theta) - (x[2]-z0)*sin(theta);
-    double z = z0 + (x[1]-y0)*sin(theta) + (x[2]-z0)*cos(theta);
-
-    // Rotate at right end
-    values[0] = 0.0;
-    values[1] = scale*(y - x[1]);
-    values[2] = scale*(z - x[2]);
-  }
-
-};
-
-int main()
-{
-  // Create mesh and define function space
-  UnitCubeMesh mesh (16, 16, 16);
-  HyperElasticity::FunctionSpace V(mesh);
-
-  // Define Dirichlet boundaries
-  Left left;
-  Right right;
-
-  // Define Dirichlet boundary functions
-  Clamp c;
-  Rotation r;
-
-  // Create Dirichlet boundary conditions
-  DirichletBC bcl(V, c, left);
-  DirichletBC bcr(V, r, right);
-  std::vector<const BoundaryCondition*> bcs;
-  bcs.push_back(&bcl); bcs.push_back(&bcr);
-
-  // Define source and boundary traction functions
-  Constant B(0.0, -0.5, 0.0);
-  Constant T(0.1,  0.0, 0.0);
-
-  // Define solution function
-  Function u(V);
-
-  // Set material parameters
-  const double E  = 10.0;
-  const double nu = 0.3;
-  Constant mu(E/(2*(1 + nu)));
-  Constant lambda(E*nu/((1 + nu)*(1 - 2*nu)));
-
-
-  
-  // Create (linear) form defining (nonlinear) variational problem
-  HyperElasticity::ResidualForm F(V);
-  F.mu = mu; F.lmbda = lambda; F.B = B; F.T = T; F.u = u;
-
-  // Create jacobian dF = F' (for use in nonlinear solver).
-  HyperElasticity::JacobianForm J(V, V);
-  J.mu = mu; J.lmbda = lambda; J.u = u;
-
-  // Solve nonlinear variational problem F(u; v) = 0
-  solve(F == 0, u, bcs, J);
-
-
-
-
-
-
-
-
-
-
-
-
-  
-  
-  
-  
-  
-  
-  
-
-
-
-  // Save solution in VTK format
-  File file("displacement.pvd");
-  file << u;
-
-  // Plot solution
-  plot(u);
-  interactive();
-
-  return 0;
-}
-# Copyright 2011, The FEniCS Project
-\end{lstlisting}}
-
-\colplacechunks
-\end{parcolumns}
-\end{changemargin}
-
-\iffalse
-\section{Fictitious Domain}
-A penalization method to take into account obstacles in incompressible viscous flows
-\fi
-\newpage 
-
-\backmatter
-
-\appendix
-\chapter{API reference}\label{app}
-
-\section{Import problem defined with ufl}
-\subsection*{import\_ufl\_BilinearForm}
-\subimport{latex/}{API/import_ufl_BilinearForm.tex}
-\subsection*{import\_ufl\_LinearForm}
-\subimport{latex/}{API/import_ufl_LinearForm.tex}
- \subsection*{ import\_ufl\_Functional}
- \subimport{latex/}{API/import_ufl_Functional.tex}
- \subsection*{ import\_ufl\_FunctionSpace}
-  \subimport{latex/}{API/import_ufl_FunctionSpace.tex}
- \subsection*{ import\_ufl\_Problem}
-   \subimport{latex/}{API/import_ufl_Problem.tex}
-\section{Problem geometry and FE space}
- \subsection*{ Mesh}
- \subimport{latex/}{API/Mesh.tex}
- \subsection*{ FunctionSpace}
-  \subimport{latex/}{API/FunctionSpace.tex}
- \subsection*{ SubSpace}
-   \subimport{latex/}{API/SubSpace.tex}
-\section{Problem variables}
- \subsection*{ Constant}
-   \subimport{latex/}{API/Constant.tex}
- \subsection*{ Expression}
-   \subimport{latex/}{API/Expression.tex}
- \subsection*{ Function}
-  \subimport{latex/}{API/Function.tex}
- \subsection*{ DirichletBC}
-  \subimport{latex/}{API/DirichletBC.tex}
-\section{Definition of the abstract Variational problem}
- \subsection*{ BilinearForm}
-  \subimport{latex/}{API/BilinearForm.tex}
-\subsection*{  LinearForm}
-  \subimport{latex/}{API/LinearForm.tex}
-\subsection*{  ResidualForm}
-  \subimport{latex/}{API/ResidualForm.tex}
- \subsection*{ JacobianForm}
-   \subimport{latex/}{API/JacobianForm.tex}
- \subsection*{ Functional}
-      \subimport{latex/}{API/Functional.tex}
-\section{Creation of the discretized problem}
-\subsection*{  assemble}
-\subimport{latex/}{API/assemble.tex}
-\subsection*{  assemble\_system}
-\subimport{latex/}{API/assemble_system.tex}
-\section{Post processing}
-\subsection*{  @function/save}
-\subimport{latex/}{API/save.tex}
-\subsection*{  @function/plot}
-\subimport{latex/}{API/plot.tex}
-\subsection*{  @mesh/plot}
-\subimport{latex/}{API/plot_m.tex}
-\subsection*{  @function/feval}
-\subimport{latex/}{API/feval.tex}
-
-
-
-
-\chapter{Autoconf and Automake}
- In this section we want to discuss how we can write a config.ac and a Makefile.in files which:
-\begin{itemize}
-    \item check if a program is available and stop if it is not
-    \item check if a header file is available and issue a warning if not, but go ahead with the compilation
-\end{itemize}
-
-To reach this goal, we need two components:
-
-\paragraph{configure.ac} Is a file which checks whether the program/header is available or not 
-and sets consequently the values of some variables.
-\begin{lstlisting}[language=make]
-    # Checks if the program mkoctfile is available and sets the variable HAVE_MKOCTFILE consequently
-    AC_CHECK_PROG([HAVE_MKOCTFILE], [mkoctfile], [yes], [no])
-    # if mkoctfile is not available, it issues an error and stops the compilation
-    if [test $HAVE_MKOCTFILE = "no"]; then 
-      AC_MSG_ERROR([mkoctfile required to install $PACKAGE_NAME])
-    fi
-
-    #Checks if the header dolfin.h is available; if it is available, the value of the ac_dolfin_cpp_flags is substituted with -DHAVE_DOLFIN_H, otherwise it is left empty and a warning message is printed
-    AC_CHECK_HEADER([dolfin.h],
-      [AC_SUBST(ac_dolfin_cpp_flags,-DHAVE_DOLFIN_H)  AC_SUBST(ac_dolfin_ld_flags,-ldolfin)],
-      [AC_MSG_WARN([dolfin headers could not be found, some functionalities will be disabled, don't worry your package will still be working, though.])] ).
-
-    # It generates the Makefile, using the template described below
-    AC_CONFIG_FILES([Makefile])
-\end{lstlisting} 
-\paragraph{Makefile.ac} This file is a template for the Makefile, which will be automatically generated when the configure.ac 
-file is executed. The values of the variable \verb$ac_dolfin_cpp_flags$ and \verb$ac_dolfin_ld_flags$ are substituted with the 
-results obtained above:
-\begin{lstlisting}[language=make]
-    CPPFLAGS += @ac_dolfin_cpp_flags@
-    LDFLAGS += @ac_dolfin_ld_flags@
-\end{lstlisting}
-
-In this way, if dolfin.h is available, CPPFLAGS contains also the flag -DHAVE\_DOLFIN\_H.
-
-\paragraph {program.cc}  Our .cc program, should thus include the header dolfin.h only if 
-\verb$-DHAVE_DOLFIN_H$ is defined at compilation time.
-For example
-
-\begin{lstlisting}
-    #ifdef HAVE_DOLFIN_H
-    #include <dolfin.h> 
-    #endif
-    int main ()
-    {  
-
-    #ifndef HAVE_DOLFIN_H
-        error("program: the program was built without support for dolfin");
-    #else 
-      /* Body of your function */
-    #endif
-     return 0;
-    }
-
-\end{lstlisting} 
-\iffalse
-\paragraph {Warning} If in the Makefile.in you write something like
-\begin{lstlisting}[language=make]
-    HAVE_DOLFIN_H = @HAVE_DOLFIN_H@  
-    ifdef HAVE_DOLFIN_H   
-      CPPFLAGS += -DHAVE_DOLFIN_H  
-      LIBS += -ldolfin
-    endif
- \end{lstlisting} 
- it doesn't work because the variable \verb$HAVE_DOLFIN_H$ seems to be always defined, even if the header is not available.
-\fi
-
-\bibliographystyle{unsrt} 
-\bibliography{doc}
-\end{document}
Binary file doc/mesh_1.png has changed
--- a/doc/presentation/Mox_30_01/Makefile	Thu Jan 30 09:14:35 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-SLIDES=fem-library.pdf
-
-all: $(SLIDES)
-
-%.pdf: %.tex beamerthemeOctave.sty octave-header.png
-	pdflatex $*.tex
-	pdflatex $*.tex
-	pdflatex $*.tex
-
-clean:
-	$(RM) -f *.aux *.log *.nav *.out *.snm *.toc *~ *.backup *.vrb
-
-distclean: clean 
-	$(RM) -f $(SLIDES)
--- a/doc/presentation/Mox_30_01/beamerthemeOctave.sty	Thu Jan 30 09:14:35 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-\usetheme{Rochester}
-
-\RequirePackage{pgf}
-
-\pgfdeclareimage[width=1.0\paperwidth]{octave-header}{octave-header}
-
-\pgfdeclareimage[height=0.03\paperwidth]{cc-header}{cc-header}
-
-\setbeamertemplate{blocks}[rounded][shadow=true]
-
-\beamer@headheight=0.13\paperwidth
-
-\definecolor{octaveorange}{HTML}{F7800A}
-\definecolor{octavegray}{HTML}{686868}
-\definecolor{octavelightgray}{HTML}{EEEEEE}
-\definecolor{octaveblue}{HTML}{236EAF}
-\setbeamercolor*{Title bar}{fg=octaveblue}
-\setbeamercolor*{Location bar}{fg=octaveorange,bg=octavelightgray}
-\setbeamercolor*{frametitle}{parent=Title bar}
-\setbeamercolor*{block title}{bg=octaveblue,fg=white}
-\setbeamercolor*{block body}{bg=octavelightgray,fg=octavegray}
-\setbeamercolor*{normal text}{bg=white,fg=octavegray}
-\setbeamercolor*{section in head/foot}{bg=octaveblue,fg=white}
-
-\usecolortheme[named=octaveblue]{structure}
-
-\setbeamerfont{section in head/foot}{size=\tiny,series=\normalfont}
-\setbeamerfont{frametitle}{size=\Large,series=\bfseries}
-
-\setbeamertemplate{title page}[default][colsep=-4bp,rounded=true,shadow=true,header=false]
-%\setbeamertemplate{headline}
-\setbeamertemplate{frametitle}
-{
-  \vskip-0.125\beamer@headheight
-  \vskip-\baselineskip
-  \vskip-0.2cm
-  \hskip1.0cm\usebeamerfont*{frametitle}\insertframetitle
-  \vskip-0.10em
-  \hskip1.0cm\usebeamerfont*{framesubtitle}\insertframesubtitle
-}
-
-\setbeamertemplate{headline}
-{
-  \pgfuseimage{octave-header}
-  \vskip -1.95cm
-  \linethickness{0.0pt}
-
-  \framelatex{
-  \begin{beamercolorbox}[wd=\paperwidth,ht=0.3\beamer@headheight]{Title bar}
-    \usebeamerfont{section in head/foot}%
-    \insertsectionnavigationhorizontal{0pt}{\hskip1.2cm}{}%
-  \end{beamercolorbox}}
-
-  \framelatex{
-  \begin{beamercolorbox}[wd=\paperwidth,ht=0.7\beamer@headheight]{Title bar}
-  \end{beamercolorbox}}
-}
-
-\setbeamertemplate{footline}
-{
- % \pgfuseimage{cc-header}
-  \linethickness{0.25pt}
-  \framelatex{
-  \begin{beamercolorbox}[leftskip=.3cm,wd=\paperwidth,ht=0.3\beamer@headheight,sep=0.1cm]{Location bar}
-    \usebeamerfont{section in head/foot}%
-    \insertshortauthor~|~\insertshorttitle
-    \hfill
-    \insertframenumber/\inserttotalframenumber
-  \end{beamercolorbox}}
-}
-
-
--- a/doc/presentation/Mox_30_01/esempi/classe.cc	Thu Jan 30 09:14:35 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-#include <dolfin.h>
-#include <octave/oct.h>
-class mesh : public octave_base_value
-{
- public:
-  mesh () : octave_base_value () {}
-
-  mesh (Array<double>& p, Array<octave_idx_type>& e, 
-        Array<octave_idx_type>& t);
-
-  ~mesh(void) {}
-
-  bool is_defined (void) const { return true; }
-
-  const dolfin::Mesh & get_msh (void) const { return *pmsh; }
-
- private:
-  boost::shared_ptr<const dolfin::Mesh> pmsh;
-  
-  DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA;
-  DECLARE_OCTAVE_ALLOCATOR; 
-};
-static bool mesh_type_loaded = false;
-
-
-
-
-
-#define DECLARE_OCTAVE_ALLOCATOR \
-  public: \
-    void *operator new (size_t size, void *p) \
-      { return ::operator new (size, p); } \
-    void operator delete (void *p, void *) \
-      { ::operator delete (p); } \
-    void *operator new (size_t size) { return allocator.alloc (size); } \
-    void operator delete (void *p, size_t size) { allocator.free (p, size); } \
-  private: \
-    static octave_allocator allocator;
-
-
-#define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA(VIRTUAL) \
-  public: \
-    VIRTUAL int type_id (void) const { return t_id; } \
-    VIRTUAL std::string type_name (void) const { return t_name; } \
-    VIRTUAL std::string class_name (void) const { return c_name; } \
-    static int static_type_id (void) { return t_id; } \
-    static std::string static_type_name (void) { return t_name; } \
-    static std::string static_class_name (void) { return c_name; } \
-    static void register_type (void); \
- \
-  private: \
-    static int t_id; \
-    static const std::string t_name; \
-    static const std::string c_name;
-
-
-DEFINE_OCTAVE_ALLOCATOR (mesh);
-//#define DEFINE_OCTAVE_ALLOCATOR(t) \
-//  octave_allocator t::allocator (sizeof (t))
-
-
-DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (mesh, "mesh", "mesh");
-// #define DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(t, n, c) \
-//  int t::t_id (-1); \
-//  const std::string t::t_name (n); \
-//  const std::string t::c_name (c); \
-//  void t::register_type (void) \
-//  { \
-//  static t exemplar; \
-//  octave_value v (&exemplar, true); \
-//  t_id = octave_value_typeinfo::register_type (t::t_name, t::c_name, v); \
-//  }
--- a/doc/presentation/Mox_30_01/esempi/func.cc	Thu Jan 30 09:14:35 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-DEFUN_DLD (FunctionSpace, args, , "initialize a FunctionSpace from a mesh")
-{
-int nargin = args.length ();
-octave_value retval;
-
-if (! mesh_type_loaded)
-  {
-    mesh::register_type ();
-    mesh_type_loaded = true;
-    mlock ();
-  }
-
-if (args(0).type_id () == mesh::static_type_id ())
-  {
-  // 1 read data
-  const mesh & msho = static_cast<const mesh&>(args(0).get_rep ());
-
-  // 2 extract the data stored in the Octave class as a DOLFIN obj
-  const dolfin::Mesh & mshd = msho.get_msh ()
-
-  // 3 build a new object using DOLFIN
-  boost::shared_ptr <const dolfin::FunctionSpace> g 
-                (new Poisson::FunctionSpace (mshd));
-
-  // 4 convert the new object from DOLFIN to Octave and return it
-  retval = new functionspace (g);
-  return retval;
-  }
-}
--- a/doc/presentation/Mox_30_01/esempi/generate_fs.m	Thu Jan 30 09:14:35 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-function output = generate_fs (ufl_name)
-
-STRING ="\n\
-#include <fem-fenics/functionspace.h>\n\
-#include <fem-fenics/mesh.h>\n\
-#include ""@@UFL_NAME@@.h""\n\
-\n\
-DEFUN_DLD (@@UFL_NAME@@_FunctionSpace, args, , ""initialize a fs"")\n\
-{\n\
-  ...\n\
-          const mesh & msho = static_cast<const mesh&> (args(0).get_rep ());\n\
-          const dolfin::Mesh & mshd = msho.get_msh ();\n\
-          boost::shared_ptr <const dolfin::FunctionSpace> g (new @@UFL_NAME@@::FunctionSpace (mshd));\n\
-  ...\n\
-          retval = new functionspace(g);\n\
-  return retval;\n\
-}";
-
-STRING =  strrep (STRING, "@@UFL_NAME@@", ufl_name);
-
-fid = fopen (sprintf ("%s_FunctionSpace.cc", ufl_name), );
-endfunction
--- a/doc/presentation/Mox_30_01/esempi/import_ufl_FunctionSpace.m	Thu Jan 30 09:14:35 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-function import_ufl_FunctionSpace (var_prob)
-  ...
-
-  % funzione che scrive il file .cc includendo l header specifico
-  output = generate_fs (var_prob);
-  % funzione che scrive il makefile per
-  % 1) Compilare l header Poisson.ufl
-  % 2) Compila Poisson_FunctionSpace.cc
-  output += generate_makefile (var_prob, private);
-  if output != 0
-    error ("Compilation failed");
-  else
-    % il makefile viene eseguito in un terminale
-    [output, textfile] = system (sprintf ("make -f Makefile_%s fs", var_prob));
-    [output, textfile] = system (sprintf ("make -f Makefile_%s clean", var_prob));
-
-  endif
-
-endfunction
--- a/doc/presentation/Mox_30_01/fem-library.tex	Thu Jan 30 09:14:35 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,233 +0,0 @@
-\documentclass[10pt]{beamer}
-
-
-\usetheme{Octave}
-\usepackage{thumbpdf}
-\usepackage{wasysym}
-\usepackage{ucs}
-\usepackage[utf8]{inputenc}
-\usepackage{pgf,pgfarrows,pgfnodes,pgfautomata,pgfheaps,pgfshade}
-\usepackage{verbatim}
-\usepackage{listings}
-\usepackage{attachfile}
-\usepackage{mathtools}
-\usepackage{parcolumns}
-\usepackage[framemethod=TikZ]{mdframed}
-\usepackage[strict]{changepage}
-
-
-\lstset{
-	language=C++,
-	keywordstyle=\bfseries\ttfamily\color[rgb]{0,0,1},
-	identifierstyle=\ttfamily,
-	commentstyle=\color[rgb]{0.133,0.545,0.133},
-	stringstyle=\ttfamily\color[rgb]{0.627,0.126,0.941},
-	showstringspaces=false,
-	basicstyle=\scriptsize,
-	numberstyle=\tiny,
-	numbers=left,
-	stepnumber=1,
-	numbersep=10pt,
-	tabsize=2,
-	breaklines=true,
-	prebreak = \raisebox{0ex}[0ex][0ex]{\ensuremath{\hookleftarrow}},
-	breakatwhitespace=false,
-	aboveskip={1.5\baselineskip},
-        columns=fixed,
-        upquote=true,
-        extendedchars=true,
-}
-
-
-
-
-\title{Fem-fenics}
-\subtitle{Una libreria di elementi finiti per Octave}
-\author[Marco Vassallo]{\bf Marco Vassallo }
-\date{30 Gennaio 2014}
-\begin{document}
-
-\frame[plain]{\titlepage}
-
-\section*{}
-\begin{frame}
-  \frametitle{Outline}
-  \tableofcontents[section=2]
-\end{frame}
-
-\AtBeginSection[]
-{\frame<handout:0>{\frametitle{Outline}\tableofcontents[currentsection]}}
-
-%\AtBeginSubsection[]
-%{\frame<handout:0>{\frametitle{Outline}\tableofcontents[sectionstyle=show/hide,subsectionstyle=show/shaded/hide]}}
-
-\newcommand<>{\highlighton}[1]{%
-\alt#2{\structure{#1}}{{#1}}}
-
-\newcommand{\icon}[1]{\pgfimage[height=1em]{#1}}
-
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
-%%%%%%%%%% Content starts here %%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
-
-\section{Una libreria di elementi finiti per Octave}
-\subsection{Introduzione}
-\begin{frame}[fragile]{Why?}
-    \begin{itemize}
-      \item Non vi è una libreria generica in Octave (msh, fpl, bim, ..)
-      \item Lasciare all'utente la scelta di utilizzare il linguaggio che preferisce
-      \item Sfruttare le potenzialità di Octave per la risoluzione di sistemi lineari
-      e sistemi di o.d.e
-      \item Migliorare i punti deboli dell'interfaccia Python 
-    \end{itemize}
-
-\end{frame}
-
-\begin{frame}
-\frametitle{Installazione, Documentazione, Wiki, ...}
-\only<1>{
-\texttt{pkg install fem-fenics -forge}
-\begin{center}
-\includegraphics[width=.9\linewidth]{inst.png}
-\end{center}
-}
-
-
-\only<2>{
-\url{http://wiki.octave.org/Fem-fenics}
-\begin{center}
-\includegraphics[width=.9\linewidth]{wiki.png}
-\end{center}
-}
-
-
-\only<3>{
-\url{http://octave.sourceforge.net/fem-fenics/overview.html}
-\begin{center}
-\includegraphics[width=.9\linewidth]{func.png}
-\end{center}
-}
-\end{frame}
-
-\subsection{Esempi}
-
-\begin{frame}[fragile]{Poisson}
-\scriptsize
-\only<1>{
-\includegraphics[width=1.\linewidth]{pois.png}}
-
-\only<2>{
-\includegraphics[width=1.\linewidth]{pois2.png}}
-
-\end{frame}
-
-\begin{frame}[fragile]{Navier Stokes}
-\scriptsize
-\includegraphics[width=1.\linewidth]{ns.png}
-\end{frame}
-
-\begin{frame}[fragile]{Mixed Poisson}
-\scriptsize
-\includegraphics[width=1.\linewidth]{mixed.png}
-
-\end{frame}
-
-\begin{frame}[fragile]{Elasticity}
-\scriptsize
-\includegraphics[width=1.\linewidth]{hyper.png}
-\end{frame}
-
-\section{Implementazione}
-
-\begin{frame}[fragile]{Octave e C++}
-    \begin{itemize}
-      \item Octave è principalmente scritto in C++ (script, Fortran)
-      \item Octave offre un'interfaccia per includere codice C++ come ``dinamically linked extension'' 
-      \item Una volta compilato (\texttt{mkoctfile}) il codice può essere chiamato dall' ``interpreter'' come
-            ogni altra funzione
-      \item Octave offre la possibilità di aggiungere nuove classi all'``interpreter''
-    \end{itemize}
-\end{frame}
-
-\begin{frame}[fragile]{Il problema}
-\includegraphics[width=1.\linewidth]{octfem.png}
-\end{frame}
-
-\begin{frame}[fragile]{Class design}
-\only<1>{\lstinputlisting[language=C++,linerange=1-23,firstnumber=1]{./esempi/classe.cc}}
-\only<2>{\lstinputlisting[language=C++,linerange=41-54,firstnumber=last]{./esempi/classe.cc}}
-\only<3>{\lstinputlisting[language=C++,linerange=29-38,firstnumber=last]{./esempi/classe.cc}}
-%\only<4>{\lstinputlisting[language=C++,linerange=57-72,firstnumber=last]{./esempi/classe.cc}}
-\pause
-%\attachfile[icon=Paperclip]{./esempi/classe.cc}{source code of the example}
-\end{frame}
-
-\begin{frame}[fragile]{Funzioni dinamiche in Octave}
-\only<1>{\lstinputlisting[language=C++,linerange=1-17,firstnumber=1]{./esempi/func.cc}}
-\only<2>{\lstinputlisting[language=C++,linerange=18-29,firstnumber=last]{./esempi/func.cc}}
-\pause
-%\attachfile[icon=Paperclip]{./esempi/func.cc}{source code of the example}
-\end{frame}
-
-\begin{frame}[fragile]{Perchè abbiamo due file ?}
-Come funziona Fenics in C++
-\begin{itemize}
- \item Problema risolto in due file: \texttt{Poisson.ufl} e \texttt{Poisson.cc}
- \item Problema astratto definito dall'utente nel file \texttt{Poisson.ufl} .
- \item Il file viene compilato dall'utente e viene generato l'header  \texttt{Poisson.h} 
- \item \texttt{Poisson.h} contiene la definizione della classe Poisson e dei costruttori delle forme
- (bi)lineari e dello spazio funzionale
- \item L'header viene incluso nel file \texttt{Poisson.cc} e il problema risolto
- \begin{lstlisting}
-#include "Poisson.h"
-int main()
-{
-  UnitSquareMesh mesh(32, 32);
-  Poisson::FunctionSpace V(mesh);
-  Poisson::BilinearForm a(V, V);
-  Poisson::LinearForm L(V);
-  ...
- \end{lstlisting}
-
-\end{itemize}
-\end{frame}
-
-\begin{frame}[fragile]{Code on the fly}
-\lstinputlisting[language=C++,linerange=1-22,firstnumber=1]{./esempi/import_ufl_FunctionSpace.m}
-%\only<2>{\lstinputlisting[language=C++,linerange=1-32,firstnumber=1]{./esempi/generate_fs.m}}
-%\pause
-%\attachfile[icon=Paperclip]{./esempi/func.cc}{source code of the example}
-\end{frame}
-
-
-\begin{frame}[fragile]{Code on the fly}
-\lstinputlisting[language=C++,linerange=1-22,firstnumber=1]{./esempi/generate_fs.m}
-%\attachfile[icon=Paperclip]{./esempi/func.cc}{source code of the example}
-\end{frame}
-
-\begin{frame}[fragile]{Implementzione}
- Altri aspetti implementativi descritti nella documentazione
- \begin{itemize}
-  \item Conversione da (p, e, t) a dolfin xml
-  \item Estensione del pkg msh con la funzione \texttt{mshm\_refine ()}
-  \item Conversione da csc a csr
-  \item Polimorfismo (save, plot)
-  \item Autoconf, Automake e la generazione del pkg
- \end{itemize}
-\end{frame}
-
-\begin{frame}[fragile]{Conclusione}
-La prima versione del pkg è stata rilasciata, ma ancora del 
-lavoro resta da fare
- \begin{itemize}
-  \item TODO sulla wiki
-  \item Aggiungere funzioni disponibili in Fenics
-  \item Estendere con nuovi esempi
-  \item Migliorare la gestione delle matrici
-  \item Controllare che tutto funzioni anche con le nuove versioni di Octave e Fenics
-  \item ...
- \end{itemize}
-\end{frame}
-\end{document}
Binary file doc/presentation/Mox_30_01/func.png has changed
Binary file doc/presentation/Mox_30_01/hyper.png has changed
Binary file doc/presentation/Mox_30_01/inst.png has changed
Binary file doc/presentation/Mox_30_01/mixed.png has changed
Binary file doc/presentation/Mox_30_01/ns.png has changed
Binary file doc/presentation/Mox_30_01/octave-header.png has changed
Binary file doc/presentation/Mox_30_01/octfem.png has changed
Binary file doc/presentation/Mox_30_01/pois.png has changed
Binary file doc/presentation/Mox_30_01/pois2.png has changed
Binary file doc/presentation/Mox_30_01/wiki.png has changed