9 #include <fei_macros.hpp>
12 #include <test_utils/test_Factory.hpp>
14 #include <test_utils/LibraryFactory.hpp>
16 #include <test_utils/test_VectorSpace.hpp>
17 #include <test_utils/test_MatrixGraph.hpp>
19 #include <fei_Factory.hpp>
20 #include <snl_fei_Factory.hpp>
22 #include <test_utils/test_Factory_helper.hpp>
24 #ifdef HAVE_FEI_AZTECOO
25 #include <fei_Aztec_LinSysCore.hpp>
28 #include <fei_Factory_Trilinos.hpp>
31 #define fei_file "test_Factory.cpp"
32 #include <fei_ErrMacros.hpp>
34 test_Factory::test_Factory(MPI_Comm comm)
39 test_Factory::~test_Factory()
43 int test_Factory::runtests()
47 if (localProc_==0) FEI_COUT <<
"constructing Factory_Trilinos...";
51 if (localProc_==0) FEI_COUT <<
"ok" << FEI_ENDL;
53 factory_test1(factory);
55 if (localProc_==0) FEI_COUT <<
"testing fei::Factory::clone..." << FEI_ENDL;
64 #ifdef HAVE_FEI_AZTECOO
67 if (localProc_==0) FEI_COUT <<
"constructing snl_fei::Factory(Aztec)...";
73 if (localProc_==0) FEI_COUT <<
"ok" << FEI_ENDL;
75 factory_test1(factory);
77 if (localProc_==0) FEI_COUT <<
"testing fei::Factory::clone..." << FEI_ENDL;
92 if (localProc_==0) FEI_COUT <<
" testing factory->createVectorSpace...";
97 if (vecspace.
get() == 0) {
98 FEI_COUT <<
"no"<<FEI_ENDL;
99 throw std::runtime_error(
"factory failed to create a fei::VectorSpace");
109 FEI_COUT <<
"no"<<FEI_ENDL;
110 throw std::runtime_error(
"vecspace->defineFields/getNumFields failed.");
113 if (localProc_==0) FEI_COUT <<
"ok"<<FEI_ENDL;
115 if (localProc_==0) FEI_COUT <<
" testing factory->createFEI...";
121 int err = fei->
initFields(1, &fieldSize, &fieldID);
123 FEI_COUT <<
"failed"<<FEI_ENDL;
124 throw std::runtime_error(
"fei->initFields() failed.");
127 int testFieldSize = -1;
129 if (err != 0 || testFieldSize != fieldSize) {
130 FEI_COUT <<
"failed"<<FEI_ENDL;
131 throw std::runtime_error(
"fei->getFieldSize() failed.");
134 if (localProc_==0) FEI_COUT <<
"ok"<<FEI_ENDL;
void defineFields(int numFields, const int *fieldIDs, const int *fieldSizes, const int *fieldTypes=NULL)
virtual fei::SharedPtr< VectorSpace > createVectorSpace(MPI_Comm, const char *name)
virtual int initFields(int numFields, const int *fieldSizes, const int *fieldIDs, const int *fieldTypes=NULL)=0
virtual int getFieldSize(int fieldID, int &numScalars)=0
virtual fei::SharedPtr< FEI > createFEI(fei::SharedPtr< LibraryWrapper > wrapper, MPI_Comm comm)