Changeset 4455f4 for src/config.cpp


Ignore:
Timestamp:
Oct 19, 2009, 1:09:29 PM (16 years ago)
Author:
Frederik Heber <heber@…>
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, Candidate_v1.7.0, 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:
c75de1
Parents:
9eefda
Message:

Huge Refactoring: class atom split up into several inherited classes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/config.cpp

    r9eefda r4455f4  
    99#include "element.hpp"
    1010#include "helpers.hpp"
     11#include "molecule.hpp"
    1112#include "memoryallocator.hpp"
    1213#include "molecule.hpp"
     
    14441445bool config::SaveMPQC(const char *filename, molecule *mol) const
    14451446{
    1446   int ElementNo = 0;
    14471447  int AtomNo;
    1448   atom *Walker = NULL;
    1449   element *runner = NULL;
    14501448  Vector *center = NULL;
    14511449  ofstream *output = NULL;
     
    14751473  center = mol->DetermineCenterOfAll(output);
    14761474  // output of atoms
    1477   runner = mol->elemente->start;
    1478   while (runner->next != mol->elemente->end) { // go through every element
    1479     runner = runner->next;
    1480     if (mol->ElementsInMolecule[runner->Z]) { // if this element got atoms
    1481       ElementNo++;
    1482       AtomNo = 0;
    1483       Walker = mol->start;
    1484       while (Walker->next != mol->end) { // go through every atom of this element
    1485         Walker = Walker->next;
    1486         if (Walker->type == runner) { // if this atom fits to element
    1487           AtomNo++;
    1488           *output << "\t\t" << Walker->type->symbol << " [ " << Walker->x.x[0]-center->x[0] << "\t" << Walker->x.x[1]-center->x[1] << "\t" << Walker->x.x[2]-center->x[2] << " ]" << endl;
    1489         }
    1490       }
    1491     }
    1492   }
     1475  AtomNo = 0;
     1476  mol->ActOnAllAtoms( &atom::OutputMPQCLine, output, center, &AtomNo );
    14931477  delete(center);
    14941478  *output << "\t}" << endl;
     
    15241508  center = mol->DetermineCenterOfAll(output);
    15251509  // output of atoms
    1526   runner = mol->elemente->start;
    1527   while (runner->next != mol->elemente->end) { // go through every element
    1528     runner = runner->next;
    1529     if (mol->ElementsInMolecule[runner->Z]) { // if this element got atoms
    1530       ElementNo++;
    1531       AtomNo = 0;
    1532       Walker = mol->start;
    1533       while (Walker->next != mol->end) { // go through every atom of this element
    1534         Walker = Walker->next;
    1535         if (Walker->type == runner) { // if this atom fits to element
    1536           AtomNo++;
    1537           *output << "\t\t" << Walker->type->symbol << " [ " << Walker->x.x[0]-center->x[0] << "\t" << Walker->x.x[1]-center->x[1] << "\t" << Walker->x.x[2]-center->x[2] << " ]" << endl;
    1538         }
    1539       }
    1540     }
    1541   }
     1510  AtomNo = 0;
     1511  mol->ActOnAllAtoms( &atom::OutputMPQCLine, output, center, &AtomNo );
    15421512  delete(center);
    15431513  *output << "\t}" << endl;
Note: See TracChangeset for help on using the changeset viewer.