FEI Version of the Day
DataReader.hpp
00001 #ifndef _DataReader_h_
00002 #define _DataReader_h_
00003 
00004 /*--------------------------------------------------------------------*/
00005 /*    Copyright 2005 Sandia Corporation.                              */
00006 /*    Under the terms of Contract DE-AC04-94AL85000, there is a       */
00007 /*    non-exclusive license for use of this work by or on behalf      */
00008 /*    of the U.S. Government.  Export of this program may require     */
00009 /*    a license from the United States Government.                    */
00010 /*--------------------------------------------------------------------*/
00011 
00012 #include <test_utils/BCNodeSet.hpp>
00013 #include <test_utils/CRSet.hpp>
00014 #include <test_utils/CommNodeSet.hpp>
00015 #include <test_utils/ElemBlock.hpp>
00016 #include <test_utils/AccessPattern.hpp>
00017 #include <test_utils/CoefAccess.hpp>
00018 #include <fei_iostream.hpp>
00019 #include <string>
00020 
00021 class DataReader {
00022  public:
00023   DataReader();
00024   ~DataReader();
00025 
00026   int readData(const char* fileName);
00027 
00028   int solveType_;
00029 
00030   std::string solverLibraryName_;
00031   std::string solnFileName_;
00032   std::string checkFileName_;
00033 
00034   int numFields_;
00035   int* fieldIDs_;
00036   int* fieldSizes_;
00037 
00038   int numParams_;
00039   char** paramStrings_;
00040 
00041   int numElemBlocks_;
00042   ElemBlock* elemBlocks_; //list of length numElemBlocks_
00043 
00044   int numCoefAccessPatterns_;
00045   AccessPattern* accessPatterns_;
00046 
00047   int numCoefAccesses_;
00048   CoefAccess* coefAccesses_;
00049 
00050   int numCRMultSets_;
00051   CRSet* crMultSets_;
00052 
00053   int numSlaveVars_;
00054   CRSet* slaveVars_;
00055 
00056    int numCRPenSets_;
00057    CRSet* crPenSets_;
00058 
00059    int numBCNodeSets_;
00060    BCNodeSet* bcNodeSets_;
00061 
00062    int numSharedNodeSets_;
00063    CommNodeSet* sharedNodeSets_;
00064 
00065    int getFieldSize(int fieldID);
00066 
00067    static int getKeyword(FEI_ISTREAM* instr, char*& keyword);
00068    void readData(FEI_ISTREAM* instr, char* keyword);
00069    static void readData(FEI_ISTREAM* instr, int& n);
00070    static void readData(FEI_ISTREAM* instr, double& val);
00071 
00072    static int is_reg_char(char c);
00073    static int skipWhite(FEI_ISTREAM* instr);
00074 
00075  private:
00076    void deleteMemory();
00077 
00078    bool numFieldsRead_;
00079    bool numElemBlocksRead_;
00080    int currentElemBlockIndex_;
00081    int currentElemIndex_;
00082 
00083    int currentShIndex_;
00084    int currentExtIndex_;
00085    int currentBCIndex_;
00086 };
00087 
00088 #endif
00089 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends