walberla::geometry::initializer::ScalarFieldFromBody< Field_T > Class Template Reference

Detailed Description

template<typename Field_T>
class walberla::geometry::initializer::ScalarFieldFromBody< Field_T >

Initializes a scalar field from a geometric body.

Currently supported are Sphere, Ellipsoid and Box (= AABB)

Examples:

  <InitializerUID> {
       initialFill : drop;
       someArbitraryId {
          shape sphere;
          add;                  // add to the current value in the field
          value 1.0;
          midpoint < 3,4,5>;
          radius 4;
          id 0;                 // If given a vector of scalar fields, which one of them to operate on.
                                // Should be zero (the default value) if given a scalar field directly.
       }
       object2 {
          shape box;
          add;
          value -3.14;
          min <1,2,3>;
          max <3,4,5>;
       }
       object3_ellipse {
          set;                  // overwrite the current value in the field
          value 0;
          shape ellipsoid;
          midpoint < 3,4,2>;
          axis1    <1,0,0>;
          axis2    <0,1,0>;
          radii    <1,1,4>;
       }
  }

#include <ScalarFieldFromBody.h>

+ Inheritance diagram for walberla::geometry::initializer::ScalarFieldFromBody< Field_T >:

Public Types

typedef Field_T::value_type Value_T
 

Public Member Functions

 ScalarFieldFromBody (StructuredBlockStorage &structuredBlockStorage, BlockDataID scalarFieldID)
 Constructor. More...
 
 ScalarFieldFromBody (StructuredBlockStorage &structuredBlockStorage, std::vector< BlockDataID > scalarFieldID)
 
virtual void init (BlockStorage &blockStorage, const Config::BlockHandle &blockHandle)
 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, Value_T value, bool addOrSet, std::vector< BlockDataID >::size_type id=0)
 Sets a body on the scalar field. More...
 
template<typename Body >
void init (const Body &body, math::FunctionParser &parser, bool addOrSet, std::vector< BlockDataID >::size_type id=0)
 
- 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_
 
std::vector< BlockDataID > scalarFieldID_
 
std::string addKeyword_
 
std::string setKeyword_
 

Member Typedef Documentation

template<typename Field_T >
typedef Field_T::value_type walberla::geometry::initializer::ScalarFieldFromBody< Field_T >::Value_T

Constructor & Destructor Documentation

template<typename Field_T >
walberla::geometry::initializer::ScalarFieldFromBody< Field_T >::ScalarFieldFromBody ( StructuredBlockStorage &  structuredBlockStorage,
BlockDataID  scalarFieldID 
)
inline

Constructor.

Parameters
scalarFieldIDthe scalar field to initialize, or a vector of scalar fields to initialize based on the id specified with the body
template<typename Field_T >
walberla::geometry::initializer::ScalarFieldFromBody< Field_T >::ScalarFieldFromBody ( StructuredBlockStorage &  structuredBlockStorage,
std::vector< BlockDataID >  scalarFieldID 
)

Member Function Documentation

template<typename Field_T >
void walberla::geometry::initializer::ScalarFieldFromBody< Field_T >::init ( BlockStorage &  blockStorage,
const Config::BlockHandle &  blockHandle 
)
virtual

Interface implementation for Initializer - sets a body on a scalar field with options from configuration file.

template<typename Field_T >
template<typename Body >
void walberla::geometry::initializer::ScalarFieldFromBody< Field_T >::init ( const Body &  body,
Value_T  value,
bool  addOrSet,
std::vector< BlockDataID >::size_type  id = 0 
)

Sets a body on the scalar field.

Parameters
bodyThe body object - has to implement either overlapFraction(...), or contains(...) see BodyOverlapFunctions for detailed body concept
valueThe value to set on the matched cells in the field.
parserA function parser which will have the variables x,y,z bound before it is evaluated
addOrSetIf true, the value is added to scalar field If false, the value is set on the scalar field.
idIf operating on a vector of fields, which field to treat. Zero otherwise.

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.

template<typename Field_T >
template<typename Body >
void walberla::geometry::initializer::ScalarFieldFromBody< Field_T >::init ( const Body &  body,
math::FunctionParser parser,
bool  addOrSet,
std::vector< BlockDataID >::size_type  id = 0 
)

Member Data Documentation

template<typename Field_T >
std::string walberla::geometry::initializer::ScalarFieldFromBody< Field_T >::addKeyword_
protected
template<typename Field_T >
std::vector<BlockDataID> walberla::geometry::initializer::ScalarFieldFromBody< Field_T >::scalarFieldID_
protected
template<typename Field_T >
std::string walberla::geometry::initializer::ScalarFieldFromBody< Field_T >::setKeyword_
protected
template<typename Field_T >
StructuredBlockStorage& walberla::geometry::initializer::ScalarFieldFromBody< Field_T >::structuredBlockStorage_
protected

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