Muscat.IO.SamcefOutputReader module¶
Samcef output file reader
- ReadFieldFromDataBase(fieldname, field, time=None)[source]¶
Function API for reading a field in a samcef output file
- Parameters:
fieldname (str) – name of the file to be read
field (str) – name of the field to read in the file
time (float, optional) – time at which the data is read, by default None
- Returns:
indices and values of the field to read
- Return type:
np.ndarray, np.ndarray
- class SamcefDataE(*k, **nk)[source]¶
Bases:
SamcefData
- class SamcefDataG(*k, **nk)[source]¶
Bases:
SamcefData
- class SamcefDataN(*k, **nk)[source]¶
Bases:
SamcefData
- class SamcefOuputReader[source]¶
Bases:
objectSamcef output Reader class
- GetAvailableTimes()[source]¶
Returns available times to read
- Returns:
time values available to read
- Return type:
list
- Read()[source]¶
Function that performs the reading of a samcef output file
- Returns:
output unstructured mesh object containing reading result
- Return type:
- ReadField(fieldname=None, time=None, timeIndex=None)[source]¶
Function that performs the reading of a field in a samcef output file
- Parameters:
fieldname (str, optional) – name of the field to read, by default None
time (float, optional) – time at which the data is read, by default None
timeIndex (int, optional) – time index which the data is read, by default None
- Returns:
indices and values of the field to read
- Return type:
np.ndarray, np.ndarray
- class SamcefOutputBaconReader(folderpath=None, projectname=None)[source]¶
Bases:
PropertiesReader,SamcefOuputReaderReads and parses mesh and element data from SAMCEF output files using baconpost.
This class provides an interface to process SAMCEF output data, extract the mesh structure. This class inherits from PropertiesReader and can be used to extract other relevant information (element attributes, mechanical boundary conditions).
Examples
>>> reader = SamcefOutputBaconReader(folderpath=tempdir, projectname=projectname) >>> reader.SetFileName(filename) >>> reader.fieldsToRead = ["U"] >>> reader.LCP = "as" >>> reader.timeToRead = None >>> mesh = reader.Read() >>> element_id_to_element_info = reader.ReadElementAttributes() # uses class PropertiesReader >>> node_id_to_clm, element_id_to_clm, structure_id_to_clm = reader.ReadMechanicalBoundaryConditions() # uses class PropertiesReader >>> group_id_to_infos = reader.SelRead() # uses class PropertiesReader
- ReadMeshStructure()[source]¶
Read a SAMCEF output file and construct a mesh object.
This function reads only the nodes and elements from a SAMCEF output file using baconpost and constructs a mesh object. The function makes certain assumptions about element types.
- Returns:
Output mesh object.
- Return type: