GRINS-0.8.0
neumann_bc_function_base.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 #ifndef GRINS_NEUMANN_BC_FUNCTION_BASE_H
26 #define GRINS_NEUMANN_BC_FUNCTION_BASE_H
27 
28 // GRINS
30 #include "grins/var_typedefs.h"
31 #include "grins/assembly_context.h"
32 
33 // libMesh
34 #include "libmesh/auto_ptr.h" // UniquePtr
35 #include "libmesh/point.h"
36 #include "libmesh/function_base.h"
37 #include "libmesh/fem_function_base.h"
38 
39 namespace GRINS
40 {
41  template<typename FunctionType, typename FEShape>
43  {
44  public:
45 
49  _vars(1,var)
50  {}
51 
53 
56  NeumannBCFunctionBase( const std::vector<VariableIndex>& vars )
58  _vars(vars)
59  {}
60 
62 
63  virtual bool eval_flux( bool compute_jacobian,
64  AssemblyContext& context,
65  libMesh::Real sign,
66  bool is_axisymmetric );
67 
68  protected:
69 
71  FEShape eval_func( AssemblyContext& context, const libMesh::Point& point,
72  libMesh::Real time, unsigned int component,
73  libMesh::FEMFunctionBase<FEShape>& func )
74  {
75  return func.component(context,component,point,time);
76  }
77 
79  FEShape eval_func( AssemblyContext& /*context*/, const libMesh::Point& point,
80  libMesh::Real time, unsigned int component,
81  libMesh::FunctionBase<FEShape>& func )
82  {
83  return func.component(component,point,time);
84  }
85 
87 
90  std::vector<VariableIndex> _vars;
91 
93 
95  libMesh::UniquePtr<FunctionType> _func;
96 
97  };
98 
99 } // end namespace GRINS
100 
101 #endif // GRINS_NEUMANN_BC_FUNCTION_BASE_H
unsigned int VariableIndex
More descriptive name of the type used for variable indices.
Definition: var_typedefs.h:42
std::vector< VariableIndex > _vars
Variable indices for the variables whose Neumann contribution we're computing.
GRINS namespace.
NeumannBCFunctionBase(const std::vector< VariableIndex > &vars)
Constructor for function with several variables.
FEShape eval_func(AssemblyContext &, const libMesh::Point &point, libMesh::Real time, unsigned int component, libMesh::FunctionBase< FEShape > &func)
Helper function to dispatch to FunctionBase API.
virtual bool eval_flux(bool compute_jacobian, AssemblyContext &context, libMesh::Real sign, bool is_axisymmetric)
FEShape eval_func(AssemblyContext &context, const libMesh::Point &point, libMesh::Real time, unsigned int component, libMesh::FEMFunctionBase< FEShape > &func)
Helper function to dispatch to FEMFunctionBase API.
libMesh::UniquePtr< FunctionType > _func
Function object for the actual Neumann flux.
NeumannBCFunctionBase(VariableIndex var)
Constructor for function with only one variable.

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