SG++-Doxygen-Documentation
sgpp::pde::UpDownOneOpDim Class Referenceabstract

Implements the Up/Down scheme with one dimension with a special operation. More...

#include <UpDownOneOpDim.hpp>

Inheritance diagram for sgpp::pde::UpDownOneOpDim:
sgpp::base::OperationMatrix sgpp::pde::OperationLaplaceExplicitLinear sgpp::pde::OperationLaplaceLinear sgpp::pde::OperationLaplaceLinearBoundary sgpp::pde::OperationLaplaceLinearStretched sgpp::pde::OperationLaplaceLinearStretchedBoundary sgpp::pde::OperationLaplaceModLinear

Public Member Functions

virtual void mult (sgpp::base::DataVector &alpha, sgpp::base::DataVector &result)
 starts the Multiplication with the matrix More...
 
void multParallelBuildingBlock (sgpp::base::DataVector &alpha, sgpp::base::DataVector &result, size_t operationDim)
 This functions provides the same functionality as the normal mult routine. More...
 
 UpDownOneOpDim (sgpp::base::GridStorage *storage, sgpp::base::DataVector &coef)
 Constructor. More...
 
 UpDownOneOpDim (sgpp::base::GridStorage *storage)
 Constructor. More...
 
virtual ~UpDownOneOpDim ()
 Destructor. More...
 
- Public Member Functions inherited from sgpp::base::OperationMatrix
 OperationMatrix ()
 Constructor. More...
 
virtual ~OperationMatrix ()
 Destructor. More...
 

Protected Types

typedef sgpp::base::GridStorage::grid_iterator grid_iterator
 

Protected Member Functions

virtual void down (sgpp::base::DataVector &alpha, sgpp::base::DataVector &result, size_t dim)=0
 std 1D down operation More...
 
virtual void downOpDim (sgpp::base::DataVector &alpha, sgpp::base::DataVector &result, size_t dim)=0
 special 1D down operation that is only executed in one direction More...
 
virtual void specialOP (sgpp::base::DataVector &alpha, sgpp::base::DataVector &result, size_t dim, size_t op_dim)
 All calculations for gradient_dim, parallel version using OpenMP 3. More...
 
virtual void up (sgpp::base::DataVector &alpha, sgpp::base::DataVector &result, size_t dim)=0
 std 1D up operation More...
 
void updown (sgpp::base::DataVector &alpha, sgpp::base::DataVector &result, size_t dim, size_t op_dim)
 Recursive procedure for updown(), parallel version using OpenMP 3. More...
 
virtual void upOpDim (sgpp::base::DataVector &alpha, sgpp::base::DataVector &result, size_t dim)=0
 special 1D up operation that is only executed in one direction More...
 

Protected Attributes

const std::vector< size_t > algoDims
 algorithmic dimensions, operator is applied in this dimensions More...
 
sgpp::base::DataVectorcoefs
 Pointer to the sgpp::base::DataVector of the coefs. More...
 
const size_t numAlgoDims_
 number of algorithmic dimensions More...
 
sgpp::base::GridStoragestorage
 Pointer to the grid's storage object. More...
 

Static Protected Attributes

static const size_t maxParallelDims_ = TASKS_PARALLEL_UPDOWN
 max number of parallel stages (dimension recursive calls) More...
 

Detailed Description

Implements the Up/Down scheme with one dimension with a special operation.

Parallelization with OpenMP 2 / 3 is supported!

Member Typedef Documentation

◆ grid_iterator

Constructor & Destructor Documentation

◆ UpDownOneOpDim() [1/2]

sgpp::pde::UpDownOneOpDim::UpDownOneOpDim ( sgpp::base::GridStorage storage,
sgpp::base::DataVector coef 
)

Constructor.

Parameters
storagethe grid's sgpp::base::GridStorage object
coefreference to a sgpp::base::DataVector object that contains the bilinear form's constant coefficients; one per dimension

◆ UpDownOneOpDim() [2/2]

sgpp::pde::UpDownOneOpDim::UpDownOneOpDim ( sgpp::base::GridStorage storage)
explicit

