PyFoam.RunDictionary.BlockMesh module

Manipulate a C{blockMeshDict}

class PyFoam.RunDictionary.BlockMesh.BlockMesh(name, backup=False)[source]

Bases: PyFoam.RunDictionary.FileBasis.FileBasisBackup

Represents a C{blockMeshDict}-file

_BlockMesh__endProcess(newMesh, getContent=True)
_BlockMesh__startProcess()
__init__(name, backup=False)[source]
Parameters:
  • name – The name of the parameter file
  • backup – create a backup-copy of the file
__module__ = 'PyFoam.RunDictionary.BlockMesh'
_getVertexes()[source]

Get a dictionary with the 3 components of each vertex as keys and the ‘raw’ line as the value

mergeVertices(other)[source]

Merge in the vertexes from another mesh after our own vertexes

normalizePatches()[source]

Rotate patches so that they start with the lowest number vertex

numberVertices(prefix='')[source]

Add comments with the number of the vertex after them :param prefix: a string to add before the number

refineMesh(factors, offset=(0, 0, 0), getContent=False, addOld=True)[source]

Refine the Mesh by multiplying the number of cells in the blocks :param factors: either a scalar to scale in all directions or a tuple with the value for each direction :param offset: an optional tuple for an additionnal offset value for each direction :param getContent: Return the contents instead of writing a fil. Main purpose of this parameter is not to break compatibility with old versions

renumberVertices(other)[source]

Renumber the vertices in the current mesh according to another mesh

stripVertexNumber()[source]

Remove comments after vertices