esys.finley Package — esys.escript 5.6 documentation

# esys.finley Package

Our most general domain representation. Imports submodules into its namespace

## Classes

- `FinleyDomain`
- `GMSHDesign`

class `esys.finley.` `FinleyDomain`

  Bases: `esys.escriptcore.escriptcpp.ContinuousDomain`

  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`

  `getStatus`((Domain)arg1) → int :

    The status of a domain changes whenever the domain is modified

    Return type: | int

  `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`

  `isValidTagName`((FinleyDomain)arg1, (str)name) → bool :

    Returns: | True is `name` corresponds 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`) –

  `onMasterProcessor`((FinleyDomain)arg1) → bool :

    Returns: | True if this code is executing on the master process
    Return type: | `bool`

  `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 tag tag (`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`

  `supportsContactElements`((Domain)arg1) → bool :

    Does this domain support contact elements.

  `write`((FinleyDomain)arg1, (str)filename) → None :

    Write the current mesh to a file with the given name.

`esys.finley.` `GMSHDesign`

  alias of `esys.pycad.gmsh.Design`

## Functions

`esys.finley.` `Brick`(n0=1, n1=1, n2=1, order=1, l0=1.0, l1=1.0, l2=1.0, periodic0=0, periodic1=0, periodic2=0, integrationOrder=-1, reducedIntegrationOrder=-1, useElementsOnFace=1, useFullElementOrder=0, optimize=0, **kwargs)
  __Brick_driver( (list)params) -> Domain :

    Creates a rectangular mesh with n0 x n1 x n2 elements over the brick [0,l0] x [0,l1] x [0,l2].

    param n0: | number of elements in direction 0
    type n0: | `int`
    param n1: | number of elements in direction 1
    type n1: | `int`
    param n2: | number of elements in direction 2
    type n2: | `int`
    param order: | =1, =-1 or =2 gives the order of shape function. If -1 macro elements of order 1 are used.
    param l0: | length of side 0
    type l0: | `float`
    param l1: | length of side 1
    type l1: | `float`
    param l2: | length of side 2
    type l2: | `float`
    param periodic0:
    | whether or not boundary conditions are periodic in direction 0
    type periodic0: | `bool`
    param periodic1:
    | whether or not boundary conditions are periodic in direction 1
    type periodic1: | `bool`
    param periodic2:
    | whether or not boundary conditions are periodic in direction 2
    type periodic2: | `bool`
    param integrationOrder:
    | order of the quadrature scheme. If integrationOrder<0 the integration order is selected independently.
    param reducedIntegrationOrder:
    | order of the quadrature scheme. If reducedIntegrationOrder<0 the integration order is selected independently.
    param useElementsOnFace:
    | whether or not to use elements on face
    type useElementsOnFace:
    | `int`
    param useFullElementOrder:
    | Whether or not to use Hex27 elements
    type useFullElementOrder:
    | `bool`
    param optimize: | Enable optimisation of node labels
    type optimize: | `bool`

`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='file.nc']) → Domain :

  Return type: | `FinleyDomain`

`esys.finley.` `MakeDomain`(design, integrationOrder=-1, reducedIntegrationOrder=-1, optimizeLabeling=True, useMacroElements=False)

  Creates a Finley `Domain` from a `esys.pycad.design.Design` object. Currently only gmsh is supported.

  Parameters: | design (`esys.pycad.design.Design`) – the geometry integrationOrder (`int`) – integration order. If -1 the default is used. reducedIntegrationOrder (`int`) – reduced integration order. If -1 the default is used. optimizeLabeling (`bool`) – if set the labeling of the mesh nodes is optimized useMacroElements (`bool`) – uses macro elements.
  Returns: | the Finley domain defined by the design
  Return type: | `Domain`

`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, **kwargs)
  __ReadGmsh_driver( (list)params) -> Domain :

    Read a gmsh mesh file

    rtype: | `Domain`
    param fileName: |
    type fileName: | `string`
    param integrationOrder:
    | order of the quadrature scheme. If integrationOrder<0 the integration order is selected independently.
    type integrationOrder:
    | `int`
    param reducedIntegrationOrder:
    | order of the quadrature scheme. If reducedIntegrationOrder<0 the integration order is selected independently.
    param optimize: | Enable optimisation of node labels
    type optimize: | `bool`
    param useMacroElements:
    | Enable the usage of macro elements instead of second order elements.
    type useMacroElements:
    | `bool`

`esys.finley.` `ReadMesh`(filename, integrationOrder=-1, reducedIntegrationOrder=-1, optimize=True, **kwargs)
  __ReadMesh_driver( (list)params) -> Domain :

    Read a mesh from a file. For MPI parallel runs fan out the mesh to multiple processes.

    rtype: | `Domain`
    param fileName: |
    type fileName: | `string`
    param integrationOrder:
    | order of the quadrature scheme. If integrationOrder<0 the integration order is selected independently.
    type integrationOrder:
    | `int`
    param reducedIntegrationOrder:
    | order of the quadrature scheme. If reducedIntegrationOrder<0 the integration order is selected independently.
    param optimize: | Enable optimisation of node labels
    type optimize: | `bool`

`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=0, optimize=0, **kwargs)
  __Rectangle_driver( (list)args) -> Domain :

    Creates a rectangular mesh with n0 x n1 elements over the brick [0,l0] x [0,l1].

    param n0: |
    type n0: |
    param n1: |
    type n1: |
    param order: | =1, =-1 or =2 gives the order of shape function. If -1 macro elements of order 1 are used.
    param l0: | length of side 0
    param l1: |
    param integrationOrder:
    | order of the quadrature scheme. If integrationOrder<0 the integration order is selected independently.
    param reducedIntegrationOrder:
    | order of the quadrature scheme. If reducedIntegrationOrder<0 the integration order is selected independently.
    param useElementsOnFace:
    | whether or not to use elements on face
    type useElementsOnFace:
    | `int`:param periodic0: whether or not boundary conditions are periodic
    param periodic1:
    param useFullElementOrder:
    | Whether or not to use Rec9 elements
    type useFullElementOrder:
    | `bool`
    param optimize: | Enable optimisation of node labels
    type optimize: | `bool`

## Others

## Packages