gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
HierarchicalBasisHcurlBrick.h
Go to the documentation of this file.
1 // Gmsh - Copyright (C) 1997-2022 C. Geuzaine, J.-F. Remacle
2 //
3 // See the LICENSE.txt file in the Gmsh root directory for license information.
4 // Please report all issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
5 //
6 // Contributed by Ismail Badia.
7 
8 // Reference : "Higher-Order Finite Element Methods"; Pavel Solin, Karel
9 // Segeth, Ivo Dolezel, Chapman and Hall/CRC; Edition : Har/Cdr (2003).
10 
11 #ifndef HIERARCHICAL_BASIS_HCURL_BRICK_H
12 #define HIERARCHICAL_BASIS_HCURL_BRICK_H
13 
14 #include <stdexcept>
15 #include "HierarchicalBasisHcurl.h"
16 
17 /*
18  * MHexahedron
19  *
20  * v
21  * 3----------2
22  * |\ ^ |\
23  * | \ | | \
24  * | \ | | \
25  * | 7------+---6
26  * | | +-- |-- | -> u
27  * 0---+---\--1 |
28  * \ | \ \ |
29  * \ | \ \ |
30  * \| w \|
31  * 4----------5
32  *
33  * Oriented Edges:
34  * e0={0, 1}, e1={0, 3}, e2={0, 4}, e3={1, 2}, e4 ={1, 5}, e5={3, 2},e6={2, 6},
35  * e7={3, 7},e8={4, 5}, e9= {4, 7}, e10={5, 6}, e11={7, 6}
36  *
37  * Oritented Surface:
38  * s0={0, 1, 3, 2}, s1={0, 1, 4, 5}, s2={0, 3, 4, 7},
39  * s3={1, 2, 5, 6}, s4={2, 3, 7, 6}, s5={4, 5, 7, 6}
40  * Local (directional) orders on mesh faces are not allowed to exceed the mini-
41  * mum of the (appropriate directional) orders of approximation associated with
42  * the interior of the adjacent elements. Local orders of approximation on mesh
43  * edges are limited by the minimum of all (appropriate directional) orders cor-
44  * responding to faces sharing that edge
45  */
47 public:
48  HierarchicalBasisHcurlBrick(int order);
50  virtual unsigned int getNumberOfOrientations() const;
51 
52  virtual void generateBasis(double const &u, double const &v, double const &w,
53  std::vector<std::vector<double> > &vertexBasis,
54  std::vector<std::vector<double> > &edgeBasis,
55  std::vector<std::vector<double> > &faceBasis,
56  std::vector<std::vector<double> > &bubbleBasis,
57  std::string typeFunction)
58  {
59  if(typeFunction == "HcurlLegendre") {
60  generateHcurlBasis(u, v, w, edgeBasis, faceBasis, bubbleBasis);
61  }
62  else if("CurlHcurlLegendre" == typeFunction) {
63  generateCurlBasis(u, v, w, edgeBasis, faceBasis, bubbleBasis);
64  }
65  else {
66  throw std::runtime_error("unknown typeFunction");
67  }
68  };
69  virtual void
70  orientEdge(int const &flagOrientation, int const &edgeNumber,
71  std::vector<std::vector<double> > &edgeBasis,
72  const std::vector<std::vector<double> > &eTablePositiveFlag,
73  const std::vector<std::vector<double> > &eTableNegativeFlag);
75  std::vector<std::vector<double> > &edgeFunctions);
76  virtual void orientFace(
77  int const &flag1, int const &flag2, int const &flag3, int const &faceNumber,
78  const std::vector<std::vector<double> > &quadFaceFunctionsAllOrientation,
79  const std::vector<std::vector<double> > &triFaceFunctionsAllOrientation,
80  std::vector<std::vector<double> > &fTableCopy);
81  virtual void getKeysInfo(std::vector<int> &functionTypeInfo,
82  std::vector<int> &orderInfo);
83 
84 private:
85  int _pb1; // bubble function order in direction u
86  int _pb2; // bubble function order in direction v
87  int _pb3; // bubble function order in direction w
88  int _pOrderEdge[12]; // Edge functions order (pOrderEdge[0] matches the order
89  // of the edge 0)
90  int _pOrderFace1[6]; // Face functions order in direction u (pOrderFace1[0]
91  // matches the order of face 0 in direction u)
92  int _pOrderFace2[6]; // Face functions order in direction v (pOrderFace[0]
93  // matches the order of face 0 in direction v)
94  static double
95  _affineCoordinate(const int &j, const double &u, const double &v,
96  const double &w); // affine coordinate lambdaj j=1..6
97 
98  // edgeBasis=[phie0_{0},...phie0_{pe0},phie1_{0},...phie1_{pe1}...]
99  // faceBasis=[phieFf1{n1,n2} (with 0<=n1<=pf1 , 2<=n2<=pf2+1), phieFf2{n1,n2}
100  // (with 2<=n1<=pf1+1 , 0<=n2<=pf2) ] bubbleBasis=[phieb1{n1,n2,n3} (with
101  // 0<=n1<=pb1 , 2<=n2<=pb2+1 , 2<=n3<=pb3+1)...]
102  virtual void
103  generateHcurlBasis(double const &u, double const &v, double const &w,
104  std::vector<std::vector<double> > &edgeBasis,
105  std::vector<std::vector<double> > &faceBasis,
106  std::vector<std::vector<double> > &bubbleBasis);
107  virtual void
108  generateCurlBasis(double const &u, double const &v, double const &w,
109  std::vector<std::vector<double> > &edgeBasis,
110  std::vector<std::vector<double> > &faceBasis,
111  std::vector<std::vector<double> > &bubbleBasis);
112  virtual void orientOneFace(double const &u, double const &v, double const &w,
113  int const &flag1, int const &flag2,
114  int const &flag3, int const &faceNumber,
115  std::vector<std::vector<double> > &faceFunctions,
116  std::string typeFunction);
117 };
118 #endif
HierarchicalBasisHcurl
Definition: HierarchicalBasisHcurl.h:16
HierarchicalBasisHcurlBrick::orientOneFace
virtual void orientOneFace(double const &u, double const &v, double const &w, int const &flag1, int const &flag2, int const &flag3, int const &faceNumber, std::vector< std::vector< double > > &faceFunctions, std::string typeFunction)
Definition: HierarchicalBasisHcurlBrick.cpp:311
HierarchicalBasisHcurlBrick::generateBasis
virtual void generateBasis(double const &u, double const &v, double const &w, std::vector< std::vector< double > > &vertexBasis, std::vector< std::vector< double > > &edgeBasis, std::vector< std::vector< double > > &faceBasis, std::vector< std::vector< double > > &bubbleBasis, std::string typeFunction)
Definition: HierarchicalBasisHcurlBrick.h:52
HierarchicalBasisHcurlBrick::getKeysInfo
virtual void getKeysInfo(std::vector< int > &functionTypeInfo, std::vector< int > &orderInfo)
Definition: HierarchicalBasisHcurlBrick.cpp:914
HierarchicalBasisHcurlBrick::generateHcurlBasis
virtual void generateHcurlBasis(double const &u, double const &v, double const &w, std::vector< std::vector< double > > &edgeBasis, std::vector< std::vector< double > > &faceBasis, std::vector< std::vector< double > > &bubbleBasis)
Definition: HierarchicalBasisHcurlBrick.cpp:56
HierarchicalBasisHcurlBrick::_pb2
int _pb2
Definition: HierarchicalBasisHcurlBrick.h:86
HierarchicalBasisHcurlBrick::generateCurlBasis
virtual void generateCurlBasis(double const &u, double const &v, double const &w, std::vector< std::vector< double > > &edgeBasis, std::vector< std::vector< double > > &faceBasis, std::vector< std::vector< double > > &bubbleBasis)
Definition: HierarchicalBasisHcurlBrick.cpp:631
HierarchicalBasisHcurlBrick::getNumberOfOrientations
virtual unsigned int getNumberOfOrientations() const
Definition: HierarchicalBasisHcurlBrick.cpp:35
HierarchicalBasisHcurlBrick::_pb3
int _pb3
Definition: HierarchicalBasisHcurlBrick.h:87
HierarchicalBasisHcurlBrick::orientFace
virtual void orientFace(int const &flag1, int const &flag2, int const &flag3, int const &faceNumber, const std::vector< std::vector< double > > &quadFaceFunctionsAllOrientation, const std::vector< std::vector< double > > &triFaceFunctionsAllOrientation, std::vector< std::vector< double > > &fTableCopy)
Definition: HierarchicalBasisHcurlBrick.cpp:607
HierarchicalBasisHcurlBrick::~HierarchicalBasisHcurlBrick
virtual ~HierarchicalBasisHcurlBrick()
Definition: HierarchicalBasisHcurlBrick.cpp:33
HierarchicalBasisHcurlBrick
Definition: HierarchicalBasisHcurlBrick.h:46
HierarchicalBasisHcurlBrick::_pOrderFace2
int _pOrderFace2[6]
Definition: HierarchicalBasisHcurlBrick.h:92
HierarchicalBasisHcurlBrick::orientEdge
virtual void orientEdge(int const &flagOrientation, int const &edgeNumber, std::vector< std::vector< double > > &edgeBasis, const std::vector< std::vector< double > > &eTablePositiveFlag, const std::vector< std::vector< double > > &eTableNegativeFlag)
Definition: HierarchicalBasisHcurlBrick.cpp:260
HierarchicalBasisHcurlBrick::_pOrderEdge
int _pOrderEdge[12]
Definition: HierarchicalBasisHcurlBrick.h:88
HierarchicalBasisHcurlBrick::_pb1
int _pb1
Definition: HierarchicalBasisHcurlBrick.h:85
HierarchicalBasisHcurlBrick::_pOrderFace1
int _pOrderFace1[6]
Definition: HierarchicalBasisHcurlBrick.h:90
HierarchicalBasisHcurlBrick::orientEdgeFunctionsForNegativeFlag
virtual void orientEdgeFunctionsForNegativeFlag(std::vector< std::vector< double > > &edgeFunctions)
Definition: HierarchicalBasisHcurlBrick.cpp:291
HierarchicalBasisHcurlBrick::HierarchicalBasisHcurlBrick
HierarchicalBasisHcurlBrick(int order)
Definition: HierarchicalBasisHcurlBrick.cpp:12
HierarchicalBasisHcurl.h
HierarchicalBasisHcurlBrick::_affineCoordinate
static double _affineCoordinate(const int &j, const double &u, const double &v, const double &w)
Definition: HierarchicalBasisHcurlBrick.cpp:40