test/FEVbrMatrix/cxx_main.cpp

Go to the documentation of this file.
00001 //@HEADER
00002 // ************************************************************************
00003 // 
00004 //               Epetra: Linear Algebra Services Package 
00005 //                 Copyright (2001) Sandia Corporation
00006 // 
00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00008 // license for use of this work by or on behalf of the U.S. Government.
00009 // 
00010 // This library is free software; you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as
00012 // published by the Free Software Foundation; either version 2.1 of the
00013 // License, or (at your option) any later version.
00014 //  
00015 // This library is distributed in the hope that it will be useful, but
00016 // WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //  
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the Free Software
00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00023 // USA
00024 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00025 // 
00026 // ************************************************************************
00027 //@HEADER
00028 
00029 // Epetra_FEVbrMatrix Test program
00030 
00031 #include "Epetra_ConfigDefs.h"
00032 
00033 #include "Epetra_Map.h"
00034 #include "ExecuteTestProblems.h"
00035 
00036 #ifdef EPETRA_MPI
00037 #include "Epetra_MpiComm.h"
00038 #else
00039 #include "Epetra_SerialComm.h"
00040 #endif
00041 
00042 #include "../epetra_test_err.h"
00043 #include "Epetra_Version.h"
00044 
00045 int main(int argc, char *argv[]) {
00046 
00047   int ierr = 0;
00048 
00049 #ifdef EPETRA_MPI
00050 
00051   // Initialize MPI
00052 
00053   MPI_Init(&argc,&argv);
00054 
00055   Epetra_MpiComm Comm(MPI_COMM_WORLD);
00056 
00057 #else
00058 
00059   Epetra_SerialComm Comm;
00060 
00061 #endif
00062 
00063   bool verbose = false;
00064 
00065   // Check if we should print results to standard out
00066   if (argc>1) if (argv[1][0]=='-' && argv[1][1]=='v') verbose = true;
00067 
00068   int verbose_int = verbose ? 1 : 0;
00069   Comm.Broadcast(&verbose_int, 1, 0);
00070   verbose = verbose_int==1 ? true : false;
00071 
00072   int MyPID = Comm.MyPID();
00073   int NumProc = Comm.NumProc(); 
00074 
00075   if (verbose && MyPID==0)
00076     cout << Epetra_Version() << endl << endl;
00077 
00078   if (verbose) cout << Comm <<endl;
00079 
00080   int NumVectors = 1;
00081   int NumMyElements = 4;
00082   int NumGlobalElements = NumMyElements*NumProc;
00083   int IndexBase = 0;
00084 
00085   Epetra_Map Map(NumGlobalElements, NumMyElements, IndexBase, Comm);
00086 
00087   EPETRA_TEST_ERR( quad1(Map, verbose), ierr);
00088 
00089   EPETRA_TEST_ERR( quad2(Map, verbose), ierr);
00090 
00091   EPETRA_TEST_ERR( MultiVectorTests(Map, NumVectors, verbose), ierr);
00092 
00093   bool preconstruct_graph = false;
00094 
00095   EPETRA_TEST_ERR( four_quads(Comm, preconstruct_graph, verbose), ierr);
00096 
00097   preconstruct_graph = true;
00098 
00099   EPETRA_TEST_ERR( four_quads(Comm, preconstruct_graph, verbose), ierr);
00100 
00101 #ifdef EPETRA_MPI
00102   MPI_Finalize();
00103 #endif
00104 
00105   return ierr;
00106 }
00107 

Generated on Wed May 12 21:41:04 2010 for Epetra Package Browser (Single Doxygen Collection) by  doxygen 1.4.7