G+Smo  25.01.0
Geometry + Simulation Modules
 
Loading...
Searching...
No Matches
gsControlDisplacement.h
Go to the documentation of this file.
1
14#include <typeinfo>
16
17#pragma once
18
19
20namespace gismo
21{
22
30template <class T>
32{
33protected:
34
35public:
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 void setZero()
81 {
82 m_solver->reset();
83 m_U = gsVector<T>::Zero(m_solver->numDofs());
84 m_L = 0;
85 m_solver->setLoad(m_L);
86 }
87
88protected:
89 mutable gsStaticBase<T> * m_solver;
90 T m_L;
91 bool first;
92
93 gsVector<T> m_U;
94
95 gsStatus m_status;
96};
97
98
99} // namespace gismo
Base class for simple continuation schemes.
Definition gsContinuationBase.h:28
Simple class for displacement control given a static solver.
Definition gsControlDisplacement.h:32
gsControlDisplacement(gsStaticBase< T > *solver)
Constructor given a static solver.
Definition gsControlDisplacement.h:38
T solutionL()
Return the load.
Definition gsControlDisplacement.h:69
gsVector< T > & solutionU()
Return the displacements.
Definition gsControlDisplacement.h:63
void reset()
Reset the solver.
Definition gsControlDisplacement.h:75
Base class for static solvers.
Definition gsStaticBase.h:38
A vector with arbitrary coefficient type and fixed or dynamic size.
Definition gsVector.h:37
Base class for continuation.
The G+Smo namespace, containing all definitions for the library.
gsStatus
Definition gsStructuralAnalysisTypes.h:21
@ Success
Successful.