43 dealii::Mapping<dim>
const & mapping,
44 MPI_Comm
const & mpi_comm)
46 double min_cell_diameter = std::numeric_limits<double>::max();
48 for(
auto const & cell : triangulation.active_cell_iterators())
50 if(cell->is_locally_owned())
52 auto const vertices = mapping.get_vertices(cell);
53 for(
unsigned int i = 0; i < vertices.size(); ++i)
54 for(
unsigned int j = i + 1; j < vertices.size(); ++j)
55 min_cell_diameter = std::min(min_cell_diameter, vertices[i].distance(vertices[j]));
59 return dealii::Utilities::MPI::min(min_cell_diameter, mpi_comm);
69 unsigned int const dim,
70 ElementType
const & element_type)
72 if(element_type == ElementType::Hypercube)
75 return std::exp(std::log(element_volume) / (
double)dim);
77 else if(element_type == ElementType::Simplex)
84 factor = 4.0 / std::sqrt(3.0);
86 factor = 6.0 * std::sqrt(2.0);
88 AssertThrow(
false, dealii::ExcMessage(
"Only dim = 2, 3 implemented."));
90 return std::exp(std::log(element_volume * factor) / (
double)dim);
95 dealii::ExcMessage(
"This function is not implemented for the given ElementType."));
96 return std::exp(std::log(element_volume) / (
double)dim);
Number calculate_high_order_element_length(Number const element_length, unsigned int const fe_degree, bool const is_dg)
Definition calculate_characteristic_element_length.h:108
double calculate_minimum_vertex_distance(dealii::Triangulation< dim > const &triangulation, dealii::Mapping< dim > const &mapping, MPI_Comm const &mpi_comm)
Definition calculate_characteristic_element_length.h:42
Number calculate_characteristic_element_length(Number const element_volume, unsigned int const dim, ElementType const &element_type)
Definition calculate_characteristic_element_length.h:68