22#ifndef DATUM_DEPTH_HPP_INCLUDED
23#define DATUM_DEPTH_HPP_INCLUDED
37 class SOLUTIONSection;
48 DatumDepth() =
default;
53 explicit DatumDepth(
const SOLUTIONSection& soln);
57 static DatumDepth serializationTestObjectZero();
62 static DatumDepth serializationTestObjectGlobal();
67 static DatumDepth serializationTestObjectDefaultRegion();
72 static DatumDepth serializationTestObjectUserDefined();
81 double operator()(
const int region)
const
83 return (*
this)(
"FIPNUM", region);
94 double operator()(std::string_view rset,
const int region)
const
96 return std::visit([rset, region](
const auto& datumDepthImpl)
97 {
return datumDepthImpl(rset, region); }, this->datum_);
106 bool operator==(
const DatumDepth& that)
const
108 return this->datum_ == that.datum_;
116 template <
class Serializer>
117 void serializeOp(Serializer& serializer)
119 serializer(this->datum_);
137 double operator()([[maybe_unused]] std::string_view rset,
138 [[maybe_unused]]
const int region)
const
144 static Zero serializationTestObject() {
return {}; }
147 bool operator==(
const Zero&)
const {
return true; }
155 template <
class Serializer>
156 void serializeOp([[maybe_unused]] Serializer& serializer)
170 explicit Global(
const SOLUTIONSection& soln);
180 double operator()([[maybe_unused]] std::string_view rset,
181 [[maybe_unused]]
const int region)
const
187 static Global serializationTestObject();
195 bool operator==(
const Global& that)
const
197 return this->depth_ == that.depth_;
206 template <
class Serializer>
207 void serializeOp(Serializer& serializer)
209 serializer(this->depth_);
223 DefaultRegion() =
default;
228 explicit DefaultRegion(
const SOLUTIONSection& soln);
231 static DefaultRegion serializationTestObject();
241 double operator()([[maybe_unused]] std::string_view rset,
242 const int region)
const
244 assert (! this->depth_.empty());
250 return (region <
static_cast<int>(this->depth_.size()))
251 ? this->depth_[region] : this->depth_.back();
260 bool operator==(
const DefaultRegion& that)
const
262 return this->depth_ == that.depth_;
271 template <
class Serializer>
272 void serializeOp(Serializer& serializer)
274 serializer(this->depth_);
280 std::vector<double> depth_{};
288 UserDefined() =
default;
293 explicit UserDefined(
const SOLUTIONSection& soln);
296 static UserDefined serializationTestObject();
306 double operator()(std::string_view rset,
const int region)
const;
314 bool operator==(
const UserDefined& that)
const
316 return (this->rsetNames_ == that.rsetNames_)
317 && (this->rsetStart_ == that.rsetStart_)
318 && (this->depth_ == that.depth_)
319 && (this->default_ == that.default_)
320 && (this->rsetIndex_ == that.rsetIndex_)
330 template <
class Serializer>
331 void serializeOp(Serializer& serializer)
333 serializer(this->rsetNames_);
334 serializer(this->rsetStart_);
335 serializer(this->depth_);
336 serializer(this->default_);
337 serializer(this->rsetIndex_);
343 std::vector<std::string> rsetNames_{};
346 std::vector<std::vector<double>::size_type> rsetStart_{};
350 std::vector<double> depth_{};
354 std::vector<double> default_{};
358 std::vector<std::vector<std::string>::size_type> rsetIndex_{};
377 double depthValue(std::string_view rset,
378 std::vector<double>::const_iterator begin,
379 std::vector<double>::const_iterator end,
380 std::vector<double>::difference_type ix)
const;
384 std::variant<Zero, Global, DefaultRegion, UserDefined> datum_{};
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30