14 template<
class T,
class A >
class GetOpFunc;
29 template<
class T,
class A >
32 string fullFieldName =
"get" + field;
33 fullFieldName[3] = std::toupper( fullFieldName[3] );
47 return gop->reduceOp( er );
78 static bool strGet(
const ObjId& tgt,
const string& field,
string& ret );
84 static bool strSet(
const ObjId& dest,
const string& field,
const string& val );
89 const double* arg,
unsigned int size );
103 static bool set(
const ObjId& dest,
const string& field )
136 return set( dest, field );
153 static bool set(
const ObjId& dest,
const string& field, A arg )
166 hop->
op( tgt.
eref(), arg );
169 op->
op( tgt.
eref(), arg );
172 op->
op( tgt.
eref(), arg );
189 const vector< A >& arg )
191 if ( arg.size() == 0 )
return 0;
216 vector< A >temp ( 1, arg );
217 return setVec( destId, field, temp );
228 return set( dest, field, arg );
245 static bool set(
const ObjId& dest,
const string& field, A arg )
247 string temp =
"set" + field;
248 temp[3] = std::toupper( temp[3] );
253 const vector< A >& arg )
255 string temp =
"set" + field;
256 temp[3] = std::toupper( temp[3] );
263 string temp =
"set" + field;
264 temp[3] = std::toupper( temp[3] );
278 return set( dest, field, val );
284 static A
get(
const ObjId& dest,
const string& field)
288 string fullFieldName =
"get" + field;
289 fullFieldName[3] = std::toupper( fullFieldName[3] );
304 hop->
op( tgt.
eref(), &ret );
309 cout <<
"Warning: Field::Get conversion error for " <<
310 dest.id.path() <<
"." << field << endl;
317 static void getVec(
ObjId dest,
const string& field, vector< A >& vec)
323 string fullFieldName =
"get" + field;
324 fullFieldName[3] = std::toupper( fullFieldName[3] );
337 cout <<
"Warning: Field::getVec conversion error for " <<
365 static bool set(
const ObjId& dest,
const string& field,
379 hop->
op( tgt.
eref(), arg1, arg2 );
382 op->
op( tgt.
eref(), arg1, arg2 );
385 op->
op( tgt.
eref(), arg1, arg2 );
404 static bool setVec(
Id destId,
const string& field,
405 const vector< A1 >& arg1,
const vector< A2 >& arg2 )
407 ObjId tgt( destId, 0 );
442 string::size_type pos = val.find_first_of(
"," );
445 return set( dest, field, arg1, arg2 );
467 static bool set(
const ObjId& dest,
const string& field,
470 string temp =
"set" + field;
471 temp[3] = std::toupper( temp[3] );
479 static bool setVec(
Id destId,
const string& field,
480 const vector< L >& index,
const vector< A >& arg )
482 string temp =
"set" + field;
483 temp[3] = std::toupper( temp[3] );
494 const vector< L >& index,
const vector< A >& arg )
496 string temp =
"set" + field;
497 temp[3] = std::toupper( temp[3] );
505 const vector< L >& index, A arg )
507 vector< A > avec( index.size(), arg );
508 return setVec( destId, field, index, avec );
515 const string& indexStr,
const string& val )
524 return set( dest, field, index, arg );
532 static A
get(
const ObjId& dest,
const string& field, L index )
536 string fullFieldName =
"get" + field;
537 fullFieldName[3] = std::toupper( fullFieldName[3] );
551 cout <<
"Warning: LookupField::get: cannot cross nodes yet\n";
562 cout <<
"LookupField::get: Warning: Field::Get conversion error for " <<
563 dest.id.path() <<
"." << field << endl;
574 vector< L >& index, vector< A >& vec )
579 string fullFieldName =
"get" + field;
580 fullFieldName[3] = std::toupper( fullFieldName[3] );
586 unsigned int size = vec.size();
588 for (
unsigned int i = 0; i < size; ++i ) {
594 cout <<
"Warning: Field::getVec conversion error for " <<
603 const string& indexStr,
string& str )
608 A ret =
get( dest, field, index );
626 static bool set(
const ObjId& dest,
const string& field,
627 A1 arg1, A2 arg2, A3 arg3 )
641 hop->
op( tgt.
eref(), arg1, arg2, arg3 );
644 op->
op( tgt.
eref(), arg1, arg2, arg3 );
647 op->
op( tgt.
eref(), arg1, arg2, arg3 );
665 string::size_type pos = val.find_first_of(
"," );
667 string temp = val.substr( pos + 1 );
668 pos = temp.find_first_of(
"," );
671 return set( dest, field, arg1, arg2, arg3 );
678 template<
class A1,
class A2,
class A3,
class A4 >
class SetGet4:
public SetGet
687 static bool set(
const ObjId& dest,
const string& field,
688 A1 arg1, A2 arg2, A3 arg3, A4 arg4 )
701 hop->
op( tgt.
eref(), arg1, arg2, arg3, arg4 );
704 op->
op( tgt.
eref(), arg1, arg2, arg3, arg4 );
707 op->
op( tgt.
eref(), arg1, arg2, arg3, arg4 );
726 string::size_type pos = val.find_first_of(
"," );
728 string temp = val.substr( pos + 1 );
729 pos = temp.find_first_of(
"," );
731 temp = temp.substr( pos + 1 );
732 pos = temp.find_first_of(
"," );
735 return set( dest, field, arg1, arg2, arg3, arg4 );
742 template<
class A1,
class A2,
class A3,
class A4,
class A5 >
class SetGet5:
749 static bool set(
const ObjId& dest,
const string& field,
750 A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5 )
763 hop->
op( tgt.
eref(), arg1, arg2, arg3, arg4, arg5 );
766 op->
op( tgt.
eref(), arg1, arg2, arg3, arg4, arg5 );
769 op->
op( tgt.
eref(), arg1, arg2, arg3, arg4, arg5 );
789 string::size_type pos = val.find_first_of(
"," );
791 string temp = val.substr( pos + 1 );
792 pos = temp.find_first_of(
"," );
794 temp = temp.substr( pos + 1 );
795 pos = temp.find_first_of(
"," );
797 temp = temp.substr( pos + 1 );
798 pos = temp.find_first_of(
"," );
801 return set( dest, field, arg1, arg2, arg3, arg4, arg5 );
808 template<
class A1,
class A2,
class A3,
class A4,
class A5,
class A6 >
class SetGet6:
818 static bool set(
const ObjId& dest,
const string& field,
819 A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5, A6 arg6 )
832 hop->
op( tgt.
eref(), arg1, arg2, arg3, arg4, arg5, arg6 );
835 op->
op( tgt.
eref(), arg1, arg2, arg3, arg4, arg5, arg6 );
838 op->
op( tgt.
eref(), arg1, arg2, arg3, arg4, arg5, arg6);
857 string::size_type pos = val.find_first_of(
"," );
859 string temp = val.substr( pos + 1 );
860 pos = temp.find_first_of(
"," );
862 temp = temp.substr( pos + 1 );
863 pos = temp.find_first_of(
"," );
865 temp = temp.substr( pos + 1 );
866 pos = temp.find_first_of(
"," );
868 temp = temp.substr( pos + 1 );
869 pos = temp.find_first_of(
"," );
872 return set( dest, field, arg1, arg2, arg3, arg4, arg5, arg6 );
const unsigned char MooseGetVecHop
virtual void op(const Eref &e, A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5, A6 arg6) const =0
virtual void opVec(const Eref &e, const vector< A > &arg, const OpFunc1Base< A > *op) const
virtual void op(const Eref &e, A1 arg1, A2 arg2, A3 arg3, A4 arg4) const =0
static bool set(const ObjId &dest, const string &field, L index, A arg)
static const OpFunc * checkSet(const string &field, ObjId &tgt, FuncId &fid)
virtual A returnOp(const Eref &e) const =0
static bool setVec(Id destId, const string &field, const vector< A1 > &arg1, const vector< A2 > &arg2)
static double op(double x)
virtual void op(const Eref &e, A arg) const =0
Element * element() const
Synonym for Id::operator()()
static bool innerStrSet(const ObjId &dest, const string &field, const string &val)
std::string path(const std::string &separator="/") const
bool checkOpClass(const OpFunc *op) const
static bool setRepeat(ObjId destId, const string &field, A arg)
virtual A returnOp(const Eref &e, const L &index) const =0
const OpFunc * makeHopFunc(HopIndex hopIndex) const
const OpFunc * makeHopFunc(HopIndex hopIndex) const
const OpFunc * makeHopFunc(HopIndex hopIndex) const
static bool set(const ObjId &dest, const string &field, A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5, A6 arg6)
static bool innerStrSet(const ObjId &dest, const string &field, const string &val)
virtual bool checkOpClass(const OpFunc *op) const =0
Element * element() const
virtual void op(const Eref &e, A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5) const =0
static bool set(const ObjId &dest, const string &field, A arg)
void opGetVec(const Eref &e, vector< A > &ret, const GetOpFuncBase< A > *op) const
virtual void opVec(const Eref &e, const vector< A1 > &arg1, const vector< A2 > &arg2, const OpFunc2Base< A1, A2 > *op) const
virtual void op(const Eref &e) const =0
static const vector< double * > * dispatchGet(const ObjId &tgt, FuncId tgtFid, const double *arg, unsigned int size)
Sends out request for data, and awaits its return.
const unsigned char MooseGetHop
static bool setVec(Id destId, const string &field, const vector< L > &index, const vector< A > &arg)
static bool strSet(const ObjId &dest, const string &field, const string &val)
static bool innerStrSet(const ObjId &dest, const string &field, const string &val)
const OpFunc * makeHopFunc(HopIndex hopIndex) const
bool isGlobal() const
Returns true if the Element is global.
static bool setRepeat(Id destId, const string &field, const vector< L > &index, A arg)
A localGet(const Eref &er, string field)
virtual void op(const Eref &e, A1 arg1, A2 arg2) const =0
bool isOffNode() const
Returns true if we need to go off-node for calling operations.
static bool innerStrSet(const ObjId &dest, const string &field, const string &arg)
static bool innerStrSet(const ObjId &dest, const string &field, const string &indexStr, const string &val)
static bool innerStrSet(const ObjId &dest, const string &field, const string &val)
static bool innerStrSet(const ObjId &dest, const string &field, const string &val)
static bool innerStrGet(const ObjId &dest, const string &field, string &str)
static bool strGet(const ObjId &tgt, const string &field, string &ret)
static void getVec(Id dest, const string &field, vector< L > &index, vector< A > &vec)
static bool set(const ObjId &dest, const string &field, A1 arg1, A2 arg2, A3 arg3, A4 arg4)
static bool innerStrSet(const ObjId &dest, const string &field, const string &val)
bool checkOpClass(const OpFunc *op) const
const OpFunc * makeHopFunc(HopIndex hopIndex) const
static bool innerStrGet(const ObjId &dest, const string &field, const string &indexStr, string &str)
const Cinfo * cinfo() const
const unsigned char MooseSetVecHop
const unsigned char MooseSetHop
static bool innerStrSet(const ObjId &dest, const string &field, const string &val)
virtual void op(const Eref &e, A1 arg1, A2 arg2, A3 arg3) const =0
static void str2val(T &val, const string &s)
static bool setVec(ObjId destId, const string &field, const vector< A > &arg)
const OpFunc * makeHopFunc(HopIndex hopIndex) const
const OpFunc * getOpFunc() const
static bool set(const ObjId &dest, const string &field, A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5)
static bool set(const ObjId &dest, const string &field)
static bool setVec(ObjId dest, const string &field, const vector< L > &index, const vector< A > &arg)
static bool set(const ObjId &dest, const string &field, A arg)
static bool set(const ObjId &dest, const string &field, A1 arg1, A2 arg2, A3 arg3)
static void val2str(string &s, const T &val)
static void getVec(ObjId dest, const string &field, vector< A > &vec)
const OpFunc * makeHopFunc(HopIndex hopIndex) const
static bool setVec(ObjId destId, const string &field, const vector< A > &arg)
static bool setRepeat(ObjId destId, const string &field, const A &arg)
LookupField(const ObjId &dest)
const OpFunc * makeHopFunc(HopIndex hopIndex) const
virtual void resize(unsigned int newNumData)=0
const Finfo * findFinfo(const string &name) const
static bool set(const ObjId &dest, const string &field, A1 arg1, A2 arg2)
unsigned int opIndex() const