FEI  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
snl_fei_tester.hpp
1 /*--------------------------------------------------------------------*/
2 /* Copyright 2005 Sandia Corporation. */
3 /* Under the terms of Contract DE-AC04-94AL85000, there is a */
4 /* non-exclusive license for use of this work by or on behalf */
5 /* of the U.S. Government. Export of this program may require */
6 /* a license from the United States Government. */
7 /*--------------------------------------------------------------------*/
8 
9 #ifndef _snl_fei_tester_h_
10 #define _snl_fei_tester_h_
11 
12 #include <fei_macros.hpp>
13 #include <fei_mpi.h>
14 #include <fei_SharedPtr.hpp>
15 
16 #include <test_utils/feitester.hpp>
17 #include <test_utils/DataReader.hpp>
18 
19 #include <fei_fwd.hpp>
20 
21 class snl_fei_tester : public feitester {
22  public:
23  snl_fei_tester(fei::SharedPtr<DataReader> data_reader,
24  MPI_Comm comm, int localProc, int numProcs);
25  ~snl_fei_tester();
26 
27  const char* getName()
28  {
29  static const char name[] = "snl_fei_tester";
30  return((const char*)name);
31  }
32 
33  int testInitialization();
34 
35  int testLoading();
36 
37  int testSolve();
38 
39  int testCheckResult();
40 
41  void dumpMatrixFiles();
42 
43  void setParameter(const char* param);
44 
45  private:
46  void defineFieldsAndIDTypes();
47  int initElemBlocks();
48  int loadElemBlocks();
49  int initConstraints();
50  int loadConstraints();
51  void definePattern(ElemBlock& eb, int& patternID);
52  int createLibraryInstance(const char* solverName);
53 
54  int save_block_node_soln(DataReader& data, fei::Vector* vec,
55  const char* solnFileName, int numProcs,
56  int localProc, int solveCounter);
57 
58  int save_block_elem_soln(DataReader& data, fei::Vector* vec,
59  const char* solnFileName,
60  int numProcs, int localProc, int solveCounter);
61 
62  int save_multiplier_soln(DataReader& data, fei::Vector* vec,
63  const char* solnFileName,
64  int numProcs, int localProc, int solveCounter);
65 
66  int checkSolution(int localProc, int numProcs,
67  const char* solnFileName, const char* checkFileName,
68  const char* extension, int solveCounter);
69 
70  MPI_Comm comm_;
71 
73 
76 
80 
82 
83  LinearSystemCore* linSysCore_;
84  FiniteElementData* feData_;
85 
87 
88  std::vector<int> idTypes_;
89  int numPatterns_;
90  int nodeTypeOffset_, elemTypeOffset_, constraintTypeOffset_;
91 
92  int localProc_, numProcs_;
93 };
94 
95 #endif // _snl_fei_tester_h_
virtual const char * getName()=0