57 const Damping_t & Damping,
58 const Stiffness_t & Stiffness,
64 m_stiffness(Stiffness),
67 m_Tmass = [
this](
const T time,
gsSparseMatrix<T> & result) ->
bool {
return m_mass(result);};
70 m_Tforce = [
this](
const T time,
gsVector<T> & result) ->
bool {
return m_force(result);};
78 const Damping_t & Damping,
79 const Stiffness_t & Stiffness,
80 const TForce_t & TForce
85 m_stiffness(Stiffness),
88 m_Tmass = [
this](
const T time,
gsSparseMatrix<T> & result) ->
bool {
return m_mass(result);};
98 const Damping_t & Damping,
99 const Jacobian_t & Jacobian,
100 const Residual_t & Residual
105 m_jacobian(Jacobian),
108 m_Tmass = [
this](
const T time,
gsSparseMatrix<T> & result) ->
bool {
return m_mass(result);};
111 m_Tforce = [ ](
const T time,
gsVector<T> & result) ->
bool {
GISMO_ERROR(
"time-dependent force not available");};
112 m_Tresidual = [
this](
gsVector<T> const & x,
const T time,
gsVector<T> & result) ->
bool {
return m_residual(x,result);};
119 const Damping_t & Damping,
120 const Jacobian_t & Jacobian,
121 const TResidual_t & TResidual
126 m_jacobian(Jacobian),
127 m_Tresidual(TResidual)
129 m_Tmass = [
this](
const T time,
gsSparseMatrix<T> & result) ->
bool {
return m_mass(result);};
138 const Damping_t & Damping,
139 const TJacobian_t & TJacobian,
140 const TResidual_t & TResidual
145 m_Tjacobian(TJacobian),
146 m_Tresidual(TResidual)
148 m_Tmass = [
this](
const T time,
gsSparseMatrix<T> & result) ->
bool {
return m_mass(result);};
155 const TMass_t & TMass,
156 const TDamping_t & TDamping,
157 const TJacobian_t & TJacobian,
158 const TResidual_t & TResidual
162 m_Tdamping(TDamping),
163 m_Tjacobian(TJacobian),
164 m_Tresidual(TResidual)
185 virtual gsStatus status() {
return m_status; }
191 virtual T getTimeStep()
const {
return m_options.
getReal(
"DT"); }
203 return this->step(m_options.
getReal(
"DT"));
206 virtual gsStatus step(
const T t,
const T dt, gsVector<T> & U, gsVector<T> & V, gsVector<T> & A)
const
208 return _step(t,dt,U,V,A);
224 virtual const gsVector<T> & displacements()
const {
return this->solutionU();}
225 virtual const gsVector<T> & velocities()
const {
return this->solutionV();}
226 virtual const gsVector<T> & accelerations()
const {
return this->solutionA();}
228 virtual const gsVector<T> & solutionU()
const {
return m_U;}
229 virtual const gsVector<T> & solutionV()
const {
return m_V;}
230 virtual const gsVector<T> & solutionA()
const {
return m_A;}
232 virtual const T & time() {
return m_time;}
234 virtual void setU(
const gsVector<T> & U) {
m_U = U;}
235 virtual void setV(
const gsVector<T> & V) {m_V = V;}
236 virtual void setA(
const gsVector<T> & A) {m_A = A;}
238 virtual void setDisplacements(
const gsVector<T> & U) {this->setU(U);}
239 virtual void setVelocities(
const gsVector<T> & V) {this->setV(V);}
240 virtual void setAccelerations(
const gsVector<T> & A) {this->setA(A);}
263 if (!m_Tforce(time,F))
270 if (!m_Tresidual(U,time,R))
277 if (!m_Tmass(time,M))
284 if ((m_mass==
nullptr) || (m_massInv.rows()==0 || m_massInv.cols()==0))
288 gsSparseSolver<>::LU solver(M);
290 m_massInv = Minv = MinvI.sparseView();
299 if (!m_Tdamping(U,time,C))
306 if (!m_Tjacobian(U,time,K))
325 TDamping_t m_Tdamping;
327 Stiffness_t m_stiffness;
329 Jacobian_t m_jacobian;
330 TJacobian_t m_Tjacobian;
335 Residual_t m_residual;
336 TResidual_t m_Tresidual;
338 mutable typename gsSparseSolver<T>::uPtr m_solver;
408 #ifndef GISMO_BUILD_LIB
409 #include GISMO_HPP_HEADER(gsDynamicBase.hpp)
std::function< bool(gsVector< T > const &, const T, gsSparseMatrix< T > &) > TJacobian_t
Jacobian.
Definition: gsStructuralAnalysisTypes.h:85
virtual void _computeForce(const T time, gsVector< T > &F) const
Compute the residual.
Definition: gsDynamicBase.h:261
virtual index_t numDofs()
Return the number of degrees of freedom.
Definition: gsDynamicBase.h:252
virtual void _computeMassInverse(const gsSparseMatrix< T > &M, gsSparseMatrix< T > &Minv) const
Compute the mass matrix.
Definition: gsDynamicBase.h:282
virtual gsStatus _step(const T t, const T dt, gsVector< T > &U, gsVector< T > &V, gsVector< T > &A) const =0
Initialize the ALM.
std::function< bool(gsVector< T > const &, const T, gsVector< T > &)> TResidual_t
Time-dependent Residual Fint(t)-Fext(t)
Definition: gsStructuralAnalysisTypes.h:69
virtual gsStatus step(T dt)
Perform one arc-length step.
Definition: gsDynamicBase.h:194
Performs the arc length method to solve a nonlinear system of equations.
Definition: gsDynamicBase.h:34
virtual void _computeMass(const T time, gsSparseMatrix< T > &M) const
Compute the mass matrix.
Definition: gsDynamicBase.h:275
gsVector< T > m_U
Displacement vector (present, at previously converged point)
Definition: gsDynamicBase.h:397
virtual void setTimeStep(T dt)
Set time step to dt.
Definition: gsDynamicBase.h:212
#define index_t
Definition: gsConfig.h:32
gsStatus
Definition: gsStructuralAnalysisTypes.h:20
std::function< bool(gsVector< T > const &, gsVector< T > &)> Residual_t
Residual, Fint-Fext.
Definition: gsStructuralAnalysisTypes.h:65
std::function< bool(gsSparseMatrix< T > &) > Mass_t
Mass matrix.
Definition: gsStructuralAnalysisTypes.h:72
virtual bool converged() const
True if the Arc Length method converged.
Definition: gsDynamicBase.h:219
void setReal(const std::string &label, const Real &value)
Sets an existing option label to be equal to value.
Definition: gsOptionList.cpp:166
std::function< bool(gsVector< T > const &, gsSparseMatrix< T > &) > Jacobian_t
Jacobian.
Definition: gsStructuralAnalysisTypes.h:83
std::function< bool(gsVector< T > const &, gsSparseMatrix< T > &) > Damping_t
Damping matrix.
Definition: gsStructuralAnalysisTypes.h:76
virtual void defaultOptions()
Set default options.
Definition: gsDynamicBase.hpp:20
gsDynamicBase(const Mass_t &Mass, const Damping_t &Damping, const Stiffness_t &Stiffness, const TForce_t &TForce)
Constructor.
Definition: gsDynamicBase.h:76
Provides a list of labeled parameters/options that can be set and accessed easily.
virtual void _computeDamping(const gsVector< T > &U, const T time, gsSparseMatrix< T > &C) const
Compute the damping matrix.
Definition: gsDynamicBase.h:297
std::function< bool(gsVector< T > &)> Force_t
Force.
Definition: gsStructuralAnalysisTypes.h:60
std::function< bool(const T, gsSparseMatrix< T > &) > TMass_t
Time-dependent mass matrix.
Definition: gsStructuralAnalysisTypes.h:74
std::function< bool(gsSparseMatrix< T > &) > Stiffness_t
Stiffness matrix.
Definition: gsStructuralAnalysisTypes.h:81
gsDynamicBase(const Mass_t &Mass, const Damping_t &Damping, const Jacobian_t &Jacobian, const TResidual_t &TResidual)
Constructor.
Definition: gsDynamicBase.h:117
void update(const gsOptionList &other, updateType type=ignoreIfUnknown)
Updates the object using the data from other.
Definition: gsOptionList.cpp:253
Provides a status object and typedefs.
virtual void setOptions(gsOptionList options)
Set the options to options.
Definition: gsDynamicBase.h:246
gsDynamicBase(const Mass_t &Mass, const Damping_t &Damping, const Jacobian_t &Jacobian, const Residual_t &Residual)
Constructor.
Definition: gsDynamicBase.h:96
std::function< bool(const T, gsVector< T > &)> TForce_t
Time-dependent force.
Definition: gsStructuralAnalysisTypes.h:62
virtual void _computeJacobian(const gsVector< T > &U, const T time, gsSparseMatrix< T > &K) const
Compute the Jacobian matrix.
Definition: gsDynamicBase.h:304
T m_t
Time.
Definition: gsDynamicBase.h:402
index_t m_numIterations
Number of iterations performed.
Definition: gsDynamicBase.h:348
#define GISMO_ERROR(message)
Definition: gsDebug.h:118
This is the main header file that collects wrappers of Eigen for linear algebra.
gsDynamicBase(const Mass_t &Mass, const Damping_t &Damping, const Stiffness_t &Stiffness, const Force_t &Force)
Constructor.
Definition: gsDynamicBase.h:55
Class which holds a list of parameters/options, and provides easy access to them. ...
Definition: gsOptionList.h:32
virtual index_t numIterations() const
Returns the number of Newton iterations performed.
Definition: gsDynamicBase.h:222
virtual gsOptionList & options()
Access the options.
Definition: gsDynamicBase.h:243
gsDynamicBase(const Mass_t &Mass, const Damping_t &Damping, const TJacobian_t &TJacobian, const TResidual_t &TResidual)
Constructor.
Definition: gsDynamicBase.h:136
std::function< bool(gsVector< T > const &, const T, gsSparseMatrix< T > &) > TDamping_t
Time-dependent Damping matrix.
Definition: gsStructuralAnalysisTypes.h:78
virtual const void options_into(gsOptionList options)
Return the options into options.
Definition: gsDynamicBase.h:249
gsDynamicBase(const TMass_t &TMass, const TDamping_t &TDamping, const TJacobian_t &TJacobian, const TResidual_t &TResidual)
Constructor.
Definition: gsDynamicBase.h:154
T m_time
Time.
Definition: gsDynamicBase.h:360
Real getReal(const std::string &label) const
Reads value for option label from options.
Definition: gsOptionList.cpp:44
virtual void _computeResidual(const gsVector< T > &U, const T time, gsVector< T > &R) const
Compute the residual.
Definition: gsDynamicBase.h:268