svMultiPhysics
Loading...
Searching...
No Matches
ActiveStressODE Class Referenceabstract

Abstract ODE-based active stress model. More...

#include <ActiveStressODE.h>

Inheritance diagram for ActiveStressODE:
[legend]

Classes

class  Parameters
 Model parameters class. More...

Public Types

enum class  ODESolver {
  ForwardEuler ,
  RungeKutta4
}
 Enumeration of supported ODE solvers. More...

Public Member Functions

 ActiveStressODE (const unsigned int n_states, const bool needs_fiber_stretch, const bool needs_fiber_stretch_rate)
 Constructor.
Public Member Functions inherited from ActiveStress
 ActiveStress (const unsigned int n_states_, const bool needs_fiber_stretch, const bool needs_fiber_stretch_rate)
 Constructor.
virtual ~ActiveStress ()=default
 Virtual destructor.
virtual std::unique_ptr< ActiveStressModelParameters > get_parameters () const =0
 Construct an instance of model parameters for this model.
void read_parameters (const ActiveStressParameters &params)
 Read model parameters from a parameter object.
void distribute_parameters (const CmMod &cm_mod, const cmType &cm)
 Distribute model parameters to all parallel processes.
Vector< double > get_state (const unsigned int Ac) const
 Get the state vector at a given mesh node.
ActiveTension compute_tension (const Vector< double > &state, const double fiber_stretch) const
 Compute the active tension given the state vector and fiber stretch.
virtual void init (const unsigned int tnNo)
 Initialize the model.
virtual void time_advance ()
 Begin a new time step.
virtual void update (const double t, const double dt, const Vector< double > &calcium, const Vector< double > &fiber_stretch, const Vector< double > &fiber_stretch_rate)
 Update the state over the current time step.
bool needs_fiber_stretch () const
 Whether this model uses the fiber stretch passed to update. This flag can be used to determine whether fiber stretch computation can be skipped for efficiency.
bool needs_fiber_stretch_rate () const
 Whether this model uses the fiber stretch rate passed to update. This flag can be used to determine whether fiber stretch rate computation can be skipped for efficiency.
bool implicit_state_coupling () const
 Whether the state of this model is updated within the nonlinear iterations of the mechanics problem, i.e. whether the indirect dependence of the active tension on the fiber stretch is treated implicitly.

Protected Member Functions

virtual void read_model_specific_parameters (const ActiveStressModelParameters &params) override
 Read model parameters from a parameter object.
virtual void distribute_model_specific_parameters (const CmMod &cm_mod, const cmType &cm) override
 Distribute model parameters to all parallel processes.
virtual void advance_time_step_local (const double t, const double dt, const double calcium, const double fiber_stretch, const double fiber_stretch_rate, Vector< double > &state) const override
 Advance in time for a single node.
virtual Vector< double > getf (const double t, const Vector< double > &state, const double calcium, const double fiber_stretch, const double fiber_stretch_rate) const =0
 Compute the rate of change in the state variables.
Protected Member Functions inherited from ActiveStress
virtual void init_local (Vector< double > &state) const =0
 Initialize the state vector for a single node.
virtual double compute_active_tension_local (const Vector< double > &state, const double fiber_stretch) const =0
 Compute the active tension for a single node.
virtual double compute_active_tension_derivative_local (const Vector< double > &state, const double fiber_stretch) const =0
 Compute the partial derivative of the active tension with respect to the fiber stretch, at fixed state, for a single node.

Protected Attributes

ODESolver ode_solver
 ODE solver.
Protected Attributes inherited from ActiveStress
bool needs_fiber_stretch_
 Backing store for needs_fiber_stretch.
bool needs_fiber_stretch_rate_
 Backing store for needs_fiber_stretch_rate.
double time = 0.0
 Time instant being advanced to. Set by update.
Array< double > states
 State variables for the model.
Array< double > states_at_time_step_start
 State variables at the beginning of the current time step.
bool implicit_state_coupling_
 Whether the state of this model is updated within the nonlinear iterations of the mechanics problem.
double calcium_scaling_factor_ = 1.0
bool disable_force_strain_rate_feedback_ = false
double eta_f
 Active tension coefficient along the fiber direction.
double eta_s
 Active tension coefficient along the sheet direction.
double eta_n
 Active tension coefficient along the sheet-normal direction.

Additional Inherited Members

Public Attributes inherited from ActiveStress
const unsigned int n_states
 Number of state variables for this model.

Detailed Description

Abstract ODE-based active stress model.

This class provides an interface for defining active stress models for which the evolution of the state vector \(\astressstate\) is governed by a system of ordinary differential equations (ODEs):

\[ \begin{aligned} \dv{\astressstate}{t} &= \mathbf{F}_\text{AS}(t, \astressstate, \calcium, \fiberstretch, \fiberstretchrate)\;, \\ \Tact &= \Tact(\astressstate, \fiberstretch)\;. \end{aligned} \]

Numerical methods

The ODE system is advanced with one of the methods described in ODESolver. After that, the active tension is computed for every node \(i\) as:

\[ {\Tact}_{i}^{n+1} = \Tact(\astressstate_i^{n+1}, \fiberstretch_i^{n+1})\;. \]

Implementing derived models

