GRINS-0.8.0
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
GRINS::ParsedPropertyBase Class Reference

Base class for material properties based on ParsedFunction. More...

#include <parsed_property_base.h>

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

Public Member Functions

 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 *)
 

Protected Member Functions

bool check_func_nonzero (const std::string &function) const
 Returns true if function string is nonzero. More...
 

Protected Attributes

libMesh::ParsedFunction< libMesh::Number > _func
 

Detailed Description

Base class for material properties based on ParsedFunction.

This class contains the basic interface and functionality. Subclasses should only need to handle the parsing of the function-string and create the ParsedFunction in the local _func variable.

Definition at line 47 of file parsed_property_base.h.

Constructor & Destructor Documentation

GRINS::ParsedPropertyBase::ParsedPropertyBase ( )
inline

Definition at line 51 of file parsed_property_base.h.

51 : _func("") {};
libMesh::ParsedFunction< libMesh::Number > _func
virtual GRINS::ParsedPropertyBase::~ParsedPropertyBase ( )
inlinevirtual

Definition at line 52 of file parsed_property_base.h.

52 {};

Member Function Documentation

bool GRINS::ParsedPropertyBase::check_func_nonzero ( const std::string &  function) const
protected

Returns true if function string is nonzero.

The ParsedFunction used is built through a string argument. This function checks if the string is "0". This is useful for cases where the function must not be zero.

Definition at line 30 of file parsed_property_base.C.

Referenced by GRINS::ParsedConductivity::ParsedConductivity(), and GRINS::ParsedViscosity::ParsedViscosity().

31  {
32  bool is_nonzero = true;
33 
34  if (function == std::string("0"))
35  {
36  is_nonzero = false;
37  }
38 
39  return is_nonzero;
40  }
virtual void GRINS::ParsedPropertyBase::init ( libMesh::FEMSystem *  )
inlinevirtual

Definition at line 58 of file parsed_property_base.h.

58 {};
libMesh::Real GRINS::ParsedPropertyBase::operator() ( AssemblyContext context,
unsigned int  qp 
) const
inline

Definition at line 75 of file parsed_property_base.h.

References _func.

76  {
77  // FIXME: We should be getting the variable index to get the qps from the context
78  // not hardcode it to be 0
79  const std::vector<libMesh::Point>& x = context.get_element_fe(0)->get_xyz();
80 
81  const libMesh::Point& x_qp = x[qp];
82 
83  // libMesh API here sucks - RHS
86  libMesh::Number value = mutable_func(x_qp,context.time);
87 
88  return value;
89  }
libMesh::ParsedFunction< libMesh::Number > _func
libMesh::Real GRINS::ParsedPropertyBase::operator() ( const libMesh::Point &  p,
const libMesh::Real  time 
)
inline

Definition at line 92 of file parsed_property_base.h.

References _func.

93  {
94  return _func(p,time);
95  }
libMesh::ParsedFunction< libMesh::Number > _func

Member Data Documentation

libMesh::ParsedFunction<libMesh::Number> GRINS::ParsedPropertyBase::_func
protected

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