Epetra Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FECrsGraph/ExecuteTestProblems.cpp
Go to the documentation of this file.
1 //@HEADER
2 // ************************************************************************
3 //
4 // Epetra: Linear Algebra Services Package
5 // Copyright 2011 Sandia Corporation
6 //
7 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
8 // the U.S. Government retains certain rights in this software.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
38 //
39 // ************************************************************************
40 //@HEADER
41 
42 
43 #include "Epetra_BLAS.h"
44 #include "ExecuteTestProblems.h"
45 #include "Epetra_Comm.h"
46 #include "Epetra_Map.h"
47 #include "Epetra_Vector.h"
48 #include "Epetra_FECrsGraph.h"
49 #include "Epetra_FECrsMatrix.h"
52 
53 
54 int Drumm1(const Epetra_Map& map, bool verbose)
55 {
56  //Simple 2-element problem (element as in "finite-element") from
57  //Clif Drumm. Two triangular elements, one per processor, as shown
58  //here:
59  //
60  // *----*
61  // 3|\ 2|
62  // | \ |
63  // | 0\1|
64  // | \|
65  // *----*
66  // 0 1
67  //
68  //Element 0 on processor 0, element 1 on processor 1.
69  //Processor 0 will own nodes 0,1 and processor 1 will own nodes 2,3.
70  //Each processor will pass a 3x3 element-connectivity-matrix to
71  //Epetra_FECrsGraph.
72  //After GlobalAssemble(), the graph should be as follows:
73  //
74  // row 0: 2 1 0 1
75  //proc 0 row 1: 1 4 1 2
76  //----------------------------------
77  // row 2: 0 1 2 1
78  //proc 1 row 3: 1 2 1 4
79  //
80 
81  int numProcs = map.Comm().NumProc();
82  int localProc = map.Comm().MyPID();
83 
84  if (numProcs != 2) return(0);
85 
86  int indexBase = 0, ierr = 0;
87 
88  int numMyNodes = 2;
89  int* myNodes = new int[numMyNodes];
90 
91  if (localProc == 0) {
92  myNodes[0] = 0;
93  myNodes[1] = 1;
94  }
95  else {
96  myNodes[0] = 2;
97  myNodes[1] = 3;
98  }
99 
100  Epetra_Map Map(-1, numMyNodes, myNodes, indexBase, map.Comm());
101 
102  delete [] myNodes;
103  numMyNodes = 3;
104  myNodes = new int[numMyNodes];
105 
106  if (localProc == 0) {
107  myNodes[0] = 0;
108  myNodes[1] = 1;
109  myNodes[2] = 3;
110  }
111  else {
112  myNodes[0] = 1;
113  myNodes[1] = 2;
114  myNodes[2] = 3;
115  }
116 
117  int rowLengths = 3;
118  Epetra_FECrsGraph A(Copy, Map, rowLengths);
119 
120  EPETRA_TEST_ERR( A.InsertGlobalIndices(numMyNodes, myNodes,
121  numMyNodes, myNodes),ierr);
122 
123  EPETRA_TEST_ERR( A.GlobalAssemble(), ierr );
124 
125  if (verbose) {
126  A.Print(std::cout);
127  }
128 
129  delete [] myNodes;
130 
131  return(0);
132 }
133 
134 int Drumm2(const Epetra_Map& map, bool verbose)
135 {
136  //Simple 2-element problem (element as in "finite-element") from
137  //Clif Drumm. Two triangular elements, one per processor, as shown
138  //here:
139  //
140  // *----*
141  // 3|\ 2|
142  // | \ |
143  // | 0\1|
144  // | \|
145  // *----*
146  // 0 1
147  //
148  //Element 0 on processor 0, element 1 on processor 1.
149  //Processor 0 will own nodes 0,1,3 and processor 1 will own node 2.
150  //Each processor will pass a 3x3 element-connectivity-matrix to
151  //Epetra_FECrsGraph.
152  //After GlobalAssemble(), the graph should be as follows:
153  //
154  // row 0: 2 1 0 1
155  //proc 0 row 1: 1 4 1 2
156  // row 2: 0 1 2 1
157  //----------------------------------
158  //proc 1 row 3: 1 2 1 4
159  //
160 
161  int numProcs = map.Comm().NumProc();
162  int localProc = map.Comm().MyPID();
163 
164  if (numProcs != 2) return(0);
165 
166  int indexBase = 0, ierr = 0;
167  int numMyNodes = 3;
168  int* myNodes = new int[numMyNodes];
169 
170  if (localProc == 0) {
171  myNodes[0] = 0;
172  myNodes[1] = 1;
173  myNodes[2] = 3;
174  }
175  else {
176  numMyNodes = 1;
177  myNodes[0] = 2;
178  }
179 
180  Epetra_Map Map(-1, numMyNodes, myNodes, indexBase, map.Comm());
181 
182  int rowLengths = 3;
183  Epetra_FECrsGraph A(Copy, Map, rowLengths);
184 
185  if (localProc != 0) {
186  numMyNodes = 3;
187  myNodes[0] = 1;
188  myNodes[1] = 2;
189  myNodes[2] = 3;
190  }
191 
192  EPETRA_TEST_ERR( A.InsertGlobalIndices(numMyNodes, myNodes,
193  numMyNodes, myNodes),ierr);
194 
195  EPETRA_TEST_ERR( A.GlobalAssemble(), ierr );
196 
197  if (verbose) {
198  A.Print(std::cout);
199  }
200 
201  delete [] myNodes;
202 
203  return(0);
204 }
205 
206 int four_quads(const Epetra_Comm& Comm, bool preconstruct_graph, bool verbose)
207 {
208  if (verbose) {
209  std::cout << "******************* four_quads ***********************"<<std::endl;
210  }
211 
212  //This function assembles a matrix representing a finite-element
213  //mesh of four 2-D quad elements. There are 9 nodes in the problem. The
214  //same problem is assembled no matter how many processors are being used
215  //(within reason). It may not work if more than 9 processors are used.
216  //
217  // *------*------*
218  // 6| 7| 8|
219  // | E2 | E3 |
220  // *------*------*
221  // 3| 4| 5|
222  // | E0 | E1 |
223  // *------*------*
224  // 0 1 2
225  //
226  //Nodes are denoted by * with node-numbers below and left of each node.
227  //E0, E1 and so on are element-numbers.
228  //
229  //Each processor will contribute a sub-matrix of size 4x4, filled with 1's,
230  //for each element. Thus, the coefficient value at position 0,0 should end up
231  //being 1.0*numProcs, the value at position 4,4 should be 1.0*4*numProcs, etc.
232  //
233  //Depending on the number of processors being used, the locations of the
234  //specific matrix positions (in terms of which processor owns them) will vary.
235  //
236 
237  int numProcs = Comm.NumProc();
238 
239  int numNodes = 9;
240  int numElems = 4;
241  int numNodesPerElem = 4;
242 
243  int indexBase = 0;
244 
245  //Create a map using epetra-defined linear distribution.
246  Epetra_Map map(numNodes, indexBase, Comm);
247 
248  Epetra_FECrsGraph* graph = NULL;
249 
250  int* nodes = new int[numNodesPerElem];
251  int i, err = 0;
252 
253  if (preconstruct_graph) {
254  graph = new Epetra_FECrsGraph(Copy, map, 1);
255 
256  //we're going to fill the graph with indices, by passing our
257  //connectivity lists.
258  //FECrsGraph should accept indices in all rows, regardless of
259  //whether map.MyGID(row) is true.
260 
261  for(i=0; i<numElems; ++i) {
262  switch(i) {
263  case 0:
264  nodes[0] = 0; nodes[1] = 1; nodes[2] = 4; nodes[3] = 3;
265  break;
266  case 1:
267  nodes[0] = 1; nodes[1] = 2; nodes[2] = 5; nodes[3] = 4;
268  break;
269  case 2:
270  nodes[0] = 3; nodes[1] = 4; nodes[2] = 7; nodes[3] = 6;
271  break;
272  case 3:
273  nodes[0] = 4; nodes[1] = 5; nodes[2] = 8; nodes[3] = 7;
274  break;
275  }
276 
277  err = graph->InsertGlobalIndices(numNodesPerElem, nodes,
278  numNodesPerElem, nodes);
279  if (err < 0) {
280  std::cerr << "ERROR, FECrsGraph error in InsertGlobalIndices, err="
281  << err << std::endl;
282  return(-1);
283  }
284  }
285 
286  EPETRA_CHK_ERR( graph->GlobalAssemble() );
287  }
288 
289  Epetra_FECrsMatrix* A = NULL;
290 
291  if (preconstruct_graph) {
292  A = new Epetra_FECrsMatrix(Copy, *graph);
293  }
294  else {
295  A = new Epetra_FECrsMatrix(Copy, map, 1);
296  }
297 
298  EPETRA_CHK_ERR( A->PutScalar(0.0) );
299 
300  double* values_1d = new double[numNodesPerElem*numNodesPerElem];
301  double** values_2d = new double*[numNodesPerElem];
302 
303  for(i=0; i<numNodesPerElem*numNodesPerElem; ++i) values_1d[i] = 1.0;
304 
305  int offset = 0;
306  for(i=0; i<numNodesPerElem; ++i) {
307  values_2d[i] = &(values_1d[offset]);
308  offset += numNodesPerElem;
309  }
310 
311  int format = Epetra_FECrsMatrix::ROW_MAJOR;
312  Epetra_IntSerialDenseVector epetra_nodes(View, nodes, numNodesPerElem);
313  Epetra_SerialDenseMatrix epetra_values(View, values_1d, numNodesPerElem,
314  numNodesPerElem, numNodesPerElem);
315 
316  for(i=0; i<numElems; ++i) {
317  switch(i) {
318  case 0:
319  nodes[0] = 0; nodes[1] = 1; nodes[2] = 4; nodes[3] = 3;
320  if (preconstruct_graph) {
321  err = A->SumIntoGlobalValues(epetra_nodes,
322  epetra_values, format);
323  if (err<0) return(err);
324  }
325  else {
326  err = A->InsertGlobalValues(epetra_nodes,
327  epetra_values, format);
328  if (err<0) return(err);
329  }
330  break;
331 
332  case 1:
333  nodes[0] = 1; nodes[1] = 2; nodes[2] = 5; nodes[3] = 4;
334  if (preconstruct_graph) {
335  err = A->SumIntoGlobalValues(numNodesPerElem, nodes,
336  values_2d, format);
337  if (err<0) return(err);
338  }
339  else {
340  err = A->InsertGlobalValues(numNodesPerElem, nodes,
341  values_2d, format);
342  if (err<0) return(err);
343  }
344  break;
345 
346  case 2:
347  nodes[0] = 3; nodes[1] = 4; nodes[2] = 7; nodes[3] = 6;
348  if (preconstruct_graph) {
349  err = A->SumIntoGlobalValues(numNodesPerElem, nodes,
350  numNodesPerElem, nodes,
351  values_1d, format);
352  if (err<0) return(err);
353  }
354  else {
355  err = A->InsertGlobalValues(numNodesPerElem, nodes,
356  numNodesPerElem, nodes,
357  values_1d, format);
358  if (err<0) return(err);
359  }
360  break;
361 
362  case 3:
363  nodes[0] = 4; nodes[1] = 5; nodes[2] = 8; nodes[3] = 7;
364  if (preconstruct_graph) {
365  err = A->SumIntoGlobalValues(numNodesPerElem, nodes,
366  numNodesPerElem, nodes,
367  values_2d, format);
368  if (err<0) return(err);
369  }
370  else {
371  err = A->InsertGlobalValues(numNodesPerElem, nodes,
372  numNodesPerElem, nodes,
373  values_2d, format);
374  if (err<0) return(err);
375  }
376  break;
377  }
378  }
379 
380  err = A->GlobalAssemble();
381  if (err < 0) {
382  return(err);
383  }
384 
385  Epetra_Vector x(A->RowMap()), y(A->RowMap());
386 
387  x.PutScalar(1.0); y.PutScalar(0.0);
388 
389  Epetra_FECrsMatrix Acopy(*A);
390 
391  Epetra_Vector x2(Acopy.RowMap()), y2(Acopy.RowMap());
392 
393  x2.PutScalar(1.0); y2.PutScalar(0.0);
394 
395  A->Multiply(false, x, y);
396 
397  Acopy.Multiply(false, x2, y2);
398 
399  double ynorm2, y2norm2;
400 
401  y.Norm2(&ynorm2);
402  y2.Norm2(&y2norm2);
403  if (ynorm2 != y2norm2) {
404  std::cerr << "norm2(A*ones) != norm2(Acopy*ones)"<<std::endl;
405  return(-99);
406  }
407 
408  err = Acopy.GlobalAssemble();
409  if (err < 0) {
410  return(err);
411  }
412 
413  if (verbose) {
414  std::cout << "A:"<<std::endl<<*A << std::endl;
415  std::cout << "Acopy:"<<std::endl<<Acopy << std::endl;
416  }
417 
418  Epetra_FECrsMatrix Acopy2(Copy, A->RowMap(), A->ColMap(), 1);
419 
420  Acopy2 = Acopy;
421 
422  Epetra_Vector x3(Acopy.RowMap()), y3(Acopy.RowMap());
423 
424  x3.PutScalar(1.0); y3.PutScalar(0.0);
425 
426  Acopy2.Multiply(false, x3, y3);
427 
428  double y3norm2;
429  y3.Norm2(&y3norm2);
430 
431  if (y3norm2 != y2norm2) {
432  std::cerr << "norm2(Acopy*ones) != norm2(Acopy2*ones)"<<std::endl;
433  return(-999);
434  }
435 
436  int len = 20;
437  int* indices = new int[len];
438  double* values = new double[len];
439  int numIndices;
440 
441  if (map.MyGID(0)) {
442  EPETRA_CHK_ERR( A->ExtractGlobalRowCopy(0, len, numIndices,
443  values, indices) );
444  if (numIndices != 4) {
445  return(-1);
446  }
447  if (indices[0] != 0) {
448  return(-2);
449  }
450 
451  if (values[0] != 1.0*numProcs) {
452  std::cout << "ERROR: values[0] ("<<values[0]<<") should be "<<numProcs<<std::endl;
453  return(-3);
454  }
455  }
456 
457  if (map.MyGID(4)) {
458  EPETRA_CHK_ERR( A->ExtractGlobalRowCopy(4, len, numIndices,
459  values, indices) );
460 
461  if (numIndices != 9) {
462  return(-4);
463  }
464  int lcid = A->LCID(4);
465  if (lcid<0) {
466  return(-5);
467  }
468  if (values[lcid] != 4.0*numProcs) {
469  std::cout << "ERROR: values["<<lcid<<"] ("<<values[lcid]<<") should be "
470  <<4*numProcs<<std::endl;
471  return(-6);
472  }
473  }
474 
475 // now let's do the checks for Acopy...
476 
477  if (map.MyGID(0)) {
478  EPETRA_CHK_ERR( Acopy.ExtractGlobalRowCopy(0, len, numIndices,
479  values, indices) );
480  if (numIndices != 4) {
481  return(-1);
482  }
483  if (indices[0] != 0) {
484  return(-2);
485  }
486 
487  if (values[0] != 1.0*numProcs) {
488  std::cout << "ERROR: Acopy.values[0] ("<<values[0]<<") should be "<<numProcs<<std::endl;
489  return(-3);
490  }
491  }
492 
493  if (map.MyGID(4)) {
494  EPETRA_CHK_ERR( Acopy.ExtractGlobalRowCopy(4, len, numIndices,
495  values, indices) );
496 
497  if (numIndices != 9) {
498  return(-4);
499  }
500  int lcid = A->LCID(4);
501  if (lcid<0) {
502  return(-5);
503  }
504  if (values[lcid] != 4.0*numProcs) {
505  std::cout << "ERROR: Acopy.values["<<lcid<<"] ("<<values[lcid]<<") should be "
506  <<4*numProcs<<std::endl;
507  return(-6);
508  }
509  }
510 
511 // now let's do the checks for Acopy2...
512 
513  if (map.MyGID(0)) {
514  EPETRA_CHK_ERR( Acopy2.ExtractGlobalRowCopy(0, len, numIndices,
515  values, indices) );
516  if (numIndices != 4) {
517  return(-1);
518  }
519  if (indices[0] != 0) {
520  return(-2);
521  }
522 
523  if (values[0] != 1.0*numProcs) {
524  std::cout << "ERROR: Acopy2.values[0] ("<<values[0]<<") should be "<<numProcs<<std::endl;
525  return(-3);
526  }
527  }
528 
529  if (map.MyGID(4)) {
530  EPETRA_CHK_ERR( Acopy2.ExtractGlobalRowCopy(4, len, numIndices,
531  values, indices) );
532 
533  if (numIndices != 9) {
534  return(-4);
535  }
536  int lcid = A->LCID(4);
537  if (lcid<0) {
538  return(-5);
539  }
540  if (values[lcid] != 4.0*numProcs) {
541  std::cout << "ERROR: Acopy2.values["<<lcid<<"] ("<<values[lcid]<<") should be "
542  <<4*numProcs<<std::endl;
543  return(-6);
544  }
545  }
546 
547  delete [] values_2d;
548  delete [] values_1d;
549  delete [] nodes;
550  delete [] indices;
551  delete [] values;
552 
553  delete A;
554  delete graph;
555 
556  return(0);
557 }
558 
559 int Young1(const Epetra_Comm& Comm, bool verbose)
560 {
561  //This is a test case submitted by Joe Young with bug 2421. It runs
562  //only on 2 processors.
563  if (Comm.NumProc() != 2) {
564  return(0);
565  }
566 
567  // Give rows 0-2 to proc 0 and 3-5 to proc 1
568  int RowIndices[3];
569  if (Comm.MyPID() == 0) {
570  RowIndices[0] = 0;
571  RowIndices[1] = 1;
572  RowIndices[2] = 2;
573  } else {
574  RowIndices[0] = 3;
575  RowIndices[1] = 4;
576  RowIndices[2] = 5;
577  }
578  Epetra_Map RangeMap(-1, 3, RowIndices, 0, Comm);
579  Epetra_Map & RowMap = RangeMap;
580 
581  // Define a second map that gives col 0 to proc 0 and col 1 to proc 1
582  int ColIndices[1];
583  if (Comm.MyPID() == 0) {
584  ColIndices[0] = 0;
585  }
586  else {
587  ColIndices[0] = 1;
588  }
589  Epetra_Map DomainMap(-1, 1, ColIndices, 0, Comm);
590 
591  // Construct a graph where both processors only insert into local
592  // elements
593  Epetra_FECrsGraph BrokenGraph(Copy, RowMap, 2);
594  for (int i = 0; i < RangeMap.NumMyElements(); i++) {
595  int ig = RowIndices[i];
596  int jgs[2] = { 0, 1 };
597  BrokenGraph.InsertGlobalIndices(1, &ig, 2, jgs);
598  }
599  BrokenGraph.GlobalAssemble(DomainMap, RangeMap);
600 
601  // Check the size of the matrix that would be created from the graph
602  int numCols1 = BrokenGraph.NumGlobalCols();
603  if (verbose) {
604  std::cout << "Number of global rows in the graph where only "
605  "local elements were inserted: " << BrokenGraph.NumGlobalRows()
606  << std::endl;
607  std::cout << "Number of global cols in the graph where only "
608  "local elements were inserted: " << BrokenGraph.NumGlobalCols()
609  << std::endl;
610  }
611  // Construct a graph where both processors insert into global elements
612  Epetra_FECrsGraph Graph(Copy, RowMap, 2);
613  for (int i = 0; i < 6; i++) {
614  int ig = i;
615  int jgs[2] = { 0, 1 };
616  Graph.InsertGlobalIndices(1, &ig, 2, jgs);
617  }
618  Graph.GlobalAssemble(DomainMap, RangeMap);
619 
620  // Check the size of the matrix that would be created from the graph
621  int numCols2 = Graph.NumGlobalCols();
622  if (verbose) {
623  std::cout << "Number of global rows in the graph where "
624  "global elements were inserted: " << Graph.NumGlobalRows()
625  << std::endl;
626  std::cout << "Number of global cols in the graph where "
627  "global elements were inserted: " << Graph.NumGlobalCols()
628  << std::endl;
629  }
630 
631  if (numCols1 != numCols2) return(-1);
632  return(0);
633 }
634 
635 int rectangular(const Epetra_Comm& Comm, bool verbose)
636 {
637  int mypid = Comm.MyPID();
638  int numlocalrows = 3;
639  Epetra_Map rowmap(-1, numlocalrows, 0, Comm);
640 
641  int numglobalrows = numlocalrows*Comm.NumProc();
642 
643  int numcols = 2*numglobalrows;
644 
645  Epetra_FECrsGraph fegraph(Copy, rowmap, numcols);
646 
647  int* cols = new int[numcols];
648  for(int j=0; j<numcols; ++j) cols[j] = j;
649 
650  Epetra_Map domainmap(-1, numcols, 0, Comm);
651 
652  int firstlocalrow = numlocalrows*mypid;
653  int lastlocalrow = numlocalrows*(mypid+1)-1;
654 
655  for(int i=0; i<numglobalrows; ++i) {
656  //if i is a local row, then skip it. We want each processor to only
657  //load rows that belong on other processors.
658  if (i >= firstlocalrow && i <= lastlocalrow) continue;
659 
660  EPETRA_CHK_ERR( fegraph.InsertGlobalIndices(1, &i, numcols, &(cols[0])) );
661  }
662 
663  EPETRA_CHK_ERR( fegraph.GlobalAssemble(domainmap, rowmap) );
664 
665  if (verbose) {
666  std::cout << "********************** fegraph **********************" << std::endl;
667  std::cout << fegraph << std::endl;
668  }
669 
670  delete [] cols;
671 
672  return(0);
673 }
674 
int NumGlobalRows() const
Returns the number of matrix rows in global matrix.
Epetra_Map: A class for partitioning vectors and matrices.
Definition: Epetra_Map.h:127
int InsertGlobalIndices(int numRows, const int *rows, int numCols, const int *cols)
Insert a rectangular, dense &#39;submatrix&#39; of entries (matrix nonzero positions) into the graph...
Epetra_IntSerialDenseVector: A class for constructing and using dense vectors.
int Multiply(bool TransA, const Epetra_Vector &x, Epetra_Vector &y) const
Returns the result of a Epetra_CrsMatrix multiplied by a Epetra_Vector x in y.
#define EPETRA_TEST_ERR(a, b)
int PutScalar(double ScalarConstant)
Initialize all values in a multi-vector with constant value.
Epetra Finite-Element CrsGraph.
virtual void Print(std::ostream &os) const
Print method.
#define EPETRA_CHK_ERR(a)
Epetra_Vector: A class for constructing and using dense vectors on a parallel computer.
int GlobalAssemble(bool callFillComplete=true)
Gather any overlapping/shared data into the non-overlapping partitioning defined by the Map that was ...
Epetra_SerialDenseMatrix: A class for constructing and using real double precision general dense matr...
const Epetra_Map & ColMap() const
Returns the Epetra_Map object that describes the set of column-indices that appear in each processor&#39;...
int Drumm1(const Epetra_Map &map, bool verbose)
virtual int MyPID() const =0
Return my process ID.
int InsertGlobalValues(int GlobalRow, int NumEntries, const double *Values, const int *Indices)
override base-class Epetra_CrsMatrix::InsertGlobalValues method
int PutScalar(double ScalarConstant)
Initialize all values in the matrix with constant value.
const Epetra_Map & RowMap() const
Returns the Epetra_Map object associated with the rows of this matrix.
int NumMyElements() const
Number of elements on the calling processor.
Epetra Finite-Element CrsMatrix.
int NumGlobalCols() const
Returns the number of matrix columns in global matrix.
Epetra_Comm: The Epetra Communication Abstract Base Class.
Definition: Epetra_Comm.h:81
int ExtractGlobalRowCopy(int GlobalRow, int Length, int &NumEntries, double *Values, int *Indices) const
Returns a copy of the specified global row in user-provided arrays.
int LCID(int GCID_in) const
Returns the local column index for given global column index, returns -1 if no local column for this ...
int GlobalAssemble(bool callFillComplete=true, Epetra_CombineMode combineMode=Add, bool save_off_and_reuse_map_exporter=false)
Gather any overlapping/shared data into the non-overlapping partitioning defined by the Map that was ...
bool MyGID(int GID_in) const
Returns true if the GID passed in belongs to the calling processor in this map, otherwise returns fal...
const Epetra_Comm & Comm() const
Access function for Epetra_Comm communicator.
int SumIntoGlobalValues(int GlobalRow, int NumEntries, const double *Values, const int *Indices)
override base-class Epetra_CrsMatrix::SumIntoGlobalValues method
virtual int NumProc() const =0
Returns total number of processes.
int Young1(const Epetra_Comm &Comm, bool verbose)
int rectangular(const Epetra_Comm &Comm, bool verbose)
int Drumm2(const Epetra_Map &map, bool verbose)
int four_quads(const Epetra_Comm &Comm, bool preconstruct_graph, bool verbose)