SPH
Public Member Functions | List of all members
CylindricalDomain Class Reference

Cylinder aligned with z-axis, optionally including bases (can be either open or close cylinder). More...

#include <Domain.h>

Inheritance diagram for CylindricalDomain:
IDomain Polymorphic

Public Member Functions

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

Detailed Description

Cylinder aligned with z-axis, optionally including bases (can be either open or close cylinder).

Definition at line 218 of file Domain.h.

Constructor & Destructor Documentation

◆ CylindricalDomain()

CylindricalDomain::CylindricalDomain ( const Vector center,
const Float  radius,
const Float  height,
const bool  includeBases 
)

Definition at line 338 of file Domain.cpp.

Member Function Documentation

◆ addGhosts()

void CylindricalDomain::addGhosts ( ArrayView< const Vector vs,
Array< Ghost > &  ghosts,
const Float  eta,
const Float  eps 
) const
overridevirtual

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.

Implements IDomain.

Definition at line 425 of file Domain.cpp.

◆ contains()

bool CylindricalDomain::contains ( const Vector v) const
overridevirtual

Checks if the given point lies inside the domain.

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

Implements IDomain.

Definition at line 364 of file Domain.cpp.

◆ getBoundingBox()

Box CylindricalDomain::getBoundingBox ( ) const
overridevirtual

Returns the bounding box of the domain.

Implements IDomain.

Definition at line 359 of file Domain.cpp.

◆ getCenter()

Vector CylindricalDomain::getCenter ( ) const
overridevirtual

Returns the center of the domain.

Implements IDomain.

Definition at line 347 of file Domain.cpp.

◆ getDistanceToBoundary()

void CylindricalDomain::getDistanceToBoundary ( ArrayView< const Vector vs,
Array< Float > &  distances 
) const
overridevirtual

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

Implements IDomain.

Definition at line 388 of file Domain.cpp.

◆ getSubset()

void CylindricalDomain::getSubset ( ArrayView< const Vector vs,
Array< Size > &  output,
const SubsetType  type 
) const
overridevirtual

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.

Implements IDomain.

Definition at line 368 of file Domain.cpp.

◆ getSurfaceArea()

Float CylindricalDomain::getSurfaceArea ( ) const
overridevirtual

Returns the surface area of the domain.

Implements IDomain.

Definition at line 355 of file Domain.cpp.

◆ getVolume()

Float CylindricalDomain::getVolume ( ) const
overridevirtual

Returns the total volume of the domain.

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

Implements IDomain.

Definition at line 351 of file Domain.cpp.

◆ project()

void CylindricalDomain::project ( ArrayView< Vector vs,
Optional< ArrayView< Size >>  indices = NOTHING 
) const
overridevirtual

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.

Implements IDomain.

Definition at line 400 of file Domain.cpp.


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