libMesh
euler_solver.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2024 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_EULER_SOLVER_H
21 #define LIBMESH_EULER_SOLVER_H
22 
23 // Local includes
24 #include "libmesh/first_order_unsteady_solver.h"
25 
26 // C++ includes
27 
28 namespace libMesh
29 {
30 
44 {
45 public:
50 
55  explicit
56  EulerSolver (sys_type & s);
57 
61  virtual ~EulerSolver ();
62 
66  virtual Real error_order() const override;
67 
74  virtual bool element_residual (bool request_jacobian,
75  DiffContext &) override;
76 
83  virtual bool side_residual (bool request_jacobian,
84  DiffContext &) override;
85 
92  virtual bool nonlocal_residual (bool request_jacobian,
93  DiffContext &) override;
94 
98  virtual void integrate_qoi_timestep() override;
99 
100 #ifdef LIBMESH_ENABLE_AMR
101 
109  virtual void integrate_adjoint_refinement_error_estimate(AdjointRefinementEstimator & adjoint_refinement_error_estimator, ErrorVector & QoI_elementwise_error) override;
110 #endif // LIBMESH_ENABLE_AMR
111 
118 
119 protected:
120 
125  virtual bool _general_residual (bool request_jacobian,
126  DiffContext &,
127  ResFuncType mass,
128  ResFuncType damping,
129  ResFuncType time_deriv,
130  ResFuncType constraint,
133 };
134 
135 
136 } // namespace libMesh
137 
138 
139 #endif // LIBMESH_EULER_SOLVER_H
virtual void reinit() override
The reinitialization function.
virtual bool nonlocal_residual(bool request_jacobian, DiffContext &) override
This method uses the DifferentiablePhysics' nonlocal_time_derivative() and nonlocal_constraint() to b...
Definition: euler_solver.C:85
virtual ~EulerSolver()
Destructor.
bool compute_second_order_eqns(bool compute_jacobian, DiffContext &c)
If there are second order variables, then we need to compute their residual equations and correspondi...
This class provides all data required for a physics package (e.g.
Definition: diff_context.h:55
virtual void integrate_qoi_timestep() override
A method to integrate the system::QoI functionals.
Definition: euler_solver.C:196
This class implements a "brute force" goal-oriented error estimator which computes an estimate of err...
The ErrorVector is a specialization of the StatisticsVector for error data computed on a finite eleme...
Definition: error_vector.h:50
Real theta
The value for the theta method to employ: 1.0 corresponds to backwards Euler, 0.0 corresponds to forw...
Definition: euler_solver.h:117
virtual bool element_residual(bool request_jacobian, DiffContext &) override
This method uses the DifferentiablePhysics' element_time_derivative() and element_constraint() to bui...
Definition: euler_solver.C:53
virtual bool _general_residual(bool request_jacobian, DiffContext &, ResFuncType mass, ResFuncType damping, ResFuncType time_deriv, ResFuncType constraint, ReinitFuncType reinit, bool compute_second_order_eqns)
This method is the underlying implementation of the public residual methods.
Definition: euler_solver.C:102
The libMesh namespace provides an interface to certain functionality in the library.
void(DiffContext::* ReinitFuncType)(Real)
Definition: time_solver.h:327
virtual void integrate_adjoint_refinement_error_estimate(AdjointRefinementEstimator &adjoint_refinement_error_estimator, ErrorVector &QoI_elementwise_error) override
A method to compute the adjoint refinement error estimate at the current timestep.
Definition: euler_solver.C:254
This class provides a specific system class.
Definition: diff_system.h:54
Generic class from which first order UnsteadySolvers should subclass.
virtual Real error_order() const override
Error convergence order: 2 for Crank-Nicolson, 1 otherwise.
Definition: euler_solver.C:43
bool(DifferentiablePhysics::* ResFuncType)(bool, DiffContext &)
Definitions of argument types for use in refactoring subclasses.
Definition: time_solver.h:325
FirstOrderUnsteadySolver Parent
The parent class.
Definition: euler_solver.h:49
This class defines a theta-method Euler (defaulting to Backward Euler with theta = 1...
Definition: euler_solver.h:43
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: euler_solver.C:70
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
EulerSolver(sys_type &s)
Constructor.
Definition: euler_solver.C:32