Fesapi  0.13.0.0
This project provides C++ classes which allow an easy access in import and export to the Energistics standards.
AbstractGridRepresentation.h
1 /*-----------------------------------------------------------------------
2 Licensed to the Apache Software Foundation (ASF) under one
3 or more contributor license agreements. See the NOTICE file
4 distributed with this work for additional information
5 regarding copyright ownership. The ASF licenses this file
6 to you under the Apache License, Version 2.0 (the
7 "License"; you may not use this file except in compliance
8 with the License. You may obtain a copy of the License at
9 
10  http://www.apache.org/licenses/LICENSE-2.0
11 
12 Unless required by applicable law or agreed to in writing,
13 software distributed under the License is distributed on an
14 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 KIND, either express or implied. See the License for the
16 specific language governing permissions and limitations
17 under the License.
18 -----------------------------------------------------------------------*/
19 #pragma once
20 
21 #include "resqml2/GridConnectionSetRepresentation.h"
22 #include "resqml2_0_1/BlockedWellboreRepresentation.h"
23 
24 namespace RESQML2_0_1_NS
25 {
26  class AbstractStratigraphicOrganizationInterpretation;
27  class UnstructuredGridRepresentation;
28 }
29 
30 namespace RESQML2_NS
31 {
32  class DLL_IMPORT_OR_EXPORT AbstractGridRepresentation : public AbstractRepresentation
33  {
34  private:
35 
40  gsoap_resqml2_0_1::resqml2__Regrid* createRegrid(const unsigned int & indexRegridStart, unsigned int * childCellCountPerInterval, unsigned int * parentCellCountPerInterval, const unsigned int & intervalCount, double * childCellWeights,
41  const std::string & dimension, bool forceConstantCellCountPerInterval = false);
42 
43  /*
44  * @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.
45  * @param childVsParentCellCount If true return the child cell count per interval. If false return the parent cell count per interval.
46  */
47  gsoap_resqml2_0_1::resqml2__AbstractIntegerArray* getCellCountPerInterval2_0_1(const char & dimension, const bool & childVsParentCellCount) const;
48 
49  gsoap_resqml2_0_1::resqml2__AbstractParentWindow* getParentWindow2_0_1() const;
50 
51  protected:
52 
56  AbstractGridRepresentation(gsoap_resqml2_0_1::eml20__DataObjectReference* partialObject, bool withTruncatedPillars) :AbstractRepresentation(partialObject), withTruncatedPillars(withTruncatedPillars) {}
57 
61  AbstractGridRepresentation(RESQML2_NS::AbstractFeatureInterpretation* interp, RESQML2_NS::AbstractLocal3dCrs * crs, bool withTruncatedPillars) : AbstractRepresentation(interp, crs), withTruncatedPillars(withTruncatedPillars){}
62 
66  AbstractGridRepresentation(gsoap_resqml2_0_1::resqml2__AbstractGridRepresentation* fromGsoap, bool withTruncatedPillars) : AbstractRepresentation(fromGsoap), withTruncatedPillars(withTruncatedPillars) {}
67 
68  public:
69 
74 
78  virtual ULONG64 getCellCount() const = 0;
79 
80  //************************************************************
81  //****************** GRID CONNECTION SET *********************
82  //************************************************************
83 
87  std::vector<RESQML2_NS::GridConnectionSetRepresentation*> getGridConnectionSetRepresentationSet() const {return gridConnectionSetRepresentationSet;}
88 
93  unsigned int getGridConnectionSetRepresentationCount() const {return static_cast<unsigned int>(gridConnectionSetRepresentationSet.size());}
94 
99  RESQML2_NS::GridConnectionSetRepresentation* getGridConnectionSetRepresentation(const unsigned int & index) const;
100 
101 
102  //************************************************************
103  //******************** GRID PARENTAGE ************************
104  //************************************************************
105 
110  AbstractGridRepresentation* getParentGrid() const;
111 
116  gsoap_resqml2_0_1::eml20__DataObjectReference* getParentGridDor() const;
117 
122  std::string getParentGridUuid() const;
123 
127  unsigned int getChildGridCount() const {return static_cast<unsigned int>(childGridSet.size());}
128 
132  AbstractGridRepresentation* getChildGrid(const unsigned int & index) const {return childGridSet[index];}
133 
137  void setParentWindow(ULONG64 * cellIndices, const ULONG64 & cellIndexCount, RESQML2_0_1_NS::UnstructuredGridRepresentation* parentGrid);
138 
150  void setParentWindow(unsigned int * columnIndices, const unsigned int & columnIndexCount,
151  const unsigned int & kLayerIndexRegridStart,
152  unsigned int * childCellCountPerInterval, unsigned int * parentCellCountPerInterval, const unsigned int & intervalCount,
153  class AbstractColumnLayerGridRepresentation* parentGrid, double * childCellWeights = nullptr);
154 
174  void setParentWindow(
175  const unsigned int & iCellIndexRegridStart, unsigned int * childCellCountPerIInterval, unsigned int * parentCellCountPerIInterval, const unsigned int & iIntervalCount,
176  const unsigned int & jCellIndexRegridStart, unsigned int * childCellCountPerJInterval, unsigned int * parentCellCountPerJInterval, const unsigned int & jIntervalCount,
177  const unsigned int & kCellIndexRegridStart, unsigned int * childCellCountPerKInterval, unsigned int * parentCellCountPerKInterval, const unsigned int & kIntervalCount,
178  RESQML2_0_1_NS::AbstractIjkGridRepresentation* parentGrid, double * iChildCellWeights = nullptr, double * jChildCellWeights = nullptr, double * kChildCellWeights = nullptr);
179 
199  void setParentWindow(
200  const unsigned int & iCellIndexRegridStart, unsigned int constantChildCellCountPerIInterval, unsigned int constantParentCellCountPerIInterval, const unsigned int & iIntervalCount,
201  const unsigned int & jCellIndexRegridStart, unsigned int constantChildCellCountPerJInterval, unsigned int constantParentCellCountPerJInterval, const unsigned int & jIntervalCount,
202  const unsigned int & kCellIndexRegridStart, unsigned int constantChildCellCountPerKInterval, unsigned int constantParentCellCountPerKInterval, const unsigned int & kIntervalCount,
203  RESQML2_0_1_NS::AbstractIjkGridRepresentation* parentGrid, double * iChildCellWeights = nullptr, double * jChildCellWeights = nullptr, double * kChildCellWeights = nullptr);
204 
222  void setParentWindow(
223  const unsigned int & iCellIndexRegridStart, unsigned int iChildCellCount, unsigned int iParentCellCount,
224  const unsigned int & jCellIndexRegridStart, unsigned int jChildCellCount, unsigned int jParentCellCount,
225  const unsigned int & kCellIndexRegridStart, unsigned int kChildCellCount, unsigned int kParentCellCount,
226  RESQML2_0_1_NS::AbstractIjkGridRepresentation* parentGrid, double * iChildCellWeights = nullptr, double * jChildCellWeights = nullptr, double * kChildCellWeights = nullptr);
227 
232  void setForcedNonRegridedParentCell(ULONG64 * cellIndices, const ULONG64 & cellIndexCount);
233 
237  void setCellOverlap(const ULONG64 & parentChildCellPairCount, ULONG64 * parentChildCellPair,
238  const gsoap_resqml2_0_1::eml20__VolumeUom & volumeUom = gsoap_resqml2_0_1::eml20__VolumeUom__m3, double * overlapVolumes = nullptr);
239 
244  LONG64 getParentCellIndexCount() const;
245 
250  void getParentCellIndices(ULONG64 * parentCellIndices) const;
251 
255  LONG64 getParentColumnIndexCount() const;
256 
261  void getParentColumnIndices(ULONG64 * parentColumnIndices) const;
262 
268  ULONG64 getRegridStartIndexOnParentGrid(const char & dimension) const;
269 
275  ULONG64 getRegridIntervalCount(const char & dimension) const;
276 
283  bool isRegridCellCountPerIntervalConstant(const char & dimension, const bool & childVsParentCellCount) const;
284 
285  /*
286  * Get the constant cell count per interval
287  * Only run this method for an ijk parent grid or a strict column layer parent grid.
288  * @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.
289  * @param childVsParentCellCount If true return the child cell count per interval. If false return the parent cell count per interval.
290  */
291  ULONG64 getRegridConstantCellCountPerInterval(const char & dimension, const bool & childVsParentCellCount) const;
292 
299  void getRegridCellCountPerInterval(const char & dimension, ULONG64 * childCellCountPerInterval, const bool & childVsParentCellCount) const;
300 
305  bool hasRegridChildCellWeights(const char & dimension) const;
306 
312  void getRegridChildCellWeights(const char & dimension, ULONG64 * childCellWeights) const;
313 
318  bool hasForcedNonRegridedParentCell() const;
319 
320  //************************************************************
321  //**************** LINK WITH STRATIGRAPHY ********************
322  //************************************************************
323 
330  void setCellAssociationWithStratigraphicOrganizationInterpretation(ULONG64 * stratiUnitIndices, const ULONG64 & nullValue, RESQML2_0_1_NS::AbstractStratigraphicOrganizationInterpretation* stratiOrgInterp);
331 
335  RESQML2_0_1_NS::AbstractStratigraphicOrganizationInterpretation* getStratigraphicOrganizationInterpretation() const;
336 
340  virtual gsoap_resqml2_0_1::eml20__DataObjectReference* getStratigraphicOrganizationInterpretationDor() const;
341 
345  std::string getStratigraphicOrganizationInterpretationUuid() const;
346 
350  std::string getStratigraphicOrganizationInterpretationTitle() const;
351 
355  bool hasCellStratigraphicUnitIndices() const;
356 
362  ULONG64 getCellStratigraphicUnitIndices(ULONG64 * stratiUnitIndices);
363 
364  //************************************************************
365  //********************** TRUNCATION **************************
366  //************************************************************
367 
371  bool isTruncated() const;
372 
376  ULONG64 getTruncatedFaceCount() const;
377 
382  void getNodeIndicesOfTruncatedFaces(ULONG64 * nodeIndices) const;
383 
391  void getCumulativeNodeCountPerTruncatedFace(ULONG64 * nodeCountPerFace) const;
392 
399  void getNodeCountPerTruncatedFace(ULONG64 * nodeCountPerFace) const;
400 
404  ULONG64 getTruncatedCellCount() const;
405 
409  void getTruncatedCellIndices(ULONG64* cellIndices) const;
410 
416  void getTruncatedFaceIndicesOfTruncatedCells(ULONG64 * faceIndices) const;
417 
426  void getCumulativeTruncatedFaceCountPerTruncatedCell(ULONG64 * cumulativeFaceCountPerCell) const;
427 
434  void getTruncatedFaceCountPerTruncatedCell(ULONG64 * faceCountPerCell) const;
435 
441  void getNonTruncatedFaceIndicesOfTruncatedCells(ULONG64 * faceIndices) const;
442 
451  void getCumulativeNonTruncatedFaceCountPerTruncatedCell(ULONG64 * cumulativeFaceCountPerCell) const;
452 
459  void getNonTruncatedFaceCountPerTruncatedCell(ULONG64 * faceCountPerCell) const;
460 
465  void getTruncatedFaceIsRightHanded(unsigned char* cellFaceIsRightHanded) const;
466 
467  static const char* XML_TAG;
468 
469  protected:
470 
471  virtual std::vector<epc::Relationship> getAllEpcRelationships() const;
472  void importRelationshipSetFromEpc(COMMON_NS::EpcDocument* epcDoc);
473 
474  bool withTruncatedPillars;
475 
476  std::vector<AbstractGridRepresentation*> childGridSet;
477 
478  std::vector<RESQML2_NS::GridConnectionSetRepresentation*> gridConnectionSetRepresentationSet;
479  std::vector<RESQML2_0_1_NS::BlockedWellboreRepresentation*> blockedWellboreRepresentationSet;
480 
483 
484  };
485 }
486 
AbstractGridRepresentation(RESQML2_NS::AbstractFeatureInterpretation *interp, RESQML2_NS::AbstractLocal3dCrs *crs, bool withTruncatedPillars)
Definition: AbstractGridRepresentation.h:61
AbstractGridRepresentation(gsoap_resqml2_0_1::resqml2__AbstractGridRepresentation *fromGsoap, bool withTruncatedPillars)
Definition: AbstractGridRepresentation.h:66
unsigned int getChildGridCount() const
Definition: AbstractGridRepresentation.h:127
std::vector< RESQML2_NS::GridConnectionSetRepresentation * > getGridConnectionSetRepresentationSet() const
Definition: AbstractGridRepresentation.h:87
Definition: AbstractRepresentation.h:31
Definition: GridConnectionSetRepresentation.h:25
AbstractGridRepresentation(gsoap_resqml2_0_1::eml20__DataObjectReference *partialObject, bool withTruncatedPillars)
Definition: AbstractGridRepresentation.h:56
Definition: AbstractIjkGridRepresentation.h:32
Definition: AbstractFeatureInterpretation.h:30
Definition: EpcDocument.h:65
void pushBackSupportingGridRepresentation(RESQML2_NS::AbstractGridRepresentation *supportingGridRep)
Definition: BlockedWellboreRepresentation.cpp:180
Definition: EpcDocument.h:154
Definition: AbstractColumnLayerGridRepresentation.h:30
unsigned int getGridConnectionSetRepresentationCount() const
Definition: AbstractGridRepresentation.h:93
Definition: AbstractGridRepresentation.h:32
virtual ~AbstractGridRepresentation()
Definition: AbstractGridRepresentation.h:73
Definition: UnstructuredGridRepresentation.h:26
void pushBackSupportingGridRepresentation(class AbstractGridRepresentation *supportingGridRep)
Definition: GridConnectionSetRepresentation.cpp:72
Definition: AbstractStratigraphicOrganizationInterpretation.h:26
Definition: AbstractLocal3dCrs.h:25
Definition: EpcDocument.h:49
AbstractGridRepresentation * getChildGrid(const unsigned int &index) const
Definition: AbstractGridRepresentation.h:132