38 #include "materials.hh"
52 Mesh* mesh = (
Mesh*) ConstantDB::getInstance()->getObject(MESH::MAIN_INSTANCE);
96 rct->type = atoi(
xstrtok( line) );
100 xprintf(
UsrErr,
"Unsupported reaction type #%d.\n", rct->type);
102 rct->sbi = atoi(
xstrtok( NULL) );
103 INPUT_CHECK(!(rct->sbi > transport->n_subst_ - 1),
"Unknown substance ID#%d.\n", rct->sbi);
105 rct->coef = (
double*)
xmalloc(pc *
sizeof(
double));
106 for(ci = 0 ; ci < pc ; ci++)
107 rct->coef[ci] = atof(
xstrtok( NULL) );
151 Mesh* mesh = (
Mesh*) ConstantDB::getInstance()->getObject(MESH::MAIN_INSTANCE);
158 ASSERT(!( mesh == NULL ),
"NULL as argument of function read_reaction_list()\n");
160 in =
xfopen( ConstantDB::getInstance()->getChar(
"Material_fname"),
"rt" );
161 found=
skip_to( in,
"$Reactions" );
162 ASSERT( found ,
"Can not find section: $Reactions." );
164 sscanf( line,
"%s",
string );
167 while ((strcmp(
string,
"$EndReactions")) != 0){
170 sscanf( line,
"%s",
string );
173 transport->n_reaction = r;
174 ASSERT(!( r == 0 ),
"No reaction haven't defined\n");
175 transport->reaction =(
struct Reaction*)
xmalloc(transport->n_reaction *
sizeof(
struct Reaction));
178 in =
xfopen( ConstantDB::getInstance()->getChar(
"Material_fname"),
"rt" );
180 for(i=0;i<transport->n_reaction;i++){