SG++

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)  
StdConstructor. 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 ()  
StdDestructor. More...  
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.

explicit 
StdConstructor.
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  (  ) 
StdDestructor.
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.
updateVector  the vector that should be updated 
sourceVector  the vector that contains the correct boundary values 
References sgpp::base::DataVector::get(), sgpp::base::HashGridStorage::getSize(), sgpp::base::HashGridPoint::isInnerPoint(), and sgpp::base::DataVector::set().
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(), and sgpp::base::DataVector::set().
void sgpp::base::DirichletUpdateVector::multiplyBoundary  (  DataVector &  updateVector, 
double  value  
) 
Multiplies the values on the boundary with a constant value.
updateVector  the vector that should be updated 
value  the value that is multiplied with the value on the boundaries 
References sgpp::base::DataVector::get(), sgpp::base::HashGridStorage::getSize(), sgpp::base::HashGridPoint::isInnerPoint(), and sgpp::base::DataVector::set().
void sgpp::base::DirichletUpdateVector::multiplyBoundaryVector  (  DataVector &  updateVector, 
DataVector &  factor  
) 
Multiplies the values on the boundary with vector.
updateVector  the vector that should be updated 
factor  the vector contains corresponding values 
References sgpp::base::DataVector::get(), sgpp::base::HashGridStorage::getSize(), sgpp::base::HashGridPoint::isInnerPoint(), and sgpp::base::DataVector::set().
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.
updateVector  the vector that should be updated 
References sgpp::base::HashGridStorage::getSize(), sgpp::base::HashGridPoint::isInnerPoint(), and sgpp::base::DataVector::set().
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.
updateVector  the vector that should be updated 
References sgpp::base::HashGridStorage::getSize(), sgpp::base::HashGridPoint::isInnerPoint(), and sgpp::base::DataVector::set().
Referenced by sgpp::pde::HeatEquationParabolicPDESolverSystemParallelOMP::generateRHS(), sgpp::pde::OperationEllipticPDESolverSystemDirichlet::generateRHS(), and sgpp::pde::OperationParabolicPDESolverSystemDirichlet::generateRHS().