SG++-Doxygen-Documentation
|
Implements the Up/Down scheme with one dimension with a special operation. More...
#include <UpDownOneOpDim.hpp>
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::DataVector * | coefs |
Pointer to the sgpp::base::DataVector of the coefs. More... | |
const size_t | numAlgoDims_ |
number of algorithmic dimensions More... | |
sgpp::base::GridStorage * | storage |
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... | |
Implements the Up/Down scheme with one dimension with a special operation.
Parallelization with OpenMP 2 / 3 is supported!
sgpp::pde::UpDownOneOpDim::UpDownOneOpDim | ( | sgpp::base::GridStorage * | storage, |
sgpp::base::DataVector & | coef | ||
) |
Constructor.
storage | the grid's sgpp::base::GridStorage object |
coef | reference to a sgpp::base::DataVector object that contains the bilinear form's constant coefficients; one per dimension |
|
explicit |
Constructor.
storage | the grid's sgpp::base::GridStorage object |
|
virtual |
Destructor.
|
protectedpure virtual |
std 1D down operation
dim | dimension in which to apply the down-part |
alpha | vector of coefficients |
result | vector 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().
|
protectedpure virtual |
special 1D down operation that is only executed in one direction
alpha | the coefficients of the gridpoints |
result | vector with the result of this operation |
dim | the 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().
|
virtual |
starts the Multiplication with the matrix
alpha | DataVector that contains the ansatzfunctions' coefficients |
result | DataVector 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().
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.
alpha | vector of coefficients |
result | vector to store the results in |
operationDim | Dimension 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().
|
protectedvirtual |
All calculations for gradient_dim, parallel version using OpenMP 3.
alpha | the coefficients of the grid points |
result | the result of the operations |
dim | the current dimension in the recursion |
op_dim | the 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().
|
protectedpure virtual |
std 1D up operation
dim | dimension in which to apply the up-part |
alpha | vector of coefficients |
result | vector 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().
|
protected |
Recursive procedure for updown(), parallel version using OpenMP 3.
dim | the current dimension |
op_dim | the dimension in which a special operation is applied |
alpha | vector of coefficients |
result | vector 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().
|
protectedpure virtual |
special 1D up operation that is only executed in one direction
alpha | the coefficients of the gridpoints |
result | vector with the result of this operation |
dim | the 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().
|
protected |
algorithmic dimensions, operator is applied in this dimensions
Referenced by specialOP(), and updown().
|
protected |
Pointer to the sgpp::base::DataVector of the coefs.
Referenced by mult(), and multParallelBuildingBlock().
|
staticprotected |
max number of parallel stages (dimension recursive calls)
Referenced by specialOP(), and updown().
|
protected |
number of algorithmic dimensions
Referenced by mult(), multParallelBuildingBlock(), specialOP(), and updown().
|
protected |
Pointer to the grid's storage object.
Referenced by sgpp::pde::OperationLaplaceLinearStretchedBoundary::down(), sgpp::pde::OperationLaplaceModLinear::down(), sgpp::pde::OperationLaplaceLinearStretched::down(), sgpp::pde::OperationLaplaceLinearBoundary::down(), sgpp::pde::OperationLaplaceLinear::down(), sgpp::pde::OperationLaplaceModLinear::downOpDim(), sgpp::pde::OperationLaplaceLinearStretchedBoundary::downOpDim(), sgpp::pde::OperationLaplaceLinearStretched::downOpDim(), sgpp::pde::OperationLaplaceLinearBoundary::downOpDim(), sgpp::pde::OperationLaplaceLinear::downOpDim(), sgpp::pde::OperationLaplaceExplicitLinear::OperationLaplaceExplicitLinear(), sgpp::pde::OperationLaplaceModLinear::up(), sgpp::pde::OperationLaplaceLinearStretchedBoundary::up(), sgpp::pde::OperationLaplaceLinearStretched::up(), sgpp::pde::OperationLaplaceLinearBoundary::up(), sgpp::pde::OperationLaplaceLinear::up(), sgpp::pde::OperationLaplaceModLinear::upOpDim(), sgpp::pde::OperationLaplaceLinearStretchedBoundary::upOpDim(), and sgpp::pde::OperationLaplaceLinearBoundary::upOpDim().