Changeset cee0b57 for src/molecule.hpp


Ignore:
Timestamp:
Oct 5, 2009, 10:10:53 PM (15 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, 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:
ebcade
Parents:
d09ff7
Message:

class molecule implementation split up into six separate parts.

  • dynamics: Verlet integration and constraint potential
  • fragmentation: BOSSANOVA scheme
  • geometry: all operations acting on the Vector's inside the atom's
  • graph: supplementary functions for fragmentation, treating molecule as a bonding graph
  • pointcloud: implementations of virtual functions for pointcloud class, needed for Tesselation
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/molecule.hpp

    rd09ff7 rcee0b57  
    1 /** \file molecules.hpp
     1/** \file molecule.hpp
    22 *
    33 * Class definitions of atom and molecule, element and periodentafel
     
    133133
    134134  // templates for allowing global manipulation of all vectors
     135  template <typename res> void ActOnAllVectors( res (Vector::*f)() );
    135136  template <typename res, typename T> void ActOnAllVectors( res (Vector::*f)(T), T t );
    136137  template <typename res, typename T, typename U> void ActOnAllVectors( res (Vector::*f)(T, U), T t, U u );
    137138  template <typename res, typename T, typename U, typename V> void ActOnAllVectors( res (Vector::*f)(T, U, V), T t, U u, V v);
     139
     140  // templates for allowing global manipulation of all atoms
     141  template <typename res> void ActOnAllAtoms( res (molecule::*f)(atom *) );
     142  template <typename res> void ActOnAllAtoms( res (atom::*f)() );
     143  template <typename res, typename T> void ActOnAllAtoms( res (atom::*f)(T), T t );
     144  template <typename res, typename T, typename U> void ActOnAllAtoms( res (atom::*f)(T, U), T t, U u );
     145  template <typename res, typename T, typename U, typename V> void ActOnAllAtoms( res (atom::*f)(T, U, V), T t, U u, V v);
    138146
    139147  /// remove atoms from molecule.
     
    147155  bool AddXYZFile(string filename);
    148156  bool AddHydrogenReplacementAtom(ofstream *out, bond *Bond, atom *BottomOrigin, atom *TopOrigin, atom *TopReplacement, bond **BondList, int NumBond, bool IsAngstroem);
    149   bond * AddBond(atom *first, atom *second, int degree);
     157  bond * AddBond(atom *first, atom *second, int degree = 1);
    150158  bool RemoveBond(bond *pointer);
    151159  bool RemoveBonds(atom *BondPartner);
     
    255263
    256264
     265template <typename res> void molecule::ActOnAllVectors( res (Vector::*f)() ) {
     266  atom *Walker = start;
     267  while (Walker->next != end) {
     268    Walker = Walker->next;
     269    ((Walker->node)->*f)();
     270  }
     271};
    257272template <typename res, typename T> void molecule::ActOnAllVectors( res (Vector::*f)(T), T t )
    258273{
     
    260275  while (Walker->next != end) {
    261276    Walker = Walker->next;
    262     ((*Walker->node)->*f)(t);
    263   }
    264 };
    265 
     277    ((Walker->node)->*f)(t);
     278  }
     279};
    266280template <typename res, typename T, typename U> void molecule::ActOnAllVectors( res (Vector::*f)(T, U), T t, U u )
    267281{
     
    269283  while (Walker->next != end) {
    270284    Walker = Walker->next;
    271     ((*Walker->node)->*f)(t, u);
    272   }
    273 };
    274 
     285    ((Walker->node)->*f)(t, u);
     286  }
     287};
    275288template <typename res, typename T, typename U, typename V> void molecule::ActOnAllVectors( res (Vector::*f)(T, U, V), T t, U u, V v)
    276289{
     
    278291  while (Walker->next != end) {
    279292    Walker = Walker->next;
    280     ((*Walker->node)->*f)(t, u, v);
     293    ((Walker->node)->*f)(t, u, v);
     294  }
     295};
     296
     297template <typename res> void molecule::ActOnAllAtoms( res (molecule::*f)(atom *)) {
     298  atom *Walker = start;
     299  while (Walker->next != end) {
     300    Walker = Walker->next;
     301    (*f)(Walker);
     302  }
     303};
     304
     305template <typename res> void molecule::ActOnAllAtoms( res (atom::*f)()) {
     306  atom *Walker = start;
     307  while (Walker->next != end) {
     308    Walker = Walker->next;
     309    (Walker->*f)();
     310  }
     311};
     312template <typename res, typename T> void molecule::ActOnAllAtoms( res (atom::*f)(T), T t )
     313{
     314  atom *Walker = start;
     315  while (Walker->next != end) {
     316    Walker = Walker->next;
     317    (Walker->*f)(t);
     318  }
     319};
     320template <typename res, typename T, typename U> void molecule::ActOnAllAtoms( res (atom::*f)(T, U), T t, U u )
     321{
     322  atom *Walker = start;
     323  while (Walker->next != end) {
     324    Walker = Walker->next;
     325    (Walker->*f)(t, u);
     326  }
     327};
     328template <typename res, typename T, typename U, typename V> void molecule::ActOnAllAtoms( res (atom::*f)(T, U, V), T t, U u, V v)
     329{
     330  atom *Walker = start;
     331  while (Walker->next != end) {
     332    Walker = Walker->next;
     333    (Walker->*f)(t, u, v);
    281334  }
    282335};
Note: See TracChangeset for help on using the changeset viewer.