GRINS-0.8.0
scalar_ode.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // GRINS - General Reacting Incompressible Navier-Stokes
5 //
6 // Copyright (C) 2014-2017 Paul T. Bauman, Roy H. Stogner
7 // Copyright (C) 2010-2013 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 
26 #ifndef GRINS_SCALAR_ODE_H
27 #define GRINS_SCALAR_ODE_H
28 
29 // GRINS
30 #include "grins_config.h"
31 #include "grins/assembly_context.h"
32 #include "grins/cached_values.h"
34 
35 
36 // libMesh
37 #include "libmesh/fem_system.h"
38 #include "libmesh/getpot.h"
39 
40 // C++
41 #include <string>
42 
43 namespace GRINS
44 {
45 
47  /*
48  This physics class allows ODEs specified in ParsedFEMFunction
49  config file arguments to be solved.
50  */
51  class ScalarODE : public Physics
52  {
53  public:
54 
55  ScalarODE( const std::string& physics_name, const GetPot& input );
56 
58 
60  virtual void set_time_evolving_vars( libMesh::FEMSystem * system );
61 
63  virtual void init_context( AssemblyContext & context );
64 
65  // residual and jacobian calculations
66 
67  // User-specified ODE(s)
68  virtual void nonlocal_time_derivative ( bool compute_jacobian,
69  AssemblyContext & context );
70 
71  // User-specified constraint equation
72  virtual void nonlocal_constraint ( bool compute_jacobian,
73  AssemblyContext & context );
74 
75  // User-specified (or default "s'") mass term
76  virtual void nonlocal_mass_residual ( bool compute_jacobian,
77  AssemblyContext & context );
78 
80  { return _var.var(); }
81 
82  private:
83 
84  // ParsedFEMFunctions evaluating the mass, time derivative, and
85  // constraint components of an ODE.
86  libMesh::UniquePtr<libMesh::FEMFunctionBase<libMesh::Number> >
90 
91  // Perturbation to use for finite differencing of functions
92  libMesh::Number _epsilon;
93 
94  const GetPot & _input;
95 
97 
98  ScalarODE();
99 
101  void read_input_options( const GetPot& input );
102  };
103 
104 } // end namespace block
105 
106 #endif // GRINS_SCALAR_ODE_H
Physics class for arbitrary scalar-valued ODEs.
Definition: scalar_ode.h:51
unsigned int VariableIndex
More descriptive name of the type used for variable indices.
Definition: var_typedefs.h:42
const GetPot & _input
Definition: scalar_ode.h:94
Physics abstract base class. Defines API for physics to be added to MultiphysicsSystem.
Definition: physics.h:106
libMesh::UniquePtr< libMesh::FEMFunctionBase< libMesh::Number > > mass_residual_function
Definition: scalar_ode.h:87
virtual void nonlocal_mass_residual(bool compute_jacobian, AssemblyContext &context)
Mass matrix part(s) for scalar variables.
Definition: scalar_ode.C:151
VariableIndex var() const
void read_input_options(const GetPot &input)
Read options from GetPot input file.
Definition: scalar_ode.C:91
virtual void init_context(AssemblyContext &context)
Prepare the context for evaluations.
Definition: scalar_ode.C:97
GRINS namespace.
virtual void nonlocal_time_derivative(bool compute_jacobian, AssemblyContext &context)
Time dependent part(s) of physics for scalar variables.
Definition: scalar_ode.C:106
libMesh::Number _epsilon
Definition: scalar_ode.h:92
virtual void set_time_evolving_vars(libMesh::FEMSystem *system)
Sets scalar variable(s) to be time-evolving.
Definition: scalar_ode.C:51
ScalarVariable & _var
Definition: scalar_ode.h:96
virtual void nonlocal_constraint(bool compute_jacobian, AssemblyContext &context)
Constraint part(s) of physics for scalar variables.
Definition: scalar_ode.C:196
Variables with a single SCALAR component.
libMesh::UniquePtr< libMesh::FEMFunctionBase< libMesh::Number > > time_deriv_function
Definition: scalar_ode.h:87
VariableIndex scalar_ode_var() const
Definition: scalar_ode.h:79
libMesh::UniquePtr< libMesh::FEMFunctionBase< libMesh::Number > > constraint_function
Definition: scalar_ode.h:87

Generated on Tue Dec 19 2017 12:47:28 for GRINS-0.8.0 by  doxygen 1.8.9.1