19 MakeFaceNodeMapping(cell),
22 aux_surface_quadrature_(aux_surface_quadrature)
28 const double x = qpoint.
x;
29 const double y = qpoint.
y;
30 const double z = qpoint.
z;
33 if (i == 0)
return (1.0 - x - y) * 0.5 * (1.0 - z);
34 if (i == 1)
return x * 0.5 * (1.0 - z);
35 if (i == 2)
return y * 0.5 * (1.0 - z);
37 if (i == 3)
return (1.0 - x - y) * 0.5 * (1.0 + z);
38 if (i == 4)
return x * 0.5 * (1.0 + z);
39 if (i == 5)
return y * 0.5 * (1.0 + z);
46 const Vec3& qpoint)
const
49 const double x = qpoint.
x;
50 const double y = qpoint.
y;
51 const double z = qpoint.
z;
54 if (i == 0)
return Vec3(-0.5 * (1.0 - z), -0.5 * (1.0 - z), -0.5 * (1.0 - x - y));
55 if (i == 1)
return Vec3( 0.5 * (1.0 - z), 0.0, -0.5 * x);
56 if (i == 2)
return Vec3( 0.0, 0.5 * (1.0 - z), -0.5 * y);
58 if (i == 3)
return Vec3(-0.5 * (1.0 + z), -0.5 * (1.0 + z), 0.5 * (1.0 - x - y));
59 if (i == 4)
return Vec3( 0.5 * (1.0 + z), 0.0, 0.5 * x);
60 if (i == 5)
return Vec3( 0.0, 0.5 * (1.0 + z), 0.5 * y);
74 const double x_i = node_i.x;
75 const double y_i = node_i.y;
76 const double z_i = node_i.z;
79 J[0][0] += grad_shape_i.
x * x_i;
80 J[0][1] += grad_shape_i.
y * x_i;
81 J[0][2] += grad_shape_i.
z * x_i;
83 J[1][0] += grad_shape_i.
x * y_i;
84 J[1][1] += grad_shape_i.
y * y_i;
85 J[1][2] += grad_shape_i.
z * y_i;
87 J[2][0] += grad_shape_i.
x * z_i;
88 J[2][1] += grad_shape_i.
y * z_i;
89 J[2][2] += grad_shape_i.
z * z_i;
95std::pair<double, LagrangeBaseMapping::Vec3>
97 size_t face_index,
const Vec3& qpoint_face)
const
106 const double xbar = qpoint_face.
x;
107 const double ybar = qpoint_face.
y;
110 for (
size_t i = 0; i < 4; ++i)
115 if (i == 0) {a = -1.0; b=-1.0; xi = x0;}
116 if (i == 1) {a = 1.0; b=-1.0; xi = x1;}
117 if (i == 2) {a = 1.0; b= 1.0; xi = x2;}
118 if (i == 3) {a = -1.0; b= 1.0; xi = x3;}
121 const double ab = a * b;
122 dx_dxbar += 0.25 * (a + ab * ybar) * xi;
123 dx_dybar += 0.25 * (b + ab * xbar) * xi;
126 const auto cross = dx_dxbar.
Cross(dx_dybar);
128 return {cross.
Norm(), cross.Normalized()};
138 for (
size_t i = 0; i < 3; ++i)
140 double dN_dxbar, dN_dybar;
143 if (i == 0) {dN_dxbar = -1.0; dN_dybar=-1.0; xi = x0;}
144 if (i == 1) {dN_dxbar = 1.0; dN_dybar= 0.0; xi = x1;}
145 if (i == 2) {dN_dxbar = 0.0; dN_dybar= 1.0; xi = x2;}
148 dx_dxbar += dN_dxbar * xi;
149 dx_dybar += dN_dybar * xi;
152 const auto cross = dx_dxbar.
Cross(dx_dybar);
153 const double detJ = cross.
Norm();
155 return {detJ, cross/detJ};
160 size_t face_index,
const Vec3& qpoint_face)
const
165 const double x = 0.5*(qpoint_face.
x + 1.0);
166 const double y = qpoint_face.
y + 1.0;
169 if (face_index == 0)
return Vec3( x, 0.0, -1.0 + y);
170 if (face_index == 1)
return Vec3(1.0-x, x, -1.0 + y);
171 if (face_index == 2)
return Vec3( 0.0, 1.0-x, -1.0 + y);
176 const double x = qpoint_face.
x;
177 const double y = qpoint_face.
y;
179 if (face_index == 3)
return Vec3( x, y, 1.0);
180 if (face_index == 4)
return Vec3( x, y, -1.0);
#define ChiLogicalError(message)
const std::vector< std::vector< int > > face_node_mappings_
const std::vector< chi_mesh::Vector3 > node_locations_
std::vector< double > VecDbl
const Quadrature & surface_quadrature_
std::vector< VecDbl > MatDbl
MatDbl RefJacobian(const Vec3 &qpoint) const override
const Quadrature & GetSurfaceQuadrature(size_t face_index) const override
Vec3 RefGradShape(uint32_t i, const Vec3 &qpoint) const override
const Quadrature & aux_surface_quadrature_
Vec3 FaceToElementQPointConversion(size_t face_index, const Vec3 &qpoint_face) const override
std::pair< double, Vec3 > RefFaceJacobianDeterminantAndNormal(size_t face_index, const Vec3 &qpoint_face) const override
double RefShape(uint32_t i, const Vec3 &qpoint) const override
LagrangeWedgeMapping(const chi_mesh::MeshContinuum &grid, const chi_mesh::Cell &cell, const Quadrature &volume_quadrature, const Quadrature &surface_quadrature, const Quadrature &aux_surface_quadrature)
Vector3 Cross(const Vector3 &that) const