diff --git a/dune/gdt/local/finite-elements/default.hh b/dune/gdt/local/finite-elements/default.hh index afcc6eabddb5926f50eb887cc97e92fd189adc58..f84c836d9c6e8d917108600a9944534a0537b690 100644 --- a/dune/gdt/local/finite-elements/default.hh +++ b/dune/gdt/local/finite-elements/default.hh @@ -180,7 +180,7 @@ public: // TODO: Double checked locking pattern is not thread-safe without memory barriers. if (fes_.count(key) == 0) { // the FE needs to be created, we need to lock - std::lock_guard<std::mutex> DXTC_UNUSED(guard)(mutex_); + std::lock_guard<std::mutex> DXTC_UNUSED(guard){mutex_}; // and to check again if someone else created the FE while we were waiting to acquire the lock if (fes_.count(key) == 0) fes_[key] = factory_(geometry_type, order); diff --git a/dune/gdt/local/finite-elements/flattop.hh b/dune/gdt/local/finite-elements/flattop.hh index 8d7723d54a12c54235a3fae01acaca722a3c188c..da54091a059d29304a4367cc14b9bccc5832e29c 100644 --- a/dune/gdt/local/finite-elements/flattop.hh +++ b/dune/gdt/local/finite-elements/flattop.hh @@ -24,6 +24,9 @@ namespace GDT { /** + * Inspired by [Brenner, Davis, Sung, 2014, A partition of unity method for the displacement obstacle problem of clamped + * Kirchhoff plates], section 2 + * * \sa LocalFlatTop2dCubeFiniteElement * \sa LocalFlatTopFiniteElementFactory */ @@ -41,6 +44,9 @@ public: LocalFlatTop2dCubeFiniteElementBasis(const double& overlap = 0.5) : geometry_type_(Dune::GeometryTypes::cube(2)) { + DUNE_THROW_IF( + !(overlap > 0.), Exceptions::finite_element_error, "Overlap has to be in (0, 1], is " << overlap << "!"); + DUNE_THROW_IF(overlap > 1., Exceptions::finite_element_error, "Overlap has to be in (0, 1], is " << overlap << "!"); // we cannot let L_ and R_ be members and define phi_L_ and phi_R_ in the ctor initializer list, as they will // copy/reference broken/empty/default L_ and R_ const auto L_ = (1. - overlap) / 2.;