Chi-Tech
chi_grid_face_histogram.cc
Go to the documentation of this file.
2
3#include "chi_runtime.h"
4#include "chi_log.h"
5
6namespace chi_mesh
7{
8
9/**Returns the number of bins.*/
11{
12 return face_categories_.size();
13}
14
15/**Finds which bin holds the given number of vertices*/
16size_t GridFaceHistogram::MapFaceHistogramBins(size_t num_face_verts) const
17{
18 size_t category_counter = -1;
19 for (auto category : face_categories_)
20 {
21 category_counter++;
22 if (num_face_verts <= category.first)
23 return category_counter;
24 }
25
26 return 0;
27}
28
29/**Finds the amount of vertices per face for the given bin.*/
30size_t GridFaceHistogram::GetFaceHistogramBinDOFSize(size_t bin_number) const
31{
32 size_t face_dof_size;
33
34 try {
35 face_dof_size = face_categories_.at(bin_number).first;
36 }
37 catch (std::out_of_range& o){
39 << "Fault detected in chi_mesh::MeshContinuum::"
40 << "GetFaceHistogramBinDOFSize.";
41 return 0;
42 }
43
44 return face_dof_size;
45}
46
47}//namespace chi_mesh
static chi::ChiLog & log
Definition: chi_runtime.h:81
LogStream LogAllWarning()
Definition: chi_log.h:238
std::vector< std::pair< size_t, size_t > > face_categories_
size_t GetFaceHistogramBinDOFSize(size_t bin_number) const
size_t MapFaceHistogramBins(size_t num_face_verts) const