gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
HierarchicalBasisHcurlQuad.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_QUAD_H
12 #define HIERARCHICAL_BASIS_HCURL_QUAD_H
13 
14 #include <stdexcept>
15 #include "HierarchicalBasisHcurl.h"
16 
17 /*
18  *
19  * v
20  * ^
21  * |+1
22  * 3<----------2
23  * | | ^
24  * | | |
25  * -1| +---- |+1 --> u
26  * | |
27  * v |
28  * 0---------->1
29  * -1
30  *
31  * Oriented Edges:
32  * e0={v0;v1} e1={v1;v2} e2={v2;v3} e3={v3;v4}
33  * pe3,pe1<=pf2 pe0,pe2<=pf1
34  *
35  */
37 public:
38  HierarchicalBasisHcurlQuad(int order);
40  virtual unsigned int getNumberOfOrientations() const;
41  virtual void generateBasis(double const &u, double const &v, double const &w,
42  std::vector<std::vector<double> > &vertexBasis,
43  std::vector<std::vector<double> > &edgeBasis,
44  std::vector<std::vector<double> > &faceBasis,
45  std::vector<std::vector<double> > &bubbleBasis,
46  std::string typeFunction)
47  {
48  if(typeFunction == "HcurlLegendre") {
49  generateHcurlBasis(u, v, w, edgeBasis, faceBasis, bubbleBasis);
50  }
51  else if("CurlHcurlLegendre" == typeFunction) {
52  generateCurlBasis(u, v, w, edgeBasis, faceBasis, bubbleBasis);
53  }
54  else {
55  throw std::runtime_error("unknown typeFunction");
56  }
57  };
58  virtual void
59  orientEdge(int const &flagOrientation, int const &edgeNumber,
60  std::vector<std::vector<double> > &edgeBasis,
61  const std::vector<std::vector<double> > &eTablePositiveFlag,
62  const std::vector<std::vector<double> > &eTableNegativeFlag);
63 
65  std::vector<std::vector<double> > &edgeFunctions);
66  virtual void orientFace(
67  int const &flag1, int const &flag2, int const &flag3, int const &faceNumber,
68  const std::vector<std::vector<double> > &quadFaceFunctionsAllOrientation,
69  const std::vector<std::vector<double> > &triFaceFunctionsAllOrientation,
70  std::vector<std::vector<double> > &fTableCopy);
71 
72  virtual void getKeysInfo(std::vector<int> &functionTypeInfo,
73  std::vector<int> &orderInfo);
74 
75 private:
76  int _pf1; // face function order in direction u
77  int _pf2; // face function order in direction v
78  int _pOrderEdge[4]; // Edge functions order (pOrderEdge[0] matches the edge 0
79  // order)
80  static double
81  _affineCoordinate(int const &j, double const &u,
82  double const &v); // affine coordinate lambdaj j=1..4
83  // edgeBasis=[phie0_{0},...phie0_{pe0},phie1_{0},...phie1_{pe1}...]
84  // faceBasis=[phieFf1{n1,n2} (with 0<=n1<=pf1 , 2<=n2<=pf2+1), phieFf2{n1,n2}
85  // (with 2<=n1<=pf1+1 , 0<=n2<=pf2) ]
86  virtual void
87  generateHcurlBasis(double const &u, double const &v, double const &w,
88  std::vector<std::vector<double> > &edgeBasis,
89  std::vector<std::vector<double> > &faceBasis,
90  std::vector<std::vector<double> > &bubbleBasis);
91  virtual void
92  generateCurlBasis(double const &u, double const &v, double const &w,
93  std::vector<std::vector<double> > &edgeBasis,
94  std::vector<std::vector<double> > &faceBasis,
95  std::vector<std::vector<double> > &bubbleBasis);
96  virtual void orientOneFace(double const &u, double const &v, double const &w,
97  int const &flag1, int const &flag2,
98  int const &flag3, int const &faceNumber,
99  std::vector<std::vector<double> > &faceFunctions,
100  std::string typeFunction);
101 };
102 
103 #endif
HierarchicalBasisHcurl
Definition: HierarchicalBasisHcurl.h:16
HierarchicalBasisHcurlQuad::HierarchicalBasisHcurlQuad
HierarchicalBasisHcurlQuad(int order)
Definition: HierarchicalBasisHcurlQuad.cpp:11
HierarchicalBasisHcurlQuad::orientEdgeFunctionsForNegativeFlag
virtual void orientEdgeFunctionsForNegativeFlag(std::vector< std::vector< double > > &edgeFunctions)
Definition: HierarchicalBasisHcurlQuad.cpp:157
HierarchicalBasisHcurlQuad::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: HierarchicalBasisHcurlQuad.cpp:126
HierarchicalBasisHcurlQuad
Definition: HierarchicalBasisHcurlQuad.h:36
HierarchicalBasisHcurlQuad::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: HierarchicalBasisHcurlQuad.cpp:376
HierarchicalBasisHcurlQuad::_pOrderEdge
int _pOrderEdge[4]
Definition: HierarchicalBasisHcurlQuad.h:78
HierarchicalBasisHcurlQuad::~HierarchicalBasisHcurlQuad
virtual ~HierarchicalBasisHcurlQuad()
Definition: HierarchicalBasisHcurlQuad.cpp:31
HierarchicalBasisHcurlQuad::getKeysInfo
virtual void getKeysInfo(std::vector< int > &functionTypeInfo, std::vector< int > &orderInfo)
Definition: HierarchicalBasisHcurlQuad.cpp:391
HierarchicalBasisHcurlQuad::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: HierarchicalBasisHcurlQuad.h:41
HierarchicalBasisHcurlQuad::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: HierarchicalBasisHcurlQuad.cpp:178
HierarchicalBasisHcurlQuad::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: HierarchicalBasisHcurlQuad.cpp:51
HierarchicalBasisHcurl.h
HierarchicalBasisHcurlQuad::getNumberOfOrientations
virtual unsigned int getNumberOfOrientations() const
Definition: HierarchicalBasisHcurlQuad.cpp:33
HierarchicalBasisHcurlQuad::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: HierarchicalBasisHcurlQuad.cpp:249
HierarchicalBasisHcurlQuad::_pf2
int _pf2
Definition: HierarchicalBasisHcurlQuad.h:77
HierarchicalBasisHcurlQuad::_pf1
int _pf1
Definition: HierarchicalBasisHcurlQuad.h:76
HierarchicalBasisHcurlQuad::_affineCoordinate
static double _affineCoordinate(int const &j, double const &u, double const &v)
Definition: HierarchicalBasisHcurlQuad.cpp:38