esys.finley Package¶
Our most general domain representation. Imports submodules into its namespace
Classes¶
- class esys.finley.FinleyDomain¶
A concrete class representing a domain. For more details, please consult the C++ documentation.
- __init__((object)arg1, (FinleyDomain)arg2) None¶
- MPIBarrier((FinleyDomain)arg1) None :¶
Wait until all processes have reached this point
- addPDEToLumpedSystem((FinleyDomain)arg1, (Data)arg2, (Data)arg3, (Data)mat, (Data)D, (bool)d) None :¶
adds a PDE onto the lumped stiffness matrix
- Parameters:
mat (
Data)D (
Data)d (
Data)useHRZ (bool)
- addPDEToRHS((FinleyDomain)arg1, (Data)arg2, (Data)rhs, (Data)X, (Data)Y, (Data)y, (Data)y_contact) None :¶
adds a PDE onto the stiffness matrix mat and a rhs
- Parameters:
rhs (
Data)X (
Data)Y (
Data)y (
Data)y_contact (
Data)
- addPDEToSystem((FinleyDomain)arg1, (Operator)arg2, (Data)arg3, (Data)mat, (Data)rhs, (Data)A, (Data)B, (Data)C, (Data)D, (Data)X, (Data)Y, (Data)d, (Data)y, (Data)d_contact, (Data)y_contact) None :¶
adds a PDE onto the stiffness matrix mat and a rhs
- Parameters:
mat (
OperatorAdapter)rhs (
Data)A (
Data)B (
Data)C (
Data)D (
Data)X (
Data)Y (
Data)d (
Data)d_contact (
Data)y_contact (
Data)
- addPDEToTransportProblem((FinleyDomain)arg1, (TransportProblem)arg2, (Data)arg3, (Data)tp, (Data)source, (Data)M, (Data)A, (Data)B, (Data)C, (Data)D, (Data)X, (Data)Y, (Data)d, (Data)y, (Data)d_contact, (Data)y_contact) None :¶
- Parameters:
tp (
AbstractTransportProblem)source (
Data)M (
Data)A (
Data)B (
Data)C (
Data)D (
Data)X (
Data)Y (
Data)d (
Data)y (
Data)d_contact (
Data)y_contact (
Data)
- dump((FinleyDomain)arg1, (str)fileName) None :¶
dumps the mesh to a file with the given name.
- getDataShape((FinleyDomain)arg1, (int)functionSpaceCode) object :¶
- Returns:
a pair (dps, ns) where dps=the number of data points per sample, and ns=the number of samples
- Return type:
tuple
- getDescription((FinleyDomain)arg1) str :¶
- Returns:
a description for this domain
- Return type:
string
- getDim((FinleyDomain)arg1) int :¶
- Return type:
int
- getMPIRank((FinleyDomain)arg1) int :¶
- Returns:
the rank of this process
- Return type:
int
- getMPISize((FinleyDomain)arg1) int :¶
- Returns:
the number of processes used for this
Domain- Return type:
int
- getNormal((FinleyDomain)arg1) Data :¶
- Returns:
boundary normals at the quadrature point on the face elements
- Return type:
Data
- getNumDataPointsGlobal((FinleyDomain)arg1) int :¶
- Returns:
the number of data points summed across all MPI processes
- Return type:
int
- getSize((FinleyDomain)arg1) Data :¶
- Returns:
the element size
- Return type:
Data
- getSystemMatrixTypeId((FinleyDomain)arg1, (object)options) int :¶
- Returns:
the identifier of the matrix type to be used for the global stiffness matrix when particular solver options are used.
- Return type:
int- Parameters:
options (
SolverBuddy)
- getTag((FinleyDomain)arg1, (str)name) int :¶
- Returns:
tag id for
name- Return type:
string
- getTransportTypeId((FinleyDomain)arg1, (int)solver, (int)preconditioner, (int)package, (bool)symmetry) int :¶
- Returns:
the identifier of the transport problem type to be used when a particular solver, preconditioner, package and symmetric matrix is used.
- Return type:
int- Parameters:
solver (
int)preconditioner (
int)package (
int)symmetry (
int)
- getVTKElementType((FinleyDomain)arg1) int :¶
- Returns:
returns the VTK code for this element type
- Return type:
Data
- getX((FinleyDomain)arg1) Data :¶
- Returns:
locations in the FEM nodes
- Return type:
Data
- isRootRank((FinleyDomain)arg1) bool :¶
- Returns:
True if this code is executing on the root rank (rank 0)
- Return type:
bool
- isValidTagName((FinleyDomain)arg1, (str)name) bool :¶
- Returns:
True is
namecorresponds to a tag- Return type:
bool
- newOperator((FinleyDomain)arg1, (int)row_blocksize, (FunctionSpace)row_functionspace, (int)column_blocksize, (FunctionSpace)column_functionspace, (int)type) Operator :¶
creates a stiffness matrix and initializes it with zeros
- Parameters:
row_blocksize (
int)row_functionspace (
FunctionSpace)column_blocksize (
int)column_functionspace (
FunctionSpace)type (
int)
- newTransportProblem((FinleyDomain)theta, (int)blocksize, (FunctionSpace)functionspace, (int)type) TransportProblem :¶
creates a TransportProblem
- Parameters:
theta (
float)blocksize (
int)functionspace (
FunctionSpace)type (
int)
- print_mesh_info((FinleyDomain)arg1[, (bool)full=False]) None :¶
- Parameters:
full (
bool)
- setTagMap((FinleyDomain)arg1, (str)name, (int)tag) None :¶
Give a tag number a name.
- Parameters:
name (
string) – Name for the tagtag (
int) – numeric id
- Note:
Tag names must be unique within a domain
- setX((FinleyDomain)arg1, (Data)arg) None :¶
assigns new location to the domain
- Parameters:
arg (
Data)
- showTagNames((FinleyDomain)arg1) str :¶
- Returns:
A space separated list of tag names
- Return type:
string
- write((FinleyDomain)arg1, (str)filename) None :¶
Write the current mesh to a file with the given name.
Functions¶
- esys.finley.Brick(n0=1, n1=1, n2=1, order=1, l0=1.0, l1=1.0, l2=1.0, periodic0=False, periodic1=False, periodic2=False, integrationOrder=-1, reducedIntegrationOrder=-1, useElementsOnFace=None, useFullElementOrder=False, optimize=False, diracPoints=[], diracTags=[], comm=None, framework=None)¶
Creates a rectangular mesh with n0 x n1 x n2 elements over the brick [0,l0] x [0,l1] x [0,l2].
- Parameters:
n0 – number of elements in direction 0
n1 – number of elements in direction 1
n2 – number of elements in direction 2
order – order of shape functions (1, 2, or -1 for macro elements)
l0 – length of side 0
l1 – length of side 1
l2 – length of side 2
periodic0 – periodic boundary conditions in direction 0
periodic1 – periodic boundary conditions in direction 1
periodic2 – periodic boundary conditions in direction 2
integrationOrder – order of quadrature scheme (-1 for automatic)
reducedIntegrationOrder – order of reduced quadrature scheme (-1 for automatic)
useElementsOnFace – whether to use elements on face
useFullElementOrder – whether to use Hex27 elements
optimize – enable optimization of node labels
diracPoints – Dirac point coordinates
diracTags – Dirac point tags
comm – MPI communicator (optional, defaults to MPI_COMM_WORLD)
framework – solver framework to use (optional SolverFramework instance)
- Returns:
Domain object
- esys.finley.GetMeshFromFile(filename, **kwargs)¶
Reads a mesh from a file, determines the reader to use based on the file extension. All cases require a filename and gmsh files require a number of dimensions (it doesn’t hurt to pass this in all the time). Other keyword args come from the underlying reader functions.
- esys.finley.GlueFaces((list)meshList[, (float)safetyFactor=0.2[, (float)tolerance=1e-08[, (bool)optimize=True]]]) Domain :¶
Detects matching faces in the mesh, removes them from the mesh and joins the elements touched by the face elements.
- esys.finley.JoinFaces((list)meshList[, (float)safetyFactor=0.2[, (float)tolerance=1e-08[, (bool)optimize=True]]]) Domain :¶
Detects matching faces in the mesh and replaces them by joint elements.
- esys.finley.LoadMesh((str)fileName[, (object)comm=None]) Domain :¶
Load a mesh from an HDF5 file.
- Parameters:
fileName (
string) – Path to HDF5 filecomm – MPI communicator (optional, defaults to MPI_COMM_WORLD)
- Return type:
- esys.finley.Merge((list)meshList) Domain :¶
Merges a list of meshes into one mesh.
- Return type:
Domain
- esys.finley.ReadGmsh(fileName, numDim, integrationOrder=-1, reducedIntegrationOrder=-1, optimize=True, useMacroElements=False, diracPoints=[], diracTags=[], comm=None, framework=None)¶
Read a gmsh mesh file.
- Parameters:
fileName – Path to gmsh file
numDim – Number of spatial dimensions
integrationOrder – Order of quadrature scheme (-1 for automatic)
reducedIntegrationOrder – Order of reduced quadrature scheme (-1 for automatic)
optimize – Enable optimization of node labels
useMacroElements – Enable usage of macro elements instead of second order elements
diracPoints – Dirac point coordinates
diracTags – Dirac point tags
comm – MPI communicator (optional, defaults to MPI_COMM_WORLD)
framework – solver framework to use (optional SolverFramework instance)
- Returns:
Domain object
- esys.finley.ReadMesh(filename, integrationOrder=-1, reducedIntegrationOrder=-1, optimize=True, diracPoints=[], diracTags=[], comm=None, framework=None)¶
Read a mesh from a file. For MPI parallel runs fan out the mesh to multiple processes.
- Parameters:
filename – Path to mesh file
integrationOrder – Order of quadrature scheme (-1 for automatic)
reducedIntegrationOrder – Order of reduced quadrature scheme (-1 for automatic)
optimize – Enable optimization of node labels
diracPoints – Dirac point coordinates
diracTags – Dirac point tags
comm – MPI communicator (optional, defaults to MPI_COMM_WORLD)
framework – solver framework to use (optional SolverFramework instance)
- Returns:
Domain object
- esys.finley.Rectangle(n0=1, n1=1, order=1, l0=1.0, l1=1.0, periodic0=False, periodic1=False, integrationOrder=-1, reducedIntegrationOrder=-1, useElementsOnFace=None, useFullElementOrder=False, optimize=False, diracPoints=[], diracTags=[], comm=None, framework=None)¶
Creates a rectangular mesh with n0 x n1 elements over the rectangle [0,l0] x [0,l1].
- Parameters:
n0 – number of elements in direction 0
n1 – number of elements in direction 1
order – order of shape functions (1, 2, or -1 for macro elements)
l0 – length of side 0
l1 – length of side 1
periodic0 – periodic boundary conditions in direction 0
periodic1 – periodic boundary conditions in direction 1
integrationOrder – order of quadrature scheme (-1 for automatic)
reducedIntegrationOrder – order of reduced quadrature scheme (-1 for automatic)
useElementsOnFace – whether to use elements on face
useFullElementOrder – whether to use Rec9 elements
optimize – enable optimization of node labels
diracPoints – Dirac point coordinates
diracTags – Dirac point tags
comm – MPI communicator (optional, defaults to MPI_COMM_WORLD)
framework – solver framework to use (optional SolverFramework instance)
- Returns:
Domain object