17 MakeFaceNodeMapping(cell),
25 const double x = qpoint.
x;
26 const double y = qpoint.
y;
27 const double z = qpoint.
z;
30 if (i == 0)
return 1.0 - x - y - z;
40 const Vec3& qpoint)
const
43 if (i == 0)
return Vec3( -1.0, -1.0, -1.0);
44 if (i == 1)
return Vec3( 1.0, 0.0, 0.0);
45 if (i == 2)
return Vec3( 0.0, 1.0, 0.0);
46 if (i == 3)
return Vec3( 0.0, 0.0, 1.0);
60 const double x_i = node_i.x;
61 const double y_i = node_i.y;
62 const double z_i = node_i.z;
65 J[0][0] += grad_shape_i.
x * x_i;
66 J[0][1] += grad_shape_i.
y * x_i;
67 J[0][2] += grad_shape_i.
z * x_i;
69 J[1][0] += grad_shape_i.
x * y_i;
70 J[1][1] += grad_shape_i.
y * y_i;
71 J[1][2] += grad_shape_i.
z * y_i;
73 J[2][0] += grad_shape_i.
x * z_i;
74 J[2][1] += grad_shape_i.
y * z_i;
75 J[2][2] += grad_shape_i.
z * z_i;
81std::pair<double, LagrangeBaseMapping::Vec3>
83 size_t face_index,
const Vec3& qpoint_face)
const
91 for (
size_t i = 0; i < 3; ++i)
93 double dN_dxbar = 0.0, dN_dybar = 0.0;
96 if (i == 0) {dN_dxbar = -1.0; dN_dybar=-1.0; xi = x0;}
97 if (i == 1) {dN_dxbar = 1.0; dN_dybar= 0.0; xi = x1;}
98 if (i == 2) {dN_dxbar = 0.0; dN_dybar= 1.0; xi = x2;}
101 dx_dxbar += dN_dxbar * xi;
102 dx_dybar += dN_dybar * xi;
105 const auto cross = dx_dxbar.
Cross(dx_dybar);
106 const double detJ = cross.
Norm();
108 return {detJ, cross/detJ};
113 const Vec3& qpoint_face)
const
115 const double x = qpoint_face.
x;
116 const double y = qpoint_face.
y;
119 if (face_index == 0)
return Vec3(x, y, 0);
120 if (face_index == 1)
return Vec3(x, 0, y);
121 if (face_index == 2)
return Vec3(0, x, y);
122 if (face_index == 3)
return Vec3(x, y, 1.0 - x - y);
#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
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
LagrangeTetMapping(const chi_mesh::MeshContinuum &grid, const chi_mesh::Cell &cell, const Quadrature &volume_quadrature, const Quadrature &surface_quadrature)
Vec3 RefGradShape(uint32_t i, const Vec3 &qpoint) const override
MatDbl RefJacobian(const Vec3 &qpoint) const override
double RefShape(uint32_t i, const Vec3 &qpoint) const override
Vector3 Cross(const Vector3 &that) const