Epetra Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Epetra_FEVbrMatrix.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_FEVbrMatrix.h>
45 #include <Epetra_BlockMap.h>
46 #include <Epetra_Map.h>
47 #include <Epetra_Import.h>
48 #include <Epetra_Export.h>
49 #include <Epetra_Vector.h>
50 #include <Epetra_MultiVector.h>
51 #include <Epetra_Comm.h>
52 #include <Epetra_Distributor.h>
53 #include <Epetra_Util.h>
54 
55 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES // FIXME
56 // FIXME long long : whole file
57 
58 //----------------------------------------------------------------------------
60  const Epetra_BlockMap& rowMap,
61  int *NumBlockEntriesPerRow,
62  bool ignoreNonLocalEntries)
63  : Epetra_VbrMatrix(CV, rowMap, NumBlockEntriesPerRow),
64  ignoreNonLocalEntries_(ignoreNonLocalEntries),
65  numNonlocalBlockRows_(0),
66  nonlocalBlockRows_(NULL),
67  nonlocalBlockRowLengths_(NULL),
68  nonlocalBlockRowAllocLengths_(NULL),
69  nonlocalBlockCols_(NULL),
70  nonlocalCoefs_(NULL),
71  curRowOffset_(-1),
72  curColOffset_(-1),
73  curNumCols_(0),
74  curCols_(NULL),
75  curMode_(Add)
76 {
77 }
78 
79 //----------------------------------------------------------------------------
81  const Epetra_BlockMap& rowMap,
82  int NumBlockEntriesPerRow,
83  bool ignoreNonLocalEntries)
84  : Epetra_VbrMatrix(CV, rowMap, NumBlockEntriesPerRow),
85  ignoreNonLocalEntries_(ignoreNonLocalEntries),
86  numNonlocalBlockRows_(0),
87  nonlocalBlockRows_(NULL),
88  nonlocalBlockRowLengths_(NULL),
89  nonlocalBlockRowAllocLengths_(NULL),
90  nonlocalBlockCols_(NULL),
91  nonlocalCoefs_(NULL),
92  curRowOffset_(-1),
93  curColOffset_(0),
94  curNumCols_(0),
95  curCols_(NULL),
96  curMode_(Add)
97 {
98 }
99 
100 //----------------------------------------------------------------------------
102  const Epetra_BlockMap& rowMap,
103  const Epetra_BlockMap& colMap,
104  int *NumBlockEntriesPerRow,
105  bool ignoreNonLocalEntries)
106  : Epetra_VbrMatrix(CV, rowMap, colMap, NumBlockEntriesPerRow),
107  ignoreNonLocalEntries_(ignoreNonLocalEntries),
108  numNonlocalBlockRows_(0),
109  nonlocalBlockRows_(NULL),
110  nonlocalBlockRowLengths_(NULL),
111  nonlocalBlockRowAllocLengths_(NULL),
112  nonlocalBlockCols_(NULL),
113  nonlocalCoefs_(NULL),
114  curRowOffset_(-1),
115  curColOffset_(-1),
116  curNumCols_(0),
117  curCols_(NULL),
118  curMode_(Add)
119 {
120 }
121 
122 //----------------------------------------------------------------------------
124  const Epetra_BlockMap& rowMap,
125  const Epetra_BlockMap& colMap,
126  int NumBlockEntriesPerRow,
127  bool ignoreNonLocalEntries)
128  : Epetra_VbrMatrix(CV, rowMap, colMap, NumBlockEntriesPerRow),
129  ignoreNonLocalEntries_(ignoreNonLocalEntries),
130  numNonlocalBlockRows_(0),
131  nonlocalBlockRows_(NULL),
132  nonlocalBlockRowLengths_(NULL),
133  nonlocalBlockRowAllocLengths_(NULL),
134  nonlocalBlockCols_(NULL),
135  nonlocalCoefs_(NULL),
136  curRowOffset_(-1),
137  curColOffset_(0),
138  curNumCols_(0),
139  curCols_(NULL),
140  curMode_(Add)
141 {
142 }
143 
144 //----------------------------------------------------------------------------
146  const Epetra_CrsGraph& graph,
147  bool ignoreNonLocalEntries)
148  : Epetra_VbrMatrix(CV, graph),
149  ignoreNonLocalEntries_(ignoreNonLocalEntries),
150  numNonlocalBlockRows_(0),
151  nonlocalBlockRows_(NULL),
152  nonlocalBlockRowLengths_(NULL),
153  nonlocalBlockRowAllocLengths_(NULL),
154  nonlocalBlockCols_(NULL),
155  nonlocalCoefs_(NULL),
156  curRowOffset_(-1),
157  curColOffset_(0),
158  curNumCols_(0),
159  curCols_(NULL),
160  curMode_(Add)
161 {
162 }
163 
164 //----------------------------------------------------------------------------
166  : Epetra_VbrMatrix(src),
167  ignoreNonLocalEntries_(src.ignoreNonLocalEntries_),
168  numNonlocalBlockRows_(0),
169  nonlocalBlockRows_(NULL),
170  nonlocalBlockRowLengths_(NULL),
171  nonlocalBlockRowAllocLengths_(NULL),
172  nonlocalBlockCols_(NULL),
173  nonlocalCoefs_(NULL),
174  curRowOffset_(-1),
175  curColOffset_(0),
176  curNumCols_(0),
177  curCols_(NULL),
178  curMode_(Add)
179 {
180  operator=(src);
181 }
182 
183 //----------------------------------------------------------------------------
185 {
186  if (this == &src) {
187  return( *this );
188  }
189 
191 
193 
199 
200  for(int i=0; i<numNonlocalBlockRows_; ++i) {
204 
205  for(int j=0; j<nonlocalBlockRowLengths_[i]; ++j) {
206  nonlocalBlockCols_[i][j] = src.nonlocalBlockCols_[i][j];
207 
208  nonlocalCoefs_[i][j] = new Epetra_SerialDenseMatrix(*(src.nonlocalCoefs_[i][j]));
209  }
210  }
211 
212  return( *this );
213 }
214 
215 //----------------------------------------------------------------------------
217 {
219 }
220 
221 //----------------------------------------------------------------------------
223 {
224  for(int i=0; i<numNonlocalBlockRows_; ++i) {
225  delete [] nonlocalBlockCols_[i];
226  for(int j=0; j<nonlocalBlockRowLengths_[i]; ++j) {
227  delete nonlocalCoefs_[i][j];
228  }
229  delete [] nonlocalCoefs_[i];
230  }
231 
232  delete [] nonlocalCoefs_;
233  delete [] nonlocalBlockCols_;
235  delete [] nonlocalBlockRowLengths_;
236  delete [] nonlocalBlockRows_;
237 
238  numNonlocalBlockRows_ = 0;
239  nonlocalBlockRows_ = NULL;
242  nonlocalBlockCols_ = NULL;
243  nonlocalCoefs_ = NULL;
244 }
245 
246 //----------------------------------------------------------------------------
247 int Epetra_FEVbrMatrix::PutScalar(double ScalarConstant)
248 {
249  for(int i=0; i<numNonlocalBlockRows_; ++i) {
250  for(int j=0; j<nonlocalBlockRowLengths_[i]; ++j) {
252  double* values = A.A();
253  int lda = A.LDA();
254  int n = A.N();
255  for(int k=0; k<lda*n; ++k) {
256  values[k] = ScalarConstant;
257  }
258  }
259  }
260 
261  return( Epetra_VbrMatrix::PutScalar(ScalarConstant) );
262 }
263 
264 //----------------------------------------------------------------------------
265 
266 int Epetra_FEVbrMatrix::GlobalAssemble(bool callFillComplete)
267 {
268  if(Map().Comm().NumProc() < 2 || ignoreNonLocalEntries_) {
269  if(callFillComplete) {
271  }
272 
273  return(0);
274  }
275 
276  int i;
277 
278  //In this method we need to gather all the non-local (overlapping) data
279  //that's been input on each processor, into the
280  //non-overlapping distribution defined by the map that 'this' matrix was
281  //constructed with.
282 
283  //Need to build a map that describes our nonlocal data.
284 
285  //First, create a list of the sizes (point-rows per block-row) of the
286  //nonlocal rows we're holding.
287  int* pointRowsPerNonlocalBlockRow = numNonlocalBlockRows_>0 ?
288  new int[numNonlocalBlockRows_] : NULL;
289 
290  for(i=0; i<numNonlocalBlockRows_; ++i) {
291  pointRowsPerNonlocalBlockRow[i] = nonlocalCoefs_[i][0]->M();
292  }
293 
294  //We'll use the arbitrary distribution constructor of BlockMap.
295 
296  Epetra_BlockMap sourceMap(-1, numNonlocalBlockRows_, nonlocalBlockRows_, // CJ TODO FIXME long long
297  pointRowsPerNonlocalBlockRow,
298  RowMap().IndexBase(), RowMap().Comm());
299 
300  delete [] pointRowsPerNonlocalBlockRow;
301 
302  //If sourceMap has global size 0, then no nonlocal data exists and we can
303  //skip most of this function.
304  if(sourceMap.NumGlobalElements64() < 1) {
305  if(callFillComplete) {
307  }
308  return(0);
309  }
310 
311  //We also need to build a column-map, containing the columns in our
312  //nonlocal data. To do that, create a list of all column-indices that
313  //occur in our nonlocal rows.
314 
315  int numCols = 0, allocLen = 0;
316  int* cols = NULL;
317  int* pointColsPerBlockCol = NULL;
318  int ptColAllocLen = 0;
319  int insertPoint = -1;
320 
321  for(i=0; i<numNonlocalBlockRows_; ++i) {
322  for(int j=0; j<nonlocalBlockRowLengths_[i]; ++j) {
323  int col = nonlocalBlockCols_[i][j];
324  int offset = Epetra_Util_binary_search(col, cols, numCols, insertPoint);
325  if (offset < 0) {
326  EPETRA_CHK_ERR( Epetra_Util_insert(col, insertPoint, cols,
327  numCols, allocLen) );
328  int tmpNumCols = numCols-1;
330  insertPoint,
331  pointColsPerBlockCol,
332  tmpNumCols, ptColAllocLen) );
333  }
334  }
335  }
336 
337  Epetra_BlockMap colMap(-1, numCols, cols, // CJ TODO FIXME long long
338  pointColsPerBlockCol,
339  RowMap().IndexBase(), RowMap().Comm());
340 
341  delete [] cols;
342  delete [] pointColsPerBlockCol;
343  numCols = 0;
344  allocLen = 0;
345 
346  //now we need to create a matrix with sourceMap and colMap, and fill it with
347  //our nonlocal data so we can then export it to the correct owning
348  //processors.
349 
350  Epetra_VbrMatrix tempMat(Copy, sourceMap, colMap, nonlocalBlockRowLengths_);
351 
352 
353  //Next we need to make sure the 'indices-are-global' attribute of tempMat's
354  //graph is set to true, in case this processor doesn't end up calling the
355  //InsertGlobalValues method...
356 
357  const Epetra_CrsGraph& graph = tempMat.Graph();
358  Epetra_CrsGraph& nonconst_graph = const_cast<Epetra_CrsGraph&>(graph);
359  nonconst_graph.SetIndicesAreGlobal(true);
360 
361  for(i=0; i<numNonlocalBlockRows_; ++i) {
364  nonlocalBlockCols_[i]) );
365 
366  for(int j=0; j<nonlocalBlockRowLengths_[i]; ++j) {
367  Epetra_SerialDenseMatrix& subblock = *(nonlocalCoefs_[i][j]);
368 
369  EPETRA_CHK_ERR( tempMat.SubmitBlockEntry(subblock.A(),
370  subblock.LDA(),
371  subblock.M(),
372  subblock.N()) );
373  }
374 
375  EPETRA_CHK_ERR( tempMat.EndSubmitEntries() );
376  }
377 
378  //Now we need to call FillComplete on our temp matrix. We need to
379  //pass a DomainMap and RangeMap, which are not the same as the RowMap
380  //and ColMap that we constructed the matrix with.
382 
383  //Finally, we're ready to create the exporter and export non-local data to
384  //the appropriate owning processors.
385 
386  Epetra_Export exporter(tempMat.RowMap(), RowMap());
387 
388  EPETRA_CHK_ERR( Export(tempMat, exporter, Add) );
389 
390  if(callFillComplete) {
392  }
393 
395 
396  return(0);
397 }
398 
399 //----------------------------------------------------------------------------
401  int NumRows, int NumCols)
402 {
403  if (curRowOffset_ < 0) {
404  return(-1);
405  }
406 
407  int insertPoint;
408  int col = curCols_[curColOffset_++];
409  int coloffset =
411  nonlocalBlockRowLengths_[curRowOffset_],
412  insertPoint);
413  if (coloffset < 0) return(-1);
414 
415  Epetra_SerialDenseMatrix*& subblock = nonlocalCoefs_[curRowOffset_][coloffset];
416 
417  if (subblock == NULL) {
418  //For the construction of the serial dense matrix here, we choose Copy mode
419  //in case the user deletes or reuses the Values array after this method is
420  //called.
421  subblock = new Epetra_SerialDenseMatrix(Copy, values, LDA, NumRows, NumCols);
422 
423  if (subblock == NULL) {
424  return(-1);
425  }
426  }
427  else {
428  int nrows = subblock->M();
429  int ncols = subblock->N();
430  if (nrows != NumRows || ncols != NumCols) {
431  return(-1);
432  }
433 
434  int Target_LDA = subblock->LDA();
435  int Source_LDA = LDA;
436  double* tptr = subblock->A();
437  double* sptr = values;
438  if (curMode_ == Add) {
439  for(int j=0; j<NumCols; ++j) {
440  for(int i=0; i<NumRows; ++i) {
441  tptr[i] += sptr[i];
442  }
443 
444  tptr += Target_LDA;
445  sptr += Source_LDA;
446  }
447  }
448  else {
449  for(int j=0; j<NumCols; ++j) {
450  for(int i=0; i<NumRows; ++i) {
451  tptr[i] = sptr[i];
452  }
453 
454  tptr += Target_LDA;
455  sptr += Source_LDA;
456  }
457  }
458  }
459 
460  return(0);
461 }
462 
463 //----------------------------------------------------------------------------
464 int Epetra_FEVbrMatrix::InsertNonlocalRow(int row, int offset, int numCols)
465 {
466  //insert a new row in our list of nonlocal rows.
467  //also insert new arrays to hold block-column-index information
468 
469  int alloc_len = numNonlocalBlockRows_;
471  numNonlocalBlockRows_, alloc_len, 1) );
472 
473  int tmp1 = numNonlocalBlockRows_ - 1;
474  int tmp2 = alloc_len - 1;
475 
477  tmp1, tmp2, 1) );
478 
479  --tmp1;
480  --tmp2;
481  int initialAllocLen = numCols*2;
482  EPETRA_CHK_ERR( Epetra_Util_insert(initialAllocLen, offset,
484  tmp1, tmp2, 1) );
485 
486  int** newCols = new int*[numNonlocalBlockRows_];
487  Epetra_SerialDenseMatrix*** newCoefs =
489 
490  if (newCols == NULL || newCoefs == NULL) {
491  return(-1);
492  }
493 
494  newCols[offset] = new int[initialAllocLen];
495  newCoefs[offset] = new Epetra_SerialDenseMatrix*[initialAllocLen];
496 
497  for(int j=0; j<initialAllocLen; ++j) {
498  newCols[offset][j] = 0;
499  newCoefs[offset][j] = (Epetra_SerialDenseMatrix*)NULL;
500  }
501 
502  int index = 0;
503  for(int i=0; i<numNonlocalBlockRows_-1; ++i) {
504  if (i == offset) {
505  ++index;
506  }
507 
508  newCols[index] = nonlocalBlockCols_[i];
509  newCoefs[index++] = nonlocalCoefs_[i];
510  }
511 
512  delete [] nonlocalBlockCols_;
513  delete [] nonlocalCoefs_;
514 
515  nonlocalBlockCols_ = newCols;
516  nonlocalCoefs_ = newCoefs;
517 
518  return(0);
519 }
520 
521 //--------------------------------------------------------------------------
523  int NumBlockEntries,
524  int * BlockIndices)
525 {
526  int myRow = LRID(BlockRow);
527 
528  if (myRow > -1) {
530  NumBlockEntries,
531  BlockIndices) );
532  }
533 
534  return( SetupForNonlocalSubmits(BlockRow, NumBlockEntries,
535  BlockIndices, false, Add) );
536 }
537 
538 //--------------------------------------------------------------------------
540  int NumBlockEntries,
541  int *BlockIndices)
542 {
543  int myRow = LRID(BlockRow);
544 
545  if (myRow > -1) {
547  NumBlockEntries,
548  BlockIndices) );
549  }
550 
551  return( SetupForNonlocalSubmits(BlockRow, NumBlockEntries,
552  BlockIndices, false, Insert) );
553 }
554 
555 //--------------------------------------------------------------------------
557  int NumBlockEntries,
558  int *BlockIndices)
559 {
560  int myRow = LRID(BlockRow);
561 
562  if (myRow > -1) {
564  NumBlockEntries,
565  BlockIndices) );
566  }
567 
568  return( SetupForNonlocalSubmits(BlockRow, NumBlockEntries,
569  BlockIndices, false, Add) );
570 }
571 
572 //--------------------------------------------------------------------------
574  int NumBlockEntries,
575  int * BlockIndices,
576  bool indicesAreLocal,
577  Epetra_CombineMode SubmitMode)
578 {
579  (void)indicesAreLocal;
581  curRowOffset_ = 0;
582  return(0);
583  }
584 
585  int insertPoint = -1;
586 
587  //find offset of this row in our list of nonlocal rows
588  int rowoffset = Epetra_Util_binary_search(BlockRow, nonlocalBlockRows_,
589  numNonlocalBlockRows_, insertPoint);
590 
591  //if this row is not already present, insert it
592  if (rowoffset < 0) {
593  EPETRA_CHK_ERR( InsertNonlocalRow(BlockRow, insertPoint, NumBlockEntries) );
594  rowoffset = insertPoint;
595  }
596 
597  //now insert each incoming block-column-index in this list of column-indices,
598  //maintaining sortedness.
599  for(int i=0; i<NumBlockEntries; ++i) {
600  int col = BlockIndices[i];
601  int coloffset = Epetra_Util_binary_search(col, nonlocalBlockCols_[rowoffset],
602  nonlocalBlockRowLengths_[rowoffset],
603  insertPoint);
604  if (coloffset < 0) {
605  int tmp1 = nonlocalBlockRowLengths_[rowoffset];
606  int tmp2 = nonlocalBlockRowAllocLengths_[rowoffset];
607 
608  EPETRA_CHK_ERR( Epetra_Util_insert(col, insertPoint,
609  nonlocalBlockCols_[rowoffset],
610  nonlocalBlockRowLengths_[rowoffset],
611  nonlocalBlockRowAllocLengths_[rowoffset]));
612 
614  insertPoint,
615  nonlocalCoefs_[rowoffset],
616  tmp1, tmp2) );
617  }
618  }
619 
620  curRowOffset_ = rowoffset;
621  curColOffset_ = 0;
622  curNumCols_ = NumBlockEntries;
623  curCols_ = new int[NumBlockEntries];
624  for(int j=0; j<NumBlockEntries; ++j) {
625  curCols_[j] = BlockIndices[j];
626  }
627 
628  curMode_ = SubmitMode;
629 
630  return(0);
631 }
632 
633 //--------------------------------------------------------------------------
635  int LDA,
636  int NumRows,
637  int NumCols)
638 {
639  if (curRowOffset_ < 0) {
641  NumRows, NumCols) );
642  }
643  else {
645  return(0);
646  }
647 
649  NumRows, NumCols) );
650  }
651 
652  return(0);
653 }
654 //--------------------------------------------------------------------------
656 {
657  if (curRowOffset_ < 0) {
659  }
660  else {
661  curRowOffset_ = -1;
662  curColOffset_ = -1;
663  curNumCols_ = 0;
664  delete [] curCols_;
665  }
666 
667  return(0);
668 }
669 
670 #endif // EPETRA_NO_32BIT_GLOBAL_INDICES
const Epetra_BlockMap & RangeMap() const
Returns the Epetra_BlockMap object associated with the range of this matrix operator.
Epetra_SerialDenseMatrix *** nonlocalCoefs_
int BeginReplaceGlobalValues(int BlockRow, int NumBlockEntries, int *BlockIndices)
Initiate replacement of current values with this list of entries for a given global row of the matrix...
int GlobalAssemble(bool callFillComplete=true)
const Epetra_CrsGraph & Graph() const
Returns a pointer to the Epetra_CrsGraph object associated with this matrix.
int PutScalar(double ScalarConstant)
Initialize all values in graph of the matrix with constant value.
long long NumGlobalElements64() const
virtual ~Epetra_FEVbrMatrix()
Epetra_VbrMatrix Destructor.
#define EPETRA_CHK_ERR(a)
Epetra_Export: This class builds an export object for efficient exporting of off-processor elements...
Definition: Epetra_Export.h:62
Epetra_VbrMatrix: A class for the construction and use of real-valued double-precision variable block...
int BeginSumIntoGlobalValues(int BlockRow, int NumBlockEntries, int *BlockIndices)
Initiate summing into current values with this list of entries for a given global row of the matrix...
Epetra_SerialDenseMatrix: A class for constructing and using real double precision general dense matr...
Epetra_FEVbrMatrix & operator=(const Epetra_FEVbrMatrix &src)
int BeginReplaceGlobalValues(int BlockRow, int NumBlockEntries, int *BlockIndices)
Initiate replacement of current values with this list of entries for a given global row of the matrix...
const Epetra_Comm & Comm() const
Fills a matrix with rows from a source matrix based on the specified importer.
const Epetra_BlockMap & Map() const
Map() method inherited from Epetra_DistObject.
int SetupForNonlocalSubmits(int BlockRow, int NumBlockEntries, int *BlockIndices, bool IndicesAreLocal, Epetra_CombineMode SubmitMode)
double * A() const
Returns pointer to the this matrix.
const Epetra_BlockMap & DomainMap() const
Returns the Epetra_BlockMap object associated with the domain of this matrix operator.
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 SetIndicesAreGlobal(bool Flag)
int BeginSumIntoGlobalValues(int BlockRow, int NumBlockEntries, int *BlockIndices)
Initiate summing into current values with this list of entries for a given global row of the matrix...
int LRID(int GRID_in) const
Returns the local row index for given global row index, returns -1 if no local row for this global ro...
int InsertNonlocalRow(int row, int offset, int numCols)
Epetra_BlockMap: A class for partitioning block element vectors and matrices.
const Epetra_BlockMap & RowMap() const
Returns the RowMap object as an Epetra_BlockMap (the Epetra_Map base class) needed for implementing E...
int EndSubmitEntries()
Completes processing of all data passed in for the current block row.
int EndSubmitEntries()
Completes processing of all data passed in for the current block row.
int Epetra_Util_binary_search(T item, const T *list, int len, int &insertPoint)
Utility function to perform a binary-search on a list of data.
int InputNonlocalBlockEntry(double *Values, int LDA, int NumRows, int NumCols)
int LDA() const
Returns the leading dimension of the this matrix.
Epetra Finite-Element VbrMatrix.
int IndexBase() const
Returns the index base for row and column indices for this graph.
int SubmitBlockEntry(double *Values, int LDA, int NumRows, int NumCols)
Submit a block entry to the indicated block row and column specified in the Begin routine...
int FillComplete()
Signal that data entry is complete, perform transformations to local index space. ...
Epetra_CombineMode
int BeginInsertGlobalValues(int BlockRow, int NumBlockEntries, int *BlockIndices)
Initiate insertion of a list of elements in a given global row of the matrix, values are inserted via...
int SubmitBlockEntry(double *Values, int LDA, int NumRows, int NumCols)
Submit a block entry to the indicated block row and column specified in the Begin routine...
Epetra_FEVbrMatrix(Epetra_DataAccess CV, const Epetra_BlockMap &RowMap, int *NumBlockEntriesPerRow, bool ignoreNonLocalEntries=false)
Epetra_FEVbrMatrix constuctor with variable number of indices per row.
int N() const
Returns column dimension of system.
Epetra_VbrMatrix & operator=(const Epetra_VbrMatrix &src)
Epetra_DataAccess
int n
int M() const
Returns row dimension of system.
int PutScalar(double ScalarConstant)
Initialize all values in graph of the matrix with constant value.
Epetra_CrsGraph: A class for constructing and using sparse compressed row graphs. ...
int BeginInsertGlobalValues(int BlockRow, int NumBlockEntries, int *BlockIndices)
Initiate insertion of a list of elements in a given global row of the matrix, values are inserted via...
int Epetra_Util_insert(T item, int offset, T *&list, int &usedLength, int &allocatedLength, int allocChunkSize=32)
Function to insert an item in a list, at a specified offset.
Definition: Epetra_Util.h:398