gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
HierarchicalBasis.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 // Reference : "Higher-Order Finite Element Methods"; Pavel Solin, Karel
8 // Segeth ,
9 // Ivo Dolezel , Chapman and Hall/CRC; Edition : Har/Cdr (2003).
10 
11 #ifndef HIERARCHICAL_BASIS_H
12 #define HIERARCHICAL_BASIS_H
13 
14 #include <vector>
15 #include "OrthogonalPoly.h"
16 #include <algorithm>
17 
19 protected:
20  int _nvertex;
21  int _nedge;
22  int _nfaceQuad; // number of quadrilateral faces
23  int _nfaceTri; // number of triangular faces
29  virtual void orientOneFace(double const &u, double const &v, double const &w,
30  int const &flag1, int const &flag2,
31  int const &flag3, int const &faceNumber,
32  std::vector<double> &faceFunctions) = 0;
33  virtual void orientOneFace(double const &u, double const &v, double const &w,
34  int const &flag1, int const &flag2,
35  int const &flag3, int const &faceNumber,
36  std::vector<std::vector<double> > &faceFunctions,
37  std::string typeFunction) = 0;
38 
39 public:
40  virtual ~HierarchicalBasis() = 0;
41  int getnVertexFunction() const;
42  int getnEdgeFunction() const;
43  int getnTriFaceFunction() const;
44  int getnQuadFaceFunction() const;
45  int getnBubbleFunction() const;
46  int getNumTriFace() const;
47  int getNumQuadFace() const;
48  int getNumEdge() const;
49  virtual unsigned int getNumberOfOrientations() const = 0;
50  virtual void generateBasis(double const &u, double const &v, double const &w,
51  std::vector<double> &vertexBasis,
52  std::vector<double> &edgeBasis,
53  std::vector<double> &faceBasis,
54  std::vector<double> &bubbleBasis) = 0;
55 
56  virtual void generateBasis(
57  double const &u, double const &v, double const &w,
58  std::vector<std::vector<double> > &vertexBasis,
59  std::vector<std::vector<double> > &edgeBasis,
60  std::vector<std::vector<double> > &faceBasis,
61  std::vector<std::vector<double> > &bubbleBasis,
62  std::string typeFunction) = 0; // typeFunction =GradH1Legendre ,
63  // HcurlLegendre,curlHcurlLegendre
64 
65  virtual void
66  orientEdge(int const &flagOrientation, int const &edgeNumber,
67  std::vector<std::vector<double> > &edgeBasis,
68  const std::vector<std::vector<double> > &eTablePositiveFlag,
69  const std::vector<std::vector<double> > &eTableNegativeFlag) = 0;
70 
71  virtual void
72  orientEdgeFunctionsForNegativeFlag(std::vector<double> &edgeFunctions) = 0;
74  std::vector<std::vector<double> > &edgeFunctions) = 0;
75 
77  double const &u, double const &v, double const &w,
78  const std::vector<double> &faceFunctions,
79  std::vector<double> &quadFaceFunctionsAllOrientation,
80  std::vector<double> &triFaceFunctionsAllOrientation) = 0;
81 
83  double const &u, double const &v, double const &w,
84  const std::vector<std::vector<double> > &faceFunctions,
85  std::vector<std::vector<double> > &quadFaceFunctionsAllOrientation,
86  std::vector<std::vector<double> > &triFaceFunctionsAllOrientation,
87  std::string typeFunction) = 0; // typeFunction =GradH1Legendre ,
88  // HcurlLegendre,curlHcurlLegendre
89  virtual void
90  orientFace(int const &flag1, int const &flag2, int const &flag3,
91  int const &faceNumber,
92  const std::vector<double> &quadFaceFunctionsAllOrientation,
93  const std::vector<double> &triFaceFunctionsAllOrientation,
94  std::vector<double> &fTableCopy) = 0;
95  virtual void orientFace(
96  int const &flag1, int const &flag2, int const &flag3, int const &faceNumber,
97  const std::vector<std::vector<double> > &quadFaceFunctionsAllOrientation,
98  const std::vector<std::vector<double> > &triFaceFunctionsAllOrientation,
99  std::vector<std::vector<double> > &fTableCopy) = 0;
100 
101  virtual void orientEdge(int const &flagOrientation, int const &edgeNumber,
102  std::vector<double> &edgeFunctions,
103  const std::vector<double> &eTablePositiveFlag,
104  const std::vector<double> &eTableNegativeFlag) = 0;
105  inline int numberOrientationQuadFace(int const &flag1, int const &flag2,
106  int const &flag3)
107  {
108  if(flag1 == 1 && flag2 == 1 && flag3 == 1) { return 0; }
109  else if(flag1 == -1 && flag2 == 1 && flag3 == 1) {
110  return 1;
111  }
112  else if(flag1 == 1 && flag2 == -1 && flag3 == 1) {
113  return 2;
114  }
115  else if(flag1 == -1 && flag2 == -1 && flag3 == 1) {
116  return 3;
117  }
118  else if(flag1 == 1 && flag2 == 1 && flag3 == -1) {
119  return 4;
120  }
121  else if(flag1 == -1 && flag2 == 1 && flag3 == -1) {
122  return 5;
123  }
124  else if(flag1 == 1 && flag2 == -1 && flag3 == -1) {
125  return 6;
126  }
127  else {
128  return 7;
129  }
130  }
131  inline int numberOrientationTriFace(int const &flag1, int const &flag2)
132  {
133  if(flag1 == 0 && flag2 == 1) { return 0; }
134  else if(flag1 == 1 && flag2 == 1) {
135  return 1;
136  }
137  else if(flag1 == 2 && flag2 == 1) {
138  return 2;
139  }
140  else if(flag1 == 0 && flag2 == -1) {
141  return 3;
142  }
143  else if(flag1 == 1 && flag2 == -1) {
144  return 4;
145  }
146  else {
147  return 5;
148  }
149  }
150 
151  // Get information about the `keys' defined in GMSH API for one element
152  virtual void getKeysInfo(std::vector<int> &functionTypeInfo,
153  std::vector<int> &orderInfo) = 0;
154 };
155 
156 #endif
HierarchicalBasis::getNumTriFace
int getNumTriFace() const
Definition: HierarchicalBasis.cpp:24
HierarchicalBasis::getnVertexFunction
int getnVertexFunction() const
Definition: HierarchicalBasis.cpp:22
HierarchicalBasis::getNumberOfOrientations
virtual unsigned int getNumberOfOrientations() const =0
HierarchicalBasis::_nTriFaceFunction
int _nTriFaceFunction
Definition: HierarchicalBasis.h:27
HierarchicalBasis::orientEdgeFunctionsForNegativeFlag
virtual void orientEdgeFunctionsForNegativeFlag(std::vector< std::vector< double > > &edgeFunctions)=0
HierarchicalBasis::~HierarchicalBasis
virtual ~HierarchicalBasis()=0
Definition: HierarchicalBasis.cpp:10
HierarchicalBasis::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< double > &faceFunctions)=0
HierarchicalBasis::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)=0
HierarchicalBasis::_nvertex
int _nvertex
Definition: HierarchicalBasis.h:20
HierarchicalBasis::_nBubbleFunction
int _nBubbleFunction
Definition: HierarchicalBasis.h:28
HierarchicalBasis::orientEdgeFunctionsForNegativeFlag
virtual void orientEdgeFunctionsForNegativeFlag(std::vector< double > &edgeFunctions)=0
HierarchicalBasis::addAllOrientedFaceFunctions
virtual void addAllOrientedFaceFunctions(double const &u, double const &v, double const &w, const std::vector< double > &faceFunctions, std::vector< double > &quadFaceFunctionsAllOrientation, std::vector< double > &triFaceFunctionsAllOrientation)=0
HierarchicalBasis::getnQuadFaceFunction
int getnQuadFaceFunction() const
Definition: HierarchicalBasis.cpp:15
HierarchicalBasis::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)=0
HierarchicalBasis::getnTriFaceFunction
int getnTriFaceFunction() const
Definition: HierarchicalBasis.cpp:14
HierarchicalBasis::orientEdge
virtual void orientEdge(int const &flagOrientation, int const &edgeNumber, std::vector< double > &edgeFunctions, const std::vector< double > &eTablePositiveFlag, const std::vector< double > &eTableNegativeFlag)=0
HierarchicalBasis::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)=0
HierarchicalBasis::getnEdgeFunction
int getnEdgeFunction() const
Definition: HierarchicalBasis.cpp:12
HierarchicalBasis
Definition: HierarchicalBasis.h:18
OrthogonalPoly.h
HierarchicalBasis::getNumEdge
int getNumEdge() const
Definition: HierarchicalBasis.cpp:27
HierarchicalBasis::orientFace
virtual void orientFace(int const &flag1, int const &flag2, int const &flag3, int const &faceNumber, const std::vector< double > &quadFaceFunctionsAllOrientation, const std::vector< double > &triFaceFunctionsAllOrientation, std::vector< double > &fTableCopy)=0
HierarchicalBasis::getKeysInfo
virtual void getKeysInfo(std::vector< int > &functionTypeInfo, std::vector< int > &orderInfo)=0
HierarchicalBasis::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)=0
HierarchicalBasis::generateBasis
virtual void generateBasis(double const &u, double const &v, double const &w, std::vector< double > &vertexBasis, std::vector< double > &edgeBasis, std::vector< double > &faceBasis, std::vector< double > &bubbleBasis)=0
HierarchicalBasis::_nQuadFaceFunction
int _nQuadFaceFunction
Definition: HierarchicalBasis.h:26
HierarchicalBasis::_nfaceTri
int _nfaceTri
Definition: HierarchicalBasis.h:23
HierarchicalBasis::_nfaceQuad
int _nfaceQuad
Definition: HierarchicalBasis.h:22
HierarchicalBasis::_nVertexFunction
int _nVertexFunction
Definition: HierarchicalBasis.h:24
HierarchicalBasis::getnBubbleFunction
int getnBubbleFunction() const
Definition: HierarchicalBasis.cpp:20
HierarchicalBasis::numberOrientationTriFace
int numberOrientationTriFace(int const &flag1, int const &flag2)
Definition: HierarchicalBasis.h:131
HierarchicalBasis::_nEdgeFunction
int _nEdgeFunction
Definition: HierarchicalBasis.h:25
HierarchicalBasis::addAllOrientedFaceFunctions
virtual void addAllOrientedFaceFunctions(double const &u, double const &v, double const &w, const std::vector< std::vector< double > > &faceFunctions, std::vector< std::vector< double > > &quadFaceFunctionsAllOrientation, std::vector< std::vector< double > > &triFaceFunctionsAllOrientation, std::string typeFunction)=0
HierarchicalBasis::getNumQuadFace
int getNumQuadFace() const
Definition: HierarchicalBasis.cpp:25
HierarchicalBasis::_nedge
int _nedge
Definition: HierarchicalBasis.h:21
HierarchicalBasis::numberOrientationQuadFace
int numberOrientationQuadFace(int const &flag1, int const &flag2, int const &flag3)
Definition: HierarchicalBasis.h:105