gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
HierarchicalBasisHcurlTria.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_TRIA_H
12 #define HIERARCHICAL_BASIS_HCURL_TRIA_H
13 
14 #include <stdexcept>
15 #include <math.h>
16 #include "HierarchicalBasisHcurl.h"
17 
18 /*
19  * MTriangle
20  *
21  * v
22  * ^
23  * |
24  * 2
25  * |`\
26  * | `\
27  * | `\
28  * | `\
29  * v `\
30  * 0---------->1 --> u
31  *
32  *
33  * Oriented Edges:
34  * e0={v0;v1} e1={v1;v2} e2={v2;v0}
35  * pe0,pe1,pe2<=pf
36  *
37  */
39 public:
40  HierarchicalBasisHcurlTria(int order);
42  virtual unsigned int getNumberOfOrientations() const;
43  virtual void generateBasis(double const &u, double const &v, double const &w,
44  std::vector<std::vector<double> > &vertexBasis,
45  std::vector<std::vector<double> > &edgeBasis,
46  std::vector<std::vector<double> > &faceBasis,
47  std::vector<std::vector<double> > &bubbleBasis,
48  std::string typeFunction)
49  {
50  if(typeFunction == "HcurlLegendre") {
51  generateHcurlBasis(u, v, w, edgeBasis, faceBasis, bubbleBasis);
52  }
53  else if("CurlHcurlLegendre" == typeFunction) {
54  generateCurlBasis(u, v, w, edgeBasis, faceBasis, bubbleBasis);
55  }
56  else {
57  throw std::runtime_error("unknown typeFunction");
58  }
59  }
60  virtual void
61  orientEdge(int const &flagOrientation, int const &edgeNumber,
62  std::vector<std::vector<double> > &edgeBasis,
63  const std::vector<std::vector<double> > &eTablePositiveFlag,
64  const std::vector<std::vector<double> > &eTableNegativeFlag);
66  std::vector<std::vector<double> > &edgeFunctions);
67  virtual void orientFace(
68  int const &flag1, int const &flag2, int const &flag3, int const &faceNumber,
69  const std::vector<std::vector<double> > &quadFaceFunctionsAllOrientation,
70  const std::vector<std::vector<double> > &triFaceFunctionsAllOrientation,
71  std::vector<std::vector<double> > &fTableCopy);
72 
73  virtual void getKeysInfo(std::vector<int> &functionTypeInfo,
74  std::vector<int> &orderInfo);
75 
76 private:
77  int _pf; // face function order
78  int _pOrderEdge[3]; // 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..3
83 
84  // edgeBasis=[phie0_{0},...phie0_{pe0},phie1_{0},...phie1_{pe1}...; edge-based
85  // bubble functions ] faceBasis=[ genuine bubble functions]
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 
97  static double dotProduct(const std::vector<double> &u,
98  const std::vector<double> &v);
99  virtual void orientOneFace(double const &u, double const &v, double const &w,
100  int const &flag1, int const &flag2,
101  int const &flag3, int const &faceNumber,
102  std::vector<std::vector<double> > &faceFunctions,
103  std::string typeFunction);
104 };
105 
106 #endif
HierarchicalBasisHcurl
Definition: HierarchicalBasisHcurl.h:16
HierarchicalBasisHcurlTria::orientEdgeFunctionsForNegativeFlag
virtual void orientEdgeFunctionsForNegativeFlag(std::vector< std::vector< double > > &edgeFunctions)
Definition: HierarchicalBasisHcurlTria.cpp:223
HierarchicalBasisHcurlTria::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: HierarchicalBasisHcurlTria.cpp:244
HierarchicalBasisHcurlTria::_pOrderEdge
int _pOrderEdge[3]
Definition: HierarchicalBasisHcurlTria.h:78
HierarchicalBasisHcurlTria::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: HierarchicalBasisHcurlTria.h:43
HierarchicalBasisHcurlTria::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: HierarchicalBasisHcurlTria.cpp:192
HierarchicalBasisHcurlTria::_pf
int _pf
Definition: HierarchicalBasisHcurlTria.h:77
HierarchicalBasisHcurlTria::getNumberOfOrientations
virtual unsigned int getNumberOfOrientations() const
Definition: HierarchicalBasisHcurlTria.cpp:40
HierarchicalBasisHcurlTria::~HierarchicalBasisHcurlTria
virtual ~HierarchicalBasisHcurlTria()
Definition: HierarchicalBasisHcurlTria.cpp:38
HierarchicalBasisHcurlTria::dotProduct
static double dotProduct(const std::vector< double > &u, const std::vector< double > &v)
Definition: HierarchicalBasisHcurlTria.cpp:32
HierarchicalBasisHcurlTria::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: HierarchicalBasisHcurlTria.cpp:57
HierarchicalBasisHcurlTria::_affineCoordinate
static double _affineCoordinate(int const &j, double const &u, double const &v)
Definition: HierarchicalBasisHcurlTria.cpp:45
HierarchicalBasisHcurlTria::getKeysInfo
virtual void getKeysInfo(std::vector< int > &functionTypeInfo, std::vector< int > &orderInfo)
Definition: HierarchicalBasisHcurlTria.cpp:766
HierarchicalBasisHcurlTria::HierarchicalBasisHcurlTria
HierarchicalBasisHcurlTria(int order)
Definition: HierarchicalBasisHcurlTria.cpp:12
HierarchicalBasisHcurlTria::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: HierarchicalBasisHcurlTria.cpp:427
HierarchicalBasisHcurl.h
HierarchicalBasisHcurlTria::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: HierarchicalBasisHcurlTria.cpp:751
HierarchicalBasisHcurlTria
Definition: HierarchicalBasisHcurlTria.h:38