Pointwise Plugin SDK
Functions
Unstructured Grid Export Functions
+ Collaboration diagram for Unstructured Grid Export Functions:

Functions

PWP_UINT32 PwBlkElementCount (PWGM_HBLOCK block, PWGM_ELEMCOUNTS *pCounts)
 Get the number of block elements. More...
 
PWGM_HELEMENT PwBlkEnumElements (PWGM_HBLOCK block, PWP_UINT32 ndx)
 Sequentially enumerate the block elements. More...
 
PWP_BOOL PwDomCondition (PWGM_HDOMAIN domain, PWGM_CONDDATA *pCondData)
 Get the domain condition data. More...
 
PWP_UINT32 PwDomElementCount (PWGM_HDOMAIN domain, PWGM_ELEMCOUNTS *pCounts)
 Get the number of domain elements. More...
 
PWGM_HELEMENT PwDomEnumElements (PWGM_HDOMAIN domain, PWP_UINT32 ndx)
 Sequentially enumerate the domain elements. More...
 
PWP_BOOL PwElemDataMod (PWGM_HELEMENT element, PWGM_ELEMDATA *pElemData)
 Get the element data relative to the model's index space. More...
 
PWP_BOOL PwElemDataModEnum (PWGM_HELEMENT element, PWGM_ENUMELEMDATA *pElemData)
 Get the enumerated element data relative to the model's index space. More...
 
const char * PwElemTypeToText (PWGM_ENUM_ELEMTYPE type)
 Maps a PWGM_ENUM_ELEMTYPE value to a human readable string. More...
 
const char * PwFaceOrderToText (PWGM_ENUM_FACEORDER faceOrder)
 Maps a PWGM_ENUM_FACEORDER value to a human readable string. More...
 
PWP_BOOL PwModAppendEnumElementOrder (PWGM_HGRIDMODEL model, PWGM_ENUM_ELEMORDER order)
 Append an element order to the enumElements() ordering sequence. More...
 
PWP_BOOL PwModCustomIndexSchemeReady (PWGM_HGRIDMODEL model, PWGM_INDEXMAPPERCB cb, void *cbData)
 Notifys the Pointwise export framework that the custom index map is ready. More...
 
PWP_VOID PwModDefaultEnumElementOrder (PWGM_HGRIDMODEL model)
 Reset the enumElements() ordering sequence to the default (none). More...
 
PWP_UINT32 PwModDomainCount (PWGM_HGRIDMODEL model)
 Get the number of domain elements in the model. More...
 
PWGM_HDOMAIN PwModEnumDomains (PWGM_HGRIDMODEL model, PWP_UINT32 ndx)
 Sequentially enumerate the model domain elements. More...
 
PWP_UINT32 PwModEnumElementCount (PWGM_HGRIDMODEL model, PWGM_ELEMCOUNTS *pCounts)
 Get the number of enumerated model block elements. More...
 
PWGM_HELEMENT PwModEnumElements (PWGM_HGRIDMODEL model, PWP_UINT32 ndx)
 Sequentially enumerate the model's block elements. More...
 
PWGM_HVERTEX PwModEnumVertices (PWGM_HGRIDMODEL model, PWP_UINT32 ndx)
 Sequentially enumerate the model vertex elements. More...
 
PWP_BOOL PwModStreamFaces (PWGM_HGRIDMODEL model, PWGM_ENUM_FACEORDER order, PWGM_BEGINSTREAMCB beginCB, PWGM_FACESTREAMCB faceCB, PWGM_ENDSTREAMCB endCB, void *userData)
 Stream the grid model's faces to a callback function in the specified order. More...
 
PWP_UINT32 PwModVertexCount (PWGM_HGRIDMODEL model)
 Get the number of model vertex elements. More...
 
PWP_BOOL PwVertDataMod (PWGM_HVERTEX vertex, PWGM_VERTDATA *pVertData)
 Get the vertex data relative to the model's index space. More...
 
PWP_BOOL PwVertIndexMod (PWGM_HVERTEX vertex, PWP_UINT32 *pIndex)
 Get the vertex index relative to the model's index space. More...
 
PWP_BOOL PwVertXyzVal (PWGM_HVERTEX vertex, PWGM_ENUM_XYZ which, PWGM_XYZVAL *pVal)
 Get a vertex's x, y, or z component value. More...
 

Detailed Description

