experiment
Experiment
Bases: HashableBaseModelIO
An experiment.
caches
class-attribute
caches: Dict[str, LRUCache] = {
"getitem": cachetools.LRUCache(maxsize=128),
"__getitem__": cachetools.LRUCache(maxsize=128),
}
caches for the getitem and getitem methods
lines
class-attribute
instance-attribute
lines: Dict[str, Line] = {}
list of lines in the experiment
notes
class-attribute
instance-attribute
custom notes for the experiment, only for labelling purposes and not used in the calculation
options
class-attribute
instance-attribute
options for the micromechanical-specific model, used in :meth:micromechanical.Model.setCalculationOptions to
set the calculation options for the model
phases
class-attribute
instance-attribute
phases: Dict[str, LoadPhaseIO] = {}
load phases of the experiment
__contains__
Return whether a line exists.
| PARAMETER | DESCRIPTION |
|---|---|
item
|
Names of the x-axis and y-axis of the line.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if the line exists, False otherwise. |
__getitem__
Return the x-axis and y-axis data of a line.
| PARAMETER | DESCRIPTION |
|---|---|
item
|
Names of the x-axis and y-axis of the line.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Tuple[ndarray, ndarray]
|
The x-axis and y-axis data of the line. |
addConfinementPhase
addConfinementPhase(eps1: float, steps: int) -> LoadPhaseIO
Add a confinement load phase.
| PARAMETER | DESCRIPTION |
|---|---|
steps
|
Number of steps.
TYPE:
|
eps1
|
Maximum strain.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
LoadPhaseIO
|
The load phase. |
addConstantStressRatioPhase
addConstantStressRatioPhase(
sig3_min: float, sig3_max: float, eta: float, steps: int, axis: int = 1
) -> LoadPhaseIO
Add a constant stress ratio load phase.
| PARAMETER | DESCRIPTION |
|---|---|
steps
|
Number of steps.
TYPE:
|
sig3_min
|
Minimum value of minimum principal stress.
TYPE:
|
sig3_max
|
Maximum value of minimum principal stress.
TYPE:
|
eta
|
Constant stress ratio.
TYPE:
|
axis
|
Loading axis, by default 1
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
LoadPhase
|
The load phase. |
addDrainedTriaxialPhase
addDrainedTriaxialPhase(
sigc: float, eps1: float, steps: int, axis: int = 1
) -> LoadPhaseIO
Add a drained triaxial load phase.
| PARAMETER | DESCRIPTION |
|---|---|
steps
|
Number of steps.
TYPE:
|
sigc
|
Confined stress.
TYPE:
|
eps1
|
Maximum strain.
TYPE:
|
axis
|
Loading axis, by default 1
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
LoadPhaseIO
|
The load phase. |
addIsotropicPhase
addIsotropicPhase(sigc: float, steps: int) -> LoadPhaseIO
Add an isotropic load phase.
| PARAMETER | DESCRIPTION |
|---|---|
steps
|
Number of steps.
TYPE:
|
sigc
|
Confined stress.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
LoadPhaseIO
|
The load phase. |
addLoadPhase
addLoadPhase(name: str, phase: LoadPhaseIO | LoadPhase) -> LoadPhaseIO
Add a load phase.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
Name of the load phase.
TYPE:
|
phase
|
The load phase, if not an instance of
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
LoadPhaseIO
|
The load phase. |
addTrueTriaxialPhase
addTrueTriaxialPhase(
sig3: float,
b: float,
eps1: float,
steps: int,
axis1: int = 1,
axis2: int = 2,
) -> LoadPhaseIO
Add a true triaxial load phase.
| PARAMETER | DESCRIPTION |
|---|---|
sig3
|
Minimum principal stress.
TYPE:
|
b
|
Intermediate stress ratio.
TYPE:
|
eps1
|
Maximum strain.
TYPE:
|
steps
|
Number of steps.
TYPE:
|
axis1
|
Major axis, by default 1
TYPE:
|
axis2
|
Intermediate axis, by default 2
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
LoadPhase
|
The load phase. |
addTrueTriaxialWithConstantShearPhase
addTrueTriaxialWithConstantShearPhase(
p: float, b: float, steps: int, axis1: int = 1, axis2: int = 2
) -> LoadPhaseIO
Add a true triaxial load phase.
| PARAMETER | DESCRIPTION |
|---|---|
p
|
Mean stress.
TYPE:
|
b
|
Lode parameter.
TYPE:
|
steps
|
Number of steps.
TYPE:
|
axis1
|
Major axis, by default 1
TYPE:
|
axis2
|
Intermediate axis, by default 2
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
LoadPhase
|
The load phase. |
addUndrainedTriaxialPhase
addUndrainedTriaxialPhase(
eps1: float, steps: int, axis: int = 1, no_epsv: bool = False
) -> LoadPhaseIO
Add an undrained triaxial load phase.
| PARAMETER | DESCRIPTION |
|---|---|
steps
|
Number of steps.
TYPE:
|
eps1
|
Maximum strain.
TYPE:
|
axis
|
Loading axis, by default 1
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
LoadPhaseIO
|
The load phase. |
addUndrainedTriaxialWithoutShearPhase
addUndrainedTriaxialWithoutShearPhase(
eps1: float, steps: int, axis: int = 1, no_epsv: bool = False
) -> LoadPhaseIO
Add an undrained triaxial load phase without controlling the shear strain.
| PARAMETER | DESCRIPTION |
|---|---|
steps
|
Number of steps.
TYPE:
|
eps1
|
Maximum strain.
TYPE:
|
axis
|
Loading axis, by default 1
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
LoadPhaseIO
|
The load phase. |
addUndrainedTrueTriaxialPhase
addUndrainedTrueTriaxialPhase(
eps1: float,
b: float,
steps: int,
axis1: int = 1,
axis2: int = 2,
no_epsv: bool = True,
) -> LoadPhaseIO
Add an undrained true triaxial load phase.
| PARAMETER | DESCRIPTION |
|---|---|
steps
|
Number of steps.
TYPE:
|
eps1
|
Maximum strain.
TYPE:
|
b
|
Intermediate stress ratio.
TYPE:
|
axis1
|
Major axis, by default 1
TYPE:
|
axis2
|
Intermediate axis, by default 2
TYPE:
|
no_epsv
|
Whether to control the intermediate principal stress without generating volumetric strain, this is useful when the material fabric is non-coaxial with the principal stress, by default True
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
LoadPhaseIO
|
The load phase. |
addUndrainedTrueTriaxialWithAxialStrainPhase
addUndrainedTrueTriaxialWithAxialStrainPhase(
epsa: float,
b: float,
steps: int,
axis1: int = 1,
axis2: int = 2,
no_epsv: bool = True,
) -> LoadPhaseIO
Add an undrained true triaxial load phase with axial strain control.
| PARAMETER | DESCRIPTION |
|---|---|
steps
|
Number of steps.
TYPE:
|
epsa
|
Axial strain.
TYPE:
|
b
|
Intermediate stress ratio.
TYPE:
|
axis1
|
Major axis, by default 1
TYPE:
|
axis2
|
Intermediate axis, by default 2
TYPE:
|
no_epsv
|
Whether to control the intermediate principal stress without generating volumetric strain, this is useful when the material fabric is non-coaxial with the principal stress, by default True
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
LoadPhaseIO
|
The load phase. |
check
Check whether the experiment is valid.
| PARAMETER | DESCRIPTION |
|---|---|
raise_
|
Whether to raise an error if the experiment is invalid, by default True
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool | None
|
True if the experiment is valid, False if the experiment is invalid, None if the experiment is not checked. |
get
get(
x: str,
y: str | None = None,
*,
deep: bool = False,
idx: int | Iterable[int] | slice = None
) -> Tuple[ndarray, ndarray] | ndarray
Return the x-axis and y-axis data of a line.
| PARAMETER | DESCRIPTION |
|---|---|
x
|
Name of the x-axis of the line.
TYPE:
|
y
|
Name of the y-axis of the line. If None, only the x-axis data will be returned.
TYPE:
|
deep
|
Search for the line deeply in the experiment, by default False to avoid RecursionError.
TYPE:
|
idx
|
Index of the data to be returned, by default None to return all data.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Tuple[ndarray, ndarray] | ndarray
|
The x-axis and y-axis data of the line, or only the x-axis data if y is None. |
getitem
Return the x-axis and y-axis data of a line, only for exactly matching lines or expressions that can be evaluated to the x-axis and y-axis names.
| PARAMETER | DESCRIPTION |
|---|---|
item
|
Names of the x-axis and y-axis of the line.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Tuple[ndarray, ndarray]
|
The x-axis and y-axis data of the line. |
Line
Bases: HashableBaseModelIO
A line for an experiment.
x
instance-attribute
x-axis name of the line, used in :meth:micromechanical.python.micromechanical.core.StateVariables.get to get
the x-axis data
y
instance-attribute
y-axis name of the line, used in :meth:micromechanical.python.micromechanical.core.StateVariables.get to get
the y-axis data
LoadPhaseIO
Bases: HashableBaseModelIO
A load phase for an experiment.
control
instance-attribute
Control type of the load increment, 0 for stress control, 1 for strain control
total
instance-attribute
Control whether the load is incremental or total, 0 for incremental, 1 for total
true_triaxial_control_type
class-attribute
instance-attribute
Control type for true triaxial loading, "none" for no control, "sig1", "sig2", or sig3" for controlling the principal stresses, "no_epsv" for controlling the intermediate principal stress without generating volumetric strain
true_triaxial_intermediate_axis
class-attribute
instance-attribute
Intermediate axis for true triaxial loading, 1 for axis 1, 2 for axis 2, 3 for axis 3