#include "header.h"
#include "../shell/Shell.h"
#include "ReadKkit.h"
#include "ReadCspace.h"
#include "EnzBase.h"
#include "MMenz.h"
#include "ReacBase.h"
#include "Reac.h"
Go to the source code of this file.
Definition at line 223 of file testKinetics.cpp.
References moose::log(), and s0.
Referenced by testMMenzProcess().
229 double c = -Km *
log( s0 ) -
s0;
230 double t = (-1.0 /( E * kcat ) ) * ( ( Km *
log( s ) + s ) + c );
void log(string msg, serverity_level_ type=debug, bool redirectToConsole=true, bool removeTicks=true)
Log to console (and to a log-file)
static SrcFinfo0 s0("s0","")
bool isClose |
( |
double |
x, |
|
|
double |
y, |
|
|
double |
tol |
|
) |
| |
void testKineticsProcess |
( |
| ) |
|
Definition at line 198 of file testKinetics.cpp.
References Eref::data(), Shell::doCreate(), Shell::doDelete(), doubleEq(), Id::eref(), MMenz::vEnz(), MMenz::vGetKcat(), MMenz::vGetKm(), MMenz::vProcess(), MMenz::vReinit(), MMenz::vSetKcat(), MMenz::vSetKm(), and MMenz::vSub().
Referenced by testKinetics().
215 cout <<
"." << flush;
double vGetKm(const Eref &e) const
void vSetKm(const Eref &e, double v)
void vProcess(const Eref &e, ProcPtr p)
Id doCreate(string type, ObjId parent, string name, unsigned int numData, NodePolicy nodePolicy=MooseBlockBalance, unsigned int preferredNode=1)
bool doubleEq(double x, double y)
double vGetKcat(const Eref &e) const
void vSetKcat(const Eref &e, double v)
void vReinit(const Eref &e, ProcPtr p)
void testMMenzProcess |
( |
| ) |
|
Definition at line 234 of file testKinetics.cpp.
References Eref::data(), Shell::doAddMsg(), Shell::doCreate(), Shell::doDelete(), Shell::doReinit(), Shell::doSetClock(), Shell::doStart(), doubleApprox(), Shell::doUseClock(), Id::eref(), estT(), and Field< A >::set().
Referenced by testKineticsProcess().
244 Id pid = shell->
doCreate(
"Pool", nid,
"p", 1 );
245 Id qid = shell->
doCreate(
"Pool", nid,
"q", 1 );
246 Id rid = shell->
doCreate(
"Pool", nid,
"r", 1 );
247 Id mmid = shell->
doCreate(
"MMenz", nid,
"mm", 1 );
249 Id tabid2 = shell->
doCreate(
"Table", nid,
"tab2", 1 );
263 shell->
doUseClock(
"/n/mm,/n/tab2",
"process", 0 );
264 shell->
doUseClock(
"/n/#[ISA=Pool]",
"process", 1 );
274 assert( vec.size() == 1001 );
275 for (
unsigned int i = 0; i < vec.size(); ++i ) {
277 double et =
estT( vec[i] );
282 cout <<
"." << flush;
void doStart(double runtime, bool notify=false)
void doSetClock(unsigned int tickNum, double dt)
static bool set(const ObjId &dest, const string &field, A arg)
Id doCreate(string type, ObjId parent, string name, unsigned int numData, NodePolicy nodePolicy=MooseBlockBalance, unsigned int preferredNode=1)
bool doubleApprox(double x, double y)
ObjId doAddMsg(const string &msgType, ObjId src, const string &srcField, ObjId dest, const string &destField)
void doUseClock(string path, string field, unsigned int tick)
void testPoolVolumeScaling |
( |
| ) |
|
Definition at line 40 of file testKinetics.cpp.
References Eref::data(), Shell::doAddMsg(), Shell::doCreate(), Shell::doDelete(), doubleEq(), Id::eref(), Field< A >::get(), NA, PI, Field< A >::set(), and Id::value().
Referenced by testKinetics().
43 Id comptId = shell->
doCreate(
"CylMesh",
Id(),
"cyl", 1 );
44 Id meshId( comptId.
value() + 1 );
45 Id poolId = shell->
doCreate(
"Pool", comptId,
"pool", 1 );
48 ObjId( poolId, 0 ),
"requestVolume",
49 ObjId( meshId, 0 ),
"get_volume" );
51 assert( mid !=
ObjId() );
53 vector< double > coords( 9, 0.0 );
66 assert(
doubleEq( volume,
PI * x1 * (r0+r1) * (r0+r1) / 4.0 ) );
69 double volscale = 1 / (
NA * volume );
71 assert(
doubleEq( conc, 400 * volscale ) );
78 assert(
doubleEq( concInit, 650 * volscale ) );
unsigned int value() const
static bool set(const ObjId &dest, const string &field, A arg)
Id doCreate(string type, ObjId parent, string name, unsigned int numData, NodePolicy nodePolicy=MooseBlockBalance, unsigned int preferredNode=1)
bool doubleEq(double x, double y)
ObjId doAddMsg(const string &msgType, ObjId src, const string &srcField, ObjId dest, const string &destField)
static A get(const ObjId &dest, const string &field)
void testReacVolumeScaling |
( |
| ) |
|
Definition at line 87 of file testKinetics.cpp.
References Eref::data(), Shell::doAddMsg(), Shell::doCreate(), Shell::doDelete(), doubleEq(), Id::eref(), Field< A >::get(), NA, Field< A >::set(), and Id::value().
Referenced by testKinetics().
90 Id comptId = shell->
doCreate(
"CubeMesh",
Id(),
"cube", 1 );
91 Id meshId( comptId.
value() + 1 );
92 Id subId = shell->
doCreate(
"Pool", comptId,
"sub", 1 );
93 Id prdId = shell->
doCreate(
"Pool", comptId,
"prd", 1 );
94 Id reacId = shell->
doCreate(
"Reac", comptId,
"reac", 1 );
99 subId,
"requestVolume", meshId,
"get_volume" );
100 assert( mid !=
ObjId() );
102 prdId,
"requestVolume", meshId,
"get_volume" );
103 assert( mid !=
ObjId() );
105 vector< double > coords( 9, 10.0e-6 );
106 coords[0] = coords[1] = coords[2] = 0;
113 ObjId ret = shell->
doAddMsg(
"Single", reacId,
"sub", subId,
"reac" );
114 assert( ret !=
ObjId() );
115 ret = shell->
doAddMsg(
"Single", reacId,
"prd", prdId,
"reac" );
116 assert( ret !=
ObjId() );
125 ret = shell->
doAddMsg(
"Single", reacId,
"sub", subId,
"reac" );
126 assert( ret !=
ObjId() );
127 double conv = 1.0 / (
NA * vol1 );
133 ret = shell->
doAddMsg(
"Single", reacId,
"sub", subId,
"reac" );
134 assert( ret !=
ObjId() );
135 ret = shell->
doAddMsg(
"Single", reacId,
"prd", prdId,
"reac" );
136 assert( ret !=
ObjId() );
138 assert(
doubleEq( x, 2 * conv * conv ) );
143 cout <<
"." << flush;
unsigned int value() const
static bool set(const ObjId &dest, const string &field, A arg)
Id doCreate(string type, ObjId parent, string name, unsigned int numData, NodePolicy nodePolicy=MooseBlockBalance, unsigned int preferredNode=1)
bool doubleEq(double x, double y)
ObjId doAddMsg(const string &msgType, ObjId src, const string &srcField, ObjId dest, const string &destField)
static A get(const ObjId &dest, const string &field)
Definition at line 19 of file testKinetics.cpp.
References Eref::data(), Shell::doDelete(), ReadKkit::dumpPlots(), Id::eref(), ReadKkit::read(), and ReadKkit::run().
23 Id base = rk.
read(
"foo.g",
"dend",
Id() );
24 assert( base !=
Id() );
void dumpPlots(const string &filename)
Id read(const string &filename, const string &cellname, Id parent, const string &solverClass="Stoich")
void testTwoReacGetNeighbors |
( |
| ) |
|
Definition at line 147 of file testKinetics.cpp.
References Eref::data(), Shell::doAddMsg(), Shell::doCreate(), Shell::doDelete(), Id::element(), Id::eref(), Element::getNeighbors(), Reac::initCinfo(), and Id::value().
Referenced by testKinetics().
150 Id comptId = shell->
doCreate(
"CubeMesh",
Id(),
"cube", 1 );
151 Id meshId( comptId.
value() + 1 );
152 Id subId = shell->
doCreate(
"Pool", comptId,
"sub", 1 );
153 Id prdId = shell->
doCreate(
"Pool", comptId,
"prd", 1 );
154 Id reacId = shell->
doCreate(
"Reac", comptId,
"reac", 1 );
157 subId,
"requestVolume", meshId,
"get_volume" );
158 assert( mid !=
ObjId() );
160 prdId,
"requestVolume", meshId,
"get_volume" );
161 assert( mid !=
ObjId() );
163 ObjId ret = shell->
doAddMsg(
"Single", reacId,
"sub", subId,
"reac" );
164 assert( ret !=
ObjId() );
165 ret = shell->
doAddMsg(
"Single", reacId,
"sub", subId,
"reac" );
166 assert( ret !=
ObjId() );
168 ret = shell->
doAddMsg(
"Single", reacId,
"prd", prdId,
"reac" );
169 assert( ret !=
ObjId() );
175 assert( pools[0] == subId );
176 assert( pools[1] == subId );
182 assert( pools[0] == subId );
183 assert( pools[1] == subId );
186 cout <<
"." << flush;
Element * element() const
Synonym for Id::operator()()
unsigned int value() const
Id doCreate(string type, ObjId parent, string name, unsigned int numData, NodePolicy nodePolicy=MooseBlockBalance, unsigned int preferredNode=1)
static const Cinfo * initCinfo()
ObjId doAddMsg(const string &msgType, ObjId src, const string &srcField, ObjId dest, const string &destField)
unsigned int getNeighbors(vector< Id > &ret, const Finfo *finfo) const
Definition at line 292 of file testKinetics.cpp.
References findVolOrder().
Referenced by testKinetics().
294 vector< unsigned int >
findVolOrder(
const vector< double >& vols );
295 vector< double > vols( 8 );
306 assert( order[0] == 1 );
307 assert( order[1] == 0 );
308 assert( order[2] == 2 );
309 assert( order[3] == 3 );
310 assert( order[4] == 7 );
311 assert( order[5] == 6 );
312 assert( order[6] == 5 );
313 assert( order[7] == 4 );
324 assert( order[0] == 4 );
325 assert( order[1] == 1 );
326 assert( order[2] == 3 );
327 assert( order[3] == 0 );
328 assert( order[4] == 2 );
vector< unsigned int > findVolOrder(const vector< double > &vols)
void testWriteKkit |
( |
Id |
id | ) |
|