Epetra Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Epetra_FEVector.cpp
Go to the documentation of this file.
1 
2 //@HEADER
3 // ************************************************************************
4 //
5 // Epetra: Linear Algebra Services Package
6 // Copyright 2011 Sandia Corporation
7 //
8 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9 // the U.S. Government retains certain rights in this software.
10 //
11 // Redistribution and use in source and binary forms, with or without
12 // modification, are permitted provided that the following conditions are
13 // met:
14 //
15 // 1. Redistributions of source code must retain the above copyright
16 // notice, this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright
19 // notice, this list of conditions and the following disclaimer in the
20 // documentation and/or other materials provided with the distribution.
21 //
22 // 3. Neither the name of the Corporation nor the names of the
23 // contributors may be used to endorse or promote products derived from
24 // this software without specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 //
38 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
39 //
40 // ************************************************************************
41 //@HEADER
42 
43 #include <Epetra_ConfigDefs.h>
44 #include <Epetra_FEVector.h>
45 
46 #include <Epetra_LocalMap.h>
47 #include <Epetra_Comm.h>
48 #include <Epetra_Map.h>
49 #include <Epetra_Import.h>
50 #include <Epetra_Export.h>
51 #include <Epetra_Util.h>
54 
55 #include <algorithm>
56 
57 //----------------------------------------------------------------------------
59  int numVectors,
60  bool ignoreNonLocalEntries)
61  : Epetra_MultiVector(map, numVectors),
62  myFirstID_(0),
63  myNumIDs_(0),
64 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
65  nonlocalIDs_int_(),
66 #endif
67 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
68  nonlocalIDs_LL_(),
69 #endif
70  nonlocalElementSize_(),
71  nonlocalCoefs_(),
72  nonlocalMap_(0),
73  exporter_(0),
74  nonlocalVector_(0),
75  ignoreNonLocalEntries_(ignoreNonLocalEntries)
76 {
77  myFirstID_ = map.MinMyGID64();
78  myNumIDs_ = map.NumMyElements();
79  nonlocalCoefs_.resize(numVectors);
80 }
81 
82 //----------------------------------------------------------------------------
84  double *A, int MyLDA, int theNumVectors,
85  bool ignoreNonLocalEntries)
86  : Epetra_MultiVector(CV, theMap, A, MyLDA, theNumVectors),
87  myFirstID_(0),
88  myNumIDs_(0),
89 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
90  nonlocalIDs_int_(),
91 #endif
92 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
93  nonlocalIDs_LL_(),
94 #endif
95  nonlocalElementSize_(),
96  nonlocalCoefs_(),
97  nonlocalMap_(0),
98  exporter_(0),
99  nonlocalVector_(0),
100  ignoreNonLocalEntries_(ignoreNonLocalEntries)
101 {
102  myFirstID_ = theMap.MinMyGID64();
103  myNumIDs_ = theMap.NumMyElements();
104  nonlocalCoefs_.resize(theNumVectors);
105 }
106 
107 //----------------------------------------------------------------------------
109  double **ArrayOfPointers, int theNumVectors,
110  bool ignoreNonLocalEntries)
111  : Epetra_MultiVector(CV, theMap, ArrayOfPointers, theNumVectors),
112  myFirstID_(0),
113  myNumIDs_(0),
114 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
115  nonlocalIDs_int_(),
116 #endif
117 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
118  nonlocalIDs_LL_(),
119 #endif
120  nonlocalElementSize_(),
121  nonlocalCoefs_(),
122  nonlocalMap_(0),
123  exporter_(0),
124  nonlocalVector_(0),
125  ignoreNonLocalEntries_(ignoreNonLocalEntries)
126 {
127  myFirstID_ = theMap.MinMyGID64();
128  myNumIDs_ = theMap.NumMyElements();
129  nonlocalCoefs_.resize(theNumVectors);
130 }
131 
132 //----------------------------------------------------------------------------
134  : Epetra_MultiVector(source),
135  myFirstID_(0),
136  myNumIDs_(0),
137 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
138  nonlocalIDs_int_(),
139 #endif
140 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
141  nonlocalIDs_LL_(),
142 #endif
143  nonlocalElementSize_(),
144  nonlocalCoefs_(),
145  nonlocalMap_(0),
146  exporter_(0),
147  nonlocalVector_(0),
148  ignoreNonLocalEntries_(source.ignoreNonLocalEntries_)
149 {
150  *this = source;
151 }
152 
153 //----------------------------------------------------------------------------
155 {
158 
159  nonlocalCoefs_.clear();
160 }
161 
162 //----------------------------------------------------------------------------
163 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
164 int Epetra_FEVector::SumIntoGlobalValues(int numIDs, const int* GIDs,
165  const double* values,
166  int vectorIndex)
167 {
168  return( inputValues( numIDs, GIDs, values, true, vectorIndex) );
169 }
170 #endif
171 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
172 int Epetra_FEVector::SumIntoGlobalValues(int numIDs, const long long* GIDs,
173  const double* values,
174  int vectorIndex)
175 {
176  return( inputValues( numIDs, GIDs, values, true, vectorIndex) );
177 }
178 #endif
179 //----------------------------------------------------------------------------
180 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
182  const Epetra_SerialDenseVector& values,
183  int vectorIndex)
184 {
185  if (GIDs.Length() != values.Length()) {
186  return(-1);
187  }
188 
189  return( inputValues( GIDs.Length(), GIDs.Values(), values.Values(), true,
190  vectorIndex ) );
191 }
192 #endif
193 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
195  const Epetra_SerialDenseVector& values,
196  int vectorIndex)
197 {
198  if (GIDs.Length() != values.Length()) {
199  return(-1);
200  }
201 
202  return( inputValues( GIDs.Length(), GIDs.Values(), values.Values(), true,
203  vectorIndex ) );
204 }
205 #endif
206 //----------------------------------------------------------------------------
207 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
208 int Epetra_FEVector::SumIntoGlobalValues(int numIDs, const int* GIDs,
209  const int* numValuesPerID,
210  const double* values,
211  int vectorIndex)
212 {
213  return( inputValues( numIDs, GIDs, numValuesPerID, values, true,
214  vectorIndex) );
215 }
216 #endif
217 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
218 int Epetra_FEVector::SumIntoGlobalValues(int numIDs, const long long* GIDs,
219  const int* numValuesPerID,
220  const double* values,
221  int vectorIndex)
222 {
223  return( inputValues( numIDs, GIDs, numValuesPerID, values, true,
224  vectorIndex) );
225 }
226 #endif
227 //----------------------------------------------------------------------------
228 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
229 int Epetra_FEVector::ReplaceGlobalValues(int numIDs, const int* GIDs,
230  const double* values,
231  int vectorIndex)
232 {
233  return( inputValues( numIDs, GIDs, values, false,
234  vectorIndex) );
235 }
236 #endif
237 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
238 int Epetra_FEVector::ReplaceGlobalValues(int numIDs, const long long* GIDs,
239  const double* values,
240  int vectorIndex)
241 {
242  return( inputValues( numIDs, GIDs, values, false,
243  vectorIndex) );
244 }
245 #endif
246 //----------------------------------------------------------------------------
247 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
249  const Epetra_SerialDenseVector& values,
250  int vectorIndex)
251 {
252  if (GIDs.Length() != values.Length()) {
253  return(-1);
254  }
255 
256  return( inputValues( GIDs.Length(), GIDs.Values(), values.Values(), false,
257  vectorIndex) );
258 }
259 #endif
260 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
262  const Epetra_SerialDenseVector& values,
263  int vectorIndex)
264 {
265  if (GIDs.Length() != values.Length()) {
266  return(-1);
267  }
268 
269  return( inputValues( GIDs.Length(), GIDs.Values(), values.Values(), false,
270  vectorIndex) );
271 }
272 #endif
273 //----------------------------------------------------------------------------
274 template<typename int_type>
276  const int_type* GIDs,
277  const double* values,
278  bool suminto,
279  int vectorIndex)
280 {
281  //Important note!! This method assumes that there is only 1 point
282  //associated with each element (GID), and writes to offset 0 in that
283  //GID's block.
284 
285  for(int i=0; i<numIDs; ++i) {
286  if (Map().MyGID(GIDs[i])) {
287  if (suminto) {
288  SumIntoGlobalValue(GIDs[i], 0, vectorIndex, values[i]);
289  }
290  else {
291  ReplaceGlobalValue(GIDs[i], 0, vectorIndex, values[i]);
292  }
293  }
294  else {
295  if (!ignoreNonLocalEntries_) {
296  EPETRA_CHK_ERR( inputNonlocalValue(GIDs[i], values[i], suminto,
297  vectorIndex) );
298  }
299  }
300  }
301 
302  return(0);
303 }
304 
305 //----------------------------------------------------------------------------
306 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
307 int Epetra_FEVector::ReplaceGlobalValues(int numIDs, const int* GIDs,
308  const int* numValuesPerID,
309  const double* values,
310  int vectorIndex)
311 {
312  return( inputValues( numIDs, GIDs, numValuesPerID, values, false,
313  vectorIndex) );
314 }
315 #endif
316 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
317 int Epetra_FEVector::ReplaceGlobalValues(int numIDs, const long long* GIDs,
318  const int* numValuesPerID,
319  const double* values,
320  int vectorIndex)
321 {
322  return( inputValues( numIDs, GIDs, numValuesPerID, values, false,
323  vectorIndex) );
324 }
325 #endif
326 //----------------------------------------------------------------------------
327 template<typename int_type>
329  const int_type* GIDs,
330  const int* numValuesPerID,
331  const double* values,
332  bool suminto,
333  int vectorIndex)
334 {
335  if(!Map().template GlobalIndicesIsType<int_type>())
336  throw ReportError("Epetra_FEVector::inputValues mismatch between argument types (int/long long) and map type.", -1);
337 
338  int offset=0;
339  for(int i=0; i<numIDs; ++i) {
340  int numValues = numValuesPerID[i];
341  if (Map().MyGID(GIDs[i])) {
342  if (suminto) {
343  for(int j=0; j<numValues; ++j) {
344  SumIntoGlobalValue(GIDs[i], j, vectorIndex, values[offset+j]);
345  }
346  }
347  else {
348  for(int j=0; j<numValues; ++j) {
349  ReplaceGlobalValue(GIDs[i], j, vectorIndex, values[offset+j]);
350  }
351  }
352  }
353  else {
354  if (!ignoreNonLocalEntries_) {
355  EPETRA_CHK_ERR( inputNonlocalValues(GIDs[i], numValues,
356  &(values[offset]), suminto,
357  vectorIndex) );
358  }
359  }
360  offset += numValues;
361  }
362 
363  return(0);
364 }
365 
366 //----------------------------------------------------------------------------
367 template<typename int_type>
368 int Epetra_FEVector::inputNonlocalValue(int_type GID, double value, bool suminto,
369  int vectorIndex)
370 {
371  return inputNonlocalValues(GID, 1, &value, suminto, vectorIndex);
372 }
373 
374 //----------------------------------------------------------------------------
375 template<typename int_type>
376 int Epetra_FEVector::inputNonlocalValues(int_type GID, int numValues,
377  const double* values, bool suminto,
378  int vectorIndex)
379 {
380  if(!Map().template GlobalIndicesIsType<int_type>())
381  throw ReportError("Epetra_FEVector::inputValues mismatch between argument types (int/long long) and map type.", -1);
382 
383 
384  //find offset of GID in nonlocalIDs_var
385 
386  std::vector<int_type>& nonlocalIDs_var = nonlocalIDs<int_type>();
387 
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) {
392  offset = -1;
393  }
394 
395  int elemSize = Map().MaxElementSize();
396  if (offset >= 0) {
397  //if offset >= 0 (meaning GID was found)
398  // put value in nonlocalCoefs_[vectorIndex][offset*elemSize]
399 
400  if (numValues != nonlocalElementSize_[offset]) {
401  std::cerr << "Epetra_FEVector ERROR: block-size for GID " << GID << " is "
402  << numValues<<" which doesn't match previously set block-size of "
403  << nonlocalElementSize_[offset] << std::endl;
404  return(-1);
405  }
406 
407  offset = offset*elemSize;
408 
409  if (suminto) {
410  for(int j=0; j<numValues; ++j) {
411  nonlocalCoefs_[vectorIndex][offset+j] += values[j];
412  }
413  }
414  else {
415  for(int j=0; j<numValues; ++j) {
416  nonlocalCoefs_[vectorIndex][offset+j] = values[j];
417  }
418  }
419  }
420  else {
421  //else
422  // insert GID in nonlocalIDs_
423  // insert numValues in nonlocalElementSize_
424  // insert values in nonlocalCoefs_
425 
426  nonlocalIDs_var.insert(it, GID);
427  nonlocalElementSize_.insert(nonlocalElementSize_.begin()+insertPoint, numValues);
428 
429  //to keep nonlocalCoefs_[i] the same length for each vector in the multi-
430  //vector, we'll insert positions for each vector even though values are
431  //only being set for one of them...
432  for(int i=0; i<NumVectors(); ++i) {
433  for(int ii=0; ii<elemSize; ++ii) {
434  nonlocalCoefs_[i].insert(nonlocalCoefs_[i].begin()+insertPoint*elemSize+ii, 0.0);
435  }
436  }
437 
438  for(int j=0; j<numValues; ++j) {
439  nonlocalCoefs_[vectorIndex][insertPoint*elemSize+j] = values[j];
440  }
441  }
442 
443  return(0);
444 }
445 
446 //----------------------------------------------------------------------------
447 template<typename int_type>
449  bool reuse_map_and_exporter)
450 {
451  //In this method we need to gather all the non-local (overlapping) data
452  //that's been input on each processor, into the (probably) non-overlapping
453  //distribution defined by the map that 'this' vector was constructed with.
454 
455  //We don't need to do anything if there's only one processor or if
456  //ignoreNonLocalEntries_ is true.
457  if (Map().Comm().NumProc() < 2 || ignoreNonLocalEntries_) {
458  return(0);
459  }
460 
461  if (nonlocalMap_ == 0 || !reuse_map_and_exporter) {
462  createNonlocalMapAndExporter<int_type>();
463  }
464 
465  Epetra_MultiVector& nonlocalVector = *nonlocalVector_;
466  nonlocalVector.PutScalar(0.0);
467 
468  int elemSize = Map().MaxElementSize();
469  for(int vi=0; vi<NumVectors(); ++vi) {
470  for(size_t i=0; i<nonlocalIDs<int_type>().size(); ++i) {
471  for(int j=0; j<nonlocalElementSize_[i]; ++j) {
472  nonlocalVector.ReplaceGlobalValue(nonlocalIDs<int_type>()[i], j, vi,
473  nonlocalCoefs_[vi][i*elemSize+j]);
474  }
475  }
476  }
477 
478  EPETRA_CHK_ERR( Export(nonlocalVector, *exporter_, mode) );
479 
480  if (reuse_map_and_exporter) {
481  zeroNonlocalData<int_type>();
482  }
483  else {
485  }
486 
487  return(0);
488 }
489 
491  bool reuse_map_and_exporter)
492 {
493  if(Map().GlobalIndicesInt())
494 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
495  return GlobalAssemble<int>(mode, reuse_map_and_exporter);
496 #else
497  throw ReportError("Epetra_FEVector::GlobalAssemble: ERROR, GlobalIndicesInt but no API for it.",-1);
498 #endif
499 
500  if(Map().GlobalIndicesLongLong())
501 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
502  return GlobalAssemble<long long>(mode, reuse_map_and_exporter);
503 #else
504  throw ReportError("Epetra_FEVector::GlobalAssemble: ERROR, GlobalIndicesLongLong but no API for it.",-1);
505 #endif
506 
507  throw ReportError("Epetra_FEVector::GlobalAssemble: Internal error, unable to determine global index type of maps", -1);
508 }
509 //----------------------------------------------------------------------------
510 template<typename int_type>
512 {
513  std::vector<int_type>& nonlocalIDs_var = nonlocalIDs<int_type>();
514  delete nonlocalMap_;
515  int_type* nlIDptr = Epetra_Util_data_ptr(nonlocalIDs_var);
516  int* nlElSzptr = Epetra_Util_data_ptr(nonlocalElementSize_);
517  nonlocalMap_ = new Epetra_BlockMap ((int_type) -1, (int) nonlocalIDs_var.size(), nlIDptr,
518  nlElSzptr, (int_type) Map().IndexBase64(), Map().Comm());
519  delete exporter_;
520  exporter_ = new Epetra_Export (*nonlocalMap_, Map());
521 
522  delete nonlocalVector_;
523  nonlocalVector_ = new Epetra_MultiVector (*nonlocalMap_, NumVectors());
524 }
525 
526 //----------------------------------------------------------------------------
528 {
529  delete nonlocalMap_; nonlocalMap_ = 0;
530  delete exporter_; exporter_ = 0;
531  delete nonlocalVector_; nonlocalVector_ = 0;
532 }
533 
534 //----------------------------------------------------------------------------
536 {
537  if (this == &source) {
538  // Don't allow self-assignment, since the allocations and
539  // deallocations in the code below assume that source is a
540  // different object than *this.
541  return *this;
542  }
543  // This redundantly checks for self-assignment, but the check is
544  // inexpensive (just a pointer comparison).
546 
547 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
549 #endif
550 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
552 #endif
555 
556  return(*this);
557 }
558 
559 //----------------------------------------------------------------------------
560 template<typename int_type>
562 {
563  if (nonlocalIDs<int_type>().size() > 0) {
564  int maxelemSize = Map().MaxElementSize();
565  for(int vi=0; vi<NumVectors(); ++vi) {
566  for(size_t i=0; i<nonlocalIDs<int_type>().size(); ++i) {
567  int elemSize = nonlocalElementSize_[i];
568  for(int j=0; j<elemSize; ++j) {
569  nonlocalCoefs_[vi][i*maxelemSize+j] = 0.0;
570  }
571  }
572  }
573  }
574 }
575 
576 //----------------------------------------------------------------------------
578 {
579 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
580  nonlocalIDs_int_.clear();
581 #endif
582 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
583  nonlocalIDs_LL_.clear();
584 #endif
585  nonlocalElementSize_.clear();
586 
587  if (nonlocalCoefs_.size() > 0) {
588  for(int i=0; i<NumVectors(); ++i) {
589  nonlocalCoefs_[i].clear();
590  }
591  }
592 }
593 
long long MinMyGID64() const
Epetra_MultiVector: A class for constructing and using dense multi-vectors, vectors and matrices in p...
std::vector< int > nonlocalIDs_int_
Epetra_IntSerialDenseVector: A class for constructing and using dense vectors.
std::vector< long long > nonlocalIDs_LL_
int Length() const
Returns length of vector.
const Epetra_Comm & Comm() const
Returns the address of the Epetra_Comm for this multi-vector.
long long * Values()
Returns pointer to the values in vector.
std::vector< std::vector< double > > nonlocalCoefs_
Array of arrays (one per column) of nonlocal coefficients.
long long IndexBase64() const
int PutScalar(double ScalarConstant)
Initialize all values in a multi-vector with constant value.
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...
Definition: Epetra_Util.h:430
#define EPETRA_CHK_ERR(a)
Epetra_BlockMap * nonlocalMap_
Map describing distribution of nonlocal data.
Epetra_Export: This class builds an export object for efficient exporting of off-processor elements...
Definition: Epetra_Export.h:70
Epetra_MultiVector(const Epetra_BlockMap &Map, int NumVectors, bool zeroOut=true)
Basic Epetra_MultiVector constuctor.
void createNonlocalMapAndExporter()
Allocate the Map, Export object, and MultiVector for nonlocal data.
int NumVectors() const
Returns the number of vectors in the multi-vector.
int inputNonlocalValue(int_type GID, double value, bool suminto, int vectorIndex)
int Length() const
Returns length of vector.
int SumIntoGlobalValue(int GlobalRow, int VectorIndex, double ScalarValue)
Adds ScalarValue to existing value at the specified (GlobalRow, VectorIndex) location.
Epetra_SerialDenseVector: A class for constructing and using dense vectors.
int NumMyElements() const
Number of elements on the calling processor.
int inputValues(int numIDs, const int_type *GIDs, const double *values, bool suminto, int vectorIndex)
std::vector< int > nonlocalElementSize_
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.
void destroyNonlocalData()
Deallocate storage for nonlocal data.
Epetra_FEVector(const Epetra_BlockMap &Map, int numVectors=1, bool ignoreNonLocalEntries=false)
Constructor that requires a map specifying a non-overlapping data layout.
int Length() const
Returns length of vector.
int ReplaceGlobalValue(int GlobalRow, int VectorIndex, double ScalarValue)
Replace current value at the specified (GlobalRow, VectorIndex) location with ScalarValue.
virtual ~Epetra_FEVector()
Destructor.
Epetra_BlockMap: A class for partitioning block element vectors and matrices.
Epetra_LongLongSerialDenseVector: A class for constructing and using dense vectors.
int inputNonlocalValues(int_type GID, int numValues, const double *values, bool suminto, int vectorIndex)
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.
const Epetra_Comm & Comm() const
Access function for Epetra_Comm communicator.
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 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 ...
Epetra Finite-Element Vector.
void Assign(const Epetra_MultiVector &rhs)
long long myFirstID_
int MaxElementSize() const
Maximum element size across all processors.
Epetra_CombineMode
virtual int ReportError(const std::string Message, int ErrorCode) const
Error reporting method.
double * Values() const
Returns pointer to the values in vector.
void zeroNonlocalData()
Make all the nonlocal multivector entries zero.
Epetra_DataAccess
int * Values()
Returns pointer to the values in vector.
Epetra_FEVector & operator=(const Epetra_FEVector &source)
Epetra_Export * exporter_
Export object that sums nonlocal data into a nonoverlapping distribution.
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...
const Epetra_BlockMap & Map() const
Returns the address of the Epetra_BlockMap for this multi-vector.