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

Functions

def generate (geom, dirname=None, rootdir='meshes')
 Generate the specified geometry, unless it already exists. More...
 

Variables

 xrange = range
 

Function Documentation

◆ generate()

def carputils.mesh.generate.generate (   geom,
  dirname = None,
  rootdir = 'meshes' 
)

Generate the specified geometry, unless it already exists.

This function checks whether the specified mesh already exists, and simply returns it base name if so. Otherwise, the mesh is generated in a new and uniquely named mesh directory, and the base name of this mesh is then returned. This currently only works with :class:carputils.mesh.Block.

To use:

>>> from carputils.mesh import Block, generate
>>> geom = Block(size=(2,2,2))
>>> meshname = generate(geom)
Parameters
generateBlock The geometry to generate
rootdirstr, optional The parent directory to store and search for meshes, defaults to
'meshes'
Returns
str The mesh base name of the requested name

Variable Documentation

◆ xrange

carputils.mesh.generate.xrange = range