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

#include <parsed_conductivity.h>

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

Public Member Functions

 ParsedConductivity (const GetPot &input, const std::string &material)
 Constructor with specified material. More...
 
 ParsedConductivity (const GetPot &input)
 Deprecated constructor. More...
 
 ~ParsedConductivity ()
 
- 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...
 

Private Member Functions

 ParsedConductivity ()
 

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 Attributes inherited from GRINS::ParsedPropertyBase
libMesh::ParsedFunction< libMesh::Number > _func
 

Detailed Description

Definition at line 37 of file parsed_conductivity.h.

Constructor & Destructor Documentation

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

Constructor with specified material.

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

Definition at line 53 of file parsed_conductivity.C.

References GRINS::ParsedPropertyBase::_func, GRINS::ParsedPropertyBase::check_func_nonzero(), GRINS::MaterialsParsing::dep_input_warning(), GRINS::MaterialsParsing::duplicate_input_test(), and GRINS::ParameterUser::set_parameter().

55  ParameterUser("ParsedConductivity")
56  {
58  "Materials/"+material+"/ThermalConductivity/value",
59  "Materials/Conductivity/k");
60 
61  std::string conductivity_function;
62 
63  // If we have the new version, we parse that
64  if( input.have_variable("Materials/"+material+"/ThermalConductivity/value") )
65  {
66  this->set_parameter(this->_func, input,
67  "Materials/"+material+"/ThermalConductivity/value",
68  "DIE!");
69 
70  conductivity_function = input("Materials/"+material+"/ThermalConductivity/value",std::string("0"));
71  }
72  // If we have the old DEPRECATED version, use that
73  else if( input.have_variable("Materials/Conductivity/k") )
74  {
75  MaterialsParsing::dep_input_warning( "Materials/Conductivity/k",
76  "ThermalConductivity/value" );
77 
78  this->set_parameter(this->_func, input,
79  "Materials/Conductivity/k",
80  "DIE!");
81 
82  conductivity_function = input("Materials/Conductivity/k",std::string("0"));
83  }
84  // If we don't have either, that's an error
85  else
86  {
87  libmesh_error_msg("Error: Could not find either Materials/"+material+"/ThermalConductivity/value or Materials/Conductivity/k");
88  }
89 
90  if( !this->check_func_nonzero(conductivity_function) )
91  {
92  libmesh_error_msg("ERROR: Detected '0' function for ParsedConductivity!");
93  }
94  }
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.
ParameterUser(const std::string &user_name)
bool check_func_nonzero(const std::string &function) const
Returns true if function string is nonzero.
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::ParsedConductivity::ParsedConductivity ( const GetPot &  input)

Deprecated constructor.

Definition at line 30 of file parsed_conductivity.C.

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

32  ParameterUser("ParsedConductivity")
33  {
34  // Warning about this constructor being deprecated
35  {
36  std::string warning = "WARNING: Use of this constructor is DEPRECATED.\n";
37  warning += " Please update to use constructor with input material name.\n";
38  grins_warning(warning);
39  }
40 
41  this->set_parameter(this->_func, input,
42  "Materials/Conductivity/k",
43  "DIE!");
44 
45  std::string conductivity_function = input("Materials/Conductivity/k",std::string("0"));
46 
47  if( !this->check_func_nonzero(conductivity_function) )
48  {
49  libmesh_error_msg("ERROR: Detected '0' function for ParsedConductivity!");
50  }
51  }
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::ParsedConductivity::~ParsedConductivity ( )

Definition at line 96 of file parsed_conductivity.C.

97  {
98  return;
99  }
GRINS::ParsedConductivity::ParsedConductivity ( )
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