Changes in src/moleculelist.cpp [edcda5:2746be]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/moleculelist.cpp
-
Property mode
changed from
100644
to100755
redcda5 r2746be 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't381 * \param DoCentering true - call molecule::CenterEdge(), false - don't382 380 * \return true - success (each file was written), false - something went wrong. 383 381 */ 384 bool MoleculeListClass::OutputConfigForListOfFragments(ofstream *out, con st char *fragmentprefix, config *configuration, int *SortIndex, bool DoPeriodic, bool DoCentering)382 bool MoleculeListClass::OutputConfigForListOfFragments(ofstream *out, config *configuration, int *SortIndex) 385 383 { 386 384 ofstream outputFragment; … … 395 393 int FragmentCounter = 0; 396 394 ofstream output; 395 string basis("3-21G"); 397 396 398 397 // store the fragments as config and as xyz … … 406 405 407 406 // correct periodic 408 if (DoPeriodic) 409 ListOfMolecules[i]->ScanForPeriodicCorrection(out); 407 //ListOfMolecules[i]->ScanForPeriodicCorrection(out); 410 408 411 409 // output xyz file 412 410 FragmentNumber = FixedDigitNumber(NumberOfMolecules, FragmentCounter++); 413 sprintf(FragmentName, "%s/%s%s.conf.xyz", configuration->configpath, fragmentprefix, FragmentNumber);411 sprintf(FragmentName, "%s/%s%s.conf.xyz", configuration->configpath, FRAGMENTPREFIX, FragmentNumber); 414 412 outputFragment.open(FragmentName, ios::out); 415 *out << Verbose(2) << "Saving " << fragmentprefix << "No. " << FragmentNumber << "/" << FragmentCounter-1 << " as XYZ ...";413 *out << Verbose(2) << "Saving bond fragment No. " << FragmentNumber << "/" << FragmentCounter-1 << " as XYZ ..."; 416 414 if ((intermediateResult = ListOfMolecules[i]->OutputXYZ(&outputFragment))) 417 415 *out << " done." << endl; … … 432 430 433 431 // center on edge 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 } 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); 445 441 446 442 // also calculate necessary orbitals … … 450 446 // change path in config 451 447 //strcpy(PathBackup, configuration->configpath); 452 sprintf(FragmentName, "%s/%s%s/", PathBackup, fragmentprefix, FragmentNumber);448 sprintf(FragmentName, "%s/%s%s/", PathBackup, FRAGMENTPREFIX, FragmentNumber); 453 449 configuration->SetDefaultPath(FragmentName); 454 450 455 451 // and save as config 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]))) 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]))) 460 455 *out << " done." << endl; 461 456 else 462 457 *out << " failed." << endl; 458 result = result && intermediateResult; 463 459 464 460 // restore old config 465 461 configuration->SetDefaultPath(PathBackup); 466 462 467 result = result && intermediateResult;468 outputFragment.close();469 outputFragment.clear();470 463 471 464 // and save as mpqc input file 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]))) 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]))) 476 468 *out << " done." << endl; 477 469 else … … 479 471 480 472 result = result && intermediateResult; 481 outputFragment.close();482 outputFragment.clear();473 //outputFragment.close(); 474 //outputFragment.clear(); 483 475 delete(FragmentNumber); 484 476 //Free((void **)&FragmentNumber, "MoleculeListClass::OutputConfigForListOfFragments: *FragmentNumber"); -
Property mode
changed from
Note:
See TracChangeset
for help on using the changeset viewer.