Changes in src/moleculelist.cpp [2746be:edcda5]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/moleculelist.cpp
-
Property mode
changed from
100755
to100644
r2746be redcda5 378 378 * \param *configuration standard configuration to attach atoms in fragment molecule to. 379 379 * \param *SortIndex Index to map from the BFS labeling to the sequence how of Ion_Type in the config 380 * \param DoPeriodic true - call ScanForPeriodicCorrection, false - don't 381 * \param DoCentering true - call molecule::CenterEdge(), false - don't 380 382 * \return true - success (each file was written), false - something went wrong. 381 383 */ 382 bool MoleculeListClass::OutputConfigForListOfFragments(ofstream *out, con fig *configuration, int *SortIndex)384 bool MoleculeListClass::OutputConfigForListOfFragments(ofstream *out, const char *fragmentprefix, config *configuration, int *SortIndex, bool DoPeriodic, bool DoCentering) 383 385 { 384 386 ofstream outputFragment; … … 393 395 int FragmentCounter = 0; 394 396 ofstream output; 395 string basis("3-21G");396 397 397 398 // store the fragments as config and as xyz … … 405 406 406 407 // correct periodic 407 //ListOfMolecules[i]->ScanForPeriodicCorrection(out); 408 if (DoPeriodic) 409 ListOfMolecules[i]->ScanForPeriodicCorrection(out); 408 410 409 411 // output xyz file 410 412 FragmentNumber = FixedDigitNumber(NumberOfMolecules, FragmentCounter++); 411 sprintf(FragmentName, "%s/%s%s.conf.xyz", configuration->configpath, FRAGMENTPREFIX, FragmentNumber);413 sprintf(FragmentName, "%s/%s%s.conf.xyz", configuration->configpath, fragmentprefix, FragmentNumber); 412 414 outputFragment.open(FragmentName, ios::out); 413 *out << Verbose(2) << "Saving bond fragmentNo. " << FragmentNumber << "/" << FragmentCounter-1 << " as XYZ ...";415 *out << Verbose(2) << "Saving " << fragmentprefix << " No. " << FragmentNumber << "/" << FragmentCounter-1 << " as XYZ ..."; 414 416 if ((intermediateResult = ListOfMolecules[i]->OutputXYZ(&outputFragment))) 415 417 *out << " done." << endl; … … 430 432 431 433 // center on edge 432 ListOfMolecules[i]->CenterEdge(out, &BoxDimension); 433 ListOfMolecules[i]->SetBoxDimension(&BoxDimension); // update Box of atoms by boundary 434 int j = -1; 435 for (int k=0;k<NDIM;k++) { 436 j += k+1; 437 BoxDimension.x[k] = 2.5* (configuration->GetIsAngstroem() ? 1. : 1./AtomicLengthToAngstroem); 438 ListOfMolecules[i]->cell_size[j] += BoxDimension.x[k]*2.; 439 } 440 ListOfMolecules[i]->Translate(&BoxDimension); 434 if (DoCentering) { 435 ListOfMolecules[i]->CenterEdge(out, &BoxDimension); 436 ListOfMolecules[i]->SetBoxDimension(&BoxDimension); // update Box of atoms by boundary 437 int j = -1; 438 for (int k=0;k<NDIM;k++) { 439 j += k+1; 440 BoxDimension.x[k] = 2.5* (configuration->GetIsAngstroem() ? 1. : 1./AtomicLengthToAngstroem); 441 ListOfMolecules[i]->cell_size[j] += BoxDimension.x[k]*2.; 442 } 443 ListOfMolecules[i]->Translate(&BoxDimension); 444 } 441 445 442 446 // also calculate necessary orbitals … … 446 450 // change path in config 447 451 //strcpy(PathBackup, configuration->configpath); 448 sprintf(FragmentName, "%s/%s%s/", PathBackup, FRAGMENTPREFIX, FragmentNumber);452 sprintf(FragmentName, "%s/%s%s/", PathBackup, fragmentprefix, FragmentNumber); 449 453 configuration->SetDefaultPath(FragmentName); 450 454 451 455 // and save as config 452 sprintf(FragmentName, "%s/%s%s.conf", configuration->configpath, FRAGMENTPREFIX, FragmentNumber); 453 *out << Verbose(2) << "Saving bond fragment No. " << FragmentNumber << "/" << FragmentCounter-1 << " as config ..."; 454 if ((intermediateResult = configuration->Save(FragmentName, ListOfMolecules[i]->elemente, ListOfMolecules[i]))) 456 sprintf(FragmentName, "%s/%s%s.conf", configuration->configpath, fragmentprefix, FragmentNumber); 457 outputFragment.open(FragmentName, ios::out); 458 *out << Verbose(2) << "Saving " << fragmentprefix << " No. " << FragmentNumber << "/" << FragmentCounter-1 << " as config ..."; 459 if ((intermediateResult = configuration->Save(&outputFragment, ListOfMolecules[i]->elemente, ListOfMolecules[i]))) 455 460 *out << " done." << endl; 456 461 else 457 462 *out << " failed." << endl; 458 result = result && intermediateResult;459 463 460 464 // restore old config 461 465 configuration->SetDefaultPath(PathBackup); 462 466 467 result = result && intermediateResult; 468 outputFragment.close(); 469 outputFragment.clear(); 463 470 464 471 // and save as mpqc input file 465 sprintf(FragmentName, "%s/%s%s.conf", configuration->configpath, FRAGMENTPREFIX, FragmentNumber); 466 *out << Verbose(2) << "Saving bond fragment No. " << FragmentNumber << "/" << FragmentCounter-1 << " as mpqc input ..."; 467 if ((intermediateResult = configuration->SaveMPQC(FragmentName, ListOfMolecules[i]))) 472 sprintf(FragmentName, "%s/%s%s.in", configuration->configpath, fragmentprefix, FragmentNumber); 473 outputFragment.open(FragmentName, ios::out); 474 *out << Verbose(2) << "Saving " << fragmentprefix << " No. " << FragmentNumber << "/" << FragmentCounter-1 << " as mpqc input ..."; 475 if ((intermediateResult = configuration->SaveMPQC(&outputFragment, ListOfMolecules[i]))) 468 476 *out << " done." << endl; 469 477 else … … 471 479 472 480 result = result && intermediateResult; 473 //outputFragment.close();474 //outputFragment.clear();481 outputFragment.close(); 482 outputFragment.clear(); 475 483 delete(FragmentNumber); 476 484 //Free((void **)&FragmentNumber, "MoleculeListClass::OutputConfigForListOfFragments: *FragmentNumber"); -
Property mode
changed from
Note:
See TracChangeset
for help on using the changeset viewer.