13#ifndef DUMUX_TIMESTEPPING_NEWMARK_BETA_HH
14#define DUMUX_TIMESTEPPING_NEWMARK_BETA_HH
32template<
class Scalar,
class Solution>
35 using Block =
typename Solution::block_type;
48 getParam<Scalar>(
"NewmarkBeta.Beta", 0.25),
49 getParam<Scalar>(
"NewmarkBeta.Gamma", 0.5)
64 void initialize(
const Solution& x,
const Solution& v,
const Solution& a)
72 void update(
const Scalar dt,
const Solution& x)
74 for (std::size_t i = 0; i < x_.size(); ++i)
76 const auto xNew = x[i];
78 const auto vNew =
velocity(i, dt, xNew, aNew);
87 Block
acceleration(
const std::size_t index,
const Scalar dt,
const Block& x)
const
89 const auto& x0 = x_[index];
90 const auto& v0 = v_[index];
91 const auto& a0 = a_[index];
93 return (x - x0 - dt*v0)/(beta_*dt*dt) + (beta_ - 0.5)/beta_*a0;
97 Block
velocity(
const std::size_t index,
const Scalar dt,
const Block& x,
const Block& a)
const
99 const auto& v0 = v_[index];
100 const auto& a0 = a_[index];
102 return v0 + dt*((1.0-gamma_)*a0 + gamma_*a);
106 Block
velocity(
const std::size_t index,
const Scalar dt,
const Block& x)
const
114 {
return x_[index]; }
118 {
return v_[index]; }
122 {
return a_[index]; }
125 Scalar beta_, gamma_;
Newmark-beta time integration scheme.
Definition: newmarkbeta.hh:34
NewmarkBeta()
Definition: newmarkbeta.hh:46
Block velocity(const std::size_t index, const Scalar dt, const Block &x, const Block &a) const
new v in terms of the old v, a, the new x, a and the time step size
Definition: newmarkbeta.hh:97
void initialize(const Solution &x, const Solution &v, const Solution &a)
Initialize the time integration scheme with the current solution.
Definition: newmarkbeta.hh:64
NewmarkBeta(const Scalar beta, const Scalar gamma)
Definition: newmarkbeta.hh:39
Block acceleration(const std::size_t index, const Scalar dt, const Block &x) const
new a in terms of the old x, v, a, the new x and the time step size
Definition: newmarkbeta.hh:87
Scalar position(const std::size_t index) const
current position
Definition: newmarkbeta.hh:113
Scalar velocity(const std::size_t index) const
current velocity
Definition: newmarkbeta.hh:117
void initialize(const Solution &x)
Definition: newmarkbeta.hh:54
void update(const Scalar dt, const Solution &x)
Update with new position x.
Definition: newmarkbeta.hh:72
Scalar acceleration(const std::size_t index) const
current acceleration
Definition: newmarkbeta.hh:121
Block velocity(const std::size_t index, const Scalar dt, const Block &x) const
new v in terms of the old v, a, the new x and the time step size
Definition: newmarkbeta.hh:106
T getParam(Args &&... args)
A free function to get a parameter from the parameter tree singleton.
Definition: parameters.hh:139
Definition: experimental/assembly/cclocalassembler.hh:36
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.