Epetra Package Browser (Single Doxygen Collection) Development
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
Epetra_FEVector Class Reference

Epetra Finite-Element Vector. More...

#include <Epetra_FEVector.h>

Inheritance diagram for Epetra_FEVector:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 Epetra_FEVector (const Epetra_BlockMap &Map, int numVectors=1, bool ignoreNonLocalEntries=false)
 Constructor that requires a map specifying a non-overlapping data layout.
 Epetra_FEVector (Epetra_DataAccess CV, const Epetra_BlockMap &Map, double *A, int MyLDA, int NumVectors, bool ignoreNonLocalEntries=false)
 Set multi-vector values from two-dimensional array.
 Epetra_FEVector (Epetra_DataAccess CV, const Epetra_BlockMap &Map, double **ArrayOfPointers, int NumVectors, bool ignoreNonLocalEntries=false)
 Set multi-vector values from array of pointers.
 Epetra_FEVector (const Epetra_FEVector &source)
 Copy constructor.
virtual ~Epetra_FEVector ()
 Destructor.
int SumIntoGlobalValues (int numIDs, const int *GIDs, const double *values, int vectorIndex=0)
 Accumulate values into the vector, adding them to any values that already exist for the specified indices.
int SumIntoGlobalValues (int numIDs, const long long *GIDs, const double *values, int vectorIndex=0)
int SumIntoGlobalValues (const Epetra_IntSerialDenseVector &GIDs, const Epetra_SerialDenseVector &values, int vectorIndex=0)
 Accumulate values into the vector, adding them to any values that already exist for the specified GIDs.
int SumIntoGlobalValues (const Epetra_LongLongSerialDenseVector &GIDs, const Epetra_SerialDenseVector &values, int vectorIndex=0)
int ReplaceGlobalValues (int numIDs, const int *GIDs, const double *values, int vectorIndex=0)
 Copy values into the vector overwriting any values that already exist for the specified indices.
int ReplaceGlobalValues (int numIDs, const long long *GIDs, const double *values, int vectorIndex=0)
int ReplaceGlobalValues (const Epetra_IntSerialDenseVector &GIDs, const Epetra_SerialDenseVector &values, int vectorIndex=0)
 Copy values into the vector, replacing any values that already exist for the specified GIDs.
int ReplaceGlobalValues (const Epetra_LongLongSerialDenseVector &GIDs, const Epetra_SerialDenseVector &values, int vectorIndex=0)
int SumIntoGlobalValues (int numIDs, const int *GIDs, const int *numValuesPerID, const double *values, int vectorIndex=0)
int SumIntoGlobalValues (int numIDs, const long long *GIDs, const int *numValuesPerID, const double *values, int vectorIndex=0)
int ReplaceGlobalValues (int numIDs, const int *GIDs, const int *numValuesPerID, const double *values, int vectorIndex=0)
int ReplaceGlobalValues (int numIDs, const long long *GIDs, const int *numValuesPerID, const double *values, int vectorIndex=0)
int GlobalAssemble (Epetra_CombineMode mode=Add, bool reuse_map_and_exporter=false)
 Gather any overlapping/shared data into the non-overlapping partitioning defined by the Map that was passed to this vector at construction time.
void setIgnoreNonLocalEntries (bool flag)
 Set whether or not non-local data values should be ignored.
Epetra_FEVectoroperator= (const Epetra_FEVector &source)

Protected Member Functions

template<typename int_type >
int inputValues (int numIDs, const int_type *GIDs, const double *values, bool suminto, int vectorIndex)
template<typename int_type >
int inputValues (int numIDs, const int_type *GIDs, const int *numValuesPerID, const double *values, bool suminto, int vectorIndex)
template<typename int_type >
int inputNonlocalValue (int_type GID, double value, bool suminto, int vectorIndex)
template<typename int_type >
int inputNonlocalValues (int_type GID, int numValues, const double *values, bool suminto, int vectorIndex)
template<typename int_type >
void createNonlocalMapAndExporter ()
 Allocate the Map, Export object, and MultiVector for nonlocal data.
void destroyNonlocalMapAndExporter ()
 Deallocate the Map, Export object, and MultiVector for nonlocal data.
template<typename int_type >
void zeroNonlocalData ()
 Make all the nonlocal multivector entries zero.
void destroyNonlocalData ()
 Deallocate storage for nonlocal data.
template<typename int_type >
std::vector< int_type > & nonlocalIDs ()

