Initializes a scalar field, using the pixel values from a gray scale image The real_t
field is initialized with values between 0 and 1.
Example:
<InitializerId> { file domain.png; extrusionCoordinate 1; // y coordinate lowerExtrusionLimit 5; upperExtrusionLimit 10; xOffset 5; yOffset 6; }
#include <ScalarFieldFromGrayScaleImage.h>
Public Member Functions | |
ScalarFieldFromGrayScaleImage (StructuredBlockStorage &blocks, BlockDataID scalarFieldID) | |
void | init (BlockStorage &blockStorage, const Config::BlockHandle &block) override |
Initializes the scalar field using parameters of config block for syntax see class documentation. More... | |
void | init (const GrayScaleImage &img, uint_t extrusionCoord, cell_idx_t xOffset, cell_idx_t yOffset, cell_idx_t lowerExtrusionLimit=std::numeric_limits< cell_idx_t >::min(), cell_idx_t upperExtrusionLimit=std::numeric_limits< cell_idx_t >::max()) |
Initializes scalar field using a gray scale image. More... | |
void | init (const GrayScaleImage &img, uint_t extrusionCoord, bool rescaleToDomain=true, cell_idx_t lowerExtrusionLimit=std::numeric_limits< cell_idx_t >::min(), cell_idx_t upperExtrusionLimit=std::numeric_limits< cell_idx_t >::max()) |
Initializes scalar field using a gray scale image. More... | |
Public Member Functions inherited from walberla::geometry::initializer::Initializer | |
virtual | ~Initializer ()=default |
Protected Attributes | |
StructuredBlockStorage & | structuredBlockStorage_ |
BlockDataID | scalarFieldID_ |
walberla::geometry::initializer::ScalarFieldFromGrayScaleImage::ScalarFieldFromGrayScaleImage | ( | StructuredBlockStorage & | blocks, |
BlockDataID | scalarFieldID | ||
) |
|
overridevirtual |
Initializes the scalar field using parameters of config block for syntax see class documentation.
Implements walberla::geometry::initializer::Initializer.
void walberla::geometry::initializer::ScalarFieldFromGrayScaleImage::init | ( | const GrayScaleImage & | img, |
uint_t | extrusionCoord, | ||
bool | rescaleToDomain = true , |
||
cell_idx_t | lowerExtrusionLimit = std::numeric_limits<cell_idx_t>::min() , |
||
cell_idx_t | upperExtrusionLimit = std::numeric_limits<cell_idx_t>::max() |
||
) |
Initializes scalar field using a gray scale image.
rescaleToDomain | if true the image is first rescaled to match the size of the domain other parameters as for function above |
void walberla::geometry::initializer::ScalarFieldFromGrayScaleImage::init | ( | const GrayScaleImage & | img, |
uint_t | extrusionCoord, | ||
cell_idx_t | xOffset, | ||
cell_idx_t | yOffset, | ||
cell_idx_t | lowerExtrusionLimit = std::numeric_limits<cell_idx_t>::min() , |
||
cell_idx_t | upperExtrusionLimit = std::numeric_limits<cell_idx_t>::max() |
||
) |
Initializes scalar field using a gray scale image.
img | the image |
extrusionCoord | the image is set in slices where extrusionCoord is constant |
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 |