Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
bcList Class Reference
Collaboration diagram for bcList:

Public Member Functions

 bcList (FILE *inF)
 
string lookup (int bcNo, string insert) const
 

Private Attributes

vector< bcRec * > b
 

Detailed Description

Definition at line 91 of file writeflo.cpp.

Constructor & Destructor Documentation

bcList ( FILE *  inF)

Definition at line 99 of file writeflo.cpp.

References bcRec::addLine(), and b.

100 {
101  int lineCount=0;
102  char line[200];
103  bcRec *curBC=NULL;
104  int bcNo;
105  while (NULL!=fgets(line,200,inF)) {
106  lineCount++;
107  switch(line[0]) {
108  case '#': break; //Skip comment line
109  case '\n': case '\r': case 0:
110  break; //Skip empty lines
111  case '@': //Start of new boundary condition
112  bcNo=0;
113  if (1!=sscanf(&line[1],"%d",&bcNo)) {
114  fprintf(stderr,"ERROR!\n"
115  "Can't parse boundary condition number from '%s',\n"
116  "found on line %d of the boundary condition file\n",
117  line,lineCount);
118  exit(1);
119  }
120  //Flush the old bc:
121  if (curBC!=NULL) b.push_back(curBC);
122  curBC=new bcRec(bcNo);
123  break;
124  default: //Just a regular description line
125  if (curBC!=NULL) curBC->addLine(line);
126  break;
127  };
128  }
129  if (curBC!=NULL) b.push_back(curBC);
130 }
vector< bcRec * > b
Definition: writeflo.cpp:92
void addLine(string l)
Definition: writeflo.cpp:70

Here is the call graph for this function:

Member Function Documentation

string lookup ( int  bcNo,
string  insert 
) const

Definition at line 133 of file writeflo.cpp.

References b, and i.

Referenced by writeBlock(), and externalBCpatch::writeFlo().

134 {
135  unsigned int i;
136  for (i=0;i<b.size();i++)
137  if (b[i]->hasNumber(bcNo))
138  return b[i]->getString(insert);
139  //If we got here, we couldn't find bcNo
140  fprintf(stderr,"ERROR! Can't find boundary condition %d in .bc file!\n",bcNo);
141  exit(1);
142  return "";//<- for whining compilers
143 }
vector< bcRec * > b
Definition: writeflo.cpp:92
blockLoc i
Definition: read.cpp:79

Here is the caller graph for this function:

Member Data Documentation

vector<bcRec *> b
private

Definition at line 92 of file writeflo.cpp.

Referenced by bcList(), and lookup().


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