Skip to content
Snippets Groups Projects
Commit b130d8c4 authored by Dr. Felix Tobias Schindler's avatar Dr. Felix Tobias Schindler
Browse files

[operators.prolongations] add safe integer conversion

parent 88c2aa01
No related branches found
No related tags found
No related merge requests found
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
#include <vector> #include <vector>
#include <limits> #include <limits>
#include <boost/numeric/conversion/cast.hpp>
#include <dune/common/dynmatrix.hh> #include <dune/common/dynmatrix.hh>
#include <dune/stuff/common/type_utils.hh> #include <dune/stuff/common/type_utils.hh>
...@@ -155,9 +157,9 @@ private: ...@@ -155,9 +157,9 @@ private:
LocalVectorType local_vector(local_basis.size(), RangeFieldType(0)); LocalVectorType local_vector(local_basis.size(), RangeFieldType(0));
LocalVectorType local_DoFs(local_basis.size(), RangeFieldType(0)); LocalVectorType local_DoFs(local_basis.size(), RangeFieldType(0));
// create quadrature // create quadrature
const size_t integrand_order = std::max(source_order, local_basis.order()) + local_basis.order(); const auto integrand_order = std::max(source_order, local_basis.order()) + local_basis.order();
assert(integrand_order < std::numeric_limits<int>::max()); const auto& quadrature =
const auto& quadrature = QuadratureRules<DomainFieldType, dimDomain>::rule(entity.type(), int(integrand_order)); QuadratureRules<DomainFieldType, dimDomain>::rule(entity.type(), boost::numeric_cast<int>(integrand_order));
// get global quadrature points // get global quadrature points
std::vector<DomainType> quadrature_points; std::vector<DomainType> quadrature_points;
for (const auto& quadrature_point : quadrature) for (const auto& quadrature_point : quadrature)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment