00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifdef DISABLE_INLINE
00020 #define inline
00021 #endif
00022
00023 #include <numeric>
00024 #include <tr1/functional>
00025 #include "Geometry.hpp"
00026 inline double
00027 Surface::Site::InteractionEnergy() const
00028 { using std::accumulate; typedef std::plus<double> plus;
00029 using std::tr1::bind; using namespace std::tr1::placeholders;
00030
00031 return species().no_species() ?
00032 0.0 : accumulate(two_body_interactions_container.begin(), two_body_interactions_container.end(),
00033 0.0,
00034 bind(plus(), _1, bind(&Interactions::TwoBody::Geometry::InteractionEnergy, _2)));
00035 }
00036
00037
00038 inline double
00039 Surface::Site::InteractionEnergyBridge(const Site* const other_site_ptr) const
00040 {
00041 using std::accumulate; typedef std::plus<double> plus;
00042 using std::tr1::bind; using namespace std::tr1::placeholders;
00043
00044 return species().no_species() ?
00045 0.0 : accumulate(bridge_interactions_container.begin(),
00046 bridge_interactions_container.end(),
00047 0.0,
00048 bind(plus(), _1, bind(&Bridge::InteractionEnergy, _2, this, other_site_ptr)));
00049 }
00050
00051 #include <ostream>
00052 inline std::ostream&
00053 operator<< (std::ostream& os, const Surface::Site& s)
00054 { return os << s.index() << "\t" << s.name() << "\t" << s.species(); }
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069 #ifdef DISABLE_INLINE
00070 #undef inline
00071 #endif