carputils
Doxygen code documentation for the python framework controlling openCARP
Public Member Functions | List of all members
carputils.mesh.ellipsoid.Ellipsoid Class Reference

Generate a mesh of an ellipsoidal shell. More...

Inheritance diagram for carputils.mesh.ellipsoid.Ellipsoid:

Public Member Functions

def __init__ (self, r_a, r_b, r_c, aout=None, bout=None, cout=None, v0=np.pi/3.0, v1=np.pi, div_trans=2, div_vert=25, div_circ=50, flat_top=True, cumulative_offset=True, args, kwargs)
 
def with_resolution (cls, radius, resolution, lengthratio=1.5, wallthickness=None, apexthickness=None, v0=np.pi/3.0, v1=np.pi, kwargs)
 Simplified interface to generate ellipsoid with target resolution. More...
 
def cavity_volume (self)
 Calculate the volume of the cavity analytically. More...
 
def generate_carp_apex_vtx (self, basename)
 Generate vtx file with apex node. More...
 

Detailed Description

Generate a mesh of an ellipsoidal shell.

An ellipsoidal shell is generated with hexahedral and prism elements, divided into tetrahedra if desired. The shell is defined in terms of its internal axes a, b and c, with the outer axes currently being a scalar multiple of those (thickness).

v0 determines the azimuthal angle of the top (base) of the geometry, and v1 determines the azimuthal angle of the bottom (apex). By default, v1 is at the maximum of pi, and is therefore closed at that point. The mesh may be adjusted to have a flat (constant z coordiate) base place by use of the flat_top argument (on by default). Disabling this will case a constant-v base place.

Mesh discretisation is controlled by the div_trans, div_vert and div_circ arguments. div_trans controls the number of hexahedra/prisms generated transmurally, div_vert controls the number of layers of elements are generated between the apex and base, and div_circ controls the number of hexahedra/prisms are in the layer at the equator (v=pi/2) layer of the ellipsoid. This is used to calculate a target circumferential element size, which is in turn used to determine the number of elements to be generated at other layers such that they are of a consistent size.

Parameters
r_afloat Internal radius (x direction) of the ellipsoid shell
r_bfloat Internal radius (y direction) of the ellipsoid shell
r_cfloat Internal radius (z direction) of the ellipsoid shell
aoutfloat External radius (x direction) of the ellipsoid shell, defaults to 1.25a
boutfloat External radius (y direction) of the ellipsoid shell, defaults to 1.25b
coutfloat External radius (z direction) of the ellipsoid shell, defaults to 1.15c
v0float, optional Azimuthal angle of the top of the mesh, defaults to pi/3
v1float, optional Aximuthal angle of the bottom of the mesh, defaults to pi (closed apex)
div_transint, optional Number of elements across the radial thickness, defaults to 2
div_vertint, optional Number of layers of elements vertically, defaults to 25
div_circint, optional Number of elements around the equator (v=pi/2), defaults to 50
flat_topbool, optional True to make a flat (constant z) top to the mesh, defaults to true
cumulative_offsetbool, optional True to add a cumulative offset to the points, defaults to true
tetrahedrisebool, optional True to subdivide the mesh into tetrahedra
fibre_rulecallable, optional Function describing the transmural variation of fibre angle, takes a single normalised transmural distance on [0,1] and returns a helix angle in radians, defaults to circumferentially oriented fibres

Constructor & Destructor Documentation

◆ __init__()

def carputils.mesh.ellipsoid.Ellipsoid.__init__ (   self,
  r_a,
  r_b,
  r_c,
  aout = None,
  bout = None,
  cout = None,
  v0 = np.pi/3.0,
  v1 = np.pi,
  div_trans = 2,
  div_vert = 25,
  div_circ = 50,
  flat_top = True,
  cumulative_offset = True,
  args,
  kwargs 
)

Member Function Documentation

◆ cavity_volume()

def carputils.mesh.ellipsoid.Ellipsoid.cavity_volume (   self)

Calculate the volume of the cavity analytically.

The actual volume may be less due to discretisation effects.

Returns
float The cavity volume

◆ generate_carp_apex_vtx()

def carputils.mesh.ellipsoid.Ellipsoid.generate_carp_apex_vtx (   self,
  basename 
)

Generate vtx file with apex node.

Parameters
basenamestr Mesh base name (without extension)

◆ with_resolution()

def carputils.mesh.ellipsoid.Ellipsoid.with_resolution (   cls,
  radius,
  resolution,
  lengthratio = 1.5,
  wallthickness = None,
  apexthickness = None,
  v0 = np.pi/3.0,
  v1 = np.pi,
  kwargs 
)

Simplified interface to generate ellipsoid with target resolution.

Parameters
radiusfloat Inner radius of ellipsoid cavity
resolutionfloat Target mesh edge length
lengthratiofloat, optional Ratio of ellipsoid apical-basal radius to short axis-radius (default: 1.5)
wallthicknessfloat, optional Thickness of ellipsoid wall (default: radius/5)
apexthicknessfloat, optional Thickness of wall at apex (default: wallthickness)

The documentation for this class was generated from the following file: