6 #include "celllistimpl.h" 8 #include <range/v3/numeric.hpp> 23 using index_type = size_t;
24 using GeometryType = Geometry::Chameleon;
41 bool needs_syncing =
false;
47 double probe_radius = 1.4;
50 int slices_per_atom = 20;
51 const double two_pi = 2.0 * std::numbers::pi;
60 return static_cast<index_type
>(std::addressof(particle) - first_particle);
63 [[nodiscard]]
double calcSASAOfParticle(
const Neighbours& neighbour)
const;
64 double exposedArcLength(std::vector<std::pair<double, double>>& arcs)
const;
67 [[nodiscard]]
double calcSASAOfParticle(
const Space& spc,
const Particle& particle)
const;
77 template <
typename TBegin,
typename TEnd>
80 return ranges::accumulate(begin, end, 0.0, [&spc,
this](
auto& area,
const auto& species) {
81 return area + this->calcSASAOf(spc, species);
85 template <
typename TSpecies>
double calcSASAOf(
const Space& spc,
const TSpecies& species)
const;
87 void updateSASA(
const std::vector<SASABase::Neighbours>& neighbours_data,
88 const std::vector<index_type>& target_indices);
90 virtual void init(
const Space& spc) = 0;
91 [[nodiscard]]
virtual std::vector<SASABase::Neighbours>
92 calcNeighbourData(
const Space& spc,
const std::vector<index_type>& target_indices)
const = 0;
94 calcNeighbourDataOfParticle(
const Space& spc, index_type target_index)
const = 0;
95 virtual void update(
const Space& spc,
const Change& change) = 0;
96 [[nodiscard]]
const std::vector<double>& getAreas()
const;
97 SASABase(
const Space& spc,
double probe_radius,
int slices_per_atom);
108 void init(
const Space& spc)
override;
109 [[nodiscard]] std::vector<SASABase::Neighbours>
110 calcNeighbourData(
const Space& spc,
111 const std::vector<index_type>& target_indices)
const override;
113 calcNeighbourDataOfParticle(
const Space& spc, index_type target_index)
const override;
114 void update([[maybe_unused]]
const Space& spc, [[maybe_unused]]
const Change& change)
override;
115 SASA(
const Space& spc,
double probe_radius,
int slices_per_atom);
129 using CellCoord =
typename CellList::Grid::CellCoord;
130 std::unique_ptr<CellList> cell_list;
132 std::vector<CellCoord>
139 void init(
const Space& spc)
override;
141 calcNeighbourDataOfParticle(
const Space& spc, index_type target_index)
const override;
142 [[nodiscard]] std::vector<SASABase::Neighbours>
143 calcNeighbourData(
const Space& spc,
144 const std::vector<index_type>& target_indices)
const override;
145 void update(
const Space& spc,
const Change& change)
override;
148 template <
typename TBegin,
typename TEnd>
149 void createCellList(TBegin begin, TEnd end,
const GeometryType& geometry);
150 void updateMatterChange(
const Space& spc,
const Change& change);
151 void updatePositionsChange(
const Space& spc,
const Change& change);
154 using PeriodicGrid = CellList::Grid::Grid3DPeriodic;
155 using FixedGrid = CellList::Grid::Grid3DFixed;
157 template <
typename TMember,
typename TIndex>
159 template <
typename TMember,
typename TIndex>
162 template <
class TGr
id,
template <
typename,
typename>
class TContainer =
DenseContainer>
164 CellList::CellListType<index_type, TGrid, CellList::CellListBase, TContainer>>;
179 #endif // FAUNUS_SASA_H nlohmann::json json
JSON object.
Definition: json_support.h:10
Container based on a map suitable for system with a non-uniform or low member density.
Definition: celllistimpl.h:521
std::vector< Point > PointVector
Vector of 3D vectors.
Definition: core.h:24
Geometry class for spheres, cylinders, cuboids, hexagonal prism, truncated octahedron, slits.
Definition: geometry.h:342
index_type index
index of particle whose neighbours are in indices
Definition: sasa.h:38
derived class of SASABase which uses O(N^2) neighbour search
Definition: sasa.h:105
index_type indexOf(const Particle &particle) const
first particle in ParticleVector
Definition: sasa.h:58
A mixin using spatial coordinates instead of cell coordinates when inserting or removing a member...
Definition: celllistimpl.h:937
double calcSASA(const Space &spc, TBegin begin, TEnd end) const
calculates total sasa of either particles or groups between given iterators
Definition: sasa.h:78
std::vector< double > sasa_radii
Radii buffer for all particles.
Definition: sasa.h:49
std::vector< index_type > indices
indices of neighbouring particles in ParticleVector
Definition: sasa.h:36
PointVector points
vectors to neighbouring particles
Definition: sasa.h:37
Particle class for storing positions, id, and other properties.
Definition: particle.h:220
Cell list class templates.
Definition: actions.cpp:11
base class for calculating solvent accessible surface areas of target particles derived classes imple...
Definition: sasa.h:31
Specify changes made to a system.
Definition: space.h:29
derived class of SASABase which uses cell lists for neighbour search currently can be used only for g...
Definition: sasa.h:126
Placeholder for atoms and molecules.
Definition: space.h:92
std::vector< double > areas
vector holding SASA area of each atom
Definition: sasa.h:48
Container based on a vector suitable for system with a uniform and high member density.
Definition: celllistimpl.h:450