GRINS-0.7.0
ic_handling_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-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 #ifndef GRINS_IC_HANDLING_BASE_H
25 #define GRINS_IC_HANDLING_BASE_H
26 
27 //GRINS
29 #include "grins/var_typedefs.h"
30 #include "grins/cached_values.h"
31 
32 //libMesh
33 #include "libmesh/libmesh.h"
34 #include "libmesh/getpot.h"
35 #include "libmesh/point.h"
36 #include "libmesh/function_base.h"
37 
38 // libMesh forward declarations
39 namespace libMesh
40 {
41  template <typename Scalar>
43 
44  class FEMSystem;
45 }
46 
47 namespace GRINS
48 {
51  {
52  public:
53 
54  ICHandlingBase(const std::string& physics_name);
55 
56  virtual ~ICHandlingBase();
57 
58  void attach_initial_func( const libMesh::FunctionBase<libMesh::Number>& initial_val );
59 
60  virtual void read_ic_data( const GetPot& input, const std::string& id_str,
61  const std::string& ic_str,
62  const std::string& var_str,
63  const std::string& value_str );
64 
66 
68  virtual void init_ic_data( const libMesh::FEMSystem& system,
70 
71  // User will need to implement these functions for IC handling
72  virtual int string_to_int( const std::string& bc_type_in ) const;
73 
74  virtual void init_ic_types( const libMesh::subdomain_id_type ic_id,
75  const std::string& ic_id_string,
76  const int ic_type,
77  const std::string& ic_vars_string,
78  const std::string& ic_value_string,
79  const GetPot& input );
80 
81  libMesh::FunctionBase<libMesh::Number>* get_ic_func() const;
82 
83  protected:
84 
85  libMesh::UniquePtr<libMesh::FunctionBase<libMesh::Number> > _ic_func;
86 
87  std::string _physics_name;
88 
89  enum IC_BASE{ PARSED = -2,
91 
92  std::vector<std::string> _subfunction_variables;
93  };
94 
95  /* ------------------------- Inline Functions -------------------------*/
96  inline
97  libMesh::FunctionBase<libMesh::Number>*
99  {
100  return _ic_func.get();
101  }
102 }
103 #endif // GRINS_BC_HANDLING_BASE
void attach_initial_func(const libMesh::FunctionBase< libMesh::Number > &initial_val)
libMesh::FunctionBase< libMesh::Number > * get_ic_func() const
GRINS namespace.
virtual void init_ic_types(const libMesh::subdomain_id_type ic_id, const std::string &ic_id_string, const int ic_type, const std::string &ic_vars_string, const std::string &ic_value_string, const GetPot &input)
ICHandlingBase(const std::string &physics_name)
virtual void read_ic_data(const GetPot &input, const std::string &id_str, const std::string &ic_str, const std::string &var_str, const std::string &value_str)
virtual int string_to_int(const std::string &bc_type_in) const
Base class for reading and handling initial conditions for physics classes.
std::vector< std::string > _subfunction_variables
virtual void init_ic_data(const libMesh::FEMSystem &system, libMesh::CompositeFunction< libMesh::Number > &all_ics)
Override this method to initialize any system-dependent data.
libMesh::UniquePtr< libMesh::FunctionBase< libMesh::Number > > _ic_func

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