Chi-Tech
LagrangeSlabMapping.cc
Go to the documentation of this file.
2
4
6
8{
9
11 const chi_mesh::Cell& cell,
12 const Quadrature& volume_quadrature,
13 const Quadrature& surface_quadrature)
15 cell,
16 2,
17 MakeFaceNodeMapping(cell),
18 volume_quadrature,
19 surface_quadrature)
20
21{
22}
23
24double LagrangeSlabMapping::RefShape(uint32_t i, const Vec3& qpoint) const
25{
26 if (i == 0) return 0.5 * (1.0 - qpoint.x);
27 if (i == 1) return 0.5 * (1.0 + qpoint.x);
28
29 ChiLogicalError("Invalid shapefunction index " + std::to_string(i));
30}
31
33 const Vec3& qpoint) const
34{
35 if (i == 0) return Vec3(0.0, 0.0, -0.5);
36 if (i == 1) return Vec3(0.0, 0.0, 0.5);
37
38 ChiLogicalError("Invalid shapefunction index " + std::to_string(i));
39}
40
43{
44 const double zz = 0.5 * (node_locations_[1] - node_locations_[0]).Norm();
45 return {{1.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 0.0, zz}};
46}
47
48std::pair<double, LagrangeBaseMapping::Vec3>
50 size_t face_index, const Vec3& qpoint_face) const
51{
52 return {1.0, cell_.faces_[face_index].normal_};
53}
54
56 size_t face_index, const Vec3& qpoint_face) const
57{
58 if (face_index == 0) return Vec3(-1.0, 0.0, 0.0);
59 if (face_index == 1) return Vec3(1.0, 0.0, 0.0);
60
61 ChiLogicalError("Invalid face index " + std::to_string(face_index));
62}
63
64} // namespace chi_math::cell_mapping
#define ChiLogicalError(message)
const std::vector< chi_mesh::Vector3 > node_locations_
Definition: CellMapping.h:121
const chi_mesh::Cell & cell_
Definition: CellMapping.h:118
double RefShape(uint32_t i, const Vec3 &qpoint) const override
Vec3 RefGradShape(uint32_t i, const Vec3 &qpoint) const override
Vec3 FaceToElementQPointConversion(size_t face_index, const Vec3 &qpoint_face) const override
LagrangeSlabMapping(const chi_mesh::MeshContinuum &grid, const chi_mesh::Cell &cell, const Quadrature &volume_quadrature, const Quadrature &surface_quadrature)
MatDbl RefJacobian(const Vec3 &qpoint) const override
std::pair< double, Vec3 > RefFaceJacobianDeterminantAndNormal(size_t face_index, const Vec3 &qpoint_face) const override
std::vector< CellFace > faces_
Definition: cell.h:82
double x
Element-0.