gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
miniBasis.cpp
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 #include "miniBasis.h"
7 #include "BasisFactory.h"
8 
10 {
13  order = 3;
14  dimension = 2;
15  numFaces = 3;
16  serendip = false;
18  closures = p1.closures;
20  for(size_t i = 0; i < fullClosures.size(); ++i) {
21  fullClosures[i].push_back(3);
22  }
24  points = p1.points;
25  points.resize(4, 2);
26  points(0, 0) = 0.;
27  points(0, 1) = 0.;
28  points(1, 0) = 1.;
29  points(1, 1) = 0.;
30  points(2, 0) = 0.;
31  points(2, 1) = 1.;
32  points(3, 0) = 1. / 3;
33  points(3, 1) = 1. / 3;
34  /*
35  monomials :
36  0 : 1
37  1 : x
38  2 : y
39  3 : xy
40  4 : x²y
41  5 : xy²
42  fs :
43  0 : 1 -1 -1 0 0 0 : 1 - x - y
44  1 : 1 0 0 0 0 0 : x
45  2 : 0 1 0 0 0 0 : y
46  3 : 0 0 0 1 -1 -1 : xy - x²y - xy² = (1 - x - y) x y
47  */
48  monomials.resize(6, 2);
49  monomials(0, 0) = 0.;
50  monomials(0, 1) = 0.;
51  monomials(1, 0) = 1.;
52  monomials(1, 1) = 0.;
53  monomials(2, 0) = 0.;
54  monomials(2, 1) = 1.;
55  monomials(3, 0) = 1.;
56  monomials(3, 1) = 1.;
57  monomials(4, 0) = 2.;
58  monomials(4, 1) = 1.;
59  monomials(5, 0) = 1.;
60  monomials(5, 1) = 2.;
61  coefficients.resize(4, 6);
62  coefficients.setAll(0.);
63  coefficients(0, 0) = 1.;
64  coefficients(0, 1) = -1.;
65  coefficients(0, 2) = -1.;
66  coefficients(1, 1) = 1.;
67  coefficients(2, 2) = 1.;
68  coefficients(3, 3) = 1.;
69  coefficients(3, 4) = -1.;
70  coefficients(3, 5) = -1.;
71 }
72 
74 {
77  order = 3;
78  dimension = 3;
79  numFaces = 4;
80  serendip = false;
82  closures = p1.closures;
84  for(size_t i = 0; i < fullClosures.size(); ++i) {
85  fullClosures[i].push_back(4);
86  }
88  points.resize(5, 3);
89  for(int i = 0; i < 4; ++i)
90  for(int j = 0; j < 3; ++j) points(i, j) = p1.points(i, j);
91  points(4, 0) = points(4, 1) = points(4, 2) = 1. / 4;
92 
93  /*
94  monomials :
95  0 : 1
96  1 : x
97  2 : y
98  3 : z
99  4 : xyz
100  5 : x²yz
101  6 : xy²z
102  7 : xyz²
103  sf :
104  0 : 1 -1 -1 -1 0 0 0 0 : 1 - x - y - z
105  1 : 0 1 0 0 0 0 0 0 : x
106  2 : 0 0 1 0 0 0 0 0 : y
107  3 : 0 0 0 1 0 0 0 0 : z
108  4 : 0 0 0 0 1 -1 -1 -1 : xyz - x²yz - xy²z - xyz² = (1 - x - y - z) x y
109  z
110  */
111  monomials.resize(8, 3);
112  monomials(0, 0) = 0.;
113  monomials(0, 1) = 0.;
114  monomials(0, 2) = 0.;
115  monomials(1, 0) = 1.;
116  monomials(1, 1) = 0.;
117  monomials(1, 2) = 0.;
118  monomials(2, 0) = 0.;
119  monomials(2, 1) = 1.;
120  monomials(2, 2) = 0.;
121  monomials(3, 0) = 0.;
122  monomials(3, 1) = 0.;
123  monomials(3, 2) = 1.;
124  monomials(4, 0) = 1.;
125  monomials(4, 1) = 1.;
126  monomials(4, 2) = 1.;
127  monomials(5, 0) = 2.;
128  monomials(5, 1) = 1.;
129  monomials(5, 2) = 1.;
130  monomials(6, 0) = 1.;
131  monomials(6, 1) = 2.;
132  monomials(6, 2) = 1.;
133  monomials(7, 0) = 1.;
134  monomials(7, 1) = 1.;
135  monomials(7, 2) = 2.;
136  coefficients.resize(5, 8);
137  coefficients.setAll(0.);
138  coefficients(0, 0) = 1.;
139  coefficients(0, 1) = -1.;
140  coefficients(0, 2) = -1.;
141  coefficients(0, 3) = -1.;
142  coefficients(1, 1) = 1.;
143  coefficients(2, 2) = 1.;
144  coefficients(3, 3) = 1.;
145  coefficients(4, 4) = 1.;
146  coefficients(4, 5) = -1.;
147  coefficients(4, 6) = -1.;
148  coefficients(4, 7) = -1.;
149 }
miniBasis.h
nodalBasis::points
fullMatrix< double > points
Definition: nodalBasis.h:16
nodalBasis::closureRef
std::vector< int > closureRef
Definition: nodalBasis.h:69
polynomialBasis::monomials
fullMatrix< double > monomials
Definition: polynomialBasis.h:20
fullMatrix::setAll
void setAll(const scalar &m)
Definition: fullMatrix.h:422
nodalBasis::numFaces
int numFaces
Definition: nodalBasis.h:14
MSH_TET_MINI
#define MSH_TET_MINI
Definition: GmshDefines.h:225
TYPE_TRI
#define TYPE_TRI
Definition: GmshDefines.h:66
nodalBasis::parentType
int parentType
Definition: nodalBasis.h:14
nodalBasis::type
int type
Definition: nodalBasis.h:14
nodalBasis::serendip
bool serendip
Definition: nodalBasis.h:15
MSH_TRI_3
#define MSH_TRI_3
Definition: GmshDefines.h:81
miniBasisTet::miniBasisTet
miniBasisTet()
Definition: miniBasis.cpp:73
nodalBasis::order
int order
Definition: nodalBasis.h:14
BasisFactory::getNodalBasis
static const nodalBasis * getNodalBasis(int tag)
Definition: BasisFactory.cpp:23
miniBasisTri::miniBasisTri
miniBasisTri()
Definition: miniBasis.cpp:9
polynomialBasis::coefficients
fullMatrix< double > coefficients
Definition: polynomialBasis.h:21
nodalBasis::dimension
int dimension
Definition: nodalBasis.h:14
nodalBasis
Definition: nodalBasis.h:12
MSH_TET_4
#define MSH_TET_4
Definition: GmshDefines.h:83
nodalBasis::closures
clCont closures
Definition: nodalBasis.h:68
nodalBasis::fullClosures
clCont fullClosures
Definition: nodalBasis.h:68
MSH_TRI_MINI
#define MSH_TRI_MINI
Definition: GmshDefines.h:224
TYPE_TET
#define TYPE_TET
Definition: GmshDefines.h:68
fullMatrix::resize
bool resize(int r, int c, bool resetValue=true)
Definition: fullMatrix.h:307
BasisFactory.h