Initializes a scalar field from a geometric body.
Currently supported are Sphere, Ellipsoid and Box (= AABB)
Example:
<InitializerUID> { initialFill : drop; someArbitraryId { shape sphere; bubble; midpoint < 3,4,5>; radius 4; } object2 { shape box; drop; min <1,2,3>; max <3,4,5>; } object3_ellipse { bubble; shape ellipsoid; midpoint < 3,4,2>; axis1 <1,0,0>; axis2 <0,1,0>; radii <1,1,4>; } } *
#include <OverlapFieldFromBody.h>
Public Member Functions | |
OverlapFieldFromBody (StructuredBlockStorage &structuredBlockStorage, BlockDataID scalarFieldID, const std::string &addKeyword="drop", const std::string &subtractKeyword="bubble") | |
Constructor. More... | |
void | init (BlockStorage &blockStorage, const Config::BlockHandle &blockHandle) override |
Interface implementation for Initializer - sets a body on a scalar field with options from configuration file. More... | |
template<typename Body > | |
void | init (const Body &body, bool addOrSubtract, uint_t superSamplingDepth=4) |
Sets a body on the scalar field. More... | |
Public Member Functions inherited from walberla::geometry::initializer::Initializer | |
virtual | ~Initializer ()=default |
Protected Attributes | |
StructuredBlockStorage & | structuredBlockStorage_ |
BlockDataID | scalarFieldID_ |
std::string | addKeyword_ |
std::string | subtractKeyword_ |
walberla::geometry::initializer::OverlapFieldFromBody::OverlapFieldFromBody | ( | StructuredBlockStorage & | structuredBlockStorage, |
BlockDataID | scalarFieldID, | ||
const std::string & | addKeyword = "drop" , |
||
const std::string & | subtractKeyword = "bubble" |
||
) |
Constructor.
scalarFieldID | the scalar field to initialize |
addKeyword | used when parsing a configuration block, and determining the addOrSubtract parameter for ScalarFieldFromBody::init(const Body&, bool) -> see documentation of this function. If the addKeyword is defined in the block, the overlapFraction is added to the cells otherwise subtracted |
subtractKeyword | see above |
|
overridevirtual |
Interface implementation for Initializer - sets a body on a scalar field with options from configuration file.
Implements walberla::geometry::initializer::Initializer.
void walberla::geometry::initializer::OverlapFieldFromBody::init | ( | const Body & | body, |
bool | addOrSubtract, | ||
uint_t | superSamplingDepth = 4 |
||
) |
Sets a body on the scalar field.
body | The body object - has to implement either overlapFraction(...), or contains(...) see BodyOverlapFunctions for detailed body concept |
addOrSubtract | if true the overlap between body and cell (fraction between 0 and 1) is added to scalar field, and if result is greater 1, then the value is set to one if false, the overlap is subtracted, and minimum value is zero |
Supported bodies are Sphere, Ellipsoid, AABB. To add a new supported body implement concept defined in BodyOverlapFunctions.h, and add an explicit template instantiation in ScalarFieldFromBody.cpp for the new body.
|
protected |
|
protected |
|
protected |
|
protected |