libMesh
newmark_solver.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2017 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
24 #include "libmesh/second_order_unsteady_solver.h"
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 () libmesh_override;
73 
79  virtual void adjoint_advance_timestep () libmesh_override;
80 
85  virtual void compute_initial_accel();
86 
97 
104  void set_initial_accel_avail (bool initial_accel_set);
105 
109  virtual Real error_order() const libmesh_override;
110 
116  virtual void solve () libmesh_override;
117 
124  virtual bool element_residual (bool request_jacobian,
125  DiffContext &) libmesh_override;
126 
133  virtual bool side_residual (bool request_jacobian,
134  DiffContext &) libmesh_override;
135 
142  virtual bool nonlocal_residual (bool request_jacobian,
143  DiffContext &) libmesh_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
Real _gamma
The value for to employ.
This class provides all data required for a physics package (e.g.
Definition: diff_context.h:54
bool _initial_accel_set
This method requires an initial acceleration.
void set_gamma(Real gamma)
Setter for .
virtual Real error_order() const libmesh_override
Error convergence order: 2 for , 1 otherwise.
virtual bool side_residual(bool request_jacobian, DiffContext &) libmesh_override
This method uses the DifferentiablePhysics' side_time_derivative() and side_constraint() to build a f...
virtual bool nonlocal_residual(bool request_jacobian, DiffContext &) libmesh_override
This method uses the DifferentiablePhysics' nonlocal_time_derivative() and nonlocal_constraint() to b...
This class defines a Newmark time integrator for second order (in time) DifferentiableSystems.
const class libmesh_nullptr_t libmesh_nullptr
void project_initial_accel(FunctionBase< Number > *f, FunctionBase< Gradient > *g=libmesh_nullptr)
Specify non-zero initial acceleration.
virtual void solve() libmesh_override
This method solves for the solution at the next timestep.
The libMesh namespace provides an interface to certain functionality in the library.
void(DiffContext::* ReinitFuncType)(Real)
Definition: time_solver.h:272
virtual void compute_initial_accel()
This method uses the specified initial displacement and velocity to compute the initial acceleration ...
virtual ~NewmarkSolver()
Destructor.
NewmarkSolver(sys_type &s)
Constructor.
This class provides a specific system class.
Definition: diff_system.h:53
virtual bool _general_residual(bool request_jacobian, DiffContext &, ResFuncType mass, ResFuncType damping, ResFuncType time_deriv, ResFuncType constraint, ReinitFuncType reinit)
This method is the underlying implementation of the public residual methods.
virtual void adjoint_advance_timestep() libmesh_override
This method advances the adjoint solution to the previous timestep, after an adjoint_solve() has been...
void set_initial_accel_avail(bool initial_accel_set)
Allow the user to (re)set whether the initial acceleration is available.
bool(DifferentiablePhysics::* ResFuncType)(bool, DiffContext &)
Definitions of argument types for use in refactoring subclasses.
Definition: time_solver.h:270
Generic class from which second order UnsteadySolvers should subclass.
virtual void reinit() libmesh_override
The reinitialization function.
This is a generic class that defines a solver to handle time integration of DifferentiableSystems.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void set_beta(Real beta)
Setter for .
virtual bool element_residual(bool request_jacobian, DiffContext &) libmesh_override
This method uses the DifferentiablePhysics&#39; element_time_derivative() and element_constraint() to bui...
bool _is_accel_solve
Need to be able to indicate to _general_residual if we are doing an acceleration solve or not...
This is the base class for functor-like classes.
virtual void advance_timestep() libmesh_override
This method advances the solution to the next timestep, after a solve() has been performed.
UnsteadySolver Parent
The parent class.
Real _beta
The value for the to employ.