• No results found

For a single PDE that has a solution with a single component the linear PDE is defined in the following form: Z Ω Ajl· v,ju,l+ Bj· v,ju + Cl· vu,l+ D · vu dΩ + Z Γ d · vu dΓ = Z Ω Xj· v,j+ Y · v dΩ + Z Γ y · v dΓ (8.1)

(5.5, 9.0)

(15.5, 14.0)

FIGURE8.1: 10x10 esys.ripley Rectangle created with l0=(5.5, 15.5) and l1=(9.0, 14.0)

8.2

Meshes

An example 2D mesh from esys.ripley is shown in Figure 8.1. Mesh files cannot be used to generate esys.ripley domains, i.e. esys.ripley does not have ReadGmsh or ReadMesh functions. Instead, esys.ripleydomains are always created using a call to Brick or Rectangle, see Section8.3.

8.3

Functions

Brick(n0,n1,n2,l0=1.,l1=1.,l2=1.,d0=-1,d1=-1,d2=-1, diracPoints=list(), diracTags=list())

generates a Domain object representing a three-dimensional brick between (0, 0, 0) and (l0, l1, l2) with orthogonal faces. All elements will be regular. The brick is filled with n0 elements along the x0-axis, n1

elements along the x1-axis and n2 elements along the x2-axis. If built with MPI support, the domain will

be subdivided d0 times along the x0-axis, d1 times along the x1-axis, and d2 times along the x2-axis. d0,

d1, and d2 must be factors of the number of MPI processes requested. If axial subdivisions are not specified, automatic domain subdivision will take place. This may not be the most efficient construction and will likely result in extra elements being added to ensure proper distribution of work. Any extra elements added in this way will change the length of the domain proportionately. diracPoints is a list of coordinate-tuples of points within the mesh, each point tagged with the respective string within diracTags.

Rectangle(n0,n1,l0=1.,l1=1.,d0=-1,d1=-1, diracPoints=list(), diracTags=list())

generates a Domain object representing a two-dimensional rectangle between (0, 0) and (l0, l1) with orthogonal faces. All elements will be regular. The rectangle is filled with n0 elements along the x0-axis

and n1 elements along the x1-axis. If built with MPI support, the domain will be subdivided d0 times

along the x0-axis and d1 times along the x1-axis. d0 and d1 must be factors of the number of MPI

processes requested. If axial subdivisions are not specified, automatic domain subdivision will take place. This may not be the most efficient construction and will likely result in extra elements being added to ensure proper distribution of work. Any extra elements added in this way will change the length of the domain proportionately. diracPoints is a list of coordinate-tuples of points within the mesh, each point tagged with the respective string within diracTags.

The arguments l0, l1 and l2 for Brick and Rectangle may also be given as tuples (x0,x1) in which case the coordinates will range between x0 and x1. For example:

from esys.ripley import Rectangle

dom = Rectangle(10, 10, l0=(5.5, 15.5), l1=(9.0, 14.0))

This will create a rectangle with 10 by 10 elements where the bottom-left node is located at (5.5, 9.0) and the top-right node has coordinates (15.5, 14.0), see Figure8.1.

The MultiResolutionDomain class is available as a wrapper, taking the dimension of the domain fol- lowed by the same arguments as Brick (if a two-dimensional domain is requested, any extra arguments over those used by Rectangle are ignored). All of these standard arguments to MultiResolutionDomain must be supplied as keyword arguments (e.g. d0 =...). The MultiResolutionDomain can then generate compatible domains for interpolation.

8.4

Linear Solvers in SolverOptions

Currently direct solvers and GPU-based solvers are not supported under MPI when running with more than one rank. By default, esys.ripley uses the iterative solvers SolverOptions.PCG for symmetric and SolverOptions.BICGSTABfor non-symmetric problems. A GPU will not be used unless explicitly requested via the setSolverTarget method of the solver options. These solvers are only available if esys.ripley was built with CUDA support. If the direct solver is selected, which can be useful when solving very ill-posed equa- tions, esys.ripley uses the MKL1solver package. If MKL is not available UMFPACK is used. If UMFPACK is not

available a suitable iterative solver from PASO is used, but if a direct solver was requested via the SolverOptions an exception will be raised.

1If the stiffness matrix is non-regular MKL may return without a proper error code. If you observe suspicious solutions when using MKL , this may be caused by a non-invertible operator.

CHAPTER

NINE

The esys.speckley Module

speckleyis a high-order form of ripley, supporting structured, uniform meshes in two and three dimensions. Uni- form meshes allow a more regular division of elements among compute nodes. Possible orders range from 2 to 10, inclusive.

speckleydomains cannot be created by reading from a mesh file.

The family of domain that will result from a Rectangle or Brick call depends on which module is imported in the specific script. The following line is an example of importing esys.speckley domains:

from esys.speckley import Rectangle, Brick

9.1

Formulation

For a single PDE that has a solution with a single component the linear PDE is defined in the following form: Z Ω D · vu dΩ + Z Γ d · vu dΓ = Z Ω Xj· v,j+ Y · v dΩ + Z Γ y · v dΓ (9.1)

9.2

Meshes

esys.speckleymeshes are formed of regular elements using Gauss-Labatto-Legendre quadrature points. The number of quadrature points in each axis is dependent on the order of the domain. Examples of small Rectangle domains of different orders are shown in Figure9.1.

Meshfiles cannot be used to generate esys.speckley domains.

9.3

Linear Solvers in SolverOptions

While esys.speckley has the same defaults as esys.ripley, the SolverOptions.HRZ_LUMPING must be set. PASO is not used in esys.speckley.