GRINS-0.8.0
parsed_function_neumann_bc_factory.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_PARSED_FUNCTION_NEUMANN_BC_FACTORY_H
26 #define GRINS_PARSED_FUNCTION_NEUMANN_BC_FACTORY_H
27 
28 // GRINS
32 
33 namespace GRINS
34 {
35  template<typename FunctionType>
37  public ParsedFunctionNeumannBCFactoryHelper<FunctionType>
38  {
39  public:
40 
41  ParsedFunctionNeumannBCFactory( const std::string& bc_type_name )
42  : NeumannBCFactoryAbstract(bc_type_name),
44  {}
45 
47 
48  protected:
49 
50  virtual SharedPtr<NeumannBCAbstract>
51  build_neumann_func( const GetPot& input,
52  MultiphysicsSystem& system,
53  const FEVariablesBase& fe_var,
54  const std::string& section )
55  {
56  std::string flux_input = this->flux_input(section);
57 
58  // Make sure flux input specified and consistent with var_names size
59  this->check_for_flux(input,flux_input,fe_var.active_var_names());
60 
61  return this->build_neumman_func_common( input, system, fe_var, flux_input );
62  }
63 
64  virtual std::string flux_input(const std::string& section ) const
65  { return section+"/"+BoundaryConditionNames::bc_flux_var(); }
66 
67  };
68 
69  template<typename FunctionType>
71  {
72  public:
73  ParsedTractionBCFactory( const std::string& bc_type_name )
74  : ParsedFunctionNeumannBCFactory<FunctionType>(bc_type_name)
75  {}
76 
78 
79  protected:
80 
81  virtual std::string flux_input(const std::string& section ) const
82  { return section+"/"+BoundaryConditionNames::traction_var(); }
83 
84  };
85 
86 } // end namespace GRINS
87 
88 #endif // GRINS_PARSED_FUNCTION_NEUMANN_BC_FACTORY_H
static std::string bc_flux_var()
"Standard" input variable for Neumann flux in input file
ParsedFunctionNeumannBCFactory(const std::string &bc_type_name)
GRINS namespace.
static std::string traction_var()
Input variable for tractions in input file.
void check_for_flux(const GetPot &input, const std::string &section, const std::vector< std::string > &var_names)
Checks that the flux variable has been set.
SharedPtr< NeumannBCAbstract > build_neumman_func_common(const GetPot &input, MultiphysicsSystem &system, const FEVariablesBase &fe_var, const std::string &flux_input)
Helper function containing common code.
Interface with libMesh for solving Multiphysics problems.
virtual std::string flux_input(const std::string &section) const
virtual SharedPtr< NeumannBCAbstract > build_neumann_func(const GetPot &input, MultiphysicsSystem &system, const FEVariablesBase &fe_var, const std::string &section)
Builds the NeumannBCAbstract object for Neumann boundary conditions.
const std::vector< std::string > & active_var_names() const
Return the var names that are active from this class.
ParsedTractionBCFactory(const std::string &bc_type_name)
virtual std::string flux_input(const std::string &section) const

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