abaqus
The micromechanical model command line interface, run with python -m micromechanical or micromechanical.
ABAQUS_UMAT_SUBROUTINE_TEMPLATE
module-attribute
ABAQUS_UMAT_SUBROUTINE_TEMPLATE = '#include <iostream>\n\n#include "{include_file}"\n\n// Please add the following include directories for your C/C++ compiler:\n//\n// {includes}\n\nnamespace mm = micromechanical;\n\nextern "C" void umat(double* stress, double* statev, double* ddsdde, double* sse, double* spd, double* scd, double* rpl,\n double* ddsddt, double* drplde, double* drpldt, double* stran, double* dstran, double* time,\n double* dtime, double* temp, double* dtemp, double* predef, double* dpred, char* cmname, int* ndi,\n int* nshr, int* ntens, int* nstatv, double* props, int* nprops, double* coords, double* drot,\n double* pnewdt, double* celent, double* dfgrd0, double* dfgrd1, int* noel, int* npt, int* layer,\n int* kspt, int* jstep, int* kinc) {{\n auto model = mm::{model_class}<double>(mm::ContactLawType::{contact}, mm::Material<double>::{props_meth}(props), {npv}, {radius});\n {post_setup}\n try {{\n model.abaqus_initialize = *jstep <= 1 && *kinc <= 1;\n model.umat(dstran, stress, statev, ddsdde, sse, spd, scd);\n }} catch (const std::exception& e) {{\n std::cout << "Total Time " << time[1] << ", Step Time " << time[0] << ", ";\n std::cout << "Step " << *jstep << ", Increment " << *kinc << ", ";\n std::cout << "Element " << *noel << ", Integration " << *npt << ", ";\n std::cout << typeid(e).name() << ": " << e.what() << std::endl;\n std::cout << "State variables: ";\n for (int i = 0; i < *nstatv; ++i) {\n std::cout << statev[i] << ", ";\n }\n std::cout << std::endl;\n std::cout << "Strain increment: " << dstran[0] << ", " << dstran[1] << ", " << dstran[2] << ", " << dstran[3]\n << ", " << dstran[4] << ", " << dstran[5] << std::endl;\n throw e;\n }}\n}}\n'
ABAQUS_VUMAT_SUBROUTINE_TEMPLATE
module-attribute
ABAQUS_VUMAT_SUBROUTINE_TEMPLATE = '#include <iostream>\n\n#include "{include_file}"\n\n// Please add the following include directories for your C/C++ compiler:\n//\n// {includes}\n\nnamespace mm = micromechanical;\n\nextern "C" void vumat(int* nBlock, int* nDir, int* nShr, int* nStatev, int* nFieldV, int* nProps, int* jInfoArray,\n double* stepTime, double* totalTime, double* dtArray, char* cmName, double* coordMp,\n double* charLength, double* props, double* density, double* strainInc, double* relSpinInc,\n double* tempOld, double* stretchOld, double* defGradOld, double* fieldOld, double* stressOld,\n double* stateOld, double* enerInternOld, double* enerInelasOld, double* tempNew,\n double* stretchNew, double* defGradNew, double* fieldNew, double* stressNew, double* stateNew,\n double* enerInternNew, double* enerInelasNew) {{\n auto model = mm::{model_class}<double>(mm::ContactLawType::{contact}, mm::Material<double>::{props_meth}(props), {npv}, {radius});\n {post_setup}\n try {{\n model.abaqus_initialize = *totalTime - *stepTime < 1e-6;\n model.vumat(*nBlock, strainInc, stressOld, stressNew, stateOld, stateNew, *nStatev);\n }} catch (const std::exception& e) {{\n std::cout << typeid(e).name() << ": " << e.what() << std::endl;\n }}\n}}\n'
AbaqusCLI
Bases: AbqpyCLI
Abaqus command line interface.
job
classmethod
job(
*,
output: str | PathLike,
skipcompleted: bool = False,
includes: str | None = None,
script: str | PathLike | None = None,
input: str | PathLike | None = None,
user: str | PathLike | None = None,
post: str | PathLike | None = None,
vis: str | PathLike | None = None,
overwrite: bool = False,
compile: bool = False,
clear: bool = False,
job: str | None = None,
submit: bool = True,
analysis: Literal["select", "odb", "state", "all"] | None = None,
datacheck: Literal["select", "odb", "state", "all"] | None = None,
parametercheck: Literal["select", "odb", "state", "all"] | None = None,
continue1: Literal["select", "odb", "state", "all"] | None = None,
convert: Literal["select", "odb", "state", "all"] | None = None,
recover: (
Literal[
"environment",
"local",
"memory",
"release",
"support",
"system",
"all",
]
| None
) = None,
syntaxcheck: (
Literal[
"environment",
"local",
"memory",
"release",
"support",
"system",
"all",
]
| None
) = None,
information: (
Literal[
"environment",
"local",
"memory",
"release",
"support",
"system",
"all",
]
| None
) = None,
uniquelibs: str | None = None,
oldjob: str | None = None,
fil: Literal["append", "new"] | None = None,
globalmodel: str | None = None,
cpus: int | None = None,
parallel: Literal["domain", "loop"] | None = None,
domains: int | None = None,
dynamic_load_balancing: Literal["on", "off"] | None = None,
mp_mode: Literal["mp", "threads"] | None = None,
threads_per_mpi_process: int | None = None,
standard_parallel: Literal["all", "solver"] | None = None,
gpus: int | None = None,
memory: str | None = None,
interactive: bool = True,
double: Literal["explicit", "both", "off", "constraint"] | None = None,
scratch: str | None = None,
output_precision: Literal["single", "full"] | None = None,
resultsformat: Literal["odb", "sim", "both"] | None = None,
port: int | None = None,
host: str | None = None,
csedirector: str | None = None,
timeout: int | None = None,
unconnected_regions: Literal["yes", "no"] | None = None,
noFlexBody: bool | None = None,
license_type: Literal["token", "credita"] | None = None,
ssd_split: int | None = None,
ssd_partition: int | None = None,
**fmt_specs
)
Run an Abaqus simulation.
| PARAMETER | DESCRIPTION |
|---|---|
output
|
Path to the output directory.
TYPE:
|
skipcompleted
|
Whether to skip completed jobs, a "completed job" is identified by the status file (*.sta)
TYPE:
|
includes
|
Paths to directories containing include files which will be added in the
TYPE:
|
script
|
Path to the Abaqus/Python script to run before the simulation.
TYPE:
|
input
|
Path to the Abaqus input file to run. If not specified, an input file will be searched for in the output
directory, typically generated by the Abaqus/Python script specified by
TYPE:
|
user
|
Path to the Abaqus user subroutine to compile and run.
TYPE:
|
post
|
Path to the Abaqus/Python script to run after the simulation.
TYPE:
|
vis
|
Path to the Python script to run after the simulation to visualize the results. Note that this script will be run with the local Python interpreter instead of the Abaqus/Python interpreter.
TYPE:
|
overwrite
|
Whether to overwrite the files in the output directory.
TYPE:
|
compile
|
Whether to compile the user subroutine before running the simulation.
TYPE:
|
clear
|
Whether to remove temporary files after the simulation.
TYPE:
|
job
|
Name of the job.
TYPE:
|
submit
|
Whether to submit the job to Abaqus.
TYPE:
|
analysis
|
See the Abaqus documentation for details.
TYPE:
|
datacheck
|
See the Abaqus documentation for details.
TYPE:
|
parametercheck
|
See the Abaqus documentation for details.
TYPE:
|
continue1
|
See the Abaqus documentation for details.
TYPE:
|
convert
|
See the Abaqus documentation for details.
TYPE:
|
recover
|
See the Abaqus documentation for details.
TYPE:
|
syntaxcheck
|
See the Abaqus documentation for details.
TYPE:
|
information
|
See the Abaqus documentation for details.
TYPE:
|
uniquelibs
|
See the Abaqus documentation for details.
TYPE:
|
oldjob
|
See the Abaqus documentation for details.
TYPE:
|
fil
|
See the Abaqus documentation for details.
TYPE:
|
globalmodel
|
See the Abaqus documentation for details.
TYPE:
|
cpus
|
See the Abaqus documentation for details.
TYPE:
|
parallel
|
See the Abaqus documentation for details.
TYPE:
|
domains
|
See the Abaqus documentation for details.
TYPE:
|
dynamic_load_balancing
|
See the Abaqus documentation for details.
TYPE:
|
mp_mode
|
See the Abaqus documentation for details.
TYPE:
|
threads_per_mpi_process
|
See the Abaqus documentation for details.
TYPE:
|
standard_parallel
|
See the Abaqus documentation for details.
TYPE:
|
gpus
|
See the Abaqus documentation for details.
TYPE:
|
memory
|
See the Abaqus documentation for details.
TYPE:
|
interactive
|
See the Abaqus documentation for details.
TYPE:
|
double
|
See the Abaqus documentation for details.
TYPE:
|
scratch
|
See the Abaqus documentation for details.
TYPE:
|
output_precision
|
See the Abaqus documentation for details.
TYPE:
|
resultsformat
|
See the Abaqus documentation for details.
TYPE:
|
port
|
See the Abaqus documentation for details.
TYPE:
|
host
|
See the Abaqus documentation for details.
TYPE:
|
csedirector
|
See the Abaqus documentation for details.
TYPE:
|
timeout
|
See the Abaqus documentation for details.
TYPE:
|
unconnected_regions
|
See the Abaqus documentation for details.
TYPE:
|
noFlexBody
|
See the Abaqus documentation for details.
TYPE:
|
license_type
|
See the Abaqus documentation for details.
TYPE:
|
ssd_split
|
See the Abaqus documentation for details.
TYPE:
|
ssd_partition
|
See the Abaqus documentation for details.
TYPE:
|
fmt_specs
|
Specifications for formatting the files specified by
DEFAULT:
|
AbaqusSubroutineCLI
Abaqus user subroutine command line interface.
compile
classmethod
compile(
user: str | PathLike,
*,
output: str | PathLike = None,
includes: str | None = None,
overwrite: bool = False,
**fmt_specs
)
Compile the Abaqus user subroutine.
| PARAMETER | DESCRIPTION |
|---|---|
user
|
Path to the Abaqus user subroutine to compile.
TYPE:
|
output
|
Path to the output directory where the compiled user subroutine will be saved, defaults to the current working directory.
TYPE:
|
includes
|
Paths to directories containing include files which will be added in the
TYPE:
|
overwrite
|
Whether to overwrite the files in the output directory.
TYPE:
|
fmt_specs
|
Specifications for formatting the file specified by
DEFAULT:
|
generate
classmethod
generate(
model: AvailableMicromechanicalModels | str,
contact: AvailableContactModels | str,
*,
output: str | PathLike,
type: Literal["umat", "vumat"] = "umat",
show_includes: bool = True,
npv: float = 1000000000.0,
radius: float = 0.00065,
fabric_type: AvailableFabricTypes | None = None,
fabric_evolution: AvailableFabricEvolutionTypes | None = None,
**kwargs
)
Generate Abaqus user subroutine, pass additional parameters for the fabric coefficients.
| PARAMETER | DESCRIPTION |
|---|---|
model
|
Micromechanical model to use.
TYPE:
|
contact
|
Contact model to use.
TYPE:
|
type
|
Subroutine type, "umat" or "vumat".
TYPE:
|
show_includes
|
Whether to show include directories for your C/C++ compiler
TYPE:
|
output
|
Path to the output file.
TYPE:
|
npv
|
Number of particles per unit volume.
TYPE:
|
radius
|
Radius of the particles.
TYPE:
|
fabric_type
|
Fabric tensor type.
TYPE:
|
fabric_evolution
|
Fabric tensor evolution type.
TYPE:
|
kwargs
|
Calculation option, or (if not) fabric tensor coefficients or
DEFAULT:
|