Epetra Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
test/FEVector/cxx_main.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 // Epetra_FEVector Test routine
44 
45 #include "Epetra_Time.h"
46 #include "Epetra_BlockMap.h"
47 #include "Epetra_FEVector.h"
48 #include "ExecuteTestProblems.h"
49 #include "../src/Epetra_test_functions.h"
50 #include "Epetra_Comm.h"
51 #include "../epetra_test_err.h"
52 #include "Epetra_Version.h"
53 
54 int main(int argc, char *argv[]) {
55 
56  int ierr = 0;
57 
58  //epetra_test::create_comm initializes mpi if EPETRA_MPI is defined
59  Epetra_Comm* epetra_comm = epetra_test::create_comm(argc, argv);
60  Epetra_Comm& Comm = *epetra_comm;
61 
62  int NumProc = Comm.NumProc();
63 
64  bool verbose =
66 
67  if (verbose) cout << Epetra_Version() << endl << endl;
68 
69  int NumVectors = 1;
70  int NumMyElements = 4;
71  int NumGlobalElements = NumMyElements*NumProc;
72  int IndexBase = 0;
73  int ElementSize = 1;
74 
75  Epetra_BlockMap BlockMap(NumGlobalElements, NumMyElements,
76  ElementSize, IndexBase, Comm);
77  BlockMap.SetTracebackMode(0); // This should shut down any error tracing
78 
79  EPETRA_TEST_ERR(MultiVectorTests(BlockMap, NumVectors, verbose),ierr);
80 
81  Comm.Barrier();
82  if (verbose)cout << endl;
83  Comm.Barrier();
84 
85  EPETRA_TEST_ERR( fevec0(Comm, verbose), ierr);
86 
87  Comm.Barrier();
88  if (verbose)cout << endl;
89  Comm.Barrier();
90 
91  EPETRA_TEST_ERR( fevec1(Comm, verbose), ierr);
92 
93  Comm.Barrier();
94  if (verbose)cout << endl;
95  Comm.Barrier();
96 
97  EPETRA_TEST_ERR( fevec2(Comm, verbose), ierr);
98 
99  Comm.Barrier();
100  if (verbose)cout << endl;
101  Comm.Barrier();
102 
103  EPETRA_TEST_ERR( fevec3(Comm, verbose), ierr);
104 
105  Comm.Barrier();
106  if (verbose)cout << endl;
107  Comm.Barrier();
108 
109  EPETRA_TEST_ERR( fevec4(Comm, verbose), ierr);
110 
111  Comm.Barrier();
112  if (verbose)cout << endl;
113  Comm.Barrier();
114 
115  EPETRA_TEST_ERR( fevec5(Comm, verbose), ierr);
116 
117  Comm.Barrier();
118  if (verbose)cout << endl;
119  Comm.Barrier();
120 
121  EPETRA_TEST_ERR( fevec6(Comm, verbose), ierr);
122 
123  Comm.Barrier();
124  if (verbose)cout << endl;
125  Comm.Barrier();
126 
127  EPETRA_TEST_ERR( fevec7(Comm, verbose), ierr);
128  delete epetra_comm;
129 
130 #ifdef EPETRA_MPI
131  MPI_Finalize();
132 #endif
133 
134  return ierr;
135 }
136 
int fevec1(Epetra_Comm &Comm, bool verbose)
Epetra_Comm * create_comm(int argc, char **argv)
If macro EPETRA_MPI is defined, call MPI_Init and then return new Epetra_MpiComm. ...
#define EPETRA_TEST_ERR(a, b)
int fevec7(Epetra_Comm &Comm, bool verbose)
static void SetTracebackMode(int TracebackModeValue)
Set the value of the Epetra_Object error traceback report mode.
int fevec6(Epetra_Comm &Comm, bool verbose)
bool global_check_for_flag_on_proc_0(const char *flag, int numargs, char **strargs, const Epetra_Comm &comm)
Check through a list of C-style string arguments searching for a specified flag on proc 0...
std::string Epetra_Version()
virtual void Barrier() const =0
Epetra_Comm Barrier function.
int MultiVectorTests(const Epetra_Map &Map, int NumVectors, bool verbose)
Epetra_Comm: The Epetra Communication Abstract Base Class.
Definition: Epetra_Comm.h:73
int fevec5(Epetra_Comm &Comm, bool verbose)
Epetra_BlockMap: A class for partitioning block element vectors and matrices.
int fevec2(Epetra_Comm &Comm, bool verbose)
virtual int NumProc() const =0
Returns total number of processes.
int fevec0(Epetra_Comm &Comm, bool verbose)
int main(int argc, char *argv[])
int fevec3(Epetra_Comm &Comm, bool verbose)
int fevec4(Epetra_Comm &Comm, bool verbose)