SG++-Doxygen-Documentation
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

◆ DirichletUpdateVector()

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

Std-Constructor.

Parameters
storagethe grid's storage object; needed to determine the bounding box and to iterate of the entries in the coefficient vector

◆ ~DirichletUpdateVector()

sgpp::base::DirichletUpdateVector::~DirichletUpdateVector ( )

Std-Destructor.

Member Function Documentation

◆ applyDirichletConditions()

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
updateVectorthe vector that should be updated
sourceVectorthe vector that contains the correct boundary values

References sgpp::base::DataVector::get(), sgpp::base::HashGridStorage::getSize(), python.statsfileInfo::i, sgpp::base::HashGridPoint::isInnerPoint(), and sgpp::base::DataVector::set().

◆ multiply()

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.

References sgpp::base::DataVector::get(), sgpp::base::HashGridStorage::getSize(), python.statsfileInfo::i, and sgpp::base::DataVector::set().

◆ multiplyBoundary()

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

Multiplies the values on the boundary with a constant value.

Parameters
updateVectorthe vector that should be updated
valuethe value that is multiplied with the value on the boundaries

References sgpp::base::DataVector::get(), sgpp::base::HashGridStorage::getSize(), python.statsfileInfo::i, sgpp::base::HashGridPoint::isInnerPoint(), and sgpp::base::DataVector::set().

◆ multiplyBoundaryVector()

void sgpp::base::DirichletUpdateVector::multiplyBoundaryVector ( DataVector updateVector,
DataVector factor 
)

Multiplies the values on the boundary with vector.

Parameters
updateVectorthe vector that should be updated
factorthe vector contains corresponding values

References sgpp::base::DataVector::get(), sgpp::base::HashGridStorage::getSize(), python.statsfileInfo::i, sgpp::base::HashGridPoint::isInnerPoint(), and sgpp::base::DataVector::set().

◆ setBoundariesToZero()

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
updateVectorthe vector that should be updated

References sgpp::base::HashGridStorage::getSize(), python.statsfileInfo::i, sgpp::base::HashGridPoint::isInnerPoint(), and sgpp::base::DataVector::set().

◆ setInnerPointsToZero()

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
updateVectorthe vector that should be updated

References sgpp::base::HashGridStorage::getSize(), python.statsfileInfo::i, sgpp::base::HashGridPoint::isInnerPoint(), and sgpp::base::DataVector::set().

Referenced by sgpp::pde::HeatEquationParabolicPDESolverSystemParallelOMP::generateRHS(), sgpp::pde::OperationEllipticPDESolverSystemDirichlet::generateRHS(), and sgpp::pde::OperationParabolicPDESolverSystemDirichlet::generateRHS().


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