GRINS-0.8.0
physics_factory_heat_transfer.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_PHYSICS_FACTORY_HEAT_TRANSFER_H
26 #define GRINS_PHYSICS_FACTORY_HEAT_TRANSFER_H
27 
28 // GRINS
33 
34 namespace GRINS
35 {
36  template<template<typename> class DerivedPhysics>
38  {
39  public:
40  PhysicsFactoryHeatTransfer( const std::string& physics_name,
41  const std::string& core_physics_name )
42  : PhysicsFactoryWithCore(physics_name,core_physics_name)
43  {}
44 
46 
47  protected:
48 
49  virtual libMesh::UniquePtr<Physics> build_physics( const GetPot& input,
50  const std::string& physics_name );
51 
52  void cond_error_msg( const std::string& physics, const std::string& conductivity ) const;
53 
54  };
55 
56  template<template<typename> class DerivedPhysics>
57  inline
58  libMesh::UniquePtr<Physics>
60  ( const GetPot& input, const std::string& physics_name )
61  {
62  std::string core_physics = this->find_core_physics_name(physics_name);
63 
64  std::string conductivity;
65  PhysicsFactoryHelper::parse_conductivity_model(input,core_physics,conductivity);
66 
67  libMesh::UniquePtr<Physics> new_physics;
68 
69  if( conductivity == "constant" )
70  new_physics.reset( new DerivedPhysics<ConstantConductivity>(physics_name,input) );
71 
72  else if( conductivity == "parsed" )
73  new_physics.reset( new DerivedPhysics<ParsedConductivity>(physics_name,input) );
74 
75  else
76  this->cond_error_msg(physics_name, conductivity);
77 
78  libmesh_assert(new_physics);
79 
80  return new_physics;
81  }
82 
83  template<template<typename> class DerivedPhysics>
84  inline
86  const std::string& conductivity ) const
87  {
88  std::string error = "================================================================\n";
89  error += "Invalid conductivity model for "+physics+"\n";
90  error += "Conductivity model = "+conductivity+"\n";
91  error += "================================================================\n";
92 
93  libmesh_error_msg(error);
94  }
95 
96 } // end namespace GRINS
97 
98 #endif // GRINS_PHYSICS_FACTORY_HEAT_TRANSFER_H
PhysicsFactoryHeatTransfer(const std::string &physics_name, const std::string &core_physics_name)
virtual libMesh::UniquePtr< Physics > build_physics(const GetPot &input, const std::string &physics_name)
void cond_error_msg(const std::string &physics, const std::string &conductivity) const
PhysicsFactory base class for Physics that may have a related "core" Physics.
GRINS namespace.
static void parse_conductivity_model(const GetPot &input, const std::string &physics, std::string &model)
Determine conductivity model based on given physics name.

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