Epetra Package Browser (Single Doxygen Collection) Development
test/FEVector/cxx_main.cpp
Go to the documentation of this file.
00001 //@HEADER
00002 // ************************************************************************
00003 //
00004 //               Epetra: Linear Algebra Services Package
00005 //                 Copyright 2011 Sandia Corporation
00006 //
00007 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00008 // the U.S. Government retains certain rights in this software.
00009 //
00010 // Redistribution and use in source and binary forms, with or without
00011 // modification, are permitted provided that the following conditions are
00012 // met:
00013 //
00014 // 1. Redistributions of source code must retain the above copyright
00015 // notice, this list of conditions and the following disclaimer.
00016 //
00017 // 2. Redistributions in binary form must reproduce the above copyright
00018 // notice, this list of conditions and the following disclaimer in the
00019 // documentation and/or other materials provided with the distribution.
00020 //
00021 // 3. Neither the name of the Corporation nor the names of the
00022 // contributors may be used to endorse or promote products derived from
00023 // this software without specific prior written permission.
00024 //
00025 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
00026 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00028 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
00029 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00030 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00031 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00032 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00033 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00034 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00035 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00036 //
00037 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
00038 //
00039 // ************************************************************************
00040 //@HEADER
00041 
00042 
00043 // Epetra_FEVector Test routine
00044 
00045 #include "Epetra_Time.h"
00046 #include "Epetra_BlockMap.h"
00047 #include "Epetra_FEVector.h"
00048 #include "ExecuteTestProblems.h"
00049 #include "../src/Epetra_test_functions.h"
00050 #include "Epetra_Comm.h"
00051 #include "../epetra_test_err.h"
00052 #include "Epetra_Version.h"
00053 
00054 int main(int argc, char *argv[]) {
00055 
00056   int ierr = 0;
00057 
00058   //epetra_test::create_comm initializes mpi if EPETRA_MPI is defined
00059   Epetra_Comm* epetra_comm = epetra_test::create_comm(argc, argv);
00060   Epetra_Comm& Comm = *epetra_comm;
00061 
00062   int NumProc = Comm.NumProc();
00063 
00064   bool verbose =
00065     epetra_test::global_check_for_flag_on_proc_0("-v",argc,argv, Comm);
00066 
00067   if (verbose) cout << Epetra_Version() << endl << endl;
00068 
00069   int NumVectors = 1;
00070   int NumMyElements = 4;
00071   int NumGlobalElements = NumMyElements*NumProc;
00072   int IndexBase = 0;
00073   int ElementSize = 1;
00074 
00075   Epetra_BlockMap BlockMap(NumGlobalElements, NumMyElements,
00076                            ElementSize, IndexBase, Comm);
00077   BlockMap.SetTracebackMode(0); // This should shut down any error tracing
00078 
00079   EPETRA_TEST_ERR(MultiVectorTests(BlockMap, NumVectors, verbose),ierr);
00080 
00081   Comm.Barrier();
00082   if (verbose)cout << endl;
00083   Comm.Barrier();
00084 
00085   EPETRA_TEST_ERR( fevec0(Comm, verbose), ierr);
00086 
00087   Comm.Barrier();
00088   if (verbose)cout << endl;
00089   Comm.Barrier();
00090 
00091   EPETRA_TEST_ERR( fevec1(Comm, verbose), ierr);
00092 
00093   Comm.Barrier();
00094   if (verbose)cout << endl;
00095   Comm.Barrier();
00096 
00097   EPETRA_TEST_ERR( fevec2(Comm, verbose), ierr);
00098 
00099   Comm.Barrier();
00100   if (verbose)cout << endl;
00101   Comm.Barrier();
00102 
00103   EPETRA_TEST_ERR( fevec3(Comm, verbose), ierr);
00104 
00105   Comm.Barrier();
00106   if (verbose)cout << endl;
00107   Comm.Barrier();
00108 
00109   EPETRA_TEST_ERR( fevec4(Comm, verbose), ierr);
00110 
00111   Comm.Barrier();
00112   if (verbose)cout << endl;
00113   Comm.Barrier();
00114 
00115   EPETRA_TEST_ERR( fevec5(Comm, verbose), ierr);
00116 
00117   Comm.Barrier();
00118   if (verbose)cout << endl;
00119   Comm.Barrier();
00120 
00121   EPETRA_TEST_ERR( fevec6(Comm, verbose), ierr);
00122 
00123   Comm.Barrier();
00124   if (verbose)cout << endl;
00125   Comm.Barrier();
00126 
00127   EPETRA_TEST_ERR( fevec7(Comm, verbose), ierr);
00128   delete epetra_comm;
00129 
00130 #ifdef EPETRA_MPI
00131   MPI_Finalize();
00132 #endif
00133 
00134   return ierr;
00135 }
00136 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines