carputils
Doxygen code documentation for the python framework controlling openCARP
Classes | Functions | Variables
carputils.mesh.general Namespace Reference

Base framework for the mesh generation classes. More...

Classes

class  Mesh
 A generic mesh class the provides the core functionality in 1D and 3D. More...
 
class  Mesh2D
 A generic mesh class adding the core functionality for 2D meshes. More...
 
class  Mesh3D
 A generic mesh class adding the core functionality for 3D meshes. More...
 

Functions

def closest_to_rangles (angles)
 Return the indicies of the angles closest to a series of right angles. More...
 
def distribute_elements (n_type1, n_type2, type1, type2)
 Distribute two element types evenly throughout a layer. More...
 

Variables

 xrange = range
 
list ELEM_ORDER = ['hexa', 'prism1', 'prism2', 'tetra', 'quad', 'tri', 'line']
 
dictionary ELEM_NUM_NODES
 
dictionary TET_SUBDIVISIONS
 
dictionary TRI_SUBDIVISIONS
 
dictionary FACE_SELECTIONS
 
dictionary prism_faces
 
dictionary TET_FACE_SELECTIONS
 
dictionary CARP_ELEM_FORMAT
 
list VTK_HEX_REORDER = [0, 1, 3, 2, 4, 5, 7, 6]
 
list VTK_PRISM_REORDER = [0, 2, 4, 1, 3, 5]
 
list VTK_QUAD_REORDER = [0, 1, 3, 2]
 
dictionary VTK_CELL_TYPES
 

Detailed Description

Base framework for the mesh generation classes.

This module contains the core framework used by the other mesh generation modules, and implements shared functionality including the tessellation of larger elements into tetrahedra, fibre field generation and mesh file output.

For information on the detail of the implementation of this module and other derived classes, see the meshing section of the carputils documentation.

Function Documentation

◆ closest_to_rangles()

def carputils.mesh.general.closest_to_rangles (   angles)

Return the indicies of the angles closest to a series of right angles.

◆ distribute_elements()

def carputils.mesh.general.distribute_elements (   n_type1,
  n_type2,
  type1,
  type2 
)

Distribute two element types evenly throughout a layer.

Variable Documentation

◆ CARP_ELEM_FORMAT

dictionary carputils.mesh.general.CARP_ELEM_FORMAT
Initial value:
1 = {
2  'hexa': 'Hx {0[5]} {0[4]} {0[6]} {0[7]} {0[1]} {0[3]} {0[2]} {0[0]}',
3  'prism1': 'Pr {0[1]} {0[3]} {0[5]} {0[0]} {0[4]} {0[2]}',
4  'prism2': 'Pr {0[1]} {0[3]} {0[5]} {0[0]} {0[4]} {0[2]}',
5  'tetra': 'Tt {0[0]} {0[1]} {0[2]} {0[3]}',
6  'quad': 'Qd {0[0]} {0[1]} {0[3]} {0[2]}',
7  'tri': 'Tr {0[0]} {0[2]} {0[1]}',
8  'line': 'Ln {0[0]} {0[1]}'
9 }

◆ ELEM_NUM_NODES

dictionary carputils.mesh.general.ELEM_NUM_NODES
Initial value:
1 = {
2  'hexa': 8,
3  'prism1': 6,
4  'prism2': 6,
5  'tetra': 4,
6  'quad': 4,
7  'tri': 3,
8  'line': 2
9 }

◆ ELEM_ORDER

list carputils.mesh.general.ELEM_ORDER = ['hexa', 'prism1', 'prism2', 'tetra', 'quad', 'tri', 'line']

◆ FACE_SELECTIONS

dictionary carputils.mesh.general.FACE_SELECTIONS
Initial value:
1 = {
2  'hexa': {
3  'front': [0, 2, 4, 6],
4  'back': [1, 5, 3, 7],
5  'top': [4, 6, 5, 7],
6  'bottom': [0, 1, 2, 3],
7  'left': [2, 3, 6, 7],
8  'right': [1, 0, 5, 4]
9  },
10 }

◆ prism_faces

dictionary carputils.mesh.general.prism_faces
Initial value:
1 = {
2  'front': [0, 2, 4],
3  'back': [1, 5, 3],
4  'base': [2, 0, 3, 1],
5  'upperleft': [4, 2, 5, 3],
6  'upperright': [0, 4, 1, 5]
7 }

◆ TET_FACE_SELECTIONS

dictionary carputils.mesh.general.TET_FACE_SELECTIONS
Initial value:
1 = {
2  'hexa': {
3  'front': [(3, [0, 4, 2]), (5, [2, 4, 6])],
4  'back': [(0, [1, 3, 5]), (2, [5, 3, 7])],
5  'top': [(5, [4, 7, 6]), (2, [4, 5, 7])],
6  'bottom': [(3, [0, 2, 3]), (0, [0, 3, 1])],
7  'left': [(5, [2, 6, 7]), (4, [2, 7, 3])],
8  'right': [(0, [1, 5, 0]), (1, [0, 5, 4])]
9  },
10  'prism1': {
11  'front': [(2, [0, 4, 2])],
12  'back': [(0, [1, 3, 5])],
13  'base': [(0, [0, 3, 1]), (1, [0, 2, 3])],
14  'upperleft': [(1, [2, 5, 3]), (2, [2, 4, 5])],
15  'upperright': [(0, [0, 1, 5]), (2, [0, 5, 4])]
16  },
17  'prism2': {
18  'front': [(1, [0, 4, 2])],
19  'back': [(0, [1, 3, 5])],
20  'base': [(0, [0, 3, 1]), (1, [0, 2, 3])],
21  'upperleft': [(1, [2, 4, 3]), (2, [3, 4, 5])],
22  'upperright': [(0, [0, 1, 5]), (2, [0, 5, 4])]
23  }
24 }

◆ TET_SUBDIVISIONS

dictionary carputils.mesh.general.TET_SUBDIVISIONS
Initial value:
1 = {
2  'hexa': [[0, 1, 3, 5],
3  [0, 3, 4, 5],
4  [3, 4, 5, 7],
5  [0, 3, 2, 4],
6  [2, 4, 3, 7],
7  [2, 4, 7, 6]],
8  'prism1': [[0, 1, 3, 5],
9  [0, 3, 2, 5],
10  [0, 5, 2, 4]],
11  'prism2': [[0, 1, 3, 5],
12  [0, 3, 2, 4],
13  [0, 5, 3, 4]],
14  'tetra': [[0, 1, 2, 3]]
15 }

◆ TRI_SUBDIVISIONS

dictionary carputils.mesh.general.TRI_SUBDIVISIONS
Initial value:
1 = {
2  'quad': [[0, 1, 2],
3  [1, 3, 2]]
4 }

◆ VTK_CELL_TYPES

dictionary carputils.mesh.general.VTK_CELL_TYPES
Initial value:
1 = {
2  'hexa': 12,
3  'prism1': 13,
4  'prism2': 13,
5  'tetra': 10,
6  'quad': 9,
7  'tri': 5,
8  'line': 3
9 }

◆ VTK_HEX_REORDER

list carputils.mesh.general.VTK_HEX_REORDER = [0, 1, 3, 2, 4, 5, 7, 6]

◆ VTK_PRISM_REORDER

list carputils.mesh.general.VTK_PRISM_REORDER = [0, 2, 4, 1, 3, 5]

◆ VTK_QUAD_REORDER

list carputils.mesh.general.VTK_QUAD_REORDER = [0, 1, 3, 2]

◆ xrange

carputils.mesh.general.xrange = range