00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef DMCUT2_INTERACTIONS_TWO_BODY_GEOMETRY_HPP
00020 #define DMCUT2_INTERACTIONS_TWO_BODY_GEOMETRY_HPP
00021
00022 #include <string>
00023 #include <set>
00024 #include <vector>
00025 #include <ostream>
00026
00027 #include "EnergyContainer.hpp"
00028 #include "Species.hpp"
00029
00030 namespace Surface { class Site; }
00031
00033 namespace Interactions {
00035 namespace TwoBody {
00036
00038 typedef std::vector<std::ptrdiff_t> RelativeIndexContainer;
00039
00049 class Geometry {
00050 public:
00052 typedef std::vector< Surface::Site* > NeighborContainer;
00053
00055 typedef std::string Name;
00056
00059 Geometry(const Name& name):
00060 name_(name), site_ptr_(NULL),
00061 neighbor_container_(), energy_container_() {};
00062
00066
00067
00069 Name name() const
00070 { return name_; }
00071
00073 const NeighborContainer& neighbor_container() const
00074 { return neighbor_container_; }
00075
00077
00081
00082
00084 void set_interaction_energy_container(const EnergyContainer& energy_container)
00085 { energy_container_ = energy_container; }
00086
00088
00091 double InteractionEnergy() const;
00092
00093 private:
00094 NeighborContainer& neighbor_container()
00095 { return neighbor_container_; }
00096
00097 void set_site_ptr(Surface::Site* site_ptr)
00098 { site_ptr_ = site_ptr; }
00099
00100 Name name_;
00101 Surface::Site* site_ptr_;
00102 NeighborContainer neighbor_container_;
00103 EnergyContainer energy_container_;
00104
00105 friend class LinkSites;
00106 };
00107
00108 }
00109 }
00110
00111 namespace Surface {
00112 class HelicalBoundaryConditions;
00113 class Site;
00114 }
00115
00116 #include <tr1/functional>
00117
00118 namespace Interactions {
00119 namespace TwoBody {
00124 struct LinkSites: std::tr1::function<void(Surface::Site*, RelativeIndexContainer)>
00125 {
00128 LinkSites(const Surface::HelicalBoundaryConditions& boundary_conditions):
00129 boundary_conditions_(boundary_conditions) {};
00130
00135 void operator()(Geometry interactions,
00136 Surface::Site* site_ptr,
00137 RelativeIndexContainer relative_index_container) const;
00138
00139 private:
00140 const Surface::HelicalBoundaryConditions& boundary_conditions_;
00141 };
00142
00143 }
00144 }
00145
00147 std::ostream& operator<<(std::ostream&, const Interactions::TwoBody::Geometry&);
00148
00149 #endif