Openfhandler¶
Derived module from filehandler.py to handle OpenFOAM files.
Warning
This module will be deprecated in next releases. Follow updates on https://github.com/mathLab for news about file handling.
- class OpenFoamHandler[source]
Bases:
pygem.filehandler.FileHandler
OpenFOAM mesh file handler class.
- Variables
infile (string) – name of the input file to be processed.
outfile (string) – name of the output file where to write in.
extensions (list) – extensions of the input/output files. It is equal to [‘’] since openFOAM files do not have extension.
- parse(filename)[source]
Method to parse the filename. It returns a matrix with all the coordinates.
- Parameters
filename (string) – name of the input file.
- Returns
mesh_points: it is a n_points-by-3 matrix containing the coordinates of the points of the mesh
- Return type
Todo
specify when it works
- write(mesh_points, filename)[source]
Writes a openFOAM file, called filename, copying all the lines from self.filename but the coordinates. mesh_points is a matrix that contains the new coordinates to write in the openFOAM file.
- Parameters
mesh_points (numpy.ndarray) – it is a n_points-by-3 matrix containing the coordinates of the points of the mesh.
filename (string) – name of the output file.
Todo
DOCS