Changeset 85bac0 for src/moleculelist.cpp
- Timestamp:
- Sep 11, 2008, 1:28:25 PM (16 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
- Children:
- c30cda
- Parents:
- a1fe77
- 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
Legend:
- Unmodified
- Added
- Removed
-
src/moleculelist.cpp
ra1fe77 r85bac0 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.