Changeset a9d254
- Timestamp:
- May 21, 2008, 11:14:06 AM (17 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:
- ca2b83
- Parents:
- 3b67a1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/molecules.cpp
r3b67a1 ra9d254 461 461 istringstream *item = new istringstream(line); 462 462 //istringstream input(line); 463 cout << Verbose(1) << "Reading: " << line << endl;463 //cout << Verbose(1) << "Reading: " << line << endl; 464 464 *item >> shorthand; 465 465 *item >> x[0]; … … 596 596 cell_size[4] = 0.; 597 597 cell_size[5] = dim->x[2]; 598 }; 599 600 /** Centers the molecule in the box whose lengths are defined by vector \a *BoxLengths. 601 * \param *out output stream for debugging 602 * \param *BoxLengths box lengths 603 */ 604 bool molecule::CenterInBox(ofstream *out, vector *BoxLengths) 605 { 606 bool status = true; 607 atom *ptr = NULL; 608 vector *min = new vector; 609 vector *max = new vector; 610 611 // gather min and max for each axis 612 ptr = start->next; // start at first in list 613 if (ptr != end) { //list not empty? 614 for (int i=0;i<NDIM;i++) { 615 max->x[i] = ptr->x.x[i]; 616 min->x[i] = ptr->x.x[i]; 617 } 618 while (ptr->next != end) { // continue with second if present 619 ptr = ptr->next; 620 //ptr->Output(1,1,out); 621 for (int i=0;i<NDIM;i++) { 622 max->x[i] = (max->x[i] < ptr->x.x[i]) ? ptr->x.x[i] : max->x[i]; 623 min->x[i] = (min->x[i] > ptr->x.x[i]) ? ptr->x.x[i] : min->x[i]; 624 } 625 } 626 } 627 // sanity check 628 for(int i=0;i<NDIM;i++) { 629 if (max->x[i] - min->x[i] > BoxLengths->x[i]) 630 status = false; 631 } 632 // warn if check failed 633 if (!status) 634 *out << "WARNING: molecule is bigger than defined box!" << endl; 635 else { // else center in box 636 ptr = start; 637 while (ptr->next != end) { 638 ptr = ptr->next; 639 for (int i=0;i<NDIM;i++) 640 ptr->x.x[i] += -(max->x[i] + min->x[i])/2. + BoxLengths->x[i]/2.; // first term centers molecule at (0,0,0), second shifts to center of new box 641 } 642 } 643 644 // free and exit 645 delete(min); 646 delete(max); 647 return status; 598 648 }; 599 649 … … 884 934 * \param *text question before entering 885 935 */ 886 atom * molecule::AskAtom( char *text)936 atom * molecule::AskAtom(string text) 887 937 { 888 938 int No; … … 1204 1254 * \return string of the flag 1205 1255 */ 1206 char *molecule::GetColor(enum Shading color)1256 string molecule::GetColor(enum Shading color) 1207 1257 { 1208 1258 switch(color) { … … 3240 3290 3241 3291 // Hier muessen von 1 bis NumberOfBondsPerAtom[Walker->nr] alle Kombinationen 3242 // von Endstuecken (aus den Bonds) hinzugef ÃŒgt werden und fÃŒr verbleibende ANOVAOrder3243 // rekursiv GraphCrawler in der n Àchsten Ebene aufgerufen werden3292 // von Endstuecken (aus den Bonds) hinzugefᅵᅵgt werden und fᅵᅵr verbleibende ANOVAOrder 3293 // rekursiv GraphCrawler in der nᅵᅵchsten Ebene aufgerufen werden 3244 3294 3245 3295 *out << Verbose(1+verbosity) << "Begin of SPFragmentGenerator." << endl;
Note:
See TracChangeset
for help on using the changeset viewer.