|
Epetra Package Browser (Single Doxygen Collection)
Development
|
Go to the documentation of this file.
60 bool ignoreNonLocalEntries)
64 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
67 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
70 nonlocalElementSize_(),
75 ignoreNonLocalEntries_(ignoreNonLocalEntries)
84 double *
A,
int MyLDA,
int theNumVectors,
85 bool ignoreNonLocalEntries)
89 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
92 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
95 nonlocalElementSize_(),
100 ignoreNonLocalEntries_(ignoreNonLocalEntries)
109 double **ArrayOfPointers,
int theNumVectors,
110 bool ignoreNonLocalEntries)
114 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
117 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
120 nonlocalElementSize_(),
125 ignoreNonLocalEntries_(ignoreNonLocalEntries)
137 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
140 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
143 nonlocalElementSize_(),
148 ignoreNonLocalEntries_(source.ignoreNonLocalEntries_)
163 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
165 const double* values,
168 return(
inputValues( numIDs, GIDs, values,
true, vectorIndex) );
171 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
173 const double* values,
176 return(
inputValues( numIDs, GIDs, values,
true, vectorIndex) );
180 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
193 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
207 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
209 const int* numValuesPerID,
210 const double* values,
213 return(
inputValues( numIDs, GIDs, numValuesPerID, values,
true,
217 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
219 const int* numValuesPerID,
220 const double* values,
223 return(
inputValues( numIDs, GIDs, numValuesPerID, values,
true,
228 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
230 const double* values,
237 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
239 const double* values,
247 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
260 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
274 template<
typename int_type>
276 const int_type* GIDs,
277 const double* values,
285 for(
int i=0; i<numIDs; ++i) {
286 if (
Map().MyGID(GIDs[i])) {
306 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
308 const int* numValuesPerID,
309 const double* values,
312 return(
inputValues( numIDs, GIDs, numValuesPerID, values,
false,
316 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
318 const int* numValuesPerID,
319 const double* values,
322 return(
inputValues( numIDs, GIDs, numValuesPerID, values,
false,
327 template<
typename int_type>
329 const int_type* GIDs,
330 const int* numValuesPerID,
331 const double* values,
335 if(!
Map().
template GlobalIndicesIsType<int_type>())
336 throw ReportError(
"Epetra_FEVector::inputValues mismatch between argument types (int/long long) and map type.", -1);
339 for(
int i=0; i<numIDs; ++i) {
340 int numValues = numValuesPerID[i];
341 if (
Map().MyGID(GIDs[i])) {
343 for(
int j=0; j<numValues; ++j) {
348 for(
int j=0; j<numValues; ++j) {
356 &(values[offset]), suminto,
367 template<
typename int_type>
375 template<
typename int_type>
377 const double* values,
bool suminto,
380 if(!
Map().
template GlobalIndicesIsType<int_type>())
381 throw ReportError(
"Epetra_FEVector::inputValues mismatch between argument types (int/long long) and map type.", -1);
386 std::vector<int_type>& nonlocalIDs_var = nonlocalIDs<int_type>();
388 typename std::vector<int_type>::iterator it = std::lower_bound(nonlocalIDs_var.begin(), nonlocalIDs_var.end(), GID);
389 int offset = (int) (it - nonlocalIDs_var.begin());
390 int insertPoint = offset;
391 if (it == nonlocalIDs_var.end() || *it != GID) {
401 std::cerr <<
"Epetra_FEVector ERROR: block-size for GID " << GID <<
" is "
402 << numValues<<
" which doesn't match previously set block-size of "
407 offset = offset*elemSize;
410 for(
int j=0; j<numValues; ++j) {
415 for(
int j=0; j<numValues; ++j) {
426 nonlocalIDs_var.insert(it, GID);
433 for(
int ii=0; ii<elemSize; ++ii) {
438 for(
int j=0; j<numValues; ++j) {
447 template<
typename int_type>
449 bool reuse_map_and_exporter)
462 createNonlocalMapAndExporter<int_type>();
470 for(
size_t i=0; i<nonlocalIDs<int_type>().size(); ++i) {
480 if (reuse_map_and_exporter) {
481 zeroNonlocalData<int_type>();
491 bool reuse_map_and_exporter)
493 if(
Map().GlobalIndicesInt())
494 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
495 return GlobalAssemble<int>(mode, reuse_map_and_exporter);
497 throw ReportError(
"Epetra_FEVector::GlobalAssemble: ERROR, GlobalIndicesInt but no API for it.",-1);
500 if(
Map().GlobalIndicesLongLong())
501 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
502 return GlobalAssemble<long long>(mode, reuse_map_and_exporter);
504 throw ReportError(
"Epetra_FEVector::GlobalAssemble: ERROR, GlobalIndicesLongLong but no API for it.",-1);
507 throw ReportError(
"Epetra_FEVector::GlobalAssemble: Internal error, unable to determine global index type of maps", -1);
510 template<
typename int_type>
513 std::vector<int_type>& nonlocalIDs_var = nonlocalIDs<int_type>();
537 if (
this == &source) {
547 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
550 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
560 template<
typename int_type>
563 if (nonlocalIDs<int_type>().size() > 0) {
566 for(
size_t i=0; i<nonlocalIDs<int_type>().size(); ++i) {
568 for(
int j=0; j<elemSize; ++j) {
579 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
582 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
Epetra_SerialDenseVector: A class for constructing and using dense vectors.
const Epetra_Comm & Comm() const
Access function for Epetra_Comm communicator.
int NumMyElements() const
Number of elements on the calling processor.
int ReplaceGlobalValue(int GlobalRow, int VectorIndex, double ScalarValue)
Replace current value at the specified (GlobalRow, VectorIndex) location with ScalarValue.
const Epetra_Comm & Comm() const
Returns the address of the Epetra_Comm for this multi-vector.
void destroyNonlocalMapAndExporter()
Deallocate the Map, Export object, and MultiVector for nonlocal data.
Epetra_MultiVector * nonlocalVector_
Multivector that holds nonlocal data; source for the Export operation.
int PutScalar(double ScalarConstant)
Initialize all values in a multi-vector with constant value.
int inputNonlocalValues(int_type GID, int numValues, const double *values, bool suminto, int vectorIndex)
#define EPETRA_CHK_ERR(a)
const Epetra_BlockMap & Map() const
Returns the address of the Epetra_BlockMap for this multi-vector.
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 ...
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.
long long IndexBase64() const
int MaxElementSize() const
Maximum element size across all processors.
Epetra Finite-Element Vector.
int Length() const
Returns length of vector.
void Assign(const Epetra_MultiVector &rhs)
Epetra_LongLongSerialDenseVector: A class for constructing and using dense vectors.
void zeroNonlocalData()
Make all the nonlocal multivector entries zero.
int * Values()
Returns pointer to the values in vector.
bool ignoreNonLocalEntries_
int SumIntoGlobalValue(int GlobalRow, int VectorIndex, double ScalarValue)
Adds ScalarValue to existing value at the specified (GlobalRow, VectorIndex) location.
Epetra_FEVector & operator=(const Epetra_FEVector &source)
int Export(const Epetra_SrcDistObject &A, const Epetra_Import &Importer, Epetra_CombineMode CombineMode, const Epetra_OffsetIndex *Indexor=0)
Exports an Epetra_DistObject using the Epetra_Import object.
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 ind...
std::vector< int > nonlocalIDs_int_
Epetra_Export * exporter_
Export object that sums nonlocal data into a nonoverlapping distribution.
std::vector< long long > nonlocalIDs_LL_
long long MinMyGID64() const
virtual int ReportError(const std::string Message, int ErrorCode) const
Error reporting method.
Epetra_MultiVector(const Epetra_BlockMap &Map, int NumVectors, bool zeroOut=true)
Basic Epetra_MultiVector constuctor.
std::vector< std::vector< double > > nonlocalCoefs_
Array of arrays (one per column) of nonlocal coefficients.
Epetra_BlockMap: A class for partitioning block element vectors and matrices.
int Length() const
Returns length of vector.
long long * Values()
Returns pointer to the values in vector.
Epetra_IntSerialDenseVector: A class for constructing and using dense vectors.
Epetra_MultiVector: A class for constructing and using dense multi-vectors, vectors and matrices in p...
void createNonlocalMapAndExporter()
Allocate the Map, Export object, and MultiVector for nonlocal data.
int inputNonlocalValue(int_type GID, double value, bool suminto, int vectorIndex)
Epetra_BlockMap * nonlocalMap_
Map describing distribution of nonlocal data.
int inputValues(int numIDs, const int_type *GIDs, const double *values, bool suminto, int vectorIndex)
std::vector< int > nonlocalElementSize_
int Length() const
Returns length of vector.
Epetra_FEVector(const Epetra_BlockMap &Map, int numVectors=1, bool ignoreNonLocalEntries=false)
Constructor that requires a map specifying a non-overlapping data layout.
Epetra_Export: This class builds an export object for efficient exporting of off-processor elements.
double * Values() const
Returns pointer to the values in vector.
void destroyNonlocalData()
Deallocate storage for nonlocal data.
int NumVectors() const
Returns the number of vectors in the multi-vector.
virtual ~Epetra_FEVector()
Destructor.
T * Epetra_Util_data_ptr(std::vector< T > &vec)
Function that returns either a pointer to the first entry in the vector or, if the vector is empty,...