carputils
Doxygen code documentation for the python framework controlling openCARP
|
Generate a two dimensional mesh of a regular grid. More...
Public Member Functions | |
def | __init__ (self, lowerleft, upperright, resolution=0.1, fibres=(1.0, 0.0), triangulate=False) |
![]() | |
def | __init__ (self, triangulate=False) |
def | elements (self) |
Generate and return array of element point indices. More... | |
![]() | |
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... | |
Generate a two dimensional mesh of a regular grid.
The generated mesh is aligned along the x-y plane, with z set to 0. Nodes are arranged on a regularly spaced grid and connected by quad elements. The mesh is defined by the x,y coordinates of the lower left and upper right corners and the mesh resolution, in mm.
To generate a mesh from 0,0 to 10,10, with 0.1mm spacing:
Constant fibre vectors are set by the fibres optional command line argument, which defaults to be aligned with the positive x direction. The mesh may also be triangulated by use of the triangulate
argument.
For more information on defining mesh regions etc., please see the :ref:`mesh_generation` section of the documentation.
lowerleft | array-like The lower left (x,y) coordinate of the mesh, in mm |
upperright | array-like The upper right (x,y) coordinate of the mesh, in mm |
resolution | float or array-like, optional The resolution of the mesh in mm, either as a scalar for the same in both directions or as a list or array when in 2 directions, defaults to |
0.1 | |
fibres | array-like, optional Specify a fibre vector, defaults to (1.0, 0.0) |
def carputils.mesh.grid.Grid.__init__ | ( | self, | |
lowerleft, | |||
upperright, | |||
resolution = 0.1 , |
|||
fibres = (1.0, 0.0) , |
|||
triangulate = False |
|||
) |