svMultiPhysics
Loading...
Searching...
No Matches
ActiveStressUniformUnsteady.h
1// SPDX-FileCopyrightText: Copyright (c) Stanford University, The Regents of the
2// University of California, and others. SPDX-License-Identifier: BSD-3-Clause
3
4#ifndef ACTIVE_STRESS_UNIFORM_UNSTEADY_H
5#define ACTIVE_STRESS_UNIFORM_UNSTEADY_H
6
7#include "ActiveStress.h"
8
9#include "FourierInterpolation.h"
10
11/**
12 * @brief Uniform and time dependent active stress model.
13 *
14 * Defines an active tension that is constant in space but time dependent, i.e.
15 * @f[
16 * \Tact(t, \calcium, \fiberstretch, \fiberstretchrate, \astressstate) =
17 * g(t)\;,
18 * @f]
19 * where @f$g(t)@f$ is a user-defined function of time.
20 */
22public:
23 /// Model label.
24 static inline const std::string label = "UniformUnsteady";
25
26 /// Model parameters class.
28 public:
30 constexpr bool required = true;
31
32 add_parameter("Ramp", false, required);
33 add_parameter("Temporal_values_file_path", std::string(""), required);
34 }
35 };
36
37 /**
38 * @brief Constructor.
39 */
41 : ActiveStress(/* n_states = */ 0,
42 /* needs_fiber_stretch = */ false,
43 /* needs_fiber_stretch_rate = */ false) {}
44
45 /**
46 * @brief Construct an instance of model parameters.
47 */
48 virtual std::unique_ptr<ActiveStressModelParameters>
49 get_parameters() const override {
50 return std::make_unique<Parameters>();
51 }
52
53 /**
54 * @brief Initialization.
55 *
56 * Calls the parent class initialization method, and reads the Fourier
57 * coefficient from file.
58 */
59 virtual void init(const unsigned int tnNo) override;
60
61protected:
62 /**
63 * @brief Read model parameters from a parameter object.
64 */
66 const ActiveStressModelParameters &params) override;
67
68 /**
69 * @brief Distribute model parameters to all parallel processes.
70 */
71 virtual void distribute_model_specific_parameters(const CmMod &cm_mod,
72 const cmType &cm) override;
73
74 /**
75 * @brief Initialize the state vector for a single node.
76 *
77 * This model has no states, so this function does nothing.
78 */
79 virtual void init_local(Vector<double> &state) const override {}
80
81 /**
82 * @brief Advance in time for a single node.
83 *
84 * This model has no states, so this function does nothing.
85 */
86 virtual void advance_time_step_local(const double t, const double dt,
87 const double calcium,
88 const double fiber_stretch,
89 const double fiber_stretch_rate,
90 Vector<double> &state) const override {}
91
92 /**
93 * @brief Compute the active tension for a single node.
94 */
95 virtual double
97 const double fiber_stretch) const override;
98
99 /// Toggle between ramp or Fourier transform.
100 bool ramp;
101
102 /// Name of the file containing the temporal values.
104
105 /// Fourier interpolation of the time dependent data.
107};
108
109#endif
Abstract active stress class.
Definition ActiveStress.h:100
Parameters for a generic active stress model.
Definition Parameters.h:1444
void add_parameter(const std::string &label, double default_value, bool required)
Add a new parameter to this object.
Definition Parameters.h:1490
Model parameters class.
Definition ActiveStressUniformUnsteady.h:27
Uniform and time dependent active stress model.
Definition ActiveStressUniformUnsteady.h:21
virtual void init(const unsigned int tnNo) override
Initialization.
Definition ActiveStressUniformUnsteady.cpp:9
virtual void init_local(Vector< double > &state) const override
Initialize the state vector for a single node.
Definition ActiveStressUniformUnsteady.h:79
virtual double compute_active_tension_local(const Vector< double > &state, const double fiber_stretch) const override
Compute the active tension for a single node.
Definition ActiveStressUniformUnsteady.cpp:28
std::string temporal_values_file_path
Name of the file containing the temporal values.
Definition ActiveStressUniformUnsteady.h:103
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.
Definition ActiveStressUniformUnsteady.h:86
virtual std::unique_ptr< ActiveStressModelParameters > get_parameters() const override
Construct an instance of model parameters.
Definition ActiveStressUniformUnsteady.h:49
bool ramp
Toggle between ramp or Fourier transform.
Definition ActiveStressUniformUnsteady.h:100
virtual void read_model_specific_parameters(const ActiveStressModelParameters &params) override
Read model parameters from a parameter object.
Definition ActiveStressUniformUnsteady.cpp:16
FourierInterpolation fourier_interpolation
Fourier interpolation of the time dependent data.
Definition ActiveStressUniformUnsteady.h:106
virtual void distribute_model_specific_parameters(const CmMod &cm_mod, const cmType &cm) override
Distribute model parameters to all parallel processes.
Definition ActiveStressUniformUnsteady.cpp:22
ActiveStressUniformUnsteady()
Constructor.
Definition ActiveStressUniformUnsteady.h:40
static const std::string label
Model label.
Definition ActiveStressUniformUnsteady.h:24
The CmMod class duplicates the data structures in the Fortran CMMOD module defined in COMU....
Definition CmMod.h:36
Fourier interpolation of time dependent data.
Definition FourierInterpolation.h:113
The Vector template class is used for storing int and double data.
Definition Vector.h:26
The cmType class stores data and defines methods used for mpi communication.
Definition CmMod.h:56