SPH
Public Member Functions | List of all members
IDomain Class Referenceabstract

Base class for computational domains. More...

#include <Domain.h>

Inheritance diagram for IDomain:
Polymorphic BlockDomain BooleanDomain CylindricalDomain ElasticBands::SubtractDomain EllipsoidalDomain GaussianRandomSphere HalfSpaceDomain HexagonalDomain InvertDomain MeshDomain SphDomain SpheresDomain SphericalDomain SubtractDomain TransformedDomain

Public Member Functions

virtual Vector getCenter () const =0
 Returns the center of the domain. More...
 
virtual Box getBoundingBox () const =0
 Returns the bounding box of the domain. More...
 
virtual Float getVolume () const =0
 Returns the total volume of the domain. More...
 
virtual Float getSurfaceArea () const =0
 Returns the surface area of the domain. More...
 
virtual bool contains (const Vector &v) const =0
 Checks if the given point lies inside the domain. More...
 
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. More...
 
virtual void getDistanceToBoundary (ArrayView< const Vector > vs, Array< Float > &distances) const =0
 Returns distances of particles lying close to the boundary. More...
 
virtual void project (ArrayView< Vector > vs, Optional< ArrayView< Size >> indices=NOTHING) const =0
 Projects vectors outside of the domain onto its boundary. More...
 
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 other side of the domain. More...
 
- Public Member Functions inherited from Polymorphic
virtual ~Polymorphic ()
 

Detailed Description

Base class for computational domains.

Definition at line 29 of file Domain.h.

Member Function Documentation

◆ addGhosts()

virtual void IDomain::addGhosts ( ArrayView< const Vector vs,
Array< Ghost > &  ghosts,
const Float  eta = 2._f,
const Float  eps = 0.05_f 
) const
pure virtual

Duplicates positions located close to the boundary, placing copies ("ghosts") symmetrically to the other side of the domain.

Distance of the copy (ghost) to the boundary shall be the same as the source vector. One vector can create multiple ghosts.

Parameters
vsArray containing vectors creating ghosts.
ghostsOutput parameter containing created ghosts, stored as pairs (position of ghost and index of source vector). Array must be cleared by the function!
etaDimensionless distance to the boundary necessary for creating a ghost. A ghost is created for vector v if it is closer than radius * v[H]. Vector must be inside, outside vectors are ignored.
epsMinimal dimensionless distance of ghost from the source vector. When vector is too close to the boundary, the ghost would be too close or even on top of the source vector; implementation must place the ghost so that it is outside of the domain and at least eps * v[H] from the vector. Must be strictly lower than radius, checked by assert.

Implemented in SubtractDomain, SphDomain, InvertDomain, SpheresDomain, ElasticBands::SubtractDomain, MeshDomain, BooleanDomain, TransformedDomain, HalfSpaceDomain, GaussianRandomSphere, HexagonalDomain, CylindricalDomain, BlockDomain, EllipsoidalDomain, and SphericalDomain.

◆ contains()

virtual bool IDomain::contains ( const Vector v) const
pure virtual

Checks if the given point lies inside the domain.

Points lying exactly on the boundary of the domain are assumed to be inside.

Implemented in BooleanDomain, SubtractDomain, MeshDomain, SphDomain, InvertDomain, SpheresDomain, TransformedDomain, HalfSpaceDomain, GaussianRandomSphere, HexagonalDomain, CylindricalDomain, BlockDomain, EllipsoidalDomain, SphericalDomain, and ElasticBands::SubtractDomain.

◆ getBoundingBox()

virtual Box IDomain::getBoundingBox ( ) const
pure virtual

◆ getCenter()

virtual Vector IDomain::getCenter ( ) const
pure virtual

◆ getDistanceToBoundary()

virtual void IDomain::getDistanceToBoundary ( ArrayView< const Vector vs,
Array< Float > &  distances 
) const
pure virtual

Returns distances of particles lying close to the boundary.

The distances are signed, negative number means the particle is lying outside of the domain. Distances can be computed with small error to simplify implementation.

Parameters
vsInput array of points.
distancesOutput array, will be resized to the size of particle array and cleared.
Todo:
unify the (non)clearing of output arrays

Implemented in SubtractDomain, MeshDomain, SphDomain, BooleanDomain, SpheresDomain, HexagonalDomain, ElasticBands::SubtractDomain, InvertDomain, TransformedDomain, HalfSpaceDomain, GaussianRandomSphere, CylindricalDomain, BlockDomain, EllipsoidalDomain, and SphericalDomain.

◆ getSubset()

virtual void IDomain::getSubset ( ArrayView< const Vector vs,
Array< Size > &  output,
const SubsetType  type 
) const
pure virtual

Returns an array of indices, marking vectors with given property by their index.

Parameters
vsInput array of points.
outputOutput array, is not cleared by the method, previously stored values are kept unchanged. Indices of vectors belonging in the subset are pushed into the array.
typeType of the subset, see SubsetType.

Implemented in SubtractDomain, SphDomain, SpheresDomain, ElasticBands::SubtractDomain, MeshDomain, BooleanDomain, InvertDomain, TransformedDomain, HalfSpaceDomain, GaussianRandomSphere, HexagonalDomain, CylindricalDomain, BlockDomain, EllipsoidalDomain, and SphericalDomain.

◆ getSurfaceArea()

virtual Float IDomain::getSurfaceArea ( ) const
pure virtual

◆ getVolume()

virtual Float IDomain::getVolume ( ) const
pure virtual

Returns the total volume of the domain.

This should be identical to computing an integral of isInside function, although faster and more precise.

Implemented in SubtractDomain, MeshDomain, SphDomain, BooleanDomain, InvertDomain, SpheresDomain, TransformedDomain, HalfSpaceDomain, GaussianRandomSphere, HexagonalDomain, CylindricalDomain, BlockDomain, EllipsoidalDomain, SphericalDomain, and ElasticBands::SubtractDomain.

◆ project()

virtual void IDomain::project ( ArrayView< Vector vs,
Optional< ArrayView< Size >>  indices = NOTHING 
) const
pure virtual

Projects vectors outside of the domain onto its boundary.

Vectors inside the domain are untouched. Function does not affect 4th component of vectors.

Parameters
vsArray of vectors we want to project
indicesOptional array of indices. If passed, only selected vectors will be projected. All vectors are projected by default.

Implemented in SubtractDomain, SphDomain, InvertDomain, SpheresDomain, ElasticBands::SubtractDomain, TransformedDomain, HalfSpaceDomain, GaussianRandomSphere, HexagonalDomain, CylindricalDomain, BlockDomain, EllipsoidalDomain, SphericalDomain, MeshDomain, and BooleanDomain.


The documentation for this class was generated from the following file: