gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
HierarchicalBasisH1Brick.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_H1_BRICK_H
12 #define HIERARCHICAL_BASIS_H1_BRICK_H
13 
14 #include "HierarchicalBasisH1.h"
15 
16 /*
17  * MHexahedron
18  *
19  * v
20  * 3----------2
21  * |\ ^ |\
22  * | \ | | \
23  * | \ | | \
24  * | 7------+---6
25  * | | +-- |-- | -> u
26  * 0---+---\--1 |
27  * \ | \ \ |
28  * \ | \ \ |
29  * \| w \|
30  * 4----------5
31  *
32  * Oriented Edges:
33  * e0={0, 1}, e1={0, 3}, e2={0, 4}, e3={1, 2}, e4 ={1, 5}, e5={3, 2},e6={2, 6},
34  * e7={3, 7},e8={4, 5}, e9= {4, 7}, e10={5, 6}, e11={7, 6}
35  *
36  * Oritented Surface:
37  * s0={0, 1, 3, 2}, s1={0, 1, 4, 5}, s2={0, 3, 4, 7},
38  * s3={1, 2, 5, 6}, s4={3,2,7,6}, s5={4, 5, 7, 6}
39  * Local (directional) orders on mesh faces are not allowed to exceed the mini-
40  * mum of the (appropriate directional) orders of approximation associated with
41  * the interior of the adjacent elements. Local orders of approximation on mesh
42  * edges are limited by the minimum of all (appropriate directional) orders cor-
43  * responding to faces sharing that edge
44  */
46 public:
47  HierarchicalBasisH1Brick(int order);
48  virtual ~HierarchicalBasisH1Brick();
49  virtual unsigned int getNumberOfOrientations() const;
50  // vertexBasis=[v0,...,v12]
51  // edgeBasis=[phie0_{2},...phie0_{pe0-1},phie1_{2},...phie1_{pe1-1}...]
52  // faceBasis=[phif0_{2,2},...,phif0_{2,pF0_2},...,phif0_{pF0_1,2},...,phief0_{pF0_1,pF0_2},phif1_{2,2}...}]
53  // bubbleBasis=[phieb_{2,2,2},...,phieb_{2,,2,pb3},phieb_{2,3,2},...,phieb_{2,3,pe3},...}]
54  virtual void generateBasis(double const &u, double const &v, double const &w,
55  std::vector<double> &vertexBasis,
56  std::vector<double> &edgeBasis,
57  std::vector<double> &faceBasis,
58  std::vector<double> &bubbleBasis);
59  virtual void generateBasis(double const &u, double const &v, double const &w,
60  std::vector<std::vector<double> > &vertexBasis,
61  std::vector<std::vector<double> > &edgeBasis,
62  std::vector<std::vector<double> > &faceBasis,
63  std::vector<std::vector<double> > &bubbleBasis,
64  std::string typeFunction = "GradH1Legendre")
65  {
66  generateGradientBasis(u, v, w, vertexBasis, edgeBasis, faceBasis,
67  bubbleBasis);
68  }
69 
70  virtual void orientEdge(int const &flagOrientation, int const &edgeNumber,
71  std::vector<double> &edgeFunctions,
72  const std::vector<double> &eTablePositiveFlag,
73  const std::vector<double> &eTableNegativeFlag);
74  virtual void
75  orientEdge(int const &flagOrientation, int const &edgeNumber,
76  std::vector<std::vector<double> > &edgeBasis,
77  const std::vector<std::vector<double> > &eTablePositiveFlag,
78  const std::vector<std::vector<double> > &eTableNegativeFlag);
79 
80  virtual void
81  orientEdgeFunctionsForNegativeFlag(std::vector<double> &edgeFunctions);
83  std::vector<std::vector<double> > &edgeFunctions);
84 
85  virtual void
86  orientFace(int const &flag1, int const &flag2, int const &flag3,
87  int const &faceNumber,
88  const std::vector<double> &quadFaceFunctionsAllOrientation,
89  const std::vector<double> &triFaceFunctionsAllOrientation,
90  std::vector<double> &fTableCopy);
91 
92  virtual void orientFace(
93  int const &flag1, int const &flag2, int const &flag3, int const &faceNumber,
94  const std::vector<std::vector<double> > &quadFaceFunctionsAllOrientation,
95  const std::vector<std::vector<double> > &triFaceFunctionsAllOrientation,
96  std::vector<std::vector<double> > &fTableCopy);
97  virtual void getKeysInfo(std::vector<int> &functionTypeInfo,
98  std::vector<int> &orderInfo);
99 
100 private:
101  int _pb1; // bubble function order in direction u
102  int _pb2; // bubble function order in direction v
103  int _pb3; // bubble function order in direction w
104  int _pOrderEdge[12]; // Edge functions order (pOrderEdge[0] matches the order
105  // of the edge 0)
106  int _pOrderFace1[6]; // Face functions order in direction u (pOrderFace1[0]
107  // matches the order of face 0 in direction u)
108  int _pOrderFace2[6]; // Face functions order in direction v (pOrderFace[0]
109  // matches the order of face 0 in direction v)
110  static double
111  _affineCoordinate(const int &j, const double &u, const double &v,
112  const double &w); // affine coordinate lambdaj j=1..6
113  inline void _someProduct(double const &u, double const &v, double const &w,
114  std::vector<double> &product,
115  std::vector<double> &lambda); // compute some product
116  inline void
117  _someProductGrad(double const &u, double const &v, double const &w,
118  std::vector<double> &product,
119  std::vector<std::vector<double> > &gradientProduct,
120  std::vector<double> &lambda,
121  std::vector<std::vector<double> >
122  &gradientLambda); // compute some product and fill the
123  // vector gradientVertex
124  void generateGradientBasis(double const &u, double const &v, double const &w,
125  std::vector<std::vector<double> > &gradientVertex,
126  std::vector<std::vector<double> > &gradientEdge,
127  std::vector<std::vector<double> > &gradientFace,
128  std::vector<std::vector<double> > &gradientBubble);
129  virtual void orientOneFace(double const &u, double const &v, double const &w,
130  int const &flag1, int const &flag2,
131  int const &flag3, int const &faceNumber,
132  std::vector<double> &faceBasis);
133  virtual void orientOneFace(double const &u, double const &v, double const &w,
134  int const &flag1, int const &flag2,
135  int const &flag3, int const &faceNumber,
136  std::vector<std::vector<double> > &faceFunctions,
137  std::string typeFunction = "GradH1Legendre");
138 };
139 #endif
HierarchicalBasisH1Brick::orientEdge
virtual void orientEdge(int const &flagOrientation, int const &edgeNumber, std::vector< double > &edgeFunctions, const std::vector< double > &eTablePositiveFlag, const std::vector< double > &eTableNegativeFlag)
Definition: HierarchicalBasisH1Brick.cpp:430
HierarchicalBasisH1Brick::getKeysInfo
virtual void getKeysInfo(std::vector< int > &functionTypeInfo, std::vector< int > &orderInfo)
Definition: HierarchicalBasisH1Brick.cpp:762
HierarchicalBasisH1
Definition: HierarchicalBasisH1.h:14
HierarchicalBasisH1Brick::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)
Definition: HierarchicalBasisH1Brick.cpp:721
HierarchicalBasisH1Brick::HierarchicalBasisH1Brick
HierarchicalBasisH1Brick(int order)
Definition: HierarchicalBasisH1Brick.cpp:15
HierarchicalBasisH1Brick::_pb3
int _pb3
Definition: HierarchicalBasisH1Brick.h:103
HierarchicalBasisH1Brick::_someProduct
void _someProduct(double const &u, double const &v, double const &w, std::vector< double > &product, std::vector< double > &lambda)
Definition: HierarchicalBasisH1Brick.cpp:58
HierarchicalBasisH1Brick::generateGradientBasis
void generateGradientBasis(double const &u, double const &v, double const &w, std::vector< std::vector< double > > &gradientVertex, std::vector< std::vector< double > > &gradientEdge, std::vector< std::vector< double > > &gradientFace, std::vector< std::vector< double > > &gradientBubble)
Definition: HierarchicalBasisH1Brick.cpp:255
HierarchicalBasisH1Brick::_pOrderFace1
int _pOrderFace1[6]
Definition: HierarchicalBasisH1Brick.h:106
HierarchicalBasisH1Brick::_pOrderEdge
int _pOrderEdge[12]
Definition: HierarchicalBasisH1Brick.h:104
HierarchicalBasisH1Brick::_pb2
int _pb2
Definition: HierarchicalBasisH1Brick.h:102
HierarchicalBasisH1Brick::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="GradH1Legendre")
Definition: HierarchicalBasisH1Brick.h:59
HierarchicalBasisH1Brick::getNumberOfOrientations
virtual unsigned int getNumberOfOrientations() const
Definition: HierarchicalBasisH1Brick.cpp:38
HierarchicalBasisH1Brick::_someProductGrad
void _someProductGrad(double const &u, double const &v, double const &w, std::vector< double > &product, std::vector< std::vector< double > > &gradientProduct, std::vector< double > &lambda, std::vector< std::vector< double > > &gradientLambda)
Definition: HierarchicalBasisH1Brick.cpp:198
HierarchicalBasisH1Brick::_affineCoordinate
static double _affineCoordinate(const int &j, const double &u, const double &v, const double &w)
Definition: HierarchicalBasisH1Brick.cpp:43
HierarchicalBasisH1Brick::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)
Definition: HierarchicalBasisH1Brick.cpp:83
HierarchicalBasisH1Brick::_pOrderFace2
int _pOrderFace2[6]
Definition: HierarchicalBasisH1Brick.h:108
HierarchicalBasisH1Brick::orientEdgeFunctionsForNegativeFlag
virtual void orientEdgeFunctionsForNegativeFlag(std::vector< double > &edgeFunctions)
Definition: HierarchicalBasisH1Brick.cpp:490
HierarchicalBasisH1Brick
Definition: HierarchicalBasisH1Brick.h:45
HierarchicalBasisH1Brick::_pb1
int _pb1
Definition: HierarchicalBasisH1Brick.h:101
HierarchicalBasisH1Brick::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 > &faceBasis)
Definition: HierarchicalBasisH1Brick.cpp:530
HierarchicalBasisH1.h
HierarchicalBasisH1Brick::~HierarchicalBasisH1Brick
virtual ~HierarchicalBasisH1Brick()
Definition: HierarchicalBasisH1Brick.cpp:36