Skip to content
Snippets Groups Projects
Commit 92fe3fe5 authored by Felix Schindler's avatar Felix Schindler
Browse files

[functions] added type()

parent 883a5ecb
No related branches found
No related tags found
No related merge requests found
...@@ -244,6 +244,11 @@ public: ...@@ -244,6 +244,11 @@ public:
ThisType& operator=(const ThisType& /*other*/) = delete; ThisType& operator=(const ThisType& /*other*/) = delete;
virtual std::string type() const DS_OVERRIDE DS_FINAL
{
return BaseType::static_id() + ".ESV2007.testcase1.force";
}
virtual std::string name() const DS_OVERRIDE DS_FINAL virtual std::string name() const DS_OVERRIDE DS_FINAL
{ {
return name_; return name_;
...@@ -347,6 +352,11 @@ public: ...@@ -347,6 +352,11 @@ public:
ThisType& operator=(const ThisType& /*other*/) = delete; ThisType& operator=(const ThisType& /*other*/) = delete;
virtual std::string type() const DS_OVERRIDE DS_FINAL
{
return BaseType::static_id() + ".ESV2007.testcase1.exactsolution";
}
virtual std::string name() const DS_OVERRIDE DS_FINAL virtual std::string name() const DS_OVERRIDE DS_FINAL
{ {
return name_; return name_;
......
...@@ -199,6 +199,11 @@ public: ...@@ -199,6 +199,11 @@ public:
return new ThisType(*this); return new ThisType(*this);
} }
virtual std::string type() const DS_OVERRIDE
{
return BaseType::static_id() + ".checkerboard";
}
virtual std::string name() const DS_OVERRIDE virtual std::string name() const DS_OVERRIDE
{ {
return name_; return name_;
......
...@@ -151,6 +151,11 @@ public: ...@@ -151,6 +151,11 @@ public:
return new ThisType(minuend_, subtrahend_); return new ThisType(minuend_, subtrahend_);
} }
virtual std::string type() const DS_OVERRIDE
{
return "difference between '" + minuend_.type() + "' and '" + subtrahend_.type() + "'";
}
virtual std::string name() const DS_OVERRIDE virtual std::string name() const DS_OVERRIDE
{ {
return "difference between '" + minuend_.name() + "' and '" + subtrahend_.name() + "'"; return "difference between '" + minuend_.name() + "' and '" + subtrahend_.name() + "'";
......
...@@ -81,6 +81,11 @@ public: ...@@ -81,6 +81,11 @@ public:
{ {
} }
virtual std::string type() const DS_OVERRIDE
{
return BaseType::static_id() + ".constant";
}
virtual size_t order() const DS_OVERRIDE DS_FINAL virtual size_t order() const DS_OVERRIDE DS_FINAL
{ {
return 0; return 0;
......
...@@ -156,6 +156,11 @@ public: ...@@ -156,6 +156,11 @@ public:
return *this; return *this;
} }
virtual std::string type() const DS_OVERRIDE DS_FINAL
{
return BaseType::static_id() + ".expression";
}
virtual std::string name() const DS_OVERRIDE virtual std::string name() const DS_OVERRIDE
{ {
return name_; return name_;
......
...@@ -310,6 +310,11 @@ public: ...@@ -310,6 +310,11 @@ public:
/** \defgroup info ´´These methods should be implemented in order to identify the function.'' */ /** \defgroup info ´´These methods should be implemented in order to identify the function.'' */
/* @{ */ /* @{ */
virtual std::string type() const
{
return "stuff.function";
}
virtual std::string name() const virtual std::string name() const
{ {
return "stuff.function"; return "stuff.function";
......
...@@ -94,22 +94,9 @@ private: ...@@ -94,22 +94,9 @@ private:
return data; return data;
} else } else
DUNE_THROW_COLORFULLY(Dune::IOError, "could not open '" << filename << "'!"); DUNE_THROW_COLORFULLY(Dune::IOError, "could not open '" << filename << "'!");
} // Spe10Model1() } // ... read_values_from_file(...)
public: public:
Spe10Model1(const std::string& filename, std::vector<DomainFieldType>&& lowerLeft,
std::vector<DomainFieldType>&& upperRight, const RangeFieldType min = minValue,
const RangeFieldType max = maxValue, const std::string nm = static_id())
: BaseType(std::move(lowerLeft), std::move(upperRight), {numXelements, numZelements},
read_values_from_file(filename, min, max), nm)
{
}
virtual ThisType* copy() const DS_OVERRIDE
{
return new ThisType(*this);
}
static Common::ConfigTree default_config(const std::string sub_name = "") static Common::ConfigTree default_config(const std::string sub_name = "")
{ {
Common::ConfigTree config; Common::ConfigTree config;
...@@ -143,6 +130,24 @@ public: ...@@ -143,6 +130,24 @@ public:
cfg.get("max_val", maxValue), cfg.get("max_val", maxValue),
cfg.get("name", default_cfg.get<std::string>("name"))); cfg.get("name", default_cfg.get<std::string>("name")));
} // ... create(...) } // ... create(...)
Spe10Model1(const std::string& filename, std::vector<DomainFieldType>&& lowerLeft,
std::vector<DomainFieldType>&& upperRight, const RangeFieldType min = minValue,
const RangeFieldType max = maxValue, const std::string nm = static_id())
: BaseType(std::move(lowerLeft), std::move(upperRight), {numXelements, numZelements},
read_values_from_file(filename, min, max), nm)
{
}
virtual std::string type() const DS_OVERRIDE
{
return BaseType::static_id() + ".spe10.model1";
}
virtual ThisType* copy() const DS_OVERRIDE
{
return new ThisType(*this);
}
}; // class Spe10Model1< ..., 2, ..., 1, 1 > }; // class Spe10Model1< ..., 2, ..., 1, 1 >
......
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