GRINS-0.7.0
constant_function_dirichlet_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-2016 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_CONSTANT_FUNCTION_DIRICHLET_BC_FACTORY_H
26 #define GRINS_CONSTANT_FUNCTION_DIRICHLET_BC_FACTORY_H
27 
28 // GRINS
31 
32 // libMesh
33 #include "libmesh/function_base.h"
34 
35 namespace GRINS
36 {
37  // Foward declarations
38  class SpeciesMassFractionsFEVariables;
39 
41  class ConstantFunctionDirichletBCFactory : public DirichletBCFactoryFunctionBase<libMesh::FunctionBase<libMesh::Number> >,
42  public ParsedFunctionFactoryHelper<libMesh::FunctionBase<libMesh::Number> >
43  {
44  public:
45 
46  ConstantFunctionDirichletBCFactory( const std::string& bc_type_name )
47  : DirichletBCFactoryFunctionBase<libMesh::FunctionBase<libMesh::Number> >(bc_type_name),
48  ParsedFunctionFactoryHelper<libMesh::FunctionBase<libMesh::Number> >()
49  {}
50 
52 
53  protected:
55 
62  virtual libMesh::UniquePtr<libMesh::FunctionBase<libMesh::Number> >
63  build_func( const GetPot& input,
64  MultiphysicsSystem& system,
65  std::vector<std::string>& var_names,
66  const std::string& section );
67 
69 
73  virtual void add_found_vars(const GetPot& input,
74  MultiphysicsSystem& system,
75  const std::string& section,
76  const std::set<std::string>& vars_found,
78  std::set<std::string>& vars_added) const;
79 
81 
85  virtual void set_vars_to_search_for( const std::vector<std::string>& var_names,
86  std::vector<std::string>& vars_to_search_for ) const
87  { libmesh_assert_equal_to(var_names.size(),vars_to_search_for.size());
88  vars_to_search_for = var_names; }
89 
90  };
91 
93 
95  {
96  public:
97  MoleFractionsDirichletBCFactory( const std::string& bc_type_name )
99  {}
100 
102 
103  protected:
104 
106 
109  virtual void add_found_vars(const GetPot& input,
110  MultiphysicsSystem& system,
111  const std::string& section,
112  const std::set<std::string>& vars_found,
114  std::set<std::string>& vars_added) const;
115 
117 
119  virtual void set_vars_to_search_for( const std::vector<std::string>& var_names,
120  std::vector<std::string>&vars_to_search_for ) const;
121 
122  template<typename ChemistryType>
123  void add_mole_frac_to_mass_frac(const GetPot& input,
124  const std::string& section,
125  const std::set<std::string>& vars_found,
126  const std::string& material,
127  const SpeciesMassFractionsFEVariables& species_fe_var,
129  std::set<std::string>& vars_added) const;
130 
131  void extract_species_name( const std::string& var_name,
132  const std::string& prefix,
133  std::string& species_name ) const;
134 
135  };
136 
137 } // end namespace GRINS
138 
139 #endif // GRINS_CONSTANT_FUNCTION_DIRICHLET_BC_FACTORY_H
virtual void set_vars_to_search_for(const std::vector< std::string > &var_names, std::vector< std::string > &vars_to_search_for) const
We'll search for mole fractions: X_.
virtual void add_found_vars(const GetPot &input, MultiphysicsSystem &system, const std::string &section, const std::set< std::string > &vars_found, libMesh::CompositeFunction< libMesh::Number > &composite_func, std::set< std::string > &vars_added) const
Adds the vars_found to the composite_func.
void add_mole_frac_to_mass_frac(const GetPot &input, const std::string &section, const std::set< std::string > &vars_found, const std::string &material, const SpeciesMassFractionsFEVariables &species_fe_var, libMesh::CompositeFunction< libMesh::Number > &composite_func, std::set< std::string > &vars_added) const
virtual void set_vars_to_search_for(const std::vector< std::string > &var_names, std::vector< std::string > &vars_to_search_for) const
Set the vars_to_search_for, based on var_names.
GRINS namespace.
Constructs ConstFunction objects for Dirichlet boundary conditions.
void extract_species_name(const std::string &var_name, const std::string &prefix, std::string &species_name) const
Parses mole fraction values and converts to mass fractions.
Interface with libMesh for solving Multiphysics problems.
virtual libMesh::UniquePtr< libMesh::FunctionBase< libMesh::Number > > build_func(const GetPot &input, MultiphysicsSystem &system, std::vector< std::string > &var_names, const std::string &section)
Builds ConstantFunction objects for boundary conditions.
virtual void add_found_vars(const GetPot &input, MultiphysicsSystem &system, const std::string &section, const std::set< std::string > &vars_found, libMesh::CompositeFunction< libMesh::Number > &composite_func, std::set< std::string > &vars_added) const
Here, we're expected vars_found to correspond to mole fractions and we'll add mass fractions...
MoleFractionsDirichletBCFactory(const std::string &bc_type_name)

Generated on Thu Jun 2 2016 21:52:27 for GRINS-0.7.0 by  doxygen 1.8.10