13 #include "../scheduling/Clock.h"
19 #include "../shell/Shell.h"
26 unsigned int size = 10;
63 unsigned int numFib = 20;
79 bool ret = outFinfo->
addMsg( arg1Finfo, dm1->
mid(), a1 );
84 ret = outFinfo->
addMsg( arg2Finfo, dm2->
mid(), a1 );
108 for (
unsigned int i = 0; i < numFib; ++i ) {
114 unsigned int temp = f1;
120 cout <<
"." << flush;
129 unsigned int numFib = 20;
148 ObjId( a1id, 0 ),
"output",
ObjId( a1id, 0 ),
"arg1" );
153 ObjId( a1id, 0 ),
"output",
ObjId( a1id, 0 ),
"arg2" );
169 vector< double > retVec;
171 assert( retVec.size() == numFib );
175 for (
unsigned int i = 0; i < numFib; ++i ) {
183 assert(
doubleEq( retVec[i], f1 ) );
184 unsigned int temp = f1;
190 cout <<
"." << flush;
195 bool isNamedPlot(
const string& line,
const string& plotname );
210 cout <<
"." << flush;
215 double getRMSDiff(
const vector< double >& v1,
const vector< double >& v2 );
216 double getRMS(
const vector< double >& v );
218 double getRMSRatio(
const vector< double >& v1,
const vector< double >& v2 );
230 double r1 = sqrt( 5.0 / 3.0 );
231 double r2 = sqrt( 1.0 / 3.0 );
242 cout <<
"." << flush;
253 assert( tabid !=
ObjId() );
255 for (
unsigned int i = 0; i < 100; ++i ) {
256 t->
input( sqrt((
double) i ) );
259 assert( values.size() == 100 );
260 for (
unsigned int i = 0; i < 100; ++i ) {
262 assert(
doubleEq( values[i] , sqrt((
double) i ) ) );
263 assert(
doubleEq( ret , sqrt((
double) i ) ) );
266 cout <<
"." << flush;
276 assert( tabid !=
ObjId() );
278 assert( arithid !=
ObjId() );
282 arithid.
eref().
objId(),
"getOutputValue" );
283 assert( ret !=
ObjId() );
286 assert( ret !=
ObjId() );
292 assert( numEntries == 0 );
299 assert( numEntries == 1 );
305 assert( numEntries == 101 );
308 for (
unsigned int i = 0; i < 100; ++i ) {
311 assert(
doubleEq( temp[i], 2 * i ) );
317 Id arith2 = shell->
doCopy( arithid,
ObjId(),
"arith2", 1,
false,
false);
321 arith2.
eref().
objId(),
"getOutputValue" );
331 assert( numEntries == 202 );
334 for (
unsigned int i = 1; i < 100; ++i ) {
335 assert(
doubleEq( temp[2 * i], 2 * i ) );
336 assert(
doubleEq( temp[2 * i + 1], 10 + 12 * i ) );
349 cout <<
"." << flush;
356 unsigned int size = 1000;
357 vector< double > sinewave( size, 0 );
358 for (
unsigned int i = 0; i < size; ++i ) {
359 sinewave[i] = sin( 2 * i *
PI / static_cast< double >( size ) );
362 assert( tabid !=
ObjId() );
399 assert( wnum == size/2 );
417 assert( wnum == size );
421 cout <<
"." << flush;
441 cout <<
"." << flush;
double getRMSDiff(const vector< double > &v1, const vector< double > &v2)
void doStart(double runtime, bool notify=false)
bool isNamedPlot(const string &line, const string &plotname)
static A get(const ObjId &dest, const string &field, L index)
void doSetClock(unsigned int tickNum, double dt)
static const Cinfo * initCinfo()
Id doCopy(Id orig, ObjId newParent, string newName, unsigned int n, bool toGlobal, bool copyExtMsgs)
Returns the Id of the root of the copied tree upon success.
double getRMSRatio(const vector< double > &v1, const vector< double > &v2)
static void children(const Eref &e, vector< Id > &ret)
Element * element() const
static bool set(const ObjId &dest, const string &field, A arg)
void testBuiltinsProcess()
Id doCreate(string type, ObjId parent, string name, unsigned int numData, NodePolicy nodePolicy=MooseBlockBalance, unsigned int preferredNode=1)
void testUtilsForCompareXplot()
bool doubleApprox(double x, double y)
void process(const Eref &e, ProcPtr p)
void setStride(int stride)
bool doubleEq(double x, double y)
double getYcolumn(const string &line)
void testUtilsForLoadXplot()
virtual bool addMsg(const Finfo *target, ObjId mid, Element *src) const
double getRMS(const vector< double > &v)
virtual char * data(unsigned int rawIndex, unsigned int fieldIndex=0) const =0
ObjId doAddMsg(const string &msgType, ObjId src, const string &srcField, ObjId dest, const string &destField)
static bool set(const ObjId &dest, const string &field, A arg)
void doUseClock(string path, string field, unsigned int tick)
static const Cinfo * initCinfo()
static A get(const ObjId &dest, const string &field)
static unsigned int numNodes()
static void getVec(ObjId dest, const string &field, vector< A > &vec)
const Finfo * findFinfo(const string &name) const