gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
HierarchicalBasisHcurlPri.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_PRI_H
12 #define HIERARCHICAL_BASIS_HCURL_PRI_H
13 
14 #include <stdexcept>
15 #include <math.h>
16 #include "HierarchicalBasisHcurl.h"
17 
18 
56 public:
57  HierarchicalBasisHcurlPri(int order);
59  virtual unsigned int getNumberOfOrientations() const;
60  virtual void generateBasis(double const &u, double const &v, double const &w,
61  std::vector<std::vector<double> > &vertexBasis,
62  std::vector<std::vector<double> > &edgeBasis,
63  std::vector<std::vector<double> > &faceBasis,
64  std::vector<std::vector<double> > &bubbleBasis,
65  std::string typeFunction)
66  {
67  if(typeFunction == "HcurlLegendre") {
68  generateHcurlBasis(u, v, w, edgeBasis, faceBasis, bubbleBasis);
69  }
70  else if("CurlHcurlLegendre" == typeFunction) {
71  generateCurlBasis(u, v, w, edgeBasis, faceBasis, bubbleBasis);
72  }
73  else {
74  throw std::runtime_error("unknown typeFunction");
75  }
76  }
77 
78  virtual void
79  orientEdge(int const &flagOrientation, int const &edgeNumber,
80  std::vector<std::vector<double> > &edgeBasis,
81  const std::vector<std::vector<double> > &eTablePositiveFlag,
82  const std::vector<std::vector<double> > &eTableNegativeFlag);
84  std::vector<std::vector<double> > &edgeFunctions);
85  virtual void orientFace(
86  int const &flag1, int const &flag2, int const &flag3, int const &faceNumber,
87  const std::vector<std::vector<double> > &quadFaceFunctionsAllOrientation,
88  const std::vector<std::vector<double> > &triFaceFunctionsAllOrientation,
89  std::vector<std::vector<double> > &fTableCopy);
90 
91  virtual void getKeysInfo(std::vector<int> &functionTypeInfo,
92  std::vector<int> &orderInfo);
93 
94 private:
95  int _pb1; // bubble function order in direction uv
96  int _pb2; // bubble function order in direction w
97  int _pOrderEdge[9]; // Edge functions order (pOrderEdge[0] matches the order
98  // of the edge 0)
99  int _pOrderQuadFace1[3]; // Quad Face functions order in direction u
100  // (pOrderFace1[0] matches the order of face 0 in
101  // direction u)
102  int _pOrderQuadFace2[3]; // Quad Face functions order in direction v
103  // (pOrderFace[0] matches the order of face 0 in
104  // direction v)
105  int _pOrderTriFace[2]; // Tri Face Functions order
106  static double
107  _affineCoordinate(const int &j, const double &u, const double &v,
108  const double &w); // affine coordinate lambda j=1..5
109  static double dotProduct(const std::vector<double> &u1,
110  const std::vector<double> &u2);
111  // to take into account the mapping (product with jacobian)
112  static void matrixVectorProductForMapping(
113  const double &a, const std::vector<double> &u,
114  std::vector<double> &result); // ((2,0,0),(0,2,0),(0,0,1))*u
116  std::vector<double> &result); // det*((0.5,0,0),(0,0.5,0),(0,0,1))*result
117  virtual void
118  generateHcurlBasis(double const &u, double const &v, double const &w,
119  std::vector<std::vector<double> > &edgeBasis,
120  std::vector<std::vector<double> > &faceBasis,
121  std::vector<std::vector<double> > &bubbleBasis);
122 
123  virtual void
124  generateCurlBasis(double const &u, double const &v, double const &w,
125  std::vector<std::vector<double> > &edgeBasis,
126  std::vector<std::vector<double> > &faceBasis,
127  std::vector<std::vector<double> > &bubbleBasis);
128  virtual void orientOneFace(double const &u, double const &v, double const &w,
129  int const &flag1, int const &flag2,
130  int const &flag3, int const &faceNumber,
131  std::vector<std::vector<double> > &faceFunctions,
132  std::string typeFunction);
133 };
134 #endif
HierarchicalBasisHcurl
Definition: HierarchicalBasisHcurl.h:16
HierarchicalBasisHcurlPri::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: HierarchicalBasisHcurlPri.cpp:79
HierarchicalBasisHcurlPri::_pOrderQuadFace2
int _pOrderQuadFace2[3]
Definition: HierarchicalBasisHcurlPri.h:102
HierarchicalBasisHcurlPri::matrixVectorProductForMapping
static void matrixVectorProductForMapping(const double &a, const std::vector< double > &u, std::vector< double > &result)
Definition: HierarchicalBasisHcurlPri.cpp:72
HierarchicalBasisHcurlPri::~HierarchicalBasisHcurlPri
virtual ~HierarchicalBasisHcurlPri()
Definition: HierarchicalBasisHcurlPri.cpp:43
HierarchicalBasisHcurlPri::matrixVectorProductForCurlMapping
static void matrixVectorProductForCurlMapping(std::vector< double > &result)
Definition: HierarchicalBasisHcurlPri.cpp:1241
HierarchicalBasisHcurlPri::_pOrderQuadFace1
int _pOrderQuadFace1[3]
Definition: HierarchicalBasisHcurlPri.h:99
HierarchicalBasisHcurlPri::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: HierarchicalBasisHcurlPri.cpp:491
HierarchicalBasisHcurlPri::_pOrderTriFace
int _pOrderTriFace[2]
Definition: HierarchicalBasisHcurlPri.h:105
HierarchicalBasisHcurlPri::orientEdgeFunctionsForNegativeFlag
virtual void orientEdgeFunctionsForNegativeFlag(std::vector< std::vector< double > > &edgeFunctions)
Definition: HierarchicalBasisHcurlPri.cpp:471
HierarchicalBasisHcurlPri::_pb2
int _pb2
Definition: HierarchicalBasisHcurlPri.h:96
HierarchicalBasisHcurlPri::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: HierarchicalBasisHcurlPri.cpp:1196
HierarchicalBasisHcurlPri
Definition: HierarchicalBasisHcurlPri.h:55
HierarchicalBasisHcurlPri::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: HierarchicalBasisHcurlPri.cpp:1249
HierarchicalBasisHcurlPri::HierarchicalBasisHcurlPri
HierarchicalBasisHcurlPri(int order)
Definition: HierarchicalBasisHcurlPri.cpp:14
HierarchicalBasisHcurlPri::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: HierarchicalBasisHcurlPri.h:60
HierarchicalBasisHcurlPri::dotProduct
static double dotProduct(const std::vector< double > &u1, const std::vector< double > &u2)
Definition: HierarchicalBasisHcurlPri.cpp:66
HierarchicalBasisHcurlPri::_affineCoordinate
static double _affineCoordinate(const int &j, const double &u, const double &v, const double &w)
Definition: HierarchicalBasisHcurlPri.cpp:50
HierarchicalBasisHcurlPri::_pb1
int _pb1
Definition: HierarchicalBasisHcurlPri.h:95
HierarchicalBasisHcurlPri::_pOrderEdge
int _pOrderEdge[9]
Definition: HierarchicalBasisHcurlPri.h:97
HierarchicalBasisHcurl.h
HierarchicalBasisHcurlPri::getKeysInfo
virtual void getKeysInfo(std::vector< int > &functionTypeInfo, std::vector< int > &orderInfo)
Definition: HierarchicalBasisHcurlPri.cpp:1828
HierarchicalBasisHcurlPri::getNumberOfOrientations
virtual unsigned int getNumberOfOrientations() const
Definition: HierarchicalBasisHcurlPri.cpp:45
HierarchicalBasisHcurlPri::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: HierarchicalBasisHcurlPri.cpp:440