MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
FieldElementFinfo< T, F > Class Template Reference

#include <FieldElementFinfo.h>

+ Inheritance diagram for FieldElementFinfo< T, F >:
+ Collaboration diagram for FieldElementFinfo< T, F >:

Public Member Functions

 FieldElementFinfo (const string &name, const string &doc, const Cinfo *fieldCinfo, F *(T::*lookupField)(unsigned int), void(T::*setNumField)(unsigned int num), unsigned int(T::*getNumField)() const, bool deferCreate=0)
 
unsigned int getNumField (const char *parent) const
 virtual func to get size of Field array, using char* for parent More...
 
char * lookupField (char *parent, unsigned int fieldIndex) const
 
string rttiType () const
 Virtual function to look up type of FieldElementFinfo. More...
 
void setNumField (char *parent, unsigned int num) const
 virtual func to resize Field array, using char* for parent More...
 
- Public Member Functions inherited from FieldElementFinfoBase
 FieldElementFinfoBase (const string &name, const string &doc, const Cinfo *fieldCinfo, bool deferCreate)
 
void postCreationFunc (Id parent, Element *parentElm) const
 
void registerFinfo (Cinfo *c)
 
bool strGet (const Eref &tgt, const string &field, string &returnValue) const
 
bool strSet (const Eref &tgt, const string &field, const string &arg) const
 
virtual ~FieldElementFinfoBase ()
 
- Public Member Functions inherited from Finfo
virtual bool addMsg (const Finfo *target, ObjId mid, Element *src) const
 
virtual bool checkTarget (const Finfo *target) const
 
const string & docs () const
 Returns documentation string. More...
 
 Finfo (const string &name, const string &doc)
 
virtual vector< string > innerDest () const
 
virtual vector< string > innerSrc () const
 
const string & name () const
 
virtual ~Finfo ()
 

Private Attributes

unsigned int(T::* getNumField_ )() const
 
F *(T::* lookupField_ )(unsigned int)
 
void(T::* setNumField_ )(unsigned int num)
 

Additional Inherited Members

- Static Public Member Functions inherited from Finfo
static const CinfoinitCinfo ()
 
- Protected Attributes inherited from FieldElementFinfoBase
bool deferCreate_
 
const CinfofieldCinfo_
 
DestFinfogetNum_
 
DestFinfosetNum_
 

Detailed Description

template<class T, class F>
class FieldElementFinfo< T, F >

Definition at line 104 of file FieldElementFinfo.h.

Constructor & Destructor Documentation

template<class T, class F>
FieldElementFinfo< T, F >::FieldElementFinfo ( const string &  name,
const string &  doc,
const Cinfo fieldCinfo,
F *(T::*)(unsigned int)  lookupField,
void(T::*)(unsigned int num)  setNumField,
unsigned int(T::*)() const  getNumField,
bool  deferCreate = 0 
)
inline

Definition at line 107 of file FieldElementFinfo.h.

References FieldElementFinfoBase::getNum_, Finfo::name(), and FieldElementFinfoBase::setNum_.

116  : FieldElementFinfoBase( name, doc, fieldCinfo, deferCreate ),
120  {
121  string setname = "setNum" + name;
122  setname[6] = std::toupper( setname[6] );
123  // setNumField is a tricky operation, because it may require
124  // cross-node rescaling of the
125  // FieldDataHandler::fieldDimension. To acheive this we
126  // wrap the setNumField in something more interesting
127  // than a simple OpFunc.
128  setNum_ = new DestFinfo(
129  setname,
130  "Assigns number of field entries in field array.",
132 
133  string getname = "getNum" + name;
134  getname[6] = std::toupper( getname[6] );
135  getNum_ = new DestFinfo(
136  getname,
137  "Requests number of field entries in field array."
138  "The requesting Element must "
139  "provide a handler for the returned value.",
141  }
const string & name() const
Definition: Finfo.cpp:80
unsigned int getNumField(const char *parent) const
virtual func to get size of Field array, using char* for parent
char * lookupField(char *parent, unsigned int fieldIndex) const
Definition: OpFunc.h:27
void(T::* setNumField_)(unsigned int num)
F *(T::* lookupField_)(unsigned int)
void setNumField(char *parent, unsigned int num) const
virtual func to resize Field array, using char* for parent
FieldElementFinfoBase(const string &name, const string &doc, const Cinfo *fieldCinfo, bool deferCreate)
unsigned int(T::* getNumField_)() const

+ Here is the call graph for this function:

Member Function Documentation

template<class T, class F>
unsigned int FieldElementFinfo< T, F >::getNumField ( const char *  parent) const
inlinevirtual

virtual func to get size of Field array, using char* for parent

Implements FieldElementFinfoBase.

Definition at line 167 of file FieldElementFinfo.h.

References FieldElementFinfo< T, F >::getNumField_.

168  {
169  const T* pa = reinterpret_cast< const T* >( parent );
170  return ( pa->*getNumField_ )();
171  }
unsigned int(T::* getNumField_)() const
template<class T, class F>
char* FieldElementFinfo< T, F >::lookupField ( char *  parent,
unsigned int  fieldIndex 
) const
inlinevirtual

virtual function to look up pointer for Field object. This casts everything down to chars so that the FieldElement can use it.

Implements FieldElementFinfoBase.

Definition at line 148 of file FieldElementFinfo.h.

References FieldElementFinfo< T, F >::getNumField_, and FieldElementFinfo< T, F >::lookupField_.

149  {
150  T* pa = reinterpret_cast< T* >( parent );
151  if ( fieldIndex < ( pa->*getNumField_ )() )
152  {
153  F* self = ( pa->*lookupField_ )( fieldIndex );
154  return reinterpret_cast< char* >( self );
155  }
156  return 0;
157  }
F *(T::* lookupField_)(unsigned int)
unsigned int(T::* getNumField_)() const
template<class T, class F>
string FieldElementFinfo< T, F >::rttiType ( ) const
inlinevirtual

Virtual function to look up type of FieldElementFinfo.

Reimplemented from Finfo.

Definition at line 176 of file FieldElementFinfo.h.

References Conv< T >::rttiType().

177  {
178  return Conv<F>::rttiType();
179  }
static string rttiType()
Definition: Conv.h:82

+ Here is the call graph for this function:

template<class T, class F>
void FieldElementFinfo< T, F >::setNumField ( char *  parent,
unsigned int  num 
) const
inlinevirtual

virtual func to resize Field array, using char* for parent

Implements FieldElementFinfoBase.

Definition at line 160 of file FieldElementFinfo.h.

References FieldElementFinfo< T, F >::setNumField_.

161  {
162  T* pa = reinterpret_cast< T* >( parent );
163  ( pa->*setNumField_ )( num );
164  }
void(T::* setNumField_)(unsigned int num)

Member Data Documentation

template<class T, class F>
unsigned int( T::* FieldElementFinfo< T, F >::getNumField_)() const
private
template<class T, class F>
F*( T::* FieldElementFinfo< T, F >::lookupField_)(unsigned int)
private

Definition at line 182 of file FieldElementFinfo.h.

Referenced by FieldElementFinfo< T, F >::lookupField().

template<class T, class F>
void( T::* FieldElementFinfo< T, F >::setNumField_)(unsigned int num)
private

Definition at line 183 of file FieldElementFinfo.h.

Referenced by FieldElementFinfo< T, F >::setNumField().


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