These functions are ONLY used to access unstructured grid models.

Function Documentation

◆ PwBlkElementCount()

PWP_UINT32 PwBlkElementCount ( PWGM_HBLOCK  block,
PWGM_ELEMCOUNTS pCounts 
)

Get the number of block elements.

Parameters
blockA block handle.
pCountsPointer to a PWGM_ELEMCOUNTS buffer.
Returns
The total number of elements

Definition at line 311 of file apiGridModel.cxx.

References PWGM_HBLOCK_ISVALID.

◆ PwBlkEnumElements()

PWGM_HELEMENT PwBlkEnumElements ( PWGM_HBLOCK  block,
PWP_UINT32  ndx 
)

Sequentially enumerate the block elements.

Parameters
blockA block handle.
ndxThe element index starting at 0.
Returns
The element handle.
See also
PwBlkElementCount(), PwElemDataMod()
Sample usage:
PWGM_ELEMDATA ElemData;
PWP_UINT32 ndx = 0;
PWGM_HELEMENT hElem = PwBlkEnumElements(block, ndx);
while (PWGM_HELEMENT_ISVALID(hElem)) {
if (PwElemDataMod(hElem, &ElemData)) {
// ...etc...
}
hElem = PwBlkEnumElements(block, ++ndx);
}

Definition at line 319 of file apiGridModel.cxx.

References PWGM_HBLOCK_ISVALID.

◆ PwDomCondition()

PWP_BOOL PwDomCondition ( PWGM_HDOMAIN  domain,
PWGM_CONDDATA pCondData 
)

Get the domain condition data.

Parameters
domainA domain handle.
pCondDataPointer to a PWGM_CONDDATA buffer.
Returns
PWP_TRUE on success

Definition at line 343 of file apiGridModel.cxx.

References PWGM_HDOMAIN_ISVALID, and PWP_FALSE.

Referenced by CaeUnsPatch::condition().

◆ PwDomElementCount()

PWP_UINT32 PwDomElementCount ( PWGM_HDOMAIN  domain,
PWGM_ELEMCOUNTS pCounts 
)

Get the number of domain elements.

Parameters
domainA domain handle.
pCountsPointer to a PWGM_ELEMCOUNTS buffer.
Returns
The total number of elements

Definition at line 327 of file apiGridModel.cxx.

References PWGM_HDOMAIN_ISVALID.

◆ PwDomEnumElements()

PWGM_HELEMENT PwDomEnumElements ( PWGM_HDOMAIN  domain,
PWP_UINT32  ndx 
)

Sequentially enumerate the domain elements.

Parameters
domainA domain handle.
ndxThe element index starting at 0.
Returns
The element handle.
See also
PwDomElementCount()

Definition at line 335 of file apiGridModel.cxx.

References PWGM_HDOMAIN_ISVALID.

◆ PwElemDataMod()

PWP_BOOL PwElemDataMod ( PWGM_HELEMENT  element,
PWGM_ELEMDATA pElemData 
)

Get the element data relative to the model's index space.

Parameters
elementA element handle.
pElemDataPointer to a PWGM_ELEMDATA buffer.
Returns
PWP_TRUE on success

Definition at line 379 of file apiGridModel.cxx.

References PWGM_HELEMENT_ISVALID, and PWP_FALSE.

Referenced by CaeUnsElement::data().

◆ PwElemDataModEnum()

PWP_BOOL PwElemDataModEnum ( PWGM_HELEMENT  element,
PWGM_ENUMELEMDATA pElemData 
)

Get the enumerated element data relative to the model's index space.

Parameters
elementA model element handle obtained from PwModEnumElements().
pElemDataPointer to a PWGM_ENUMELEMDATA buffer.
Returns
PWP_TRUE on success

Definition at line 388 of file apiGridModel.cxx.

References PWGM_HELEMENT_ISVALID, and PWP_FALSE.

Referenced by CaeUnsElement::data().

◆ PwElemTypeToText()

const char* PwElemTypeToText ( PWGM_ENUM_ELEMTYPE  type)

Maps a PWGM_ENUM_ELEMTYPE value to a human readable string.

Parameters
typeA PWGM_ENUM_ELEMTYPE value.
Returns
A human readable string. If type is invalid, "!Invalid" is returned.

Definition at line 417 of file apiGridModel.cxx.

