FEI Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
fei_test_plugins.cpp
Go to the documentation of this file.
1 /*
2 // @HEADER
3 // ************************************************************************
4 // FEI: Finite Element Interface to Linear Solvers
5 // Copyright (2005) Sandia Corporation.
6 //
7 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the
8 // 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 Alan Williams (william@sandia.gov)
38 //
39 // ************************************************************************
40 // @HEADER
41 */
42 
43 
44 #include <fei_iostream.hpp>
45 
46 #include <fei_utils.hpp>
48 
52 
53 #include <fei_Factory_Trilinos.hpp>
54 
55 #undef fei_file
56 #define fei_file "fei_test_plugins.cpp"
57 #include <fei_ErrMacros.hpp>
58 
59 
60 //--------------------------------------------------
61 // main
62 //--------------------------------------------------
63 int main(int argc, char** argv) {
64 
65  int numProcs, localProc;
66  CHK_ERR( fei_test_utils::initialize_mpi(argc, argv, localProc, numProcs) );
67 
68  if (localProc == 0) {
69  FEI_COUT << "FEI version: " << fei::utils::version() << FEI_ENDL;
70  }
71 
73 
74  fei::ParameterSet pset;
75  pset.add(fei::Param("LPM_EpetraBasic", true));
76  factory->parameters(pset);
77 
79 
80  ftester.factory_test1(factory);
81 
82  test_Vector vtester(MPI_COMM_WORLD);
83 
84  fei::SharedPtr<fei::Vector> fei_vec = vtester.create_vector(factory);
85 
86  vtester.vector_test1(fei_vec);
87 
88  test_Matrix mtester(MPI_COMM_WORLD);
89 
90  fei::SharedPtr<fei::Matrix> fei_mat = mtester.create_matrix(factory);
91 
92  mtester.matrix_test1(fei_mat);
93 
94 #ifndef FEI_SER
95  if (MPI_Finalize() != MPI_SUCCESS) ERReturn(-1);
96 #endif
97 
98  return(0);
99 }
100 
#define FEI_COUT
#define MPI_COMM_WORLD
Definition: fei_mpi.h:58
virtual void parameters(const fei::ParameterSet &paramset)
Definition: fei_Factory.cpp:38
fei::SharedPtr< fei::Vector > create_vector(fei::SharedPtr< fei::Factory > factory)
Definition: test_Vector.cpp:58
fei::SharedPtr< fei::Matrix > create_matrix(fei::SharedPtr< fei::Factory > factory)
#define MPI_SUCCESS
Definition: fei_mpi.h:62
void add(const Param &param, bool maintain_unique_keys=true)
int initialize_mpi(int argc, char **argv, int &localProc, int &numProcs)
#define ERReturn(a)
#define FEI_ENDL
void vector_test1(fei::SharedPtr< fei::Vector > fei_vec)
Definition: test_Vector.cpp:80
int localProc(MPI_Comm comm)
void matrix_test1(fei::SharedPtr< fei::Matrix > mat)
const char * version()
Definition: fei_utils.hpp:53
#define CHK_ERR(a)
void factory_test1(fei::SharedPtr< fei::Factory > factory)
int main(int argc, char **argv)
Definition: beam.cpp:85
int numProcs(MPI_Comm comm)