Fesapi  0.13.0.0
This project provides C++ classes which allow an easy access in import and export to the Energistics standards.
AbstractIjkGridRepresentation.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/AbstractColumnLayerGridRepresentation.h"
22 
23 #include <stdexcept>
24 #include <map>
25 
26 namespace RESQML2_0_1_NS
27 {
33  {
34  private :
35 
39  void init(soap* soapContext, RESQML2_NS::AbstractLocal3dCrs * crs,
40  const std::string & guid, const std::string & title,
41  const unsigned int & iCount, const unsigned int & jCount, const unsigned int & kCount,
42  bool withTruncatedPillars);
43 
44  class BlockInformation
45  {
46  public:
47 
48  unsigned int iInterfaceStart;
49  unsigned int iInterfaceEnd;
50  unsigned int jInterfaceStart;
51  unsigned int jInterfaceEnd;
52  unsigned int kInterfaceStart;
53  unsigned int kInterfaceEnd;
54 
58  std::map<unsigned int, unsigned int> globalToLocalSplitCoordinateLinesIndex;
59 
60  BlockInformation() {}
61 
62  ~BlockInformation() {}
63  };
64 
65  protected :
66 
70  AbstractIjkGridRepresentation(gsoap_resqml2_0_1::_resqml2__IjkGridRepresentation* fromGsoap) : AbstractColumnLayerGridRepresentation(fromGsoap, false), splitInformation(nullptr), blockInformation(nullptr) {}
71  AbstractIjkGridRepresentation(gsoap_resqml2_0_1::_resqml2__TruncatedIjkGridRepresentation* fromGsoap) : AbstractColumnLayerGridRepresentation(fromGsoap, true), splitInformation(nullptr), blockInformation(nullptr) {}
72 
73  gsoap_resqml2_0_1::_resqml2__IjkGridRepresentation* getSpecializedGsoapProxy() const;
74  gsoap_resqml2_0_1::_resqml2__TruncatedIjkGridRepresentation* getSpecializedTruncatedGsoapProxy() const;
75 
76  gsoap_resqml2_0_1::resqml2__PointGeometry* getPointGeometry2_0_1(const unsigned int & patchIndex) const;
77 
78  std::vector< std::pair< unsigned int, std::vector<unsigned int> > >* splitInformation;
79 
80  BlockInformation* blockInformation;
81 
82  public:
83 
84  enum geometryKind { UNKNOWN = 0, EXPLICIT = 1, PARAMETRIC = 2, LATTICE = 3, NO_GEOMETRY = 4}; // UNKNOWN exists in case of partial transfer
85 
90  const std::string & guid, const std::string & title,
91  const unsigned int & iCount, const unsigned int & jCount, const unsigned int & kCount,
92  bool withTruncatedPillars = false);
93 
95  const std::string & guid, const std::string & title,
96  const unsigned int & iCount, const unsigned int & jCount, const unsigned int & kCount,
97  bool withTruncatedPillars = false);
98 
102  AbstractIjkGridRepresentation(gsoap_resqml2_0_1::eml20__DataObjectReference* partialObject,
103  bool withTruncatedPillars = false) :
104  AbstractColumnLayerGridRepresentation(nullptr, partialObject, withTruncatedPillars), splitInformation(nullptr), blockInformation(nullptr)
105  {
106  }
107 
112  {
113  if (blockInformation != nullptr)
114  delete blockInformation;
115  }
116 
120  unsigned int getICellCount() const;
121 
125  void setICellCount(const unsigned int & iCount);
126 
130  unsigned int getJCellCount() const;
131 
135  void setJCellCount(const unsigned int & jCount);
136 
140  ULONG64 getCellCount() const {return getICellCount() * getJCellCount() * getKCellCount();}
141 
145  unsigned int getColumnCount() const {return getICellCount() * getJCellCount();}
146 
150  unsigned int getPillarCount() const {return (getICellCount()+1) * (getJCellCount()+1);}
151 
156  unsigned int getFaceCount() const;
157 
161  unsigned int getIPillarFromGlobalIndex(const unsigned int & globalIndex) const;
162 
166  unsigned int getJPillarFromGlobalIndex(const unsigned int & globalIndex) const;
167 
171  unsigned int getGlobalIndexPillarFromIjIndex(const unsigned int & iPillar, const unsigned int & jPillar) const;
172 
176  unsigned int getIColumnFromGlobalIndex(const unsigned int & globalIndex) const;
177 
181  unsigned int getJColumnFromGlobalIndex(const unsigned int & globalIndex) const;
182 
186  unsigned int getGlobalIndexColumnFromIjIndex(const unsigned int & iColumn, const unsigned int & jColumn) const;
187 
191  unsigned int getGlobalIndexCellFromIjkIndex(const unsigned int & iCell, const unsigned int & jCell, const unsigned int & kCell) const;
192 
193  bool isRightHanded() const;
194 
200  void getPillarsOfSplitCoordinateLines(unsigned int * pillarIndices, bool reverseIAxis = false, bool reverseJAxis = false) const;
201 
206  void getColumnsOfSplitCoordinateLines(unsigned int * columnIndices, bool reverseIAxis = false, bool reverseJAxis = false) const;
207  void getColumnCountOfSplitCoordinateLines(unsigned int * columnIndexCountPerSplitCoordinateLine) const;
208 
212  unsigned long getSplitCoordinateLineCount() const;
213 
217  unsigned long getBlockSplitCoordinateLineCount() const;
218 
222  ULONG64 getSplitNodeCount() const;
223 
224  void getPillarGeometryIsDefined(bool * pillarGeometryIsDefined, bool reverseIAxis = false, bool reverseJAxis = false) const;
225 
229  bool hasEnabledCellInformation() const;
230 
237  void getEnabledCells(bool * enabledCells, bool reverseIAxis = false, bool reverseJAxis= false, bool reverseKAxis= false) const;
238 
244  void setEnabledCells(unsigned char* enabledCells);
245 
250  void loadSplitInformation();
251 
261  void loadBlockInformation(const unsigned int & iInterfaceStart, const unsigned int & iInterfaceEnd, const unsigned int & jInterfaceStart, const unsigned int & jInterfaceEnd, const unsigned int & kInterfaceStart, const unsigned int & kInterfaceEnd);
262 
266  void unloadSplitInformation();
267 
278  bool isColumnEdgeSplitted(const unsigned int & iColumn, const unsigned int & jColumn, const unsigned int & edge) const;
279 
297  ULONG64 getXyzPointIndexFromCellCorner(const unsigned int & iCell, const unsigned int & jCell, const unsigned int & kCell, const unsigned int & corner) const;
298 
318  void getXyzPointOfBlockFromCellCorner(const unsigned int & iCell, const unsigned int & jCell, const unsigned int & kCell, const unsigned int & corner,
319  const double* xyzPoints, double & x, double & y, double & z) const;
320 
325  ULONG64 getXyzPointCountOfKInterfaceOfPatch(const unsigned int & patchIndex) const;
326 
330  ULONG64 getXyzPointCountOfBlock() const;
331 
340  void getXyzPointsOfKInterfaceOfPatch(const unsigned int & kInterface, const unsigned int & patchIndex, double * xyzPoints);
341 
342  virtual void getXyzPointsOfKInterfaceSequenceOfPatch(const unsigned int & kInterfaceStart, const unsigned int & kInterfaceEnd, const unsigned int & patchIndex, double * xyzPoints) { throw std::logic_error("Partial object"); }
343 
344  virtual void getXyzPointsOfBlockOfPatch(const unsigned int & patchIndex, double * xyzPoints) { throw std::logic_error("Partial object"); };
345 
349  gsoap_resqml2_0_1::resqml2__KDirection getKDirection() const;
350 
351  virtual geometryKind getGeometryKind() const { return UNKNOWN; }
352  virtual std::string getHdfProxyUuid() const { throw std::logic_error("Partial object"); }
353  virtual ULONG64 getXyzPointCountOfPatch(const unsigned int & patchIndex) const { throw std::logic_error("Partial object"); }
354  virtual void getXyzPointsOfPatch(const unsigned int & patchIndex, double * xyzPoints) const { throw std::logic_error("Partial object"); }
355 
356  static const char* XML_TAG;
357  static const char* XML_TAG_TRUNCATED;
358  virtual std::string getXmlTag() const;
359 
360  unsigned int getPatchCount() const {return 1;}
361  };
362 }
363 
virtual ~AbstractIjkGridRepresentation()
Definition: AbstractIjkGridRepresentation.h:111
unsigned int getColumnCount() const
Definition: AbstractIjkGridRepresentation.h:145
Definition: AbstractIjkGridRepresentation.h:32
Definition: AbstractFeatureInterpretation.h:30
Definition: EpcDocument.h:65
AbstractIjkGridRepresentation(gsoap_resqml2_0_1::eml20__DataObjectReference *partialObject, bool withTruncatedPillars=false)
Definition: AbstractIjkGridRepresentation.h:102
ULONG64 getCellCount() const
Definition: AbstractIjkGridRepresentation.h:140
Definition: AbstractColumnLayerGridRepresentation.h:30
virtual ULONG64 getXyzPointCountOfPatch(const unsigned int &patchIndex) const
Definition: AbstractIjkGridRepresentation.h:353
AbstractIjkGridRepresentation(gsoap_resqml2_0_1::_resqml2__IjkGridRepresentation *fromGsoap)
Definition: AbstractIjkGridRepresentation.h:70
virtual void getXyzPointsOfPatch(const unsigned int &patchIndex, double *xyzPoints) const
Definition: AbstractIjkGridRepresentation.h:354
Definition: AbstractLocal3dCrs.h:25
unsigned int getPillarCount() const
Definition: AbstractIjkGridRepresentation.h:150