Reference documentation for deal.II version 9.3.3
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Public Member Functions | Private Attributes | Related Functions | List of all members
SUNDIALS::internal::NVectorView< VectorType > Class Template Reference

#include <deal.II/sundials/n_vector.h>

Public Member Functions

 NVectorView ()=default
 
 NVectorView (VectorType &vector)
 
 NVectorView (NVectorView &&) noexcept=default
 
NVectorViewoperator= (NVectorView &&) noexcept=default
 
 NVectorView (const NVectorView &)=delete
 
NVectorViewoperator= (const NVectorView &)=delete
 
 ~NVectorView ()=default
 
 operator N_Vector () const
 
N_Vector operator-> () const
 

Private Attributes

std::unique_ptr< _generic_N_Vector, std::function< void(N_Vector)> > vector_ptr
 

Related Functions

(Note that these are not member functions.)

template<typename VectorType >
NVectorView< VectorType > make_nvector_view (VectorType &vector)
 

Detailed Description

template<typename VectorType>
class SUNDIALS::internal::NVectorView< VectorType >

A view to a vector which can be used whenever a N_Vector is required.

Objects of this class should preferably be created by make_nvector_view() as

auto view = make_nvector_view(vector);
NVectorView< VectorType > make_nvector_view(VectorType &vector)

The resulting N_Vector is a view of the actual vector and not owning memory. Also, N_VDestroy() cannot be called on the resulting N_Vector since this would lead to a double delete in the destructor.

Note
SUNDIALS will never call N_VDestroy() on a vector it didn't create itself and thus the above constraint is not limiting the user.
Template Parameters
VectorTypeType of the vector that is stored in v

Definition at line 118 of file n_vector.h.

Constructor & Destructor Documentation

◆ NVectorView() [1/4]

template<typename VectorType >
SUNDIALS::internal::NVectorView< VectorType >::NVectorView ( )
default

Default constructor.

The object is not actually viewing anything and needs to be assigned to with operator=(NVectorView &&).

◆ NVectorView() [2/4]

template<typename VectorType >
SUNDIALS::internal::NVectorView< VectorType >::NVectorView ( VectorType &  vector)

Constructor. Create view of vector.

◆ NVectorView() [3/4]

template<typename VectorType >
SUNDIALS::internal::NVectorView< VectorType >::NVectorView ( NVectorView< VectorType > &&  )
defaultnoexcept

Move assignment.

◆ NVectorView() [4/4]

template<typename VectorType >
SUNDIALS::internal::NVectorView< VectorType >::NVectorView ( const NVectorView< VectorType > &  )
delete

Explicitly delete copy ctor. This class is move-only.

◆ ~NVectorView()

template<typename VectorType >
SUNDIALS::internal::NVectorView< VectorType >::~NVectorView ( )
default

Destructor.

Note
This will not destroy the viewed vector.

Member Function Documentation

◆ operator=() [1/2]

template<typename VectorType >
NVectorView & SUNDIALS::internal::NVectorView< VectorType >::operator= ( NVectorView< VectorType > &&  )
defaultnoexcept

Move constructor.

◆ operator=() [2/2]

template<typename VectorType >
NVectorView & SUNDIALS::internal::NVectorView< VectorType >::operator= ( const NVectorView< VectorType > &  )
delete

Explicitly delete copy assignment. This class is move-only.

◆ operator N_Vector()

template<typename VectorType >
SUNDIALS::internal::NVectorView< VectorType >::operator N_Vector ( ) const

Implicit conversion to N_Vector. This operator makes the NVectorView look like an actual N_Vector and it can be used directly as an argument in many SUNDIALS functions.

◆ operator->()

template<typename VectorType >
N_Vector SUNDIALS::internal::NVectorView< VectorType >::operator-> ( ) const

Access the N_Vector that is viewed by this object.

Friends And Related Function Documentation

◆ make_nvector_view()

template<typename VectorType >
NVectorView< VectorType > make_nvector_view ( VectorType &  vector)
related

Create a NVectorView of the given vector.

This call is intended to be used as

auto view = make_nvector_view(vector);

The resulting object view must be kept around as long as any other object will use the internally viewed N_Vector.

Template Parameters
VectorTypeType of the viewed vector. This parameter can be deduced automatically and will respect a potential const-qualifier.
Parameters
vectorThe vector to view.
Returns
A NVectorView of the vector.

Member Data Documentation

◆ vector_ptr

template<typename VectorType >
std::unique_ptr<_generic_N_Vector, std::function<void(N_Vector)> > SUNDIALS::internal::NVectorView< VectorType >::vector_ptr
private

Actual pointer to a vector viewed by this class.

Definition at line 180 of file n_vector.h.


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