Skip to content
Snippets Groups Projects
Commit 8b7065cb authored by Nicolas Marsic's avatar Nicolas Marsic
Browse files

HexNodeBasis: face contribution (missing test)

parent 38f41779
No related branches found
No related tags found
No related merge requests found
...@@ -131,10 +131,34 @@ HexNodeBasis::HexNodeBasis(const int order){ ...@@ -131,10 +131,34 @@ HexNodeBasis::HexNodeBasis(const int order){
int face3[6] = {2, 6, 5, 4, 7, 3}; int face3[6] = {2, 6, 5, 4, 7, 3};
int face4[6] = {3, 2, 1, 5, 4, 0}; int face4[6] = {3, 2, 1, 5, 4, 0};
// 'Xi' Function
Polynomial* xi = new Polynomial[6];
for(int f = 0; f < 6; f++)
xi[f] = lifting[face1[f]] - lifting[face2[f]];
// 'Eta' Function
Polynomial* eta = new Polynomial[6];
for(int f = 0; f < 6; f++)
eta[f] = lifting[face1[f]] - lifting[face4[f]];
// 'Lambda' Function
Polynomial* lambda = new Polynomial[6];
for(int f = 0; f < 6; f++)
lambda[f] =
(*basis)[face1[f]] +
(*basis)[face2[f]] +
(*basis)[face3[f]] +
(*basis)[face4[f]];
for(int l1 = 1; l1 < order; l1++){ for(int l1 = 1; l1 < order; l1++){
for(int l2 = 1; l2 < order; l2++){ for(int l2 = 1; l2 < order; l2++){
for(int f = 0; f < 6; f++){ for(int f = 0; f < 6; f++){
(*basis)[i] = Polynomial(42, 0, 0, 0); (*basis)[i] =
legendre[l1].compose(xi[f]) *
legendre[l2].compose(eta[f]) *
lambda[f];
i++; i++;
} }
...@@ -154,7 +178,8 @@ HexNodeBasis::HexNodeBasis(const int order){ ...@@ -154,7 +178,8 @@ HexNodeBasis::HexNodeBasis(const int order){
for(int l1 = 1; l1 < order; l1++){ for(int l1 = 1; l1 < order; l1++){
for(int l2 = 1; l2 < order; l2++){ for(int l2 = 1; l2 < order; l2++){
for(int l3 = 1; l3 < order; l3++){ for(int l3 = 1; l3 < order; l3++){
(*basis)[i] = legendre[l1].compose(px) * (*basis)[i] =
legendre[l1].compose(px) *
legendre[l2].compose(py) * legendre[l2].compose(py) *
legendre[l3].compose(pz); legendre[l3].compose(pz);
...@@ -167,13 +192,17 @@ HexNodeBasis::HexNodeBasis(const int order){ ...@@ -167,13 +192,17 @@ HexNodeBasis::HexNodeBasis(const int order){
// Free Temporary Sapce // // Free Temporary Sapce //
delete[] legendre; delete[] legendre;
delete[] lifting; delete[] lifting;
delete[] xi;
delete[] eta;
delete[] lambda;
} }
HexNodeBasis::~HexNodeBasis(void){ HexNodeBasis::~HexNodeBasis(void){
delete basis; delete basis;
} }
/*
#include <cstdio> #include <cstdio>
int main(void){ int main(void){
...@@ -244,4 +273,4 @@ int main(void){ ...@@ -244,4 +273,4 @@ int main(void){
*/ */
return 0; return 0;
} }
*/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment