Changeset 63b5c31 for molecuilder/src/moleculelist.cpp
- Timestamp:
- Sep 11, 2008, 1:28:25 PM (17 years ago)
- Children:
- 9070650
- Parents:
- 909610
- git-author:
- Frederik Heber <heber@…> (09/09/08 15:29:58)
- git-committer:
- Frederik Heber <heber@…> (09/11/08 13:28:25)
- File:
-
- 1 edited
-
molecuilder/src/moleculelist.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/moleculelist.cpp
r909610 r63b5c31 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; … … 404 406 405 407 // correct periodic 406 ListOfMolecules[i]->ScanForPeriodicCorrection(out); 408 if (DoPeriodic) 409 ListOfMolecules[i]->ScanForPeriodicCorrection(out); 407 410 408 411 // output xyz file 409 412 FragmentNumber = FixedDigitNumber(NumberOfMolecules, FragmentCounter++); 410 sprintf(FragmentName, "%s/%s%s.conf.xyz", configuration->configpath, FRAGMENTPREFIX, FragmentNumber);413 sprintf(FragmentName, "%s/%s%s.conf.xyz", configuration->configpath, fragmentprefix, FragmentNumber); 411 414 outputFragment.open(FragmentName, ios::out); 412 *out << Verbose(2) << "Saving bond fragmentNo. " << FragmentNumber << "/" << FragmentCounter-1 << " as XYZ ...";415 *out << Verbose(2) << "Saving " << fragmentprefix << " No. " << FragmentNumber << "/" << FragmentCounter-1 << " as XYZ ..."; 413 416 if ((intermediateResult = ListOfMolecules[i]->OutputXYZ(&outputFragment))) 414 417 *out << " done." << endl; … … 429 432 430 433 // center on edge 431 ListOfMolecules[i]->CenterEdge(out, &BoxDimension); 432 ListOfMolecules[i]->SetBoxDimension(&BoxDimension); // update Box of atoms by boundary 433 int j = -1; 434 for (int k=0;k<NDIM;k++) { 435 j += k+1; 436 BoxDimension.x[k] = 2.5* (configuration->GetIsAngstroem() ? 1. : 1./AtomicLengthToAngstroem); 437 ListOfMolecules[i]->cell_size[j] += BoxDimension.x[k]*2.; 438 } 439 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 } 440 445 441 446 // also calculate necessary orbitals … … 445 450 // change path in config 446 451 //strcpy(PathBackup, configuration->configpath); 447 sprintf(FragmentName, "%s/%s%s/", PathBackup, FRAGMENTPREFIX, FragmentNumber);452 sprintf(FragmentName, "%s/%s%s/", PathBackup, fragmentprefix, FragmentNumber); 448 453 configuration->SetDefaultPath(FragmentName); 449 454 450 455 // and save as config 451 sprintf(FragmentName, "%s/%s%s.conf", configuration->configpath, FRAGMENTPREFIX, FragmentNumber);456 sprintf(FragmentName, "%s/%s%s.conf", configuration->configpath, fragmentprefix, FragmentNumber); 452 457 outputFragment.open(FragmentName, ios::out); 453 *out << Verbose(2) << "Saving bond fragmentNo. " << FragmentNumber << "/" << FragmentCounter-1 << " as config ...";458 *out << Verbose(2) << "Saving " << fragmentprefix << " No. " << FragmentNumber << "/" << FragmentCounter-1 << " as config ..."; 454 459 if ((intermediateResult = configuration->Save(&outputFragment, ListOfMolecules[i]->elemente, ListOfMolecules[i]))) 455 460 *out << " done." << endl; … … 465 470 466 471 // and save as mpqc input file 467 sprintf(FragmentName, "%s/%s%s.in", configuration->configpath, FRAGMENTPREFIX, FragmentNumber);472 sprintf(FragmentName, "%s/%s%s.in", configuration->configpath, fragmentprefix, FragmentNumber); 468 473 outputFragment.open(FragmentName, ios::out); 469 *out << Verbose(2) << "Saving bond fragmentNo. " << FragmentNumber << "/" << FragmentCounter-1 << " as mpqc input ...";474 *out << Verbose(2) << "Saving " << fragmentprefix << " No. " << FragmentNumber << "/" << FragmentCounter-1 << " as mpqc input ..."; 470 475 if ((intermediateResult = configuration->SaveMPQC(&outputFragment, ListOfMolecules[i]))) 471 476 *out << " done." << endl;
Note:
See TracChangeset
for help on using the changeset viewer.
