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

Generate a one dimensional mesh of line segments. More...

Inheritance diagram for carputils.mesh.cable.Cable:
carputils.mesh.general.Mesh

Public Member Functions

def __init__ (self, x0, x1, dx=0.1)
 
- Public Member Functions inherited from carputils.mesh.general.Mesh
def __init__ (self)
 
def add_region (self, tag, func)
 Add a new tag region. More...
 
def points (self)
 Generate and return numpy array of point coordinates. More...
 
def n_pts (self)
 Return the number of points/nodes in the mesh. More...
 
def elements (self)
 Generate and return list of numpy arrays of element node indices. More...
 
def n_elem (self)
 Count and return the total number of elements in the mesh. More...
 
def element_centres (self)
 Calculate the centroids of the mesh elements. More...
 
def element_tags (self)
 Determine element tags based on rules passed to :meth:add_region. More...
 
def fibres (self)
 Generate numpy array of fibre vectors and return. More...
 
def generate_carp (self, meshname)
 Generate the mesh and store it to disk in openCARP format. More...
 
def generate_vtk (self, filename)
 Generate VTK file of mesh. More...
 

Detailed Description

Generate a one dimensional mesh of line segments.

The generated mesh is aligned along the x axis, with y and z set to 0. The mesh is defined by three parameters, the start and end x coordinate and the node spacing, in mm.

To generate a mesh from x=0 to x=10, with 0.1mm spacing:

>>> geom = Cable(0, 10, 0.1)
>>> geom.generate_carp('mesh/cable')

At present, fibres are always aligned in the positive x direction.

For more information on defining mesh regions etc., please see the :ref:mesh_generation section of the documentation.

Parameters
x0float The lower x limit of the mesh, in mm
x1float The upper x limit of the mesh, in mm
dxfloat, optional The node spacing of the mesh, in mm, defaults to 0.1

Constructor & Destructor Documentation

◆ __init__()

def carputils.mesh.cable.Cable.__init__ (   self,
  x0,
  x1,
  dx = 0.1 
)

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