Chi-Tech
FiniteVolumeMapping.h
Go to the documentation of this file.
1#ifndef CELL_FVDATA_BASE_H
2#define CELL_FVDATA_BASE_H
3
4#include <utility>
5
6#include "CellMapping.h"
7
8#include "mesh/Cell/cell.h"
9
11
12// ######################################################### Class def
14{
15
16/**Cell mapping for a finite volume representation of a cell.
17* \ingroup doc_CellMappings*/
19{
20public:
22 const chi_mesh::Cell& cell,
23 const chi_mesh::Vector3& cc,
24 std::vector<std::vector<int>> face_node_mappings)
25 : CellMapping(grid,
26 cell,
27 1,
28 {cell.centroid_},
29 std::move(face_node_mappings),
31 {
32 }
33
34 // 02 Shapefuncs
35 double ShapeValue(int i, const chi_mesh::Vector3& xyz) const override
36 {
37 if (ref_grid_.CheckPointInsideCell(cell_, xyz)) return 1.0;
38 else
39 return 0.0;
40 }
42 std::vector<double>& shape_values) const override
43 {
45 shape_values.assign(num_nodes_, 1.0);
46 else
47 shape_values.assign(num_nodes_, 0.0);
48 }
50 const chi_mesh::Vector3& xyz) const override
51 {
52 return chi_mesh::Vector3(0.0, 0.0, 0.0);
53 }
55 const chi_mesh::Vector3& xyz,
56 std::vector<chi_mesh::Vector3>& gradshape_values) const override
57 {
58 gradshape_values.assign(num_nodes_, chi_mesh::Vector3(0, 0, 0));
59 }
60
61 // 03 Quadrature
63 MakeVolumetricQuadraturePointData() const override;
64
66 MakeSurfaceQuadraturePointData(size_t face_index) const override;
67};
68
69} // namespace chi_math::cell_mapping
70
71#endif
static void ComputeCellVolumeAndAreas(const chi_mesh::MeshContinuum &grid, const chi_mesh::Cell &cell, double &volume, std::vector< double > &areas)
Definition: CellMapping.cc:67
const chi_mesh::MeshContinuum & ref_grid_
Definition: CellMapping.h:117
const size_t num_nodes_
Definition: CellMapping.h:120
const chi_mesh::Cell & cell_
Definition: CellMapping.h:118
finite_element::SurfaceQuadraturePointData MakeSurfaceQuadraturePointData(size_t face_index) const override
double ShapeValue(int i, const chi_mesh::Vector3 &xyz) const override
finite_element::VolumetricQuadraturePointData MakeVolumetricQuadraturePointData() const override
chi_mesh::Vector3 GradShapeValue(int i, const chi_mesh::Vector3 &xyz) const override
FiniteVolumeMapping(const chi_mesh::MeshContinuum &grid, const chi_mesh::Cell &cell, const chi_mesh::Vector3 &cc, std::vector< std::vector< int > > face_node_mappings)
void ShapeValues(const chi_mesh::Vector3 &xyz, std::vector< double > &shape_values) const override
void GradShapeValues(const chi_mesh::Vector3 &xyz, std::vector< chi_mesh::Vector3 > &gradshape_values) const override
Vertex centroid_
Definition: cell.h:78
bool CheckPointInsideCell(const chi_mesh::Cell &cell, const chi_mesh::Vector3 &point) const
VectorN< 3 > Vector3