carputils
Doxygen code documentation for the python framework controlling openCARP
|
Generate a block mesh with the mesher command line utility. More...
Public Member Functions | |
def | __init__ (self, centre=(0., 0., 0.), size=(1., 1., 1.), resolution=0.1, etype='tetra', periodic=0, periodic_tag=1234, pertb=0.0, first_region=True) |
def | resolution (self) |
Return the currently set mesh resolution. More... | |
def | set_bath (self, thickness, both_sides=True) |
Add a bath region of the specified thickness. More... | |
def | set_fibres (self, fibre_endo=None, fibre_epi=None, sheet_endo=None, sheet_epi=None) |
Set the angles for generated fibres in the generated geometry. More... | |
def | corner_at_origin (self) |
Put the corner of the tissue block at the origin. More... | |
def | tissue_limits (self) |
Return the lower and upper limits of the block, excluding the bath. More... | |
def | bath_limits (self) |
Return the lower and upper limits of the block, including the bath. More... | |
def | shape (self, bath=True) |
Determine the number of points in each dimension. More... | |
def | add_region (self, region) |
Add a region definition. More... | |
def | mesher_opts (self, meshname) |
Generate a list of command line arguments for mesher. More... | |
Generate a block mesh with the mesher command line utility.
This class describes a tissue block with optional additional bath region. For example, to define a 2x2x2mm block centred on the origin with 1mm bath on the positive z side:
Regions may also be specified using the :class:BoxRegion
, :class:SphereRegion
and :class:CylinderRegion
objects:
Generate a list of command line options to pass to mesher to generate the described mesh with the :meth:mesher_opts
method:
.. note::
While the mesher executable takes arguments in centimetres and micrometres, this class expects *all* physical sizes to be specified in millimetres. Arguments are converted to the correct units when generating the mesher command line.
centre | array-like, optional Coordinate of centre of Block, defaults to (0,0,0) |
size | array-like, optional Size of Block, defaults to (1,1,1) |
resolution | float, optional Resolution at which to tesselate block into mesh, defaults to 0.1 |
etype | str, optional Element type to generate, either 'tetra' or 'hexa' in 3D, or 'quad' or 'tri' in 2D, defaults to 'tetra' in 3D and 'quad' in 2D |
periodic | int, optional If set, the edges along a given direction are connected by linear elements to implement periodic boundary conditions. The range of values spans 0 (none), 1 (X), 2 (Y) and 3 (XY) |
periodic_tag | int, optional Tag value assigned to the connecting linear elements. As default the value 1234 is used. |
def carputils.mesh.block.Block.__init__ | ( | self, | |
centre = (0., 0., 0.) , |
|||
size = (1., 1., 1.) , |
|||
resolution = 0.1 , |
|||
etype = 'tetra' , |
|||
periodic = 0 , |
|||
periodic_tag = 1234 , |
|||
pertb = 0.0 , |
|||
first_region = True |
|||
) |
def carputils.mesh.block.Block.add_region | ( | self, | |
region | |||
) |
Add a region definition.
region | BoxRegion or SphereRegion or CylinderRegion The region description. |
def carputils.mesh.block.Block.bath_limits | ( | self | ) |
Return the lower and upper limits of the block, including the bath.
def carputils.mesh.block.Block.corner_at_origin | ( | self | ) |
Put the corner of the tissue block at the origin.
def carputils.mesh.block.Block.mesher_opts | ( | self, | |
meshname | |||
) |
Generate a list of command line arguments for mesher.
meshname | str The base name of the mesh to be generated. |
def carputils.mesh.block.Block.resolution | ( | self | ) |
Return the currently set mesh resolution.
def carputils.mesh.block.Block.set_bath | ( | self, | |
thickness, | |||
both_sides = True |
|||
) |
Add a bath region of the specified thickness.
Note that this method does not use the mesher convention of positive bath size meaning bath on one side and negative bath size meaning bath on both sides. Instead always use positive thickness values and the optional both_sides parameter to control this behaviour.
thickness | array-like The thickness of bath to add, one value per coordinate axis |
both_side | bool or array-like of bools, optional If True, generate bath on both sides of the object, if False only on one side. Pass an array of bools to control this behaviour for individual directions. |
def carputils.mesh.block.Block.set_fibres | ( | self, | |
fibre_endo = None , |
|||
fibre_epi = None , |
|||
sheet_endo = None , |
|||
sheet_epi = None |
|||
) |
Set the angles for generated fibres in the generated geometry.
fibre_endo | float, optional Set the principal fibre direction on the endocardium |
fibre_epi | float, optional Set the principal fibre direction on the epicardium |
sheet_endo | float, optional Set the sheet direction on the endocardium |
sheet_epi | float, optional Set the shhet direction on the epicardium |
def carputils.mesh.block.Block.shape | ( | self, | |
bath = True |
|||
) |
Determine the number of points in each dimension.
def carputils.mesh.block.Block.tissue_limits | ( | self | ) |
Return the lower and upper limits of the block, excluding the bath.