Fesapi  2.0.0.0
This project provides C++ classes which allow an easy access in import and export to the Energistics standards.
UnstructuredGridRepresentation.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 "AbstractGridRepresentation.h"
22 
23 namespace RESQML2_NS
24 {
30  {
31  public:
32 
38  DLL_IMPORT_OR_EXPORT UnstructuredGridRepresentation(gsoap_resqml2_0_1::eml20__DataObjectReference* partialObject):
39  AbstractGridRepresentation(partialObject, false), constantNodeCountPerFace(0), constantFaceCountPerCell(0),
40  cumulativeNodeCountPerFace(nullptr), cumulativeFaceCountPerCell(nullptr),
41  nodeIndicesOfFaces(nullptr), faceIndicesOfCells(nullptr) {}
42 
45  AbstractGridRepresentation(false), constantNodeCountPerFace(0), constantFaceCountPerCell(0),
46  cumulativeNodeCountPerFace(nullptr), cumulativeFaceCountPerCell(nullptr),
47  nodeIndicesOfFaces(nullptr), faceIndicesOfCells(nullptr) {}
48 
54  UnstructuredGridRepresentation(gsoap_resqml2_0_1::_resqml20__UnstructuredGridRepresentation* fromGsoap) :
55  RESQML2_NS::AbstractGridRepresentation(fromGsoap, false), constantNodeCountPerFace(0), constantFaceCountPerCell(0),
56  cumulativeNodeCountPerFace(nullptr), cumulativeFaceCountPerCell(nullptr),
57  nodeIndicesOfFaces(nullptr), faceIndicesOfCells(nullptr) {}
58 
64  UnstructuredGridRepresentation(gsoap_eml2_3::_resqml22__UnstructuredGridRepresentation* fromGsoap) :
65  RESQML2_NS::AbstractGridRepresentation(fromGsoap, false), constantNodeCountPerFace(0), constantFaceCountPerCell(0),
66  cumulativeNodeCountPerFace(nullptr), cumulativeFaceCountPerCell(nullptr),
67  nodeIndicesOfFaces(nullptr), faceIndicesOfCells(nullptr) {}
68 
72  virtual ~UnstructuredGridRepresentation() = default;
73 
79  DLL_IMPORT_OR_EXPORT virtual bool hasGeometry() const = 0;
80 
81  DLL_IMPORT_OR_EXPORT uint64_t getXyzPointCountOfPatch(unsigned int patchIndex) const final;
82 
99  DLL_IMPORT_OR_EXPORT virtual void getFaceIndicesOfCells(uint64_t * faceIndices) const = 0;
100 
120  DLL_IMPORT_OR_EXPORT virtual void getCumulativeFaceCountPerCell(uint64_t * cumulativeFaceCountPerCell_) const = 0;
121 
136  DLL_IMPORT_OR_EXPORT uint64_t const * getCumulativeFaceCountPerCell() const;
137 
156  DLL_IMPORT_OR_EXPORT void getFaceCountPerCell(uint64_t * faceCountPerCell) const;
157 
169  DLL_IMPORT_OR_EXPORT virtual bool isFaceCountOfCellsConstant() const = 0;
170 
185  DLL_IMPORT_OR_EXPORT virtual unsigned int getConstantFaceCountOfCells() const = 0;
186 
203  DLL_IMPORT_OR_EXPORT virtual void getNodeIndicesOfFaces(uint64_t * nodeIndices) const = 0;
204 
223  DLL_IMPORT_OR_EXPORT virtual void getCumulativeNodeCountPerFace(uint64_t * nodeCountPerFace) const = 0;
224 
242  DLL_IMPORT_OR_EXPORT void getNodeCountPerFace(uint64_t * nodeCountPerFace) const;
243 
253  DLL_IMPORT_OR_EXPORT virtual bool isNodeCountOfFacesConstant() const = 0;
254 
267  DLL_IMPORT_OR_EXPORT virtual unsigned int getConstantNodeCountOfFaces() const = 0;
268 
288  DLL_IMPORT_OR_EXPORT void loadGeometry();
289 
291  DLL_IMPORT_OR_EXPORT void unloadGeometry();
292 
305  DLL_IMPORT_OR_EXPORT unsigned int getFaceCountOfCell(uint64_t cellIndex) const;
306 
324  DLL_IMPORT_OR_EXPORT unsigned int getNodeCountOfFaceOfCell(uint64_t cellIndex, unsigned int localFaceIndex) const;
325 
345  DLL_IMPORT_OR_EXPORT uint64_t const * getNodeIndicesOfFaceOfCell(uint64_t cellIndex, unsigned int localFaceIndex) const;
346 
347  DLL_IMPORT_OR_EXPORT virtual uint64_t getCellCount() const override = 0;
348 
356  DLL_IMPORT_OR_EXPORT virtual uint64_t getFaceCount() const = 0;
357 
365  DLL_IMPORT_OR_EXPORT virtual uint64_t getNodeCount() const = 0;
366 
380  DLL_IMPORT_OR_EXPORT virtual void getCellFaceIsRightHanded(unsigned char* cellFaceIsRightHanded) const = 0;
381 
450  DLL_IMPORT_OR_EXPORT virtual void setGeometryUsingExistingDatasets(const std::string& cellFaceIsRightHanded, const std::string& points, uint64_t pointCount, EML2_NS::AbstractHdfProxy* proxy,
451  const std::string& faceIndicesPerCell, const std::string& faceIndicesCumulativeCountPerCell,
452  uint64_t faceCount, const std::string& nodeIndicesPerFace, const std::string& nodeIndicesCumulativeCountPerFace,
453  gsoap_resqml2_0_1::resqml20__CellShape cellShape, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr) = 0;
454 
515  DLL_IMPORT_OR_EXPORT void setGeometry(unsigned char * cellFaceIsRightHanded, double * points, uint64_t pointCount, EML2_NS::AbstractHdfProxy* proxy,
516  uint64_t * faceIndicesPerCell, uint64_t * faceIndicesCumulativeCountPerCell,
517  uint64_t faceCount, uint64_t * nodeIndicesPerFace, uint64_t * nodeIndicesCumulativeCountPerFace,
518  gsoap_resqml2_0_1::resqml20__CellShape cellShape, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr);
519 
559  DLL_IMPORT_OR_EXPORT void setTetrahedraOnlyGeometryUsingExistingDatasets(const std::string& cellFaceIsRightHanded, const std::string& points,
560  uint64_t pointCount, uint64_t faceCount, EML2_NS::AbstractHdfProxy* proxy,
561  const std::string& faceIndicesPerCell, const std::string& nodeIndicesPerFace, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr);
562 
599  DLL_IMPORT_OR_EXPORT void setTetrahedraOnlyGeometry(unsigned char * cellFaceIsRightHanded, double * points,
600  uint64_t pointCount, uint64_t faceCount, EML2_NS::AbstractHdfProxy* proxy,
601  uint64_t * faceIndicesPerCell, uint64_t * nodeIndicesPerFace, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr);
602 
608  DLL_IMPORT_OR_EXPORT void setHexahedraOnlyGeometryUsingExistingDatasets(const std::string& cellFaceIsRightHanded, const std::string& points,
609  uint64_t pointCount, uint64_t faceCount, EML2_NS::AbstractHdfProxy* proxy,
610  const std::string& faceIndicesPerCell, const std::string& nodeIndicesPerFace, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr);
611 
617  DLL_IMPORT_OR_EXPORT void setHexahedraOnlyGeometry(unsigned char * cellFaceIsRightHanded, double * points,
618  uint64_t pointCount, uint64_t faceCount, EML2_NS::AbstractHdfProxy* proxy,
619  uint64_t * faceIndicesPerCell, uint64_t * nodeIndicesPerFace, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr);
620 
621  DLL_IMPORT_OR_EXPORT unsigned int getPatchCount() const final {return 1;}
622 
624  DLL_IMPORT_OR_EXPORT static const char* XML_TAG;
625 
626  DLL_IMPORT_OR_EXPORT virtual std::string getXmlTag() const final { return XML_TAG; }
627 
628  protected:
641  void virtual setConstantCellShapeGeometryUsingExistingDatasets(const std::string& cellFaceIsRightHanded, const std::string& points,
642  uint64_t pointCount, uint64_t faceCount, RESQML2_NS::AbstractLocal3dCrs * localCrs, EML2_NS::AbstractHdfProxy* proxy,
643  const std::string& faceIndicesPerCell, uint64_t faceCountPerCell,
644  const std::string& nodeIndicesPerFace, uint64_t nodeCountPerFace) = 0;
645 
646  private:
659  void setConstantCellShapeGeometry(unsigned char * cellFaceIsRightHanded, double * points,
660  uint64_t pointCount, uint64_t faceCount, RESQML2_NS::AbstractLocal3dCrs * localCrs, EML2_NS::AbstractHdfProxy* proxy,
661  uint64_t * faceIndicesPerCell, uint64_t faceCountPerCell,
662  uint64_t * nodeIndicesPerFace, uint64_t nodeCountPerFace);
663 
664  unsigned int constantNodeCountPerFace;
665  unsigned int constantFaceCountPerCell;
666  std::unique_ptr<uint64_t[]> cumulativeNodeCountPerFace;
667  std::unique_ptr<uint64_t[]> cumulativeFaceCountPerCell;
668  std::unique_ptr<uint64_t[]> nodeIndicesOfFaces;
669  std::unique_ptr<uint64_t[]> faceIndicesOfCells;
670 
678  uint64_t getGlobalFaceIndex(uint64_t cellIndex, unsigned int localFaceIndex) const;
679  };
680 }
Proxy class for an abstract grid representation.
Definition: AbstractGridRepresentation.h:27
Unstructured grid representation characterized by a cell count, and potentially nothing else....
Definition: UnstructuredGridRepresentation.h:30
virtual uint64_t getCellCount() const override=0
void setGeometry(unsigned char *cellFaceIsRightHanded, double *points, uint64_t pointCount, eml2::AbstractHdfProxy *proxy, uint64_t *faceIndicesPerCell, uint64_t *faceIndicesCumulativeCountPerCell, uint64_t faceCount, uint64_t *nodeIndicesPerFace, uint64_t *nodeIndicesCumulativeCountPerFace, gsoap_resqml2_0_1::resqml20__CellShape cellShape, resqml2::AbstractLocal3dCrs *localCrs=nullptr)
void setTetrahedraOnlyGeometry(unsigned char *cellFaceIsRightHanded, double *points, uint64_t pointCount, uint64_t faceCount, eml2::AbstractHdfProxy *proxy, uint64_t *faceIndicesPerCell, uint64_t *nodeIndicesPerFace, resqml2::AbstractLocal3dCrs *localCrs=nullptr)
Sets a geometry which is only defined by means of tetrahedra and creates corresponding HDF5 datasets.
UnstructuredGridRepresentation(gsoap_resqml2_0_1::_resqml20__UnstructuredGridRepresentation *fromGsoap)
Definition: UnstructuredGridRepresentation.h:54
unsigned int getFaceCountOfCell(uint64_t cellIndex) const
virtual uint64_t getNodeCount() const =0
uint64_t const * getNodeIndicesOfFaceOfCell(uint64_t cellIndex, unsigned int localFaceIndex) const
virtual bool hasGeometry() const =0
virtual void getCumulativeNodeCountPerFace(uint64_t *nodeCountPerFace) const =0
virtual std::string getXmlTag() const final
Definition: UnstructuredGridRepresentation.h:626
virtual unsigned int getConstantNodeCountOfFaces() const =0
virtual bool isNodeCountOfFacesConstant() const =0
void setHexahedraOnlyGeometry(unsigned char *cellFaceIsRightHanded, double *points, uint64_t pointCount, uint64_t faceCount, eml2::AbstractHdfProxy *proxy, uint64_t *faceIndicesPerCell, uint64_t *nodeIndicesPerFace, resqml2::AbstractLocal3dCrs *localCrs=nullptr)
virtual void getNodeIndicesOfFaces(uint64_t *nodeIndices) const =0
virtual void getCellFaceIsRightHanded(unsigned char *cellFaceIsRightHanded) const =0
unsigned int getPatchCount() const final
Definition: UnstructuredGridRepresentation.h:621
void setHexahedraOnlyGeometryUsingExistingDatasets(const std::string &cellFaceIsRightHanded, const std::string &points, uint64_t pointCount, uint64_t faceCount, eml2::AbstractHdfProxy *proxy, const std::string &faceIndicesPerCell, const std::string &nodeIndicesPerFace, resqml2::AbstractLocal3dCrs *localCrs=nullptr)
virtual void setGeometryUsingExistingDatasets(const std::string &cellFaceIsRightHanded, const std::string &points, uint64_t pointCount, eml2::AbstractHdfProxy *proxy, const std::string &faceIndicesPerCell, const std::string &faceIndicesCumulativeCountPerCell, uint64_t faceCount, const std::string &nodeIndicesPerFace, const std::string &nodeIndicesCumulativeCountPerFace, gsoap_resqml2_0_1::resqml20__CellShape cellShape, resqml2::AbstractLocal3dCrs *localCrs=nullptr)=0
UnstructuredGridRepresentation()
Definition: UnstructuredGridRepresentation.h:44
void getFaceCountPerCell(uint64_t *faceCountPerCell) const
void getNodeCountPerFace(uint64_t *nodeCountPerFace) const
uint64_t const * getCumulativeFaceCountPerCell() const
virtual void getFaceIndicesOfCells(uint64_t *faceIndices) const =0
virtual void getCumulativeFaceCountPerCell(uint64_t *cumulativeFaceCountPerCell_) const =0
void setTetrahedraOnlyGeometryUsingExistingDatasets(const std::string &cellFaceIsRightHanded, const std::string &points, uint64_t pointCount, uint64_t faceCount, eml2::AbstractHdfProxy *proxy, const std::string &faceIndicesPerCell, const std::string &nodeIndicesPerFace, resqml2::AbstractLocal3dCrs *localCrs=nullptr)
Sets a geometry which is only defined by means of tetrahedra using some existing HDF5 dataset.
uint64_t getXyzPointCountOfPatch(unsigned int patchIndex) const final
virtual bool isFaceCountOfCellsConstant() const =0
virtual ~UnstructuredGridRepresentation()=default
unsigned int getNodeCountOfFaceOfCell(uint64_t cellIndex, unsigned int localFaceIndex) const
UnstructuredGridRepresentation(gsoap_resqml2_0_1::eml20__DataObjectReference *partialObject)
Definition: UnstructuredGridRepresentation.h:38
UnstructuredGridRepresentation(gsoap_eml2_3::_resqml22__UnstructuredGridRepresentation *fromGsoap)
Definition: UnstructuredGridRepresentation.h:64
static const char * XML_TAG
Definition: UnstructuredGridRepresentation.h:624
virtual unsigned int getConstantFaceCountOfCells() const =0
virtual uint64_t getFaceCount() const =0