cratepy.online.crom.asca.RewindManager

class RewindManager(rewind_state_criterion, rewinding_criterion, max_n_rewinds=1)[source]

Bases: object

Manage analysis rewind operations and evaluate analysis rewind criteria.

_n_rewinds

Number of rewind operations.

Type:

int

_rewind_time

Total time spent in rewind operations and in deleted analysis increments.

Type:

float

_init_time

Reference time.

Type:

float

get_rewind_time(self)[source]

Get total time of rewind operations and deleted analysis increments.

update_rewind_time(self, mode='init')[source]

Update total rewind time.

is_rewind_available(self)[source]

Evaluate if rewind operations are available.

is_save_rewind_state(self, inc)[source]

Evaluate conditions to save rewind state.

is_rewinding_criteria(self, inc, material_phases, phase_clusters, clusters_state)[source]

Check analysis rewinding criteria.

get_save_rewind_state_criteria()[source]

Get available rewind state storage criteria and default parameters.

get_rewinding_criteria()[source]

Get rewinding criteria and default parameters.

Analysis rewind manager constructor.

Parameters:
  • rewind_state_criterion (tuple) – Rewind state storage criterion [0] and associated parameter [1].

  • rewinding_criterion (tuple) – Rewinding criterion [0] and associated parameter [1].

  • max_n_rewinds (int, default=1) – Maximum number of rewind operations.

List of Public Methods

get_rewind_time

Get total time of rewind operations and deleted analysis increments.

get_rewinding_criteria

Get rewinding criteria and default parameters.

get_save_rewind_state_criteria

Get available rewind state storage criteria and default parameters.

is_rewind_available

Evaluate if rewind operations are available.

is_rewinding_criteria

Check analysis rewinding criteria.

is_save_rewind_state

Evaluate conditions to save rewind state.

update_rewind_time

Update total rewind time.

Methods

__init__(rewind_state_criterion, rewinding_criterion, max_n_rewinds=1)[source]

Analysis rewind manager constructor.

Parameters:
  • rewind_state_criterion (tuple) – Rewind state storage criterion [0] and associated parameter [1].

  • rewinding_criterion (tuple) – Rewinding criterion [0] and associated parameter [1].

  • max_n_rewinds (int, default=1) – Maximum number of rewind operations.

get_rewind_time()[source]

Get total time of rewind operations and deleted analysis increments.

Returns:

rewind_time – Total time of rewind operations and in deleted analysis increments.

Return type:

float

static get_rewinding_criteria()[source]

Get rewinding criteria and default parameters.

Returns:

available_rewinding_criteria – Available rewinding criteria (key, str) and associated default parameters (item).

Return type:

dict

static get_save_rewind_state_criteria()[source]

Get available rewind state storage criteria and default parameters.

Returns:

available_save_rewind_state_criteria – Available rewind state storage criteria (key, str) and associated default parameters (item).

Return type:

dict

is_rewind_available()[source]

Evaluate if rewind operations are available.

Returns:

is_available – True if rewind operations are available, False otherwise.

Return type:

bool

is_rewinding_criteria(inc, material_phases, phase_clusters, clusters_state)[source]

Check analysis rewinding criteria.

Parameters:
  • inc (int) – Macroscale loading increment.

  • material_phases (list[str]) – CRVE material phases labels (str).

  • phase_clusters (dict) – Clusters labels (item, list[int]) associated with each material phase (key, str).

  • clusters_state (dict) – Material constitutive model state variables (item, dict) associated with each material cluster (key, str).

Returns:

is_rewind – True if analysis rewinding criteria are satisfied, False otherwise.

Return type:

bool

is_save_rewind_state(inc)[source]

Evaluate conditions to save rewind state.

Parameters:

inc (int) – Macroscale loading increment.

Returns:

is_save_state – True if conditions to save rewind state are satisfied, False otherwise.

Return type:

bool

update_rewind_time(mode='init')[source]

Update total rewind time.

Parameters:

mode ({'init', 'update'}, default='init') –