GRINS-0.8.0
List of all members | Public Member Functions | Private Member Functions | Private Attributes
GRINS::ConstantSpecificHeat Class Reference

#include <constant_specific_heat.h>

Inheritance diagram for GRINS::ConstantSpecificHeat:
Inheritance graph
[legend]
Collaboration diagram for GRINS::ConstantSpecificHeat:
Collaboration graph
[legend]

Public Member Functions

 ConstantSpecificHeat (const GetPot &input, const std::string &material)
 Constructor with specified material. More...
 
 ConstantSpecificHeat (const GetPot &input)
 Deprecated constructor. More...
 
virtual ~ConstantSpecificHeat ()
 
libMesh::Real operator() () const
 
libMesh::Real operator() (const libMesh::Real T) const
 
libMesh::Real deriv (const libMesh::Real T) const
 
- Public Member Functions inherited from GRINS::ParameterUser
 ParameterUser (const std::string &user_name)
 
virtual ~ParameterUser ()
 
virtual void set_parameter (libMesh::Number &param_variable, const GetPot &input, const std::string &param_name, libMesh::Number param_default)
 Each subclass can simultaneously read a parameter value from. More...
 
virtual void set_parameter (libMesh::ParsedFunction< libMesh::Number, libMesh::Gradient > &func, const GetPot &input, const std::string &func_param_name, const std::string &param_default)
 Each subclass can simultaneously read a parsed function from. More...
 
virtual void set_parameter (libMesh::ParsedFEMFunction< libMesh::Number > &func, const GetPot &input, const std::string &func_param_name, const std::string &param_default)
 Each subclass can simultaneously read a parsed function from. More...
 
virtual void move_parameter (const libMesh::Number &old_parameter, libMesh::Number &new_parameter)
 When cloning an object, we need to update parameter pointers. More...
 
virtual void move_parameter (const libMesh::ParsedFunction< libMesh::Number, libMesh::Gradient > &old_func, libMesh::ParsedFunction< libMesh::Number, libMesh::Gradient > &new_func)
 When cloning an object, we need to update parameter pointers. More...
 
virtual void move_parameter (const libMesh::ParsedFEMFunction< libMesh::Number > &old_func, libMesh::ParsedFEMFunction< libMesh::Number > &new_func)
 When cloning an object, we need to update parameter pointers. More...
 
virtual void register_parameter (const std::string &param_name, libMesh::ParameterMultiAccessor< libMesh::Number > &param_pointer) const
 Each subclass will register its copy of an independent. More...
 

Private Member Functions

 ConstantSpecificHeat ()
 

Private Attributes

libMesh::Real _cp
 

Additional Inherited Members

- Static Public Attributes inherited from GRINS::ParameterUser
static std::string zero_vector_function = std::string("{0}")
 A parseable function string with LIBMESH_DIM components, all 0. More...
 

Detailed Description

Definition at line 39 of file constant_specific_heat.h.

Constructor & Destructor Documentation

GRINS::ConstantSpecificHeat::ConstantSpecificHeat ( const GetPot &  input,
const std::string &  material 
)

Constructor with specified material.

Will look in the input file for [Materials/material/SpecificHeat/value] for the value of specific heat.

Definition at line 60 of file constant_specific_heat.C.

References _cp, GRINS::MaterialsParsing::dep_input_warning(), GRINS::MaterialsParsing::duplicate_input_test(), and GRINS::ParameterUser::set_parameter().

62  : ParameterUser("ConstantSpecificHeat"),
63  _cp(0.0)
64  {
65  // It's an error to have both the old and new version
67  "Materials/"+material+"/SpecificHeat/value",
68  "Materials/SpecificHeat/cp");
69 
70  // If we have the "new" version, then parse it
71  if( input.have_variable("Materials/"+material+"/SpecificHeat/value") )
72  {
73  this->set_parameter
74  (_cp, input, "Materials/"+material+"/SpecificHeat/value", _cp);
75  }
76  // If instead we have the old version, use that.
77  else if( input.have_variable("Materials/SpecificHeat/cp") )
78  {
79  MaterialsParsing::dep_input_warning( "Materials/SpecificHeat/cp",
80  "SpecificHeat/value" );
81 
82  this->set_parameter
83  (_cp, input, "Materials/SpecificHeat/cp", _cp);
84  }
85  else
86  {
87  libmesh_error_msg("ERROR: Could not find valid input for ConstantSpecificHeat! Please set Materials/"+material+"/SpecificHeat/value");
88  }
89  }
virtual void set_parameter(libMesh::Number &param_variable, const GetPot &input, const std::string &param_name, libMesh::Number param_default)
Each subclass can simultaneously read a parameter value from.
ParameterUser(const std::string &user_name)
static void dep_input_warning(const std::string &old_option, const std::string &property)
Helper function for parsing/maintaing backward compatibility.
static void duplicate_input_test(const GetPot &input, const std::string &option1, const std::string &option2)
Helper function for parsing/maintaing backward compatibility.
GRINS::ConstantSpecificHeat::ConstantSpecificHeat ( const GetPot &  input)

Deprecated constructor.

Definition at line 39 of file constant_specific_heat.C.

References _cp, grins_warning, and GRINS::ParameterUser::set_parameter().

40  : ParameterUser("ConstantSpecificHeat"),
41  _cp(0.0)
42  {
43  // Warning about this constructor being deprecated
44  {
45  std::string warning = "WARNING: Use of this constructor is DEPRECATED.\n";
46  warning += " Please update to use constructor with input material name.\n";
47  grins_warning(warning);
48  }
49 
50  if( !input.have_variable("Materials/SpecificHeat/cp") )
51  {
52  std::cerr << "Error: Must specify cp value for constant specific heat model!" << std::endl;
53  libmesh_error();
54  }
55 
56  this->set_parameter
57  (_cp, input, "Materials/SpecificHeat/cp", _cp);
58  }
virtual void set_parameter(libMesh::Number &param_variable, const GetPot &input, const std::string &param_name, libMesh::Number param_default)
Each subclass can simultaneously read a parameter value from.
#define grins_warning(message)
Definition: common.h:34
ParameterUser(const std::string &user_name)
GRINS::ConstantSpecificHeat::~ConstantSpecificHeat ( )
virtual

Definition at line 91 of file constant_specific_heat.C.

92  {
93  return;
94  }
GRINS::ConstantSpecificHeat::ConstantSpecificHeat ( )
private

Member Function Documentation

libMesh::Real GRINS::ConstantSpecificHeat::deriv ( const libMesh::Real  T) const
inline

Definition at line 80 of file constant_specific_heat.h.

81  {
82  return 0.0;
83  }
libMesh::Real GRINS::ConstantSpecificHeat::operator() ( ) const
inline

Definition at line 68 of file constant_specific_heat.h.

References _cp.

69  {
70  return _cp;
71  }
libMesh::Real GRINS::ConstantSpecificHeat::operator() ( const libMesh::Real  T) const
inline

Definition at line 74 of file constant_specific_heat.h.

75  {
76  return (*this)();
77  }

Member Data Documentation

libMesh::Real GRINS::ConstantSpecificHeat::_cp
private

Definition at line 62 of file constant_specific_heat.h.

Referenced by ConstantSpecificHeat(), and operator()().


The documentation for this class was generated from the following files:

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