Muscat.IO.SamcefTools module¶
Return whether a SAMCEF run failed because no license was available.
- class PropertiesReader(folderpath: str | None = None, projectname: str | None = None)[source]¶
Bases:
ReaderBaseSamcef Reader class
- ContactRead(id_min: int, id_max: int) dict[int, dict[str, Any]][source]¶
Creates and parses a trace file (.tra) describing contacts and return a dictionary of parsed information.
This method processes a .tra file resulting from the baconpost execution “.MCT LIST n1 A n2”, which provides information on contacts. WARNING : “.MCT LIST n1 n2” may not create the expected list
The .tra file contains contact IDs along with the following information:
Attributes (int)
Connected nodes (connected to a face)
Target group (the facet)
Max Radius
Max number of elements
Triangulation option
Shells reverse option
Minimal distance DMIN
UN3
OPT
- Parameters:
id_min (int) – Minimum .MCT identifier
id_max (int) – Maximum .MCT identifier
- Returns:
A dictionary where keys are IDs of the contacts and values are the corresponding definitions.
- Return type:
dict
Notes
This function may ignore some information from the trace file and have undesired effect for other use-cases. This reader only considers Node-Facet contacts
- ElementRead() dict[int, list[int]][source]¶
Creates a trace file and parse element information.
This method processes a .tra file generated by the baconpost execution “.MAI DLIST”, which contains information about elements. The file includes element IDs and their composing nodes.
- Returns:
A dictionary where keys are element original IDs and values are the corresponding nodes.
- Return type:
dict
Notes
This function may ignore some information from the .tra file and have undesired effect for other use-cases.
- FctRead(id_min: int, id_max: int, ignore_unsupported: bool) dict[int, dict[str, Any]][source]¶
Creates a trace file and extract function information.
This method creates a trace file (.tra) describing functions and returns a dictionary of parsed information. The .tra file is the result of the baconpost execution “.FCT LIST n1 A n2” (n1, n2 refer to min function id and max id). WARNING : “.FCT LIST n1 n2” may not create the expected list The .tra file contains the function ids as well as the function descriptions.
- Parameters:
id_min (int) – Minimum .FCT identifier
id_max (int) – Maximum .FCT identifier
- Returns:
A dictionary where keys are ids of the functions and values are the corresponding function definitions.
- Return type:
dict
Notes
VERY IMPORTANT !!!! CALL THIS FUNCTION ONLY WITH 1D FUNCTION AND FOR FUNCTIONS SATISFYING: 1. ONLY ONE description WITH abscissae/ordinates format 2. Multiple linear descriptions (only linear) on intervals giving the interval extremities and the values on those extremities This function may ignore some information and have undesired effect for other use-cases.
- NodesRead() tuple[list[int], list[float], list[float], list[float]][source]¶
Create a trace file and parse node information.
This method creates a trace file (.tra) describing nodes and returns parsed node information. The .tra file is the result of the baconpost execution “.NOE DLIST”. It contains the IDs and spatial coordinates of the nodes.
- Returns:
list – Original IDs of the nodes.
list – Corresponding x coordinates.
list – Corresponding y coordinates.
list – Corresponding z coordinates.
Notes
This function may ignore some information and have undesired effect for other use-cases.
- ReadBlockOfFloats(first_values: list[str]) list[float][source]¶
Read a block of consecutive lines containing only float values.
- Parameters:
first_values (list[str]) – Values already read from the first line of the block.
- Returns:
All float values in the block.
- Return type:
list[float]
Notes
The file pointer is left at the beginning of the first line that does not belong to the block.
- ReadBlockOfInts(first_values: list[str]) list[int][source]¶
Read a block of consecutive lines containing only integer values.
- Parameters:
first_values (list[str]) – Values already read from the first line of the block.
- Returns:
All integer values in the block.
- Return type:
list[int]
Notes
The file pointer is left at the beginning of the first line that does not belong to the block.
- ReadElasticMat(id_min: int, id_max: int) dict[int, dict[str, Any]][source]¶
IMPORTANT : call only if all materials are elastic Creates and parses a trace file (.tra) describing ELASTIC materials and return a dictionary of parsed information.
This method creates a .tra file resulting from the baconpost execution “.MAT LIST I n1 n2”, which returns information on material definitions for identifiers between n1 and n2. WARNING : “.MAT LIST n1 n2” may not create the expected list The .tra file contains the identifier, name of the material, as well as:
Poisson number (described by reference values and a multiplicative temporal function)
Young modulus (described by reference values and a multiplicative temporal function)
Thermal expansion (described by reference values and a multiplicative temporal function)
Mass density
Reference temperature
- Parameters:
id_min (int) – Minimum .MAT identifier
id_max (int) – Maximum .MAT identifier
- Returns:
A dictionary where keys are ids of the materials and values are the corresponding material descriptions.
- Return type:
dict
Notes
This function may ignore some information and have undesired effect for other use-cases.
- ReadElementAttributes() dict[int, dict[str, Any]][source]¶
Create a trace file and parse element/material affectations.
This method creates a trace file (.tra) describing element/material affectations and returns a dictionary of parsed information. The .tra file is the result of the baconpost execution “.AEL LIST” (returns information of attributions of properties to element). The .tra file contains the element ids, the corresponding degree, the material name affected to this element, and the integration rules.
- Returns:
A dictionary where keys are ids of the elements and values are the corresponding attributes.
- Return type:
dict
Notes
CURRENTLY, THIS METHOD ONLY ALLOWS READING MATERIALS (affected with .AEL in the .dat file), and is not designed to behave well if there are other attributes affected with .AEL in the .dat file. This function may ignore some information (non exhaustive result) and have undesired effect for other use-cases.
- ReadMechanicalBoundaryConditions() tuple[dict[int, dict[str, Any]], dict[int, dict[str, Any]], dict[int, dict[str, Any]]][source]¶
Create a trace file describing mechanical boundary conditions.
This reader only considers conditions imposed on Node, Edge, and Structure. It creates a .tra file describing mechanical boundary conditions and returns a dictionary of parsed information. The .tra file is the result of the baconpost execution “.CLM LIST TOUT” and contains element ids (for mechanical conditions on edges), node ids, or structure, as well as the nature of the mechanical boundary condition, components, reference values, and corresponding function ids.
- Returns:
A dictionary containing three key-value pairs:
- node_id_to_clmdict
Keys are ids of the nodes, values are the corresponding boundary conditions.
- element_id_to_clmdict
Keys are ids of the elements, values are the corresponding boundary conditions.
- structure_id_to_clmdict
Keys are ids of the structures, values are the corresponding boundary conditions.
- Return type:
dict
Notes
This function may ignore some information and have undesired effect for other use-cases.
This function assumes that only Node, Edge, and Structure are concerned, which may be restrictive.
The .tra file contains information about mechanical boundary conditions such as “Prescribed pressure”, “Prescribed displacement”, etc.
- SelRead() dict[int, dict[str, Any]][source]¶
Create a trace file and parse group contents.
This method creates a trace file (.tra) describing group contents and returns a dictionary of parsed information. The .tra file is the result of the baconpost execution “.SEL LIST TOUT”. It contains the group IDs as well as:
Nature of objects composing the group (cells, nodes, or faces)
Group name
Identifiers of the objects composing the group (for faces, a couple instead of a single ID (cell number, face order number))
- Returns:
A dictionary where keys are IDs of the groups, and values are the corresponding information (name, nature of objects, IDs of objects).
- Return type:
dict
Notes
This function may ignore some information and have undesired effect for other use-cases.