GRINS-0.8.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-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 #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 #include "libmesh/auto_ptr.h"
38 
39 // libMesh forward declarations
40 namespace libMesh
41 {
42  template <typename Scalar>
44 
45  class FEMSystem;
46 }
47 
48 namespace GRINS
49 {
52  {
53  public:
54 
55  ICHandlingBase(const std::string& physics_name);
56 
57  virtual ~ICHandlingBase();
58 
59  void attach_initial_func( const libMesh::FunctionBase<libMesh::Number>& initial_val );
60 
61  virtual void read_ic_data( const GetPot& input, const std::string& id_str,
62  const std::string& ic_str,
63  const std::string& var_str,
64  const std::string& value_str );
65 
67 
69  virtual void init_ic_data( const libMesh::FEMSystem& system,
71 
72  // User will need to implement these functions for IC handling
73  virtual int string_to_int( const std::string& bc_type_in ) const;
74 
75  virtual void init_ic_types( const libMesh::subdomain_id_type ic_id,
76  const std::string& ic_id_string,
77  const int ic_type,
78  const std::string& ic_vars_string,
79  const std::string& ic_value_string,
80  const GetPot& input );
81 
82  libMesh::FunctionBase<libMesh::Number>* get_ic_func() const;
83 
84  protected:
85 
86  libMesh::UniquePtr<libMesh::FunctionBase<libMesh::Number> > _ic_func;
87 
88  std::string _physics_name;
89 
90  enum IC_BASE{ PARSED = -2,
92 
93  std::vector<std::string> _subfunction_variables;
94  };
95 
96  /* ------------------------- Inline Functions -------------------------*/
97  inline
98  libMesh::FunctionBase<libMesh::Number>*
100  {
101  return _ic_func.get();
102  }
103 }
104 #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 Tue Dec 19 2017 12:47:27 for GRINS-0.8.0 by  doxygen 1.8.9.1