Skip to content

cycle_jump

gripyth.solving.cycle_jump

Helper functions for the implementation of cycle jumps.

CLASS DESCRIPTION
History

History variables used for the system state prediction.

Method

Available cycle-jump methods.

Parameters

Parameters for cycle jumps.

Restore

Stores state prior to cycle jump in case trial-cycle not accepted.

Variables

Variables for cycle jumps.

FUNCTION DESCRIPTION
backward_finite_difference

Approximates the p-th derivative of a function f.

extrapolate

Extrapolate system state variables based on backward finite differences.

History dataclass

History variables used for the system state prediction.

Method

Bases: Enum

Available cycle-jump methods.

Parameters dataclass

Parameters for cycle jumps.

ATTRIBUTE DESCRIPTION
active

whether to jump cycles or not

TYPE: bool

fixed_cycle_jump

cycles to jump if "fixed" method is used

TYPE: int

max_Dn

maximum allowable cycles to jump if "relative" method is used

TYPE: int

max_rel_error

maximum allowable relative error if "relative" method is used

TYPE: float

method

approach to determine the number of cycles to jump

TYPE: Method

n_stencil

number of cycles computed in between the individual cycle jumps,

TYPE: int

prediction_error_estimation

whether to estimate prediction error for postprocessing purposes

TYPE: bool

stage2_scale

Scales allowed increment in stage II if "adaptive" method is used.

TYPE: float

stage3_scale

Scales allowed increment in stage III if "adaptive" method is used.

TYPE: float

active class-attribute instance-attribute

active: bool = False

whether to jump cycles or not

fixed_cycle_jump class-attribute instance-attribute

fixed_cycle_jump: int = 10

cycles to jump if "fixed" method is used

max_Dn class-attribute instance-attribute

max_Dn: int = 1000

maximum allowable cycles to jump if "relative" method is used

max_rel_error class-attribute instance-attribute

max_rel_error: float = 1e-06

maximum allowable relative error if "relative" method is used

method class-attribute instance-attribute

method: Method = adaptive

approach to determine the number of cycles to jump

n_stencil class-attribute instance-attribute

n_stencil: int = 4

number of cycles computed in between the individual cycle jumps, used for the extrapolation of the fatigue history variable

prediction_error_estimation class-attribute instance-attribute

prediction_error_estimation: bool = False

whether to estimate prediction error for postprocessing purposes

stage2_scale class-attribute instance-attribute

stage2_scale: float = 1.0

Scales allowed increment in stage II if "adaptive" method is used.

stage3_scale class-attribute instance-attribute

stage3_scale: float = 1.0

Scales allowed increment in stage III if "adaptive" method is used.

Restore dataclass

Stores state prior to cycle jump in case trial-cycle not accepted.

Variables dataclass

Variables for cycle jumps.

METHOD DESCRIPTION
__init__

Creates cycle-jump variables.

ATTRIBUTE DESCRIPTION
error_predictions

array to monitor the system state prediction error estimate (if requested)

TYPE: NDArray[float64] | None

history

history variables used for the system state prediction

TYPE: History | None

jumps

array to monitor the cycle jumps

TYPE: NDArray[float64]

n_resolved

number of explicitly computed cycles in total

TYPE: int

restore

Stores state prior to cycle jump in case trial-cycle cannot be accepted.

TYPE: Restore | None

error_predictions class-attribute instance-attribute

error_predictions: NDArray[float64] | None = None

array to monitor the system state prediction error estimate (if requested)

history class-attribute instance-attribute

history: History | None = None

history variables used for the system state prediction

jumps instance-attribute

jumps: NDArray[float64] = zeros((3, 3))

array to monitor the cycle jumps

n_resolved class-attribute instance-attribute

n_resolved: int = 0

number of explicitly computed cycles in total

restore class-attribute instance-attribute

restore: Restore | None = None

Stores state prior to cycle jump in case trial-cycle cannot be accepted.

__init__

__init__(
    parameters: Parameters,
    mesh: Mesh,
    quadrature: Quadrature,
)

Creates cycle-jump variables.

backward_finite_difference

backward_finite_difference(
    f_i: list[NDArray[float64]], p: int
) -> NDArray[float64]

Approximates the p-th derivative of a function f.

The derivative is computed with respect to x based on n equidistant points f_i, given as a list of arrays such as [f(x-2), f(x-1), f(x)]. Accepts scalars, vectors, or matrices for the points.

Returns the derivative dpf_dxp, i.e. \(\frac{d^p f}{d x^p}\).

extrapolate

extrapolate(
    fatigue: NDArray[float64], n_stencil: int, Dn: int
)

Extrapolate system state variables based on backward finite differences.

Dn is the number of cycles to jump.

Returns Theta_extrap.