IGLFEAModel
Module: cae
High-level access wrapper for finite element analysis (FEA) data.
The model keeps references to a mesh and a set of analysis results
and provides convenience methods to extract fields, compute derived
scalar fields (e.g. stress measures or displacement components),
query min/max values and retrieve node histories.
Attributes:
mesh (IGLFEAMesh|None): Reference to the FEA mesh.
results (IGLFEAResults|None): Reference to the analysis results.
__init__
method
__init__(self)
Initialize an empty FEA model.
The mesh and results references are initialized to None and
should be assigned by the caller or a loader routine.
GetMesh
method
GetMesh(self)
Return the mesh associated with this FEA model.
Returns
IGLFEAMesh: The mesh object containing node and element data.
GetResults
method
GetResults(self)
Return the analysis results associated with this FEA model.
Returns
IGLFEAResults: The results object containing analysis data.
_get_step
method
_get_step(self, analysis_type: IGLAnalysisType, step_id: int)
Retrieve a specific analysis step from the results.
Args
| Name | Type | Description |
|---|---|---|
| analysis_type | Analysis type identifier (e.g. IGLAnalysisType). | |
| step_id (int) | Step index or identifier. |
Returns
An analysis step object as provided by the results container.
Raises
ValueError: If the requested step is not present in results.
_extract_field_values
method
_extract_field_values(self, field, bvis, entity_ids)
Extract values and ids from a field object according to entity selection.
Behavior:
- If entity_ids is None: return the full field (ids, values).
- If entity_ids is a scalar: return the single entity value via field.get_value.
- If entity_ids is an iterable: return multiple entity values via field.get_values.
Behavior:
- If entity_ids is None: return the full field (ids, values).
- If entity_ids is a scalar: return the single entity value via field.get_value.
- If entity_ids is an iterable: return multiple entity values via field.get_values.
Args
| Name | Type | Description |
|---|---|---|
| field | Field object exposing attributes/methods: | - ids, values for full-field extraction - get_value(entity_id) for single entity - get_values(entity_ids) for multiple entities |
| entity_ids (None|int|iterable, optional) | Entity selection. | |
| bvis | Map node ids to visualisation node indices |
Returns
tuple or value:
- (ids, values) for full-field
- single value for scalar entity_ids
- array/list of values for multiple entity_ids
- values for visualization
get_analysis_time
method
get_analysis_time(self, step: int, inc: int, analysis_type)
GetField
method
GetField(self, field_name: str, step_id: int, increment_id: float, entity_ids, analysis_type)
Get raw values for a named field at a specified step/increment.
Args
| Name | Type | Description |
|---|---|---|
| field_name (str) | Name of the field to retrieve. | |
| step_id (int) | Step index or identifier. | |
| increment_id (float) | Increment index within the step. | |
| entity_ids (None|int|iterable, optional) | Entity selection (see _extract_field_values). | |
| analysis_type | Analysis type (default: IGLAnalysisType.STATIC). |
Returns
tuple or value: See _extract_field_values for return shapes.
Raises
ValueError: If the requested step or field is not found.
GetStressTensor
method
GetStressTensor(self, step_id: int, increment_id: int, analysis_type)
Returns Stress Tensor
Args
| Name | Type | Description |
|---|---|---|
| step_id (int) | Step index or identifier. | |
| increment_id (int) | Increment index within the step. | |
| analysis_type | Analysis type (default: IGLAnalysisType.STATIC). |
Returns
IGLTensorField
Raises
ValueError: If the step or stress field is not found.
GetStress
method
GetStress(self, step_id: int, increment_id: int, stress_type: str, analysis_type, node_ids)
Compute and return stress values of the requested type.
This method looks up the raw "STRESS" field in the requested step,
computes the requested stress scalar via IGLFEAPost.compute_stress,
and extracts values for the requested node(s).
This method looks up the raw "STRESS" field in the requested step,
computes the requested stress scalar via IGLFEAPost.compute_stress,
and extracts values for the requested node(s).
Args
| Name | Type | Description |
|---|---|---|
| step_id (int) | Step index or identifier. | |
| increment_id (int) | Increment index within the step. | |
| stress_type (str) | Identifier for the stress operation (see IGLFEAPost). | |
| node_ids (None|int|iterable, optional) | Node selection. | |
| analysis_type | Analysis type (default: IGLAnalysisType.STATIC). |
Returns
IGLScalarField
Raises
ValueError: If the step or stress field is not found.
GetStrainTensor
method
GetStrainTensor(self, step_id: int, increment_id: int, analysis_type)
Returns Strain Tensor
Args
| Name | Type | Description |
|---|---|---|
| step_id (int) | Step index or identifier. | |
| increment_id (int) | Increment index within the step. | |
| analysis_type | Analysis type (default: IGLAnalysisType.STATIC). |
Returns
IGLTensorField
Raises
ValueError: If the step or strain field is not found.
GetStrain
method
GetStrain(self, step_id: int, increment_id: int, strain_type: str, analysis_type, node_ids)
Compute and return strain values of the requested type.
This method looks up the raw "STRAIN" field in the requested step,
computes the requested strain scalar via IGLFEAPost.compute_strain,
and extracts values for the requested node(s).
This method looks up the raw "STRAIN" field in the requested step,
computes the requested strain scalar via IGLFEAPost.compute_strain,
and extracts values for the requested node(s).
Args
| Name | Type | Description |
|---|---|---|
| step_id (int) | Step index or identifier. | |
| increment_id (int) | Increment index within the step. | |
| strain_type (str) | Identifier for the strain operation (see IGLFEAPost). | |
| node_ids (None|int|iterable, optional) | Node selection. | |
| analysis_type | Analysis type (default: IGLAnalysisType.STATIC). |
Returns
IGLScalarField
Raises
ValueError: If the step or strain field is not found.
GetDisplacement
method
GetDisplacement(self, step_id: int, increment_id: int, component, analysis_type, node_ids)
Compute and return displacement values.
The field name "DISPLACEMENT" is used. The requested component (e.g. "MAG",
"X", "Y", "Z") is computed via IGLFEAPost.compute_displacement.
The field name "DISPLACEMENT" is used. The requested component (e.g. "MAG",
"X", "Y", "Z") is computed via IGLFEAPost.compute_displacement.
Args
| Name | Type | Description |
|---|---|---|
| step_id (int) | Step index or identifier. | |
| increment_id (int) | Increment index within the step. | |
| component (str, optional) | Displacement component to compute (default "MAG"). | |
| node_ids (None|int|iterable, optional) | Node selection. | |
| analysis_type | Analysis type (default: IGLAnalysisType.STATIC). |
Returns
tuple or value: Computed displacement field or selected node values.
Raises
ValueError: If the step or displacement field is not found.
GetDisplacementVector
method
GetDisplacementVector(self, step_id: int, increment_id: float, node_ids, analysis_type)
Return displacement vectors.
Returns
-------
IGLVectorField
GetNodalForces
method
GetNodalForces(self, step_id: int, increment_id: int, component, analysis_type, node_ids)
Compute and return force values.
The field name "FORCE" is used. The requested component (e.g. "FMAG",
"FX", "FY", "FZ") is computed via IGLFEAPost.compute_force.
The field name "FORCE" is used. The requested component (e.g. "FMAG",
"FX", "FY", "FZ") is computed via IGLFEAPost.compute_force.
Args
| Name | Type | Description |
|---|---|---|
| step_id (int) | Step index or identifier. | |
| increment_id (int) | Increment index within the step. | |
| component (str, optional) | Force component to compute (default "FMAG"). | |
| node_ids (None|int|iterable, optional) | Node selection. | |
| analysis_type | Analysis type (default: IGLAnalysisType.STATIC). |
Returns
tuple or value: Computed force field or selected node values.
Raises
ValueError: If the step or force field is not found.
GetForceVector
method
GetForceVector(self, step_id: int, increment_id: float, node_ids, analysis_type)
Return Force vectors.
Returns
-------
IGLVectorField
GetModeShape
method
GetModeShape(self, step_id: int, mode_number: int)
Return displacement vector field of the mode shape.
Returns
-------
IGLVectorField
NormalizedVector
method
NormalizedVector(self, vectors)
GetFieldNames
method
GetFieldNames(self, step_id: int, analysis_type)
Return the list of field names available in a given step.
Args
| Name | Type | Description |
|---|---|---|
| step_id (int) | Step index or identifier. | |
| analysis_type | Analysis type (default: IGLAnalysisType.STATIC). |
Returns
list[str]: Field names available for the specified step.
GetSteps
method
GetSteps(self)
Return the internal steps collection from the results object.
Returns
Iterable: The steps container stored in the results object.
GetNumberOfSteps
method
GetNumberOfSteps(self)
Return the number of analysis steps in the results.
Returns
int: Number of steps.
Note:
This method forwards the call to the results.num_steps() method.
GetStep
method
GetStep(self, analysis_type: IGLAnalysisType, step_id)
Return a raw step object from the results without validation.
Args
| Name | Type | Description |
|---|---|---|
| analysis_type | Analysis type identifier. | |
| step_id (int) | Step index or identifier. |
Returns
Step object or None: The step as returned by results.get_step().
GetAnalysisType
method
GetAnalysisType(self, stepId: int)
Return type of analysis of the step.
Args
| Name | Type | Description |
|---|---|---|
| step_id (int) | Step index or identifier. |
Returns
IGLAnalysisType object or None
GetNodeHistory
method
GetNodeHistory(self, node_id: int, field_name: str, component: IGLFEAResultType, analysis_type)
Collect a time history for a given node and field across steps.
The method iterates over all steps in the results, filters by analysis_type,
and queries the requested field at the specified node for each step.
The method iterates over all steps in the results, filters by analysis_type,
and queries the requested field at the specified node for each step.
Args
| Name | Type | Description |
|---|---|---|
| node_id (int) | Node identifier. | |
| field_name (str) | Field to sample (e.g. "DISPLACEMENT", "STRESS" , "STRAIN"). | |
| analysis_type | Analysis type to filter steps (default: IGLAnalysisType.STATIC). | |
| component | IGLFEAResultType | None |
Returns
numpy.ndarray: Array of shape (N, 2) with [time, value] entries.
dtype=object to accommodate scalar or vector values.
GetAvailableStressTypes
method
GetAvailableStressTypes(self)
Return a list of available stress computation types.
Returns
list[str]: Keys of IGLFEAPost.STRESS_OPERATIONS indicating supported stress ops.
GetAvailableStrainTypes
method
GetAvailableStrainTypes(self)
Return a list of available strain computation types.
Returns
list[str]: Keys of IGLFEAPost.STRAIN_OPERATIONS indicating supported strain ops.
GetAvailableDisplacementTypes
method
GetAvailableDisplacementTypes(self)
Return a list of available displacement computation types.
Returns
list[str]: Keys of IGLFEAPost.DISPLACEMENT_OPERATIONS indicating supported displacement ops.
GetAvailableForceTypes
method
GetAvailableForceTypes(self)
Return a list of available force computation types.
Returns
list[str]: Keys of IGLFEAPost.FORCE_OPERATIONS indicating supported force ops.
GetResult
method
GetResult(self, ResName: IGLFEAResultType, step: int, inc: int, analysis_type)
Convenience method to retrieve a specific result field by name.
Args
| Name | Type | Description |
|---|---|---|
| ResName (IGLFEAResultType) | The type of result to retrieve (e.g. IGLFEAResultType.SX). | |
| step | The analysis step index or identifier. | |
| inc | The increment index within the step. |
Returns
Field object or None: The requested result field, or None if not found.
PrintModelInfo
method
PrintModelInfo(self)
Convenience method to print the information of the FEA Model
PrintNodalField
staticmethod
PrintNodalField(field, title, max_rows)
Print nodal field data in tabular format.
PrintStressTensorSummary
staticmethod
PrintStressTensorSummary(stress_field)
Print min/max summary for each stress component.
Parameters
| Name | Type | Description |
|---|---|---|
| stress_field | IGLTensorField | |
| Stress tensor field with | values.shape = (N,6) | |
| Order | [SXX, SYY, SZZ, SXY, SYZ, SXZ] |
PrintNodalResult
staticmethod
PrintNodalResult(resname: str, nodalvalues: np.ndarray, filename)
Print nodal result values in tabular format.
Parameters
| Name | Type | Description |
|---|---|---|
| resname | str | |
| nodalvalues | np.ndarray | |
| Supported formats | ||
| Scalar | shape = (N,2) [node_id, value] | |
| Vector | shape = (N,4) [node_id, x, y, z] | |
| Tensor | shape = (N,7) [node_id, xx, yy, zz, xy, yz, xz] | |
| filename | str | None |
PrintNodalArray
staticmethod
PrintNodalArray(title: str, data: np.ndarray, filename, delimiter)
Print or save nodal array.
Parameters
| Name | Type | Description |
|---|---|---|
| data | np.ndarray | |
| filename | str | None | |
| delimiter | str |
ReadNodalArray
staticmethod
ReadNodalArray(filename, delimiter)
Read nodal result array from CSV/text file.
Parameters
| Name | Type | Description |
|---|---|---|
| filename | str | |
| delimiter | str |
Returns
np.ndarray
PrintHistory
staticmethod
PrintHistory(history: np.ndarray, headers, title)
Print history table.
Parameters
| Name | Type | Description |
|---|---|---|
| history | np.ndarray | |
| headers | list[str] | None | |
| Example | ["Time", "Value"] ["Time", "UX", "UY", "UZ"] ["Time", "SXX", "SYY", "SZZ", "SXY", "SYZ", "SXZ"] | |
| title | str |