SG++
sgpp::base::DirichletUpdateVector Class Reference

This class is useful if you do some PDE calculations with Dirichlet Boundary Conditions. More...

#include <DirichletUpdateVector.hpp>

## Public Member Functions

void applyDirichletConditions (DataVector &updateVector, DataVector &sourceVector)
Replace the boundary entries in updateVector with the one from sourceVector only in that dimension, for which Dirichlet Boundary Conditions were specified. More...

DirichletUpdateVector (GridStorage &storage)
Std-Constructor. More...

void multiply (DataVector &updateVector, double value, bool(*predicate)(GridPoint *, GridStorage &))
Multiplies the values of the points in the vector that meet the predicate condition by the constant value. More...

void multiplyBoundary (DataVector &updateVector, double value)
Multiplies the values on the boundary with a constant value. More...

void multiplyBoundaryVector (DataVector &updateVector, DataVector &factor)
Multiplies the values on the boundary with vector. More...

void setBoundariesToZero (DataVector &updateVector)
Replace the boundary entries in updateVector with Zero only in that dimension, for which Dirichlet Boundary Conditions were specified. More...

void setInnerPointsToZero (DataVector &updateVector)
Replace the inner entries in updateVector with Zero only in that dimension, for which Dirichlet Boundary Conditions were specified. More...

~DirichletUpdateVector ()
Std-Destructor. More...

## Detailed Description

This class is useful if you do some PDE calculations with Dirichlet Boundary Conditions.

Doing this, e.g. you might wish to add some solution from a timestep to the current coefficients of the sparse grid. If you are using Dirichlet conditions you mustn't overwrite the values on the boundaries in your coefficient vector.

This class implements a functor that uses the Bounding Box of the grid to determine, if a boundary has to implement Dirichlet boundary conditions. In that case, simply use this to replace all values in the update vector on these boundaries with zero, so you can safely add the resulting vector to your solution.

## Constructor & Destructor Documentation

 sgpp::base::DirichletUpdateVector::DirichletUpdateVector ( GridStorage & storage )
explicit

Std-Constructor.

Parameters
 storage the grid's storage object; needed to determine the bounding box and to iterate of the entries in the coefficient vector
 sgpp::base::DirichletUpdateVector::~DirichletUpdateVector ( )

Std-Destructor.

## Member Function Documentation

 void sgpp::base::DirichletUpdateVector::applyDirichletConditions ( DataVector & updateVector, DataVector & sourceVector )

Replace the boundary entries in updateVector with the one from sourceVector only in that dimension, for which Dirichlet Boundary Conditions were specified.

Parameters
 updateVector the vector that should be updated sourceVector the vector that contains the correct boundary values
 void sgpp::base::DirichletUpdateVector::multiply ( DataVector & updateVector, double value, bool(*)(GridPoint *, GridStorage &) predicate )

Multiplies the values of the points in the vector that meet the predicate condition by the constant value.

Calling this method with a function pointer that returns true if point->isInnerPoint() and false otherwise gives the same result as the multiplyBoundary method.

 void sgpp::base::DirichletUpdateVector::multiplyBoundary ( DataVector & updateVector, double value )

Multiplies the values on the boundary with a constant value.

Parameters
 updateVector the vector that should be updated value the value that is multiplied with the value on the boundaries
 void sgpp::base::DirichletUpdateVector::multiplyBoundaryVector ( DataVector & updateVector, DataVector & factor )

Multiplies the values on the boundary with vector.

Parameters
 updateVector the vector that should be updated factor the vector contains corresponding values
 void sgpp::base::DirichletUpdateVector::setBoundariesToZero ( DataVector & updateVector )

Replace the boundary entries in updateVector with Zero only in that dimension, for which Dirichlet Boundary Conditions were specified.

Parameters
 updateVector the vector that should be updated
 void sgpp::base::DirichletUpdateVector::setInnerPointsToZero ( DataVector & updateVector )

Replace the inner entries in updateVector with Zero only in that dimension, for which Dirichlet Boundary Conditions were specified.

Parameters
 updateVector the vector that should be updated

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