25 double sum_of_sqr(0.0);
27 std::size_t n_sampling(0);
32 for (
auto element : elements)
34 std::size_t
const n_edges(element->getNumberOfEdges());
35 for (std::size_t k(0); k < n_edges; k++)
39 double const len = edge->getContent();
42 sum_of_sqr += len * len;
44 n_sampling += n_edges;
51 auto const [min, max] =
53 sum += std::sqrt(min);
59 const double mean(sum / n_sampling);
60 const double variance((sum_of_sqr - (sum * sum) / n_sampling) /
69 if (variance < mean * mean / 4)
80 "[MeshNodeSearcher::MeshNodeSearcher] Calculated search length for "
81 "mesh '{:s}' is {:f}.",
Definition of the Element class.
Interface for heuristic search length strategy.
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
std::vector< Element * > const & getElements() const
Get the element-vector for the mesh.
const std::string getName() const
Get name of the mesh.
std::size_t getNumberOfElements() const
Get the number of elements.
std::pair< double, double > computeSqrNodeDistanceRange(MeshLib::Element const &element, bool const check_allnodes)
Compute the minimum and maximum node distances for this element.