API: Engines
matmdl.engines
Choose the computational engine for running, checking, and extracting finite element job information. Currently only Abaqus exists.
abaqus
This module contains helper functions for dealing with Abaqus but has no Abaqus-specific imports.
extract(outname)
Call :py:mod:matmdl.engines.abaqus_extract from new shell to extract force-displacement data.
Source code in matmdl/engines/abaqus.py
has_completed()
Return True if Abaqus has finished sucessfully.
Source code in matmdl/engines/abaqus.py
load_subroutine()
Compile the user subroutine uset.umat as a shared library in the directory.
Source code in matmdl/engines/abaqus.py
pre_run(next_params, orient, in_opt)
prepare()
run()
Run the Abaqus job!
write_strain(strain, jobname)
Modify boundary conditions in main Abaqus input file to match max strain.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
strain
|
float
|
signed float used to specify axial displacement |
required |
jobname
|
str
|
Filename for main Abaqus job -- unique to orientation if applicable. |
required |
Note
Relies on finding RP-TOP under *Boundary keyword in main
input file.
Source code in matmdl/engines/abaqus.py
abaqus_extract
This runnable module requires Abaqus libraries and must be run from Abaqus python. It extracts force-displacement data from pre-defined reference points for use in comparison of model input parameters to reference data.
GetForceDisplacement
Bases: object
Open ODB file and store force-displacement data from a reference point.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ResultFile
|
str
|
name of odb file without the '.odb' |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
Time |
simulation time (0->1) |
|
TopU2 |
displacement of reference point |
|
TopRF2 |
reaction force of reference point |
Note
Depends on the Abaqus names of loading step, part instance, and reference point. Requires Abaqus-specific libraries, must be called from Abaqus python.
Source code in matmdl/engines/abaqus_extract.py
write2file()
Using GetForceDisplacement object, read odb file and write time-displacement-force to csv file.
Source code in matmdl/engines/abaqus_extract.py
fepx
Functions for dealing with FEPX.
extract(outname)
Get time, displacement, force data from simdir.
Note
This does extra work to match the Abaqus format... worth a change?
Source code in matmdl/engines/fepx.py
has_completed()
Return True if Abaqus has finished sucessfully.
Source code in matmdl/engines/fepx.py
pre_run(next_params, orient, in_opt)
prepare()
run()
Starts FEPX, assuming fepx and mpirun are on system's path.
Otherwise, give path to fepx as executable_path in input file.
Source code in matmdl/engines/fepx.py
write_strain(strain, jobname=None, debug=False)
Modify boundary conditions in main Abaqus input file to match max strain.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
strain
|
float
|
signed float used to specify axial displacement |
required |
jobname
|
str
|
ignored, only included to match call signature in abaqus |
None
|
Note
Relies on finding target_strain in simulation.cfg