MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
OpFunc2Base< A1, A2 > Class Template Referenceabstract

#include <OpFuncBase.h>

+ Inheritance diagram for OpFunc2Base< A1, A2 >:
+ Collaboration diagram for OpFunc2Base< A1, A2 >:

Public Member Functions

bool checkFinfo (const Finfo *s) const
 
const OpFuncmakeHopFunc (HopIndex hopIndex) const
 
virtual void op (const Eref &e, A1 arg1, A2 arg2) const =0
 
void opBuffer (const Eref &e, double *buf) const
 Executes the OpFunc by converting args. More...
 
virtual void opVec (const Eref &e, const vector< A1 > &arg1, const vector< A2 > &arg2, const OpFunc2Base< A1, A2 > *op) const
 
void opVecBuffer (const Eref &e, double *buf) const
 Executes the OpFunc for all data by converting a vector of args. More...
 
string rttiType () const
 
- Public Member Functions inherited from OpFunc
 OpFunc ()
 
unsigned int opIndex () const
 
bool setIndex (unsigned int i)
 Used when rebuilding the Fid->OpFunc mapping. More...
 
virtual ~OpFunc ()
 

Additional Inherited Members

- Static Public Member Functions inherited from OpFunc
static const OpFunclookop (unsigned int opIndex)
 
static unsigned int rebuildOpIndex ()
 cleans out the entire Ops vector. Returns size of orig vector. More...
 

Detailed Description

template<class A1, class A2>
class OpFunc2Base< A1, A2 >

Definition at line 145 of file OpFuncBase.h.

Member Function Documentation

template<class A1, class A2>
bool OpFunc2Base< A1, A2 >::checkFinfo ( const Finfo s) const
inlinevirtual

Implements OpFunc.

Definition at line 148 of file OpFuncBase.h.

148  {
149  return dynamic_cast< const SrcFinfo2< A1, A2 >* >( s );
150  }
template<class A1 , class A2 >
const OpFunc * OpFunc2Base< A1, A2 >::makeHopFunc ( HopIndex  hopIndex) const
virtual

Implements OpFunc.

Definition at line 269 of file HopFunc.h.

Referenced by SetGet2< L, A >::set(), and SetGet2< L, A >::setVec().

271 {
272  return new HopFunc2< A1, A2 >( hopIndex );
273 }

+ Here is the caller graph for this function:

template<class A1, class A2>
virtual void OpFunc2Base< A1, A2 >::op ( const Eref e,
A1  arg1,
A2  arg2 
) const
pure virtual

Implemented in HopFunc2< A1, A2 >, EpFunc2< T, A1, A2 >, and OpFunc2< T, A1, A2 >.

Referenced by OpFunc2Base< A1, A2 >::opBuffer(), HopFunc2< A1, A2 >::opVec(), OpFunc2Base< A1, A2 >::opVecBuffer(), SrcFinfo2< T1, T2 >::send(), SrcFinfo2< T1, T2 >::sendTo(), and SetGet2< L, A >::set().

+ Here is the caller graph for this function:

template<class A1, class A2>
void OpFunc2Base< A1, A2 >::opBuffer ( const Eref e,
double *  buf 
) const
inlinevirtual

Executes the OpFunc by converting args.

Implements OpFunc.

Definition at line 157 of file OpFuncBase.h.

References Conv< T >::buf2val(), and OpFunc2Base< A1, A2 >::op().

157  {
158  const A1& arg1 = Conv< A1 >::buf2val( &buf );
159  op( e,
160  arg1, Conv< A2 >::buf2val( &buf ) );
161  }
Definition: Conv.h:30
virtual void op(const Eref &e, A1 arg1, A2 arg2) const =0
static const T & buf2val(double **buf)
Definition: Conv.h:44

+ Here is the call graph for this function:

template<class A1, class A2>
virtual void OpFunc2Base< A1, A2 >::opVec ( const Eref e,
const vector< A1 > &  arg1,
const vector< A2 > &  arg2,
const OpFunc2Base< A1, A2 > *  op 
) const
inlinevirtual

Definition at line 182 of file OpFuncBase.h.

Referenced by SetGet2< L, A >::setVec().

186  { ; } // overridden in HopFuncs.

+ Here is the caller graph for this function:

template<class A1, class A2>
void OpFunc2Base< A1, A2 >::opVecBuffer ( const Eref e,
double *  buf 
) const
inlinevirtual

Executes the OpFunc for all data by converting a vector of args.

Reimplemented from OpFunc.

Definition at line 163 of file OpFuncBase.h.

References Eref::element(), Element::localDataStart(), Element::numField(), Element::numLocalData(), and OpFunc2Base< A1, A2 >::op().

163  {
164  vector< A1 > temp1 = Conv< vector< A1 > >::buf2val( &buf );
165  vector< A2 > temp2 = Conv< vector< A2 > >::buf2val( &buf );
166  Element* elm = e.element();
167  assert( temp1.size() >= elm->numLocalData() );
168  unsigned int k = 0;
169  unsigned int start = elm->localDataStart();
170  unsigned int end = start + elm->numLocalData();
171  for ( unsigned int i = start; i < end; ++i) {
172  unsigned int nf = elm->numField( i - start );
173  for ( unsigned int j = 0; j < nf; ++j) {
174  Eref er( elm, i, j );
175  op( er, temp1[ k % temp1.size() ],
176  temp2[ k % temp2.size() ] );
177  ++k;
178  }
179  }
180  }
Element * element() const
Definition: Eref.h:42
Definition: Conv.h:30
virtual void op(const Eref &e, A1 arg1, A2 arg2) const =0
virtual unsigned int numField(unsigned int rawIndex) const =0
Returns number of field entries for specified data.
Definition: Eref.h:26
virtual unsigned int localDataStart() const =0
Returns index of first data entry on this node.
virtual unsigned int numLocalData() const =0
Returns number of local data entries on this node.

+ Here is the call graph for this function:

template<class A1, class A2>
string OpFunc2Base< A1, A2 >::rttiType ( ) const
inlinevirtual

Implements OpFunc.

Definition at line 188 of file OpFuncBase.h.

References Conv< T >::rttiType().

188  {
189  return Conv< A1 >::rttiType() + "," + Conv< A2 >::rttiType();
190  }
static string rttiType()
Definition: Conv.h:82

+ Here is the call graph for this function:


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