diff --git a/dune/xt/functions/grid-function.hh b/dune/xt/functions/grid-function.hh index f4d30443642bd67c78080ce9fd41c9d20bb3f023..0fd72df5010d446b5e100a17d18ceab232774f5b 100644 --- a/dune/xt/functions/grid-function.hh +++ b/dune/xt/functions/grid-function.hh @@ -126,31 +126,38 @@ public: using typename BaseType::LocalFunctionType; GridFunction(const typename RangeTypeSelector<R, r, rC>::type& value) - : storage_(new FunctionAsGridFunctionWrapper<E, r, rC, R>(new ConstantFunction<d, r, rC, R>(value))) + : BaseType() + , storage_(new FunctionAsGridFunctionWrapper<E, r, rC, R>(new ConstantFunction<d, r, rC, R>(value))) {} GridFunction(const FunctionInterface<d, r, rC, R>& func) - : storage_(new FunctionAsGridFunctionWrapper<E, r, rC, R>(func)) + : BaseType() + , storage_(new FunctionAsGridFunctionWrapper<E, r, rC, R>(func)) {} GridFunction(FunctionInterface<d, r, rC, R>*&& func_ptr) - : storage_(new FunctionAsGridFunctionWrapper<E, r, rC, R>(std::move(func_ptr))) + : BaseType() + , storage_(new FunctionAsGridFunctionWrapper<E, r, rC, R>(std::move(func_ptr))) {} GridFunction(const GridFunctionInterface<E, r, rC, R>& func) - : storage_(func) + : BaseType() + , storage_(func) {} GridFunction(GridFunctionInterface<E, r, rC, R>*&& func_ptr) - : storage_(std::move(func_ptr)) + : BaseType() + , storage_(std::move(func_ptr)) {} GridFunction(const ThisType& other) - : storage_(other.storage_) + : BaseType(other) + , storage_(other.storage_) {} GridFunction(ThisType&& source) - : storage_(std::move(source.storage_)) + : BaseType(source) + , storage_(std::move(source.storage_)) {} std::unique_ptr<LocalFunctionType> local_function() const override final @@ -192,58 +199,70 @@ public: using typename BaseType::LocalFunctionType; GridFunction(const R& value) - : storage_(new ProductGridFunction<GridFunction<E, 1, 1, R>, GridFunctionInterface<E, r, r, R>>( + : BaseType() + , storage_(new ProductGridFunction<GridFunction<E, 1, 1, R>, GridFunctionInterface<E, r, r, R>>( new GridFunction<E, 1, 1, R>(value), std::move(unit_matrix()), "")) {} GridFunction(const FieldMatrix<R, r, r>& value) // <- Must not be XT::Common::FieldMatrix! - : storage_(new FunctionAsGridFunctionWrapper<E, r, r, R>(new ConstantFunction<d, r, r, R>(value))) + : BaseType() + , storage_(new FunctionAsGridFunctionWrapper<E, r, r, R>(new ConstantFunction<d, r, r, R>(value))) {} GridFunction(const FunctionInterface<d, 1, 1, R>& func) - : storage_(new ProductGridFunction<FunctionAsGridFunctionWrapper<E, 1, 1, R>, GridFunctionInterface<E, r, r, R>>( + : BaseType() + , storage_(new ProductGridFunction<FunctionAsGridFunctionWrapper<E, 1, 1, R>, GridFunctionInterface<E, r, r, R>>( new FunctionAsGridFunctionWrapper<E, 1, 1, R>(func), std::move(unit_matrix()), func.name())) {} GridFunction(FunctionInterface<d, 1, 1, R>*&& func_ptr) - : storage_(new ProductGridFunction<FunctionAsGridFunctionWrapper<E, 1, 1, R>, GridFunctionInterface<E, r, r, R>>( + : BaseType() + , storage_(new ProductGridFunction<FunctionAsGridFunctionWrapper<E, 1, 1, R>, GridFunctionInterface<E, r, r, R>>( new FunctionAsGridFunctionWrapper<E, 1, 1, R>(std::move(func_ptr)), std::move(unit_matrix()), func_ptr->name())) {} GridFunction(const FunctionInterface<d, r, r, R>& func) - : storage_(new FunctionAsGridFunctionWrapper<E, r, r, R>(func)) + : BaseType() + , storage_(new FunctionAsGridFunctionWrapper<E, r, r, R>(func)) {} GridFunction(FunctionInterface<d, r, r, R>*&& func_ptr) - : storage_(new FunctionAsGridFunctionWrapper<E, r, r, R>(std::move(func_ptr))) + : BaseType() + , storage_(new FunctionAsGridFunctionWrapper<E, r, r, R>(std::move(func_ptr))) {} GridFunction(const GridFunctionInterface<E, 1, 1, R>& func) - : storage_(new ProductGridFunction<GridFunction<E, 1, 1, R>, GridFunctionInterface<E, r, r, R>>( + : BaseType() + , storage_(new ProductGridFunction<GridFunction<E, 1, 1, R>, GridFunctionInterface<E, r, r, R>>( new GridFunction<E, 1, 1, R>(func), std::move(unit_matrix()), func.name())) {} GridFunction(GridFunctionInterface<E, 1, 1, R>*&& func_ptr) - : storage_(new ProductGridFunction<GridFunctionInterface<E, 1, 1, R>, GridFunctionInterface<E, r, r, R>>( + : BaseType() + , storage_(new ProductGridFunction<GridFunctionInterface<E, 1, 1, R>, GridFunctionInterface<E, r, r, R>>( std::move(func_ptr), std::move(unit_matrix()), func_ptr->name())) {} GridFunction(const GridFunctionInterface<E, r, r, R>& func) - : storage_(func) + : BaseType() + , storage_(func) {} GridFunction(GridFunctionInterface<E, r, r, R>*&& func_ptr) - : storage_(std::move(func_ptr)) + : BaseType() + , storage_(std::move(func_ptr)) {} GridFunction(const ThisType& other) - : storage_(other.storage_) + : BaseType(other) + , storage_(other.storage_) {} GridFunction(ThisType&& source) - : storage_(std::move(source.storage_)) + : BaseType(source) + , storage_(std::move(source.storage_)) {} std::unique_ptr<LocalFunctionType> local_function() const override final @@ -279,35 +298,43 @@ public: using typename BaseType::LocalFunctionType; GridFunction(const R& value) - : storage_(new FunctionAsGridFunctionWrapper<E, 1, 1, R>(new ConstantFunction<d, 1, 1, R>(value))) + : BaseType() + , storage_(new FunctionAsGridFunctionWrapper<E, 1, 1, R>(new ConstantFunction<d, 1, 1, R>(value))) {} GridFunction(const FieldVector<R, 1>& value) // <- Must not be XT::Common::FieldVector! - : storage_(new FunctionAsGridFunctionWrapper<E, 1, 1, R>(new ConstantFunction<d, 1, 1, R>(value))) + : BaseType() + , storage_(new FunctionAsGridFunctionWrapper<E, 1, 1, R>(new ConstantFunction<d, 1, 1, R>(value))) {} GridFunction(const FunctionInterface<d, 1, 1, R>& func) - : storage_(new FunctionAsGridFunctionWrapper<E, 1, 1, R>(func)) + : BaseType() + , storage_(new FunctionAsGridFunctionWrapper<E, 1, 1, R>(func)) {} GridFunction(FunctionInterface<d, 1, 1, R>*&& func_ptr) - : storage_(new FunctionAsGridFunctionWrapper<E, 1, 1, R>(std::move(func_ptr))) + : BaseType() + , storage_(new FunctionAsGridFunctionWrapper<E, 1, 1, R>(std::move(func_ptr))) {} GridFunction(const GridFunctionInterface<E, 1, 1, R>& func) - : storage_(func) + : BaseType() + , storage_(func) {} GridFunction(GridFunctionInterface<E, 1, 1, R>*&& func_ptr) - : storage_(std::move(func_ptr)) + : BaseType() + , storage_(std::move(func_ptr)) {} GridFunction(const ThisType& other) - : storage_(other.storage_) + : BaseType(other) + , storage_(other.storage_) {} GridFunction(ThisType&& source) - : storage_(std::move(source.storage_)) + : BaseType(source) + , storage_(std::move(source.storage_)) {} std::unique_ptr<LocalFunctionType> local_function() const override final diff --git a/dune/xt/grid/boundaryinfo/interfaces.hh b/dune/xt/grid/boundaryinfo/interfaces.hh index d7c26da5b079aeecc2f0bcf7fa75ba8961017e61..44c19e4409ef3267d5124071767c537a2dc17f37 100644 --- a/dune/xt/grid/boundaryinfo/interfaces.hh +++ b/dune/xt/grid/boundaryinfo/interfaces.hh @@ -76,12 +76,8 @@ public: typedef Common::FieldVector<DomainFieldType, dimDomain> DomainType; typedef Common::FieldVector<DomainFieldType, dimWorld> WorldType; - BoundaryInfo(const std::string& logging_prefix = "", - const std::string& logging_id = "", - const bool logging_disabled = true) - : Logger(logging_prefix.empty() ? "xt.grid" : logging_prefix, - logging_id.empty() ? "BoundaryInfo" : logging_id, - logging_disabled) + BoundaryInfo(const std::string& log_prefix = "", const std::string& log_id = "", const bool logging_disabled = true) + : Logger(log_prefix.empty() ? "xt.grid" : log_prefix, log_id.empty() ? "BoundaryInfo" : log_id, logging_disabled) {} BoundaryInfo(const ThisType&) = default; diff --git a/python/dune/xt/common/empty.cc b/python/dune/xt/common/empty.cc index 0460a92220b02587d2df18d22a6b5d830ea33cb5..a75bf3e0c99fcdb8b55e69d6ad88b917b708bbf2 100644 --- a/python/dune/xt/common/empty.cc +++ b/python/dune/xt/common/empty.cc @@ -26,8 +26,8 @@ struct Pet { - Pet(const std::string& name) - : name(name) + Pet(const std::string& name_) + : name(name_) {} void setName(const std::string& name_) { @@ -42,8 +42,8 @@ struct Pet }; struct Dog : Pet { - Dog(const std::string& name) - : Pet(name) + Dog(const std::string& name_) + : Pet(name_) {} std::string bark() const { diff --git a/python/dune/xt/grid/boundaryinfo/types.cc b/python/dune/xt/grid/boundaryinfo/types.cc index 6c4b3aff19591d1fcbc3b6753f53bce8f67ef6b0..417fb6bdae3cf5170e93d4ce7c2309903044ad40 100644 --- a/python/dune/xt/grid/boundaryinfo/types.cc +++ b/python/dune/xt/grid/boundaryinfo/types.cc @@ -39,7 +39,7 @@ PYBIND11_MODULE(_grid_boundaryinfo_types, m) #define BIND_(NAME) \ py::class_<NAME, BoundaryType>(m, #NAME, #NAME) \ .def(py::init([]() { return std::make_unique<NAME>(); })) \ - .def("__repr__", [](const NAME& self) { return std::string(#NAME) + "()"; }) + .def("__repr__", [](const NAME&) { return std::string(#NAME) + "()"; }) BIND_(NoBoundary); BIND_(UnknownBoundary); diff --git a/python/dune/xt/grid/gridprovider.hh b/python/dune/xt/grid/gridprovider.hh index c69fb60152835e31e1ee917df5417fa29878b52f..ac5805399fb9c6932dd9cf7a9b36489ea8c49de9 100644 --- a/python/dune/xt/grid/gridprovider.hh +++ b/python/dune/xt/grid/gridprovider.hh @@ -46,7 +46,7 @@ public: { namespace py = pybind11; using namespace pybind11::literals; - const size_t dim = type::GridType::dimension; + const int dim = type::GridType::dimension; const std::string class_name = class_id + "_" + grid_id; const auto ClassName = XT::Common::to_camel_case(class_name); @@ -59,7 +59,7 @@ public: "dim = " << dim << "\n codim = " << codim); auto grid_view = self.leaf_view(); MultipleCodimMultipleGeomTypeMapper<decltype(grid_view)> mapper(grid_view, [codim](GeometryType gt, int dimgrid) { - return dimgrid - gt.dim() == codim; + return dimgrid - Common::numeric_cast<int>(gt.dim()) == codim; }); return mapper.size(); }, "codim"_a); diff --git a/python/dune/xt/la/container/container-interface.hh b/python/dune/xt/la/container/container-interface.hh index 1004eb25292d0f1eb56929cd7082f273e7f0ed20..fc04bbc13c87e9922994dd5e636584d93dc47192 100644 --- a/python/dune/xt/la/container/container-interface.hh +++ b/python/dune/xt/la/container/container-interface.hh @@ -116,14 +116,14 @@ bind_ProvidesDataAccess(pybind11::module& m, const std::string& class_id, const py::class_<C> c(m, class_id.c_str(), help_id.c_str(), py::buffer_protocol()); - c.def_buffer([](C &m) -> py::buffer_info { + c.def_buffer([](C &mat) -> py::buffer_info { return py::buffer_info( - m.data(), /* Pointer to buffer */ + mat.data(), /* Pointer to buffer */ sizeof(D), /* Size of one scalar */ py::format_descriptor<D>::format(), /* Python struct-style format descriptor */ - 2, /* Number of dimensions */ - { m.rows(), m.cols() }, /* Buffer dimensions */ - { sizeof(D) * m.cols(), /* Strides (in bytes) for each index */ + 2, /* Number of dimensions */ + { mat.rows(), mat.cols() }, /* Buffer dimensions */ + { sizeof(D) * mat.cols(), /* Strides (in bytes) for each index */ sizeof(D) } ); });