Constructor.

Parameters
storagethe grid's sgpp::base::GridStorage object

◆ ~UpDownOneOpDim()

sgpp::pde::UpDownOneOpDim::~UpDownOneOpDim ( )
virtual

Destructor.

Member Function Documentation

◆ down()

virtual void sgpp::pde::UpDownOneOpDim::down ( sgpp::base::DataVector alpha,
sgpp::base::DataVector result,
size_t  dim 
)
protectedpure virtual

std 1D down operation

Parameters
dimdimension in which to apply the down-part
alphavector of coefficients
resultvector to store the results in

Implemented in sgpp::pde::OperationLaplaceExplicitLinear, sgpp::pde::OperationLaplaceLinear, sgpp::pde::OperationLaplaceLinearBoundary, sgpp::pde::OperationLaplaceLinearStretched, sgpp::pde::OperationLaplaceLinearStretchedBoundary, and sgpp::pde::OperationLaplaceModLinear.

Referenced by updown().

◆ downOpDim()

virtual void sgpp::pde::UpDownOneOpDim::downOpDim ( sgpp::base::DataVector alpha,
sgpp::base::DataVector result,
size_t  dim 
)
protectedpure virtual

special 1D down operation that is only executed in one direction

Parameters
alphathe coefficients of the gridpoints
resultvector with the result of this operation
dimthe dimension in that down-Gradient is applied

Implemented in sgpp::pde::OperationLaplaceExplicitLinear, sgpp::pde::OperationLaplaceLinear, sgpp::pde::OperationLaplaceLinearBoundary, sgpp::pde::OperationLaplaceLinearStretched, sgpp::pde::OperationLaplaceLinearStretchedBoundary, and sgpp::pde::OperationLaplaceModLinear.

Referenced by specialOP().

◆ mult()

void sgpp::pde::UpDownOneOpDim::mult ( sgpp::base::DataVector alpha,
sgpp::base::DataVector result 
)
virtual

starts the Multiplication with the matrix

Parameters
alphaDataVector that contains the ansatzfunctions' coefficients
resultDataVector into which the result of the Laplace operation is stored

Implements sgpp::base::OperationMatrix.

Reimplemented in sgpp::pde::OperationLaplaceExplicitLinear.

References sgpp::base::DataVector::add(), sgpp::base::DataVector::axpy(), coefs, sgpp::base::DataVector::get(), sgpp::base::DataVector::getSize(), python.statsfileInfo::i, numAlgoDims_, sgpp::base::DataVector::setAll(), and updown().

Referenced by sgpp::pde::OperationLaplaceExplicitLinear::OperationLaplaceExplicitLinear().

◆ multParallelBuildingBlock()

void sgpp::pde::UpDownOneOpDim::multParallelBuildingBlock ( sgpp::base::DataVector alpha,
sgpp::base::DataVector result,
size_t  operationDim 
)

This functions provides the same functionality as the normal mult routine.

However, it doesn't set up an OpenMP task initialization as the mult routine. This method has to be called within a OpenMP task parallelized region.

Using this function is useful in following case: Assuming the solver of a certain requires several operators in the space discretization (e.g. Black Scholes Equations) this method can be used to parallelize their calculation which might results results in a better parallel efficiency on systems with 4 or more cores hence fewer barriers are needed.

For full calculation in of mult serval number of up/downs are needed. This number is equal to the number of the grid's dimensions. All different steps can be executed in parallel, so here only one up/Down is executed, identified by its special dimension.

Parameters
alphavector of coefficients
resultvector to store the results in
operationDimDimension in which the special operator is applied

References sgpp::base::DataVector::add(), sgpp::base::DataVector::axpy(), coefs, sgpp::base::DataVector::get(), sgpp::base::DataVector::getSize(), numAlgoDims_, sgpp::base::DataVector::setAll(), and updown().

◆ specialOP()

void sgpp::pde::UpDownOneOpDim::specialOP ( sgpp::base::DataVector alpha,
sgpp::base::DataVector result,
size_t  dim,
size_t  op_dim 
)
protectedvirtual

