#include <source/solvers/vectors/PETSc_SAMRAIVectorReal.h>
Inheritance diagram for SAMRAI::solv::PETSc_SAMRAIVectorReal< DIM, TYPE >:
Static Public Member Functions | |
static Vec | createPETScVector (tbox::Pointer< SAMRAIVectorReal< DIM, TYPE > > samrai_vec, MPI_Comm comm=PETSC_COMM_SELF) |
static void | destroyPETScVector (Vec petsc_vec) |
static tbox::Pointer< SAMRAIVectorReal< DIM, TYPE > > | getSAMRAIVector (Vec petsc_vec) |
Protected Member Functions | |
PETSc_SAMRAIVectorReal (tbox::Pointer< SAMRAIVectorReal< DIM, TYPE > > samrai_vector, bool vector_created_via_duplicate, MPI_Comm comm) | |
virtual | ~PETSc_SAMRAIVectorReal () |
C++
interface for PETSc vectors where the underlying data is float or double. It also maintains a pointer to a SAMRAI vector object. A SAMRAI vector is defined as a collection of patch data components and associated operations living on some subset of levels in a structured AMR mesh hierarchy.Observe that there are only three public member functions in this class They are used to create and destroy PETSc vector objects (i.e., "Vec"s), and to obtain the SAMRAI vector associated with the PETSc vector. In particular, note that the constructor and destructor of this class are protected members. The construction and destruction of instances of this class may occur only through the static member functions that create and destroy PETSc vector objects.
Finally, we remark that PETSc allows vectors with complex-valued entries. This class and the class VectorReal assume real-values vectors (i.e., data of type double
or float
. The class PETSc_SAMRAIVectorComplex must be used for complex data.
SAMRAI::solv::PETSc_SAMRAIVectorReal< DIM, TYPE >::PETSc_SAMRAIVectorReal | ( | tbox::Pointer< SAMRAIVectorReal< DIM, TYPE > > | samrai_vector, | |
bool | vector_created_via_duplicate, | |||
MPI_Comm | comm | |||
) | [protected] |
SAMRAI::solv::PETSc_SAMRAIVectorReal< DIM, TYPE >::~PETSc_SAMRAIVectorReal | ( | ) | [protected, virtual] |
Vec SAMRAI::solv::PETSc_SAMRAIVectorReal< DIM, TYPE >::createPETScVector | ( | tbox::Pointer< SAMRAIVectorReal< DIM, TYPE > > | samrai_vec, | |
MPI_Comm | comm = PETSC_COMM_SELF | |||
) | [static] |
Create and return a new PETSc vector object. The SAMRAI vector object is wrapped so that it may be manipulated through the PETSc vector structure in the PETScAbstractVectorReal base class. It is important to note that this function does not allocate storage for the vector data. Data must be allocated through the SAMRAI vector object directly. For output of the data through PETSc "ViewVec" calls, the output stream to which the SAMRAI vector object writes will be used.
void SAMRAI::solv::PETSc_SAMRAIVectorReal< DIM, TYPE >::destroyPETScVector | ( | Vec | petsc_vec | ) | [static] |
Destroy a given PETSc vector object. It is important to note that this function does not deallocate storage for the vector data. Vector data must be deallocated through the SAMRAI vector object.
SAMRAI::tbox::Pointer< SAMRAI::solv::SAMRAIVectorReal< DIM, TYPE > > SAMRAI::solv::PETSc_SAMRAIVectorReal< DIM, TYPE >::getSAMRAIVector | ( | Vec | petsc_vec | ) | [static] |
Return pointer to the SAMRAI vector object associated with the given PETSc vector.