References PWGM_ELEMTYPE_BAR, PWGM_ELEMTYPE_HEX, PWGM_ELEMTYPE_POINT, PWGM_ELEMTYPE_PYRAMID, PWGM_ELEMTYPE_QUAD, PWGM_ELEMTYPE_TET, PWGM_ELEMTYPE_TRI, and PWGM_ELEMTYPE_WEDGE.

Referenced by CaeUnsGridModel::elemTypeStr().

◆ PwFaceOrderToText()

const char* PwFaceOrderToText ( PWGM_ENUM_FACEORDER  faceOrder)

Maps a PWGM_ENUM_FACEORDER value to a human readable string.

Parameters
faceOrderA PWGM_ENUM_FACEORDER value.
Returns
A human readable string. If faceOrder is invalid, "!Invalid" is returned.

Definition at line 396 of file apiGridModel.cxx.

References PWGM_FACEORDER_BCGROUPSFIRST, PWGM_FACEORDER_BCGROUPSLAST, PWGM_FACEORDER_BCGROUPSONLY, PWGM_FACEORDER_BCGROUPSONLY_BYVC, PWGM_FACEORDER_BOUNDARYFIRST, PWGM_FACEORDER_BOUNDARYONLY, PWGM_FACEORDER_DONTCARE, PWGM_FACEORDER_INTERIORFIRST, PWGM_FACEORDER_INTERIORONLY, and PWGM_FACEORDER_VCGROUPSBCLAST.

Referenced by CaeUnsGridModel::faceOrderStr().

◆ PwModAppendEnumElementOrder()

PWP_BOOL PwModAppendEnumElementOrder ( PWGM_HGRIDMODEL  model,
PWGM_ENUM_ELEMORDER  order 
)

Append an element order to the enumElements() ordering sequence.

Parameters
modelThe grid model handle.
orderThe first/next element order in the enumeration sequence.
Returns
PWP_TRUE on success. PWP_FALSE if a duplicate or invalid order is appended.
Note
If a sequence is defined, the elements returned by enumElements() will be consecutivly grouped in the specified order. By default, no ordering is used (elements are not consecutive by type).
You are not required to append all possible element types. Any "missing" types will be exported at the end of the enumeration in an unspecified order.
Due to processing overhead, element ordering should only be used if it is required by a given export format (or for debugging). The ordering should be set before any calls to the enumElements() or streamFaces() functions.
The ordering should be set before any calls to the enumElements() or streamFaces() functions. If the ordering is changed, data returned by calls to enumElements() or streamFaces() prior to the change will not be consistent with data returned after the change.
See also
PwModEnumElementCount(), PwModEnumElements(), PwModDefaultEnumElementOrder()
Sample usage:
// Since they are not explicitly appended, the PWGM_ELEMORDER_TET and
// PWGM_ELEMORDER_PYRAMID elements will enumerate last in an unspecified
// order.
PWGM_ELEMDATA ElemData;
PWGM_ENUMELEMDATA EnumElemData;
PWP_UINT32 ndx = 0;
PWGM_HELEMENT hElem = PwModEnumElements(model, ndx);
while (PWGM_HELEMENT_ISVALID(hElem)) {
// get basic element connectivity information
if (PwElemDataMod(hElem, &ElemData)) {
// ...etc...
}
// get detailed element ownership and connectivity information
if (PwElemDataModEnum(hElem, &EnumElemData)) {
// ...etc...
}
hElem = PwModEnumElements(model, ++ndx);
}
// reset the enumeration ordering to the default (none). This call is not
// really needed. Just here for example.

Definition at line 295 of file apiGridModel.cxx.

Referenced by CaeUnsGridModel::appendEnumElementOrder(), and PwModDefaultEnumElementOrder().

◆ PwModCustomIndexSchemeReady()

PWP_BOOL PwModCustomIndexSchemeReady ( PWGM_HGRIDMODEL  model,
PWGM_INDEXMAPPERCB  cb,
void *  cbData 
)

Notifys the Pointwise export framework that the custom index map is ready.

Parameters
modelThe grid model handle.

This is only needed if IndexScheme is set to Custom in runtimeCreate(). After the mesh data has been succesfully exported, but before returning from runtimeWrite(), the plugin must call PwModCustomIndexSchemeReady() to notify the Pointwise export framework that the custom index map is ready.

While in this call, the Pointwise export framework invokes the PWGM_INDEXMAPPERCB callback as needed to map vertex indices.

