BEM++  2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Types | Public Member Functions | Private Types | Private Attributes | List of all members
Fiber::DefaultCollectionOfKernels< Functor > Class Template Reference

Default implementation of a collection of kernels. More...

#include </home/wojtek/Projects/BEM/bempp-sven/bempp/lib/fiber/default_collection_of_kernels.hpp>

Inheritance diagram for Fiber::DefaultCollectionOfKernels< Functor >:
Fiber::CollectionOfKernels< Functor::ValueType >

Public Types

typedef Base::ValueType ValueType
 
typedef Base::CoordinateType CoordinateType
 
- Public Types inherited from Fiber::CollectionOfKernels< Functor::ValueType >
typedef Functor::ValueType ValueType
 
typedef ScalarTraits
< ValueType >::RealType 
CoordinateType
 

Public Member Functions

 DefaultCollectionOfKernels (const Functor &functor)
 
const Functor & functor () const
 
Functor & functor ()
 
virtual void addGeometricalDependencies (size_t &testGeomDeps, size_t &trialGeomDeps) const
 Retrieve types of geometrical data on which the kernels depend. More...
 
virtual void evaluateAtPointPairs (const GeometricalData< CoordinateType > &testGeomData, const GeometricalData< CoordinateType > &trialGeomData, CollectionOf3dArrays< ValueType > &result) const
 
virtual void evaluateOnGrid (const GeometricalData< CoordinateType > &testGeomData, const GeometricalData< CoordinateType > &trialGeomData, CollectionOf4dArrays< ValueType > &result) const
 
virtual std::pair< const char
*, int > 
evaluateClCode () const
 Currently unused.
 
virtual CoordinateType estimateRelativeScale (CoordinateType distance) const
 
- Public Member Functions inherited from Fiber::CollectionOfKernels< Functor::ValueType >
virtual ~CollectionOfKernels ()
 Destructor.
 
virtual void evaluateAtPointPairs (const GeometricalData< CoordinateType > &testGeomData, const GeometricalData< CoordinateType > &trialGeomData, CollectionOf3dArrays< ValueType > &result) const =0
 Evaluate the kernels at a list of (test point, trial point) pairs. More...
 
virtual void evaluateOnGrid (const GeometricalData< CoordinateType > &testGeomData, const GeometricalData< CoordinateType > &trialGeomData, CollectionOf4dArrays< ValueType > &result) const =0
 Evaluate the kernels on a tensor grid of test and trial points. More...
 

Private Types

typedef CollectionOfKernels
< typename Functor::ValueType > 
Base
 

Private Attributes

Functor m_functor
 

Detailed Description

template<typename Functor>
class Fiber::DefaultCollectionOfKernels< Functor >

Default implementation of a collection of kernels.

This class implements the interface defined by CollectionOfKernels using a functor object to evaluate the kernels at specific point pairs.

Template Parameters
FunctorType of the functor that will be passed to the constructor and used to evaluate a number of kernels at individual point pairs.

The Functor class should provide the following interface:

class KernelCollectionFunctor
{
public:
typedef ... ValueType; // can be float, double, std::complex<float>
// or std::complex<double>
typedef typename ScalarTraits<ValueType>::RealType CoordinateType;
// Return the number of kernels in the collection
int kernelCount() const;
// Return the number of rows in the tensor being the value of i'th kernel
int kernelRowCount(int i) const;
// Return the number of columns in the tensor being the value of i'th kernel
int kernelColCount(int i) const;
// Specify types of geometrical data required by the kernels (see
// documentation of CollectionOfKernels::addGeometricalDependencies
// for details)
void addGeometricalDependencies(size_t& testGeomDeps,
size_t& trialGeomDeps) const;
// Evaluate the kernels at the pair of points whose geometrical data
// are provided in the testGeomData and trialGeomData arguments. The
// (j, k)th element of the tensor being the value of i'th kernel should
// be written to result[i](j, k).
template <template <typename T> class CollectionOf2dSlicesOfNdArrays>
void evaluate(
const ConstGeometricalDataSlice<CoordinateType>& testGeomData,
const ConstGeometricalDataSlice<CoordinateType>& trialGeomData,
CollectionOf2dSlicesOfNdArrays<ValueType>& result) const;
// (Optional)
// Return an estimate of the magnitude of the kernel at test and trial
// points lying in a given distance from each other. This estimate does
// not need to be accurate; in practice, it is only useful to give it at
// all for exponentially decaying kernels. If this function is not
// defined, the kernel behaves as if its estimated magnitude was 1
// everywhere.
CoordinateType estimateRelativeScale(CoordinateType distance) const;
};

See the Laplace3dSingleLayerPotentialKernelFunctor class for an example implementation of a (simple) kernel collection functor.

Member Function Documentation

template<typename Functor >
void Fiber::DefaultCollectionOfKernels< Functor >::addGeometricalDependencies ( size_t &  testGeomDeps,
size_t &  trialGeomDeps 
) const
virtual

Retrieve types of geometrical data on which the kernels depend.

An implementation of this function for a particular kernel collection should modify the testGeomDeps and trialGeomDeps bitfields by adding to them, using the bitwise OR operation, an appropriate combination of the flags defined in the enum GeometricalDataType.

For example, a collection of kernels depending on the global coordinates of test and trial points and on the orientation of the vector normal to the trial element at trial points should modify the arguments as follows:

testGeomDeps |= GLOBALS;
trialGeomDeps |= GLOBALS | NORMALS;

Implements Fiber::CollectionOfKernels< Functor::ValueType >.


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