walberla::geometry::initializer::ScalarFieldFromGrayScaleImage Class Reference

Detailed Description

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>

+ Inheritance diagram for walberla::geometry::initializer::ScalarFieldFromGrayScaleImage:

Public Member Functions

 ScalarFieldFromGrayScaleImage (StructuredBlockStorage &blocks, BlockDataID scalarFieldID)
 
virtual void init (BlockStorage &blockStorage, const Config::BlockHandle &block)
 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 ()
 
virtual void init (domain_decomposition::BlockStorage &blockStorage, const Config::BlockHandle &blockHandle)=0
 

Protected Attributes

StructuredBlockStorage & structuredBlockStorage_
 
BlockDataID scalarFieldID_
 

Constructor & Destructor Documentation

walberla::geometry::initializer::ScalarFieldFromGrayScaleImage::ScalarFieldFromGrayScaleImage ( StructuredBlockStorage &  blocks,
BlockDataID  scalarFieldID 
)

Member Function Documentation

void walberla::geometry::initializer::ScalarFieldFromGrayScaleImage::init ( BlockStorage &  blockStorage,
const Config::BlockHandle &  block 
)
virtual

Initializes the scalar field using parameters of config block for syntax see class documentation.

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.

Parameters
imgthe image
extrusionCoordthe image is set in slices where extrusionCoord is constant
xOffsetoffset for the x IMAGE coordinate ( not cell coordinates )
yOffsetoffset for the y IMAGE coordinate ( not cell coordinates )
lowerExtrusionLimitonly cells where extrusionCoord is bigger than this parameter are modified
upperExtrusionLimitonly cells where extrusionCoord is smaller than this parameter are modified
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.

Parameters
rescaleToDomainif true the image is first rescaled to match the size of the domain other parameters as for function above

Member Data Documentation

BlockDataID walberla::geometry::initializer::ScalarFieldFromGrayScaleImage::scalarFieldID_
protected
StructuredBlockStorage& walberla::geometry::initializer::ScalarFieldFromGrayScaleImage::structuredBlockStorage_
protected

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