55 
\end{equation} 
\end{equation} 
56 


57 
\section{Meshes} 
\section{Meshes} 
58 

\label{FINLEY MESHES} 
59 
To understand the usage of \finley one needs to have an understanding of how the finite element meshes 
To understand the usage of \finley one needs to have an understanding of how the finite element meshes 
60 
\index{FEM!mesh} are defined. \fig{FINLEY FIG 0} shows an example of the 
\index{FEM!mesh} are defined. \fig{FINLEY FIG 0} shows an example of the 
61 
subdivision of an ellipse into so called elements \index{FEM!elements} \index{element}. 
subdivision of an ellipse into so called elements \index{FEM!elements} \index{element}. 
66 
In the example of \fig{FINLEY FIG 0} a linear polynomial is used on each triangle. As one can see, the triangulation 
In the example of \fig{FINLEY FIG 0} a linear polynomial is used on each triangle. As one can see, the triangulation 
67 
is quite a poor approximation of the ellipse. It can be improved by introducing a midpoint on each element edge then 
is quite a poor approximation of the ellipse. It can be improved by introducing a midpoint on each element edge then 
68 
positioning those nodes located on an edge expected to describe the boundary, onto the boundary. 
positioning those nodes located on an edge expected to describe the boundary, onto the boundary. 
69 
In this case the triangle gets a curved edge which requires a parametrization of the triangle using a 
In this case the triangle gets a curved edge which requires a parameterization of the triangle using a 
70 
quadratic polynomial. For this case, the solution is also approximated by a piecewise quadratic polynomial 
quadratic polynomial. For this case, the solution is also approximated by a piecewise quadratic polynomial 
71 
(which explains the name isoparametrical elements), see \Ref{Zienc,NumHand} for more details. 
(which explains the name isoparametrical elements), see \Ref{Zienc,NumHand} for more details. 
72 
\finley supports macro elements\index{macro elements}. For these elements a piecewise linear approximation is used on an element which is further subdivided (in the case \finley halved). As such these elements do not provide more than a further mesh refinement but should be used in the case of incompressible flows, see \class{StokesProblemCartesian}. For these problems a linear approximation of the pressure across the element is used (use the \ReducedSolutionFS \FunctionSpace) while the refined element is used to approximate velocity. So a macro element provides a continuous pressure approximation together with a velocity approximation on a refined mesh. This approach is necessary to make sure that the incompressible flow has a unique solution. 
\finley supports macro elements\index{macro elements}. For these elements a piecewise linear approximation is used on an element which is further subdivided (in the case \finley halved). As such these elements do not provide more than a further mesh refinement but should be used in the case of incompressible flows, see \class{StokesProblemCartesian}. For these problems a linear approximation of the pressure across the element is used (use the \ReducedSolutionFS \FunctionSpace) while the refined element is used to approximate velocity. So a macro element provides a continuous pressure approximation together with a velocity approximation on a refined mesh. This approach is necessary to make sure that the incompressible flow has a unique solution. 
263 
\input{finleyelements} 
\input{finleyelements} 
264 
\clearpage 
\clearpage 
265 


266 

\begin{figure}[th] 
267 

\begin{center} 
268 

\subfigure[Triangle]{\label{FINLEY MACRO TRI}\includegraphics[scale=0.25]{figures/FinleyMacroTri}} 
269 

\subfigure[Quadrilateral]{\label{FINLEY MACRO REC}\includegraphics[scale=0.25]{figures/FinleyMacroRec}} 
270 

\includegraphics[scale=0.2]{figures/FinleyMacroLeg} 
271 

\end{center} 
272 

Macro elements in \finley. 
273 

\end{figure} 
274 


275 
\section{Macro Elements} 
\section{Macro Elements} 
276 
\label{SEC FINLEY MACRO} 
\label{SEC FINLEY MACRO} 
277 

\finley supports the usage of macro elements~\index{macro elements} which can be used to 
278 

achieve LBB compliance when solving incompressible fluid flow problems. LBB compliance is required to 
279 

get a problem which has a unique solution for pressure and velocity. For macro elements the 
280 

pressure and velocity are approximated by a polynomial of order 1 but the velocity approximation bases on a refinement of the element. The nodes of a triangle and quadrilateral element is shown in Figures~\ref{FINLEY MACRO TRI} and~\ref{FINLEY MACRO REC}, respectively. In essence, the velocity uses the same nodes like a quadratic polynomial approximation but replaces the quadratic polynomial by piecewise linear polynomials. In fact, this is the 
281 

way \finley is defining the macro elements. In particular \finley uses the same local ordering of the nodes for the macro element as for the corresponding quadratic element. Another interpretation is that 
282 

one uses a linear approximation of the velocity together with a linear approximation of the pressure but on elements 
283 

created by combining elements to macro elements. Notice that the macro elements still use quadratic interpolation to represent the element and domain boundary. However, if elements have linear boundary 
284 

a macro element approximation for the velocity is equivalent to using a linear approximation on a mesh which is created through a one step, global refinement. 
285 

Typically macro elements are only required to use when an incompressible fluid flow problem 
286 

is solved, e.g the Stokes problem in Section \ref{STOKES PROBLEM}. Please see Section~\ref{FINLEY MESHES} for 
287 

