19#ifndef OPM_WELL_FRACTURE_SEED_HPP_INCLUDED
20#define OPM_WELL_FRACTURE_SEED_HPP_INCLUDED
59 enum class Quant : std::size_t {
76 using SizeVector = std::array<double, static_cast<std::underlying_type_t<Quant>>(Quant::Num)>;
86 static constexpr auto ix(
const Quant i)
88 return static_cast<std::underlying_type_t<Quant>
>(i);
104 explicit SeedSize(
const double ev,
const double eh,
const double wd)
129 return this->v_ == that.v_;
141 return ! (*
this == that);
153 this->v_[ix(Quant::Horizontal)] = eh;
166 this->v_[ix(Quant::Vertical)] = ev;
179 this->v_[ix(Quant::Width)] = wd;
186 return this->v_[ix(Quant::Horizontal)];
192 return this->v_[ix(Quant::Vertical)];
198 return this->v_[ix(Quant::Width)];
209 template <
class Serializer>
212 serializer(this->v_);
227 : wellName_ { wellName }
234 const std::string&
name()
const
236 return this->wellName_;
252 bool updateSeed(
const std::size_t seedCellGlobal,
253 const NormalVector& seedNormal,
254 const SeedSize& seedSize);
265 void finalizeSeeds();
270 bool empty()
const {
return this->seedCell_.empty(); }
273 auto numSeeds()
const {
return this->seedCell_.size(); }
281 const NormalVector* getNormal(
const SeedCell& c)
const;
289 const SeedSize* getSize(
const SeedCell& c)
const;
304 return this->seedNormal_[i.
i];
322 return this->seedSize_[i.
i];
332 return this->seedCell_;
351 template <
class Serializer>
354 serializer(this->wellName_);
355 serializer(this->seedCell_);
356 serializer(this->seedNormal_);
357 serializer(this->seedSize_);
358 serializer(this->lookup_);
362 using NormalVectorIx = std::vector<NormalVector>::size_type;
368 std::string wellName_{};
372 std::vector<std::size_t> seedCell_{};
375 std::vector<NormalVector> seedNormal_{};
378 std::vector<SeedSize> seedSize_{};
383 std::vector<NormalVectorIx> lookup_{};
389 void establishLookup();
400 NormalVectorIx seedIndex(
const std::size_t seedCellGlobal)
const;
409 NormalVectorIx seedIndexBinarySearch(
const std::size_t seedCellGlobal)
const;
418 NormalVectorIx seedIndexLinearSearch(
const std::size_t seedCellGlobal)
const;
432 bool insertNewSeed(
const std::size_t seedCellGlobal,
433 const NormalVector& seedNormal,
434 const SeedSize& seedSize);
446 bool updateExistingSeed(
const NormalVectorIx ix,
447 const NormalVector& seedNormal,
448 const SeedSize& seedSize);
Class for (de-)serializing.
Definition Serializer.hpp:94
Vertical extent, horizontal extent, and width of initial fracture at a seed point.
Definition WellFractureSeeds.hpp:56
bool operator==(const SeedSize &that) const
Equality predicate.
Definition WellFractureSeeds.hpp:127
SeedSize & operator=(SeedSize &&rhs)=default
Move assignment operator.
SeedSize()=default
Default constructor.
SeedSize & horizontalExtent(const double eh)
Assign horizontal extent.
Definition WellFractureSeeds.hpp:151
SeedSize(const SeedSize &rhs)=default
Copy constructor.
SeedSize & verticalExtent(const double ev)
Assign vertical extent.
Definition WellFractureSeeds.hpp:164
SeedSize & width(const double wd)
Assign initial fracture width.
Definition WellFractureSeeds.hpp:177
SeedSize(const double ev, const double eh, const double wd)
Constructor.
Definition WellFractureSeeds.hpp:104
auto horizontalExtent() const
Seed's horizontal extent.
Definition WellFractureSeeds.hpp:184
void serializeOp(Serializer &serializer)
Convert between byte array and object representation.
Definition WellFractureSeeds.hpp:210
auto verticalExtent() const
Seed's vertical extent.
Definition WellFractureSeeds.hpp:190
SeedSize & operator=(const SeedSize &rhs)=default
Assignment operator.
auto width() const
Seed's initial fracture width.
Definition WellFractureSeeds.hpp:196
bool operator!=(const SeedSize &that) const
Inequality predicate.
Definition WellFractureSeeds.hpp:139
SeedSize(SeedSize &&rhs)=default
Move constructor.
Fracture seed points attached to a single well.
Definition WellFractureSeeds.hpp:32
bool empty() const
Predicate for empty fracture seed collection.
Definition WellFractureSeeds.hpp:270
const std::string & name() const
Named well to which this seed collection is associated.
Definition WellFractureSeeds.hpp:234
const std::vector< std::size_t > & seedCells() const
Retrieve this collection's fracture seed cells.
Definition WellFractureSeeds.hpp:330
void serializeOp(Serializer &serializer)
Convert between byte array and object representation.
Definition WellFractureSeeds.hpp:352
const NormalVector & getNormal(const SeedIndex &i) const
Retrieve fracturing plane normal vector based on insertion order/record index.
Definition WellFractureSeeds.hpp:302
WellFractureSeeds(const std::string &wellName)
Constructor.
Definition WellFractureSeeds.hpp:226
WellFractureSeeds()=default
Default constructor.
auto numSeeds() const
Number of fracture seeds in the current collection.
Definition WellFractureSeeds.hpp:273
std::array< double, 3 > NormalVector
Type alias for the normal vector at a single seed point.
Definition WellFractureSeeds.hpp:51
static WellFractureSeeds serializationTestObject()
Create a serialisation test object.
Definition WellFractureSeeds.cpp:92
const SeedSize & getSize(const SeedIndex &i) const
Retrieve initial fracture size vector based on insertion order/record index.
Definition WellFractureSeeds.hpp:320
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30
Disambiguating type for requesting fracture plane normal vectors based on Cartesian cell indices.
Definition WellFractureSeeds.hpp:45
std::size_t c
Cartesian cell index.
Definition WellFractureSeeds.hpp:47
Disambiguating type for requesting fracture plane normal vectors based on insertion indices.
Definition WellFractureSeeds.hpp:37
std::size_t i
Insertion/record index.
Definition WellFractureSeeds.hpp:39