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

fix some warnings

parent 381eaad1
No related branches found
No related tags found
1 merge request!20Update bindings
Pipeline #61709 failed
...@@ -126,31 +126,38 @@ public: ...@@ -126,31 +126,38 @@ public:
using typename BaseType::LocalFunctionType; using typename BaseType::LocalFunctionType;
GridFunction(const typename RangeTypeSelector<R, r, rC>::type& value) 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) 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) 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) GridFunction(const GridFunctionInterface<E, r, rC, R>& func)
: storage_(func) : BaseType()
, storage_(func)
{} {}
GridFunction(GridFunctionInterface<E, r, rC, R>*&& func_ptr) GridFunction(GridFunctionInterface<E, r, rC, R>*&& func_ptr)
: storage_(std::move(func_ptr)) : BaseType()
, storage_(std::move(func_ptr))
{} {}
GridFunction(const ThisType& other) GridFunction(const ThisType& other)
: storage_(other.storage_) : BaseType(other)
, storage_(other.storage_)
{} {}
GridFunction(ThisType&& source) GridFunction(ThisType&& source)
: storage_(std::move(source.storage_)) : BaseType(source)
, storage_(std::move(source.storage_))
{} {}
std::unique_ptr<LocalFunctionType> local_function() const override final std::unique_ptr<LocalFunctionType> local_function() const override final
...@@ -192,58 +199,70 @@ public: ...@@ -192,58 +199,70 @@ public:
using typename BaseType::LocalFunctionType; using typename BaseType::LocalFunctionType;
GridFunction(const R& value) 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()), "")) new GridFunction<E, 1, 1, R>(value), std::move(unit_matrix()), ""))
{} {}
GridFunction(const FieldMatrix<R, r, r>& value) // <- Must not be XT::Common::FieldMatrix! 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) 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())) new FunctionAsGridFunctionWrapper<E, 1, 1, R>(func), std::move(unit_matrix()), func.name()))
{} {}
GridFunction(FunctionInterface<d, 1, 1, R>*&& func_ptr) 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)), new FunctionAsGridFunctionWrapper<E, 1, 1, R>(std::move(func_ptr)),
std::move(unit_matrix()), std::move(unit_matrix()),
func_ptr->name())) func_ptr->name()))
{} {}
GridFunction(const FunctionInterface<d, r, r, R>& func) 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) 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) 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())) new GridFunction<E, 1, 1, R>(func), std::move(unit_matrix()), func.name()))
{} {}
GridFunction(GridFunctionInterface<E, 1, 1, R>*&& func_ptr) 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())) std::move(func_ptr), std::move(unit_matrix()), func_ptr->name()))
{} {}
GridFunction(const GridFunctionInterface<E, r, r, R>& func) GridFunction(const GridFunctionInterface<E, r, r, R>& func)
: storage_(func) : BaseType()
, storage_(func)
{} {}
GridFunction(GridFunctionInterface<E, r, r, R>*&& func_ptr) GridFunction(GridFunctionInterface<E, r, r, R>*&& func_ptr)
: storage_(std::move(func_ptr)) : BaseType()
, storage_(std::move(func_ptr))
{} {}
GridFunction(const ThisType& other) GridFunction(const ThisType& other)
: storage_(other.storage_) : BaseType(other)
, storage_(other.storage_)
{} {}
GridFunction(ThisType&& source) GridFunction(ThisType&& source)
: storage_(std::move(source.storage_)) : BaseType(source)
, storage_(std::move(source.storage_))
{} {}
std::unique_ptr<LocalFunctionType> local_function() const override final std::unique_ptr<LocalFunctionType> local_function() const override final
...@@ -279,35 +298,43 @@ public: ...@@ -279,35 +298,43 @@ public:
using typename BaseType::LocalFunctionType; using typename BaseType::LocalFunctionType;
GridFunction(const R& value) 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! 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) 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) 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) GridFunction(const GridFunctionInterface<E, 1, 1, R>& func)
: storage_(func) : BaseType()
, storage_(func)
{} {}
GridFunction(GridFunctionInterface<E, 1, 1, R>*&& func_ptr) GridFunction(GridFunctionInterface<E, 1, 1, R>*&& func_ptr)
: storage_(std::move(func_ptr)) : BaseType()
, storage_(std::move(func_ptr))
{} {}
GridFunction(const ThisType& other) GridFunction(const ThisType& other)
: storage_(other.storage_) : BaseType(other)
, storage_(other.storage_)
{} {}
GridFunction(ThisType&& source) GridFunction(ThisType&& source)
: storage_(std::move(source.storage_)) : BaseType(source)
, storage_(std::move(source.storage_))
{} {}
std::unique_ptr<LocalFunctionType> local_function() const override final std::unique_ptr<LocalFunctionType> local_function() const override final
......
...@@ -76,12 +76,8 @@ public: ...@@ -76,12 +76,8 @@ public:
typedef Common::FieldVector<DomainFieldType, dimDomain> DomainType; typedef Common::FieldVector<DomainFieldType, dimDomain> DomainType;
typedef Common::FieldVector<DomainFieldType, dimWorld> WorldType; typedef Common::FieldVector<DomainFieldType, dimWorld> WorldType;
BoundaryInfo(const std::string& logging_prefix = "", BoundaryInfo(const std::string& log_prefix = "", const std::string& log_id = "", const bool logging_disabled = true)
const std::string& logging_id = "", : Logger(log_prefix.empty() ? "xt.grid" : log_prefix, log_id.empty() ? "BoundaryInfo" : log_id, logging_disabled)
const bool logging_disabled = true)
: Logger(logging_prefix.empty() ? "xt.grid" : logging_prefix,
logging_id.empty() ? "BoundaryInfo" : logging_id,
logging_disabled)
{} {}
BoundaryInfo(const ThisType&) = default; BoundaryInfo(const ThisType&) = default;
......
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
struct Pet struct Pet
{ {
Pet(const std::string& name) Pet(const std::string& name_)
: name(name) : name(name_)
{} {}
void setName(const std::string& name_) void setName(const std::string& name_)
{ {
...@@ -42,8 +42,8 @@ struct Pet ...@@ -42,8 +42,8 @@ struct Pet
}; };
struct Dog : Pet struct Dog : Pet
{ {
Dog(const std::string& name) Dog(const std::string& name_)
: Pet(name) : Pet(name_)
{} {}
std::string bark() const std::string bark() const
{ {
......
...@@ -39,7 +39,7 @@ PYBIND11_MODULE(_grid_boundaryinfo_types, m) ...@@ -39,7 +39,7 @@ PYBIND11_MODULE(_grid_boundaryinfo_types, m)
#define BIND_(NAME) \ #define BIND_(NAME) \
py::class_<NAME, BoundaryType>(m, #NAME, #NAME) \ py::class_<NAME, BoundaryType>(m, #NAME, #NAME) \
.def(py::init([]() { return std::make_unique<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_(NoBoundary);
BIND_(UnknownBoundary); BIND_(UnknownBoundary);
......
...@@ -46,7 +46,7 @@ public: ...@@ -46,7 +46,7 @@ public:
{ {
namespace py = pybind11; namespace py = pybind11;
using namespace pybind11::literals; 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 std::string class_name = class_id + "_" + grid_id;
const auto ClassName = XT::Common::to_camel_case(class_name); const auto ClassName = XT::Common::to_camel_case(class_name);
...@@ -59,7 +59,7 @@ public: ...@@ -59,7 +59,7 @@ public:
"dim = " << dim << "\n codim = " << codim); "dim = " << dim << "\n codim = " << codim);
auto grid_view = self.leaf_view(); auto grid_view = self.leaf_view();
MultipleCodimMultipleGeomTypeMapper<decltype(grid_view)> mapper(grid_view, [codim](GeometryType gt, int dimgrid) { 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(); return mapper.size();
}, "codim"_a); }, "codim"_a);
......
...@@ -116,14 +116,14 @@ bind_ProvidesDataAccess(pybind11::module& m, const std::string& class_id, const ...@@ -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()); 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( return py::buffer_info(
m.data(), /* Pointer to buffer */ mat.data(), /* Pointer to buffer */
sizeof(D), /* Size of one scalar */ sizeof(D), /* Size of one scalar */
py::format_descriptor<D>::format(), /* Python struct-style format descriptor */ py::format_descriptor<D>::format(), /* Python struct-style format descriptor */
2, /* Number of dimensions */ 2, /* Number of dimensions */
{ m.rows(), m.cols() }, /* Buffer dimensions */ { mat.rows(), mat.cols() }, /* Buffer dimensions */
{ sizeof(D) * m.cols(), /* Strides (in bytes) for each index */ { sizeof(D) * mat.cols(), /* Strides (in bytes) for each index */
sizeof(D) } sizeof(D) }
); );
}); });
......
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