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,
254 const SeedSize& seedSize);
270 bool empty()
const {
return this->seedCell_.empty(); }
273 auto numSeeds()
const {
return this->seedCell_.size(); }
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,
434 const SeedSize& seedSize);
446 bool updateExistingSeed(
const NormalVectorIx ix,
448 const SeedSize& seedSize);
453 #endif // OPM_WELL_FRACTURE_SEED_HPP_INCLUDED std::array< double, 3 > NormalVector
Type alias for the normal vector at a single seed point.
Definition: WellFractureSeeds.hpp:51
auto verticalExtent() const
Seed's vertical extent.
Definition: WellFractureSeeds.hpp:190
void serializeOp(Serializer &serializer)
Convert between byte array and object representation.
Definition: WellFractureSeeds.hpp:210
const SeedSize & getSize(const SeedIndex &i) const
Retrieve initial fracture size vector based on insertion order/record index.
Definition: WellFractureSeeds.hpp:320
SeedSize()=default
Default constructor.
void finalizeSeeds()
Establish accelerator structure for LOG(n) normal vector lookup based on Cartesian cell indices...
Definition: WellFractureSeeds.cpp:51
static WellFractureSeeds serializationTestObject()
Create a serialisation test object.
Definition: WellFractureSeeds.cpp:92
bool operator!=(const SeedSize &that) const
Inequality predicate.
Definition: WellFractureSeeds.hpp:139
static SeedSize serializationTestObject()
Create a serialisation test object.
Definition: WellFractureSeeds.cpp:30
WellFractureSeeds(const std::string &wellName)
Constructor.
Definition: WellFractureSeeds.hpp:226
const SeedSize * getSize(const SeedCell &c) const
Look up fracturing size vector based on Cartesian cell index.
Definition: WellFractureSeeds.cpp:70
SeedSize & verticalExtent(const double ev)
Assign vertical extent.
Definition: WellFractureSeeds.hpp:164
Vertical extent, horizontal extent, and width of initial fracture at a seed point.
Definition: WellFractureSeeds.hpp:55
const std::vector< std::size_t > & seedCells() const
Retrieve this collection's fracture seed cells.
Definition: WellFractureSeeds.hpp:330
const NormalVector * getNormal(const SeedCell &c) const
Look up fracturing plane normal vector based on Cartesian cell index.
Definition: WellFractureSeeds.cpp:57
WellFractureSeeds()=default
Default constructor.
bool operator==(const SeedSize &that) const
Equality predicate.
Definition: WellFractureSeeds.hpp:127
auto width() const
Seed's initial fracture width.
Definition: WellFractureSeeds.hpp:196
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
auto horizontalExtent() const
Seed's horizontal extent.
Definition: WellFractureSeeds.hpp:184
SeedSize(const double ev, const double eh, const double wd)
Constructor.
Definition: WellFractureSeeds.hpp:104
SeedSize & width(const double wd)
Assign initial fracture width.
Definition: WellFractureSeeds.hpp:177
SeedSize & horizontalExtent(const double eh)
Assign horizontal extent.
Definition: WellFractureSeeds.hpp:151
void serializeOp(Serializer &serializer)
Convert between byte array and object representation.
Definition: WellFractureSeeds.hpp:352
bool empty() const
Predicate for empty fracture seed collection.
Definition: WellFractureSeeds.hpp:270
Disambiguating type for requesting fracture plane normal vectors based on Cartesian cell indices...
Definition: WellFractureSeeds.hpp:44
bool updateSeed(const std::size_t seedCellGlobal, const NormalVector &seedNormal, const SeedSize &seedSize)
Insert or update a fracture seed in current collection.
Definition: WellFractureSeeds.cpp:37
std::size_t i
Insertion/record index.
Definition: WellFractureSeeds.hpp:39
Fracture seed points attached to a single well.
Definition: WellFractureSeeds.hpp:31
auto numSeeds() const
Number of fracture seeds in the current collection.
Definition: WellFractureSeeds.hpp:273
Disambiguating type for requesting fracture plane normal vectors based on insertion indices...
Definition: WellFractureSeeds.hpp:36
bool operator==(const WellFractureSeeds &that) const
Equality predicate.
Definition: WellFractureSeeds.cpp:82
const NormalVector & getNormal(const SeedIndex &i) const
Retrieve fracturing plane normal vector based on insertion order/record index.
Definition: WellFractureSeeds.hpp:302
std::size_t c
Cartesian cell index.
Definition: WellFractureSeeds.hpp:47
SeedSize & operator=(const SeedSize &rhs)=default
Assignment operator.
Class for (de-)serializing.
Definition: Serializer.hpp:94
const std::string & name() const
Named well to which this seed collection is associated.
Definition: WellFractureSeeds.hpp:234