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

Function to generate a CARP mesh if it does not yet exist. More...

Functions

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

Detailed Description

Function to generate a CARP mesh if it does not yet exist.

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)
def generate(geom, dirname=None, rootdir='meshes')
Generate the specified geometry, unless it already exists.
Definition: generate.py:66
Classes and routines for the generation of geometric meshes.
Definition: __init__.py:1
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