MFEM  v3.1
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
geom.hpp
Go to the documentation of this file.
1 // Copyright (c) 2010, Lawrence Livermore National Security, LLC. Produced at
2 // the Lawrence Livermore National Laboratory. LLNL-CODE-443211. All Rights
3 // reserved. See file COPYRIGHT for details.
4 //
5 // This file is part of the MFEM library. For more information and source code
6 // availability see http://mfem.org.
7 //
8 // MFEM is free software; you can redistribute it and/or modify it under the
9 // terms of the GNU Lesser General Public License (as published by the Free
10 // Software Foundation) version 2.1 dated February 1999.
11 
12 #ifndef MFEM_GEOM
13 #define MFEM_GEOM
14 
15 #include "../config/config.hpp"
16 #include "../linalg/densemat.hpp"
17 #include "intrules.hpp"
18 
19 namespace mfem
20 {
21 
29 class Geometry
30 {
31 public:
33 
34  static const int NumGeom = 6;
35  static const int NumBdrArray[];
36  static const char *Name[NumGeom];
37  static const double Volume[NumGeom];
38 
39 private:
40  IntegrationRule *GeomVert[NumGeom];
41  IntegrationPoint GeomCenter[NumGeom];
42  DenseMatrix *PerfGeomToGeomJac[NumGeom];
43 
44 public:
45 
46  Geometry();
47 
48  ~Geometry();
49 
50  const IntegrationRule *GetVertices(int GeomType);
51  const IntegrationPoint &GetCenter(int GeomType)
52  { return GeomCenter[GeomType]; }
55  static void GetRandomPoint(int GeomType, IntegrationPoint &ip);
57  static bool CheckPoint(int GeomType, const IntegrationPoint &ip);
62  static bool ProjectPoint(int GeomType, const IntegrationPoint &beg,
63  IntegrationPoint &end);
64 
66  { return PerfGeomToGeomJac[GeomType]; }
67  void GetPerfPointMat(int GeomType, DenseMatrix &pm);
68  void JacToPerfJac(int GeomType, const DenseMatrix &J,
69  DenseMatrix &PJ) const;
70 
71  int NumBdr (int GeomType) { return NumBdrArray[GeomType]; }
72 };
73 
74 extern Geometry Geometries;
75 
77 {
78 public:
79  int Times, ETimes;
82 
83  RefinedGeometry (int NPts, int NRefG, int NRefE) :
84  RefPts (NPts), RefGeoms (NRefG), RefEdges (NRefE) { }
85 };
86 
88 {
89 private:
90  int type; // 0 - uniform points, otherwise - poly1d.ClosedPoints
93 public:
95 
96  void SetType(const int t) { type = t; }
97  RefinedGeometry *Refine (int Geom, int Times, int ETimes = 1);
98  const IntegrationRule *RefineInterior(int Geom, int Times);
99 
101 };
102 
103 extern GeometryRefiner GlobGeometryRefiner;
104 
105 }
106 
107 #endif
Class for integration rule.
Definition: intrules.hpp:83
RefinedGeometry(int NPts, int NRefG, int NRefE)
Definition: geom.hpp:83
static const int NumGeom
Definition: geom.hpp:34
void JacToPerfJac(int GeomType, const DenseMatrix &J, DenseMatrix &PJ) const
Definition: geom.cpp:428
static void GetRandomPoint(int GeomType, IntegrationPoint &ip)
Definition: geom.cpp:190
RefinedGeometry * Refine(int Geom, int Times, int ETimes=1)
Definition: geom.cpp:465
Data type dense matrix using column-major storage.
Definition: densemat.hpp:22
static const double Volume[NumGeom]
Definition: geom.hpp:37
static const int NumBdrArray[]
Definition: geom.hpp:35
Array< int > RefEdges
Definition: geom.hpp:81
const IntegrationPoint & GetCenter(int GeomType)
Definition: geom.hpp:51
const IntegrationRule * GetVertices(int GeomType)
Definition: geom.cpp:172
Geometry Geometries
Definition: geom.cpp:443
void SetType(const int t)
Definition: geom.hpp:96
const IntegrationRule * RefineInterior(int Geom, int Times)
Definition: geom.cpp:836
GeometryRefiner GlobGeometryRefiner
Definition: geom.cpp:914
IntegrationRule RefPts
Definition: geom.hpp:80
static const char * Name[NumGeom]
Definition: geom.hpp:36
static bool ProjectPoint(int GeomType, const IntegrationPoint &beg, IntegrationPoint &end)
Definition: geom.cpp:317
void GetPerfPointMat(int GeomType, DenseMatrix &pm)
Definition: geom.cpp:367
int NumBdr(int GeomType)
Definition: geom.hpp:71
DenseMatrix * GetPerfGeomToGeomJac(int GeomType)
Definition: geom.hpp:65
Class for integration point with weight.
Definition: intrules.hpp:25
static bool CheckPoint(int GeomType, const IntegrationPoint &ip)
Check if the given point is inside the given reference element.
Definition: geom.cpp:255
Array< int > RefGeoms
Definition: geom.hpp:81