OGS
NumLib::VectorProvider Class Referenceabstract

Detailed Description

Manages storage for vectors.

This interface provides storage management semantics for vectors, which can be acquired at a certain point in time, be released later on and be acquired again etc.

"Released" means that the caller indicates, that he currently does not need that Vector instance, i.e, Either it is not needed anymore for the entire program run, or it is temporarily not needed, but might be acquired again later on. Thereby the implementation of this interface can decide, whether the storage for the specific vector can be freed or reused in the meantime.

All get-methods of this class come in two variants: One with an id argument, and one without. The latter makes it possible to temporarily release a vector during the program run and re-acquire it again. The former variant is intended as a short-cut that simplifies vector acquisition for callers that will use the same vector throughout all of their lifetime without releasing it intermediately.

Attention
The first time a vector is acquired by a method with id argument, the id has to be initialized with zero. The respective method then will set the id to the specific id of the returned vector.

Definition at line 43 of file VectorProvider.h.

#include <VectorProvider.h>

Inheritance diagram for NumLib::VectorProvider:
[legend]

Public Member Functions

virtual GlobalVectorgetVector (std::size_t &id)=0
 Get an uninitialized vector with the given id. More...
 
virtual GlobalVectorgetVector (GlobalVector const &x)=0
 Get a copy of x. More...
 
virtual GlobalVectorgetVector (GlobalVector const &x, std::size_t &id)=0
 Get a copy of x in the storage of the vector with the given id. More...
 
virtual GlobalVectorgetVector (MathLib::MatrixSpecifications const &ms)=0
 Get a vector according to the given specifications. More...
 
virtual GlobalVectorgetVector (MathLib::MatrixSpecifications const &ms, std::size_t &id)=0
 
virtual void releaseVector (GlobalVector const &x)=0
 
virtual ~VectorProvider ()=default
 

Constructor & Destructor Documentation

◆ ~VectorProvider()

virtual NumLib::VectorProvider::~VectorProvider ( )
virtualdefault

Member Function Documentation

◆ getVector() [1/5]

virtual GlobalVector& NumLib::VectorProvider::getVector ( GlobalVector const &  x)
pure virtual

Get a copy of x.

Implemented in NumLib::SimpleMatrixVectorProvider.

◆ getVector() [2/5]

virtual GlobalVector& NumLib::VectorProvider::getVector ( GlobalVector const &  x,
std::size_t &  id 
)
pure virtual

Get a copy of x in the storage of the vector with the given id.

Implemented in NumLib::SimpleMatrixVectorProvider.

◆ getVector() [3/5]

virtual GlobalVector& NumLib::VectorProvider::getVector ( MathLib::MatrixSpecifications const &  ms)
pure virtual

Get a vector according to the given specifications.

Implemented in NumLib::SimpleMatrixVectorProvider.

◆ getVector() [4/5]

virtual GlobalVector& NumLib::VectorProvider::getVector ( MathLib::MatrixSpecifications const &  ms,
std::size_t &  id 
)
pure virtual

Get a vector according to the given specifications in the storage of the vector with the given id.

Implemented in NumLib::SimpleMatrixVectorProvider.

◆ getVector() [5/5]

virtual GlobalVector& NumLib::VectorProvider::getVector ( std::size_t &  id)
pure virtual

◆ releaseVector()

virtual void NumLib::VectorProvider::releaseVector ( GlobalVector const &  x)
pure virtual

Release the given vector.

Precondition
x must have been acquired before, i.e., you must not call this method twice in a row in the same x!

Implemented in NumLib::SimpleMatrixVectorProvider.

Referenced by NumLib::NonlinearSolver< NonlinearSolverTag::Newton >::~NonlinearSolver(), NumLib::NonlinearSolver< NonlinearSolverTag::Picard >::~NonlinearSolver(), NumLib::TimeDiscretizedODESystem< ODESystemTag::FirstOrderImplicitQuasilinear, NonlinearSolverTag::Newton >::~TimeDiscretizedODESystem(), NumLib::TimeDiscretizedODESystem< ODESystemTag::FirstOrderImplicitQuasilinear, NonlinearSolverTag::Picard >::~TimeDiscretizedODESystem(), ProcessLib::TimeLoop::~TimeLoop(), NumLib::TimeDiscretizedODESystem< ODESystemTag::FirstOrderImplicitQuasilinear, NonlinearSolverTag::Newton >::assemble(), NumLib::TimeDiscretizedODESystem< ODESystemTag::FirstOrderImplicitQuasilinear, NonlinearSolverTag::Picard >::assemble(), NumLib::MatrixTranslatorGeneral< ODESystemTag::FirstOrderImplicitQuasilinear >::computeRhs(), NumLib::TimeDiscretizedODESystem< ODESystemTag::FirstOrderImplicitQuasilinear, NonlinearSolverTag::Newton >::getResidual(), ProcessLib::TimeLoop::outputSolutions(), ProcessLib::postTimestepForAllProcesses(), NumLib::NonlinearSolver< NonlinearSolverTag::Newton >::solve(), NumLib::NonlinearSolver< NonlinearSolverTag::Picard >::solve(), NumLib::PETScNonlinearSolver::solve(), ProcessLib::solveOneTimeStepOneProcess(), and ProcessLib::ComponentTransport::ComponentTransportProcess::solveReactionEquation().


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