more details on the supported macro elements. 
288 


289 


290 


474 
\caption{Preconditioners available for \finley and the \PASO package and the relevant options in \class{SolverOptions}. \label{TAB FINLEY SOLVER OPTIONS 2}} 
\caption{Preconditioners available for \finley and the \PASO package and the relevant options in \class{SolverOptions}. \label{TAB FINLEY SOLVER OPTIONS 2}} 
475 
\end{table} 
\end{table} 
476 


477 
\subsection{Linear Solvers in \SolverOptions} 
\section{Linear Solvers in \SolverOptions} 
478 
Table~\ref{TAB FINLEY SOLVER OPTIONS 1} and 
Table~\ref{TAB FINLEY SOLVER OPTIONS 1} and 
479 
Table~\ref{TAB FINLEY SOLVER OPTIONS 2} show the solvers and preconditioners supported by 
Table~\ref{TAB FINLEY SOLVER OPTIONS 2} show the solvers and preconditioners supported by 
480 
\finley through the \PASO library. Currently direct solvers are not supported under MPI. 
\finley through the \PASO library. Currently direct solvers are not supported under MPI. 
481 
By default, \finley is using the iterative solvers \PCG for symmetric and \BiCGStab for nonsymmetric problems. 
By default, \finley is using the iterative solvers \PCG for symmetric and \BiCGStab for nonsymmetric problems. 
482 
If the direct solver is selected which can be useful when solving very illposedequations 
If the direct solver is selected which can be useful when solving very illposed equations 
483 
\finley uses the \MKL \footnote{If the stiffness matrix is nonregular \MKL may return without 
\finley uses the \MKL \footnote{If the stiffness matrix is nonregular \MKL may return without 
484 
returning a proper error code. If you observe suspicious solutions when using MKL, this may cause by a noninvertible operator. } solver package. If \MKL is not available \UMFPACK is used. If \UMFPACK is not available 
returning a proper error code. If you observe suspicious solutions when using MKL, this may cause by a noninvertible operator. } solver package. If \MKL is not available \UMFPACK is used. If \UMFPACK is not available 
485 
a suitable iterative solver from the \PASO is used. 
a suitable iterative solver from the \PASO is used. 
486 


487 
\subsection{Functions} 
\section{Functions} 
488 
\begin{funcdesc}{ReadMesh}{fileName \optional{, \optional{integrationOrder=1}, optimize=True}} 
\begin{funcdesc}{ReadMesh}{fileName \optional{, \optional{integrationOrder=1}, optimize=True}} 
489 
creates a \Domain object form the FEM mesh defined in 
creates a \Domain object form the FEM mesh defined in 
490 
file \var{fileName}. The file must be given the \finley file format. 
file \var{fileName}. The file must be given the \finley file format. 
505 
an appropriate integration order is chosen independently. 
an appropriate integration order is chosen independently. 
506 
By default the labeling of mesh nodes and element distribution is 
By default the labeling of mesh nodes and element distribution is 
507 
optimized. Set \var{optimize=False} to switch off relabeling and redistribution. 
optimized. Set \var{optimize=False} to switch off relabeling and redistribution. 
508 
If \var{useMacroElements} is set, second order elements are interpreated as macro elements~\index{macro elements}. 
If \var{useMacroElements} is set, second order elements are interpreted as macro elements~\index{macro elements}. 
509 
Currently \function{ReadGmsh} does not support MPI. 
Currently \function{ReadGmsh} does not support MPI. 
510 
\end{funcdesc} 
\end{funcdesc} 
511 


512 
\begin{funcdesc}{MakeDomain}{design\optional{, integrationOrder=1\optional{, optimizeLabeling=True\optional{, useMacroElements=False}}}} 
\begin{funcdesc}{MakeDomain}{design\optional{, integrationOrder=1\optional{, optimizeLabeling=True\optional{, useMacroElements=False}}}} 
513 
Creates a Finley \Domain from a \class{Design} object using \gmshextern. 
Creates a Finley \Domain from a \class{Design} object from \pycad using \gmshextern. 
514 
The \class{Design} \var{design} defines the geometry. 
The \class{Design} \var{design} defines the geometry. 
515 
If \var{integrationOrder} is positive, a numerical integration scheme 
If \var{integrationOrder} is positive, a numerical integration scheme 
516 
chosen which is accurate on each element up to a polynomial of 
chosen which is accurate on each element up to a polynomial of 
524 


525 
\begin{funcdesc}{load}{fileName} 
\begin{funcdesc}{load}{fileName} 
526 
recovers a \Domain object from a dump file created by the \ 
recovers a \Domain object from a dump file created by the \ 
527 
eateseates a \Domain object form the FEM mesh defined in 
\function{dump} method of a \Domain object defined in 
528 
file \var{fileName}. The file must be given the \finley file format. 
file \var{fileName}. 

If \var{integrationOrder} is positive, a numerical integration scheme 


chosen which is accurate on each element up to a polynomial of 


degree \var{integrationOrder} \index{integration order}. Otherwise 


an appropriate integration order is chosen independently. 

529 
\end{funcdesc} 
\end{funcdesc} 
530 


531 

