Skip to content

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 "{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    model = mm::{model_class}<double>(mm::ContactLawType::{contact}, mm::Material<double>::{props_meth}(props), {npv}, {radius});\n    {post_setup}\n    model.umat(dstran, stress, statev, ddsdde, *jstep == 1 && *kinc == 1);\n}}\n'

ABAQUS_VUMAT_SUBROUTINE_TEMPLATE module-attribute

ABAQUS_VUMAT_SUBROUTINE_TEMPLATE = '#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    model = mm::{model_class}<double>(mm::ContactLawType::{contact}, mm::Material<double>::{props_meth}(props), {npv}, {radius});\n    {post_setup}\n    model.vumat(*nBlock, strainInc, stressOld, stressNew, stateOld, stateNew, *totalTime - *stepTime < 1e-6);\n}}\n'

abaqus module-attribute

abaqus: AbaqusCLI = AbaqusCLI()

AbaqusCLI

Bases: AbqpyCLI

Abaqus command line interface.

subroutine instance-attribute

__init__

__init__()

Initialize the Abaqus command line interface.

job classmethod

job(
    *,
    output: str | PathLike,
    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: str

includes

Paths to directories containing include files which will be added in the INCLUDE environment variable. Multiple directories should be separated by os.pathsep (; on Windows and : on Linux), relative paths will be resolved relative to the current working directory. For example, includes=".;eigen" will add the current working directory and the eigen directory to the INCLUDE environment variable.

TYPE: str DEFAULT: None

script

Path to the Abaqus/Python script to run before the simulation.

TYPE: str DEFAULT: None

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 script.

TYPE: str DEFAULT: None

user

Path to the Abaqus user subroutine to compile and run.

TYPE: str DEFAULT: None

post

Path to the Abaqus/Python script to run after the simulation.

TYPE: str DEFAULT: None

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: str DEFAULT: None

overwrite

Whether to overwrite the files in the output directory.

TYPE: bool DEFAULT: False

compile

Whether to compile the user subroutine before running the simulation.

TYPE: bool DEFAULT: False

clear

Whether to remove temporary files after the simulation.

TYPE: bool DEFAULT: False

job

Name of the job.

TYPE: str DEFAULT: None

submit

Whether to submit the job to Abaqus.

TYPE: bool DEFAULT: True

analysis

See the Abaqus documentation for details.

TYPE: str DEFAULT: None

datacheck

See the Abaqus documentation for details.

TYPE: str DEFAULT: None

parametercheck

See the Abaqus documentation for details.

TYPE: str DEFAULT: None

continue1

See the Abaqus documentation for details.

TYPE: str DEFAULT: None

convert

See the Abaqus documentation for details.

TYPE: str DEFAULT: None

recover

See the Abaqus documentation for details.

TYPE: str DEFAULT: None

syntaxcheck

See the Abaqus documentation for details.

TYPE: str DEFAULT: None

information

See the Abaqus documentation for details.

TYPE: str DEFAULT: None

uniquelibs

See the Abaqus documentation for details.

TYPE: str or int DEFAULT: None

oldjob

See the Abaqus documentation for details.

TYPE: str or int DEFAULT: None

fil

See the Abaqus documentation for details.

TYPE: str or int DEFAULT: None

globalmodel

See the Abaqus documentation for details.

TYPE: str or int DEFAULT: None

cpus

See the Abaqus documentation for details.

TYPE: str or int DEFAULT: None

parallel

See the Abaqus documentation for details.

TYPE: str or int DEFAULT: None

domains

See the Abaqus documentation for details.

TYPE: str or int DEFAULT: None

dynamic_load_balancing

See the Abaqus documentation for details.

TYPE: str or int DEFAULT: None

mp_mode

See the Abaqus documentation for details.

TYPE: str or int DEFAULT: None

threads_per_mpi_process

See the Abaqus documentation for details.

TYPE: str or int DEFAULT: None

standard_parallel

See the Abaqus documentation for details.

TYPE: str or int DEFAULT: None

gpus

See the Abaqus documentation for details.

TYPE: str or int DEFAULT: None

memory

See the Abaqus documentation for details.

TYPE: str or int DEFAULT: None

interactive

See the Abaqus documentation for details.

TYPE: str or int DEFAULT: None

double

See the Abaqus documentation for details.

TYPE: str or int DEFAULT: None

scratch

See the Abaqus documentation for details.

TYPE: str or int DEFAULT: None

output_precision

See the Abaqus documentation for details.

TYPE: str or int DEFAULT: None

resultsformat

See the Abaqus documentation for details.

TYPE: str or int DEFAULT: None

port

See the Abaqus documentation for details.

TYPE: str or int DEFAULT: None

host

See the Abaqus documentation for details.

TYPE: str or int DEFAULT: None

csedirector

See the Abaqus documentation for details.

TYPE: str or int DEFAULT: None

timeout

See the Abaqus documentation for details.

TYPE: str or int DEFAULT: None

unconnected_regions

See the Abaqus documentation for details.

TYPE: str or int DEFAULT: None

noFlexBody

See the Abaqus documentation for details.

TYPE: str or int DEFAULT: None

license_type

See the Abaqus documentation for details.

TYPE: str or int DEFAULT: None

ssd_split

See the Abaqus documentation for details.

TYPE: str or int DEFAULT: None

ssd_partition

See the Abaqus documentation for details.

TYPE: str or int DEFAULT: None

fmt_specs

Specifications for formatting the files specified by script, inp, user, post, and vis with Jinja2.

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: str

output

Path to the output directory where the compiled user subroutine will be saved, defaults to the current working directory.

TYPE: str DEFAULT: None

includes

Paths to directories containing include files which will be added in the INCLUDE environment variable. Multiple directories should be separated by os.pathsep (; on Windows and : on Linux), relative paths will be resolved relative to the current working directory. For example, includes=".;eigen" will add the current working directory and the eigen directory to the INCLUDE environment variable.

TYPE: str DEFAULT: None

overwrite

Whether to overwrite the files in the output directory.

TYPE: bool DEFAULT: False

fmt_specs

Specifications for formatting the file specified by user with Jinja2.

DEFAULT: {}

generate classmethod

generate(
    model: AvailableMicromechanicalModels,
    contact: AvailableContactModels,
    *,
    output: str | PathLike,
    type: Literal["umat", "vumat"] = "umat",
    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: str

contact

Contact model to use.

TYPE: str

type

Subroutine type, "umat" or "vumat".

TYPE: str DEFAULT: 'umat'

output

Path to the output file.

TYPE: str

npv

Number of particles per unit volume.

TYPE: float DEFAULT: 1000000000.0

radius

Radius of the particles.

TYPE: float DEFAULT: 0.00065

fabric_type

Fabric tensor type.

TYPE: str DEFAULT: None

fabric_evolution

Fabric tensor evolution type.

TYPE: str DEFAULT: None

kwargs

Calculation option, or (if not) fabric tensor coefficients or

DEFAULT: {}

_format_files

_format_files(*files: str | PathLike, overwrite: bool = True, **specs)

Format files with specifications.

PARAMETER DESCRIPTION
files

Paths to files to format.

TYPE: str or Path DEFAULT: ()

overwrite

Whether to overwrite the files.

TYPE: bool DEFAULT: True

specs

Specifications for formatting the files with Jinja2.

DEFAULT: {}