Sets boundary conditions according to a gray scale image.
Example:
<InitializerId> { file domain.png; extrusionCoordinate 1; // defaults to 2 lowerExtrusionLimit 5 // defaults to 0 upperExtrusionLimit 10; // defaults to maximum of extrusionCoordinate xOffset 5; // "x" offset of the image in the domain yOffset 6; // "y" offset of the image in the domain // or rescaleToDomain true; BoundaryValueMapping { <BoundaryUID> { <boundary Config> } // boundary name i.e. name of boundary flag #or flag <FlagUID>; value ff0000; // boundary is set in cells where image has exactly // this value ( here: red) // value has to be specified in hex notation // for rgba images the format is ff11aaff // ( red=255, green=11, blue=aa, alpha=ff) // where the alpha channel is optional // for grayscale images only the gray value has to be specified: // for example "ff" for white } BoundaryValueMapping { NoSlip {} value 125; } }
#include <BoundaryFromImage.h>
Public Types | |
using | pixel_t = typename Image_T::pixel_t |
using | BoundarySetters = std::map< pixel_t, BoundarySetter< BoundaryHandling_T > > |
Public Member Functions | |
BoundaryFromImage (StructuredBlockStorage &blocks, BlockDataID handlerBlockDataID) | |
void | init (BlockStorage &, const Config::BlockHandle &block) override |
Initializes the scalar field using parameters of config block for syntax see class documentation. More... | |
void | init (const Config::BlockHandle &block) |
void | init (const Image_T &img, uint_t extrusionCoord, BoundarySetters &boundarySetters, cell_idx_t xOffset, cell_idx_t yOffset, cell_idx_t lowerExtrusionLimit, cell_idx_t upperExtrusionLimit) |
Initializes boundary values using an image. More... | |
Public Member Functions inherited from walberla::geometry::initializer::Initializer | |
virtual | ~Initializer ()=default |
Protected Member Functions | |
Image_T | resizeImageToDomain (const Image_T &img, uint_t extrusionCoord) const |
Protected Attributes | |
StructuredBlockStorage & | structuredBlockStorage_ |
BlockDataID | handlingID_ |
using walberla::geometry::initializer::BoundaryFromImage< BoundaryHandling_T, Image_T >::BoundarySetters = std::map<pixel_t, BoundarySetter<BoundaryHandling_T> > |
using walberla::geometry::initializer::BoundaryFromImage< BoundaryHandling_T, Image_T >::pixel_t = typename Image_T::pixel_t |
walberla::geometry::initializer::BoundaryFromImage< Handling, Image_T >::BoundaryFromImage | ( | StructuredBlockStorage & | blocks, |
BlockDataID | handlerBlockDataID | ||
) |
|
inlineoverridevirtual |
Initializes the scalar field using parameters of config block for syntax see class documentation.
Implements walberla::geometry::initializer::Initializer.
void walberla::geometry::initializer::BoundaryFromImage< Handling, Image_T >::init | ( | const Config::BlockHandle & | block | ) |
void walberla::geometry::initializer::BoundaryFromImage< Handling, Image_T >::init | ( | const Image_T & | img, |
uint_t | extrusionCoord, | ||
BoundarySetters & | boundarySetters, | ||
cell_idx_t | xOffset, | ||
cell_idx_t | yOffset, | ||
cell_idx_t | lowerExtrusionLimit, | ||
cell_idx_t | upperExtrusionLimit | ||
) |
Initializes boundary values using an image.
img | the image |
extrusionCoord | the image is set in slices where extrusionCoord is constant |
boundarySetters | a map from pixel value to boundary information |
xOffset | offset for the x IMAGE coordinate ( not cell coordinates ) |
yOffset | offset for the y IMAGE coordinate ( not cell coordinates ) |
lowerExtrusionLimit | only cells where extrusionCoord is bigger than this parameter are modified |
upperExtrusionLimit | only cells where extrusionCoord is smaller than this parameter are modified |
|
protected |
|
protected |
|
protected |