Pointwise Plugin SDK
CaeUnsGridModel.h
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * CaeUnsGridModel class
4  *
5  * (C) 2021 Cadence Design Systems, Inc. All rights reserved worldwide.
6  *
7  ***************************************************************************/
8 
9 #if !defined(PWGM_HIDE_UNSTRUCTURED_API)
10 
11 #ifndef _CAEUNSGRIDMODEL_H_
12 #define _CAEUNSGRIDMODEL_H_
13 
14 
15 #include "apiGridModel.h"
16 #include "apiPWP.h"
17 
18 #include "CaeGridModel.h"
19 #include "CaeUnsElementGroup.h"
20 
21 
73 public:
74 
77  {
78  }
79 
81 
94  {
95  (void)data.userData;
96  return 1;
97  }
98 
100 
111  virtual PWP_UINT32 streamFace(const PWGM_FACESTREAM_DATA &data) = 0;
112 
114 
127  {
128  (void)data.userData;
129  return 1;
130  }
131 };
132 
133 
148 public:
151  {
152  }
153 
155 
164  virtual PWP_UINT64 mapIndex(const PWP_UINT64 pwgmNdx) = 0;
165 };
166 
167 
177 public:
178 
180 
185 
187 
191  CaeUnsGridModel(const CaeUnsGridModel &src);
192 
194  virtual ~CaeUnsGridModel();
195 
197 
201  PWP_UINT32 patchCount() const;
202 
204 
207  PWP_UINT32 vertexCount() const;
208 
210 
217  bool streamFaces(PWGM_ENUM_FACEORDER order,
218  CaeFaceStreamHandler &handler) const;
219 
221 
228 
230 
236 
238 
242 
244 
250  PWP_UINT32 patchElementCount(PWGM_ELEMCOUNTS* pDetails = nullptr) const;
251 
254 
256  static const char * faceOrderStr(PWGM_ENUM_FACEORDER order)
257  {
258  return PwFaceOrderToText(order);
259  }
260 
262  static const char * elemTypeStr(PWGM_ENUM_ELEMTYPE type)
263  {
264  return PwElemTypeToText(type);
265  }
266 
267 protected:
268 
270  PWP_UINT32
271  elementCountImpl(PWGM_ELEMCOUNTS *pDetails = nullptr) const override
272  {
273  return PwModEnumElementCount(model_, pDetails);
274  }
275 
277  enumElementsImpl(PWP_UINT32 ndx) const override
278  {
279  return PwModEnumElements(model_, ndx);
280  }
282 };
283 
285 bool operator==(const PWGM_HELEMENT &h1, const PWGM_HELEMENT &h2);
286 bool operator!=(const PWGM_HELEMENT &h1, const PWGM_HELEMENT &h2);
287 bool operator<(const PWGM_HELEMENT &h1, const PWGM_HELEMENT &h2);
288 bool operator>(const PWGM_HELEMENT &h1, const PWGM_HELEMENT &h2);
289 
290 
291 bool operator==(const PWGM_HVERTEX &h1, const PWGM_HVERTEX &h2);
292 bool operator!=(const PWGM_HVERTEX &h1, const PWGM_HVERTEX &h2);
293 bool operator<(const PWGM_HVERTEX &h1, const PWGM_HVERTEX &h2);
294 bool operator>(const PWGM_HVERTEX &h1, const PWGM_HVERTEX &h2);
296 
297 // Must include here because these depend on CaeUnsGridModel
298 #include "CaeUnsBlock.h"
299 #include "CaeUnsElement.h"
300 #include "CaeUnsPatch.h"
301 #include "CaeUnsVertex.h"
302 
303 #endif // _CAEUNSGRIDMODEL_H_
304 
305 #endif // PWGM_HIDE_UNSTRUCTURED_API
CaeGridModel.h
PWGM_ENDSTREAM_DATA::userData
void * userData
The PwModStreamFaces user data ptr.
Definition: apiGridModel.h:1173
operator>
bool operator>(const PWGM_HBLOCK &h1, const PWGM_HBLOCK &h2)
Definition: CaeGridModel.cxx:158
PWGM_HELEMENT
Grid element handle declaration.
Definition: apiGridModel.h:427
CaeUnsCustomIndexHandler::~CaeUnsCustomIndexHandler
virtual ~CaeUnsCustomIndexHandler()
Destructor.
Definition: CaeUnsGridModel.h:150
CaeFaceStreamHandler::streamBegin
virtual PWP_UINT32 streamBegin(const PWGM_BEGINSTREAM_DATA &data)
Virtual begin stream implementation.
Definition: CaeUnsGridModel.h:93
PWGM_BEGINSTREAM_DATA::userData
void * userData
The PwModStreamFaces user data ptr.
Definition: apiGridModel.h:1091
PwFaceOrderToText
const char * PwFaceOrderToText(PWGM_ENUM_FACEORDER faceOrder)
Maps a PWGM_ENUM_FACEORDER value to a human readable string.
Definition: apiGridModel.cxx:424
PWP_UINT32
unsigned int PWP_UINT32
32-bit unsigned integer
Definition: apiPWP.h:210
CaeUnsElementGroup.h
CaeUnsGridModel
The unstructured grid model class.
Definition: CaeUnsGridModel.h:176
PwModEnumElementCount
PWP_UINT32 PwModEnumElementCount(PWGM_HGRIDMODEL model, PWGM_ELEMCOUNTS *pCounts)
Get the number of enumerated model block elements.
Definition: apiGridModel.cxx:277
operator<
bool operator<(const PWGM_HBLOCK &h1, const PWGM_HBLOCK &h2)
Definition: CaeGridModel.cxx:140
PWGM_HGRIDMODEL
An opaque handle to a grid model.
Definition: apiGridModel.h:326
PWP_VOID
void PWP_VOID
no value
Definition: apiPWP.h:317
CaeGridModel
The grid model base class.
Definition: CaeGridModel.h:46
CaeFaceStreamHandler::streamEnd
virtual PWP_UINT32 streamEnd(const PWGM_ENDSTREAM_DATA &data)
Virtual end stream implementation.
Definition: CaeUnsGridModel.h:126
apiGridModel.h
Pointwise Grid Model API Specification (PWGM-API)
PWGM_ENUM_ELEMORDER
PWGM_ENUM_ELEMORDER
Types of element orderings.
Definition: apiGridModel.h:699
CaeFaceStreamHandler::~CaeFaceStreamHandler
virtual ~CaeFaceStreamHandler()
Destructor.
Definition: CaeUnsGridModel.h:76
CaeUnsElementGroup
The unstructured element group class.
Definition: CaeUnsElementGroup.h:44
CaeUnsGridModel::faceOrderStr
static const char * faceOrderStr(PWGM_ENUM_FACEORDER order)
Maps a face order id to a string value.
Definition: CaeUnsGridModel.h:256
operator==
bool operator==(const PWGM_HBLOCK &h1, const PWGM_HBLOCK &h2)
Definition: CaeGridModel.cxx:124
CaeUnsVertex.h
CaeUnsGridModel::elemTypeStr
static const char * elemTypeStr(PWGM_ENUM_ELEMTYPE type)
Maps an element type id to a string value.
Definition: CaeUnsGridModel.h:262
PWGM_ENUM_ELEMTYPE
PWGM_ENUM_ELEMTYPE
Element type ids.
Definition: apiGridModel.h:672
CaeUnsGridModel::~CaeUnsGridModel
virtual ~CaeUnsGridModel()
Destructor.
Definition: CaeUnsGridModel.cxx:34
CaeUnsElementGroup::enumElementsImpl
virtual PWGM_HELEMENT enumElementsImpl(PWP_UINT32 ndx) const =0
Get an element in the group.
CaeUnsBlock.h
PWGM_ELEMCOUNTS
Element count information.
Definition: apiGridModel.h:774
PWGM_BEGINSTREAM_DATA
Data passed to a PWGM_BEGINSTREAMCB callback function.
Definition: apiGridModel.h:1084
CaeUnsGridModel::patchElementCount
PWP_UINT32 patchElementCount(PWGM_ELEMCOUNTS *pDetails=nullptr) const
Get the number of patch elements in the model.
Definition: CaeUnsGridModel.cxx:118
PwModEnumElements
PWGM_HELEMENT PwModEnumElements(PWGM_HGRIDMODEL model, PWP_UINT32 ndx)
Sequentially enumerate the model's block elements.
Definition: apiGridModel.cxx:285
CaeUnsGridModel::customIndexSchemeReady
bool customIndexSchemeReady(CaeUnsCustomIndexHandler &handler) const
Notify export framework that custom index mapper is ready for use.
Definition: CaeUnsGridModel.cxx:96
CaeUnsGridModel::streamFaces
bool streamFaces(PWGM_ENUM_FACEORDER order, CaeFaceStreamHandler &handler) const
Initiate ordered face streaming to the given handler.
Definition: CaeUnsGridModel.cxx:79
CaeUnsCustomIndexHandler
The unstructured grid model index mapper handler class.
Definition: CaeUnsGridModel.h:147
CaeUnsGridModel::operator=
CaeUnsGridModel & operator=(const CaeUnsGridModel &rhs)
Assignment operator.
Definition: CaeUnsGridModel.cxx:145
PWGM_ENDSTREAM_DATA
Data passed to a PWGM_ENDSTREAMCB callback function.
Definition: apiGridModel.h:1170
PWGM_FACESTREAM_DATA
Data passed to a PWGM_FACESTREAMCB callback function.
Definition: apiGridModel.h:1133
CaeUnsCustomIndexHandler::mapIndex
virtual PWP_UINT64 mapIndex(const PWP_UINT64 pwgmNdx)=0
Pure virtual index mapping method.
CaeFaceStreamHandler
The unstructured grid model face stream handler class.
Definition: CaeUnsGridModel.h:72
PWGM_HVERTEX
An opaque handle to a grid vertex element.
Definition: apiGridModel.h:398
CaeUnsGridModel::patchCount
PWP_UINT32 patchCount() const
Get the number of boundary patches in the model.
Definition: CaeUnsGridModel.cxx:40
apiPWP.h
Pointwise Plugin API (PWP-API)
CaeUnsElement.h
CaeUnsElementGroup::elementCountImpl
virtual PWP_UINT32 elementCountImpl(PWGM_ELEMCOUNTS *pDetails) const =0
Get the number of elements in the group.
CaeUnsGridModel::vertexCount
PWP_UINT32 vertexCount() const
Get the number of unstructured vertices in the model.
Definition: CaeUnsGridModel.cxx:47
PWP_UINT64
unsigned long long PWP_UINT64
64-bit unsigned integer
Definition: apiPWP.h:243
CaeUnsPatch.h
PWGM_ENUM_FACEORDER
PWGM_ENUM_FACEORDER
The orderings supported by face streaming.
Definition: apiGridModel.h:1059
CaeFaceStreamHandler::streamFace
virtual PWP_UINT32 streamFace(const PWGM_FACESTREAM_DATA &data)=0
Pure virtual face stream handler method.
operator!=
bool operator!=(const PWGM_HBLOCK &h1, const PWGM_HBLOCK &h2)
Definition: CaeGridModel.cxx:134
CaeUnsGridModel::defaultEnumElementOrder
PWP_VOID defaultEnumElementOrder() const
Reset to the default element type order.
Definition: CaeUnsGridModel.cxx:111
CaeGridModel::model_
PWGM_HGRIDMODEL model_
The bound PWGM_HGRIDMODEL.
Definition: CaeGridModel.h:145
PwElemTypeToText
const char * PwElemTypeToText(PWGM_ENUM_ELEMTYPE type)
Maps a PWGM_ENUM_ELEMTYPE value to a human readable string.
Definition: apiGridModel.cxx:445
CaeUnsGridModel::appendEnumElementOrder
bool appendEnumElementOrder(PWGM_ENUM_ELEMORDER order) const
Append an element type to the current face streaming order.
Definition: CaeUnsGridModel.cxx:104
CaeUnsGridModel::CaeUnsGridModel
CaeUnsGridModel(PWGM_HGRIDMODEL model)
Constructor.
Definition: CaeUnsGridModel.cxx:22