/[escript]/trunk/doc/user/finley.tex
ViewVC logotype

Diff of /trunk/doc/user/finley.tex

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/esys2/doc/user/finley.tex revision 107 by jgs, Thu Jan 27 06:21:48 2005 UTC trunk/doc/user/finley.tex revision 1700 by lgraham, Thu Aug 14 03:35:46 2008 UTC
# Line 1  Line 1 
1    %
2  % $Id$  % $Id$
3    %
4    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5    %
6    %           Copyright 2003-2007 by ACceSS MNRF
7    %       Copyright 2007 by University of Queensland
8    %
9    %                http://esscc.uq.edu.au
10    %        Primary Business: Queensland, Australia
11    %  Licensed under the Open Software License version 3.0
12    %     http://www.opensource.org/licenses/osl-3.0.php
13    %
14    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
15    %
16    
17    \chapter{ The Module \finley}
 \chapter{ The module \finley}  
18   \label{CHAPTER ON FINLEY}   \label{CHAPTER ON FINLEY}
19    
20  \begin{figure}  \begin{figure}
21  \centerline{\includegraphics[width=\figwidth]{FinleyMesh}}  \centerline{\includegraphics[width=\figwidth]{figures/FinleyMesh.eps}}
22  \caption{Subdivision of an Ellipse into triangles order 1 (\finleyelement{Tri3})}  \caption{Subdivision of an Ellipse into triangles order 1 (\finleyelement{Tri3})}
23  \label{FINLEY FIG 0}  \label{FINLEY FIG 0}
24  \end{figure}  \end{figure}
25    
26  \begin{figure}  \begin{figure}
27  \centerline{\includegraphics[width=\figwidth]{FinleyContact}}  \centerline{\includegraphics[width=\figwidth]{figures/FinleyContact.eps}}
28  \caption{Mesh around a contact region (\finleyelement{Rec4})}  \caption{Mesh around a contact region (\finleyelement{Rec4})}
29  \label{FINLEY FIG 01}  \label{FINLEY FIG 01}
30  \end{figure}  \end{figure}
# Line 26  It supports unstructured, 1D, 2D and 3D Line 39  It supports unstructured, 1D, 2D and 3D
39  library through the \LinearPDE class of \escript supporting its full functionality. {\it finley}  library through the \LinearPDE class of \escript supporting its full functionality. {\it finley}
40  is parallelized using the OpenMP \index{OpenMP} paradigm.  is parallelized using the OpenMP \index{OpenMP} paradigm.
41    
42  \subsection{Meshes}  \section{Formulation}
43    
44    For a single PDE with a solution with a single component the linear PDE is defined in the
45    following form:
46    \begin{equation}\label{FINLEY.SINGLE.1}
47    \begin{array}{cl} &
48    \displaystyle{
49    \int\hackscore{\Omega}
50    A\hackscore{jl} \cdot v\hackscore{,j}u\hackscore{,l}+ B\hackscore{j} \cdot v\hackscore{,j} u+ C\hackscore{l} \cdot v u\hackscore{,l}+D \cdot vu \; d\Omega }  \\
51    + & \displaystyle{\int\hackscore{\Gamma} d \cdot vu \; d{\Gamma} }
52    +  \displaystyle{\int\hackscore{\Gamma^{contact}} d^{contact} \cdot [v][u] \; d{\Gamma} } \\
53    = & \displaystyle{\int\hackscore{\Omega}  X\hackscore{j} \cdot v\hackscore{,j}+ Y \cdot v \; d\Omega }\\
54    + & \displaystyle{\int\hackscore{\Gamma} y \cdot v \; d{\Gamma}}  +
55    \displaystyle{\int\hackscore{\Gamma^{contact}} y^{contact}\cdot [v] \; d{\Gamma}} \\
56    \end{array}
57    \end{equation}
58    
59    \section{Meshes}
60  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
61  \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
62  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}.
63  In this case, triangles have been used but other forms of subdivisions  In this case, triangles have been used but other forms of subdivisions
64  can be constructed, e.g. into quadrilaterals or, in the three dimensional case, into tetrahedrons  can be constructed, e.g. into quadrilaterals or, in the three dimensional case, into tetrahedrons
65  and hexahedrons. The idea of the finite element method is to approximate the solution by a function  and hexahedrons. The idea of the finite element method is to approximate the solution by a function
66  which is a polynomial of a certain order and is continuous across it boundary to neighbour elements.  which is a polynomial of a certain order and is continuous across it boundary to neighbor elements.
67  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
68  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
69  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.
# Line 56  to second node the domain has to lie on Line 86  to second node the domain has to lie on
86  the domain has to lie on the left hand side when moving counterclockwise). If the gradient on the  the domain has to lie on the left hand side when moving counterclockwise). If the gradient on the
87  surface of the domain is to be calculated rich face elements face to be used. Rich elements on a face  surface of the domain is to be calculated rich face elements face to be used. Rich elements on a face
88  are identical to interior elements but with a modified order of nodes such that the 'first' face of the element aligns  are identical to interior elements but with a modified order of nodes such that the 'first' face of the element aligns
89  with the surface of the domian. In \fig{FINLEY FIG 0}  with the surface of the domain. In \fig{FINLEY FIG 0}
90  elements of the type \finleyelement{Tri3Face} are used.  elements of the type \finleyelement{Tri3Face} are used.
91  The face element reference number $20$ as a rich face element is defined by the nodes  The face element reference number $20$ as a rich face element is defined by the nodes
92  with reference numbers $11$, $0$ and $9$. Notice that the face element $20$ is identical to the  with reference numbers $11$, $0$ and $9$. Notice that the face element $20$ is identical to the
# Line 107  the nodes within an element. Line 137  the nodes within an element.
137  \linev{\finleyelement{Hex20}}{\finleyelement{Rec8}}{\finleyelement{Hex20Face}}{\finleyelement{Rec8_Contact}}{\finleyelement{Hex20Face_Contact}}  \linev{\finleyelement{Hex20}}{\finleyelement{Rec8}}{\finleyelement{Hex20Face}}{\finleyelement{Rec8_Contact}}{\finleyelement{Hex20Face_Contact}}
138  \end{tablev}  \end{tablev}
139  \caption{Finley elements and corresponding elements to be used on domain faces and contacts.  \caption{Finley elements and corresponding elements to be used on domain faces and contacts.
140  The rich types have to be used if the gradient of function is to be calculated on faces and contacts, resepctively.}  The rich types have to be used if the gradient of function is to be calculated on faces and contacts, respectively.}
141  \label{FINLEY TAB 1}  \label{FINLEY TAB 1}
142  \end{table}  \end{table}
143    
# Line 151  for i in range(ContactElement_Num): Line 181  for i in range(ContactElement_Num):
181     for j in range(ContactElement_numNodes): print " %d"%ContactElement_Nodes[i][j]     for j in range(ContactElement_numNodes): print " %d"%ContactElement_Nodes[i][j]
182     print "\n"     print "\n"
183  # point sources (not supported yet)  # point sources (not supported yet)
184  write("Point1 0",face_element_typ,numFaceElements)  write("Point1 0",face_element_type,numFaceElements)
185  \end{python}  \end{python}
186    
187  The following example of a mesh file defines the mesh shown in \fig{FINLEY FIG 01}:  The following example of a mesh file defines the mesh shown in \fig{FINLEY FIG 01}:
# Line 227  $7$, $10$, $15$ and $20$, respectively. Line 257  $7$, $10$, $15$ and $20$, respectively.
257    
258  \subsection{Linear Solvers in \LinearPDE}  \subsection{Linear Solvers in \LinearPDE}
259  Currently \finley supports the linear solvers \PCG, \GMRES, \PRESTWENTY and \BiCGStab.  Currently \finley supports the linear solvers \PCG, \GMRES, \PRESTWENTY and \BiCGStab.
260  For \GMRES the options \var{trancation} and \var{restart} of the \method{getSolution} can be  For \GMRES the options \var{truncation} and \var{restart} of the \method{getSolution} can be
261  used to control the trunction and restart during iteration. Default values are  used to control the truncation and restart during iteration. Default values are
262  \var{truncation}=5 and \var{restart}=20.  \var{truncation}=5 and \var{restart}=20.
263  The default solver is \BiCGStab  but if the symmetry flag is set \PCG is the default solver.  The default solver is \BiCGStab  but if the symmetry flag is set \PCG is the default solver.
264  \finley supports the solver options \var{iter_max} which specifies the maximum number of iterations steps,  \finley supports the solver options \var{iter_max} which specifies the maximum number of iterations steps,
# Line 237  In some installations \finley supports t Line 267  In some installations \finley supports t
267  solver options \var{reordering}=\constant{util.NO_REORDERING},  solver options \var{reordering}=\constant{util.NO_REORDERING},
268  \constant{util.MINIMUM_FILL_IN} or \constant{util.NESTED_DISSECTION} (default is \constant{util.NO_REORDERING}),  \constant{util.MINIMUM_FILL_IN} or \constant{util.NESTED_DISSECTION} (default is \constant{util.NO_REORDERING}),
269  \var{drop_tolerance} specifying the threshold for values to be dropped in the  \var{drop_tolerance} specifying the threshold for values to be dropped in the
270  incomplete elimation process (default is 0.01) and \var{drop_storage} specifying the maximum increase  incomplete elimination process (default is 0.01) and \var{drop_storage} specifying the maximum increase
271  in storage allowed in the  in storage allowed in the
272  incomplete elimation process (default is 1.20).  incomplete elimination process (default is 1.20).
273    
274  \subsection{Functions}  \subsection{Functions}
275  \begin{funcdesc}{Mesh}{fileName,integrationOrder=-1}  \begin{funcdesc}{Mesh}{fileName,integrationOrder=-1}
# Line 251  degree \var{integrationOrder} \index{int Line 281  degree \var{integrationOrder} \index{int
281  an appropriate integration order is chosen independently.  an appropriate integration order is chosen independently.
282  \end{funcdesc}  \end{funcdesc}
283    
 \begin{funcdesc}{Interval}{n0,order=1,l0=1.,integrationOrder=-1, \\  
   periodic0=\False,useElementsOnFace=\False}  
 Generates a \Domain object representing a interval $[0,l0]$. The interval is filled with  
 \var{n0} elements.  
 For \var{order}=1 and \var{order}=2  
 \finleyelement{Line2} and    
 \finleyelement{Line3} are used, respectively.  
 In the case of \var{useElementsOnFace}=\False,  
 \finleyelement{Point1} are used to describe the boundary points.  
 In the case of \var{useElementsOnFace}=\True (this option should be used if gradients  
 are calculated on domain faces),  
 \finleyelement{Line2} and    
 \finleyelement{Line3} are used on both ends of the interval.    
 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. If  
 \var{periodic0}=\True, periodic boundary conditions \index{periodic boundary conditions}  
 along the $x_0$-directions are enforced. That means when for any solution of a PDE solved by \finley  
 the value at $x_0=0$ will be identical to the values at $x_0=\var{l0}$.  
 \end{funcdesc}  
   