Protected Attributes

long long myFirstID_
int myNumIDs_
std::vector< int > nonlocalIDs_int_
std::vector< long long > nonlocalIDs_LL_
std::vector< int > nonlocalElementSize_
std::vector< std::vector
< double > > 
nonlocalCoefs_
 Array of arrays (one per column) of nonlocal coefficients.
Epetra_BlockMapnonlocalMap_
 Map describing distribution of nonlocal data.
Epetra_Exportexporter_
 Export object that sums nonlocal data into a nonoverlapping distribution.
Epetra_MultiVectornonlocalVector_
 Multivector that holds nonlocal data; source for the Export operation.
bool ignoreNonLocalEntries_

Private Member Functions

template<typename int_type >
int GlobalAssemble (Epetra_CombineMode mode, bool reuse_map_and_exporter)

Detailed Description

Epetra Finite-Element Vector.

This class inherits Epetra_MultiVector and thus provides all Epetra_MultiVector functionality.

The added functionality provided by Epetra_FEVector is the ability to perform finite-element style vector assembly. It accepts sub-vector contributions, such as those that would come from element-load vectors, etc. These sub-vectors need not be owned by the local processor. In other words, the user can assemble overlapping data (e.g., corresponding to shared finite-element nodes). When the user is finished assembling their vector data, they then call the method Epetra_FEVector::GlobalAssemble() which gathers the overlapping data (all non-local data that was input on each processor) into the data-distribution specified by the map with which the Epetra_FEVector was constructed.

Definition at line 78 of file Epetra_FEVector.h.


Constructor & Destructor Documentation

Epetra_FEVector::Epetra_FEVector ( const Epetra_BlockMap Map,
int  numVectors = 1,
bool  ignoreNonLocalEntries = false 
)

Constructor that requires a map specifying a non-overlapping data layout.