To implement a new ODE-based active stress model, the following steps need to be taken:

  1. Create a new class derived from ActiveStressODE.
  2. Override the method init_local (from the base class ActiveStress) to define the initial condition for the state vector at a single node.
  3. Override the method getf to define the right-hand side function \(\mathbf{F}_\text{AS}\) of the ODE system.
  4. Create a new class derived from ActiveStressODE::Parameters to store the parameters specific to the new active stress model.
  5. Override the methods get_parameters, read_parameters and distribute_parameters to manage the parameters of the new active stress model. Both read_parameters and distribute_parameters need to call the corresponding method of ActiveStressODE.
  6. Register the new class into the active stress model factory by using the macro REGISTER_ACTIVE_STRESS_MODEL. The macro should be called in a .cpp file, not in a header file.

Member Enumeration Documentation

◆ ODESolver

enum class ActiveStressODE::ODESolver
strong

Enumeration of supported ODE solvers.

In the documentation of the individual methods below, the subscript \(i\) is used to denote the value of variables at the \(i\)-th node, and the superscript \(n\) is used to denote the time step.

Enumerator
ForwardEuler 

Forward Euler.

The state vector is updated as follows:

\[ \astressstate_i^{n+1} = \astressstate_i^n + \Delta t \mathbf{F}_\text{AS}(t^n, \astressstate_i^n, \calcium_i^n, \fiberstretch_i^n, \fiberstretchrate_i^n)\;. \]

RungeKutta4 

4th order explicit Runge-Kutta.

The state vector is updated as follows:

\[ \begin{aligned} \mathbf{k}_1 &= \mathbf{F}_\text{AS}(t^n, \astressstate_i^n, \calcium_i^n, \fiberstretch_i^n, \fiberstretchrate_i^n)\;, \\ \mathbf{k}_2 &= \mathbf{F}_\text{AS}(t^n + \Delta t / 2, \astressstate_i^n + \Delta t \mathbf{k}_1 / 2, \calcium_i^n, \fiberstretch_i^n, \fiberstretchrate_i^n)\;, \\ \mathbf{k}_3 &= \mathbf{F}_\text{AS}(t^n + \Delta t / 2, \astressstate_i^n + \Delta t \mathbf{k}_2 / 2, \calcium_i^n, \fiberstretch_i^n, \fiberstretchrate_i^n)\;, \\ \mathbf{k}_4 &= \mathbf{F}_\text{AS}(t^{n+1}, \astressstate_i^n + \Delta t \mathbf{k}_3, \calcium_i^n, \fiberstretch_i^n, \fiberstretchrate_i^n)\;, \\ \astressstate_i^{n+1} &= \astressstate_i^n + \frac{\Delta t}{6} \left( \mathbf{k}_1 + 2 \mathbf{k}_2 + 2 \mathbf{k}_3 + \mathbf{k}_4 \right)\;. \end{aligned} \]

Note that the driving quantities \(\calcium\), \(\fiberstretch\) and \(\fiberstretchrate\) are held fixed at their values at \(t^{n+1}\) across all four stages.

Constructor & Destructor Documentation

◆ ActiveStressODE()

ActiveStressODE::ActiveStressODE ( const unsigned int n_states,
const bool needs_fiber_stretch,
const bool needs_fiber_stretch_rate )
inline

Constructor.

Parameters
n_statesNumber of state variables for this model.
needs_fiber_stretchSee ActiveStress::ActiveStress.
needs_fiber_stretch_rateSee ActiveStress::ActiveStress.

Member Function Documentation

◆ advance_time_step_local()

void ActiveStressODE::advance_time_step_local ( const double t,
const double dt,
const double calcium,
const double fiber_stretch,
const double fiber_stretch_rate,
Vector< double > & state ) const
overrideprotectedvirtual

Advance in time for a single node.

Solves one forward Euler time step for the ODE system.

Parameters
[in]tCurrent time (i.e. the time instant being advanced to).
[in]dtTime step size.
[in]calciumCalcium concentration at the current node.
[in]fiber_stretchFiber stretch at the current node.
[in]fiber_stretch_rateFiber stretch rate at the current node.
[in,out]stateState vector for a single node, to be updated by this function.
Todo
[michelebucelli] It might be necessary or useful to implement implicit time stepping too, e.g. by adding a method to evaluate the Jacobian matrix of the system, as in IonicModel.

Implements ActiveStress.

◆ distribute_model_specific_parameters()

void ActiveStressODE::distribute_model_specific_parameters ( const CmMod & cm_mod,
const cmType & cm )
overrideprotectedvirtual

Distribute model parameters to all parallel processes.

Implements ActiveStress.

Reimplemented in ActiveStressLandNiederer, and ActiveStressNashPanfilov.

◆ getf()

virtual Vector< double > ActiveStressODE::getf ( const double t,
const Vector< double > & state,
const double calcium,
const double fiber_stretch,
const double fiber_stretch_rate ) const
protectedpure virtual

Compute the rate of change in the state variables.

Parameters
[in]tCurrent time (i.e. the time instant being advanced to).
[in]dtTime step size.
[in]calciumCalcium concentration at the current node.
[in]fiber_stretchFiber stretch at the current node.
[in]fiber_stretch_rateFiber stretch rate at the current node.
Returns
A vector containing the rate of change for each state variable.

Implemented in ActiveStressLandNiederer, and ActiveStressNashPanfilov.

◆ read_model_specific_parameters()

void ActiveStressODE::read_model_specific_parameters ( const ActiveStressModelParameters & params)
overrideprotectedvirtual

Read model parameters from a parameter object.

Implements ActiveStress.

Reimplemented in ActiveStressLandNiederer, and ActiveStressNashPanfilov.

Member Data Documentation

◆ ode_solver

ODESolver ActiveStressODE::ode_solver
protected

ODE solver.


The documentation for this class was generated from the following files: