AMDiS  0.3
The Adaptive Multi-Dimensional Simulation Toolbox
DOFVector< GB, T, TraitsType > Class Template Reference

The basic container that stores a base vector and a corresponding basis. More...

#include <DOFVector.hpp>

Inherits VectorFacade< T, TraitsType::template VectorImpl >, Observer< event::preAdapt >, Observer< event::adapt >, and Observer< event::postAdapt >.

Public Types

using GlobalBasis = GB
 A global basis associated to the coefficients.
 
using Coefficients = VectorFacade< T, TraitsType::template VectorImpl >
 The internal coefficient vector storage.
 
using size_type = typename GlobalBasis::size_type
 The index/size - type.
 
using value_type = T
 The type of the elements of the DOFVector.
 
using DataTransfer = DataTransferWrapper< Self >
 Wrapper for the implementation of the transfer of data during grid adaption.
 
using Traits = TraitsType
 Collection of parameter for the linear-algebra backend.
 
- Public Types inherited from VectorFacade< T, TraitsType::template VectorImpl >
using size_type = typename Impl::size_type
 
using value_type = typename Impl::value_type
 
using HasLocalSize = decltype(std::declval< V >().localSize())
 
using HasGlobalSize = decltype(std::declval< V >().globalSize())
 

Public Member Functions

 DOFVector (std::shared_ptr< GB > const &basis, DataTransferOperation op=DataTransferOperation::INTERPOLATE)
 
template<class GB_ , REQUIRES(Concepts::Similar< GB_, GB >) >
 DOFVector (GB_ &&basis, DataTransferOperation op=DataTransferOperation::INTERPOLATE)
 
template<class GV , class PBF , REQUIRES(Concepts::PreBasisFactory< PBF, GV, MultiIndex_t< PBF >>) >
 DOFVector (GV const &gridView, PBF const &preBasisFactory, DataTransferOperation op=DataTransferOperation::INTERPOLATE)
 
GlobalBasis const & basis () const
 Return the global basis.
 
Coefficients const & coefficients () const
 
Coefficientscoefficients ()
 
void backup (std::string const &filename)
 Write DOFVector to file.
 
void restore (std::string const &filename)
 Read backup data from file.
 
void resize ()
 
void resizeZero ()
 
DataTransfer const & dataTransfer () const
 Return the associated DataTransfer object.
 
DataTransferdataTransfer ()
 Return the associated DataTransfer object.
 
void setDataTransfer (DataTransfer const &dataTransfer)
 Assign the DataTransfer object.
 
void setDataTransfer (DataTransfer &&dataTransfer)
 
void setDataTransfer (DataTransferOperation op)
 Create a new DataTransfer object based on the operation type.
 
- Public Member Functions inherited from VectorFacade< T, TraitsType::template VectorImpl >
 VectorFacade (GlobalBasis const &basis)
 
Impl const & impl () const
 Return the underlying linear algebra backend.
 
Implimpl ()
 
std::size_t localSize () const
 Return the number of entries in the local part of the vector.
 
std::size_t globalSize () const
 Return the number of entries in the global vector.
 
void resize (SizeInfo const &sizeInfo)
 Resize the vector to the size of the basis.
 
void resizeZero (SizeInfo const &sizeInfo)
 Resize the vector to the size of the basis and set to zero.
 
void init (SizeInfo const &sizeInfo, bool clear)
 
void finish ()
 Finish the insertion of values, see init()
 
Impl::value_type at (Index const &idx) const
 Return the value of the vector at the local index idx.
 
void insert (Index const &idx, typename Impl::value_type const &value, Assign assign={})
 Insert a single value into the matrix (add or overwrite to existing value) More...
 
void set (Index const &idx, typename Impl::value_type const &value)
 See insert for assignment operation Assigner::assign.
 
void add (Index const &idx, typename Impl::value_type const &value)
 See insert for assignment operation Assigner::plus_assign.
 
void gather (LocalView const &localView, Node const &node, Buffer &buffer) const
 Extract values from the vector referring to the given local indices and store it into a buffer. More...
 
void gather (LocalView const &localView, Buffer &buffer) const
 
void scatter (LocalView const &localView, Node const &node, NodeVector const &localVector, MaskRange const &mask, Assign assign)
 Insert a block of values into the vector (add or overwrite to existing values) More...
 
void scatter (LocalView const &localView, Node const &node, NodeVector const &localVector, Assign assign)
 Call scatter with MaskRange set to FakeContainer.
 
void scatter (LocalView const &localView, LocalVector const &localVector, Assign assign)
 Call scatter with Node given by the tree of the localView.
 
void forEach (LocalInd const &localInd, Func &&func)
 Apply func to each value at given indices localInd. More...
 
void forEach (Func &&func)
 Call forEach for all entries in the vector.
 
void forEach (LocalInd const &localInd, Func &&func) const
 Apply func to each value at given indices localInd. More...
 
void forEach (Func &&func) const
 Call forEach for all entries in the vector.
 

Protected Member Functions

void updateImpl (event::preAdapt e) override
 
void updateImpl (event::adapt e) override
 
void updateImpl (event::postAdapt) override
 

Detailed Description

template<class GB, class T = double, class TraitsType = BackendTraits<GB>>
class AMDiS::DOFVector< GB, T, TraitsType >

The basic container that stores a base vector and a corresponding basis.

Template Parameters
GBBasis of the vector
TType of the coefficients
TraitsTypeCollection of parameter for the linear-algebra backend

Constructor & Destructor Documentation

◆ DOFVector() [1/3]

DOFVector ( std::shared_ptr< GB > const &  basis,
DataTransferOperation  op = DataTransferOperation::INTERPOLATE 
)
inline

(1) Constructor. Stores the shared_ptr of the basis and creates a new DataTransfer.

Referenced by DOFVector< GB, T, TraitsType >::updateImpl().

◆ DOFVector() [2/3]

DOFVector ( GB_ &&  basis,
DataTransferOperation  op = DataTransferOperation::INTERPOLATE 
)
inline

(2) Constructor. Forwards to (1) by wrapping reference into non-destroying shared_ptr, see Dune::wrap_or_move.

◆ DOFVector() [3/3]

DOFVector ( GV const &  gridView,
PBF const &  preBasisFactory,
DataTransferOperation  op = DataTransferOperation::INTERPOLATE 
)
inline

(3) Constructor. Forwards to (1) by creating a new basis from a dune-functions pre-basis factory.

Member Function Documentation

◆ updateImpl() [1/3]

void updateImpl ( event::preAdapt  e)
inlineoverrideprotected

Override of Observer update(event::preAdapt) method. Redirects to preAdapt method of the DataTransfer object.

◆ updateImpl() [2/3]

void updateImpl ( event::adapt  e)
inlineoverrideprotected

Override of Observer update(event::adapt) method. Redirects to adapt method of the DataTransfer object.

◆ updateImpl() [3/3]

void updateImpl ( event::postAdapt  )
inlineoverrideprotected

Override of Observer update(event::postAdapt) method. Redirects to postAdapt method of the DataTransfer object.

References DOFVector< GB, T, TraitsType >::basis(), and DOFVector< GB, T, TraitsType >::DOFVector().


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