43 case(1):
return 0.5 * (1 + u);
44 case(2):
return 0.5 * (1 - u);
45 case(3):
return 0.5 * (1 + v);
46 case(4):
return 0.5 * (1 - v);
47 default:
throw std::runtime_error(
"j must be : 1<=j<=4");
52 double const &u,
double const &v,
double const &w,
53 std::vector<std::vector<double> > &edgeBasis,
54 std::vector<std::vector<double> > &faceBasis,
55 std::vector<std::vector<double> > &bubbleBasis)
61 std::vector<std::vector<double> > legendreVector(2);
62 legendreVector[0] = std::vector<double>(
_pf1 + 1);
63 legendreVector[1] = std::vector<double>(
_pf2 + 1);
64 for(
unsigned int k = 0; k < legendreVector[0].size(); k++) {
67 for(
unsigned int k = 0; k < legendreVector[1].size(); k++) {
71 for(
int i = 0; i <
_nedge; i++) {
97 for(
int iedge = 0; iedge <
_pOrderEdge[i] + 1; iedge++) {
98 for(
int j = 0; j < 3; j++) {
99 edgeBasis[edgeIt][j] =
100 lambda * legendreVector[uv][iedge] *
direction[j];
106 for(
int n1 = 0; n1 <=
_pf1; n1++) {
107 for(
int n2 = 2; n2 <=
_pf2 + 1; n2++) {
108 faceBasis[faceIt][0] =
110 faceBasis[faceIt][1] = 0;
111 faceBasis[faceIt][2] = 0;
115 for(
int n1 = 2; n1 <=
_pf1 + 1; n1++) {
116 for(
int n2 = 0; n2 <=
_pf2; n2++) {
117 faceBasis[faceIt][0] = 0;
118 faceBasis[faceIt][1] =
120 faceBasis[faceIt][2] = 0;
127 int const &flagOrientation,
int const &edgeNumber,
128 std::vector<std::vector<double> > &edgeFunctions,
129 const std::vector<std::vector<double> > &eTablePositiveFlag,
130 const std::vector<std::vector<double> > &eTableNegativeFlag)
132 if(flagOrientation == -1) {
135 for(
int i = 0; i <= edgeNumber; i++) { constant2 +=
_pOrderEdge[i] + 1; }
136 constant2 = constant2 - 1;
138 for(
int k = constant1; k <= constant2; k++) {
139 edgeFunctions[k][0] = eTableNegativeFlag[k][0];
140 edgeFunctions[k][1] = eTableNegativeFlag[k][1];
141 edgeFunctions[k][2] = eTableNegativeFlag[k][2];
147 for(
int i = 0; i <= edgeNumber; i++) { constant2 +=
_pOrderEdge[i] + 1; }
148 constant2 = constant2 - 1;
150 for(
int k = constant1; k <= constant2; k++) {
151 edgeFunctions[k][0] = eTablePositiveFlag[k][0];
152 edgeFunctions[k][1] = eTablePositiveFlag[k][1];
153 edgeFunctions[k][2] = eTablePositiveFlag[k][2];
158 std::vector<std::vector<double> > &edgeFunctions)
162 for(
int edgeNumber = 0; edgeNumber <
_nedge; edgeNumber++) {
165 for(
int i = 0; i <= edgeNumber; i++) { constant2 +=
_pOrderEdge[i] + 1; }
166 constant2 = constant2 - 1;
168 for(
int k = constant1; k <= constant2; k++) {
169 if((k - constant1) % 2 == 0) {
170 edgeFunctions[k][0] = edgeFunctions[k][0] * (-1);
171 edgeFunctions[k][1] = edgeFunctions[k][1] * (-1);
172 edgeFunctions[k][2] = edgeFunctions[k][2] * (-1);
179 double const &u,
double const &v,
double const &w,
180 std::vector<std::vector<double> > &edgeBasis,
181 std::vector<std::vector<double> > &faceBasis,
182 std::vector<std::vector<double> > &bubbleBasis)
184 double dlambda1 = 0.5;
185 double dlambda2 = -0.5;
186 double dlambda3 = 0.5;
187 double dlambda4 = -0.5;
188 std::vector<std::vector<double> > legendreVector(2);
189 legendreVector[0] = std::vector<double>(
_pf1 + 1);
190 legendreVector[1] = std::vector<double>(
_pf2 + 1);
191 for(
unsigned int k = 0; k < legendreVector[0].size(); k++) {
194 for(
unsigned int k = 0; k < legendreVector[1].size(); k++) {
198 for(
int i = 0; i <
_nedge; i++) {
221 for(
int iedge = 0; iedge <
_pOrderEdge[i] + 1; iedge++) {
222 for(
int j = 0; j < 3; j++) {
223 edgeBasis[edgeIt][j] =
224 dlambda * legendreVector[uv][iedge] *
direction[j];
230 for(
int n1 = 0; n1 <=
_pf1; n1++) {
231 for(
int n2 = 2; n2 <=
_pf2 + 1; n2++) {
232 faceBasis[faceIt][0] = 0;
233 faceBasis[faceIt][1] = 0;
234 faceBasis[faceIt][2] =
239 for(
int n1 = 2; n1 <=
_pf1 + 1; n1++) {
240 for(
int n2 = 0; n2 <=
_pf2; n2++) {
241 faceBasis[faceIt][0] = 0;
242 faceBasis[faceIt][1] = 0;
243 faceBasis[faceIt][2] =
250 double const &u,
double const &v,
double const &w,
int const &flag1,
251 int const &flag2,
int const &flag3,
int const &faceNumber,
252 std::vector<std::vector<double> > &faceFunctions, std::string typeFunction)
254 if(!(flag1 == 1 && flag2 == 1 && flag3 == 1)) {
257 for(
int it1 = 0; it1 <=
_pf1; it1++) {
258 for(
int it2 = 2; it2 <=
_pf2 + 1; it2++) {
261 if(flag1 == -1 && it1 % 2 == 0) { impactFlag1 = -1; }
262 if(flag2 == -1 && it2 % 2 != 0) { impactFlag2 = -1; }
263 faceFunctions[iterator][0] =
264 faceFunctions[iterator][0] * impactFlag1 * impactFlag2;
265 faceFunctions[iterator][1] =
266 faceFunctions[iterator][1] * impactFlag1 * impactFlag2;
267 faceFunctions[iterator][2] =
268 faceFunctions[iterator][2] * impactFlag1 * impactFlag2;
272 for(
int it1 = 2; it1 <=
_pf1 + 1; it1++) {
273 for(
int it2 = 0; it2 <=
_pf2; it2++) {
276 if(flag1 == -1 && it1 % 2 != 0) { impactFlag1 = -1; }
277 if(flag2 == -1 && it2 % 2 == 0) { impactFlag2 = -1; }
278 faceFunctions[iterator][0] =
279 faceFunctions[iterator][0] * impactFlag1 * impactFlag2;
280 faceFunctions[iterator][1] =
281 faceFunctions[iterator][1] * impactFlag1 * impactFlag2;
282 faceFunctions[iterator][2] =
283 faceFunctions[iterator][2] * impactFlag1 * impactFlag2;
289 if(typeFunction ==
"HcurlLegendre") {
290 std::vector<std::vector<double> > legendreVector(2);
291 legendreVector[0] = std::vector<double>(
_pf1 + 1);
292 legendreVector[1] = std::vector<double>(
_pf2 + 1);
293 for(
unsigned int k = 0; k < legendreVector[0].size(); k++) {
296 for(
unsigned int k = 0; k < legendreVector[1].size(); k++) {
301 for(
int it1 = 0; it1 <=
_pf2; it1++) {
302 for(
int it2 = 2; it2 <=
_pf1 + 1; it2++) {
305 if(flag2 == -1 && it1 % 2 == 0) { impactFlag1 = -1; }
306 if(flag1 == -1 && it2 % 2 != 0) { impactFlag2 = -1; }
307 faceFunctions[iterator][0] = 0;
308 faceFunctions[iterator][1] = legendreVector[1][it1] *
310 impactFlag1 * impactFlag2;
311 faceFunctions[iterator][2] = 0;
315 for(
int it1 = 2; it1 <=
_pf2 + 1; it1++) {
316 for(
int it2 = 0; it2 <=
_pf1; it2++) {
319 if(flag2 == -1 && it1 % 2 != 0) { impactFlag1 = -1; }
320 if(flag1 == -1 && it2 % 2 == 0) { impactFlag2 = -1; }
321 faceFunctions[iterator][0] = legendreVector[0][it2] *
323 impactFlag1 * impactFlag2;
324 faceFunctions[iterator][1] = 0;
325 faceFunctions[iterator][2] = 0;
330 else if(typeFunction ==
"CurlHcurlLegendre") {
331 std::vector<std::vector<double> > legendreVector(2);
332 legendreVector[0] = std::vector<double>(
_pf1 + 1);
333 legendreVector[1] = std::vector<double>(
_pf2 + 1);
334 for(
unsigned int k = 0; k < legendreVector[0].size(); k++) {
337 for(
unsigned int k = 0; k < legendreVector[1].size(); k++) {
341 for(
int it1 = 0; it1 <=
_pf2; it1++) {
342 for(
int it2 = 2; it2 <=
_pf1 + 1; it2++) {
345 if(flag2 == -1 && it1 % 2 == 0) { impactFlag1 = -1; }
346 if(flag1 == -1 && it2 % 2 != 0) { impactFlag2 = -1; }
347 faceFunctions[iterator][0] = 0;
348 faceFunctions[iterator][1] = 0;
349 faceFunctions[iterator][2] = legendreVector[1][it1] *
351 impactFlag1 * impactFlag2;
355 for(
int it1 = 2; it1 <=
_pf2 + 1; it1++) {
356 for(
int it2 = 0; it2 <=
_pf1; it2++) {
359 if(flag2 == -1 && it1 % 2 != 0) { impactFlag1 = -1; }
360 if(flag1 == -1 && it2 % 2 == 0) { impactFlag2 = -1; }
361 faceFunctions[iterator][0] = 0;
362 faceFunctions[iterator][1] = 0;
363 faceFunctions[iterator][2] = -legendreVector[0][it2] *
365 impactFlag1 * impactFlag2;
371 throw std::runtime_error(
"unknown typeFunction");
377 int const &flag1,
int const &flag2,
int const &flag3,
int const &faceNumber,
378 const std::vector<std::vector<double> > &quadFaceFunctionsAllOrientation,
379 const std::vector<std::vector<double> > &triFaceFunctionsAllOrientation,
380 std::vector<std::vector<double> > &fTableCopy)
385 fTableCopy[i][0] = quadFaceFunctionsAllOrientation[i + offset][0];
386 fTableCopy[i][1] = quadFaceFunctionsAllOrientation[i + offset][1];
387 fTableCopy[i][2] = quadFaceFunctionsAllOrientation[i + offset][2];
392 std::vector<int> &orderInfo)
395 for(
int numEdge = 0; numEdge < 4; numEdge++) {
397 functionTypeInfo[it] = 1;
402 for(
int n1 = 0; n1 <=
_pf1; n1++) {
403 for(
int n2 = 2; n2 <=
_pf2 + 1; n2++) {
404 functionTypeInfo[it] = 2;
405 orderInfo[it] = std::max(n1, n2);
409 for(
int n1 = 2; n1 <=
_pf1 + 1; n1++) {
410 for(
int n2 = 0; n2 <=
_pf2; n2++) {
411 functionTypeInfo[it] = 2;
412 orderInfo[it] = std::max(n1, n2);