FEI Version of the Day
Loading...
Searching...
No Matches
DataReader.hpp
1#ifndef _DataReader_h_
2#define _DataReader_h_
3
4/*--------------------------------------------------------------------*/
5/* Copyright 2005 Sandia Corporation. */
6/* Under the terms of Contract DE-AC04-94AL85000, there is a */
7/* non-exclusive license for use of this work by or on behalf */
8/* of the U.S. Government. Export of this program may require */
9/* a license from the United States Government. */
10/*--------------------------------------------------------------------*/
11
12#include <test_utils/BCNodeSet.hpp>
13#include <test_utils/CRSet.hpp>
14#include <test_utils/CommNodeSet.hpp>
15#include <test_utils/ElemBlock.hpp>
16#include <test_utils/AccessPattern.hpp>
17#include <test_utils/CoefAccess.hpp>
18#include <fei_iostream.hpp>
19#include <string>
20
21class DataReader {
22 public:
23 DataReader();
24 ~DataReader();
25
26 int readData(const char* fileName);
27
28 int solveType_;
29
30 std::string solverLibraryName_;
31 std::string solnFileName_;
32 std::string checkFileName_;
33
34 int numFields_;
35 int* fieldIDs_;
36 int* fieldSizes_;
37
38 int numParams_;
39 char** paramStrings_;
40
41 int numElemBlocks_;
42 ElemBlock* elemBlocks_; //list of length numElemBlocks_
43
44 int numCoefAccessPatterns_;
45 AccessPattern* accessPatterns_;
46
47 int numCoefAccesses_;
48 CoefAccess* coefAccesses_;
49
50 int numCRMultSets_;
51 CRSet* crMultSets_;
52
53 int numSlaveVars_;
54 CRSet* slaveVars_;
55
56 int numCRPenSets_;
57 CRSet* crPenSets_;
58
59 int numBCNodeSets_;
60 BCNodeSet* bcNodeSets_;
61
62 int numSharedNodeSets_;
63 CommNodeSet* sharedNodeSets_;
64
65 int getFieldSize(int fieldID);
66
67 static int getKeyword(FEI_ISTREAM* instr, char*& keyword);
68 void readData(FEI_ISTREAM* instr, char* keyword);
69 static void readData(FEI_ISTREAM* instr, int& n);
70 static void readData(FEI_ISTREAM* instr, double& val);
71
72 static int is_reg_char(char c);
73 static int skipWhite(FEI_ISTREAM* instr);
74
75 private:
76 void deleteMemory();
77
78 bool numFieldsRead_;
79 bool numElemBlocksRead_;
80 int currentElemBlockIndex_;
81 int currentElemIndex_;
82
83 int currentShIndex_;
84 int currentExtIndex_;
85 int currentBCIndex_;
86};
87
88#endif
89