The vertax map is no longer needed by the Pointwise export framework after this call returns.

Returns
PWP_TRUE on success

Definition at line 260 of file apiGridModel.cxx.

References PWP_FALSE.

Referenced by CaeUnsGridModel::customIndexSchemeReady().

◆ PwModDefaultEnumElementOrder()

PWP_VOID PwModDefaultEnumElementOrder ( PWGM_HGRIDMODEL  model)

Reset the enumElements() ordering sequence to the default (none).

Parameters
modelThe grid model handle.
Returns
nothing.
See also
PwModEnumElementCount(), PwModEnumElements(), PwModAppendEnumElementOrder()
Sample usage:
See sample usage for PwModAppendEnumElementOrder()

Definition at line 303 of file apiGridModel.cxx.

References PwModAppendEnumElementOrder().

Referenced by CaeUnsGridModel::defaultEnumElementOrder().

◆ PwModDomainCount()

PWP_UINT32 PwModDomainCount ( PWGM_HGRIDMODEL  model)

Get the number of domain elements in the model.

Parameters
modelThe grid model handle.

Definition at line 228 of file apiGridModel.cxx.

Referenced by CaeUnsGridModel::patchCount().

◆ PwModEnumDomains()

PWGM_HDOMAIN PwModEnumDomains ( PWGM_HGRIDMODEL  model,
PWP_UINT32  ndx 
)

Sequentially enumerate the model domain elements.

Parameters
modelThe grid model handle.
ndxThe block index starting at 0.
See also
PwModDomainCount()
Sample usage:
PWP_UINT32 eTotCnt;
PWP_UINT32 ndx = 0;
PWGM_HDOMAIN hDom = PwModEnumDomains(model, ndx);
while (PWGM_HDOMAIN_ISVALID(hDom)) {
eTotCnt = PwDomElementCount(hDom, &eCounts);
// ...etc...
hDom = PwModEnumDomains(model, ++ndx);
}
Note
Domain elements are oriented to the interior of the block.
Connection elements are oriented to their source connection domain. This is done so that blocks with local coordinate indices have a 1:1 point match across block connections.
If a particular CAE plugin uses a different orientation model, the plugin will need to manipulate the data during export.
For 3D Grids
Elements are TRIS and QUADS. The element normals (right-hand rule) point to the block interior.
For 2D Grids
Elements are BARS. The block interior is to the "left" while walking the block's "up" side. Up is defined by the block's local normal (right-hand rule).
elem-orient.png
2D Element Orientation

Definition at line 236 of file apiGridModel.cxx.

Referenced by CaeUnsPatch::moveTo().

◆ PwModEnumElementCount()

PWP_UINT32 PwModEnumElementCount ( PWGM_HGRIDMODEL  model,
PWGM_ELEMCOUNTS pCounts 
)

Get the number of enumerated model block elements.

Parameters
modelThe grid model handle.
pCountsPointer to a PWGM_ELEMCOUNTS buffer.
Returns
The total number of elements

Definition at line 279 of file apiGridModel.cxx.

◆ PwModEnumElements()

PWGM_HELEMENT PwModEnumElements ( PWGM_HGRIDMODEL  model,
PWP_UINT32  ndx 
)

Sequentially enumerate the model's block elements.

Parameters
modelThe grid model handle.
ndxThe enumerated model element index starting at 0.
Returns
The model element handle.
See also
PwModEnumElementCount(), PwElemDataMod(), PwElemDataModEnum()
Sample usage:
See sample usage for PwModAppendEnumElementOrder()

Definition at line 287 of file apiGridModel.cxx.

◆ PwModEnumVertices()

PWGM_HVERTEX PwModEnumVertices ( PWGM_HGRIDMODEL  model,
PWP_UINT32  ndx 
)

Sequentially enumerate the model vertex elements.

Parameters
modelThe grid model handle.
ndxThe vertex index starting at 0.
See also
PwModVertexCount(), PwVertDataMod(), PwVertIndexMod()
Sample usage:
PWGM_VERTDATA VertData;
PWP_UINT32 ndx = 0;
PWGM_HVERTEX hVert = PwModEnumVertices(model, ndx);
while (PWGM_HVERTEX_ISVALID(hVert)) {
if (PwVertDataMod(hVert, &VertData)) {
// ...etc...
}
hVert = PwModEnumVertices(model, ++ndx);
}

