Epetra Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FECrsGraph_LL/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  long long indexBase = 0;
87  int ierr = 0;
88 
89  int numMyNodes = 2;
90  long long* myNodes = new long long[numMyNodes];
91 
92  if (localProc == 0) {
93  myNodes[0] = 0;
94  myNodes[1] = 1;
95  }
96  else {
97  myNodes[0] = 2;
98  myNodes[1] = 3;
99  }
100 
101  Epetra_Map Map((long long) -1, numMyNodes, myNodes, indexBase, map.Comm());
102 
103  delete [] myNodes;
104  numMyNodes = 3;
105  myNodes = new long long[numMyNodes];
106 
107  if (localProc == 0) {
108  myNodes[0] = 0;
109  myNodes[1] = 1;
110  myNodes[2] = 3;
111  }
112  else {
113  myNodes[0] = 1;
114  myNodes[1] = 2;
115  myNodes[2] = 3;
116  }
117 
118  int rowLengths = 3;
119  Epetra_FECrsGraph A(Copy, Map, rowLengths);
120 
121  EPETRA_TEST_ERR( A.InsertGlobalIndices(numMyNodes, myNodes,
122  numMyNodes, myNodes),ierr);
123 
124  EPETRA_TEST_ERR( A.GlobalAssemble(), ierr );
125 
126  if (verbose) {
127  A.Print(std::cout);
128  }
129 
130  delete [] myNodes;
131 
132  return(0);
133 }
134 
135 int Drumm2(const Epetra_Map& map, bool verbose)
136 {
137  //Simple 2-element problem (element as in "finite-element") from
138  //Clif Drumm. Two triangular elements, one per processor, as shown
139  //here:
140  //
141  // *----*
142  // 3|\ 2|
143  // | \ |
144  // | 0\1|
145  // | \|
146  // *----*
147  // 0 1
148  //
149  //Element 0 on processor 0, element 1 on processor 1.
150  //Processor 0 will own nodes 0,1,3 and processor 1 will own node 2.
151  //Each processor will pass a 3x3 element-connectivity-matrix to
152  //Epetra_FECrsGraph.
153  //After GlobalAssemble(), the graph should be as follows:
154  //
155  // row 0: 2 1 0 1
156  //proc 0 row 1: 1 4 1 2
157  // row 2: 0 1 2 1
158  //----------------------------------
159  //proc 1 row 3: 1 2 1 4
160  //
161 
162  int numProcs = map.Comm().NumProc();
163  int localProc = map.Comm().MyPID();
164 
165  if (numProcs != 2) return(0);
166 
167  long long indexBase = 0;
168  int ierr = 0;
169  int numMyNodes = 3;
170  long long* myNodes = new long long[numMyNodes];
171 
172  if (localProc == 0) {
173  myNodes[0] = 0;
174  myNodes[1] = 1;
175  myNodes[2] = 3;
176  }
177  else {
178  numMyNodes = 1;
179  myNodes[0] = 2;
180  }
181 
182  Epetra_Map Map((long long) -1, numMyNodes, myNodes, indexBase, map.Comm());
183 
184  int rowLengths = 3;
185  Epetra_FECrsGraph A(Copy, Map, rowLengths);
186 
187  if (localProc != 0) {
188  numMyNodes = 3;
189  myNodes[0] = 1;
190  myNodes[1] = 2;
191  myNodes[2] = 3;
192  }
193 
194  EPETRA_TEST_ERR( A.InsertGlobalIndices(numMyNodes, myNodes,
195  numMyNodes, myNodes),ierr);
196 
197  EPETRA_TEST_ERR( A.GlobalAssemble(), ierr );
198 
199  if (verbose) {
200  A.Print(std::cout);
201  }
202 
203  delete [] myNodes;
204 
205  return(0);
206 }
207 
208 int four_quads(const Epetra_Comm& Comm, bool preconstruct_graph, bool verbose)
209 {
210  if (verbose) {
211  std::cout << "******************* four_quads ***********************"<<std::endl;
212  }
213 
214  //This function assembles a matrix representing a finite-element
215  //mesh of four 2-D quad elements. There are 9 nodes in the problem. The
216  //same problem is assembled no matter how many processors are being used
217  //(within reason). It may not work if more than 9 processors are used.
218  //
219  // *------*------*
220  // 6| 7| 8|
221  // | E2 | E3 |
222  // *------*------*
223  // 3| 4| 5|
224  // | E0 | E1 |
225  // *------*------*
226  // 0 1 2
227  //
228  //Nodes are denoted by * with node-numbers below and left of each node.
229  //E0, E1 and so on are element-numbers.
230  //
231  //Each processor will contribute a sub-matrix of size 4x4, filled with 1's,
232  //for each element. Thus, the coefficient value at position 0,0 should end up
233  //being 1.0*numProcs, the value at position 4,4 should be 1.0*4*numProcs, etc.
234  //
235  //Depending on the number of processors being used, the locations of the
236  //specific matrix positions (in terms of which processor owns them) will vary.
237  //
238 
239  int numProcs = Comm.NumProc();
240 
241  long long numNodes = 9;
242  int numElems = 4;
243  int numNodesPerElem = 4;
244 
245  long long indexBase = 0;
246 
247  //Create a map using epetra-defined linear distribution.
248  Epetra_Map map(numNodes, indexBase, Comm);
249 
250  Epetra_FECrsGraph* graph = NULL;
251 
252  long long* nodes = new long long[numNodesPerElem];
253  int i, err = 0;
254 
255  if (preconstruct_graph) {
256  graph = new Epetra_FECrsGraph(Copy, map, 1);
257 
258  //we're going to fill the graph with indices, by passing our
259  //connectivity lists.
260  //FECrsGraph should accept indices in all rows, regardless of
261  //whether map.MyGID(row) is true.
262 
263  for(i=0; i<numElems; ++i) {
264  switch(i) {
265  case 0:
266  nodes[0] = 0; nodes[1] = 1; nodes[2] = 4; nodes[3] = 3;
267  break;
268  case 1:
269  nodes[0] = 1; nodes[1] = 2; nodes[2] = 5; nodes[3] = 4;
270  break;
271  case 2:
272  nodes[0] = 3; nodes[1] = 4; nodes[2] = 7; nodes[3] = 6;
273  break;
274  case 3:
275  nodes[0] = 4; nodes[1] = 5; nodes[2] = 8; nodes[3] = 7;
276  break;
277  }
278 
279  err = graph->InsertGlobalIndices(numNodesPerElem, nodes,
280  numNodesPerElem, nodes);
281  if (err < 0) {
282  std::cerr << "ERROR, FECrsGraph error in InsertGlobalIndices, err="
283  << err << std::endl;
284  return(-1);
285  }
286  }
287 
288  EPETRA_CHK_ERR( graph->GlobalAssemble() );
289  }
290 
291  Epetra_FECrsMatrix* A = NULL;
292 
293  if (preconstruct_graph) {
294  A = new Epetra_FECrsMatrix(Copy, *graph);
295  }
296  else {
297  A = new Epetra_FECrsMatrix(Copy, map, 1);
298  }
299 
300  EPETRA_CHK_ERR( A->PutScalar(0.0) );
301 
302  double* values_1d = new double[numNodesPerElem*numNodesPerElem];
303  double** values_2d = new double*[numNodesPerElem];
304 
305  for(i=0; i<numNodesPerElem*numNodesPerElem; ++i) values_1d[i] = 1.0;
306 
307  int offset = 0;
308  for(i=0; i<numNodesPerElem; ++i) {
309  values_2d[i] = &(values_1d[offset]);
310  offset += numNodesPerElem;
311  }
312 
313  int format = Epetra_FECrsMatrix::ROW_MAJOR;
314  Epetra_LongLongSerialDenseVector epetra_nodes(View, nodes, numNodesPerElem);
315  Epetra_SerialDenseMatrix epetra_values(View, values_1d, numNodesPerElem,
316  numNodesPerElem, numNodesPerElem);
317 
318  for(i=0; i<numElems; ++i) {
319  switch(i) {
320  case 0:
321  nodes[0] = 0; nodes[1] = 1; nodes[2] = 4; nodes[3] = 3;
322  if (preconstruct_graph) {
323  err = A->SumIntoGlobalValues(epetra_nodes,
324  epetra_values, format);
325  if (err<0) return(err);
326  }
327  else {
328  err = A->InsertGlobalValues(epetra_nodes,
329  epetra_values, format);
330  if (err<0) return(err);
331  }
332  break;
333 
334  case 1:
335  nodes[0] = 1; nodes[1] = 2; nodes[2] = 5; nodes[3] = 4;
336  if (preconstruct_graph) {
337  err = A->SumIntoGlobalValues(numNodesPerElem, nodes,
338  values_2d, format);
339  if (err<0) return(err);
340  }
341  else {
342  err = A->InsertGlobalValues(numNodesPerElem, nodes,
343  values_2d, format);
344  if (err<0) return(err);
345  }
346  break;
347 
348  case 2:
349  nodes[0] = 3; nodes[1] = 4; nodes[2] = 7; nodes[3] = 6;
350  if (preconstruct_graph) {
351  err = A->SumIntoGlobalValues(numNodesPerElem, nodes,
352  numNodesPerElem, nodes,
353  values_1d, format);
354  if (err<0) return(err);
355  }
356  else {
357  err = A->InsertGlobalValues(numNodesPerElem, nodes,
358  numNodesPerElem, nodes,
359  values_1d, format);
360  if (err<0) return(err);
361  }
362  break;
363 
364  case 3:
365  nodes[0] = 4; nodes[1] = 5; nodes[2] = 8; nodes[3] = 7;
366  if (preconstruct_graph) {
367  err = A->SumIntoGlobalValues(numNodesPerElem, nodes,
368  numNodesPerElem, nodes,
369  values_2d, format);
370  if (err<0) return(err);
371  }
372  else {
373  err = A->InsertGlobalValues(numNodesPerElem, nodes,
374  numNodesPerElem, nodes,
375  values_2d, format);
376  if (err<0) return(err);
377  }
378  break;
379  }
380  }
381 
382  err = A->GlobalAssemble();
383  if (err < 0) {
384  return(err);
385  }
386 
387  Epetra_Vector x(A->RowMap()), y(A->RowMap());
388 
389  x.PutScalar(1.0); y.PutScalar(0.0);
390 
391  Epetra_FECrsMatrix Acopy(*A);
392 
393  Epetra_Vector x2(Acopy.RowMap()), y2(Acopy.RowMap());
394 
395  x2.PutScalar(1.0); y2.PutScalar(0.0);
396 
397  A->Multiply(false, x, y);
398 
399  Acopy.Multiply(false, x2, y2);
400 
401  double ynorm2, y2norm2;
402 
403  y.Norm2(&ynorm2);
404  y2.Norm2(&y2norm2);
405  if (ynorm2 != y2norm2) {
406  std::cerr << "norm2(A*ones) != norm2(Acopy*ones)"<<std::endl;
407  return(-99);
408  }
409 
410  err = Acopy.GlobalAssemble();
411  if (err < 0) {
412  return(err);
413  }
414 
415  if (verbose) {
416  std::cout << "A:"<<std::endl<<*A << std::endl;
417  std::cout << "Acopy:"<<std::endl<<Acopy << std::endl;
418  }
419 
420  Epetra_FECrsMatrix Acopy2(Copy, A->RowMap(), A->ColMap(), 1);
421 
422  Acopy2 = Acopy;
423 
424  Epetra_Vector x3(Acopy.RowMap()), y3(Acopy.RowMap());
425 
426  x3.PutScalar(1.0); y3.PutScalar(0.0);
427 
428  Acopy2.Multiply(false, x3, y3);
429 
430  double y3norm2;
431  y3.Norm2(&y3norm2);
432 
433  if (y3norm2 != y2norm2) {
434  std::cerr << "norm2(Acopy*ones) != norm2(Acopy2*ones)"<<std::endl;
435  return(-999);
436  }
437 
438  int len = 20;
439  long long* indices = new long long[len];
440  double* values = new double[len];
441  int numIndices;
442 
443  if (map.MyGID(0)) {
444  EPETRA_CHK_ERR( A->ExtractGlobalRowCopy(0, len, numIndices,
445  values, indices) );
446  if (numIndices != 4) {
447  return(-1);
448  }
449  if (indices[0] != 0) {
450  return(-2);
451  }
452 
453  if (values[0] != 1.0*numProcs) {
454  std::cout << "ERROR: values[0] ("<<values[0]<<") should be "<<numProcs<<std::endl;
455  return(-3);
456  }
457  }
458 
459  if (map.MyGID(4)) {
460  EPETRA_CHK_ERR( A->ExtractGlobalRowCopy(4, len, numIndices,
461  values, indices) );
462 
463  if (numIndices != 9) {
464  return(-4);
465  }
466  int lcid = A->LCID(4);
467  if (lcid<0) {
468  return(-5);
469  }
470  if (values[lcid] != 4.0*numProcs) {
471  std::cout << "ERROR: values["<<lcid<<"] ("<<values[lcid]<<") should be "
472  <<4*numProcs<<std::endl;
473  return(-6);
474  }
475  }
476 
477 // now let's do the checks for Acopy...
478 
479  if (map.MyGID(0)) {
480  EPETRA_CHK_ERR( Acopy.ExtractGlobalRowCopy(0, len, numIndices,
481  values, indices) );
482  if (numIndices != 4) {
483  return(-1);
484  }
485  if (indices[0] != 0) {
486  return(-2);
487  }
488 
489  if (values[0] != 1.0*numProcs) {
490  std::cout << "ERROR: Acopy.values[0] ("<<values[0]<<") should be "<<numProcs<<std::endl;
491  return(-3);
492  }
493  }
494 
495  if (map.MyGID(4)) {
496  EPETRA_CHK_ERR( Acopy.ExtractGlobalRowCopy(4, len, numIndices,
497  values, indices) );
498 
499  if (numIndices != 9) {
500  return(-4);
501  }
502  int lcid = A->LCID(4);
503  if (lcid<0) {
504  return(-5);
505  }
506  if (values[lcid] != 4.0*numProcs) {
507  std::cout << "ERROR: Acopy.values["<<lcid<<"] ("<<values[lcid]<<") should be "
508  <<4*numProcs<<std::endl;
509  return(-6);
510  }
511  }
512 
513 // now let's do the checks for Acopy2...
514 
515  if (map.MyGID(0)) {
516  EPETRA_CHK_ERR( Acopy2.ExtractGlobalRowCopy(0, len, numIndices,
517  values, indices) );
518  if (numIndices != 4) {
519  return(-1);
520  }
521  if (indices[0] != 0) {
522  return(-2);
523  }
524 
525  if (values[0] != 1.0*numProcs) {
526  std::cout << "ERROR: Acopy2.values[0] ("<<values[0]<<") should be "<<numProcs<<std::endl;
527  return(-3);
528  }
529  }
530 
531  if (map.MyGID(4)) {
532  EPETRA_CHK_ERR( Acopy2.ExtractGlobalRowCopy(4, len, numIndices,
533  values, indices) );
534 
535  if (numIndices != 9) {
536  return(-4);
537  }
538  int lcid = A->LCID(4);
539  if (lcid<0) {
540  return(-5);
541  }
542  if (values[lcid] != 4.0*numProcs) {
543  std::cout << "ERROR: Acopy2.values["<<lcid<<"] ("<<values[lcid]<<") should be "
544  <<4*numProcs<<std::endl;
545  return(-6);
546  }
547  }
548 
549  delete [] values_2d;
550  delete [] values_1d;
551  delete [] nodes;
552  delete [] indices;
553  delete [] values;
554 
555  delete A;
556  delete graph;
557 
558  return(0);
559 }
560 
561 int Young1(const Epetra_Comm& Comm, bool verbose)
562 {
563  //This is a test case submitted by Joe Young with bug 2421. It runs
564  //only on 2 processors.
565  if (Comm.NumProc() != 2) {
566  return(0);
567  }
568 
569  // Give rows 0-2 to proc 0 and 3-5 to proc 1
570  long long RowIndices[3];
571  if (Comm.MyPID() == 0) {
572  RowIndices[0] = 0;
573  RowIndices[1] = 1;
574  RowIndices[2] = 2;
575  } else {
576  RowIndices[0] = 3;
577  RowIndices[1] = 4;
578  RowIndices[2] = 5;
579  }
580  Epetra_Map RangeMap((long long) -1, 3, RowIndices, 0LL, Comm);
581  Epetra_Map & RowMap = RangeMap;
582 
583  // Define a second map that gives col 0 to proc 0 and col 1 to proc 1
584  long long ColIndices[1];
585  if (Comm.MyPID() == 0) {
586  ColIndices[0] = 0;
587  }
588  else {
589  ColIndices[0] = 1;
590  }
591  Epetra_Map DomainMap((long long) -1, 1, ColIndices, 0LL, Comm);
592 
593  // Construct a graph where both processors only insert into local
594  // elements
595  Epetra_FECrsGraph BrokenGraph(Copy, RowMap, 2);
596  for (int i = 0; i < RangeMap.NumMyElements(); i++) {
597  long long ig = RowIndices[i];
598  long long jgs[2] = { 0, 1 };
599  BrokenGraph.InsertGlobalIndices(1, &ig, 2, jgs);
600  }
601  BrokenGraph.GlobalAssemble(DomainMap, RangeMap);
602 
603  // Check the size of the matrix that would be created from the graph
604  long long numCols1 = BrokenGraph.NumGlobalCols64();
605  if (verbose) {
606  std::cout << "Number of global rows in the graph where only "
607  "local elements were inserted: " << BrokenGraph.NumGlobalRows64()
608  << std::endl;
609  std::cout << "Number of global cols in the graph where only "
610  "local elements were inserted: " << BrokenGraph.NumGlobalCols64()
611  << std::endl;
612  }
613  // Construct a graph where both processors insert into global elements
614  Epetra_FECrsGraph Graph(Copy, RowMap, 2);
615  for (int i = 0; i < 6; i++) {
616  long long ig = i;
617  long long jgs[2] = { 0, 1 };
618  Graph.InsertGlobalIndices(1, &ig, 2, jgs);
619  }
620  Graph.GlobalAssemble(DomainMap, RangeMap);
621 
622  // Check the size of the matrix that would be created from the graph
623  long long numCols2 = Graph.NumGlobalCols64();
624  if (verbose) {
625  std::cout << "Number of global rows in the graph where "
626  "global elements were inserted: " << Graph.NumGlobalRows64()
627  << std::endl;
628  std::cout << "Number of global cols in the graph where "
629  "global elements were inserted: " << Graph.NumGlobalCols64()
630  << std::endl;
631  }
632 
633  if (numCols1 != numCols2) return(-1);
634  return(0);
635 }
636 
637 int rectangular(const Epetra_Comm& Comm, bool verbose)
638 {
639  int mypid = Comm.MyPID();
640  int numlocalrows = 3;
641  Epetra_Map rowmap((long long) -1, numlocalrows, 0LL, Comm);
642 
643  long long numglobalrows = numlocalrows*Comm.NumProc();
644 
645  long long numcols = 2*numglobalrows;
646 
647  Epetra_FECrsGraph fegraph(Copy, rowmap, numcols);
648 
649  long long* cols = new long long[numcols];
650  for(int j=0; j<numcols; ++j) cols[j] = j;
651 
652  Epetra_Map domainmap((long long) -1, numcols, 0LL, Comm);
653 
654  long long firstlocalrow = numlocalrows*mypid;
655  long long lastlocalrow = numlocalrows*(mypid+1)-1;
656 
657  for(long long i=0; i<numglobalrows; ++i) {
658  //if i is a local row, then skip it. We want each processor to only
659  //load rows that belong on other processors.
660  if (i >= firstlocalrow && i <= lastlocalrow) continue;
661 
662  EPETRA_CHK_ERR( fegraph.InsertGlobalIndices(1, &i, numcols, &(cols[0])) );
663  }
664 
665  EPETRA_CHK_ERR( fegraph.GlobalAssemble(domainmap, rowmap) );
666 
667  if (verbose) {
668  std::cout << "********************** fegraph **********************" << std::endl;
669  std::cout << fegraph << std::endl;
670  }
671 
672  delete [] cols;
673 
674  return(0);
675 }
676 
Epetra_Map: A class for partitioning vectors and matrices.
Definition: Epetra_Map.h:119
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...
long long NumGlobalRows64() const
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)
long long NumGlobalCols64() const
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.
Epetra_Comm: The Epetra Communication Abstract Base Class.
Definition: Epetra_Comm.h:73
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 ...
Epetra_LongLongSerialDenseVector: A class for constructing and using dense vectors.
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)