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

#include <parsed_viscosity.h>

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

Public Member Functions

 ParsedViscosity (const GetPot &input, const std::string &material)
 Constructor with specified material. More...
 
 ParsedViscosity (const GetPot &input)
 Deprecated constructor. More...
 
virtual ~ParsedViscosity ()
 
- Public Member Functions inherited from GRINS::ParsedPropertyBase
 ParsedPropertyBase ()
 
virtual ~ParsedPropertyBase ()
 
libMesh::Real operator() (AssemblyContext &context, unsigned int qp) const
 
libMesh::Real operator() (const libMesh::Point &p, const libMesh::Real time)
 
virtual void init (libMesh::FEMSystem *)
 
- 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...
 
- Public Member Functions inherited from GRINS::ViscosityBase
 ViscosityBase ()
 
virtual ~ViscosityBase ()
 

Private Member Functions

 ParsedViscosity ()
 

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...
 
- Protected Member Functions inherited from GRINS::ParsedPropertyBase
bool check_func_nonzero (const std::string &function) const
 Returns true if function string is nonzero. More...
 
- Protected Member Functions inherited from GRINS::ViscosityBase
void check_input_consistency (const GetPot &input, const std::string &material) const
 
void old_mu_warning () const
 
- Protected Attributes inherited from GRINS::ParsedPropertyBase
libMesh::ParsedFunction< libMesh::Number > _func
 

Detailed Description

Definition at line 39 of file parsed_viscosity.h.

Constructor & Destructor Documentation

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

Constructor with specified material.

Will look in the input file for [Materials/material/Viscosity/value] for the value of viscosity.

Definition at line 64 of file parsed_viscosity.C.

References GRINS::ParsedPropertyBase::_func, GRINS::ParsedPropertyBase::check_func_nonzero(), GRINS::ViscosityBase::check_input_consistency(), GRINS::ViscosityBase::old_mu_warning(), and GRINS::ParameterUser::set_parameter().

65  : ParameterUser("ParsedViscosity"),
67  {
68  this->check_input_consistency(input,material);
69 
70  std::string viscosity_function = "0";
71 
72  // If we have the new version, we parse that
73  if( input.have_variable("Materials/"+material+"/Viscosity/value") )
74  {
75  this->set_parameter(this->_func, input,
76  "Materials/"+material+"/Viscosity/value",
77  "DIE!");
78 
79  viscosity_function = input("Materials/"+material+"/Viscosity/value",std::string("0"));
80  }
81  // If we have the old DEPRECATED version, use that
82  else if( input.have_variable("Materials/Viscosity/mu") )
83  {
84  this->old_mu_warning();
85 
86  this->set_parameter(this->_func, input,
87  "Materials/Viscosity/mu",
88  "DIE!");
89 
90  viscosity_function = input("Materials/Viscosity/mu",std::string("0"));
91  }
92  // If we don't have either, that's an error
93  else
94  {
95  libmesh_error_msg("Error: Could not find either Materials/"+material+"/Viscosity/value or Materials/Viscosity/mu");
96  }
97 
98  if( !this->check_func_nonzero(viscosity_function) )
99  {
100  libmesh_error_msg("ERROR: Detected '0' function for ParsedConductivity!");
101  }
102  }
libMesh::ParsedFunction< libMesh::Number > _func
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.
void old_mu_warning() const
ParameterUser(const std::string &user_name)
bool check_func_nonzero(const std::string &function) const
Returns true if function string is nonzero.
void check_input_consistency(const GetPot &input, const std::string &material) const
GRINS::ParsedViscosity::ParsedViscosity ( const GetPot &  input)

Deprecated constructor.

Definition at line 39 of file parsed_viscosity.C.

References GRINS::ParsedPropertyBase::_func, GRINS::ParsedPropertyBase::check_func_nonzero(), grins_warning, and GRINS::ParameterUser::set_parameter().

41  ParameterUser("ParsedViscosity"),
43  {
44 
45  // Warning about this constructor being deprecated
46  {
47  std::string warning = "WARNING: Use of this constructor is DEPRECATED.\n";
48  warning += " Please update to use constructor with input material name.\n";
49  grins_warning(warning);
50  }
51 
52  this->set_parameter(this->_func, input,
53  "Materials/Viscosity/mu",
54  "DIE!");
55 
56  std::string viscosity_function = input("Materials/Viscosity/mu",std::string("0"));
57 
58  if( !this->check_func_nonzero(viscosity_function) )
59  {
60  libmesh_error_msg("ERROR: Detected '0' function for ParsedConductivity!");
61  }
62  }
libMesh::ParsedFunction< libMesh::Number > _func
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)
bool check_func_nonzero(const std::string &function) const
Returns true if function string is nonzero.
GRINS::ParsedViscosity::~ParsedViscosity ( )
virtual

Definition at line 104 of file parsed_viscosity.C.

105  {
106  return;
107  }
GRINS::ParsedViscosity::ParsedViscosity ( )
private

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

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