94 const Float eta = 2._f,
95 const Float eps = 0.05_f)
const = 0;
131 const Float eps)
const override;
148 Float effectiveRadius;
174 const Float eps)
const override;
213 const Float eps)
const override;
249 const Float eps)
const override;
254 sqr(v[
Z] - center[
Z]) <=
sqr(0.5_f * height);
295 const Float eps)
const override;
299 if (
sqr(v[
Z] - center[
Z]) >
sqr(0.5_f * height)) {
303 if (sqrLength >
sqr(outerRadius)) {
306 if (sqrLength <=
sqr(innerRadius)) {
315 return 0.5_f *
SQRT_3 * 1._f /
sin(phi -
PI / 3._f * (
floor(phi / (
PI / 3._f)) - 1._f));
350 const Float eps)
const override;
383 const Float eps)
const override;
417 const Float eps)
const override;
Three-dimensional affine matrix.
Object representing a three-dimensional axis-aligned box.
@ INSIDE
Marks all vectors inside of the domain.
@ OUTSIDE
Marks all vectors outside of the domain.
uint32_t Size
Integral type used to index arrays (by default).
double Float
Precision used withing the code. Use Float instead of float or double where precision is important.
constexpr INLINE T sqr(const T &f) noexcept
Return a squared value.
INLINE auto floor(const T &f)
INLINE T atan2(const T y, const T x)
constexpr Float PI
Mathematical constants.
#define INLINE
Macros for conditional compilation based on selected compiler.
#define NAMESPACE_SPH_END
Wrapper of type value of which may or may not be present.
const NothingType NOTHING
INLINE Float getSqrLength(const Vector &v)
BasicVector< Float > Vector
Object providing safe access to continuous memory of data.
Block aligned with coordinate axes, defined by its center and length of each side.
virtual bool contains(const Vector &v) const override
Checks if the given point lies inside the domain.
virtual Float getVolume() const override
Returns the total volume of the domain.
virtual void getDistanceToBoundary(ArrayView< const Vector > vs, Array< Float > &distances) const override
Returns distances of particles lying close to the boundary.
virtual void addGhosts(ArrayView< const Vector > vs, Array< Ghost > &ghosts, const Float eta, const Float eps) const override
Duplicates positions located close to the boundary, placing copies ("ghosts") symmetrically to the ot...
virtual void project(ArrayView< Vector > vs, Optional< ArrayView< Size >> indices=NOTHING) const override
Projects vectors outside of the domain onto its boundary.
virtual void getSubset(ArrayView< const Vector > vs, Array< Size > &output, const SubsetType type) const override
Returns an array of indices, marking vectors with given property by their index.
virtual Box getBoundingBox() const override
Returns the bounding box of the domain.
virtual Vector getCenter() const override
Returns the center of the domain.
virtual Float getSurfaceArea() const override
Returns the surface area of the domain.
BlockDomain(const Vector ¢er, const Vector &edges)
Helper object defining three-dimensional interval (box).
Cylinder aligned with z-axis, optionally including bases (can be either open or close cylinder).
virtual void getSubset(ArrayView< const Vector > vs, Array< Size > &output, const SubsetType type) const override
Returns an array of indices, marking vectors with given property by their index.
virtual void addGhosts(ArrayView< const Vector > vs, Array< Ghost > &ghosts, const Float eta, const Float eps) const override
Duplicates positions located close to the boundary, placing copies ("ghosts") symmetrically to the ot...
CylindricalDomain(const Vector ¢er, const Float radius, const Float height, const bool includeBases)
virtual Float getVolume() const override
Returns the total volume of the domain.
virtual Vector getCenter() const override
Returns the center of the domain.
virtual Float getSurfaceArea() const override
Returns the surface area of the domain.
virtual bool contains(const Vector &v) const override
Checks if the given point lies inside the domain.
virtual void project(ArrayView< Vector > vs, Optional< ArrayView< Size >> indices=NOTHING) const override
Projects vectors outside of the domain onto its boundary.
virtual void getDistanceToBoundary(ArrayView< const Vector > vs, Array< Float > &distances) const override
Returns distances of particles lying close to the boundary.
virtual Box getBoundingBox() const override
Returns the bounding box of the domain.
Axis aligned ellipsoidal domain, defined by the center of sphere and lengths of three axes.
virtual Vector getCenter() const override
Returns the center of the domain.
virtual void addGhosts(ArrayView< const Vector > vs, Array< Ghost > &ghosts, const Float eta, const Float eps) const override
Duplicates positions located close to the boundary, placing copies ("ghosts") symmetrically to the ot...
EllipsoidalDomain(const Vector ¢er, const Vector &axes)
virtual Float getVolume() const override
Returns the total volume of the domain.
virtual Float getSurfaceArea() const override
Returns the surface area of the domain.
virtual bool contains(const Vector &v) const override
Checks if the given point lies inside the domain.
virtual void getDistanceToBoundary(ArrayView< const Vector > vs, Array< Float > &distances) const override
Returns distances of particles lying close to the boundary.
virtual void getSubset(ArrayView< const Vector > vs, Array< Size > &output, const SubsetType type) const override
Returns an array of indices, marking vectors with given property by their index.
virtual Box getBoundingBox() const override
Returns the bounding box of the domain.
virtual void project(ArrayView< Vector > vs, Optional< ArrayView< Size >> indices=NOTHING) const override
Projects vectors outside of the domain onto its boundary.
virtual Float getVolume() const override
Returns the total volume of the domain.
GaussianRandomSphere(const Vector ¢er, const Float radius, const Float beta, const Size seed)
virtual void getDistanceToBoundary(ArrayView< const Vector > vs, Array< Float > &distances) const override
Returns distances of particles lying close to the boundary.
virtual void getSubset(ArrayView< const Vector > vs, Array< Size > &output, const SubsetType type) const override
Returns an array of indices, marking vectors with given property by their index.
virtual Vector getCenter() const override
Returns the center of the domain.
virtual Box getBoundingBox() const override
Returns the bounding box of the domain.
virtual bool contains(const Vector &v) const override
Checks if the given point lies inside the domain.
virtual void addGhosts(ArrayView< const Vector > vs, Array< Ghost > &ghosts, const Float eta, const Float eps) const override
Duplicates positions located close to the boundary, placing copies ("ghosts") symmetrically to the ot...
virtual void project(ArrayView< Vector > vs, Optional< ArrayView< Size >> indices=NOTHING) const override
Projects vectors outside of the domain onto its boundary.
virtual Float getSurfaceArea() const override
Returns the surface area of the domain.
Domain representing a half-space, given by z>0.
virtual void getSubset(ArrayView< const Vector > vs, Array< Size > &output, const SubsetType type) const override
Returns an array of indices, marking vectors with given property by their index.
virtual Vector getCenter() const override
Returns the center of the domain.
virtual bool contains(const Vector &v) const override
Checks if the given point lies inside the domain.
virtual Float getVolume() const override
Returns the total volume of the domain.
virtual Float getSurfaceArea() const override
Returns the surface area of the domain.
virtual Box getBoundingBox() const override
Returns the bounding box of the domain.
virtual void project(ArrayView< Vector > vs, Optional< ArrayView< Size >> indices=NOTHING) const override
Projects vectors outside of the domain onto its boundary.
virtual void addGhosts(ArrayView< const Vector > vs, Array< Ghost > &ghosts, const Float eta, const Float eps) const override
Duplicates positions located close to the boundary, placing copies ("ghosts") symmetrically to the ot...
virtual void getDistanceToBoundary(ArrayView< const Vector > vs, Array< Float > &distances) const override
Returns distances of particles lying close to the boundary.
Similar to cylindrical domain, but bases are hexagons instead of circles.
virtual Box getBoundingBox() const override
Returns the bounding box of the domain.
virtual void getDistanceToBoundary(ArrayView< const Vector >, Array< Float > &) const override
Returns distances of particles lying close to the boundary.
virtual Float getVolume() const override
Returns the total volume of the domain.
virtual void getSubset(ArrayView< const Vector > vs, Array< Size > &output, const SubsetType type) const override
Returns an array of indices, marking vectors with given property by their index.
HexagonalDomain(const Vector ¢er, const Float radius, const Float height, const bool includeBases)
virtual Float getSurfaceArea() const override
Returns the surface area of the domain.
virtual Vector getCenter() const override
Returns the center of the domain.
virtual void project(ArrayView< Vector > vs, Optional< ArrayView< Size >> indices=NOTHING) const override
Projects vectors outside of the domain onto its boundary.
virtual void addGhosts(ArrayView< const Vector > vs, Array< Ghost > &ghosts, const Float eta, const Float eps) const override
Duplicates positions located close to the boundary, placing copies ("ghosts") symmetrically to the ot...
virtual bool contains(const Vector &v) const override
Checks if the given point lies inside the domain.
Base class for computational domains.
virtual Float getSurfaceArea() const =0
Returns the surface area of the domain.
virtual void getSubset(ArrayView< const Vector > vs, Array< Size > &output, const SubsetType type) const =0
Returns an array of indices, marking vectors with given property by their index.
virtual void getDistanceToBoundary(ArrayView< const Vector > vs, Array< Float > &distances) const =0
Returns distances of particles lying close to the boundary.
virtual Box getBoundingBox() const =0
Returns the bounding box of the domain.
virtual Float getVolume() const =0
Returns the total volume of the domain.
virtual void project(ArrayView< Vector > vs, Optional< ArrayView< Size >> indices=NOTHING) const =0
Projects vectors outside of the domain onto its boundary.
virtual void addGhosts(ArrayView< const Vector > vs, Array< Ghost > &ghosts, const Float eta=2._f, const Float eps=0.05_f) const =0
Duplicates positions located close to the boundary, placing copies ("ghosts") symmetrically to the ot...
virtual bool contains(const Vector &v) const =0
Checks if the given point lies inside the domain.
virtual Vector getCenter() const =0
Returns the center of the domain.
Wrapper of type value of which may or may not be present.
Spherical domain, defined by the center of sphere and its radius.
virtual Float getSurfaceArea() const override
Returns the surface area of the domain.
virtual Box getBoundingBox() const override
Returns the bounding box of the domain.
virtual void getDistanceToBoundary(ArrayView< const Vector > vs, Array< Float > &distances) const override
Returns distances of particles lying close to the boundary.
virtual void addGhosts(ArrayView< const Vector > vs, Array< Ghost > &ghosts, const Float eta, const Float eps) const override
Duplicates positions located close to the boundary, placing copies ("ghosts") symmetrically to the ot...
virtual void getSubset(ArrayView< const Vector > vs, Array< Size > &output, const SubsetType type) const override
Returns an array of indices, marking vectors with given property by their index.
virtual Float getVolume() const override
Returns the total volume of the domain.
virtual Vector getCenter() const override
Returns the center of the domain.
SphericalDomain(const Vector ¢er, const Float &radius)
virtual bool contains(const Vector &v) const override
Checks if the given point lies inside the domain.
virtual void project(ArrayView< Vector > vs, Optional< ArrayView< Size >> indices=NOTHING) const override
Projects vectors outside of the domain onto its boundary.
Transform another domain by given transformation matrix.
virtual void getSubset(ArrayView< const Vector > vs, Array< Size > &output, const SubsetType type) const override
Returns an array of indices, marking vectors with given property by their index.
virtual Float getVolume() const override
Returns the total volume of the domain.
virtual void getDistanceToBoundary(ArrayView< const Vector > vs, Array< Float > &distances) const override
Returns distances of particles lying close to the boundary.
virtual void project(ArrayView< Vector > vs, Optional< ArrayView< Size >> indices=NOTHING) const override
Projects vectors outside of the domain onto its boundary.
virtual Float getSurfaceArea() const override
Returns the surface area of the domain.
virtual void addGhosts(ArrayView< const Vector > vs, Array< Ghost > &ghosts, const Float eta, const Float eps) const override
Duplicates positions located close to the boundary, placing copies ("ghosts") symmetrically to the ot...
TransformedDomain(SharedPtr< IDomain > domain, const AffineMatrix &matrix)
virtual Vector getCenter() const override
Returns the center of the domain.
virtual bool contains(const Vector &v) const override
Checks if the given point lies inside the domain.
virtual Box getBoundingBox() const override
Returns the bounding box of the domain.
Size index
Index into the original array of vectors.
Vector position
Position of the ghost.
Base class for all polymorphic objects.