www.mooseframework.org
Classes | Functions
MaterialProperty.h File Reference

Go to the source code of this file.

Classes

class  PropertyValue
 Abstract definition of a property value. More...
 
class  MaterialProperty< T >
 Concrete definition of a parameter value for a specified type. More...
 
class  MaterialProperties
 Container for storing material properties. More...
 

Functions

template<typename P >
PropertyValue_init_helper (int size, PropertyValue *prop, const P *the_type)
 Scalar Init helper routine so that specialization isn't needed for basic scalar MaterialProperty types. More...
 
template<typename P >
PropertyValue_init_helper (int size, PropertyValue *prop, const std::vector< P > *the_type)
 Vector Init helper routine so that specialization isn't needed for basic vector MaterialProperty types. More...
 
template<>
void dataStore (std::ostream &stream, PropertyValue *&p, void *)
 
template<>
void dataLoad (std::istream &stream, PropertyValue *&p, void *)
 
template<>
void dataStore (std::ostream &stream, MaterialProperties &v, void *context)
 
template<>
void dataLoad (std::istream &stream, MaterialProperties &v, void *context)
 

Function Documentation

template<typename P >
PropertyValue * _init_helper ( int  size,
PropertyValue prop,
const P *  the_type 
)

Scalar Init helper routine so that specialization isn't needed for basic scalar MaterialProperty types.

Friend helper function to handle scalar material property initializations.

Parameters
size- the size corresponding to the quadrature rule
prop- The Material property that we will resize since this is not a member
the_type- This is just a template parameter used to identify the difference between the scalar and vector template functions

Definition at line 330 of file MaterialProperty.h.

Referenced by MaterialProperty< T >::init(), and MaterialProperty< Real >::operator[]().

331 {
333  copy->_value.resize(size, P{});
334  return copy;
335 }
Concrete definition of a parameter value for a specified type.
MooseArray< T > _value
Stored parameter value.
template<typename P >
PropertyValue * _init_helper ( int  size,
PropertyValue prop,
const std::vector< P > *  the_type 
)

Vector Init helper routine so that specialization isn't needed for basic vector MaterialProperty types.

Friend helper function to handle vector material property initializations This function is an overload for the vector version.

Definition at line 340 of file MaterialProperty.h.

341 {
342  typedef MaterialProperty<std::vector<P>> PropType;
343  PropType * copy = new PropType;
344  copy->_value.resize(size, std::vector<P>{});
345 
346  // We don't know the size of the underlying vector at each
347  // quadrature point, the user will be responsible for resizing it
348  // and filling in the entries...
349 
350  // Return the copy we allocated
351  return copy;
352 }
Concrete definition of a parameter value for a specified type.
MooseArray< T > _value
Stored parameter value.
template<>
void dataLoad ( std::istream &  stream,
PropertyValue *&  p,
void *   
)
inline

Definition at line 94 of file MaterialProperty.h.

95 {
96  p->load(stream);
97 }
virtual void load(std::istream &stream)=0
template<>
void dataLoad ( std::istream &  stream,
MaterialProperties v,
void *  context 
)
inline

Definition at line 319 of file MaterialProperty.h.

320 {
321  // Cast this to a vector so we can just piggy back on the vector store capability
322  std::vector<PropertyValue *> & mat_props = static_cast<std::vector<PropertyValue *> &>(v);
323 
324  loadHelper(stream, mat_props, context);
325 }
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:592
template<>
void dataStore ( std::ostream &  stream,
PropertyValue *&  p,
void *   
)
inline

Definition at line 87 of file MaterialProperty.h.

88 {
89  p->store(stream);
90 }
virtual void store(std::ostream &stream)=0
template<>
void dataStore ( std::ostream &  stream,
MaterialProperties v,
void *  context 
)
inline

Definition at line 309 of file MaterialProperty.h.

310 {
311  // Cast this to a vector so we can just piggy back on the vector store capability
312  std::vector<PropertyValue *> & mat_props = static_cast<std::vector<PropertyValue *> &>(v);
313 
314  storeHelper(stream, mat_props, context);
315 }
void storeHelper(std::ostream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:528