SPH
PeriodicFinder.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include "objects/geometry/Box.h"
6 #include "thread/ThreadLocal.h"
7 
9 
12 private:
14  Box domain;
15  SharedPtr<IScheduler> scheduler;
16 
18 
19 public:
20  PeriodicFinder(AutoPtr<ISymmetricFinder>&& actual, const Box& domain, SharedPtr<IScheduler> scheduler);
21 
22  virtual Size findAll(const Size index,
23  const Float radius,
24  Array<NeighbourRecord>& neighbours) const override;
25 
26  virtual Size findAll(const Vector& pos,
27  const Float radius,
28  Array<NeighbourRecord>& neighbours) const override;
29 
30  virtual Size findLowerRank(const Size, const Float, Array<NeighbourRecord>&) const override {
32  }
33 
34 protected:
35  virtual void buildImpl(IScheduler& scheduler, ArrayView<const Vector> points) override {
36  actual->build(scheduler, points);
37  }
38 };
39 
#define NOT_IMPLEMENTED
Helper macro marking missing implementation.
Definition: Assert.h:100
Simplified implementation of std::unique_ptr, using only default deleter.
NAMESPACE_SPH_BEGIN
Definition: BarnesHut.cpp:13
Object representing a three-dimensional axis-aligned box.
const float radius
Definition: CurveDialog.cpp:18
uint32_t Size
Integral type used to index arrays (by default).
Definition: Globals.h:16
double Float
Precision used withing the code. Use Float instead of float or double where precision is important.
Definition: Globals.h:13
#define NAMESPACE_SPH_END
Definition: Object.h:12
Template for thread-local storage.
Object providing safe access to continuous memory of data.
Definition: ArrayView.h:17
Helper object defining three-dimensional interval (box).
Definition: Box.h:17
Interface that allows unified implementation of sequential and parallelized versions of algorithms.
Definition: Scheduler.h:27
Extension of IBasicFinder, allowing to search only particles with lower rank in smoothing length.
void build(IScheduler &scheduler, ArrayView< const Vector > points, Flags< FinderFlag > flags=FinderFlag::MAKE_RANK)
Constructs the struct with an array of vectors.
Finder wrapper respecting periodic domain.
virtual void buildImpl(IScheduler &scheduler, ArrayView< const Vector > points) override
Builds finder from set of vectors.
virtual Size findLowerRank(const Size, const Float, Array< NeighbourRecord > &) const override
Finds all points within radius that have a lower rank in smoothing length.
virtual Size findAll(const Size index, const Float radius, Array< NeighbourRecord > &neighbours) const override
Finds all neighbours within given radius from the point given by index.
PeriodicFinder(AutoPtr< ISymmetricFinder > &&actual, const Box &domain, SharedPtr< IScheduler > scheduler)
Template for storing a copy of a value for every thread in given scheduler.
Definition: ThreadLocal.h:36