source: src/Filling/ClusterInterface.hpp@ aec098

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 aec098 was 9e5a306, checked in by Frederik Heber <heber@…>, 13 years ago

Added ClusterInterface.

  • this is preparatory for using a Cluster as possible atom sets.
  • ClusterInterface has getShape(), transform(), and translate(), also its clone() requires CopyAtomsInterface.
  • Property mode set to 100644
File size: 2.6 KB
Line 
1/*
2 * ClusterInterface.hpp
3 *
4 * Created on: Jan 20, 2012
5 * Author: heber
6 */
7
8#ifndef CLUSTERINTERFACE_HPP_
9#define CLUSTERINTERFACE_HPP_
10
11
12// include config.h
13#ifdef HAVE_CONFIG_H
14#include <config.h>
15#endif
16
17#include <boost/shared_ptr.hpp>
18#include <set>
19
20#include "AtomIdSet.hpp"
21#include "types.hpp"
22
23class atom;
24class CopyAtomsInterface;
25class RealSpaceMatrix;
26class Shape;
27class Vector;
28
29/** This is the interface class for clusters.
30 *
31 * Clusters are containers for \refAtomIdSet that make sure that within a given
32 * shape each of the atoms in the \ref AtomIdSet is contained and none else.
33 *
34 * We need this ClusterInterface to allow for ClusterInterface::clone() to not
35 * return a pointer but a boost::shared_ptr which is much cleaner in terms of
36 * memory management.
37 *
38 */
39class ClusterInterface
40{
41public:
42 //!> typedef for pointer to ClusterInterface-compatible instances
43 typedef boost::shared_ptr<ClusterInterface> Cluster_impl;
44 typedef AtomIdSet::atomIdSet atomIdSet;
45
46 virtual ~ClusterInterface() {}
47
48 /** Getter for the set of atomic ids associated to the cluster.
49 *
50 * @return set of atomic ids
51 */
52 virtual const atomIdSet & getAtomIds() const=0;
53
54 /** Getter for the set of atoms associated to the cluster.
55 *
56 * @return set of atoms
57 */
58 AtomIdSet getAtoms() const
59 {
60 return AtomIdSet(getAtomIds());
61 }
62
63 /** Getter for the cluster's Shape.
64 *
65 * @return Shape \a s
66 */
67 virtual const Shape& getShape() const=0;
68
69 /** Clones this cluster.
70 *
71 * We copy the shape and we copy all contained atoms in such a way as
72 * functor \a copyMethod does. We also translate atoms by \a offset
73 * eventually.
74 *
75 * @param copyMethod functor that knows how to copy the atoms
76 * @param offset translational offset for contained atoms
77 * @return reference to the clone cluster
78 */
79 virtual Cluster_impl clone(CopyAtomsInterface& copyMethod, const Vector &offset) const =0;
80
81 /** Move a cluster.
82 *
83 * This moves both all contained atoms associated to the cluster and the
84 * shape itself
85 *
86 * @param offset translation vector
87 */
88 virtual void translate(const Vector &offset)=0;
89
90 /** Transforms a cluster.
91 *
92 * This transforms both all contained atoms associated to the cluster and the
93 * shape itself with respect to their spatial positions.
94 *
95 * @param M transformation matrix
96 */
97 virtual void transform(const RealSpaceMatrix &M)=0;
98
99 /** Check whether the given atom is inside the Cluster's shape.
100 *
101 * @param id atom id to check
102 * @return true - is inside cluster's shape, false - else
103 */
104 virtual bool isInside(const atomId_t id) const = 0;
105};
106
107
108#endif /* CLUSTERINTERFACE_HPP_ */
Note: See TracBrowser for help on using the repository browser.