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)[source]¶
Function mesh and solution fields (nodal and elemental) 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) Mesh[source]¶
Function that performs the reading of the mesh and the nodal/element 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) 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:
Depending on the location of the field in the rst this function can return a ‘Nodal’ field (numpy array), “Elemental” field (numpy array), or a “ElementalNodal” field (FEField)
- Return type:
np.ndarray or FEField
- 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 If the simulation is modal then it sets self.modal to True because it needs to accomodate to the 1 index of modal simulations
- 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