carputils.mesh
.Ellipsoidcarputils.mesh.
Ellipsoid
(r_a, r_b, r_c, aout=None, bout=None, cout=None, v0=1.0471975511965976, v1=3.141592653589793, div_trans=2, div_vert=25, div_circ=50, flat_top=True, cumulative_offset=True, *args, **kwargs)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.
cavity_volume
()Calculate the volume of the cavity analytically.
The actual volume may be less due to discretisation effects.
generate_carp_apex_vtx
(basename)Generate vtx file with apex node.
with_resolution
(radius, resolution, lengthratio=1.5, wallthickness=None, apexthickness=None, v0=1.0471975511965976, v1=3.141592653589793, **kwargs)Simplified interface to generate ellipsoid with target resolution.