libMesh
Loading...
Searching...
No Matches
newmark_solver.h
Go to the documentation of this file.
1// The libMesh Finite Element Library.
2// Copyright (C) 2002-2026 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
26namespace libMesh
27{
47{
48public:
53
58 explicit
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
160protected:
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
This class provides all data required for a physics package (e.g.
This class provides a specific system class.
Definition diff_system.h:57
Base class for functors that can be evaluated at a point and (optionally) time.
This class defines a Newmark time integrator for second order (in time) DifferentiableSystems.
virtual void adjoint_advance_timestep() override
This method advances the adjoint solution to the previous timestep, after an adjoint_solve() has been...
UnsteadySolver Parent
The parent class.
bool _is_accel_solve
Need to be able to indicate to _general_residual if we are doing an acceleration solve or not.
virtual ~NewmarkSolver()
Destructor.
virtual bool side_residual(bool request_jacobian, DiffContext &) override
This method uses the DifferentiablePhysics' side_time_derivative() and side_constraint() to build a f...
virtual bool nonlocal_residual(bool request_jacobian, DiffContext &) override
This method uses the DifferentiablePhysics' nonlocal_time_derivative() and nonlocal_constraint() to b...
void project_initial_accel(FunctionBase< Number > *f, FunctionBase< Gradient > *g=nullptr)
Specify non-zero initial acceleration.
void set_gamma(Real gamma)
Setter for .
Real _gamma
The value for to employ.
Real _beta
The value for the to employ.
virtual void solve() override
This method solves for the solution at the next timestep.
bool _initial_accel_set
This method requires an initial acceleration.
virtual void compute_initial_accel()
This method uses the specified initial displacement and velocity to compute the initial acceleration ...
void set_beta(Real beta)
Setter for .
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 advance_timestep() override
This method advances the solution to the next timestep, after a solve() has been performed.
virtual Real error_order() const override
Error convergence order: 2 for , 1 otherwise.
void set_initial_accel_avail(bool initial_accel_set)
Allow the user to (re)set whether the initial acceleration is available.
virtual bool element_residual(bool request_jacobian, DiffContext &) override
This method uses the DifferentiablePhysics' element_time_derivative() and element_constraint() to bui...
Generic class from which second order UnsteadySolvers should subclass.
virtual void reinit() override
The reinitialization function.
void(DiffContext::* ReinitFuncType)(Real)
bool(DifferentiablePhysics::* ResFuncType)(bool, DiffContext &)
Definitions of argument types for use in refactoring subclasses.
This is a generic class that defines a solver to handle time integration of DifferentiableSystems.
The libMesh namespace provides an interface to certain functionality in the library.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real