Index
The micromechanical model command line interface, run with python -m micromechanical
or micromechanical
.
__all__
module-attribute
__all__ = [
"AbaqusCLI",
"abaqus",
"CalibrationCLI",
"calibration",
"CleanCLI",
"clean",
"MicromechanicalCLI",
"micromechanical",
"PlotCLI",
"plot",
"PluginCLI",
"plugin",
"SchemaCLI",
"schema",
]
AbaqusCLI
Bases: AbqpyCLI
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:
|
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. |
oldjob
|
See the Abaqus documentation for details. |
fil
|
See the Abaqus documentation for details. |
globalmodel
|
See the Abaqus documentation for details. |
cpus
|
See the Abaqus documentation for details. |
parallel
|
See the Abaqus documentation for details. |
domains
|
See the Abaqus documentation for details. |
dynamic_load_balancing
|
See the Abaqus documentation for details. |
mp_mode
|
See the Abaqus documentation for details. |
threads_per_mpi_process
|
See the Abaqus documentation for details. |
standard_parallel
|
See the Abaqus documentation for details. |
gpus
|
See the Abaqus documentation for details. |
memory
|
See the Abaqus documentation for details. |
interactive
|
See the Abaqus documentation for details. |
double
|
See the Abaqus documentation for details. |
scratch
|
See the Abaqus documentation for details. |
output_precision
|
See the Abaqus documentation for details. |
resultsformat
|
See the Abaqus documentation for details. |
port
|
See the Abaqus documentation for details. |
host
|
See the Abaqus documentation for details. |
csedirector
|
See the Abaqus documentation for details. |
timeout
|
See the Abaqus documentation for details. |
unconnected_regions
|
See the Abaqus documentation for details. |
noFlexBody
|
See the Abaqus documentation for details. |
license_type
|
See the Abaqus documentation for details. |
ssd_split
|
See the Abaqus documentation for details. |
ssd_partition
|
See the Abaqus documentation for details. |
fmt_specs
|
Specifications for formatting the files specified by
DEFAULT:
|
CalibrationCLI
Bases: _CLIBase
Micromechanical model calibration command line interface.
loadConfig
classmethod
loadConfig(
config: str | PathLike | None = None,
base_config: str | PathLike | None = None,
key: str = "",
) -> CalibrationConfig
run
run(
config: str | PathLike | None = None,
base_config: str | PathLike | None = None,
key: str = "",
*,
overwrite: bool | None = None,
skip: bool | None = None,
overwrite_figures: bool | None = None,
include_calibrations: List[str] | str | None = None,
exclude_calibrations: List[str] | str | None = None,
include_models: List[str] | str | None = None,
exclude_models: List[str] | str | None = None,
continue_last_unfinished_run: bool = False,
continue_last_unfinished_run_outcmaes: str | None = None,
continue_last_run: bool = False,
logfile: str | None = None,
maxiter: int | None = None,
maxfun: int | None = None,
return_initial_fitness: bool = False,
**kwargs
) -> Dict[str, float] | None
Calibrate the micromechanical model.
PARAMETER | DESCRIPTION |
---|---|
config
|
Configuration file, by default None. If None, search for the default configuration files. |
base_config
|
Base configuration file to merge with the main configuration file, by default None |
key
|
Key of the table in the configuration file, by default ""
TYPE:
|
overwrite
|
Overwrite existing calibration, by default False
TYPE:
|
skip
|
Skip calibration, by default False
TYPE:
|
overwrite_figures
|
Overwrite existing figures, by default False
TYPE:
|
include_calibrations
|
Include calibrations, by default None (all). Can be glob patterns. |
exclude_calibrations
|
Exclude calibrations, by default None. Can be glob patterns. |
include_models
|
Include models, by default None (all). Can be glob patterns. |
exclude_models
|
Exclude models, by default None. Can be glob patterns. |
continue_last_unfinished_run
|
Continue the last unfinished calibration, by default False
TYPE:
|
continue_last_unfinished_run_outcmaes
|
Override the path to the outcmaes folder to continue the last unfinished calibration, by default None
TYPE:
|
continue_last_run
|
Continue the last calibration, by default False
TYPE:
|
logfile
|
Print the output to a log file, by default None
TYPE:
|
maxiter
|
Overriding the maximum number of iterations, by default None
TYPE:
|
maxfun
|
Overriding the maximum number of function evaluations, by default None
TYPE:
|
return_initial_fitness
|
Return initial fitness for debugging, by default False
TYPE:
|
kwargs
|
Additional keyword arguments to pass to the calibrate method.
TYPE:
|
CleanCLI
Clean up things.
cache
classmethod
MicromechanicalCLI
Micromechanical model command line interface.
calibration
instance-attribute
calibration: CalibrationCLI = CalibrationCLI()
Perform micromechanical calibrations
schema
instance-attribute
Generate JSON schema files for configuration files
__call__
PlotCLI
Bases: _CLIBase
Micromechanical plot command line interface.
loadConfig
classmethod
loadConfig(
config: str | PathLike | None = None,
base_config: str | PathLike | None = None,
key: str = "",
) -> PlotConfig
run
run(
config: str | PathLike | None = None,
base_config: str | PathLike | None = None,
key: str = "",
*,
overwrite: bool | None = None,
include_plots: List[str] | str | None = None,
exclude_plots: List[str] | str | None = None,
include_models: List[str] | str | None = None,
exclude_models: List[str] | str | None = None
)
Plotting command line interface.
PARAMETER | DESCRIPTION |
---|---|
config
|
Configuration file, by default None. If None, search for the default configuration files. |
base_config
|
Base configuration file to merge with the main configuration file, by default None |
key
|
Key of the table in the configuration file, by default ""
TYPE:
|
overwrite
|
Overwrite existing figures, by default False
TYPE:
|
include_plots
|
Include plots, by default None (all). Can be glob patterns. |
exclude_plots
|
Exclude plots, by default None. Can be glob patterns. |
include_models
|
Include models, by default None (all). Can be glob patterns. |
exclude_models
|
Exclude models, by default None. Can be glob patterns. |
PluginCLI
Micromechanical model plugin command line interface.
make
classmethod
make(
*plugins: str,
project: str = "micromechanical-plugin",
working_directory: str = "micromechanical-plugin",
includes: str | None = None,
build: str = "build",
build_type: str = "Release",
cmake_minimum_required: str = "3.16",
cxx_standard: str | int = 11,
output_directory: str = "",
cmake: str = "cmake",
cmake_generate_args: str = "",
cmake_build_args: str = ""
)
Build a micromechanical model plugin.
PARAMETER | DESCRIPTION |
---|---|
plugins
|
The plugin source file.
TYPE:
|
project
|
The project name
TYPE:
|
working_directory
|
The working directory
TYPE:
|
includes
|
The include directories separated by
TYPE:
|
build
|
The build directory relative to the working directory
TYPE:
|
build_type
|
The build type
TYPE:
|
cmake_minimum_required
|
The minimum required CMake version
TYPE:
|
cxx_standard
|
The C++ standard |
output_directory
|
The output directory relative to the working directory
TYPE:
|
cmake
|
The CMake executable
TYPE:
|
cmake_generate_args
|
Additional arguments for the CMake generate step
TYPE:
|
cmake_build_args
|
Additional arguments for the CMake build step
TYPE:
|
SchemaCLI
Micromechanical model JSON Schema command line interface.
generate
classmethod
generate(
type: Literal["config", "labels", "calibrations", "plots"],
output: str | PathLike,
**kwargs
)
Generate the JSON Schema of the micromechanical configuration.
PARAMETER | DESCRIPTION |
---|---|
type
|
Type of JSON schema to generate.
TYPE:
|
output
|
Path to the output file. |
kwargs
|
Additional keyword arguments passed to the pydantic
DEFAULT:
|