My Project
AbstractGridRepresentation.h
1 /*-----------------------------------------------------------------------
2 Copyright F2I-CONSULTING, (2014-2017)
3 
4 philippe.verney@f2i-consulting.com
5 
6 This software is a computer program whose purpose is to access to data formatted using Energistics standards.
7 
8 This software is governed by the CeCILL-B license under French law and
9 abiding by the rules of distribution of free software. You can use,
10 modify and/ or redistribute the software under the terms of the CeCILL-B
11 license as circulated by CEA, CNRS and INRIA at the following URL
12 "http://www.cecill.info".
13 
14 As a counterpart to the access to the source code and rights to copy,
15 modify and redistribute granted by the license, users are provided only
16 with a limited warranty and the software's author, the holder of the
17 economic rights, and the successive licensors have only limited
18 liability.
19 
20 In this respect, the user's attention is drawn to the risks associated
21 with loading, using, modifying and/or developing or reproducing the
22 software by the user in light of its specific status of free software,
23 that may mean that it is complicated to manipulate, and that also
24 therefore means that it is reserved for developers and experienced
25 professionals having in-depth computer knowledge. Users are therefore
26 encouraged to load and test the software's suitability as regards their
27 requirements in conditions enabling the security of their systems and/or
28 data to be ensured and, more generally, to use and operate it in the
29 same conditions as regards security.
30 
31 The fact that you are presently reading this means that you have had
32 knowledge of the CeCILL-B license and that you accept its terms.
33 -----------------------------------------------------------------------*/
34 #pragma once
35 
36 #include "resqml2/GridConnectionSetRepresentation.h"
37 #include "resqml2_0_1/BlockedWellboreRepresentation.h"
38 
39 namespace resqml2_0_1
40 {
41  class AbstractStratigraphicOrganizationInterpretation;
42  class UnstructuredGridRepresentation;
43 }
44 
45 namespace resqml2
46 {
47  class DLL_IMPORT_OR_EXPORT AbstractGridRepresentation : public AbstractRepresentation
48  {
49  private:
50 
55  gsoap_resqml2_0_1::resqml2__Regrid* createRegrid(const unsigned int & indexRegridStart, unsigned int * childCellCountPerInterval, unsigned int * parentCellCountPerInterval, const unsigned int & intervalCount, double * childCellWeights,
56  const std::string & dimension, bool forceConstantCellCountPerInterval = false);
57 
58  /*
59  * @param dimension It must be either 'i', 'j' ou 'k' (upper or lower case) for an ijk parent grid. 'k' for a strict column layer parent grid.
60  * @param childVsParentCellCount If true return the child cell count per interval. If false return the parent cell count per interval.
61  */
62  gsoap_resqml2_0_1::resqml2__AbstractIntegerArray* getCellCountPerInterval2_0_1(const char & dimension, const bool & childVsParentCellCount) const;
63 
64  gsoap_resqml2_0_1::resqml2__AbstractParentWindow* getParentWindow2_0_1() const;
65 
66  protected:
67 
71  AbstractGridRepresentation(gsoap_resqml2_0_1::eml20__DataObjectReference* partialObject, bool withTruncatedPillars) :AbstractRepresentation(partialObject), withTruncatedPillars(withTruncatedPillars) {}
72 
76  AbstractGridRepresentation(resqml2::AbstractFeatureInterpretation* interp, resqml2::AbstractLocal3dCrs * crs, bool withTruncatedPillars) : AbstractRepresentation(interp, crs), withTruncatedPillars(withTruncatedPillars){}
77 
81  AbstractGridRepresentation(gsoap_resqml2_0_1::resqml2__AbstractGridRepresentation* fromGsoap, bool withTruncatedPillars) : AbstractRepresentation(fromGsoap), withTruncatedPillars(withTruncatedPillars) {}
82 
83  public:
84 
89 
93  virtual ULONG64 getCellCount() const = 0;
94 
95  //************************************************************
96  //****************** GRID CONNECTION SET *********************
97  //************************************************************
98 
102  std::vector<resqml2::GridConnectionSetRepresentation*> getGridConnectionSetRepresentationSet() const {return gridConnectionSetRepresentationSet;}
103 
108  unsigned int getGridConnectionSetRepresentationCount() const {return gridConnectionSetRepresentationSet.size();}
109 
114  resqml2::GridConnectionSetRepresentation* getGridConnectionSetRepresentation(const unsigned int & index) const;
115 
116 
117  //************************************************************
118  //******************** GRID PARENTAGE ************************
119  //************************************************************
120 
125  AbstractGridRepresentation* getParentGrid() const;
126 
131  gsoap_resqml2_0_1::eml20__DataObjectReference* getParentGridDor() const;
132 
137  std::string getParentGridUuid() const;
138 
142  unsigned int getChildGridCount() const {return childGridSet.size();}
143 
147  AbstractGridRepresentation* getChildGrid(const unsigned int & index) const {return childGridSet[index];}
148 
152  void setParentWindow(ULONG64 * cellIndices, const ULONG64 & cellIndexCount, resqml2_0_1::UnstructuredGridRepresentation* parentGrid);
153 
165  void setParentWindow(unsigned int * columnIndices, const unsigned int & columnIndexCount,
166  const unsigned int & kLayerIndexRegridStart,
167  unsigned int * childCellCountPerInterval, unsigned int * parentCellCountPerInterval, const unsigned int & intervalCount,
168  class AbstractColumnLayerGridRepresentation* parentGrid, double * childCellWeights = nullptr);
169 
189  void setParentWindow(
190  const unsigned int & iCellIndexRegridStart, unsigned int * childCellCountPerIInterval, unsigned int * parentCellCountPerIInterval, const unsigned int & iIntervalCount,
191  const unsigned int & jCellIndexRegridStart, unsigned int * childCellCountPerJInterval, unsigned int * parentCellCountPerJInterval, const unsigned int & jIntervalCount,
192  const unsigned int & kCellIndexRegridStart, unsigned int * childCellCountPerKInterval, unsigned int * parentCellCountPerKInterval, const unsigned int & kIntervalCount,
193  resqml2_0_1::AbstractIjkGridRepresentation* parentGrid, double * iChildCellWeights = nullptr, double * jChildCellWeights = nullptr, double * kChildCellWeights = nullptr);
194 
214  void setParentWindow(
215  const unsigned int & iCellIndexRegridStart, unsigned int constantChildCellCountPerIInterval, unsigned int constantParentCellCountPerIInterval, const unsigned int & iIntervalCount,
216  const unsigned int & jCellIndexRegridStart, unsigned int constantChildCellCountPerJInterval, unsigned int constantParentCellCountPerJInterval, const unsigned int & jIntervalCount,
217  const unsigned int & kCellIndexRegridStart, unsigned int constantChildCellCountPerKInterval, unsigned int constantParentCellCountPerKInterval, const unsigned int & kIntervalCount,
218  resqml2_0_1::AbstractIjkGridRepresentation* parentGrid, double * iChildCellWeights = nullptr, double * jChildCellWeights = nullptr, double * kChildCellWeights = nullptr);
219 
237  void setParentWindow(
238  const unsigned int & iCellIndexRegridStart, unsigned int iChildCellCount, unsigned int iParentCellCount,
239  const unsigned int & jCellIndexRegridStart, unsigned int jChildCellCount, unsigned int jParentCellCount,
240  const unsigned int & kCellIndexRegridStart, unsigned int kChildCellCount, unsigned int kParentCellCount,
241  resqml2_0_1::AbstractIjkGridRepresentation* parentGrid, double * iChildCellWeights = nullptr, double * jChildCellWeights = nullptr, double * kChildCellWeights = nullptr);
242 
247  void setForcedNonRegridedParentCell(ULONG64 * cellIndices, const ULONG64 & cellIndexCount);
248 
252  void setCellOverlap(const ULONG64 & parentChildCellPairCount, ULONG64 * parentChildCellPair,
253  const gsoap_resqml2_0_1::eml20__VolumeUom & volumeUom = gsoap_resqml2_0_1::eml20__VolumeUom__m3, double * overlapVolumes = nullptr);
254 
259  LONG64 getParentCellIndexCount() const;
260 
265  void getParentCellIndices(ULONG64 * parentCellIndices) const;
266 
270  LONG64 getParentColumnIndexCount() const;
271 
276  void getParentColumnIndices(ULONG64 * parentColumnIndices) const;
277 
283  ULONG64 getRegridStartIndexOnParentGrid(const char & dimension) const;
284 
290  ULONG64 getRegridIntervalCount(const char & dimension) const;
291 
298  bool isRegridCellCountPerIntervalConstant(const char & dimension, const bool & childVsParentCellCount) const;
299 
300  /*
301  * Get the constant cell count per interval
302  * Only run this method for an ijk parent grid or a strict column layer parent grid.
303  * @param dimension It must be either 'i', 'j' ou 'k' (upper or lower case) for an ijk parent grid. 'k' for a strict column layer parent grid.
304  * @param childVsParentCellCount If true return the child cell count per interval. If false return the parent cell count per interval.
305  */
306  ULONG64 getRegridConstantCellCountPerInterval(const char & dimension, const bool & childVsParentCellCount) const;
307 
314  void getRegridCellCountPerInterval(const char & dimension, ULONG64 * childCellCountPerInterval, const bool & childVsParentCellCount) const;
315 
320  bool hasRegridChildCellWeights(const char & dimension) const;
321 
327  void getRegridChildCellWeights(const char & dimension, ULONG64 * childCellWeights) const;
328 
333  bool hasForcedNonRegridedParentCell() const;
334 
335  //************************************************************
336  //**************** LINK WITH STRATIGRAPHY ********************
337  //************************************************************
338 
345  void setCellAssociationWithStratigraphicOrganizationInterpretation(ULONG64 * stratiUnitIndices, const ULONG64 & nullValue, resqml2_0_1::AbstractStratigraphicOrganizationInterpretation* stratiOrgInterp);
346 
350  resqml2_0_1::AbstractStratigraphicOrganizationInterpretation* getStratigraphicOrganizationInterpretation() const;
351 
355  virtual gsoap_resqml2_0_1::eml20__DataObjectReference* getStratigraphicOrganizationInterpretationDor() const;
356 
360  std::string getStratigraphicOrganizationInterpretationUuid() const;
361 
365  std::string getStratigraphicOrganizationInterpretationTitle() const;
366 
370  bool hasCellStratigraphicUnitIndices() const;
371 
377  ULONG64 getCellStratigraphicUnitIndices(ULONG64 * stratiUnitIndices);
378 
379  //************************************************************
380  //********************** TRUNCATION **************************
381  //************************************************************
382 
386  bool isTruncated() const;
387 
391  ULONG64 getTruncatedFaceCount() const;
392 
397  void getNodeIndicesOfTruncatedFaces(ULONG64 * nodeIndices) const;
398 
406  void getCumulativeNodeCountPerTruncatedFace(ULONG64 * nodeCountPerFace) const;
407 
414  void getNodeCountPerTruncatedFace(ULONG64 * nodeCountPerFace) const;
415 
419  ULONG64 getTruncatedCellCount() const;
420 
424  void getTruncatedCellIndices(ULONG64* cellIndices) const;
425 
431  void getTruncatedFaceIndicesOfTruncatedCells(ULONG64 * faceIndices) const;
432 
441  void getCumulativeTruncatedFaceCountPerTruncatedCell(ULONG64 * cumulativeFaceCountPerCell) const;
442 
449  void getTruncatedFaceCountPerTruncatedCell(ULONG64 * faceCountPerCell) const;
450 
456  void getNonTruncatedFaceIndicesOfTruncatedCells(ULONG64 * faceIndices) const;
457 
466  void getCumulativeNonTruncatedFaceCountPerTruncatedCell(ULONG64 * cumulativeFaceCountPerCell) const;
467 
474  void getNonTruncatedFaceCountPerTruncatedCell(ULONG64 * faceCountPerCell) const;
475 
480  void getTruncatedFaceIsRightHanded(unsigned char* cellFaceIsRightHanded) const;
481 
482  static const char* XML_TAG;
483 
484  protected:
485 
486  virtual std::vector<epc::Relationship> getAllEpcRelationships() const;
487  void importRelationshipSetFromEpc(common::EpcDocument* epcDoc);
488 
489  bool withTruncatedPillars;
490 
491  std::vector<AbstractGridRepresentation*> childGridSet;
492 
493  std::vector<resqml2::GridConnectionSetRepresentation*> gridConnectionSetRepresentationSet;
494  std::vector<resqml2_0_1::BlockedWellboreRepresentation*> blockedWellboreRepresentationSet;
495 
498 
499  };
500 }
std::vector< resqml2::GridConnectionSetRepresentation * > getGridConnectionSetRepresentationSet() const
Definition: AbstractGridRepresentation.h:102
Definition: AbstractIjkGridRepresentation.h:46
void pushBackSupportingGridRepresentation(class AbstractGridRepresentation *supportingGridRep)
Definition: GridConnectionSetRepresentation.cpp:87
Definition: AbstractLocal3dCrs.h:40
unsigned int getGridConnectionSetRepresentationCount() const
Definition: AbstractGridRepresentation.h:108
Definition: AbstractStratigraphicOrganizationInterpretation.h:41
virtual ~AbstractGridRepresentation()
Definition: AbstractGridRepresentation.h:88
Definition: AbstractGridRepresentation.h:47
Definition: EpcDocument.h:78
void pushBackSupportingGridRepresentation(resqml2::AbstractGridRepresentation *supportingGridRep)
Definition: BlockedWellboreRepresentation.cpp:195
Definition: EpcDocument.h:168
Definition: UnstructuredGridRepresentation.h:40
Definition: AbstractRepresentation.h:44
Definition: GridConnectionSetRepresentation.h:40
AbstractGridRepresentation(resqml2::AbstractFeatureInterpretation *interp, resqml2::AbstractLocal3dCrs *crs, bool withTruncatedPillars)
Definition: AbstractGridRepresentation.h:76
Definition: AbstractColumnLayerGridRepresentation.h:45
AbstractGridRepresentation(gsoap_resqml2_0_1::eml20__DataObjectReference *partialObject, bool withTruncatedPillars)
Definition: AbstractGridRepresentation.h:71
unsigned int getChildGridCount() const
Definition: AbstractGridRepresentation.h:142
Definition: EpcDocument.h:62
AbstractGridRepresentation(gsoap_resqml2_0_1::resqml2__AbstractGridRepresentation *fromGsoap, bool withTruncatedPillars)
Definition: AbstractGridRepresentation.h:81
AbstractGridRepresentation * getChildGrid(const unsigned int &index) const
Definition: AbstractGridRepresentation.h:147
Definition: AbstractFeatureInterpretation.h:45