17 MakeFaceNodeMapping(cell),
29 if (i == 0) {a = -1.0; b=-1.0; c=-1.0;}
30 if (i == 1) {a = 1.0; b=-1.0; c=-1.0;}
31 if (i == 2) {a = 1.0; b= 1.0; c=-1.0;}
32 if (i == 3) {a = -1.0; b= 1.0; c=-1.0;}
34 if (i == 4) {a = -1.0; b=-1.0; c= 1.0;}
35 if (i == 5) {a = 1.0; b=-1.0; c= 1.0;}
36 if (i == 6) {a = 1.0; b= 1.0; c= 1.0;}
37 if (i == 7) {a = -1.0; b= 1.0; c= 1.0;}
40 (1.0 + a * qpoint.
x) * (1.0 + b * qpoint.
y) * (1.0 + c * qpoint.
z);
45 const Vec3& qpoint)
const
51 if (i == 0) {a = -1.0; b=-1.0; c=-1.0;}
52 if (i == 1) {a = 1.0; b=-1.0; c=-1.0;}
53 if (i == 2) {a = 1.0; b= 1.0; c=-1.0;}
54 if (i == 3) {a = -1.0; b= 1.0; c=-1.0;}
56 if (i == 4) {a = -1.0; b=-1.0; c= 1.0;}
57 if (i == 5) {a = 1.0; b=-1.0; c= 1.0;}
58 if (i == 6) {a = 1.0; b= 1.0; c= 1.0;}
59 if (i == 7) {a = -1.0; b= 1.0; c= 1.0;}
62 const double x = qpoint.
x;
63 const double y = qpoint.
y;
64 const double z = qpoint.
z;
66 return Vec3(0.125 * a * (1.0 + b * y) * (1.0 + c * z),
67 0.125 * b * (1.0 + a * x) * (1.0 + c * z),
68 0.125 * c * (1.0 + a * x) * (1.0 + b * y));
79 const double x_i = node_i.x;
80 const double y_i = node_i.y;
81 const double z_i = node_i.z;
84 J[0][0] += grad_shape_i.
x * x_i;
85 J[0][1] += grad_shape_i.
y * x_i;
86 J[0][2] += grad_shape_i.
z * x_i;
88 J[1][0] += grad_shape_i.
x * y_i;
89 J[1][1] += grad_shape_i.
y * y_i;
90 J[1][2] += grad_shape_i.
z * y_i;
92 J[2][0] += grad_shape_i.
x * z_i;
93 J[2][1] += grad_shape_i.
y * z_i;
94 J[2][2] += grad_shape_i.
z * z_i;
100std::pair<double, LagrangeBaseMapping::Vec3>
102 size_t face_index,
const Vec3& qpoint_face)
const
109 const double xbar = qpoint_face.
x;
110 const double ybar = qpoint_face.
y;
113 for (
size_t i = 0; i < 4; ++i)
118 if (i == 0) {a = -1.0; b=-1.0; xi = x0;}
119 if (i == 1) {a = 1.0; b=-1.0; xi = x1;}
120 if (i == 2) {a = 1.0; b= 1.0; xi = x2;}
121 if (i == 3) {a = -1.0; b= 1.0; xi = x3;}
124 const double ab = a * b;
125 dx_dxbar += 0.25 * (a + ab * ybar) * xi;
126 dx_dybar += 0.25 * (b + ab * xbar) * xi;
129 const auto cross = dx_dxbar.
Cross(dx_dybar);
130 const double detJ = cross.
Norm();
132 return {detJ, cross / detJ};
137 const Vec3& qpoint_face)
const
139 const double x = qpoint_face.
x + 1.0;
140 const double y = qpoint_face.
y + 1.0;
142 if (face_index == 0)
return Vec3( 1.0, -1.0, -1.0) +
Vec3(0.0, x, y);
143 if (face_index == 1)
return Vec3(-1.0, 1.0, -1.0) +
Vec3(0.0, -x, y);
144 if (face_index == 2)
return Vec3( 1.0, 1.0, -1.0) +
Vec3( -x,0.0, y);
145 if (face_index == 3)
return Vec3(-1.0, -1.0, -1.0) +
Vec3( x,0.0, y);
146 if (face_index == 4)
return Vec3(-1.0, -1.0, 1.0) +
Vec3( x, y,0.0);
147 if (face_index == 5)
return Vec3(-1.0, 1.0, -1.0) +
Vec3( x, -y,0.0);
#define ChiLogicalErrorIf(condition, message)
#define ChiLogicalError(message)
const std::vector< std::vector< int > > face_node_mappings_
const std::vector< chi_mesh::Vector3 > node_locations_
std::vector< double > VecDbl
std::vector< VecDbl > MatDbl
double RefShape(uint32_t i, const Vec3 &qpoint) const override
std::pair< double, Vec3 > RefFaceJacobianDeterminantAndNormal(size_t face_index, const Vec3 &qpoint_face) const override
MatDbl RefJacobian(const Vec3 &qpoint) const override
Vec3 FaceToElementQPointConversion(size_t face_index, const Vec3 &qpoint_face) const override
Vec3 RefGradShape(uint32_t i, const Vec3 &qpoint) const override
LagrangeHexMapping(const chi_mesh::MeshContinuum &grid, const chi_mesh::Cell &cell, const Quadrature &volume_quadrature, const Quadrature &surface_quadrature)
Vector3 Cross(const Vector3 &that) const