From 5a85fc74e0bd14a0b5cefccb4b311a36c738eb4b Mon Sep 17 00:00:00 2001 From: Felix Schindler <felix.schindler@wwu.de> Date: Wed, 20 Jan 2016 15:23:00 +0100 Subject: [PATCH] update names, namespaces and includes --- dune/xt/functions.hh | 24 +++++------ dune/xt/functions/ESV2007.hh | 28 ++++++------- dune/xt/functions/affine.hh | 8 ++-- dune/xt/functions/checkerboard.hh | 14 +++---- dune/xt/functions/combined.hh | 8 ++-- dune/xt/functions/constant.hh | 6 +-- dune/xt/functions/default.hh | 6 +-- dune/xt/functions/derived.hh | 10 ++--- dune/xt/functions/expression.hh | 30 +++++++------- dune/xt/functions/expression/base.hh | 18 ++++---- dune/xt/functions/femadapter.hh | 11 +++-- dune/xt/functions/flattop.hh | 22 +++++----- dune/xt/functions/global.hh | 12 +++--- dune/xt/functions/indicator.hh | 18 ++++---- dune/xt/functions/interfaces.hh | 50 +++++++++++----------- dune/xt/functions/random_ellipsoids.hh | 57 +++++++++++++------------- dune/xt/functions/spe10/model1.hh | 20 ++++----- dune/xt/functions/spe10/model2.hh | 44 ++++++++++---------- dune/xt/test/ESV2007.cc | 11 +++-- dune/xt/test/ESV2007.mini | 6 +-- dune/xt/test/checkerboard.cc | 11 +++-- dune/xt/test/checkerboard.mini | 6 +-- dune/xt/test/combined.cc | 14 +++---- dune/xt/test/constant.cc | 15 ++++--- dune/xt/test/constant.mini | 6 +-- dune/xt/test/expression.cc | 13 +++--- dune/xt/test/expression.mini | 6 +-- dune/xt/test/flattop.cc | 28 ++++++------- dune/xt/test/functions.cc | 14 ++++--- dune/xt/test/functions.hh | 16 ++++---- dune/xt/test/functions.mini | 4 +- dune/xt/test/global.cc | 11 +++-- dune/xt/test/global.mini | 6 +-- dune/xt/test/indicator.cc | 11 +++-- dune/xt/test/indicator.mini | 4 +- dune/xt/test/spe10.cc | 13 +++--- dune/xt/test/spe10.mini | 6 +-- 37 files changed, 305 insertions(+), 282 deletions(-) diff --git a/dune/xt/functions.hh b/dune/xt/functions.hh index 5bbe679cf..9d237b68d 100644 --- a/dune/xt/functions.hh +++ b/dune/xt/functions.hh @@ -14,8 +14,8 @@ #include <vector> #include <memory> -#include <dune/stuff/common/exceptions.hh> -#include <dune/stuff/common/configuration.hh> +#include <dune/xt/common/exceptions.hh> +#include <dune/xt/common/configuration.hh> #include "functions/interfaces.hh" #include "functions/checkerboard.hh" @@ -24,10 +24,10 @@ #include "functions/ESV2007.hh" #include "functions/flattop.hh" #include "functions/indicator.hh" -#include "functions/spe10.hh" +#include "functions/spe10/model1.hh" namespace Dune { -namespace Stuff { +namespace XT { /** * \note If you want to add a new function FooBar, do the following: provide a definition that is available for all @@ -69,13 +69,13 @@ private: static Common::Configuration default_config(const std::string /*sub_name*/) { - DUNE_THROW(Stuff::Exceptions::internal_error, "This should not happen!"); + DUNE_THROW(Common::Exceptions::internal_error, "This should not happen!"); return Common::Configuration(0); } static std::unique_ptr<FunctionType> create(const Common::Configuration& /*cfg*/) { - DUNE_THROW(Stuff::Exceptions::internal_error, "This should not happen!"); + DUNE_THROW(Common::Exceptions::internal_error, "This should not happen!"); return std::unique_ptr<FunctionType>(nullptr); } }; // struct Call @@ -187,14 +187,14 @@ public: else if (call_compare<Spe10Model1Type>(type)) return call_default_config<Spe10Model1Type>(sub_name); else if (available().empty()) - DUNE_THROW(Exceptions::wrong_input_given, + DUNE_THROW(Common::Exceptions::wrong_input_given, "There is no " << InterfaceType::static_id() << " available for dimensions " << size_t(d) << " -> " << size_t(r) << " x " << size_t(rC) << "!"); else - DUNE_THROW(Exceptions::wrong_input_given, + DUNE_THROW(Common::Exceptions::wrong_input_given, "Requested type '" << type << "' is not one of those avaible for dimensions " << size_t(d) << " -> " << size_t(r) << " x " @@ -223,14 +223,14 @@ public: else if (call_compare<Spe10Model1Type>(type)) return call_create<Spe10Model1Type>(cfg); else if (available().empty()) - DUNE_THROW(Exceptions::wrong_input_given, + DUNE_THROW(Common::Exceptions::wrong_input_given, "There is no " << InterfaceType::static_id() << " available for dimensions " << size_t(d) << " -> " << size_t(r) << " x " << size_t(rC) << "!"); else - DUNE_THROW(Exceptions::wrong_input_given, + DUNE_THROW(Common::Exceptions::wrong_input_given, "Requested type '" << type << "' is not one of those avaible for dimensions " << size_t(d) << " -> " << size_t(r) << " x " @@ -242,12 +242,12 @@ public: static std::unique_ptr<InterfaceType> create(const Common::Configuration& cfg) { if (!cfg.has_key("type")) - DUNE_THROW(Exceptions::wrong_input_given, "Missing 'type' in given cfg (see below)!\n\n" << cfg); + DUNE_THROW(Common::Exceptions::wrong_input_given, "Missing 'type' in given cfg (see below)!\n\n" << cfg); return create(cfg.get<std::string>("type"), cfg); } }; // class FunctionsProvider -} // namespace Stuff +} // namespace XT } // namespace Dune #endif // DUNE_XT_FUNCTIONS_HH diff --git a/dune/xt/functions/ESV2007.hh b/dune/xt/functions/ESV2007.hh index a8c3fbbcc..0b077e5d2 100644 --- a/dune/xt/functions/ESV2007.hh +++ b/dune/xt/functions/ESV2007.hh @@ -20,15 +20,15 @@ #include <dune/geometry/referenceelements.hh> -#include <dune/stuff/common/configuration.hh> -#include <dune/stuff/common/debug.hh> -#include <dune/stuff/common/ranges.hh> -#include <dune/stuff/la/container/eigen.hh> +#include <dune/xt/common/configuration.hh> +#include <dune/xt/common/debug.hh> +#include <dune/xt/common/ranges.hh> +#include <dune/xt/la/container/eigen.hh> #include "interfaces.hh" namespace Dune { -namespace Stuff { +namespace XT { namespace Functions { namespace ESV2007 { @@ -320,13 +320,13 @@ class Cutoff<DiffusionType, void> return 0; } - virtual void evaluate(const DomainType& UNUSED_UNLESS_DEBUG(xx), RangeType& ret) const override final + virtual void evaluate(const DomainType& DXTC_DEBUG_ONLY(xx), RangeType& ret) const override final { assert(this->is_a_valid_point(xx)); ret[0] = value_; } - virtual void jacobian(const DomainType& UNUSED_UNLESS_DEBUG(xx), JacobianRangeType& ret) const override final + virtual void jacobian(const DomainType& DXTC_DEBUG_ONLY(xx), JacobianRangeType& ret) const override final { assert(this->is_a_valid_point(xx)); ret *= RangeFieldType(0); @@ -336,9 +336,9 @@ class Cutoff<DiffusionType, void> static DomainFieldType compute_diameter_of_(const EntityType& ent) { DomainFieldType ret(0); - for (auto cc : DSC::valueRange(ent.template count<dimDomain>())) { + for (auto cc : Common::value_range(ent.template count<dimDomain>())) { const auto vertex = ent.template subEntity<dimDomain>(cc)->geometry().center(); - for (auto dd : DSC::valueRange(cc + 1, ent.template count<dimDomain>())) { + for (auto dd : Common::value_range(cc + 1, ent.template count<dimDomain>())) { const auto other_vertex = ent.template subEntity<dimDomain>(dd)->geometry().center(); const auto diff = vertex - other_vertex; ret = std::max(ret, diff.two_norm()); @@ -532,13 +532,13 @@ class Cutoff return 0; } - virtual void evaluate(const DomainType& UNUSED_UNLESS_DEBUG(xx), RangeType& ret) const override final + virtual void evaluate(const DomainType& DXTC_DEBUG_ONLY(xx), RangeType& ret) const override final { assert(this->is_a_valid_point(xx)); ret[0] = value_; } - virtual void jacobian(const DomainType& UNUSED_UNLESS_DEBUG(xx), JacobianRangeType& ret) const override final + virtual void jacobian(const DomainType& DXTC_DEBUG_ONLY(xx), JacobianRangeType& ret) const override final { assert(this->is_a_valid_point(xx)); ret *= RangeFieldType(0); @@ -548,9 +548,9 @@ class Cutoff static DomainFieldType compute_diameter_of_(const EntityType& ent) { DomainFieldType ret(0); - for (auto cc : DSC::valueRange(ent.template count<dimDomain>())) { + for (auto cc : Common::value_range(ent.template count<dimDomain>())) { const auto vertex = ent.template subEntity<dimDomain>(cc)->geometry().center(); - for (auto dd : DSC::valueRange(cc + 1, ent.template count<dimDomain>())) { + for (auto dd : Common::value_range(cc + 1, ent.template count<dimDomain>())) { const auto other_vertex = ent.template subEntity<dimDomain>(dd)->geometry().center(); const auto diff = vertex - other_vertex; ret = std::max(ret, diff.two_norm()); @@ -613,7 +613,7 @@ private: } // namespace ESV2007 } // namespace Functions -} // namespace Stuff +} // namespace XT } // namespace Dune #endif // DUNE_XT_FUNCTIONS_ESV2007_HH diff --git a/dune/xt/functions/affine.hh b/dune/xt/functions/affine.hh index 740de37aa..a06baeb60 100644 --- a/dune/xt/functions/affine.hh +++ b/dune/xt/functions/affine.hh @@ -13,13 +13,13 @@ #include <memory> -#include <dune/stuff/common/configuration.hh> -#include <dune/stuff/functions/constant.hh> +#include <dune/xt/common/configuration.hh> +#include <dune/xt/functions/constant.hh> #include "interfaces.hh" namespace Dune { -namespace Stuff { +namespace XT { namespace Functions { /** @@ -126,7 +126,7 @@ private: }; } // namespace Functions -} // namespace Stuff +} // namespace XT } // namespace Dune #endif // DUNE_XT_FUNCTIONS_AFFINE_HH diff --git a/dune/xt/functions/checkerboard.hh b/dune/xt/functions/checkerboard.hh index 7c233ba6a..3d68c6fa8 100644 --- a/dune/xt/functions/checkerboard.hh +++ b/dune/xt/functions/checkerboard.hh @@ -17,14 +17,14 @@ #include <dune/common/exceptions.hh> -#include <dune/stuff/common/configuration.hh> -#include <dune/stuff/common/debug.hh> -#include <dune/stuff/common/fvector.hh> +#include <dune/xt/common/configuration.hh> +#include <dune/xt/common/debug.hh> +#include <dune/xt/common/fvector.hh> #include "interfaces.hh" namespace Dune { -namespace Stuff { +namespace XT { namespace Functions { template <class EntityImp, class DomainFieldImp, size_t domainDim, class RangeFieldImp, size_t rangeDim, @@ -65,13 +65,13 @@ class Checkerboard return 0; } - virtual void evaluate(const DomainType& UNUSED_UNLESS_DEBUG(xx), RangeType& ret) const override + virtual void evaluate(const DomainType& DXTC_DEBUG_ONLY(xx), RangeType& ret) const override { assert(this->is_a_valid_point(xx)); ret = value_; } - virtual void jacobian(const DomainType& UNUSED_UNLESS_DEBUG(xx), JacobianRangeType& ret) const override + virtual void jacobian(const DomainType& DXTC_DEBUG_ONLY(xx), JacobianRangeType& ret) const override { assert(this->is_a_valid_point(xx)); jacobian_helper(ret, internal::ChooseVariant<rangeDimCols>()); @@ -229,7 +229,7 @@ private: }; // class Checkerboard } // namespace Functions -} // namespace Stuff +} // namespace XT } // namespace Dune #endif // DUNE_XT_FUNCTIONS_CHECKERBOARD_HH diff --git a/dune/xt/functions/combined.hh b/dune/xt/functions/combined.hh index ee8cbb964..0403c4d9f 100644 --- a/dune/xt/functions/combined.hh +++ b/dune/xt/functions/combined.hh @@ -15,12 +15,12 @@ #include <dune/common/typetraits.hh> -#include <dune/stuff/common/memory.hh> +#include <dune/xt/common/memory.hh> #include "interfaces.hh" namespace Dune { -namespace Stuff { +namespace XT { namespace Functions { namespace internal { @@ -380,7 +380,7 @@ public: typedef CombinedLocalFunction<LeftType, RightType, comb> RealLocalFunctionType; assert(left_); assert(right_); - return DSC::make_unique<RealLocalFunctionType>(left_->storage_access(), right_->storage_access(), entity); + return Common::make_unique<RealLocalFunctionType>(left_->storage_access(), right_->storage_access(), entity); } // ... local_function(...) virtual ThisType* copy() const @@ -498,7 +498,7 @@ std::shared_ptr<Product<T1, T2>> make_product(std::shared_ptr<T1> left, std::sha } } // namespace Functions -} // namespace Stuff +} // namespace XT } // namespace Dune #endif // DUNE_XT_FUNCTIONS_COMBINED_HH diff --git a/dune/xt/functions/constant.hh b/dune/xt/functions/constant.hh index 58facbc57..98819c810 100644 --- a/dune/xt/functions/constant.hh +++ b/dune/xt/functions/constant.hh @@ -13,12 +13,12 @@ #include <memory> -#include <dune/stuff/common/configuration.hh> +#include <dune/xt/common/configuration.hh> #include "interfaces.hh" namespace Dune { -namespace Stuff { +namespace XT { namespace Functions { namespace internal { @@ -219,7 +219,7 @@ private: }; } // namespace Functions -} // namespace Stuff +} // namespace XT } // namespace Dune #endif // DUNE_XT_FUNCTIONS_CONSTANT_HH diff --git a/dune/xt/functions/default.hh b/dune/xt/functions/default.hh index a302fa31f..52186f86f 100644 --- a/dune/xt/functions/default.hh +++ b/dune/xt/functions/default.hh @@ -16,12 +16,12 @@ #include <dune/grid/io/file/vtk/function.hh> #endif -#include <dune/stuff/common/float_cmp.hh> +#include <dune/xt/common/float_cmp.hh> #include "interfaces.hh" namespace Dune { -namespace Stuff { +namespace XT { namespace Functions { #if HAVE_DUNE_GRID @@ -109,7 +109,7 @@ private: #endif // HAVE_DUNE_GRID } // namespace Functions -} // namespace Stuff +} // namespace XT } // namespace Dune #endif // DUNE_XT_FUNCTIONS_VISUALIZATION_HH diff --git a/dune/xt/functions/derived.hh b/dune/xt/functions/derived.hh index af84ae296..e6efa52c6 100644 --- a/dune/xt/functions/derived.hh +++ b/dune/xt/functions/derived.hh @@ -16,13 +16,13 @@ #include <dune/common/typetraits.hh> -#include <dune/stuff/common/exceptions.hh> -#include <dune/stuff/common/memory.hh> +#include <dune/xt/common/exceptions.hh> +#include <dune/xt/common/memory.hh> #include "interfaces.hh" namespace Dune { -namespace Stuff { +namespace XT { namespace Functions { namespace internal { @@ -220,7 +220,7 @@ public: { typedef DerivedLocalFunction<FunctionType, derivative> RealLocalFunctionType; assert(func_); - return DSC::make_unique<RealLocalFunctionType>(func_->storage_access(), entity); + return Common::make_unique<RealLocalFunctionType>(func_->storage_access(), entity); } // ... local_function(...) virtual ThisType* copy() const @@ -271,7 +271,7 @@ std::shared_ptr<Divergence<T>> make_divergence(std::shared_ptr<T> func, Args&&.. } } // namespace Functions -} // namespace Stuff +} // namespace XT } // namespace Dune #endif // DUNE_XT_FUNCTIONS_DERIVED_HH diff --git a/dune/xt/functions/expression.hh b/dune/xt/functions/expression.hh index 2bc5effa7..4f3ed52a9 100644 --- a/dune/xt/functions/expression.hh +++ b/dune/xt/functions/expression.hh @@ -17,16 +17,16 @@ #include <dune/common/fmatrix.hh> #include <dune/common/fvector.hh> -#include <dune/stuff/common/configuration.hh> -#include <dune/stuff/common/exceptions.hh> -#include <dune/stuff/common/parallel/threadstorage.hh> +#include <dune/xt/common/configuration.hh> +#include <dune/xt/common/exceptions.hh> +#include <dune/xt/common/parallel/threadstorage.hh> #include "expression/base.hh" #include "interfaces.hh" #include "default.hh" namespace Dune { -namespace Stuff { +namespace XT { namespace Functions { template <class EntityImp, class DomainFieldImp, size_t domainDim, class RangeFieldImp, size_t rangeDim, @@ -85,7 +85,7 @@ public: // try to get expression as FieldVector (if dimRangeCols == 1) or as FieldMatrix (else) try { get_expression_helper(cfg, expression_as_vectors, internal::ChooseVariant<dimRangeCols>()); - } catch (Exceptions::conversion_error) { + } catch (Common::Exceptions::conversion_error) { // if dimRangeCols == 1 and we could not get expression as FieldVector, get it as FieldMatrix with one col if (dimRangeCols == 1) { // the 2 in ChooseVariant is here on purpose, anything > 1 will suffice get_expression_helper(cfg, expression_as_vectors, internal::ChooseVariant<2>()); @@ -215,16 +215,16 @@ public: { evaluate_helper(xx, ret, internal::ChooseVariant<dimRangeCols>()); #ifndef NDEBUG -#ifndef DUNE_STUFF_FUNCTIONS_EXPRESSION_DISABLE_CHECKS +#ifndef DUNE_XT_FUNCTIONS_EXPRESSION_DISABLE_CHECKS bool failure = false; std::string error_type; for (size_t rr = 0; rr < dimRange; ++rr) { *tmp_row_ = ret[rr]; for (size_t cc = 0; cc < dimRangeCols; ++cc) { - if (DSC::isnan(tmp_row_->operator[](cc))) { + if (isnan(tmp_row_->operator[](cc))) { failure = true; error_type = "NaN"; - } else if (DSC::isinf(tmp_row_->operator[](cc))) { + } else if (isinf(tmp_row_->operator[](cc))) { failure = true; error_type = "inf"; } else if (std::abs(tmp_row_->operator[](cc)) > (0.9 * std::numeric_limits<double>::max())) { @@ -232,7 +232,7 @@ public: error_type = "an unlikely value"; } if (failure) - DUNE_THROW(Stuff::Exceptions::internal_error, + DUNE_THROW(Common::Exceptions::internal_error, "evaluating this function yielded " << error_type << "!\n" @@ -248,10 +248,10 @@ public: << "The result was: " << tmp_row_->operator[](cc) << "\n\n" - << "You can disable this check by defining DUNE_STUFF_FUNCTIONS_EXPRESSION_DISABLE_CHECKS\n"); + << "You can disable this check by defining DUNE_XT_FUNCTIONS_EXPRESSION_DISABLE_CHECKS\n"); } } -#endif // DUNE_STUFF_FUNCTIONS_EXPRESSION_DISABLE_CHECKS +#endif // DUNE_XT_FUNCTIONS_EXPRESSION_DISABLE_CHECKS #endif // NDEBUG } // ... evaluate(...) @@ -365,7 +365,7 @@ private: // create vector of gradient keys std::vector<std::string> gradient_keys(1, first_gradient_key); for (size_t cc = 1; cc < dimRangeCols; ++cc) - gradient_keys.emplace_back("gradient." + DSC::toString(cc)); + gradient_keys.emplace_back("gradient." + Common::to_string(cc)); // get gradient as FieldMatrix for every key for (std::string key : gradient_keys) { ExpressionStringVectorType gradient_as_vectors_component; @@ -385,13 +385,13 @@ private: std::shared_ptr<const MathExpressionFunctionType> function_; size_t order_; std::string name_; - mutable typename DS::PerThreadValue<FieldVector<RangeFieldType, dimRange * dimRangeCols>> tmp_vector_; - mutable typename DS::PerThreadValue<FieldVector<RangeFieldType, dimRangeCols>> tmp_row_; + mutable typename Common::PerThreadValue<FieldVector<RangeFieldType, dimRange * dimRangeCols>> tmp_vector_; + mutable typename Common::PerThreadValue<FieldVector<RangeFieldType, dimRangeCols>> tmp_row_; std::vector<std::vector<std::shared_ptr<const MathExpressionGradientType>>> gradients_; }; // class Expression } // namespace Functions -} // namespace Stuff +} // namespace XT } // namespace Dune #endif // DUNE_XT_FUNCTIONS_EXPRESSION_HH diff --git a/dune/xt/functions/expression/base.hh b/dune/xt/functions/expression/base.hh index 68f587a1d..b5aa13e95 100644 --- a/dune/xt/functions/expression/base.hh +++ b/dune/xt/functions/expression/base.hh @@ -14,22 +14,23 @@ #include <sstream> #include <vector> +#include <mutex> #include <dune/common/fvector.hh> #include <dune/common/dynvector.hh> #include <dune/common/exceptions.hh> -#include <dune/stuff/common/string.hh> -#include <dune/stuff/common/color.hh> +#include <dune/xt/common/string.hh> +#include <dune/xt/common/color.hh> #include "mathexpr.hh" namespace Dune { -namespace Stuff { +namespace XT { namespace Functions { /** - * \brief base class that makes a function out of the stuff from mathexpr.hh + * \brief base class that makes a function out of the from mathexpr.hh * \attention Most surely you do not want to use this class directly, but Functions::Expression! */ template <class DomainFieldImp, size_t domainDim, class RangeFieldImp, size_t rangeDim> @@ -147,7 +148,7 @@ public: ret[ii] = op_[ii]->Val(); } - void report(const std::string _name = "dune.stuff.function.mathexpressionbase", std::ostream& stream = std::cout, + void report(const std::string _name = "function.mathexpressionbase", std::ostream& stream = std::cout, const std::string& _prefix = "") const { const std::string tmp = _name + "(" + variable() + ") = "; @@ -156,7 +157,7 @@ public: stream << expression()[0] << std::endl; else { stream << "[ " << expression()[0] << std::endl; - const std::string whitespace = Dune::Stuff::Common::whitespaceify(tmp + "[ "); + const std::string whitespace = Common::whitespaceify(tmp + "[ "); for (size_t i = 1; i < expression().size() - 1; ++i) stream << _prefix << whitespace << expression()[i] << std::endl; stream << _prefix << whitespace << expression()[expression().size() - 1] << " ]" << std::endl; @@ -171,8 +172,7 @@ private: // set expressions if (_expression.size() < dimRange) DUNE_THROW(Dune::InvalidStateException, - "\n" << Dune::Stuff::Common::colorStringRed("ERROR:") << " '_expression' too short (is " - << _expression.size() + "\n" << Common::color_string_red("ERROR:") << " '_expression' too short (is " << _expression.size() << ", should be " << dimRange << ")!"); @@ -220,7 +220,7 @@ private: }; // class MathExpressionBase } // namespace Functions -} // namespace Stuff +} // namespace XT } // namespace Dune #endif // DUNE_XT_FUNCTIONS_EXPRESSION_BASE_HH diff --git a/dune/xt/functions/femadapter.hh b/dune/xt/functions/femadapter.hh index 7f5485a65..f6a566853 100644 --- a/dune/xt/functions/femadapter.hh +++ b/dune/xt/functions/femadapter.hh @@ -10,14 +10,13 @@ #ifndef DUNE_XT_FUNCTIONS_FEMADAPTER #define DUNE_XT_FUNCTIONS_FEMADAPTER -#include <dune/stuff/functions/interfaces.hh> -#include <dune/stuff/common/memory.hh> -#include <dune/stuff/aliases.hh> +#include <dune/xt/functions/interfaces.hh> +#include <dune/xt/common/memory.hh> #if HAVE_DUNE_FEM namespace Dune { -namespace Stuff { +namespace XT { namespace Functions { template <class DiscreteFunctionType> @@ -113,7 +112,7 @@ public: //! this intentionally hides virtual std::unique_ptr<LocalfunctionType> local_function(const EntityType& entity) const { - return DSC::make_unique<Localfunction>(df_, entity); + return Common::make_unique<Localfunction>(df_, entity); } // ... local_function(...) private: @@ -121,7 +120,7 @@ private: }; // class Checkerboard } // namespace Functions -} // namespace Stuff +} // namespace XT } // namespace Dune #endif // if HAVE_DUNE_FEM diff --git a/dune/xt/functions/flattop.hh b/dune/xt/functions/flattop.hh index 9dd53f9e4..9177fa348 100644 --- a/dune/xt/functions/flattop.hh +++ b/dune/xt/functions/flattop.hh @@ -10,16 +10,16 @@ #ifndef DUNE_XT_FUNCTIONS_FLATTOP_HH #define DUNE_XT_FUNCTIONS_FLATTOP_HH -#include <dune/stuff/common/type_utils.hh> +#include <dune/xt/common/type_utils.hh> -#include <dune/stuff/common/exceptions.hh> -#include <dune/stuff/common/configuration.hh> -#include <dune/stuff/common/float_cmp.hh> -#include <dune/stuff/common/fvector.hh> -#include <dune/stuff/functions/interfaces.hh> +#include <dune/xt/common/exceptions.hh> +#include <dune/xt/common/configuration.hh> +#include <dune/xt/common/float_cmp.hh> +#include <dune/xt/common/fvector.hh> +#include <dune/xt/functions/interfaces.hh> namespace Dune { -namespace Stuff { +namespace XT { namespace Functions { /** @@ -160,7 +160,7 @@ private: void check_input() const { if (!(Common::FloatCmp::gt(upper_right_, lower_left_))) - DUNE_THROW(Exceptions::wrong_input_given, + DUNE_THROW(Common::Exceptions::wrong_input_given, "upper_right has to be greater than lower_left!\n" << "lower_left = [" << lower_left_ @@ -169,13 +169,13 @@ private: << upper_right_ << "]"); if (!(Common::FloatCmp::gt(boundary_layer_, StuffDomainType(0)))) - DUNE_THROW(Exceptions::wrong_input_given, + DUNE_THROW(Common::Exceptions::wrong_input_given, "boundary_layer has to be strictly positive!\n" << "boundary_layer = [" << boundary_layer_ << "]"); if (Common::FloatCmp::gt(boundary_layer_ * 2.0, upper_right_ - lower_left_)) - DUNE_THROW(Exceptions::wrong_input_given, + DUNE_THROW(Common::Exceptions::wrong_input_given, "boundary_layer has to be thin enough!\n" "2*boundary_layer = [" << boundary_layer_ * 2.0 @@ -213,7 +213,7 @@ private: }; // class FlatTop< ..., 1, 1 > } // namespace Functions -} // namespace Stuff +} // namespace XT } // namespace Dune #endif // DUNE_XT_FUNCTIONS_FLATTOP_HH diff --git a/dune/xt/functions/global.hh b/dune/xt/functions/global.hh index 5e5d50fd3..2f4d30f9b 100644 --- a/dune/xt/functions/global.hh +++ b/dune/xt/functions/global.hh @@ -13,11 +13,11 @@ #include <functional> -#include <dune/stuff/functions/interfaces.hh> -#include <dune/stuff/common/memory.hh> +#include <dune/xt/functions/interfaces.hh> +#include <dune/xt/common/memory.hh> namespace Dune { -namespace Stuff { +namespace XT { /** * Global-valued function you can pass a lambda expression to that gets evaluated @@ -38,7 +38,7 @@ private: typedef std::function<RangeType(DomainType)> LambdaType; public: - GlobalLambdaFunction(LambdaType lambda, const size_t order_in, const std::string nm = "stuff.globallambdafunction") + GlobalLambdaFunction(LambdaType lambda, const size_t order_in, const std::string nm = "globallambdafunction") : lambda_(lambda) , order_(order_in) , name_(nm) @@ -62,7 +62,7 @@ public: virtual std::string type() const override { - return "stuff.globallambdafunction"; + return "globallambdafunction"; } virtual std::string name() const override @@ -76,7 +76,7 @@ private: const std::string name_; }; -} // namespace Stuff +} // namespace XT } // namespace Dune #endif // DUNE_XT_FUNCTIONS_GLOBAL_HH diff --git a/dune/xt/functions/indicator.hh b/dune/xt/functions/indicator.hh index b93cd2d65..7b4496e80 100644 --- a/dune/xt/functions/indicator.hh +++ b/dune/xt/functions/indicator.hh @@ -13,17 +13,17 @@ #include <vector> #include <utility> -#include <dune/stuff/common/type_utils.hh> +#include <dune/xt/common/type_utils.hh> -#include <dune/stuff/common/fvector.hh> -#include <dune/stuff/common/string.hh> -#include <dune/stuff/common/memory.hh> -#include <dune/stuff/common/configuration.hh> +#include <dune/xt/common/fvector.hh> +#include <dune/xt/common/string.hh> +#include <dune/xt/common/memory.hh> +#include <dune/xt/common/configuration.hh> #include "interfaces.hh" namespace Dune { -namespace Stuff { +namespace XT { namespace Functions { template <class E, class D, size_t d, class R, size_t r, size_t rC = 1> @@ -124,8 +124,8 @@ public: DomainType tmp_lower; DomainType tmp_upper; size_t cc = 0; - while (cfg.has_sub(DSC::toString(cc))) { - const Stuff::Common::Configuration local_cfg = cfg.sub(DSC::toString(cc)); + while (cfg.has_sub(Common::to_string(cc))) { + const Common::Configuration local_cfg = cfg.sub(Common::to_string(cc)); if (local_cfg.has_key("domain") && local_cfg.has_key("value")) { auto domains = local_cfg.get<FieldMatrix<DomainFieldType, d, 2>>("domain"); for (size_t dd = 0; dd < d; ++dd) { @@ -187,7 +187,7 @@ private: }; // class Indicator } // namespace Functions -} // namespace Stuff +} // namespace XT } // namespace Dune #endif // DUNE_XT_FUNCTIONS_INDICATOR_HH diff --git a/dune/xt/functions/interfaces.hh b/dune/xt/functions/interfaces.hh index b0c643e56..fca340db1 100644 --- a/dune/xt/functions/interfaces.hh +++ b/dune/xt/functions/interfaces.hh @@ -28,7 +28,7 @@ #if HAVE_DUNE_GRID #include <dune/grid/io/file/vtk.hh> -#include <dune/stuff/common/filesystem.hh> +#include <dune/xt/common/filesystem.hh> #endif #if HAVE_DUNE_FEM @@ -41,26 +41,26 @@ #include <dune/pdelab/common/function.hh> #endif -#include <dune/stuff/aliases.hh> -#include <dune/stuff/common/exceptions.hh> -#include <dune/stuff/common/memory.hh> -#include <dune/stuff/common/type_utils.hh> +#include <dune/xt/common/exceptions.hh> +#include <dune/xt/common/memory.hh> +#include <dune/xt/common/type_utils.hh> namespace Dune { -namespace Stuff { +namespace XT { namespace internal { template <class F> struct is_localizable_function_helper { - DSC_has_typedef_initialize_once(EntityType) DSC_has_typedef_initialize_once(DomainFieldType) - DSC_has_typedef_initialize_once(RangeFieldType) DSC_has_static_member_initialize_once(dimDomain) - DSC_has_static_member_initialize_once(dimRange) DSC_has_static_member_initialize_once(dimRangeCols) + DXTC_has_typedef_initialize_once(EntityType) DXTC_has_typedef_initialize_once(DomainFieldType) + DXTC_has_typedef_initialize_once(RangeFieldType) DXTC_has_static_member_initialize_once(dimDomain) + DXTC_has_static_member_initialize_once(dimRange) DXTC_has_static_member_initialize_once(dimRangeCols) static const - bool is_candidate = DSC_has_typedef(EntityType)<F>::value && DSC_has_typedef(DomainFieldType)<F>::value - && DSC_has_typedef(RangeFieldType)<F>::value && DSC_has_static_member(dimDomain)<F>::value - && DSC_has_static_member(dimRange)<F>::value && DSC_has_static_member(dimRangeCols)<F>::value; + bool is_candidate = DXTC_has_typedef(EntityType)<F>::value && DXTC_has_typedef(DomainFieldType)<F>::value + && DXTC_has_typedef(RangeFieldType)<F>::value && DXTC_has_static_member(dimDomain)<F>::value + && DXTC_has_static_member(dimRange)<F>::value + && DXTC_has_static_member(dimRangeCols)<F>::value; }; // class is_localizable_function_helper } // namespace internal @@ -362,7 +362,7 @@ public: static std::string static_id() { - return "stuff.function"; + return "function"; } /** @@ -376,12 +376,12 @@ public: /* @{ */ virtual std::string type() const { - return "stuff.function"; + return "function"; } virtual std::string name() const { - return "stuff.function"; + return "function"; } /* @} */ @@ -418,14 +418,14 @@ public: { if (path.empty()) DUNE_THROW(RangeError, "Empty path given!"); - const auto directory = DSC::directoryOnly(path); - const auto filename = DSC::filenameOnly(path); + const auto directory = Common::directory_only(path); + const auto filename = Common::filename_only(path); auto adapter = std::make_shared<Functions::VisualizationAdapter<GridViewType, dimRange, dimRangeCols>>(*this); std::unique_ptr<VTKWriter<GridViewType>> vtk_writer = - subsampling ? DSC::make_unique<SubsamplingVTKWriter<GridViewType>>(grid_view, VTK::nonconforming) - : DSC::make_unique<VTKWriter<GridViewType>>(grid_view, VTK::nonconforming); + subsampling ? Common::make_unique<SubsamplingVTKWriter<GridViewType>>(grid_view, VTK::nonconforming) + : Common::make_unique<VTKWriter<GridViewType>>(grid_view, VTK::nonconforming); vtk_writer->addVertexData(adapter); - DSC::testCreateDirectory(directory); + Common::test_create_directory(directory); if (MPIHelper::getCollectiveCommunication().size() == 1) vtk_writer->write(path, vtk_output_type); else @@ -506,12 +506,12 @@ public: virtual std::string type() const override { - return "stuff.globalfunction"; + return "globalfunction"; } virtual std::string name() const override { - return "stuff.globalfunction"; + return "globalfunction"; } private: @@ -645,12 +645,12 @@ public: virtual std::string type() const override { - return "stuff.globalfunction"; + return "globalfunction"; } virtual std::string name() const override { - return "stuff.globalfunction"; + return "globalfunction"; } private: @@ -752,7 +752,7 @@ struct is_localizable_function<F, false> : public std::false_type { }; -} // namespace Stuff +} // namespace XT } // namespace Dune #include "default.hh" diff --git a/dune/xt/functions/random_ellipsoids.hh b/dune/xt/functions/random_ellipsoids.hh index d61436d3a..b0e04d111 100644 --- a/dune/xt/functions/random_ellipsoids.hh +++ b/dune/xt/functions/random_ellipsoids.hh @@ -17,22 +17,21 @@ #include <dune/common/exceptions.hh> -#include <dune/stuff/common/configuration.hh> -#include <dune/stuff/common/debug.hh> -#include <dune/stuff/common/fvector.hh> -#include <dune/stuff/common/random.hh> -#include <dune/stuff/grid/information.hh> +#include <dune/xt/common/configuration.hh> +#include <dune/xt/common/debug.hh> +#include <dune/xt/common/fvector.hh> +#include <dune/xt/common/random.hh> #include "interfaces.hh" namespace Dune { -namespace Stuff { +namespace XT { namespace Functions { template <size_t dim, class CoordType = double> struct Ellipsoid { - typedef DSC::FieldVector<CoordType, dim> DomainType; + typedef FieldVector<CoordType, dim> DomainType; DomainType center; DomainType radii; @@ -40,11 +39,11 @@ struct Ellipsoid { const auto shifted = point - center; double sum = 0; - for (auto ii : DSC::valueRange(dim)) { + for (auto ii : Common::value_range(dim)) { const auto pii = shifted[ii]; sum += std::pow(pii, 2) / std::pow(radii[ii], 2); } - return DSC::FloatCmp::le(sum, 1.); + return FloatCmp::le(sum, 1.); } bool intersects_cube(DomainType /*ll*/, DomainType /*ur*/) const { @@ -93,7 +92,7 @@ public: , value_(value) , local_ellipsoids_(local_ellipsoids) { - // DSC_LOG_DEBUG_0 << "create local LF Ellips with " << local_ellipsoids_.size() << " instances\n"; + // DXTC_LOG_DEBUG_0 << "create local LF Ellips with " << local_ellipsoids_.size() << " instances\n"; } Localfunction(const Localfunction& /*other*/) = delete; @@ -112,14 +111,14 @@ public: for (const auto& ellipsoid : local_ellipsoids_) { if (ellipsoid.contains(xx_global)) { ret = value_; - // DSC_LOG_DEBUG_0 << "ell INSIDE " << ellipsoid.center << " with xx " << xx_global << "\n"; + // DXTC_LOG_DEBUG_0 << "ell INSIDE " << ellipsoid.center << " with xx " << xx_global << "\n"; return; } } ret = 0; } - virtual void jacobian(const DomainType& UNUSED_UNLESS_DEBUG(xx), JacobianRangeType& ret) const override + virtual void jacobian(const DomainType& DXTC_DEBUG_ONLY(xx), JacobianRangeType& ret) const override { assert(this->is_a_valid_point(xx)); ret *= RangeFieldType(0); @@ -165,7 +164,7 @@ public: RandomEllipsoidsFunction(const Common::FieldVector<DomainFieldType, dimDomain>& lowerLeft, const Common::FieldVector<DomainFieldType, dimDomain>& upperRight, - const Stuff::Common::Configuration& ellipsoid_cfg, const std::string nm = static_id()) + const Common::Configuration& ellipsoid_cfg, const std::string nm = static_id()) : lowerLeft_(lowerLeft) , upperRight_(upperRight) , name_(nm) @@ -174,7 +173,7 @@ public: typedef unsigned long UL; const UL level_0_count = ellipsoid_cfg.get("ellipsoids.count", 10); const UL max_depth = ellipsoid_cfg.get("ellipsoids.recursion_depth", 1); - const UL children = ellipsoid_cfg.get<UL>("ellipsoids.children", 3u); //, DSC::ValidateLess<UL>(0)); + const UL children = ellipsoid_cfg.get<UL>("ellipsoids.children", 3u); //, ValidateLess<UL>(0)); const UL total_count = level_0_count + level_0_count * std::pow(children, max_depth + 1); ellipsoids_.resize(level_0_count); ellipsoids_.reserve(total_count); @@ -182,13 +181,13 @@ public: const auto min_radius = ellipsoid_cfg.get("ellipsoids.min_radius", 0.01); const auto max_radius = ellipsoid_cfg.get("ellipsoids.max_radius", 0.02); const auto child_displacement = ellipsoid_cfg.get("ellipsoids.max_child_displacement", max_radius); - typedef DSC::DefaultRNG<DomainFieldType> RNG; + typedef Common::DefaultRNG<DomainFieldType> RNG; RNG center_rng(0, 1, seed); RNG radii_rng(min_radius, max_radius, seed); RNG dist_rng(min_radius, child_displacement, seed); RNG sign_rng(-1, 1, seed); - const auto parent_range = DSC::valueRange(0ul, level_0_count); + const auto parent_range = Common::value_range(0ul, level_0_count); for (auto ii : parent_range) { std::generate( ellipsoids_[ii].center.begin(), ellipsoids_[ii].center.end(), [¢er_rng]() { return center_rng(); }); @@ -198,13 +197,13 @@ public: std::function<void(UL, const EllipsoidType&)> recurse_add = [&](UL current_level, const EllipsoidType& parent) { if (current_level > max_depth) return; - for (const auto unused_counter : DSC::valueRange(children)) { + for (const auto unused_counter : Common::value_range(children)) { EllipsoidType child = parent; const double scale = std::pow(ellipsoid_cfg.get("ellipsoids.recursion_scale", 0.5), current_level); const auto displace = [&](DomainFieldType& coord) { - const auto disp = dist_rng() * DSC::signum(sign_rng()); + const auto disp = dist_rng() * signum(sign_rng()); coord += disp; - DSC_LOG_DEBUG_0 << disp << ";"; + DXTC_LOG_DEBUG_0 << disp << ";"; }; std::for_each(child.center.begin(), child.center.end(), displace); std::generate(child.radii.begin(), child.radii.end(), [&radii_rng, scale]() { return radii_rng() * scale; }); @@ -216,8 +215,8 @@ public: for (auto ii : parent_range) { recurse_add(0, ellipsoids_[ii]); } - DSC_LOG_DEBUG_0 << "generated " << ellipsoids_.size() << " of " << total_count << "\n"; - to_file(*DSC::make_ofstream("ellipsoids.txt")); + DXTC_LOG_DEBUG_0 << "generated " << ellipsoids_.size() << " of " << total_count << "\n"; + to_file(*Common::make_ofstream("ellipsoids.txt")); } RandomEllipsoidsFunction(const ThisType& other) = default; @@ -253,15 +252,15 @@ private: bounding_box(const EntityType& entity) const { typename EllipsoidType::DomainType ll, ur; - typedef Dune::Stuff::Common::MinMaxAvg<DomainFieldType> MinMaxAvgType; + typedef Common::MinMaxAvg<DomainFieldType> MinMaxAvgType; std::array<MinMaxAvgType, dimDomain> coord_limits; const auto& geo = entity.geometry(); - for (auto i : DSC::valueRange(geo.corners())) { + for (auto i : Common::value_range(geo.corners())) { const auto& corner(geo.corner(i)); for (size_t k = 0; k < dimDomain; ++k) coord_limits[k](corner[k]); } - for (auto ii : DSC::valueRange(dimDomain)) { + for (auto ii : Common::value_range(dimDomain)) { ll[ii] = coord_limits[ii].min(); ur[ii] = coord_limits[ii].max(); @@ -282,9 +281,9 @@ public: std::vector<EllipsoidType> local_ellipsoids; for (const auto& ellipsoid : ellipsoids_) { bool inside = true; - for (auto ii : DSC::valueRange(dimDomain)) { - inside = inside && DSC::FloatCmp::ge(ellipsoid.center[ii], ll[ii]); - inside = inside && DSC::FloatCmp::le(ellipsoid.center[ii], ur[ii]); + for (auto ii : Common::value_range(dimDomain)) { + inside = inside && FloatCmp::ge(ellipsoid.center[ii], ll[ii]); + inside = inside && FloatCmp::le(ellipsoid.center[ii], ur[ii]); } if (inside) { local_ellipsoids.push_back(ellipsoid); @@ -298,12 +297,12 @@ private: const Common::FieldVector<DomainFieldType, dimDomain> lowerLeft_; const Common::FieldVector<DomainFieldType, dimDomain> upperRight_; const std::string name_; - const Stuff::Common::Configuration ellipsoid_cfg_; + const Common::Configuration ellipsoid_cfg_; std::vector<EllipsoidType> ellipsoids_; }; // class RandomEllipsoidsFunction } // namespace Functions -} // namespace Stuff +} // namespace XT } // namespace Dune #endif // DUNE_XT_FUNCTIONS_RANDOMELLIPSOIDS_HH diff --git a/dune/xt/functions/spe10/model1.hh b/dune/xt/functions/spe10/model1.hh index e148e9526..982e69e1b 100644 --- a/dune/xt/functions/spe10/model1.hh +++ b/dune/xt/functions/spe10/model1.hh @@ -13,17 +13,17 @@ #include <iostream> #include <memory> -#include <dune/stuff/common/exceptions.hh> -#include <dune/stuff/common/configuration.hh> -#include <dune/stuff/common/color.hh> -#include <dune/stuff/common/string.hh> -#include <dune/stuff/common/fvector.hh> -#include <dune/stuff/common/type_utils.hh> +#include <dune/xt/common/exceptions.hh> +#include <dune/xt/common/configuration.hh> +#include <dune/xt/common/color.hh> +#include <dune/xt/common/string.hh> +#include <dune/xt/common/fvector.hh> +#include <dune/xt/common/type_utils.hh> -#include "checkerboard.hh" +#include "../checkerboard.hh" namespace Dune { -namespace Stuff { +namespace XT { namespace Exceptions { class spe10_data_file_missing : public Dune::IOError @@ -102,7 +102,7 @@ public: config["filename"] = internal::model1_filename; config["lower_left"] = "[0.0 0.0]"; config["upper_right"] = - "[" + Common::toString(internal::model_1_length_x) + " " + Common::toString(internal::model_1_length_z) + "]"; + "[" + Common::to_string(internal::model_1_length_x) + " " + Common::to_string(internal::model_1_length_z) + "]"; config.set("min_value", internal::model1_min_value); config.set("max_value", internal::model1_max_value); config["name"] = static_id(); @@ -215,7 +215,7 @@ private: } // namespace Spe10 } // namespace Functions -} // namespace Stuff +} // namespace XT } // namespace Dune #endif // DUNE_XT_FUNCTIONS_SPE10_HH diff --git a/dune/xt/functions/spe10/model2.hh b/dune/xt/functions/spe10/model2.hh index 48fbbfa23..f6f6eb402 100644 --- a/dune/xt/functions/spe10/model2.hh +++ b/dune/xt/functions/spe10/model2.hh @@ -11,16 +11,16 @@ #include <iostream> #include <memory> -#include <dune/stuff/common/exceptions.hh> -#include <dune/stuff/common/configuration.hh> -#include <dune/stuff/common/color.hh> -#include <dune/stuff/common/string.hh> -#include <dune/stuff/common/fvector.hh> -#include <dune/stuff/common/type_utils.hh> -#include <dune/stuff/functions/global.hh> +#include <dune/xt/common/exceptions.hh> +#include <dune/xt/common/configuration.hh> +#include <dune/xt/common/color.hh> +#include <dune/xt/common/string.hh> +#include <dune/xt/common/fvector.hh> +#include <dune/xt/common/type_utils.hh> +#include <dune/xt/functions/global.hh> namespace Dune { -namespace Stuff { +namespace XT { namespace Functions { namespace Spe10 { @@ -29,16 +29,16 @@ namespace Spe10 { * */ template <class EntityImp, class DomainFieldImp, size_t dim_domain, class RangeFieldImp, size_t r, size_t rC> -class Model2 : public Stuff::GlobalFunctionInterface<EntityImp, DomainFieldImp, dim_domain, RangeFieldImp, r, rC> +class Model2 : public GlobalFunctionInterface<EntityImp, DomainFieldImp, dim_domain, RangeFieldImp, r, rC> { static_assert(r == rC, ""); static_assert(dim_domain == rC, ""); static_assert(dim_domain == 3, ""); - typedef Stuff::GlobalFunctionInterface<EntityImp, DomainFieldImp, dim_domain, RangeFieldImp, r, rC> BaseType; + typedef GlobalFunctionInterface<EntityImp, DomainFieldImp, dim_domain, RangeFieldImp, r, rC> BaseType; public: Model2(std::string data_filename = "perm_case2a.dat", - DSC::FieldVector<double, dim_domain> upper_right = default_upper_right) + Common::FieldVector<double, dim_domain> upper_right = default_upper_right) : deltas_{{upper_right[0] / num_elements[0], upper_right[1] / num_elements[1], upper_right[2] / num_elements[2]}} , permeability_(nullptr) , permMatrix_(0.0) @@ -47,9 +47,9 @@ public: readPermeability(); } - static const DSC::FieldVector<double, dim_domain> default_upper_right; + static const Common::FieldVector<double, dim_domain> default_upper_right; // unsigned int mandated by CubeGrid provider - static const DSC::FieldVector<unsigned int, dim_domain> num_elements; + static const Common::FieldVector<unsigned int, dim_domain> num_elements; virtual ~Model2() { @@ -63,12 +63,12 @@ public: { if (!permeability_) { - DSC_LOG_ERROR_0 << "The SPE10-permeability data file could not be opened. This file does\n" - << "not come with the dune-multiscale repository due to file size. To download it\n" - << "execute\n" - << "wget http://www.spe.org/web/csp/datasets/por_perm_case2a.zip\n" - << "unzip the file and move the file 'spe_perm.dat' to\n" - << "dune-multiscale/dune/multiscale/problems/spe10_permeability.dat!\n"; + DXTC_LOG_ERROR_0 << "The SPE10-permeability data file could not be opened. This file does\n" + << "not come with the dune-multiscale repository due to file size. To download it\n" + << "execute\n" + << "wget http://www.spe.org/web/csp/datasets/por_perm_case2a.zip\n" + << "unzip the file and move the file 'spe_perm.dat' to\n" + << "dune-multiscale/dune/multiscale/problems/spe10_permeability.dat!\n"; DUNE_THROW(IOError, "Data file for Groundwaterflow permeability could not be opened!"); } @@ -116,14 +116,14 @@ private: }; template <class EntityImp, class DomainFieldImp, size_t dim_domain, class RangeFieldImp, size_t r, size_t rC> -const DSC::FieldVector<unsigned int, dim_domain> +const Common::FieldVector<unsigned int, dim_domain> Model2<EntityImp, DomainFieldImp, dim_domain, RangeFieldImp, r, rC>::num_elements{{60, 220, 85}}; template <class EntityImp, class DomainFieldImp, size_t dim_domain, class RangeFieldImp, size_t r, size_t rC> -const DSC::FieldVector<double, dim_domain> +const Common::FieldVector<double, dim_domain> Model2<EntityImp, DomainFieldImp, dim_domain, RangeFieldImp, r, rC>::default_upper_right{{1, 3.667, 1.417}}; } // namespace Spe10 } // namespace Functions -} // namespace Stuff +} // namespace XT } // namespace Dune #endif // DUNE_XT_FUNCTIONS_SPE10MODEL2_HH diff --git a/dune/xt/test/ESV2007.cc b/dune/xt/test/ESV2007.cc index ede113c9c..cedd3b0dc 100644 --- a/dune/xt/test/ESV2007.cc +++ b/dune/xt/test/ESV2007.cc @@ -6,15 +6,15 @@ // Felix Schindler (2015) // Rene Milk (2015) -#include "main.hxx" +#include <dune/xt/test/main.hxx> #include "functions.hh" #include <memory> #include <dune/common/exceptions.hh> -#include <dune/stuff/functions/interfaces.hh> -#include <dune/stuff/functions/ESV2007.hh> +#include <dune/xt/functions/interfaces.hh> +#include <dune/xt/functions/ESV2007.hh> #if HAVE_DUNE_GRID #include <dune/grid/yaspgrid.hh> @@ -22,7 +22,10 @@ #include <dune/grid/alugrid.hh> #endif // HAVE_ALUGRID -struct ESV2007FunctionTest : public DS::FunctionTest<TESTFUNCTIONTYPE> +using namespace Dune; +using namespace Dune::XT; + +struct ESV2007FunctionTest : public FunctionTest<TESTFUNCTIONTYPE> { virtual void check() const { diff --git a/dune/xt/test/ESV2007.mini b/dune/xt/test/ESV2007.mini index 5bd6f49c8..9671dbd66 100644 --- a/dune/xt/test/ESV2007.mini +++ b/dune/xt/test/ESV2007.mini @@ -1,4 +1,4 @@ -__name = functions_ESV2007 +__name = ESV2007 __exec_suffix = yasp_{testcase_short}, alu_{testcase_short} | expand grid grid1 = Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>> @@ -6,8 +6,8 @@ grid2 = Dune::ALUGrid<2, 2, Dune::simplex, Dune::nonconforming> grid = {grid1}, {grid2} | expand grid entity_type = {grid}::Codim<0>::Entity -testcase1 = Dune::Stuff::Functions::ESV2007::Testcase1Force<{entity_type}, double, 2, double, 1, 1> -testcase2 = Dune::Stuff::Functions::ESV2007::Testcase1ExactSolution<{entity_type}, double, 2, double, 1, 1> +testcase1 = Dune::XT::Functions::ESV2007::Testcase1Force<{entity_type}, double, 2, double, 1, 1> +testcase2 = Dune::XT::Functions::ESV2007::Testcase1ExactSolution<{entity_type}, double, 2, double, 1, 1> testcase_short = force, exact | expand testcase [__static] diff --git a/dune/xt/test/checkerboard.cc b/dune/xt/test/checkerboard.cc index a0be72669..2065dfca5 100644 --- a/dune/xt/test/checkerboard.cc +++ b/dune/xt/test/checkerboard.cc @@ -7,15 +7,15 @@ // Rene Milk (2014 - 2015) // Tobias Leibner (2014) -#include "main.hxx" +#include <dune/xt/test/main.hxx> #include "functions.hh" #include <memory> #include <dune/common/exceptions.hh> -#include <dune/stuff/functions/interfaces.hh> -#include <dune/stuff/functions/checkerboard.hh> +#include <dune/xt/functions/interfaces.hh> +#include <dune/xt/functions/checkerboard.hh> #if HAVE_DUNE_GRID #include <dune/grid/yaspgrid.hh> @@ -23,7 +23,10 @@ #include <dune/grid/alugrid.hh> #endif // HAVE_ALUGRID -struct CheckerboardFunctionTest : public DS::FunctionTest<TESTFUNCTIONTYPE> +using namespace Dune; +using namespace Dune::XT; + +struct CheckerboardFunctionTest : public FunctionTest<TESTFUNCTIONTYPE> { void check() const { diff --git a/dune/xt/test/checkerboard.mini b/dune/xt/test/checkerboard.mini index 6e1604588..2604e7572 100644 --- a/dune/xt/test/checkerboard.mini +++ b/dune/xt/test/checkerboard.mini @@ -1,6 +1,6 @@ -include functions_functions.mini +include functions.mini -__name = functions_checkerboard +__name = checkerboard [__static] -TESTFUNCTIONTYPE = Dune::Stuff::Functions::Checkerboard<{entity_type}, double, {dimDomain}, double, {dimRange}, {dimRangeCols}> +TESTFUNCTIONTYPE = Dune::XT::Functions::Checkerboard<{entity_type}, double, {dimDomain}, double, {dimRange}, {dimRangeCols}> diff --git a/dune/xt/test/combined.cc b/dune/xt/test/combined.cc index 6ae24de12..baa3c9025 100644 --- a/dune/xt/test/combined.cc +++ b/dune/xt/test/combined.cc @@ -6,7 +6,7 @@ // Felix Schindler (2014 - 2015) // Rene Milk (2015) -#include "main.hxx" +#include <dune/xt/test/main.hxx> #include <memory> @@ -18,17 +18,17 @@ #include <dune/geometry/quadraturerules.hh> -#include <dune/stuff/common/float_cmp.hh> -#include <dune/stuff/grid/provider/cube.hh> -#include <dune/stuff/functions/constant.hh> -#include <dune/stuff/functions/combined.hh> +#include <dune/xt/common/float_cmp.hh> +#include <dune/xt/grid/provider/cube.hh> +#include <dune/xt/functions/constant.hh> +#include <dune/xt/functions/combined.hh> #include "functions.hh" #if HAVE_DUNE_GRID using namespace Dune; -using namespace Stuff; +using namespace Dune::XT; template <class G> class DifferenceFunctionType @@ -57,7 +57,7 @@ protected: static std::shared_ptr<GridType> create_grid() { - return Stuff::Grid::Providers::Cube<GridType>(0.0, 1.0, 4).grid_ptr(); + return XT::Grid::Providers::Cube<GridType>(0.0, 1.0, 4).grid_ptr(); } static std::unique_ptr<FunctionType> create(const double ll, const double rr) diff --git a/dune/xt/test/constant.cc b/dune/xt/test/constant.cc index f868e81ba..f97ddef82 100644 --- a/dune/xt/test/constant.cc +++ b/dune/xt/test/constant.cc @@ -7,15 +7,15 @@ // Rene Milk (2013 - 2015) // Tobias Leibner (2014) -#include "main.hxx" -#include "functions.hh" +#include <dune/xt/test/main.hxx> + #include <memory> #include <dune/common/exceptions.hh> -#include <dune/stuff/functions/interfaces.hh> -#include <dune/stuff/functions/constant.hh> +#include <dune/xt/functions/interfaces.hh> +#include <dune/xt/functions/constant.hh> #if HAVE_DUNE_GRID #include <dune/grid/yaspgrid.hh> @@ -23,7 +23,12 @@ #include <dune/grid/alugrid.hh> #endif // HAVE_ALUGRID -struct ConstantFunctionTest : public DS::FunctionTest<TESTFUNCTIONTYPE> +#include "functions.hh" + +using namespace Dune; +using namespace Dune::XT; + +struct ConstantFunctionTest : public FunctionTest<TESTFUNCTIONTYPE> { virtual void check() const { diff --git a/dune/xt/test/constant.mini b/dune/xt/test/constant.mini index 62ba46467..65beee4cb 100644 --- a/dune/xt/test/constant.mini +++ b/dune/xt/test/constant.mini @@ -1,6 +1,6 @@ -include functions_functions.mini +include functions.mini -__name = functions_constant +__name = constant [__static] -TESTFUNCTIONTYPE = Dune::Stuff::Functions::Constant<{entity_type}, double, {dimDomain}, double, {dimRange}, {dimRangeCols}> +TESTFUNCTIONTYPE = Dune::XT::Functions::Constant<{entity_type}, double, {dimDomain}, double, {dimRange}, {dimRangeCols}> diff --git a/dune/xt/test/expression.cc b/dune/xt/test/expression.cc index e90e6413d..892920456 100644 --- a/dune/xt/test/expression.cc +++ b/dune/xt/test/expression.cc @@ -7,15 +7,15 @@ // Rene Milk (2010, 2012 - 2015) // Tobias Leibner (2014 - 2015) -#include "main.hxx" +#include <dune/xt/test/main.hxx> #include "functions.hh" #include <memory> #include <dune/common/exceptions.hh> -#include <dune/stuff/functions/interfaces.hh> -#include <dune/stuff/functions/expression.hh> +#include <dune/xt/functions/interfaces.hh> +#include <dune/xt/functions/expression.hh> #if HAVE_DUNE_GRID #include <dune/grid/yaspgrid.hh> @@ -23,11 +23,14 @@ #include <dune/grid/alugrid.hh> #endif // HAVE_ALUGRID -struct ExpressionFunctionTest : public DS::FunctionTest<TESTFUNCTIONTYPE> +using namespace Dune; +using namespace Dune::XT; + +struct ExpressionFunctionTest : public FunctionTest<TESTFUNCTIONTYPE> { virtual void check() const { - Dune::Stuff::Common::Configuration config = FunctionType::default_config(); + Common::Configuration config = FunctionType::default_config(); const std::unique_ptr<const FunctionType> function(FunctionType::create(config)); config["expression"] = "[2*x[0] 3*x[0] 4*x[0]; 1 sin(x[0]) 0; cos(x[0]) x[0] 0]"; config["gradient"] = "[2 0 0; 0 0 0; -sin(x[0]) 0 0]"; diff --git a/dune/xt/test/expression.mini b/dune/xt/test/expression.mini index 08475e5cc..e998ce32e 100644 --- a/dune/xt/test/expression.mini +++ b/dune/xt/test/expression.mini @@ -1,6 +1,6 @@ -include functions_functions.mini +include functions.mini -__name = functions_expression +__name = expression [__static] -TESTFUNCTIONTYPE = Dune::Stuff::Functions::Expression<{entity_type}, double, {dimDomain}, double, {dimRange}, {dimRangeCols}> +TESTFUNCTIONTYPE = Dune::XT::Functions::Expression<{entity_type}, double, {dimDomain}, double, {dimRange}, {dimRangeCols}> diff --git a/dune/xt/test/flattop.cc b/dune/xt/test/flattop.cc index 2d8cbd764..c84c17c2c 100644 --- a/dune/xt/test/flattop.cc +++ b/dune/xt/test/flattop.cc @@ -1,16 +1,16 @@ -// This file is part of the dune-stuff project: -// https://github.com/wwu-numerik/dune-stuff +// This file is part of the dune-xt-functions project: +// https://github.com/dune-community/dune-xt-functions // The copyright lies with the authors of this file (see below). // License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) // Authors: // Felix Schindler (2014 - 2015) // Rene Milk (2015) -#ifndef DUNE_STUFF_TEST_MAIN_CATCH_EXCEPTIONS -#define DUNE_STUFF_TEST_MAIN_CATCH_EXCEPTIONS 1 +#ifndef DUNE_XT_COMMON_TEST_MAIN_CATCH_EXCEPTIONS +#define DUNE_XT_COMMON_TEST_MAIN_CATCH_EXCEPTIONS 1 #endif -#include "main.hxx" +#include <dune/xt/test/main.hxx> #include <memory> @@ -22,18 +22,18 @@ #include <dune/geometry/quadraturerules.hh> -#include <dune/stuff/common/float_cmp.hh> -#include <dune/stuff/grid/provider/cube.hh> -#include <dune/stuff/functions/flattop.hh> -#include <dune/stuff/common/string.hh> -#include <dune/stuff/common/fvector.hh> +#include <dune/xt/common/float_cmp.hh> +#include <dune/xt/grid/provider/cube.hh> +#include <dune/xt/functions/flattop.hh> +#include <dune/xt/common/string.hh> +#include <dune/xt/common/fvector.hh> #include "functions.hh" #if HAVE_DUNE_GRID using namespace Dune; -using namespace Stuff; +using namespace Dune::XT; template <class G> class FlatTopFunctionType @@ -61,7 +61,7 @@ protected: static std::shared_ptr<GridType> create_grid() { - return Stuff::Grid::Providers::Cube<GridType>(0, 3, 12).grid_ptr(); + return XT::Grid::Providers::Cube<GridType>(0, 3, 12).grid_ptr(); } template <class P, class V, class L, class R, class D, class E> @@ -104,13 +104,13 @@ TYPED_TEST(FlatTopFunctionTest, dynamic_interface_check) TYPED_TEST(FlatTopFunctionTest, evaluate_check) { auto grid_ptr = this->create_grid(); - typedef DSC::FieldVector<double, TypeParam::value> DomainType; + typedef FieldVector<double, TypeParam::value> DomainType; const DomainType left(1); const DomainType right(2); const DomainType delta(1e-6); const double value = 20; typename TestFixture::FunctionType func(left, right, delta, value, "bar"); - func.visualize(grid_ptr->leafGridView(), "dim_" + DSC::toString(int(TypeParam::value))); + func.visualize(grid_ptr->leafGridView(), "dim_" + Common::to_string(int(TypeParam::value))); for (const auto& entity : Stuff::Common::entityRange(grid_ptr->leafGridView())) { const auto local_func = func.local_function(entity); const auto& quadrature = QuadratureRules<double, TypeParam::value>::rule( diff --git a/dune/xt/test/functions.cc b/dune/xt/test/functions.cc index 9d7341d62..4007ecfb4 100644 --- a/dune/xt/test/functions.cc +++ b/dune/xt/test/functions.cc @@ -7,14 +7,14 @@ // Rene Milk (2013 - 2015) // Tobias Leibner (2014) -#include "main.hxx" +#include <dune/xt/test/main.hxx> #include "functions.hh" #include <memory> #include <dune/common/exceptions.hh> -#include <dune/stuff/functions.hh> +#include <dune/xt/functions.hh> #if HAVE_DUNE_GRID #include <dune/grid/yaspgrid.hh> @@ -22,22 +22,24 @@ #include <dune/grid/alugrid.hh> #endif // HAVE_ALUGRID +using namespace Dune; +using namespace Dune::XT; /* we just take the constant function as a container for the types we need */ /* since this one always exists for all combinations */ -struct FunctionsTest : public DS::FunctionTest<TESTFUNCTIONTYPE> +struct FunctionsTest : public FunctionTest<TESTFUNCTIONTYPE> { - typedef Dune::Stuff::FunctionsProvider<EntityType, DomainFieldType, dimDomain, RangeFieldType, dimRange, dimRangeCols> + typedef FunctionsProvider<EntityType, DomainFieldType, dimDomain, RangeFieldType, dimRange, dimRangeCols> FunctionsProvider; typedef typename FunctionsProvider::InterfaceType InterfaceType; virtual void check() const { for (const auto& type : FunctionsProvider::available()) { - const Dune::Stuff::Common::Configuration config = FunctionsProvider::default_config(type); + const Common::Configuration config = FunctionsProvider::default_config(type); try { const std::unique_ptr<InterfaceType> function = FunctionsProvider::create(type, config); - } catch (Dune::Stuff::Exceptions::spe10_data_file_missing&) { + } catch (Exceptions::spe10_data_file_missing&) { } } } diff --git a/dune/xt/test/functions.hh b/dune/xt/test/functions.hh index 80c47577c..4a42e1430 100644 --- a/dune/xt/test/functions.hh +++ b/dune/xt/test/functions.hh @@ -13,13 +13,13 @@ #include <type_traits> #include <memory> -#include <dune/stuff/common/ranges.hh> -#include <dune/stuff/common/configuration.hh> -#include <dune/stuff/test/gtest/gtest.h> -#include <dune/stuff/functions/interfaces.hh> +#include <dune/xt/common/ranges.hh> +#include <dune/xt/common/configuration.hh> +#include <dune/xt/test/gtest/gtest.h> +#include <dune/xt/functions/interfaces.hh> namespace Dune { -namespace Stuff { +namespace XT { template <class FunctionImp> class FunctionTest : public ::testing::Test @@ -59,8 +59,8 @@ protected: static void static_create_check() { - Stuff::Common::Configuration default_cfg = FunctionImp::default_config(); - std::unique_ptr<FunctionImp> func = FunctionImp::create(default_cfg); + Common::Configuration default_cfg = FunctionImp::default_config(); + std::unique_ptr<FunctionImp> func = FunctionImp::create(default_cfg); } // ... static_create_check(...) template <class GridType> @@ -76,7 +76,7 @@ protected: }; // class FunctionTest -} // namespace Stuff +} // namespace XT } // namespace Dune #endif // DUNE_XT_TEST_FUNCTIONS_HH diff --git a/dune/xt/test/functions.mini b/dune/xt/test/functions.mini index bd770f17c..2272c696b 100644 --- a/dune/xt/test/functions.mini +++ b/dune/xt/test/functions.mini @@ -1,4 +1,4 @@ -__name = functions_functions +__name = functions __exec_suffix = yasp_d{dimDomain}_r{dimRange}_rc{dimRangeCols}, alu_{__local.geometry}_{__local.refinement}_d{dimDomain}_r{dimRange}_rc{dimRangeCols} | expand grid dimRange = 1, 2, 3 | expand @@ -7,4 +7,4 @@ dimRangeCols = 1, 2, 3 | expand include grids.mini [__static] -TESTFUNCTIONTYPE = Dune::Stuff::Functions::Constant<{entity_type}, double, {dimDomain}, double, {dimRange}, {dimRangeCols}> +TESTFUNCTIONTYPE = Dune::XT::Functions::Constant<{entity_type}, double, {dimDomain}, double, {dimRange}, {dimRangeCols}> diff --git a/dune/xt/test/global.cc b/dune/xt/test/global.cc index 068ecb77b..a542fa146 100644 --- a/dune/xt/test/global.cc +++ b/dune/xt/test/global.cc @@ -7,15 +7,15 @@ // Rene Milk (2014 - 2015) // Tobias Leibner (2014) -#include "main.hxx" +#include <dune/xt/test/main.hxx> #include "functions.hh" #include <memory> #include <dune/common/exceptions.hh> -#include <dune/stuff/functions/interfaces.hh> -#include <dune/stuff/functions/global.hh> +#include <dune/xt/functions/interfaces.hh> +#include <dune/xt/functions/global.hh> #if HAVE_DUNE_GRID #include <dune/grid/yaspgrid.hh> @@ -23,7 +23,10 @@ #include <dune/grid/alugrid.hh> #endif // HAVE_ALUGRID -struct GlobalLambdaFunctionTest : public DS::FunctionTest<TESTFUNCTIONTYPE> +using namespace Dune; +using namespace Dune::XT; + +struct GlobalLambdaFunctionTest : public FunctionTest<TESTFUNCTIONTYPE> { virtual void check() const { diff --git a/dune/xt/test/global.mini b/dune/xt/test/global.mini index 513240f55..c3071a247 100644 --- a/dune/xt/test/global.mini +++ b/dune/xt/test/global.mini @@ -1,6 +1,6 @@ -include functions_functions.mini +include functions.mini -__name = functions_global +__name = global [__static] -TESTFUNCTIONTYPE = Dune::Stuff::GlobalLambdaFunction<{entity_type}, double, {dimDomain}, double, {dimRange}, {dimRangeCols}> +TESTFUNCTIONTYPE = Dune::XT::GlobalLambdaFunction<{entity_type}, double, {dimDomain}, double, {dimRange}, {dimRangeCols}> diff --git a/dune/xt/test/indicator.cc b/dune/xt/test/indicator.cc index 3f34d822a..d0dc7db24 100644 --- a/dune/xt/test/indicator.cc +++ b/dune/xt/test/indicator.cc @@ -6,15 +6,15 @@ // Felix Schindler (2015) // Rene Milk (2015) -#include "main.hxx" +#include <dune/xt/test/main.hxx> #include "functions.hh" #include <memory> #include <dune/common/exceptions.hh> -#include <dune/stuff/functions/interfaces.hh> -#include <dune/stuff/functions/indicator.hh> +#include <dune/xt/functions/interfaces.hh> +#include <dune/xt/functions/indicator.hh> #if HAVE_DUNE_GRID #include <dune/grid/yaspgrid.hh> @@ -22,7 +22,10 @@ #include <dune/grid/alugrid.hh> #endif // HAVE_ALUGRID -struct IndicatorFunctionTest : public DS::FunctionTest<TESTFUNCTIONTYPE> +using namespace Dune; +using namespace Dune::XT; + +struct IndicatorFunctionTest : public FunctionTest<TESTFUNCTIONTYPE> { void check() const { diff --git a/dune/xt/test/indicator.mini b/dune/xt/test/indicator.mini index eb45a74f7..33c91b301 100644 --- a/dune/xt/test/indicator.mini +++ b/dune/xt/test/indicator.mini @@ -1,4 +1,4 @@ -__name = functions_indicator +__name = indicator __exec_suffix = yasp_d{dimDomain}_r{dimRange}_rc{dimRangeCols}, alu_{__local.geometry}_{__local.refinement}_d{dimDomain}_r{dimRange}_rc{dimRangeCols} | expand grid dimRange = 1 @@ -7,4 +7,4 @@ dimRangeCols = 1 include grids.mini [__static] -TESTFUNCTIONTYPE = Dune::Stuff::Functions::Indicator<{entity_type}, double, {dimDomain}, double, {dimRange}, {dimRangeCols}> +TESTFUNCTIONTYPE = Dune::XT::Functions::Indicator<{entity_type}, double, {dimDomain}, double, {dimRange}, {dimRangeCols}> diff --git a/dune/xt/test/spe10.cc b/dune/xt/test/spe10.cc index 9bbd49568..47df79b2e 100644 --- a/dune/xt/test/spe10.cc +++ b/dune/xt/test/spe10.cc @@ -5,16 +5,16 @@ // Authors: // Rene Milk (2015) -#include "main.hxx" +#include <dune/xt/test/main.hxx> #include "functions.hh" #include <memory> #include <dune/common/exceptions.hh> -#include <dune/stuff/functions/interfaces.hh> -#include <dune/stuff/functions/spe10.hh> -#include <dune/stuff/functions/spe10model2.hh> +#include <dune/xt/functions/interfaces.hh> +#include <dune/xt/functions/spe10/model1.hh> +#include <dune/xt/functions/spe10/model2.hh> #if HAVE_DUNE_GRID #include <dune/grid/yaspgrid.hh> @@ -22,7 +22,10 @@ #include <dune/grid/alugrid.hh> #endif // HAVE_ALUGRID -struct Spe10Model2FunctionTest : public DS::FunctionTest<TESTFUNCTIONTYPE> +using namespace Dune; +using namespace Dune::XT; + +struct Spe10Model2FunctionTest : public FunctionTest<TESTFUNCTIONTYPE> { void check() const { diff --git a/dune/xt/test/spe10.mini b/dune/xt/test/spe10.mini index 842024eba..783f548e8 100644 --- a/dune/xt/test/spe10.mini +++ b/dune/xt/test/spe10.mini @@ -1,10 +1,10 @@ -include functions_functions.mini +include functions.mini -__name = functions_spe10 +__name = spe10 dimDomain = 3 dimRange = 3 dimRangeCols = 3 [__static] -TESTFUNCTIONTYPE = Dune::Stuff::Functions::Spe10::Model2<{entity_type}, double, {dimDomain}, double, {dimRange}, {dimRangeCols}> +TESTFUNCTIONTYPE = Dune::XT::Functions::Spe10::Model2<{entity_type}, double, {dimDomain}, double, {dimRange}, {dimRangeCols}> -- GitLab