Definition at line 244 of file apiGridModel.cxx.

Referenced by CaeUnsVertex::moveTo().

◆ PwModStreamFaces()

PWP_BOOL PwModStreamFaces ( PWGM_HGRIDMODEL  model,
PWGM_ENUM_FACEORDER  order,
PWGM_BEGINSTREAMCB  beginCB,
PWGM_FACESTREAMCB  faceCB,
PWGM_ENDSTREAMCB  endCB,
void *  userData 
)

Stream the grid model's faces to a callback function in the specified order.

Parameters
modelThe grid model handle.
orderThe face streaming order.
beginCBThis callback is invoked by stream once before any cell faces are streamed. This callback should return a non-zero value to continue processing.
faceCBThis callback is invoked by stream once for every cell face in the grid model. This callback should return a non-zero value to continue processing.
endCBThis callback is invoked by stream once after all cell faces are streamed. This callback should return a non-zero value to indicate success.
userDataThis optional ptr is passed to the callback functions through the userData member of the PWGM_BEGINSTREAM_DATA, PWGM_FACESTREAM_DATA, and PWGM_ENDSTREAM_DATA structures. Typically, userData points to export state information such as pRti. userData can be set to NULL.
Returns
PWP_TRUE on success
Sample usage:
{
CAEP_RTITEM *pRti = (CAEP_RTITEM*)data->userData; // recover pointer
// prepare to receive the face stream
return PWP_TRUE;
}
{
CAEP_RTITEM *pRti = (CAEP_RTITEM*)data->userData; // recover pointer
// handle the face information
return PWP_TRUE;
}
{
CAEP_RTITEM *pRti = (CAEP_RTITEM*)data->userData; // recover pointer
// cleanup after streaming
return PWP_TRUE;
}
const CAEP_WRITEINFO *pWriteInfo)
{
// Faces will be streamed to faceCB in an unspecified order
// Passing pRti as the userData pointer
PwModStreamFaces(model, faceOrder, beginCB, faceCB, endCB, pRti);
}

Definition at line 268 of file apiGridModel.cxx.

References beginCB(), endCB(), faceCB(), and PWP_FALSE.

Referenced by CaeUnsGridModel::streamFaces().

◆ PwModVertexCount()

PWP_UINT32 PwModVertexCount ( PWGM_HGRIDMODEL  model)

Get the number of model vertex elements.

Parameters
modelThe grid model handle.
Returns
The total number of vertex elements.

Definition at line 252 of file apiGridModel.cxx.

Referenced by CaeUnsGridModel::vertexCount().

◆ PwVertDataMod()

PWP_BOOL PwVertDataMod ( PWGM_HVERTEX  vertex,
PWGM_VERTDATA pVertData 
)

Get the vertex data relative to the model's index space.

Parameters
vertexA vertex handle.
pVertDataPointer to a PWGM_VERTDATA buffer.
Returns
PWP_TRUE on success
See also
PwModEnumVertices()

Definition at line 352 of file apiGridModel.cxx.

References PWGM_HVERTEX_ISVALID, and PWP_FALSE.

Referenced by CaeUnsVertex::dataMod().

◆ PwVertIndexMod()

PWP_BOOL PwVertIndexMod ( PWGM_HVERTEX  vertex,
PWP_UINT32 pIndex 
)

Get the vertex index relative to the model's index space.

Parameters
vertexA vertex handle.
pIndexPointer to a PWP_UINT32 value.
Returns
PWP_TRUE on success
See also
PwModEnumVertices()

Definition at line 361 of file apiGridModel.cxx.

References PWGM_HVERTEX_ISVALID, and PWP_FALSE.

Referenced by CaeUnsVertex::indexMod().

◆ PwVertXyzVal()

PWP_BOOL PwVertXyzVal ( PWGM_HVERTEX  vertex,
PWGM_ENUM_XYZ  which,
PWGM_XYZVAL pVal 
)

Get a vertex's x, y, or z component value.

Parameters
vertexA vertex handle.
whichThe XYZ component id to retrieve.
pValPointer to a PWGM_XYZVAL value.
Returns
PWP_TRUE on success
See also
PwModEnumVertices()

Definition at line 370 of file apiGridModel.cxx.

References PWGM_HVERTEX_ISVALID, and PWP_FALSE.

Referenced by CaeUnsVertex::xyzVal().