284  \begin{funcdesc}{Rectangle}{n0,n1,order=1,l0=1.,l1=1., integrationOrder=-1, \\  \begin{funcdesc}{Rectangle}{n0,n1,order=1,l0=1.,l1=1., integrationOrder=-1, \\
285    periodic0=\False,periodic1=\False,useElementsOnFace=\False}    periodic0=\False,periodic1=\False,useElementsOnFace=\False,optimize=\False}
286  Generates a \Domain object representing a two dimensional rectangle between  Generates a \Domain object representing a two dimensional rectangle between
287  $(0,0)$ and $(l0,l1)$ with orthogonal edges. The rectangle is filled with  $(0,0)$ and $(l0,l1)$ with orthogonal edges. The rectangle is filled with
288  \var{n0} elements along the $x_0$-axis and  \var{n0} elements along the $x_0$-axis and
# Line 299  the value on the line $x_0=0$ will be id Line 307  the value on the line $x_0=0$ will be id
307  Correspondingly,  Correspondingly,
308  \var{periodic1}=\False sets periodic boundary conditions  \var{periodic1}=\False sets periodic boundary conditions
309  in $x_1$-direction.  in $x_1$-direction.
310    If \var{optimize}=\True mesh node relabeling will be attempted to reduce the computation and also ParMETIS will be used to improve the mesh partition if running on multiple CPUs with MPI.
311  \end{funcdesc}  \end{funcdesc}
312    
313  \begin{funcdesc}{Brick}{n0,n1,n2,order=1,l0=1.,l1=1.,l2=1., integrationOrder=-1, \\  \begin{funcdesc}{Brick}{n0,n1,n2,order=1,l0=1.,l1=1.,l2=1., integrationOrder=-1, \\
314    periodic0=\False,periodic1=\False,periodic2=\False,useElementsOnFace=\False}    periodic0=\False,periodic1=\False,periodic2=\False,useElementsOnFace=\False,optimize=\False}
315  Generates a \Domain object representing a three dimensional brick between  Generates a \Domain object representing a three dimensional brick between
316  $(0,0,0)$ and $(l0,l1,l2)$ with orthogonal faces. The brick is filled with  $(0,0,0)$ and $(l0,l1,l2)$ with orthogonal faces. The brick is filled with
317  \var{n0} elements along the $x_0$-axis,  \var{n0} elements along the $x_0$-axis,
# Line 327  along the $x_0$-directions are enforced. Line 336  along the $x_0$-directions are enforced.
336  the value on the plane $x_0=0$ will be identical to the values on $x_0=\var{l0}$. Correspondingly,  the value on the plane $x_0=0$ will be identical to the values on $x_0=\var{l0}$. Correspondingly,
337  \var{periodic1}=\False and \var{periodic2}=\False sets periodic boundary conditions  \var{periodic1}=\False and \var{periodic2}=\False sets periodic boundary conditions
338  in $x_1$-direction and $x_2$-direction, respectively.  in $x_1$-direction and $x_2$-direction, respectively.
339    If \var{optimize}=\True mesh node relabeling will be attempted to reduce the computation and also ParMETIS will be used to improve the mesh partition if running on multiple CPUs with MPI.
340  \end{funcdesc}  \end{funcdesc}
341    
342  \begin{funcdesc}{GlueFaces}{meshList,safetyFactor=0.2,tolerance=1.e-13}  \begin{funcdesc}{GlueFaces}{meshList,safetyFactor=0.2,tolerance=1.e-13}
343  Generates a new \Domain object from the list \var{mehList} of \finley meshes.  Generates a new \Domain object from the list \var{meshList} of \finley meshes.
344  Nodes in face elements whose difference of coordinates is less then \var{tolerance} times the  Nodes in face elements whose difference of coordinates is less then \var{tolerance} times the
345  diameter of the domain are merged. The corresponding face elements are removed from the mesh.    diameter of the domain are merged. The corresponding face elements are removed from the mesh.  
346    
# Line 338  TODO: explain \var{safetyFactor} and sho Line 348  TODO: explain \var{safetyFactor} and sho
348  \end{funcdesc}  \end{funcdesc}
349    
350  \begin{funcdesc}{JoinFaces}{meshList,safetyFactor=0.2,tolerance=1.e-13}  \begin{funcdesc}{JoinFaces}{meshList,safetyFactor=0.2,tolerance=1.e-13}
351  Generates a new \Domain object from the list \var{mehList} of \finley meshes.  Generates a new \Domain object from the list \var{meshList} of \finley meshes.
352  Face elements whose nodes coordinates have difference is less then \var{tolerance} times the  Face elements whose nodes coordinates have difference is less then \var{tolerance} times the
353  diameter of the domain are combined to form a contact element \index{element!contact}  diameter of the domain are combined to form a contact element \index{element!contact}
354  The corresponding face elements are removed from the mesh.    The corresponding face elements are removed from the mesh.  

Legend:
Removed from v.107  
changed lines
  Added in v.1700

  ViewVC Help
Powered by ViewVC 1.1.26