MFEM v2.0
|
00001 // Copyright (c) 2010, Lawrence Livermore National Security, LLC. Produced at 00002 // the Lawrence Livermore National Laboratory. LLNL-CODE-443211. All Rights 00003 // reserved. See file COPYRIGHT for details. 00004 // 00005 // This file is part of the MFEM library. For more information and source code 00006 // availability see http://mfem.googlecode.com. 00007 // 00008 // MFEM is free software; you can redistribute it and/or modify it under the 00009 // terms of the GNU Lesser General Public License (as published by the Free 00010 // Software Foundation) version 2.1 dated February 1999. 00011 00012 #ifndef MFEM_GEOM 00013 #define MFEM_GEOM 00014 00022 class Geometry 00023 { 00024 public: 00025 enum Type { POINT, SEGMENT, TRIANGLE, SQUARE, TETRAHEDRON, CUBE }; 00026 00027 static const int NumGeom = 6; 00028 static const int NumBdrArray[]; 00029 static const char *Name[NumGeom]; 00030 00031 private: 00032 IntegrationRule *GeomVert[NumGeom]; 00033 IntegrationPoint GeomCenter[NumGeom]; 00034 DenseMatrix *PerfGeomToGeomJac[NumGeom]; 00035 00036 public: 00037 00038 Geometry(); 00039 00040 ~Geometry(); 00041 00042 const IntegrationRule *GetVertices(int GeomType); 00043 const IntegrationPoint &GetCenter(int GeomType) 00044 { return GeomCenter[GeomType]; } 00045 00046 DenseMatrix *GetPerfGeomToGeomJac(int GeomType) 00047 { return PerfGeomToGeomJac[GeomType]; } 00048 void GetPerfPointMat (int GeomType, DenseMatrix &pm); 00049 void JacToPerfJac(int GeomType, const DenseMatrix &J, 00050 DenseMatrix &PJ) const; 00051 00052 int NumBdr (int GeomType) { return NumBdrArray[GeomType]; } 00053 }; 00054 00055 extern Geometry Geometries; 00056 00057 class RefinedGeometry 00058 { 00059 public: 00060 int Times, ETimes; 00061 IntegrationRule RefPts; 00062 Array<int> RefGeoms, RefEdges; 00063 00064 RefinedGeometry (int NPts, int NRefG, int NRefE) : 00065 RefPts (NPts), RefGeoms (NRefG), RefEdges (NRefE) { } 00066 }; 00067 00068 class GeometryRefiner 00069 { 00070 private: 00071 int type; // 0 - uniform points, otherwise - poly1d.ClosedPoints 00072 RefinedGeometry *RGeom[Geometry::NumGeom]; 00073 IntegrationRule *IntPts[Geometry::NumGeom]; 00074 public: 00075 GeometryRefiner(); 00076 00077 void SetType(const int t) { type = t; } 00078 RefinedGeometry *Refine (int Geom, int Times, int ETimes = 1); 00079 const IntegrationRule *RefineInterior(int Geom, int Times); 00080 00081 ~GeometryRefiner(); 00082 }; 00083 00084 extern GeometryRefiner GlobGeometryRefiner; 00085 00086 #endif