# | Line 108 | Line 108 | DumpReader::~DumpReader() { | |
---|---|---|
108 | error = fclose(inFile_); | |
109 | ||
110 | if (error) { | |
111 | < | sprintf(painCave.errMsg, "Error closing %s\n", filename_.c_str()); |
111 | > | sprintf(painCave.errMsg, "DumpReader Error: Error closing %s\n", filename_.c_str()); |
112 | painCave.isFatal = 1; | |
113 | simError(); | |
114 | } | |
# | Line 155 | Line 155 | void DumpReader::scanFile(void) { | |
155 | ||
156 | if (feof(inFile_)) { | |
157 | sprintf(painCave.errMsg, | |
158 | < | "File \"%s\" ended unexpectedly at line %d\n", |
158 | > | "DumpReader Error: File \"%s\" ended unexpectedly at line %d\n", |
159 | filename_.c_str(), | |
160 | lineNum); | |
161 | painCave.isFatal = 1; | |
# | Line 172 | Line 172 | void DumpReader::scanFile(void) { | |
172 | ||
173 | if (feof(inFile_)) { | |
174 | sprintf(painCave.errMsg, | |
175 | < | "File \"%s\" ended unexpectedly at line %d\n", |
175 | > | "DumpReader Error: File \"%s\" ended unexpectedly at line %d\n", |
176 | filename_.c_str(), | |
177 | lineNum); | |
178 | painCave.isFatal = 1; | |
# | Line 185 | Line 185 | void DumpReader::scanFile(void) { | |
185 | ||
186 | if (feof(inFile_)) { | |
187 | sprintf(painCave.errMsg, | |
188 | < | "File \"%s\" ended unexpectedly at line %d," |
188 | > | "DumpReader Error: File \"%s\" ended unexpectedly at line %d," |
189 | " with atom %d\n", filename_.c_str(), | |
190 | lineNum, | |
191 | j); | |
# | Line 265 | Line 265 | void DumpReader::readSet(int whichFrame) { | |
265 | eof_test = fgets(read_buffer, sizeof(read_buffer), inFile_); | |
266 | ||
267 | if (eof_test == NULL) { | |
268 | < | sprintf(painCave.errMsg, "error in reading commment in %s\n", |
268 | > | sprintf(painCave.errMsg, "DumpReader Error: error in reading commment in %s\n", |
269 | filename_.c_str()); | |
270 | painCave.isFatal = 1; | |
271 | simError(); | |
# | Line 284 | Line 284 | void DumpReader::readSet(int whichFrame) { | |
284 | ||
285 | if (eof_test == NULL) { | |
286 | sprintf(painCave.errMsg, | |
287 | < | "error in reading file %s\n" |
287 | > | "DumpReader Error: error in reading file %s\n" |
288 | "natoms = %d; index = %d\n" | |
289 | "error reading the line from the file.\n", | |
290 | filename_.c_str(), | |
# | Line 324 | Line 324 | void DumpReader::readSet(int whichFrame) { | |
324 | eof_test = fgets(read_buffer, sizeof(read_buffer), inFile_); | |
325 | ||
326 | if (eof_test == NULL) { | |
327 | < | sprintf(painCave.errMsg, "Error reading 1st line of %s \n ", |
327 | > | sprintf(painCave.errMsg, "DumpReader Error: Error reading 1st line of %s \n ", |
328 | filename_.c_str()); | |
329 | painCave.isFatal = 1; | |
330 | simError(); | |
# | Line 353 | Line 353 | void DumpReader::readSet(int whichFrame) { | |
353 | eof_test = fgets(read_buffer, sizeof(read_buffer), inFile_); | |
354 | ||
355 | if (eof_test == NULL) { | |
356 | < | sprintf(painCave.errMsg, "error in reading commment in %s\n", |
356 | > | sprintf(painCave.errMsg, "DumpReader Error: error in reading commment in %s\n", |
357 | filename_.c_str()); | |
358 | painCave.isFatal = 1; | |
359 | simError(); | |
# | Line 376 | Line 376 | void DumpReader::readSet(int whichFrame) { | |
376 | mol = info_->getMoleculeByGlobalIndex(i); | |
377 | ||
378 | if (mol == NULL) { | |
379 | < | sprintf(painCave.errMsg, "Molecule not found on node %d!", worldRank); |
379 | > | sprintf(painCave.errMsg, "DumpReader Error: Molecule not found on node %d!", worldRank); |
380 | painCave.isFatal = 1; | |
381 | simError(); | |
382 | } | |
# | Line 388 | Line 388 | void DumpReader::readSet(int whichFrame) { | |
388 | ||
389 | if (eof_test == NULL) { | |
390 | sprintf(painCave.errMsg, | |
391 | < | "error in reading file %s\n" |
391 | > | "DumpReader Error: error in reading file %s\n" |
392 | "natoms = %d; index = %d\n" | |
393 | "error reading the line from the file.\n", | |
394 | filename_.c_str(), | |
# | Line 412 | Line 412 | void DumpReader::readSet(int whichFrame) { | |
412 | ||
413 | if (eof_test == NULL) { | |
414 | sprintf(painCave.errMsg, | |
415 | < | "error in reading file %s\n" |
415 | > | "DumpReader Error: error in reading file %s\n" |
416 | "natoms = %d; index = %d\n" | |
417 | "error reading the line from the file.\n", | |
418 | filename_.c_str(), | |
# | Line 443 | Line 443 | void DumpReader::readSet(int whichFrame) { | |
443 | ||
444 | mol = info_->getMoleculeByGlobalIndex(i); | |
445 | if (mol == NULL) { | |
446 | < | sprintf(painCave.errMsg, "Molecule not found on node %d!", worldRank); |
446 | > | sprintf(painCave.errMsg, "DumpReader Error: Molecule not found on node %d!", worldRank); |
447 | painCave.isFatal = 1; | |
448 | simError(); | |
449 | } | |
# | Line 485 | Line 485 | void DumpReader::parseDumpLine(char *line, StuntDouble | |
485 | ||
486 | if (nTokens < 14) { | |
487 | sprintf(painCave.errMsg, | |
488 | < | "Not enough Tokens.\n"); |
488 | > | "DumpReader Error: Not enough Tokens.\n"); |
489 | painCave.isFatal = 1; | |
490 | simError(); | |
491 | } | |
# | Line 493 | Line 493 | void DumpReader::parseDumpLine(char *line, StuntDouble | |
493 | std::string name = tokenizer.nextToken(); | |
494 | ||
495 | if (name != integrableObject->getType()) { | |
496 | < | |
496 | > | |
497 | > | sprintf(painCave.errMsg, |
498 | > | "DumpReader Error: Atom type [%s] in %s does not match Atom Type [%s] in .md file.\n", |
499 | > | name.c_str(), filename_.c_str(), integrableObject->getType().c_str()); |
500 | > | painCave.isFatal = 1; |
501 | > | simError(); |
502 | } | |
503 | ||
504 | pos[0] = tokenizer.nextTokenAsDouble(); | |
# | Line 517 | Line 522 | void DumpReader::parseDumpLine(char *line, StuntDouble | |
522 | if (qlen < oopse::epsilon) { //check quaternion is not equal to 0 | |
523 | ||
524 | sprintf(painCave.errMsg, | |
525 | < | "initial quaternion error (q0^2 + q1^2 + q2^2 + q3^2 ~ 0).\n"); |
525 | > | "DumpReader Error: initial quaternion error (q0^2 + q1^2 + q2^2 + q3^2 ~ 0).\n"); |
526 | painCave.isFatal = 1; | |
527 | simError(); | |
528 | ||
# | Line 551 | Line 556 | void DumpReader::parseCommentLine(char* line, Snapshot | |
556 | //comment line should at least contain 10 tokens: current time(1 token) and h-matrix(9 tokens) | |
557 | if (nTokens < 10) { | |
558 | sprintf(painCave.errMsg, | |
559 | < | "Not enough tokens in comment line: %s", line); |
559 | > | "DumpReader Error: Not enough tokens in comment line: %s", line); |
560 | painCave.isFatal = 1; | |
561 | simError(); | |
562 | } |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |