Muscat.IO.RstReader module¶
rst based ansys mesh reader. returns an unstructured mesh (class from BasicTools)
- ReadRst(fileName: str, time: float64 = None, timeIndex: int64 = None, fromElementalNodalToNodal=True)[source]¶
Function mesh and solution fields (noda, elemental and elemental nodal) from a rst file
- Parameters:
fileName (str, optional) – name of the file to be read, by default None
time (float, optional) – time at which the field is read, by default None
timeIndex (int, optional) – time index at which the field is read, by default None
- Returns:
output Mesh object containing the results
- Return type:
- class RstReader[source]¶
Bases:
ReaderBaseRst Reader class
- GetAvailableResultsAndOperators() List[source]¶
Returns the available results and its operator name
- Returns:
contains a namedTuple with the results. attributes are name, operator_name, native_location, n_components
- Return type:
list
- GetAvailableTimes() ndarray[source]¶
Returns the available times at which data can be read
- Returns:
available times at which data can be read
- Return type:
np.ndarray
- GetModel()[source]¶
Function to recover the dpf Model associated to the rst file
- Raises:
RuntimeError – if the fileName is not already set
- Returns:
dpf model
- Return type:
Model
- MeshRead() Mesh[source]¶
Function that performs the reading of a mesh in a rst file
- Returns:
mesh containing reading result
- Return type:
- Read(time: float64 = None, timeIndex: int64 = None, fromElementalNodalToNodal=True) Mesh[source]¶
Function that performs the reading of the mesh and the fields in the rst
- Parameters:
time (float, optional) – time at which the field is read, by default None
timeIndex (int, optional) – time index at which the field is read, by default None
- Returns:
output Mesh object containing the results
- Return type:
- ReadField(fieldname, time: float64 = None, timeIndex: int64 = None, fromElementalNodalToNodal=True) ndarray[source]¶
Function that performs the reading of a field
- Parameters:
fieldname (str, optional) – name of the field to be read, by default None
time (float, optional) – time at which the field is read, by default None
timeIndex (int, optional) – time index at which the field is read, by default None
- Returns:
- for an ElementalNodal field:
if fromElementalNodalToNodal = True (default), this function returns a numpy array of the averaged value at the nodes if fromElementalNodalToNodal = False, this function returns a list of discontinuous FEfields (one for each component of the field)
- Return type:
np.ndarray
- ReadMetaData()[source]¶
Function that performs the reading of the metadata of an rst file (number of points, number of elements, timesteps, fields)
- SetFileName(fileName: str) None[source]¶
Function to set the file to read
- Parameters:
fileName (str) – path to the simulation
- SetTimeToRead(time: float64 = None, timeIndex: int64 = None) int64[source]¶
Sets the time at which the data is read
- Parameters:
time (float, optional) – time at which the data is read, by default None
timeIndex (int, optional) – time index at which the data is read, by default None
- Returns:
time index at which the data is read
- Return type:
int