From 4bed7355770ed3e0f7282d0b23a4e433e8aa76f4 Mon Sep 17 00:00:00 2001 From: Felix Schindler <felix.schindler@wwu.de> Date: Fri, 14 Aug 2020 06:53:37 +0200 Subject: [PATCH] [local.integrands] update logging --- dune/gdt/local/integrands/interfaces.hh | 10 +++++----- dune/gdt/local/integrands/laplace.hh | 1 - dune/gdt/local/integrands/linear-advection.hh | 3 +-- dune/gdt/local/integrands/product.hh | 17 ++++++++++++----- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/dune/gdt/local/integrands/interfaces.hh b/dune/gdt/local/integrands/interfaces.hh index e27e11a95..990a1dffb 100644 --- a/dune/gdt/local/integrands/interfaces.hh +++ b/dune/gdt/local/integrands/interfaces.hh @@ -208,14 +208,14 @@ public: LocalBinaryElementIntegrandInterface(const XT::Common::ParameterType& param_type = {}, const std::string& logging_prefix = "", - const std::string& logging_id_ = "", const bool logging_disabled = true) : XT::Common::ParametricInterface(param_type) , XT::Grid::ElementBoundObject<Element>() - , Logger(logging_prefix.empty() ? "gdt" : logging_prefix, - logging_id_.empty() ? "LocalBinaryElementIntegrand" : logging_id_, - logging_disabled) - {} + , Logger(logging_prefix.empty() ? "LocalBinaryElementIntegrand" : logging_prefix, logging_disabled) + { + LOG_(debug) << "LocalBinaryElementIntegrandInterface(this=" << this << ", param_type=" << param_type << ")" + << std::endl; + } virtual ~LocalBinaryElementIntegrandInterface() = default; diff --git a/dune/gdt/local/integrands/laplace.hh b/dune/gdt/local/integrands/laplace.hh index 1801510de..4f8d91b19 100644 --- a/dune/gdt/local/integrands/laplace.hh +++ b/dune/gdt/local/integrands/laplace.hh @@ -41,7 +41,6 @@ public: XT::Functions::GridFunction<E, d, d, F> diffusion = XT::LA::eye_matrix<FieldMatrix<F, d, d>>(d, d), const std::string& logging_prefix = "") : BaseType(diffusion.parameter_type(), - logging_prefix.empty() ? "gdt" : "gdt.locallaplaceintegrand", logging_prefix.empty() ? "LocalLaplaceIntegrand" : logging_prefix, /*logging_disabled=*/logging_prefix.empty()) , weight_(diffusion) diff --git a/dune/gdt/local/integrands/linear-advection.hh b/dune/gdt/local/integrands/linear-advection.hh index d5d242620..eb600425e 100644 --- a/dune/gdt/local/integrands/linear-advection.hh +++ b/dune/gdt/local/integrands/linear-advection.hh @@ -42,13 +42,12 @@ public: explicit LocalLinearAdvectionIntegrand(XT::Functions::GridFunction<E, d, 1, F> direction, const std::string& logging_prefix = "") : BaseType(direction.parameter_type(), - logging_prefix.empty() ? "gdt" : "gdt.locallinearadvectionintegrand", logging_prefix.empty() ? "LocalLinearAdvectionIntegrand" : logging_prefix, /*logging_disabled=*/logging_prefix.empty()) , direction_(direction) , local_direction_(direction_.local_function()) { - LOG_(info) << this->logging_id << "(direction=" << &direction << ")" << std::endl; + LOG_(info) << "LocalLinearAdvectionIntegrand(this=" << this << ", direction=" << &direction << ")" << std::endl; } LocalLinearAdvectionIntegrand(const ThisType& other) diff --git a/dune/gdt/local/integrands/product.hh b/dune/gdt/local/integrands/product.hh index 2d63718c4..9f0ee69b6 100644 --- a/dune/gdt/local/integrands/product.hh +++ b/dune/gdt/local/integrands/product.hh @@ -15,6 +15,7 @@ #include <dune/xt/common/memory.hh> #include <dune/xt/la/container/eye-matrix.hh> +#include <dune/xt/grid/print.hh> #include <dune/xt/functions/constant.hh> #include <dune/xt/functions/base/combined-functions.hh> #include <dune/xt/functions/base/combined-grid-functions.hh> @@ -55,13 +56,12 @@ public: LocalElementProductIntegrand(XT::Functions::GridFunction<E, r, r, F> weight = {1.}, const std::string& logging_prefix = "") : BaseType({}, - logging_prefix.empty() ? "gdt" : "gdt.elementproductintegrand", logging_prefix.empty() ? "ElementProductIntegrand" : logging_prefix, /*logging_disabled=*/logging_prefix.empty()) , weight_(weight) , local_weight_(weight_.local_function()) { - LOG_(info) << this->logging_id << "(weight=" << &weight << ")" << std::endl; + LOG_(info) << "LocalElementProductIntegrand(this=" << this << ", weight=" << &weight << ")" << std::endl; } LocalElementProductIntegrand(const ThisType& other) @@ -74,12 +74,14 @@ public: std::unique_ptr<BaseType> copy_as_binary_element_integrand() const override final { + LOG_(debug) << "copy_as_binary_element_integrand()" << std::endl; return std::make_unique<ThisType>(*this); } protected: void post_bind(const ElementType& ele) override final { + LOG_(debug) << "post_bind(element=" << XT::Grid::print(ele) << ")" << std::endl; local_weight_->bind(ele); } @@ -88,6 +90,12 @@ public: const LocalAnsatzBasisType& ansatz_basis, const XT::Common::Parameter& param = {}) const override final { + LOG_(debug) << "order(element=" << XT::Grid::print(this->element()) << ", {test|ansatz}_basis.size()={" + << test_basis.size(param) << "|" << ansatz_basis.size(param) << "}, param=" << param + << ")\n local_weight.order() = " << local_weight_->order(param) + << "\n test_basis.order() = " << test_basis.order(param) + << "\n ansatz_basis.order() = " << ansatz_basis.order(param) << "\n returning " + << local_weight_->order(param) + test_basis.order(param) + ansatz_basis.order(param) << std::endl; return local_weight_->order(param) + test_basis.order(param) + ansatz_basis.order(param); } @@ -99,9 +107,8 @@ public: DynamicMatrix<F>& result, const XT::Common::Parameter& param = {}) const override final { - LOG_(debug) << this->logging_id << ".evaluate(test_basis.size()=" << test_basis.size(param) - << ", ansatz_basis.size()=" << ansatz_basis.size(param) - << ", point_in_{reference_element | physical_space} = {" << print(point_in_reference_element) << "|" + LOG_(debug) << "evaluate({test|ansatz}_basis.size()={" << test_basis.size(param) << "|" << ansatz_basis.size(param) + << "}, point_in_{reference_element|physical_space} = {" << print(point_in_reference_element) << "|" << print(this->element().geometry().global(point_in_reference_element)) << "}, param=" << param << ")" << std::endl; // prepare storage -- GitLab