# | Line 119 | Line 119 | void SimSetup::createSim( void ){ | |
---|---|---|
119 | ||
120 | if( !the_components[i]->haveNMol() ){ | |
121 | // we have a problem | |
122 | < | std::cerr << "SimSetup Error. No global NMol or component NMol" |
123 | < | << " given. Cannot calculate the number of atoms.\n"; |
124 | < | exit( 8 ); |
122 | > | sprintf( painCave.errMsg, |
123 | > | "SimSetup Error. No global NMol or component NMol" |
124 | > | " given. Cannot calculate the number of atoms.\n" ); |
125 | > | painCave.isFatal = 1; |
126 | > | simError(); |
127 | } | |
128 | ||
129 | tot_nmol += the_components[i]->getNMol(); | |
# | Line 129 | Line 131 | void SimSetup::createSim( void ){ | |
131 | } | |
132 | } | |
133 | else{ | |
134 | < | std::cerr << "NOT A SUPPORTED FEATURE\n"; |
135 | < | |
136 | < | // tot_nmol = the_globals->getNMol(); |
137 | < | |
138 | < | // //we have the total number of molecules, now we check for molfractions |
139 | < | // for( i=0; i<n_components; i++ ){ |
140 | < | |
141 | < | // if( !the_components[i]->haveMolFraction() ){ |
142 | < | |
143 | < | // if( !the_components[i]->haveNMol() ){ |
144 | < | // //we have a problem |
145 | < | // std::cerr << "SimSetup error. Neither molFraction nor " |
146 | < | // << " nMol was given in component |
147 | < | |
134 | > | sprintf( painCave.errMsg, |
135 | > | "SimSetup error.\n" |
136 | > | "\tSorry, the ability to specify total" |
137 | > | " nMols and then give molfractions in the components\n" |
138 | > | "\tis not currently supported." |
139 | > | " Please give nMol in the components.\n" ); |
140 | > | painCave.isFatal = 1; |
141 | > | simError(); |
142 | > | |
143 | > | |
144 | > | // tot_nmol = the_globals->getNMol(); |
145 | > | |
146 | > | // //we have the total number of molecules, now we check for molfractions |
147 | > | // for( i=0; i<n_components; i++ ){ |
148 | > | |
149 | > | // if( !the_components[i]->haveMolFraction() ){ |
150 | > | |
151 | > | // if( !the_components[i]->haveNMol() ){ |
152 | > | // //we have a problem |
153 | > | // std::cerr << "SimSetup error. Neither molFraction nor " |
154 | > | // << " nMol was given in component |
155 | > | |
156 | } | |
157 | ||
158 | + | #ifdef IS_MPI |
159 | + | strcpy( checkPointMsg, "Have the number of components" ); |
160 | + | MPIcheckPoint(); |
161 | + | #endif // is_mpi |
162 | + | |
163 | // make an array of molecule stamps that match the components used. | |
164 | ||
165 | for( i=0; i<n_components; i++ ){ | |
# | Line 177 | Line 192 | void SimSetup::createSim( void ){ | |
192 | simnfo->n_torsions = tot_torsions; | |
193 | simnfo->n_SRI = tot_SRI; | |
194 | ||
195 | + | // divide the molecules among processors here. |
196 | + | |
197 | + | |
198 | // create the atom and short range interaction arrays | |
199 | ||
200 | Atom::createArrays(tot_atoms); | |
# | Line 222 | Line 240 | void SimSetup::createSim( void ){ | |
240 | if( simnfo->n_dipoles ){ | |
241 | ||
242 | if( !the_globals->haveRRF() ){ | |
243 | < | std::cerr << "SimSetup Error, system has dipoles, but no rRF was set.\n"; |
244 | < | exit(8); |
243 | > | sprintf( painCave.errMsg, |
244 | > | "SimSetup Error, system has dipoles, but no rRF was set.\n"); |
245 | > | painCave.isFatal = 1; |
246 | > | simError(); |
247 | } | |
248 | if( !the_globals->haveDielectric() ){ | |
249 | < | std::cerr << "SimSetup Error, system has dipoles, but no" |
250 | < | << " dielectric was set.\n"; |
251 | < | exit(8); |
249 | > | sprintf( painCave.errMsg, |
250 | > | "SimSetup Error, system has dipoles, but no" |
251 | > | " dielectric was set.\n" ); |
252 | > | painCave.isFatal = 1; |
253 | > | simError(); |
254 | } | |
255 | ||
256 | simnfo->rRF = the_globals->getRRF(); | |
257 | simnfo->dielectric = the_globals->getDielectric(); | |
258 | } | |
259 | ||
260 | + | #ifdef IS_MPI |
261 | + | strcpy( checkPointMsg, "rRf and dielectric check out" ); |
262 | + | MPIcheckPoint(); |
263 | + | #endif // is_mpi |
264 | + | |
265 | if( the_globals->haveBox() ){ | |
266 | simnfo->box_x = the_globals->getBox(); | |
267 | simnfo->box_y = the_globals->getBox(); | |
# | Line 250 | Line 277 | void SimSetup::createSim( void ){ | |
277 | } | |
278 | else{ | |
279 | if( !the_globals->haveBoxX() ){ | |
280 | < | std::cerr << "SimSetup error, no periodic BoxX size given.\n"; |
281 | < | exit(8); |
280 | > | sprintf( painCave.errMsg, |
281 | > | "SimSetup error, no periodic BoxX size given.\n" ); |
282 | > | painCave.isFatal = 1; |
283 | > | simError(); |
284 | } | |
285 | simnfo->box_x = the_globals->getBoxX(); | |
286 | ||
287 | if( !the_globals->haveBoxY() ){ | |
288 | < | std::cerr << "SimSetup error, no periodic BoxY size given.\n"; |
289 | < | exit(8); |
288 | > | sprintf( painCave.errMsg, |
289 | > | "SimSetup error, no periodic BoxY size given.\n" ); |
290 | > | painCave.isFatal = 1; |
291 | > | simError(); |
292 | } | |
293 | simnfo->box_y = the_globals->getBoxY(); | |
294 | ||
295 | if( !the_globals->haveBoxZ() ){ | |
296 | < | std::cerr << "SimSetup error, no periodic BoxZ size given.\n"; |
297 | < | exit(8); |
296 | > | sprintf( painCave.errMsg, |
297 | > | "SimSetup error, no periodic BoxZ size given.\n" ); |
298 | > | painCave.isFatal = 1; |
299 | > | simError(); |
300 | } | |
301 | simnfo->box_z = the_globals->getBoxZ(); | |
302 | } | |
303 | ||
304 | + | #ifdef IS_MPI |
305 | + | strcpy( checkPointMsg, "Box size set up" ); |
306 | + | MPIcheckPoint(); |
307 | + | #endif // is_mpi |
308 | ||
309 | + | |
310 | + | |
311 | // if( the_globals->haveInitialConfig() ){ | |
312 | // InitializeFromFile* fileInit; | |
313 | // fileInit = new InitializeFromFile( the_globals->getInitialConfig() ); | |
# | Line 279 | Line 318 | void SimSetup::createSim( void ){ | |
318 | // } | |
319 | // else{ | |
320 | ||
321 | < | initFromBass(); |
321 | > | initFromBass(); |
322 | > | |
323 | > | #ifdef IS_MPI |
324 | > | strcpy( checkPointMsg, "initFromBass successfully created the lattice" ); |
325 | > | MPIcheckPoint(); |
326 | > | #endif // is_mpi |
327 | ||
328 | ||
329 | < | // } |
330 | < | |
329 | > | |
330 | > | |
331 | > | |
332 | > | // } |
333 | > | |
334 | #ifdef IS_MPI | |
335 | < | if( worldRank == TESTWRITE ){ |
335 | > | if( worldRank == 0 ){ |
336 | #endif // is_mpi | |
337 | < | |
338 | < | fprintf( stderr, |
339 | < | "infile name is \"%s\"\n", |
340 | < | inFileName ); |
341 | < | |
342 | < | inFileName = "./butane.bass"; |
343 | < | |
344 | < | if( the_globals->haveFinalConfig() ){ |
345 | < | strcpy( simnfo->finalName, the_globals->getFinalConfig() ); |
337 | > | |
338 | > | if( the_globals->haveFinalConfig() ){ |
339 | > | strcpy( simnfo->finalName, the_globals->getFinalConfig() ); |
340 | > | } |
341 | > | else{ |
342 | > | strcpy( simnfo->finalName, inFileName ); |
343 | > | char* endTest; |
344 | > | int nameLength = strlen( simnfo->finalName ); |
345 | > | endTest = &(simnfo->finalName[nameLength - 5]); |
346 | > | if( !strcmp( endTest, ".bass" ) ){ |
347 | > | strcpy( endTest, ".eor" ); |
348 | } | |
349 | + | else if( !strcmp( endTest, ".BASS" ) ){ |
350 | + | strcpy( endTest, ".eor" ); |
351 | + | } |
352 | else{ | |
353 | < | strcpy( simnfo->finalName, inFileName ); |
354 | < | char* endTest; |
303 | < | int nameLength = strlen( simnfo->finalName ); |
304 | < | endTest = &(simnfo->finalName[nameLength - 5]); |
305 | < | if( !strcmp( endTest, ".bass" ) ){ |
353 | > | endTest = &(simnfo->finalName[nameLength - 4]); |
354 | > | if( !strcmp( endTest, ".bss" ) ){ |
355 | strcpy( endTest, ".eor" ); | |
356 | } | |
357 | < | else if( !strcmp( endTest, ".BASS" ) ){ |
357 | > | else if( !strcmp( endTest, ".mdl" ) ){ |
358 | strcpy( endTest, ".eor" ); | |
359 | } | |
360 | else{ | |
361 | < | endTest = &(simnfo->finalName[nameLength - 4]); |
313 | < | if( !strcmp( endTest, ".bss" ) ){ |
314 | < | strcpy( endTest, ".eor" ); |
315 | < | } |
316 | < | else if( !strcmp( endTest, ".mdl" ) ){ |
317 | < | strcpy( endTest, ".eor" ); |
318 | < | } |
319 | < | else{ |
320 | < | strcat( simnfo->finalName, ".eor" ); |
321 | < | } |
361 | > | strcat( simnfo->finalName, ".eor" ); |
362 | } | |
363 | } | |
364 | < | |
365 | < | // make the sample and status out names |
366 | < | |
367 | < | strcpy( simnfo->sampleName, inFileName ); |
368 | < | char* endTest; |
369 | < | int nameLength = strlen( simnfo->sampleName ); |
370 | < | endTest = &(simnfo->sampleName[nameLength - 5]); |
371 | < | if( !strcmp( endTest, ".bass" ) ){ |
364 | > | } |
365 | > | |
366 | > | // make the sample and status out names |
367 | > | |
368 | > | strcpy( simnfo->sampleName, inFileName ); |
369 | > | char* endTest; |
370 | > | int nameLength = strlen( simnfo->sampleName ); |
371 | > | endTest = &(simnfo->sampleName[nameLength - 5]); |
372 | > | if( !strcmp( endTest, ".bass" ) ){ |
373 | > | strcpy( endTest, ".dump" ); |
374 | > | } |
375 | > | else if( !strcmp( endTest, ".BASS" ) ){ |
376 | > | strcpy( endTest, ".dump" ); |
377 | > | } |
378 | > | else{ |
379 | > | endTest = &(simnfo->sampleName[nameLength - 4]); |
380 | > | if( !strcmp( endTest, ".bss" ) ){ |
381 | strcpy( endTest, ".dump" ); | |
382 | } | |
383 | < | else if( !strcmp( endTest, ".BASS" ) ){ |
383 | > | else if( !strcmp( endTest, ".mdl" ) ){ |
384 | strcpy( endTest, ".dump" ); | |
385 | } | |
386 | else{ | |
387 | < | endTest = &(simnfo->sampleName[nameLength - 4]); |
339 | < | if( !strcmp( endTest, ".bss" ) ){ |
340 | < | strcpy( endTest, ".dump" ); |
341 | < | } |
342 | < | else if( !strcmp( endTest, ".mdl" ) ){ |
343 | < | strcpy( endTest, ".dump" ); |
344 | < | } |
345 | < | else{ |
346 | < | strcat( simnfo->sampleName, ".dump" ); |
347 | < | } |
387 | > | strcat( simnfo->sampleName, ".dump" ); |
388 | } | |
389 | < | |
390 | < | strcpy( simnfo->statusName, inFileName ); |
391 | < | nameLength = strlen( simnfo->statusName ); |
392 | < | endTest = &(simnfo->statusName[nameLength - 5]); |
393 | < | if( !strcmp( endTest, ".bass" ) ){ |
389 | > | } |
390 | > | |
391 | > | strcpy( simnfo->statusName, inFileName ); |
392 | > | nameLength = strlen( simnfo->statusName ); |
393 | > | endTest = &(simnfo->statusName[nameLength - 5]); |
394 | > | if( !strcmp( endTest, ".bass" ) ){ |
395 | > | strcpy( endTest, ".stat" ); |
396 | > | } |
397 | > | else if( !strcmp( endTest, ".BASS" ) ){ |
398 | > | strcpy( endTest, ".stat" ); |
399 | > | } |
400 | > | else{ |
401 | > | endTest = &(simnfo->statusName[nameLength - 4]); |
402 | > | if( !strcmp( endTest, ".bss" ) ){ |
403 | strcpy( endTest, ".stat" ); | |
404 | } | |
405 | < | else if( !strcmp( endTest, ".BASS" ) ){ |
405 | > | else if( !strcmp( endTest, ".mdl" ) ){ |
406 | strcpy( endTest, ".stat" ); | |
407 | } | |
408 | else{ | |
409 | < | endTest = &(simnfo->statusName[nameLength - 4]); |
361 | < | if( !strcmp( endTest, ".bss" ) ){ |
362 | < | strcpy( endTest, ".stat" ); |
363 | < | } |
364 | < | else if( !strcmp( endTest, ".mdl" ) ){ |
365 | < | strcpy( endTest, ".stat" ); |
366 | < | } |
367 | < | else{ |
368 | < | strcat( simnfo->statusName, ".stat" ); |
369 | < | } |
409 | > | strcat( simnfo->statusName, ".stat" ); |
410 | } | |
371 | – | |
372 | – | #ifdef IS_MPI |
411 | } | |
412 | < | #endif // is_mpi |
413 | < | |
412 | > | |
413 | > | #ifdef IS_MPI |
414 | > | } |
415 | > | #endif // is_mpi |
416 | > | |
417 | // set the status, sample, and themal kick times | |
418 | < | |
418 | > | |
419 | if( the_globals->haveSampleTime() ){ | |
420 | simnfo->sampleTime = the_globals->getSampleTime(); | |
421 | simnfo->statusTime = simnfo->sampleTime; | |
# | Line 597 | Line 638 | void SimSetup::initFromBass( void ){ | |
638 | n_per_extra = (int)ceil( temp1 ); | |
639 | ||
640 | if( n_per_extra > 4){ | |
641 | < | std::cerr << "THere has been an error in constructing the non-complete lattice.\n"; |
642 | < | exit(8); |
641 | > | sprintf( painCave.errMsg, |
642 | > | "SimSetup error. There has been an error in constructing" |
643 | > | " the non-complete lattice.\n" ); |
644 | > | painCave.isFatal = 1; |
645 | > | simError(); |
646 | } | |
647 | } | |
648 | else{ | |
# | Line 703 | Line 747 | void SimSetup::makeElement( double x, double y, double | |
747 | ||
748 | current_atom = comp_stamps[current_comp]->getAtom( k ); | |
749 | if( !current_atom->havePosition() ){ | |
750 | < | std::cerr << "Component " << comp_stamps[current_comp]->getID() |
751 | < | << ", atom " << current_atom->getType() |
752 | < | << " does not have a position specified.\n" |
753 | < | << "The initialization routine is unable to give a start" |
754 | < | << " position.\n"; |
755 | < | exit(8); |
750 | > | sprintf( painCave.errMsg, |
751 | > | "SimSetup:initFromBass error.\n" |
752 | > | "\tComponent %s, atom %s does not have a position specified.\n" |
753 | > | "\tThe initialization routine is unable to give a start" |
754 | > | " position.\n", |
755 | > | comp_stamps[current_comp]->getID(), |
756 | > | current_atom->getType() ); |
757 | > | painCave.isFatal = 1; |
758 | > | simError(); |
759 | } | |
760 | ||
761 | the_atoms[current_atom_ndx]->setX( x + current_atom->getPosX() ); |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |