source: src/Fragmentation/SetValues/Fragment.hpp@ 184943

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
Last change on this file since 184943 was 184943, checked in by Frederik Heber <heber@…>, 13 years ago

Added Fragment to MPQCData fusion maps and is used in FragmentationAutomationAction.

  • new helpers Fragment::getPositions() and ::getCharges().
  • SumUpChargeDensity() now also sums up a full Fragment.
  • the Fragment is used by createLongRangeJobs to extract required posittions and charges from.
  • Property mode set to 100644
File size: 2.4 KB
Line 
1/*
2 * Fragment.hpp
3 *
4 * Created on: Aug 8, 2012
5 * Author: heber
6 */
7
8#ifndef FRAGMENT_HPP_
9#define FRAGMENT_HPP_
10
11
12// include config.h
13#ifdef HAVE_CONFIG_H
14#include <config.h>
15#endif
16
17#include <iosfwd>
18#include <vector>
19
20class Fragment {
21 //!> grant ostream operator access
22 friend std::ostream & operator<<(std::ostream &ost, const Fragment &f);
23public:
24 typedef std::vector< std::vector<double> > positions_t;
25 typedef std::vector< double > charges_t;
26 typedef std::pair< std::vector<double>, double> nucleus_t;
27 typedef std::vector< nucleus_t > nuclei_t;
28
29 /** Default constructor of class Fragment.
30 *
31 */
32 Fragment();
33
34 /** Default constructor of class Fragment.
35 *
36 */
37 Fragment(const nuclei_t &_nuclei) :
38 nuclei(_nuclei)
39 {}
40
41 /** Constructor of class Fragment.
42 *
43 * @param _positions given positions
44 * @param _charges given charges
45 */
46 Fragment(const std::vector< std::vector<double> > &_positions, const std::vector< double > &_charges);
47
48 /** Adding another fragment onto this one.
49 *
50 * \note The operation is area-conserving, i.e. the new area is the sum of
51 * both areas.
52 *
53 * @param other other fragment
54 * @return ref to this instance
55 */
56 Fragment& operator+=(const Fragment &other);
57
58 /** Assignment operator.
59 *
60 * @param other other fragment to make ourselves equal to
61 * @return ref to this instance
62 */
63 Fragment& operator=(const Fragment &other);
64
65 /** Subtracting another fragment from this one.
66 *
67 * @param other other fragment
68 * @return ref to this instance
69 */
70 Fragment& operator-=(const Fragment &other);
71
72 /** Getter for all stored positions.
73 *
74 * @return vector of positions
75 */
76 positions_t getPositions() const;
77
78 /** Getter for all stored charges.
79 *
80 * @return vector of charges
81 */
82 charges_t getCharges() const;
83
84private:
85 /** Helper function that checks whether this nuclei is present.
86 *
87 * This operation is \f${\cal O}(n)\f$
88 *
89 * @param n nuclei to check
90 * @return true - is contained, false - is not contained
91 */
92 bool containsNuclei(const nucleus_t &n) const;
93
94 /** Seeks through all nuclei and removes matching one if found.
95 *
96 * @param n nuclei to remove
97 */
98 void removeNuclei(const nucleus_t &n);
99
100private:
101 nuclei_t nuclei;
102};
103
104std::ostream & operator<<(std::ostream &ost, const Fragment &f);
105
106template<typename T> T ZeroInstance();
107template<> Fragment ZeroInstance<Fragment>();
108
109#endif /* FRAGMENT_HPP_ */
Note: See TracBrowser for help on using the repository browser.