OpenPisco.MuscatExtentions.FoamReader module#
- class OpenPisco.MuscatExtentions.FoamReader.FoamReader[source]#
Bases:
ReaderBase
- BuildMeshFromInformation(nodesCoordinates: ndarray, connectivities: dict, boundaryTags: dict) Mesh [source]#
Build mesh based on data parsed from FOAM format
- Parameters
nodesCoordinates (np.ndarray) – nodes coordinates
connectivities (dict) – mapping between element type and element connectivities
boundaryTags (dict) – mapping between boundary tag names and element ids within tags
- Returns
Mesh object
- Return type
Mesh
- Read(inputFile: Optional[str] = None) Mesh [source]#
Read mesh written using FOAM format from file
- Parameters
inputFile (str) – input file
- Returns
Mesh object
- Return type
Mesh
- ReadBoundaryTags(directoryPath: str) dict [source]#
Read boundary tags from file
- Parameters
directoryPath (str) – directory path
- Returns
mapping between boundary tags and element ids is tags
- Return type
np.ndarray
- ReadCoordinates(directoryPath: str) ndarray [source]#
Read nodes coordinates from file
- Parameters
directoryPath (str) – OpenFOAM directory path
- Returns
nodes coordinates
- Return type
np.ndarray
- OpenPisco.MuscatExtentions.FoamReader.ReadExtraField(path: str, fieldNames: Iterable[str], fieldSupports: Iterable[ElementType], binary: bool = True) ndarray [source]#
Read field produced by OpenFOAM
- Parameters
path (str) – input file location
fieldNames (Iterable[str]) – fields name to be read
fieldSupports (Iterable["ElementType"]) – Field support associated to fields to be read
binary (bool) – read from binary or ASCII, default is binary
- Returns
field array
- Return type
np.ndarray