Flow123d  release_3.0.0-684-g928e266
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
VectorMPI Class Reference

#include <vector_mpi.hh>

Public Types

typedef std::vector< double > VectorData
 
typedef std::shared_ptr< VectorDataVectorDataPtr
 

Public Member Functions

 VectorMPI (MPI_Comm comm=PETSC_COMM_SELF)
 
 VectorMPI (unsigned int local_size, MPI_Comm comm=PETSC_COMM_WORLD)
 Create shared pointer and PETSC vector with given size. COLLECTIVE. More...
 
void resize (unsigned int local_size)
 
void duplicate (VectorMPI other)
 Return new vector with same parallel structure. More...
 
VectorDataPtr data_ptr ()
 Getter for shared pointer of output data. More...
 
Vec & petsc_vec ()
 Getter for PETSC vector of output data (e.g. can be used by scatters). More...
 
void zero_entries ()
 
VectorDatadata ()
 
void swap (VectorMPI &other)
 
void copy (VectorMPI &other)
 
unsigned int size ()
 Return size of output data. More...
 
 ~VectorMPI ()
 Destructor. More...
 
double & operator[] (unsigned int idx)
 

Static Public Member Functions

static VectorMPIsequential (unsigned int size)
 

Private Attributes

VectorDataPtr data_ptr_
 shared pointer to vector of data More...
 
Vec data_petsc_
 stored vector of data in PETSC format More...
 
MPI_Comm communicator_
 communicator More...
 

Detailed Description

Auxiliary class for output elementwise concentration vectors in convection transport, sorptions, dual porosity etc.

Stores data in two formats:

Allows the following functionalities:

Definition at line 41 of file vector_mpi.hh.

Member Typedef Documentation

Definition at line 43 of file vector_mpi.hh.

typedef std::shared_ptr< VectorData > VectorMPI::VectorDataPtr

Definition at line 44 of file vector_mpi.hh.

Constructor & Destructor Documentation

VectorMPI::VectorMPI ( MPI_Comm  comm = PETSC_COMM_SELF)
inline

Definition at line 46 of file vector_mpi.hh.

Here is the caller graph for this function:

VectorMPI::VectorMPI ( unsigned int  local_size,
MPI_Comm  comm = PETSC_COMM_WORLD 
)
inline

Create shared pointer and PETSC vector with given size. COLLECTIVE.

Definition at line 50 of file vector_mpi.hh.

VectorMPI::~VectorMPI ( )
inline

Destructor.

Definition at line 144 of file vector_mpi.hh.

Member Function Documentation

void VectorMPI::copy ( VectorMPI other)
inline

Definition at line 129 of file vector_mpi.hh.

VectorData& VectorMPI::data ( )
inline

Definition at line 106 of file vector_mpi.hh.

Here is the caller graph for this function:

VectorDataPtr VectorMPI::data_ptr ( )
inline

Getter for shared pointer of output data.

Definition at line 91 of file vector_mpi.hh.

Here is the caller graph for this function:

void VectorMPI::duplicate ( VectorMPI  other)
inline

Return new vector with same parallel structure.

Definition at line 85 of file vector_mpi.hh.

double& VectorMPI::operator[] ( unsigned int  idx)
inline

Access to the vector element on index idx.

Definition at line 152 of file vector_mpi.hh.

Vec& VectorMPI::petsc_vec ( )
inline

Getter for PETSC vector of output data (e.g. can be used by scatters).

Definition at line 97 of file vector_mpi.hh.

void VectorMPI::resize ( unsigned int  local_size)
inline

Resize the vector to given local size. Operation is allowed only if this object is a unique vector object pointing to the actual data.

Definition at line 69 of file vector_mpi.hh.

Here is the caller graph for this function:

static VectorMPI* VectorMPI::sequential ( unsigned int  size)
inlinestatic

Helper method creating VectorMPI of given size with serial Petsc communicator.

Method is used for better readability of code.

Definition at line 60 of file vector_mpi.hh.

Here is the caller graph for this function:

unsigned int VectorMPI::size ( )
inline

Return size of output data.

Definition at line 136 of file vector_mpi.hh.

Here is the caller graph for this function:

void VectorMPI::swap ( VectorMPI other)
inline

Definition at line 112 of file vector_mpi.hh.

void VectorMPI::zero_entries ( )
inline

Definition at line 102 of file vector_mpi.hh.

Here is the caller graph for this function:

Member Data Documentation

MPI_Comm VectorMPI::communicator_
private

communicator

Definition at line 166 of file vector_mpi.hh.

Vec VectorMPI::data_petsc_
private

stored vector of data in PETSC format

Definition at line 164 of file vector_mpi.hh.

VectorDataPtr VectorMPI::data_ptr_
private

shared pointer to vector of data

Definition at line 162 of file vector_mpi.hh.


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