Parameters:
MapMap describing a non-overlapping distribution for the underlying Epetra_MultiVector into which this Epetra_FEVector will funnel data.
numVectorsOptional argument, default value is 1. (See the documentation for Epetra_MultiVector for the meaning of this argument.
ignoreNonLocalEntriesOptional argument, default value is false. Under certain special circumstances it is desirable to have non-local contributions ignored rather than saving them for the GlobalAssemble step.

Definition at line 58 of file Epetra_FEVector.cpp.

Epetra_FEVector::Epetra_FEVector ( Epetra_DataAccess  CV,
const Epetra_BlockMap Map,
double *  A,
int  MyLDA,
int  NumVectors,
bool  ignoreNonLocalEntries = false 
)

Set multi-vector values from two-dimensional array.

Parameters:
InEpetra_DataAccess - Enumerated type set to Copy or View.
InMap - A Epetra_LocalMap, Epetra_Map or Epetra_BlockMap.
InA - Pointer to an array of double precision numbers. The first vector starts at A. The second vector starts at A+MyLDA, the third at A+2*MyLDA, and so on.
InMyLDA - The "Leading Dimension", or stride between vectors in memory.
Warning:
This value refers to the stride on the calling processor. Thus it is a local quantity, not a global quantity.
Parameters:
InNumVectors - Number of vectors in multi-vector.
Returns:
Integer error code, set to 0 if successful.

See Detailed Description section for further discussion.

Definition at line 83 of file Epetra_FEVector.cpp.

Epetra_FEVector::Epetra_FEVector ( Epetra_DataAccess  CV,
const Epetra_BlockMap Map,
double **  ArrayOfPointers,
int  NumVectors,
bool  ignoreNonLocalEntries = false 
)

Set multi-vector values from array of pointers.

Parameters:
InEpetra_DataAccess - Enumerated type set to Copy or View.
InMap - A Epetra_LocalMap, Epetra_Map or Epetra_BlockMap.
InArrayOfPointers - An array of pointers such that ArrayOfPointers[i] points to the memory location containing ith vector to be copied.
InNumVectors - Number of vectors in multi-vector.
Returns:
Integer error code, set to 0 if successful.

See Detailed Description section for further discussion.

Definition at line 108 of file Epetra_FEVector.cpp.

Epetra_FEVector::Epetra_FEVector ( const Epetra_FEVector source)

Copy constructor.

Definition at line 133 of file Epetra_FEVector.cpp.

Epetra_FEVector::~Epetra_FEVector ( ) [virtual]

Destructor.

Definition at line 154 of file Epetra_FEVector.cpp.


Member Function Documentation

int Epetra_FEVector::SumIntoGlobalValues ( int  numIDs,
const int *  GIDs,
const double *  values,
int  vectorIndex = 0 
)

Accumulate values into the vector, adding them to any values that already exist for the specified indices.

Definition at line 164 of file Epetra_FEVector.cpp.

int Epetra_FEVector::SumIntoGlobalValues ( int  numIDs,
const long long *  GIDs,
const double *  values,
int  vectorIndex = 0 
)

Definition at line 172 of file Epetra_FEVector.cpp.

int Epetra_FEVector::SumIntoGlobalValues ( const Epetra_IntSerialDenseVector GIDs,
const Epetra_SerialDenseVector values,
int  vectorIndex = 0 
)

Accumulate values into the vector, adding them to any values that already exist for the specified GIDs.

Parameters:
GIDsList of global ids. Must be the same length as the accompanying list of values.
valuesList of coefficient values. Must be the same length as the accompanying list of GIDs.

Definition at line 181 of file Epetra_FEVector.cpp.

int Epetra_FEVector::SumIntoGlobalValues ( const Epetra_LongLongSerialDenseVector GIDs,
const Epetra_SerialDenseVector values,
int  vectorIndex = 0 
)

Definition at line 194 of file Epetra_FEVector.cpp.

int Epetra_FEVector::ReplaceGlobalValues ( int  numIDs,
const int *  GIDs,
const double *  values,
int  vectorIndex = 0 
)

Copy values into the vector overwriting any values that already exist for the specified indices.

Definition at line 229 of file Epetra_FEVector.cpp.

int Epetra_FEVector::ReplaceGlobalValues ( int  numIDs,
const long long *  GIDs,
const double *  values,
int  vectorIndex = 0 
)

Definition at line 238 of file Epetra_FEVector.cpp.

int Epetra_FEVector::ReplaceGlobalValues ( const Epetra_IntSerialDenseVector GIDs,
const Epetra_SerialDenseVector values,
int  vectorIndex = 0 
)

Copy values into the vector, replacing any values that already exist for the specified GIDs.

Parameters:
GIDsList of global ids. Must be the same length as the accompanying list of values.
valuesList of coefficient values. Must be the same length as the accompanying list of GIDs.

Definition at line 248 of file Epetra_FEVector.cpp.

int Epetra_FEVector::ReplaceGlobalValues ( const Epetra_LongLongSerialDenseVector GIDs,
const Epetra_SerialDenseVector values,
int  vectorIndex = 0 
)

Definition at line 261 of file Epetra_FEVector.cpp.

int Epetra_FEVector::SumIntoGlobalValues ( int  numIDs,
const int *  GIDs,
const int *  numValuesPerID,
const double *  values,
int  vectorIndex = 0 
)

Definition at line 208 of file Epetra_FEVector.cpp.

int Epetra_FEVector::SumIntoGlobalValues ( int  numIDs,
const long long *  GIDs,
const int *  numValuesPerID,
const double *  values,
int  vectorIndex = 0 
)

Definition at line 218 of file Epetra_FEVector.cpp.

int Epetra_FEVector::ReplaceGlobalValues ( int  numIDs,
const int *  GIDs,
const int *  numValuesPerID,
const double *  values,
int  vectorIndex = 0 
)

Definition at line 307 of file Epetra_FEVector.cpp.

int Epetra_FEVector::ReplaceGlobalValues ( int  numIDs,
const long long *  GIDs,
const int *  numValuesPerID,
const double *  values,
int  vectorIndex = 0 
)

Definition at line 317 of file Epetra_FEVector.cpp.

int Epetra_FEVector::GlobalAssemble ( Epetra_CombineMode  mode = Add,
bool  reuse_map_and_exporter = false 
)

Gather any overlapping/shared data into the non-overlapping partitioning defined by the Map that was passed to this vector at construction time.

Data imported from other processors is stored on the owning processor with a "sumInto" or accumulate operation. This is a collective method -- every processor must enter it before any will complete it.

Optimization for power-users: The optional parameter 'reuse_map_and_exporter' defaults to false. By default, a map that describes the non-local data is re-created at each call to GlobalAssemble, along with an exporter used to do the communication. This is expensive. If you know that the layout of your nonlocal data has not changed since your previous call to GlobalAssemble, you can set this flag to true and it will reuse the previously created map and exporter rather than creating new ones.

Definition at line 448 of file Epetra_FEVector.cpp.

void Epetra_FEVector::setIgnoreNonLocalEntries ( bool  flag) [inline]

Set whether or not non-local data values should be ignored.

Definition at line 260 of file Epetra_FEVector.h.

Epetra_FEVector & Epetra_FEVector::operator= ( const Epetra_FEVector source)

Definition at line 535 of file Epetra_FEVector.cpp.

template<typename int_type >
int Epetra_FEVector::inputValues ( int  numIDs,
const int_type *  GIDs,
const double *  values,
bool  suminto,
int  vectorIndex 
) [protected]

Definition at line 275 of file Epetra_FEVector.cpp.

template<typename int_type >
int Epetra_FEVector::inputValues ( int  numIDs,
const int_type *  GIDs,
const int *  numValuesPerID,
const double *  values,
bool  suminto,
int  vectorIndex 
) [protected]

Definition at line 328 of file Epetra_FEVector.cpp.

template<typename int_type >
int Epetra_FEVector::inputNonlocalValue ( int_type  GID,
double  value,
bool  suminto,
int  vectorIndex 
) [protected]

Definition at line 368 of file Epetra_FEVector.cpp.

template<typename int_type >
int Epetra_FEVector::inputNonlocalValues ( int_type  GID,
int  numValues,
const double *  values,
bool  suminto,
int  vectorIndex 
) [protected]

Definition at line 376 of file Epetra_FEVector.cpp.

template<typename int_type >
void Epetra_FEVector::createNonlocalMapAndExporter ( ) [protected]

Allocate the Map, Export object, and MultiVector for nonlocal data.

Definition at line 511 of file Epetra_FEVector.cpp.

void Epetra_FEVector::destroyNonlocalMapAndExporter ( ) [protected]

Deallocate the Map, Export object, and MultiVector for nonlocal data.

Definition at line 527 of file Epetra_FEVector.cpp.

template<typename int_type >
void Epetra_FEVector::zeroNonlocalData ( ) [protected]

Make all the nonlocal multivector entries zero.

Definition at line 561 of file Epetra_FEVector.cpp.

void Epetra_FEVector::destroyNonlocalData ( ) [protected]

Deallocate storage for nonlocal data.

This does not include whatever destroyNonlocalMapAndExporter() deallocates.

Definition at line 577 of file Epetra_FEVector.cpp.

std::vector< long long > & Epetra_FEVector::nonlocalIDs< long long > ( ) [inline, protected]

Definition at line 349 of file Epetra_FEVector.h.

template<typename int_type >
int Epetra_FEVector::GlobalAssemble ( Epetra_CombineMode  mode,
bool  reuse_map_and_exporter 
) [private]

Member Data Documentation

long long Epetra_FEVector::myFirstID_ [protected]

Definition at line 305 of file Epetra_FEVector.h.

int Epetra_FEVector::myNumIDs_ [protected]

Definition at line 306 of file Epetra_FEVector.h.

std::vector<int> Epetra_FEVector::nonlocalIDs_int_ [protected]

Definition at line 309 of file Epetra_FEVector.h.

std::vector<long long> Epetra_FEVector::nonlocalIDs_LL_ [protected]

Definition at line 312 of file Epetra_FEVector.h.

std::vector<int> Epetra_FEVector::nonlocalElementSize_ [protected]

Definition at line 317 of file Epetra_FEVector.h.

std::vector<std::vector<double> > Epetra_FEVector::nonlocalCoefs_ [protected]

Array of arrays (one per column) of nonlocal coefficients.

Entry j in this array is an array of nonlocal coefficients for column j of the multivector. nonlocalCoefs_[j] in turn contains the data for all the nonlocal block entries. Entries within a block are stored in column-major order (Fortran style), in contiguous chunks of Map().MaxElementSize() entries.

In summary: for k = 0 to numNonlocalIDs_ - 1, nonlocalCoefs_[j][j*M + i] contains the entries of nonlocal block entry k, for i = 0 to nonlocalElementSize_[k] - 1.

Definition at line 330 of file Epetra_FEVector.h.

Map describing distribution of nonlocal data.

Definition at line 333 of file Epetra_FEVector.h.

Export object that sums nonlocal data into a nonoverlapping distribution.

Definition at line 336 of file Epetra_FEVector.h.

Multivector that holds nonlocal data; source for the Export operation.

Definition at line 339 of file Epetra_FEVector.h.

Definition at line 341 of file Epetra_FEVector.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines