My Project
AbstractGridRepresentation.h
1 /*-----------------------------------------------------------------------
2 Copyright F2I-CONSULTING, (2014-2016)
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(common::EpcDocument * epcDoc, gsoap_resqml2_0_1::eml__DataObjectReference* partialObject, bool withTruncatedPillars) :AbstractRepresentation(epcDoc, 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  std::string getParentGridUuid() const;
132 
136  unsigned int getChildGridCount() const {return childGridSet.size();}
137 
141  AbstractGridRepresentation* getChildGrid(const unsigned int & index) const {return childGridSet[index];}
142 
146  void setParentWindow(ULONG64 * cellIndices, const ULONG64 & cellIndexCount, resqml2_0_1::UnstructuredGridRepresentation* parentGrid);
147 
159  void setParentWindow(unsigned int * columnIndices, const unsigned int & columnIndexCount,
160  const unsigned int & kLayerIndexRegridStart,
161  unsigned int * childCellCountPerInterval, unsigned int * parentCellCountPerInterval, const unsigned int & intervalCount,
162  class AbstractColumnLayerGridRepresentation* parentGrid, double * childCellWeights = nullptr);
163 
183  void setParentWindow(
184  const unsigned int & iCellIndexRegridStart, unsigned int * childCellCountPerIInterval, unsigned int * parentCellCountPerIInterval, const unsigned int & iIntervalCount,
185  const unsigned int & jCellIndexRegridStart, unsigned int * childCellCountPerJInterval, unsigned int * parentCellCountPerJInterval, const unsigned int & jIntervalCount,
186  const unsigned int & kCellIndexRegridStart, unsigned int * childCellCountPerKInterval, unsigned int * parentCellCountPerKInterval, const unsigned int & kIntervalCount,
187  resqml2_0_1::AbstractIjkGridRepresentation* parentGrid, double * iChildCellWeights = nullptr, double * jChildCellWeights = nullptr, double * kChildCellWeights = nullptr);
188 
208  void setParentWindow(
209  const unsigned int & iCellIndexRegridStart, unsigned int constantChildCellCountPerIInterval, unsigned int constantParentCellCountPerIInterval, const unsigned int & iIntervalCount,
210  const unsigned int & jCellIndexRegridStart, unsigned int constantChildCellCountPerJInterval, unsigned int constantParentCellCountPerJInterval, const unsigned int & jIntervalCount,
211  const unsigned int & kCellIndexRegridStart, unsigned int constantChildCellCountPerKInterval, unsigned int constantParentCellCountPerKInterval, const unsigned int & kIntervalCount,
212  resqml2_0_1::AbstractIjkGridRepresentation* parentGrid, double * iChildCellWeights = nullptr, double * jChildCellWeights = nullptr, double * kChildCellWeights = nullptr);
213 
231  void setParentWindow(
232  const unsigned int & iCellIndexRegridStart, unsigned int iChildCellCount, unsigned int iParentCellCount,
233  const unsigned int & jCellIndexRegridStart, unsigned int jChildCellCount, unsigned int jParentCellCount,
234  const unsigned int & kCellIndexRegridStart, unsigned int kChildCellCount, unsigned int kParentCellCount,
235  resqml2_0_1::AbstractIjkGridRepresentation* parentGrid, double * iChildCellWeights = nullptr, double * jChildCellWeights = nullptr, double * kChildCellWeights = nullptr);
236 
241  void setForcedNonRegridedParentCell(ULONG64 * cellIndices, const ULONG64 & cellIndexCount);
242 
246  void setCellOverlap(const ULONG64 & parentChildCellPairCount, ULONG64 * parentChildCellPair,
247  const gsoap_resqml2_0_1::eml__VolumeUom & volumeUom = gsoap_resqml2_0_1::eml__VolumeUom__m3, double * overlapVolumes = nullptr);
248 
253  LONG64 getParentCellIndexCount() const;
254 
259  void getParentCellIndices(ULONG64 * parentCellIndices) const;
260 
264  LONG64 getParentColumnIndexCount() const;
265 
270  void getParentColumnIndices(ULONG64 * parentColumnIndices) const;
271 
277  ULONG64 getRegridStartIndexOnParentGrid(const char & dimension) const;
278 
284  ULONG64 getRegridIntervalCount(const char & dimension) const;
285 
292  bool isRegridCellCountPerIntervalConstant(const char & dimension, const bool & childVsParentCellCount) const;
293 
294  /*
295  * Get the constant cell count per interval
296  * Only run this method for an ijk parent grid or a strict column layer parent grid.
297  * @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.
298  * @param childVsParentCellCount If true return the child cell count per interval. If false return the parent cell count per interval.
299  */
300  ULONG64 getRegridConstantCellCountPerInterval(const char & dimension, const bool & childVsParentCellCount) const;
301 
308  void getRegridCellCountPerInterval(const char & dimension, ULONG64 * childCellCountPerInterval, const bool & childVsParentCellCount) const;
309 
314  bool hasRegridChildCellWeights(const char & dimension) const;
315 
321  void getRegridChildCellWeights(const char & dimension, ULONG64 * childCellWeights) const;
322 
327  bool hasForcedNonRegridedParentCell() const;
328 
329  //************************************************************
330  //**************** LINK WITH STRATIGRAPHY ********************
331  //************************************************************
332 
339  void setCellAssociationWithStratigraphicOrganizationInterpretation(ULONG64 * stratiUnitIndices, const ULONG64 & nullValue, resqml2_0_1::AbstractStratigraphicOrganizationInterpretation* stratiOrgInterp);
340 
344  resqml2_0_1::AbstractStratigraphicOrganizationInterpretation* getStratigraphicOrganizationInterpretation() const;
345 
349  virtual std::string getStratigraphicOrganizationInterpretationUuid() const;
350 
354  bool hasCellStratigraphicUnitIndices() const;
355 
361  ULONG64 getCellStratigraphicUnitIndices(ULONG64 * stratiUnitIndices);
362 
363  //************************************************************
364  //********************** TRUNCATION **************************
365  //************************************************************
366 
370  bool isTruncated() const;
371 
375  ULONG64 getTruncatedFaceCount() const;
376 
381  void getNodeIndicesOfTruncatedFaces(ULONG64 * nodeIndices) const;
382 
390  void getCumulativeNodeCountPerTruncatedFace(ULONG64 * nodeCountPerFace) const;
391 
398  void getNodeCountPerTruncatedFace(ULONG64 * nodeCountPerFace) const;
399 
403  ULONG64 getTruncatedCellCount() const;
404 
408  void getTruncatedCellIndices(ULONG64* cellIndices) const;
409 
415  void getTruncatedFaceIndicesOfTruncatedCells(ULONG64 * faceIndices) const;
416 
425  void getCumulativeTruncatedFaceCountPerTruncatedCell(ULONG64 * cumulativeFaceCountPerCell) const;
426 
433  void getTruncatedFaceCountPerTruncatedCell(ULONG64 * faceCountPerCell) const;
434 
440  void getNonTruncatedFaceIndicesOfTruncatedCells(ULONG64 * faceIndices) const;
441 
450  void getCumulativeNonTruncatedFaceCountPerTruncatedCell(ULONG64 * cumulativeFaceCountPerCell) const;
451 
458  void getNonTruncatedFaceCountPerTruncatedCell(ULONG64 * faceCountPerCell) const;
459 
464  void getTruncatedFaceIsRightHanded(unsigned char* cellFaceIsRightHanded) const;
465 
466  static const char* XML_TAG;
467 
468  protected:
469 
470  virtual std::vector<epc::Relationship> getAllEpcRelationships() const;
471  void importRelationshipSetFromEpc(common::EpcDocument* epcDoc);
472 
473  bool withTruncatedPillars;
474 
475  std::vector<AbstractGridRepresentation*> childGridSet;
476 
477  std::vector<resqml2::GridConnectionSetRepresentation*> gridConnectionSetRepresentationSet;
478  std::vector<resqml2_0_1::BlockedWellboreRepresentation*> blockedWellboreRepresentationSet;
479 
482 
483  };
484 }
std::vector< resqml2::GridConnectionSetRepresentation * > getGridConnectionSetRepresentationSet() const
Definition: AbstractGridRepresentation.h:102
Definition: AbstractIjkGridRepresentation.h:46
void pushBackSupportingGridRepresentation(class AbstractGridRepresentation *supportingGridRep)
Definition: GridConnectionSetRepresentation.cpp:87
AbstractGridRepresentation(common::EpcDocument *epcDoc, gsoap_resqml2_0_1::eml__DataObjectReference *partialObject, bool withTruncatedPillars)
Definition: AbstractGridRepresentation.h:71
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:79
void pushBackSupportingGridRepresentation(resqml2::AbstractGridRepresentation *supportingGridRep)
Definition: BlockedWellboreRepresentation.cpp:203
Definition: EpcDocument.h:155
Definition: UnstructuredGridRepresentation.h:40
Definition: AbstractRepresentation.h:40
Definition: GridConnectionSetRepresentation.h:40
AbstractGridRepresentation(resqml2::AbstractFeatureInterpretation *interp, resqml2::AbstractLocal3dCrs *crs, bool withTruncatedPillars)
Definition: AbstractGridRepresentation.h:76
Definition: AbstractColumnLayerGridRepresentation.h:45
unsigned int getChildGridCount() const
Definition: AbstractGridRepresentation.h:136
Definition: EpcDocument.h:61
AbstractGridRepresentation(gsoap_resqml2_0_1::resqml2__AbstractGridRepresentation *fromGsoap, bool withTruncatedPillars)
Definition: AbstractGridRepresentation.h:81
AbstractGridRepresentation * getChildGrid(const unsigned int &index) const
Definition: AbstractGridRepresentation.h:141
Definition: AbstractFeatureInterpretation.h:45