Advanced Multi-Physics (AMP)
On-Line Documentation
SundialsVector.h
Go to the documentation of this file.
1#ifndef included_AMP_SundialsVector
2#define included_AMP_SundialsVector
3
4
5#include "AMP/vectors/Vector.h"
6
7extern "C" {
8#include "sundials/sundials_nvector.h"
9}
10
11namespace AMP::LinearAlgebra {
12
23
37{
38protected:
45 N_Vector d_n_vector;
46
54
55public:
74 N_Vector &getNVector();
75
94 const N_Vector &getNVector() const;
95
102 static std::shared_ptr<SundialsVector> view( Vector::shared_ptr AmpVector );
103
110 static std::shared_ptr<const SundialsVector> constView( Vector::const_shared_ptr AmpVector );
111
112public:
113 inline N_Vector &getNativeVec() { return getNVector(); }
114 inline const N_Vector &getNativeVec() const { return getNVector(); }
115 virtual std::shared_ptr<Vector> getManagedVec() = 0;
116 virtual std::shared_ptr<const Vector> getManagedVec() const = 0;
117};
118
119
120} // namespace AMP::LinearAlgebra
121
122
123/********************************************************
124 * Get the AMP vector from the PETSc Vec or Mat *
125 ********************************************************/
126std::shared_ptr<AMP::LinearAlgebra::Vector> getAMP( N_Vector t );
127
128
129#endif
std::shared_ptr< AMP::LinearAlgebra::Vector > getAMP(N_Vector t)
Parameters class to construct a Sundials N_Vector.
SundialsVector is a bridge between AMP::LinearAlgebra::Vector and the Sundials N_Vector data structur...
N_Vector & getNVector()
Obtain a Sundials N_Vector for use in Sundials routines.
SundialsVector()
Construct a SundialsVector.
static std::shared_ptr< SundialsVector > view(Vector::shared_ptr AmpVector)
If needed, create a Sundials wrapper for AmpVector. Otherwise, return AmpVector.
N_Vector d_n_vector
Sundials NVector wrapping the data in the Vector.
const N_Vector & getNativeVec() const
static std::shared_ptr< const SundialsVector > constView(Vector::const_shared_ptr AmpVector)
If needed, create a Sundials wrapper for AmpVector. Otherwise, return AmpVector.
const N_Vector & getNVector() const
Obtain a Sundials N_Vector for use in Sundials routines.
virtual std::shared_ptr< const Vector > getManagedVec() const =0
virtual std::shared_ptr< Vector > getManagedVec()=0
std::shared_ptr< Vector > shared_ptr
Shorthand for shared pointer to Vector.
Definition Vector.h:60
std::shared_ptr< const Vector > const_shared_ptr
Definition Vector.h:65



Advanced Multi-Physics (AMP)
Oak Ridge National Laboratory
Idaho National Laboratory
Los Alamos National Laboratory
This page automatically produced from the
source code by doxygen
Last updated: Tue Mar 10 2026 13:06:41.
Comments on this page