Select Git revision
meshGFaceExtruded.cpp
Forked from
gmsh / gmsh
Source project has a limited visibility.
-
Christophe Geuzaine authoredChristophe Geuzaine authored
HierarchicalBasisH1Brick.cpp 22.37 KiB
// Gmsh - Copyright (C) 1997-2019 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
//
// Contributed by Ismail Badia.
// Reference : "Higher-Order Finite Element Methods"; Pavel Solin, Karel
// Segeth ,
// Ivo Dolezel , Chapman and Hall/CRC; Edition : Har/Cdr (2003).
#include "HierarchicalBasisH1Brick.h"
HierarchicalBasisH1Brick::HierarchicalBasisH1Brick(int order)
{
_pb1 = order;
_pb2 = order;
_pb3 = order;
for(int i = 0; i < 12; i++) { _pOrderEdge[i] = order; }
for(int j = 0; j < 6; j++) {
_pOrderFace1[j] = order;
_pOrderFace2[j] = order;
}
_nvertex = 8;
_nedge = 12;
_nfaceQuad = 6;
_nfaceTri = 0;
_nVertexFunction = 8;
_nEdgeFunction = 12 * order - 12;
_nQuadFaceFunction = 6 * (order - 1) * (order - 1);
_nTriFaceFunction = 0;
_nBubbleFunction = (order - 1) * (order - 1) * (order - 1);
}
HierarchicalBasisH1Brick::~HierarchicalBasisH1Brick() {}
double HierarchicalBasisH1Brick::_affineCoordinate(const int &j,
const double &u,
const double &v,
const double &w)
{
switch(j) {
case(1): return 0.5 * (1 + u);
case(2): return 0.5 * (1 - u);
case(3): return 0.5 * (1 + v);
case(4): return 0.5 * (1 - v);
case(5): return 0.5 * (1 + w);
case(6): return 0.5 * (1 - w);
default: throw std::string("j must be : 1<=j<=6");
}
}
inline void HierarchicalBasisH1Brick::_someProduct(double const &u,
double const &v,
double const &w,
std::vector<double> &product,
std::vector<double> &lambda)
{
lambda[0] = _affineCoordinate(1, u, v, w);
lambda[1] = _affineCoordinate(2, u, v, w);
lambda[2] = _affineCoordinate(3, u, v, w);
lambda[3] = _affineCoordinate(4, u, v, w);
lambda[4] = _affineCoordinate(5, u, v, w);
lambda[5] = _affineCoordinate(6, u, v, w);
product[0] = lambda[3] * lambda[5];
product[1] = lambda[1] * lambda[5];
product[2] = lambda[1] * lambda[3];
product[3] = lambda[0] * lambda[5];
product[4] = lambda[3] * lambda[0];
product[5] = lambda[2] * lambda[5];
product[6] = lambda[2] * lambda[0];
product[7] = lambda[2] * lambda[1];