00001 // *************************************************************** 00002 // GrdMeshBuilder3D version: 1.0 · date: 05/27/2008 00003 // ------------------------------------------------------------- 00004 // Kazimierz Michalik 00005 // ------------------------------------------------------------- 00006 // Copyright (C) 2008 - All Rights Reserved 00007 // *************************************************************** 00008 // 00009 // *************************************************************** 00010 #ifndef GrdMeshBuilder3D_h__ 00011 #define GrdMeshBuilder3D_h__ 00012 00013 #include "IMeshBuilder.h" 00014 00015 #include <fstream> 00016 #include <string> 00017 00018 class GrdMeshBuilder3D : 00019 public MeshRead::IMeshReader 00020 { 00021 public: 00022 GrdMeshBuilder3D( const char grdFileName[] ); 00023 ~GrdMeshBuilder3D(void); 00024 00027 bool Init() ; 00028 00031 virtual void Free(); 00032 00035 int GetCoordinatesDimension() const ; 00036 00039 int GetVerticesCount() ; 00040 00044 bool GetNextVertex(double coords[]) ; 00045 00048 int GetElementCount() ; 00049 00054 bool GetNextElement(int vertices[], int neighbours[]); 00055 00062 bool GetBoundaryConditions(double ** bc,int & bcCount); 00063 00064 protected: 00065 int getDim(const int n) const; 00066 00067 std::ifstream grid_file; 00068 std::string fileName; 00069 00070 int dimension; 00071 00072 int verticesCount; 00073 int readedVertices; 00074 00075 int elementsCount; 00076 int readedElements; 00077 }; 00078 #endif // GrdMeshBuilder3D_h__