Muscat.IO.SamcefOutputReader module

Samcef output file reader

CheckIntegrity()[source]
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 SamcefData(arg1=' ', arg2=' ', arg3=' ', arg4=' ', name=' ', nbcomp=1)[source]

Bases: object

GetArgs()[source]
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: object

Samcef output Reader class

Close(needToClose=True)[source]
GetAvailableTimes()[source]

Returns available times to read

Returns:

time values available to read

Return type:

list

Open()[source]
OpenIfNeeded()[source]
Read()[source]

Function that performs the reading of a samcef output file

Returns:

output unstructured mesh object containing reading result

Return type:

Mesh

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

ReadMeshStructure()[source]
ReadMetaData()[source]

Function that performs the reading of the metadata of a samcef output file

SetFileName(fileName)[source]

Sets the name of the file to read

Parameters:

fileName (str) – name of the file to read

SetTimeToRead(time=None, timeIndex=None)[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 which the data is read, by default None

class SamcefOutputBaconReader(folderpath=None, projectname=None)[source]

Bases: PropertiesReader, SamcefOuputReader

Reads 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
GetInternalNodeNumberFromOriginalID(theList)[source]
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:

Mesh

SetFileName(fileName)[source]

Sets the name of file to read. if fileName is “PIPE” then call self.SetReadFromPipe()

Parameters:

fileName (str) – file name to set

decoupe_par_zero(lst)[source]