All calculations for gradient_dim, parallel version using OpenMP 3.

Parameters
alphathe coefficients of the grid points
resultthe result of the operations
dimthe current dimension in the recursion
op_dimthe dimension in that a special operation is applied

Reimplemented in sgpp::pde::OperationLaplaceExplicitLinear, sgpp::pde::OperationLaplaceLinear, and sgpp::pde::OperationLaplaceLinearStretched.

References sgpp::base::DataVector::add(), algoDims, downOpDim(), sgpp::base::DataVector::getSize(), maxParallelDims_, numAlgoDims_, updown(), and upOpDim().

Referenced by updown().

◆ up()

virtual void sgpp::pde::UpDownOneOpDim::up ( sgpp::base::DataVector alpha,
sgpp::base::DataVector result,
size_t  dim 
)
protectedpure virtual

std 1D up operation

Parameters
dimdimension in which to apply the up-part
alphavector of coefficients
resultvector to store the results in

Implemented in sgpp::pde::OperationLaplaceExplicitLinear, sgpp::pde::OperationLaplaceLinear, sgpp::pde::OperationLaplaceLinearBoundary, sgpp::pde::OperationLaplaceLinearStretched, sgpp::pde::OperationLaplaceLinearStretchedBoundary, and sgpp::pde::OperationLaplaceModLinear.

Referenced by updown().

◆ updown()

void sgpp::pde::UpDownOneOpDim::updown ( sgpp::base::DataVector alpha,
sgpp::base::DataVector result,
size_t  dim,
size_t  op_dim 
)
protected

Recursive procedure for updown(), parallel version using OpenMP 3.

Parameters
dimthe current dimension
op_dimthe dimension in which a special operation is applied
alphavector of coefficients
resultvector to store the results in

References sgpp::base::DataVector::add(), algoDims, down(), sgpp::base::DataVector::getSize(), maxParallelDims_, numAlgoDims_, specialOP(), and up().

Referenced by mult(), multParallelBuildingBlock(), sgpp::pde::OperationLaplaceLinearStretched::specialOP(), sgpp::pde::OperationLaplaceLinear::specialOP(), sgpp::pde::OperationLaplaceExplicitLinear::specialOP(), and specialOP().

◆ upOpDim()

virtual void sgpp::pde::UpDownOneOpDim::upOpDim ( sgpp::base::DataVector alpha,
sgpp::base::DataVector result,
size_t  dim 
)
protectedpure virtual

special 1D up operation that is only executed in one direction

Parameters
alphathe coefficients of the gridpoints
resultvector with the result of this operation
dimthe dimension in that up-Gradient is applied

Implemented in sgpp::pde::OperationLaplaceExplicitLinear, sgpp::pde::OperationLaplaceLinear, sgpp::pde::OperationLaplaceLinearBoundary, sgpp::pde::OperationLaplaceLinearStretched, sgpp::pde::OperationLaplaceLinearStretchedBoundary, and sgpp::pde::OperationLaplaceModLinear.

Referenced by specialOP().

Member Data Documentation

◆ algoDims

const std::vector<size_t> sgpp::pde::UpDownOneOpDim::algoDims
protected

algorithmic dimensions, operator is applied in this dimensions

Referenced by specialOP(), and updown().

◆ coefs

sgpp::base::DataVector* sgpp::pde::UpDownOneOpDim::coefs
protected

Pointer to the sgpp::base::DataVector of the coefs.

Referenced by mult(), and multParallelBuildingBlock().

◆ maxParallelDims_

const size_t sgpp::pde::UpDownOneOpDim::maxParallelDims_ = TASKS_PARALLEL_UPDOWN
staticprotected

max number of parallel stages (dimension recursive calls)

Referenced by specialOP(), and updown().

◆ numAlgoDims_

const size_t sgpp::pde::UpDownOneOpDim::numAlgoDims_
protected

number of algorithmic dimensions

Referenced by mult(), multParallelBuildingBlock(), specialOP(), and updown().

◆ storage


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