G+Smo  25.01.0
Geometry + Simulation Modules
 
Loading...
Searching...
No Matches
gsDynamicWilson.hpp
Go to the documentation of this file.
1
14#pragma once
15
16namespace gismo
17{
18
19template <class T, bool _NL>
21{
22 Base::defaultOptions();
23 m_options.addReal("alpha","Beta parameter for Wilson's method, such that 0 =< 2 beta =< 1",0.25);
24 m_options.addReal("delta","Beta parameter for Wilson's method, such that 0 =< delta =< 1",0.50);
25 m_options.addReal("gamma","Beta parameter for Wilson's method, such that 0 =< gamma =< 1",1.4);
26}
27
28
29template <class T, bool _NL>
30template <bool _nonlinear>
31typename std::enable_if<(_nonlinear==false), gsStatus>::type
32gsDynamicWilson<T,_NL>::_step_impl(const T t, const T dt, gsVector<T> & U, gsVector<T> & V, gsVector<T> & A) const
33{
34 T alpha = m_options.getReal("alpha");
35 T delta = m_options.getReal("delta");
36 T gamma = m_options.getReal("gamma");
37
38 gsVector<T> Uold = U;
39 gsVector<T> Vold = V;
40 gsVector<T> Aold = A;
41
42 gsVector<T> Utmp = U;
43 gsVector<T> Vtmp = V;
44 gsVector<T> Atmp = A;
45
46 // Perform a Newmark step with DT = gamma*dt
47 Base::_step(t,gamma*dt,Utmp,Vtmp,Atmp);
48
49 // Compute solutions
50 A = (1-1/gamma)*Aold + 1/gamma*Atmp;
51 V += A*delta*dt;
52 U += A*alpha*dt*dt;
53
54 return gsStatus::Success;
55}
56
57
58template <class T, bool _NL>
59template <bool _nonlinear>
60typename std::enable_if<(_nonlinear==true), gsStatus>::type
61gsDynamicWilson<T,_NL>::_step_impl(const T t, const T dt, gsVector<T> & U, gsVector<T> & V, gsVector<T> & A) const
62{
63 T alpha = m_options.getReal("alpha");
64 T delta = m_options.getReal("delta");
65 T gamma = m_options.getReal("gamma");
66
67 gsVector<T> Uold = U;
68 gsVector<T> Vold = V;
69 gsVector<T> Aold = A;
70
71 gsVector<T> Utmp = U;
72 gsVector<T> Vtmp = V;
73 gsVector<T> Atmp = A;
74
76 Base::_step(t,gamma*dt,Utmp,Vtmp,Atmp);
77
78 // Compute solutions (see Wilson et al. (1973) NONLINEAR DYNAMIC ANALYSIS OF COMPLEX STRUCTURES)
79 A = (1-1/gamma)*Aold + 1/gamma*Atmp;
80 U = Uold + dt*Vold + Aold*(0.5 - alpha)*dt*dt + alpha*dt*dt*A;
81 V = Vold + Aold*(1 - delta)*dt + delta*dt*A;
82
83 return gsStatus::Success;
84}
85
86template <class T, bool _NL>
88 gsVector<T> & U, gsVector<T> & V,
89 gsVector<T> & A) const
90{
92 status = _step_impl<_NL>(t,dt,U,V,A);
93 return status;
94}
95
96template <class T, bool _NL>
98{
99 if (m_options.getSwitch("Verbose"))
100 {
101 gsInfo<<"Stage "<<stage<<":";
102 gsInfo<<"\n";
103 }
104}
105
106template <class T, bool _NL>
107void gsDynamicWilson<T,_NL>::_initOutput() const
108{
109 if (m_options.getSwitch("Verbose"))
110 {
111 gsInfo<<"\t";
112 gsInfo<<std::setw(4)<<std::left<<"It.";
113 gsInfo<<std::setw(17)<<std::left<<"|R|/|R0|";
114 gsInfo<<std::setw(17)<<std::left<<"|dU|/|U0|"<<"\n";
115 }
116}
117
118template <class T, bool _NL>
119void gsDynamicWilson<T,_NL>::_stepOutput(const index_t it, const T resnorm, const T updatenorm) const
120{
121 if (m_options.getSwitch("Verbose"))
122 {
123 gsInfo<<"\t";
124 gsInfo<<std::setw(4)<<std::left<<it;
125 gsInfo<<std::setw(17)<<std::left<<resnorm;
126 gsInfo<<std::setw(17)<<std::left<<updatenorm<<"\n";
127 }
128}
129
130} // namespace gismo
Performs the arc length method to solve a nonlinear system of equations.
Definition gsDynamicWilson.h:36
gsStatus _step(const T t, const T dt, gsVector< T > &U, gsVector< T > &V, gsVector< T > &A) const override
Initialize the ALM.
Definition gsDynamicWilson.hpp:87
virtual void defaultOptions() override
Set default options.
Definition gsDynamicWilson.hpp:20
A vector with arbitrary coefficient type and fixed or dynamic size.
Definition gsVector.h:37
#define index_t
Definition gsConfig.h:32
#define gsInfo
Definition gsDebug.h:43
The G+Smo namespace, containing all definitions for the library.
gsStatus
Definition gsStructuralAnalysisTypes.h:21
@ Success
Successful.
@ NotStarted
ALM has not started yet.