G+Smo  24.08.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsControlDisplacement.h
Go to the documentation of this file.
1 
14 #include <typeinfo>
16 
17 #pragma once
18 
19 
20 namespace gismo
21 {
22 
30 template <class T>
32 {
33 protected:
34 
35 public:
36 
39  m_solver(solver),
40  first(true)
41  {
42  m_U = gsVector<T>::Zero(m_solver->numDofs());
43  m_L = 0;
44  }
45 
46  gsStatus step(T dL)
47  {
48  m_solver->setLoad(m_L + dL);
49  if (!first)
50  m_solver->setDisplacement(m_U);
51  else first = false;
52  m_status = m_solver->solve();
53 
54  if (m_status == gsStatus::Success)
55  {
56  m_L += dL;
57  m_U += m_solver->update();
58  }
59  return m_status;
60  }
61 
64  {
65  return m_U;
66  }
67 
70  {
71  return m_L;
72  }
73 
75  void reset()
76  {
77  m_solver->reset();
78  }
79 
80 protected:
81  mutable gsStaticBase<T> * m_solver;
82  T m_L;
83  bool first;
84 
85  gsVector<T> m_U;
86 
87  gsStatus m_status;
88 };
89 
90 
91 } // namespace gismo
Base class for continuation.
gsVector< T > & solutionU()
Return the displacements.
Definition: gsControlDisplacement.h:63
gsStatus
Definition: gsStructuralAnalysisTypes.h:20
A vector with arbitrary coefficient type and fixed or dynamic size.
Definition: gsVector.h:35
Base class for simple continuation schemes.
Definition: gsContinuationBase.h:27
Simple class for displacement control given a static solver.
Definition: gsControlDisplacement.h:31
T solutionL()
Return the load.
Definition: gsControlDisplacement.h:69
gsControlDisplacement(gsStaticBase< T > *solver)
Constructor given a static solver.
Definition: gsControlDisplacement.h:38
void reset()
Reset the solver.
Definition: gsControlDisplacement.h:75
Base class for static solvers.
Definition: gsStaticBase.h:37