libMesh
newmark_solver.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2019 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 () 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
libMesh::FunctionBase< Number >
libMesh::TimeSolver::ResFuncType
bool(DifferentiablePhysics::* ResFuncType)(bool, DiffContext &)
Definitions of argument types for use in refactoring subclasses.
Definition: time_solver.h:270
libMesh::NewmarkSolver::_general_residual
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.
Definition: newmark_solver.C:205
libMesh::NewmarkSolver::_is_accel_solve
bool _is_accel_solve
Need to be able to indicate to _general_residual if we are doing an acceleration solve or not.
Definition: newmark_solver.h:179
libMesh::NewmarkSolver::set_gamma
void set_gamma(Real gamma)
Setter for .
Definition: newmark_solver.h:157
libMesh::NewmarkSolver::_gamma
Real _gamma
The value for to employ.
Definition: newmark_solver.h:173
libMesh
The libMesh namespace provides an interface to certain functionality in the library.
Definition: factoryfunction.C:55
libMesh::NewmarkSolver::~NewmarkSolver
virtual ~NewmarkSolver()
Destructor.
Definition: newmark_solver.C:33
libMesh::TimeSolver::ReinitFuncType
void(DiffContext::* ReinitFuncType)(Real)
Definition: time_solver.h:272
libMesh::DifferentiableSystem
This class provides a specific system class.
Definition: diff_system.h:53
libMesh::NewmarkSolver::adjoint_advance_timestep
virtual void adjoint_advance_timestep() override
This method advances the adjoint solution to the previous timestep, after an adjoint_solve() has been...
Definition: newmark_solver.C:101
libMesh::NewmarkSolver::element_residual
virtual bool element_residual(bool request_jacobian, DiffContext &) override
This method uses the DifferentiablePhysics' element_time_derivative() and element_constraint() to bui...
Definition: newmark_solver.C:163
libMesh::NewmarkSolver
This class defines a Newmark time integrator for second order (in time) DifferentiableSystems.
Definition: newmark_solver.h:46
libMesh::NewmarkSolver::set_initial_accel_avail
void set_initial_accel_avail(bool initial_accel_set)
Allow the user to (re)set whether the initial acceleration is available.
Definition: newmark_solver.C:143
libMesh::UnsteadySolver
This is a generic class that defines a solver to handle time integration of DifferentiableSystems.
Definition: unsteady_solver.h:48
libMesh::NewmarkSolver::project_initial_accel
void project_initial_accel(FunctionBase< Number > *f, FunctionBase< Gradient > *g=nullptr)
Specify non-zero initial acceleration.
Definition: newmark_solver.C:132
libMesh::NewmarkSolver::_initial_accel_set
bool _initial_accel_set
This method requires an initial acceleration.
Definition: newmark_solver.h:187
libMesh::SecondOrderUnsteadySolver
Generic class from which second order UnsteadySolvers should subclass.
Definition: second_order_unsteady_solver.h:38
libMesh::DiffContext
This class provides all data required for a physics package (e.g.
Definition: diff_context.h:55
libMesh::NewmarkSolver::_beta
Real _beta
The value for the to employ.
Definition: newmark_solver.h:167
libMesh::NewmarkSolver::set_beta
void set_beta(Real beta)
Setter for .
Definition: newmark_solver.h:149
libMesh::NewmarkSolver::compute_initial_accel
virtual void compute_initial_accel()
This method uses the specified initial displacement and velocity to compute the initial acceleration ...
Definition: newmark_solver.C:106
libMesh::NewmarkSolver::NewmarkSolver
NewmarkSolver(sys_type &s)
Constructor.
Definition: newmark_solver.C:25
libMesh::NewmarkSolver::advance_timestep
virtual void advance_timestep() override
This method advances the solution to the next timestep, after a solve() has been performed.
Definition: newmark_solver.C:43
libMesh::NewmarkSolver::Parent
UnsteadySolver Parent
The parent class.
Definition: newmark_solver.h:52
libMesh::SecondOrderUnsteadySolver::reinit
virtual void reinit() override
The reinitialization function.
Definition: second_order_unsteady_solver.C:60
libMesh::Real
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Definition: libmesh_common.h:121
libMesh::NewmarkSolver::nonlocal_residual
virtual bool nonlocal_residual(bool request_jacobian, DiffContext &) override
This method uses the DifferentiablePhysics' nonlocal_time_derivative() and nonlocal_constraint() to b...
Definition: newmark_solver.C:191
libMesh::NewmarkSolver::error_order
virtual Real error_order() const override
Error convergence order: 2 for , 1 otherwise.
Definition: newmark_solver.C:36
libMesh::NewmarkSolver::side_residual
virtual bool side_residual(bool request_jacobian, DiffContext &) override
This method uses the DifferentiablePhysics' side_time_derivative() and side_constraint() to build a f...
Definition: newmark_solver.C:177
libMesh::NewmarkSolver::solve
virtual void solve() override
This method solves for the solution at the next timestep.
Definition: newmark_solver.C:148