OpenPisco.ExternalTools.Aster.AsterInterface module#
AsterInterface
This is the dedicated interface for the external physical solver Code_Aster. Its main responsability is to facilitate the interactions with Code_Aster, either by providing features to build the command line required to run the solver or to retrieve field computed by said solver.
- exception OpenPisco.ExternalTools.Aster.AsterInterface.AsterExecutableNotFound[source]#
Bases:
ExceptionShould be raised when the Code_Aster executable was not found
- class OpenPisco.ExternalTools.Aster.AsterInterface.AsterInterface[source]#
Bases:
AppExecutableBase- class AsterInterface#
Interface for the finite element solver Code_Aster
- CleanWorkingDirectory(extensions: Iterable)[source]#
Clean working directory, remove specific files with provided extensions
- Parameters
extensions (Iterable) – collection of extension to be remove from the working directory
- ComputeMemoryLimit()[source]#
When running the solver, the user is expected to provide beforehand the memory limit. Rather than letting the user estimates the value, it is computed automatically.
- ExecuteAster() int[source]#
Run Code_Aster executable
- Returns
RETURN_SUCCESS is sucess, RETURN_FAIL if failure
- Return type
int
- Raises
AsterExecutableNotFound – Raised when the executable is not found
AsterPrecisionError – Raised when the solver accuracy is not satisfactory
- GetField(fieldName: str, fieldSupport: str, index: Optional[int] = None) ndarray[source]#
Retrieve field of a given name at a specific location
- Parameters
fieldName (str) – field name
fieldSupport (str) – field support
index (int, optional) – field number id (can be time step id for instance), by default None
- Returns
array containing the field
- Return type
np.ndarray
- Raises
KeyError – raised if field name provided was not found in the mesh support.
- GetIntegrationRuleFor(name: str) Tuple[ndarray, ndarray][source]#
Get integration rule from rule name
- Parameters
name (str) – integration rule name
- Returns
Integration rule integration point localization and weights
- Return type
Tuple[np.ndarray,np.ndarray]
- GetScalar(name: str) float[source]#
Get scalar from name
- Parameters
name (str) – scalar name
- Returns
scalar value
- Return type
float
- GetScalarbyLoadCase(name: str, loadcase: str)[source]#
Get scalar by load case
- Parameters
name (str) – scalar name
loadcase (str) – load cases names
- Returns
scalar values
- Return type
float
- GetScalarsbyOrders(name: str, listSize: int = 1) float[source]#
Get scalar by order
- Parameters
name (str) – scalar name
listSize (int, optional) – size of collection of scalars expected, by default 1
- Returns
scalar values
- Return type
float
- GetSolverComputedError() float[source]#
Retrieve solver computed error after the computation
- Returns
computed error
- Return type
float
- GetStudyFilesFromPath(path: str) List[str][source]#
Retrieve file names within a path associated to a specific study
- Parameters
path (str) – location of studies
- Returns
Collection of file names associated to a study.
- Return type
List[str]
- exception OpenPisco.ExternalTools.Aster.AsterInterface.AsterPrecisionError[source]#
Bases:
ExceptionShould be raised when the solution returned by Code_Aster is not accurate enough
- OpenPisco.ExternalTools.Aster.AsterInterface.CheckIntegrity_LinToQuad(GUI=False)[source]#
Convert a linear mesh into a quadratic one. The extra nodes added for the quadratic elements are stored after the original ones in the mesh nodes storage. The following line allows to retrive the original nodes in the quadratic mesh quadMesh.nodes[0:inputmesh.GetNumberOfNodes(),:] The order of elements is left unchanged. For more information see https://www.code-aster.org/V2/doc/default/fr/man_u/u4/u4.23.02.pdf
- OpenPisco.ExternalTools.Aster.AsterInterface.GetScalarFromFile(fileName: str, scalarName: str) List[source]#
Get scalar value from file, typically a post processing value computed by Code_Aster
- Parameters
fileName (str) – input file, assumption it is in the .csv format
scalarName (str) – scalar name to be retrieved
file (Here is an example of such a) –
raised. (an assertion error is) –
file –
# –
#-------------------------------------------------------------------------------- –
15 (##ASTER 17.02.22 CONCEPT 00000036 CALCULE LE 27/10/2025 A) –
NUME_ORDRE – 1, 0.00000E+00, 1.51764E-05, 0.00000E+00
INST – 1, 0.00000E+00, 1.51764E-05, 0.00000E+00
TRAV_ELAS – 1, 0.00000E+00, 1.51764E-05, 0.00000E+00
TRAV_REEL – 1, 0.00000E+00, 1.51764E-05, 0.00000E+00
- Returns
scalar value corresponding to scalar name
- Return type
List
- OpenPisco.ExternalTools.Aster.AsterInterface.PrepareLinToQuadStudy() Tuple[AsterInterface, str][source]#
Convert a study based on a linear interpolation (P1) to a quadratic interpolation (P2) for shape functions.
- Returns
interface and study path
- Return type
Tuple[AsterInterface,str]