newmark_solver.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2018 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 
19 
20 #ifndef LIBMESH_NEWMARK_SOLVER_H
21 #define LIBMESH_NEWMARK_SOLVER_H
22 
23 // Local includes
25 
26 namespace libMesh
27 {
47 {
48 public:
53 
58  explicit
59  NewmarkSolver (sys_type & s);
60 
64  virtual ~NewmarkSolver ();
65 
72  virtual void advance_timestep () override;
73 
79  virtual void adjoint_advance_timestep () override;
80 
85  virtual void compute_initial_accel();
86 
96  FunctionBase<Gradient> * g = nullptr);
97 
104  void set_initial_accel_avail (bool initial_accel_set);
105 
109  virtual Real error_order() const override;
110 
116  virtual void solve () override;
117 
124  virtual bool element_residual (bool request_jacobian,
125  DiffContext &) override;
126 
133  virtual bool side_residual (bool request_jacobian,
134  DiffContext &) override;
135 
142  virtual bool nonlocal_residual (bool request_jacobian,
143  DiffContext &) override;
144 
145 
149  void set_beta ( Real beta )
150  { _beta = beta; }
151 
157  void set_gamma ( Real gamma )
158  { _gamma = gamma; }
159 
160 protected:
161 
168 
174 
180 
181 
188 
193  virtual bool _general_residual (bool request_jacobian,
194  DiffContext &,
195  ResFuncType mass,
196  ResFuncType damping,
197  ResFuncType time_deriv,
198  ResFuncType constraint,
200 };
201 
202 } // namespace libMesh
203 
204 #endif // LIBMESH_NEWMARK_SOLVER_H
virtual bool element_residual(bool request_jacobian, DiffContext &) override
void set_gamma(Real gamma)
virtual bool side_residual(bool request_jacobian, DiffContext &) override
void(DiffContext::* ReinitFuncType)(Real)
Definition: time_solver.h:273
virtual void compute_initial_accel()
NewmarkSolver(sys_type &s)
virtual bool _general_residual(bool request_jacobian, DiffContext &, ResFuncType mass, ResFuncType damping, ResFuncType time_deriv, ResFuncType constraint, ReinitFuncType reinit)
void set_initial_accel_avail(bool initial_accel_set)
bool(DifferentiablePhysics::* ResFuncType)(bool, DiffContext &)
Definition: time_solver.h:271
virtual void advance_timestep() override
virtual bool nonlocal_residual(bool request_jacobian, DiffContext &) override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void set_beta(Real beta)
virtual Real error_order() const override
virtual void solve() override
UnsteadySolver Parent
virtual void adjoint_advance_timestep() override
void project_initial_accel(FunctionBase< Number > *f, FunctionBase< Gradient > *g=nullptr)