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

Public Member Functions

 bcListTop (FILE *inF)
 
bcRecToplookup (int bcNo) const
 

Private Attributes

vector< bcRecTop * > b
 

Detailed Description

Definition at line 74 of file writetop.cpp.

Constructor & Destructor Documentation

bcListTop ( FILE *  inF)

Definition at line 83 of file writetop.cpp.

References b.

84 {
85  int lineCount=0;
86  char lineBuf[200];
87  while (NULL!=fgets(lineBuf,200,inF)) {
88  char *line=lineBuf;
89  while (isspace(*line)) line++; //Skip white space
90  line[strlen(line)-1]=0; //Erase newline
91  lineCount++;
92  switch(line[0]) {
93  case '#': case '!': break; //Skip comment line
94  case '\n': case '\r': case 0:
95  break; //Skip empty lines
96  case ' ': case '\t':
97  case '0': case '1': case '2': case '3': case '4':
98  case '5': case '6': case '7': case '8': case '9':
99  { //A new boundary condition
100  int in,out,coupled=0;
101  if (sscanf(line,"%d%d%d",&in,&out,&coupled)<2) {
102  fprintf(stderr,"ERROR!\n"
103  "Can't parse boundary condition number from '%s',\n"
104  "found on line %d of the boundary condition file\n",
105  line,lineCount);
106  exit(1);
107  }
108  b.push_back(new bcRecTop(in,out,coupled));
109  break;
110  }
111  case '@': //.flo-style boundary condition
112  fprintf(stderr,"ERROR!\n"
113  "This appears to be a rocflo-style boundary condition file--\n"
114  "RocfloMP does not use @ signs.\n");
115  exit(1);
116  default: //Something bizarre:
117  fprintf(stderr,"ERROR!\n"
118  "Can't parse line of boundary condition \n"
119  "'%s', found on line %d.\n",
120  line,lineCount);
121  exit(1);
122  };
123  }
124 }
vector< bcRecTop * > b
Definition: writetop.cpp:75

Member Function Documentation

bcRecTop * lookup ( int  bcNo) const

Definition at line 127 of file writetop.cpp.

References b, and i.

Referenced by externalBCpatch::writeTop().

128 {
129  unsigned int i;
130  for (i=0;i<b.size();i++)
131  if (b[i]->hasNumber(bcNo))
132  return b[i];
133  //If we got here, we couldn't find bcNo
134  fprintf(stderr,"ERROR! Can't find boundary condition %d in .bc file!\n",bcNo);
135  exit(1);
136  return NULL;//<- for whining compilers
137 }
vector< bcRecTop * > b
Definition: writetop.cpp:75
blockLoc i
Definition: read.cpp:79

Here is the caller graph for this function:

Member Data Documentation

vector<bcRecTop *> b
private

Definition at line 75 of file writetop.cpp.

Referenced by bcListTop(), and lookup().


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