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

Functions

PWP_BOOL PwAsmFinalize (PWGM_HBLOCKASSEMBLER h)
 Stitches together all the faces added to the assembler into cells and blocks. More...
 
PWGM_HVERTEXLIST PwAsmGetVertexList (PWGM_HBLOCKASSEMBLER h)
 Get the vertex list associated with an unstructured block assembler. More...
 
PWP_BOOL PwAsmPushElementFace (PWGM_HBLOCKASSEMBLER h, const PWGM_ASSEMBLER_DATA *face)
 Adds a face to an unstructured block face assembler. More...
 
PWGM_HVERTEXLIST PwModCreateUnsVertexList (PWGM_HGRIDMODEL model, const PWP_ENUM_DIMENSION blkElemDimty)
 Creates an empty, unstructured vertex list in a model. More...
 
PWGM_HVERTEXLIST PwModCreateUnsVertexList2 (PWGM_HGRIDMODEL model)
 Creates an empty, unstructured vertex list in a model for 2-D blocks and 1-D domains. More...
 
PWGM_HVERTEXLIST PwModCreateUnsVertexList3 (PWGM_HGRIDMODEL model)
 Creates an empty, unstructured vertex list in a model for 3-D blocks and 2-D domains. More...
 
PWP_BOOL PwUnsBlkAllocateElementCounts (PWGM_HBLOCK h, const PWGM_ELEMCOUNTS &counts)
 Allocates element storage in an unstructured block. More...
 
PWP_BOOL PwUnsBlkAllocateElements (PWGM_HBLOCK h, const PWGM_ENUM_ELEMTYPE cellType, const PWP_UINT count)
 Allocates element storage in an unstructured block. More...
 
PWP_BOOL PwUnsBlkSetElement (PWGM_HBLOCK h, const PWP_UINT ndx, const PWGM_ELEMDATA *eData)
 Sets the connectivity for an unstructured block element. More...
 
PWP_BOOL PwUnsDomAllocateElementCounts (PWGM_HDOMAIN h, const PWGM_ELEMCOUNTS &counts)
 Allocates element storage in an unstructured domain. More...
 
PWP_BOOL PwUnsDomAllocateElements (PWGM_HDOMAIN h, const PWGM_ENUM_ELEMTYPE cellType, const PWP_UINT count)
 Allocates element storage in an unstructured domain. More...
 
PWP_BOOL PwUnsDomSetElement (PWGM_HDOMAIN h, const PWP_UINT ndx, const PWGM_ELEMDATA *eData)
 Sets the connectivity for an unstructured domain element. More...
 
PWP_BOOL PwVlstAllocate (PWGM_HVERTEXLIST h, const PWP_UINT count)
 Allocates storage in an unstructured vertex list. More...
 
PWGM_HBLOCKASSEMBLER PwVlstCreateBlockAssembler (PWGM_HVERTEXLIST h)
 Creates an unstructured block face assembler that uses vertices from an unstructured vertex list. More...
 
PWGM_HBLOCK PwVlstCreateUnsBlock (PWGM_HVERTEXLIST h)
 Creates an unstructured block that uses vertices from an unstructured vertex list. More...
 
PWGM_HDOMAIN PwVlstCreateUnsDomain (PWGM_HVERTEXLIST h)
 Creates an unstructured domain that uses vertices from an unstructured vertex list. More...
 
PWGM_HDOMAIN PwVlstCreateUnsBoundary (PWGM_HVERTEXLIST h)
 

Detailed Description

These functions are used to import unstructured grids.

See also

Function Documentation

◆ PwAsmFinalize()

PWP_BOOL PwAsmFinalize ( PWGM_HBLOCKASSEMBLER  h)

Stitches together all the faces added to the assembler into cells and blocks.

To be successful, all the faces of a cell (owned or neighbor) must form a closed, manifold, watertight region.

Parameters
hA block assmebler handle obtained from PwVlstCreateBlockAssembler().
Returns
PWP_TRUE on success.
Sample usage:
See PwVlstCreateBlockAssembler() for an example.

Definition at line 1370 of file apiGridModel.cxx.

References PWP_FALSE.

◆ PwAsmGetVertexList()

PWGM_HVERTEXLIST PwAsmGetVertexList ( PWGM_HBLOCKASSEMBLER  h)

Get the vertex list associated with an unstructured block assembler.

Parameters
hA block assmebler handle obtained from PwVlstCreateBlockAssembler().
Returns
A vertex list handle.
See also
PwBlkGetVertexList(), PwDomGetVertexList(), PwConGetVertexList()
Sample usage:
See PwVlstCreateBlockAssembler() for an example.

Definition at line 1378 of file apiGridModel.cxx.

◆ PwAsmPushElementFace()

PWP_BOOL PwAsmPushElementFace ( PWGM_HBLOCKASSEMBLER  h,
const PWGM_ASSEMBLER_DATA face 
)

Adds a face to an unstructured block face assembler.

Parameters
hA block assmebler handle obtained from PwVlstCreateBlockAssembler().
facePointer to an PWGM_ASSEMBLER_DATA.
Returns
PWP_TRUE on success.
Sample usage:
See PwVlstCreateBlockAssembler() for an example.

Definition at line 1361 of file apiGridModel.cxx.

References PWP_FALSE.

◆ PwModCreateUnsVertexList()

PWGM_HVERTEXLIST PwModCreateUnsVertexList ( PWGM_HGRIDMODEL  model,
const PWP_ENUM_DIMENSION  blkElemDimty 
)

Creates an empty, unstructured vertex list in a model.

Parameters
modelThe grid model handle.
blkElemDimtyThe dimensionality of the block entity elements that will be created with this vertex list.

If PWP_DIMENSION_3D, blocks will contain 3-D elements (tet, pyramid, etc) and domains will contain 2-D elements (tri, quad).

If PWP_DIMENSION_2D, blocks will contain 2-D elements (tri, quad) and domains will contain 1-D bar elements.

Returns
A vertex list handle.
See also
PwModCreateUnsVertexList3(), PwModCreateUnsVertexList2()
Sample usage:

This snippet is from the GrdpTEST sample plugin included with the Plugin SDK.

static bool
doCreateUnsVertList3(const GRDP_RTITEM &rti, PWGM_HVERTEXLIST &hVL,
PWGM_XYZVAL dx = 0, PWGM_XYZVAL dy = 0, PWGM_XYZVAL dz = 0)
{
// Create an empty vertex list for a 3-D grid.
// Could also use PwModCreateUnsVertexList3(rti.model)
// Allocate memory for 13 vertices and set each vertex XYZ value
return PwVlstAllocate(hVL, 13) &&
PwVlstSetXYZ(hVL, 0, 0.0 + dx, 0.0 + dy, 0.0 + dz) &&
PwVlstSetXYZ(hVL, 1, 1.0 + dx, 0.0 + dy, 0.0 + dz) &&
PwVlstSetXYZ(hVL, 2, 1.0 + dx, 1.0 + dy, 0.0 + dz) &&
PwVlstSetXYZ(hVL, 3, 0.0 + dx, 1.0 + dy, 0.0 + dz) &&
PwVlstSetXYZ(hVL, 4, 0.0 + dx, 0.0 + dy, 1.0 + dz) &&
PwVlstSetXYZ(hVL, 5, 1.0 + dx, 0.0 + dy, 1.0 + dz) &&
PwVlstSetXYZ(hVL, 6, 1.0 + dx, 1.0 + dy, 1.0 + dz) &&
PwVlstSetXYZ(hVL, 7, 0.0 + dx, 1.0 + dy, 1.0 + dz) &&
PwVlstSetXYZ(hVL, 8, 1.0 + dx, 2.0 + dy, 1.0 + dz) &&
PwVlstSetXYZ(hVL, 9, 0.0 + dx, 2.0 + dy, 1.0 + dz) &&
PwVlstSetXYZ(hVL, 10, 0.5 + dx, 0.5 + dy, 2.0 + dz) &&
PwVlstSetXYZ(hVL, 11, 0.5 + dx, 1.5 + dy, 2.0 + dz) &&
PwVlstSetXYZ(hVL, 12, 0.5 + dx, 2.0 + dy, 2.0 + dz);
}

Definition at line 1223 of file apiGridModel.cxx.

Referenced by PwModCreateUnsVertexList2(), and PwModCreateUnsVertexList3().

◆ PwModCreateUnsVertexList2()

PWGM_HVERTEXLIST PwModCreateUnsVertexList2 ( PWGM_HGRIDMODEL  model)

Creates an empty, unstructured vertex list in a model for 2-D blocks and 1-D domains.

Parameters
modelThe grid model handle.
Returns
A vertex list handle.
See also
PwModCreateUnsVertexList(), PwModCreateUnsVertexList3()
Sample usage:

This snippet is from the GrdpTEST sample plugin included with the Plugin SDK.

static bool
doCreateUnsVertList2(const GRDP_RTITEM &rti, PWGM_HVERTEXLIST &hVL,
PWGM_XYZVAL dx = 0, PWGM_XYZVAL dy = 0, PWGM_XYZVAL dz = 0)
{
// Create an empty vertex list for a 2-D grid.
// Could also use PwModCreateUnsVertexList2(rti.model)
// Allocate memory for 13 vertices and set each vertex XYZ value
PWP_UINT n = 0;
return PwVlstAllocate(hVL, 13) &&
PwVlstSetXYZ(hVL, n++, 0.0 + dx, 0.0 + dy, 0.0 + dz) &&
PwVlstSetXYZ(hVL, n++, 1.0 + dx, 0.0 + dy, 0.0 + dz) &&
PwVlstSetXYZ(hVL, n++, 2.0 + dx, 0.0 + dy, 0.0 + dz) &&
PwVlstSetXYZ(hVL, n++, 0.0 + dx, 1.0 + dy, 0.0 + dz) &&
PwVlstSetXYZ(hVL, n++, 1.0 + dx, 1.0 + dy, 0.0 + dz) &&
PwVlstSetXYZ(hVL, n++, 2.0 + dx, 1.0 + dy, 0.0 + dz) &&
PwVlstSetXYZ(hVL, n++, 0.0 + dx, 2.0 + dy, 0.0 + dz) &&
PwVlstSetXYZ(hVL, n++, 1.0 + dx, 2.0 + dy, 0.0 + dz) &&
PwVlstSetXYZ(hVL, n++, 2.0 + dx, 2.0 + dy, 0.0 + dz);
}

Definition at line 1240 of file apiGridModel.cxx.

References PwModCreateUnsVertexList(), and PWP_DIMENSION_2D.

◆ PwModCreateUnsVertexList3()

PWGM_HVERTEXLIST PwModCreateUnsVertexList3 ( PWGM_HGRIDMODEL  model)

Creates an empty, unstructured vertex list in a model for 3-D blocks and 2-D domains.

Parameters
modelThe grid model handle.
Returns
A vertex list handle.
See also
PwModCreateUnsVertexList(), PwModCreateUnsVertexList2()
Sample usage:

This snippet is from the GrdpTEST sample plugin included with the Plugin SDK.

static bool
doCreateUnsVertList3(const GRDP_RTITEM &rti, PWGM_HVERTEXLIST &hVL,
PWGM_XYZVAL dx = 0, PWGM_XYZVAL dy = 0, PWGM_XYZVAL dz = 0)
{
// Create an empty vertex list for a 3-D grid.
// Could also use PwModCreateUnsVertexList3(rti.model)
// Allocate memory for 13 vertices and set each vertex XYZ value
return PwVlstAllocate(hVL, 13) &&
PwVlstSetXYZ(hVL, 0, 0.0 + dx, 0.0 + dy, 0.0 + dz) &&
PwVlstSetXYZ(hVL, 1, 1.0 + dx, 0.0 + dy, 0.0 + dz) &&
PwVlstSetXYZ(hVL, 2, 1.0 + dx, 1.0 + dy, 0.0 + dz) &&
PwVlstSetXYZ(hVL, 3, 0.0 + dx, 1.0 + dy, 0.0 + dz) &&
PwVlstSetXYZ(hVL, 4, 0.0 + dx, 0.0 + dy, 1.0 + dz) &&
PwVlstSetXYZ(hVL, 5, 1.0 + dx, 0.0 + dy, 1.0 + dz) &&
PwVlstSetXYZ(hVL, 6, 1.0 + dx, 1.0 + dy, 1.0 + dz) &&
PwVlstSetXYZ(hVL, 7, 0.0 + dx, 1.0 + dy, 1.0 + dz) &&
PwVlstSetXYZ(hVL, 8, 1.0 + dx, 2.0 + dy, 1.0 + dz) &&
PwVlstSetXYZ(hVL, 9, 0.0 + dx, 2.0 + dy, 1.0 + dz) &&
PwVlstSetXYZ(hVL, 10, 0.5 + dx, 0.5 + dy, 2.0 + dz) &&
PwVlstSetXYZ(hVL, 11, 0.5 + dx, 1.5 + dy, 2.0 + dz) &&
PwVlstSetXYZ(hVL, 12, 0.5 + dx, 2.0 + dy, 2.0 + dz);
}

Definition at line 1233 of file apiGridModel.cxx.

References PwModCreateUnsVertexList(), and PWP_DIMENSION_3D.

◆ PwUnsBlkAllocateElementCounts()

PWP_BOOL PwUnsBlkAllocateElementCounts ( PWGM_HBLOCK  h,
const PWGM_ELEMCOUNTS counts 
)

Allocates element storage in an unstructured block.

Parameters
hAn unstructured block handle obtained from PwVlstCreateUnsBlock().
countsThe number of elements to allocate for each type. Only the PWGM_ELEMTYPE_HEX, PWGM_ELEMTYPE_TET, PWGM_ELEMTYPE_WEDGE, and PWGM_ELEMTYPE_PYRAMID entries are used. All others are ignored.
Returns
PWP_TRUE on success.
Note
Allocating elements is NOT required. However, it is a best practice to do so if these counts are easily obtained.
See also
PwUnsBlkAllocateElements(), PwUnsBlkSetElement()
Sample usage:
See PwVlstCreateUnsBlock() for an example.

Definition at line 1273 of file apiGridModel.cxx.

References PwBlkGetVertexList(), PWGM_ECNT_Hex, PWGM_ECNT_Pyramid, PWGM_ECNT_Quad, PWGM_ECNT_Tet, PWGM_ECNT_Tri, PWGM_ECNT_Wedge, PWGM_ELEMTYPE_HEX, PWGM_ELEMTYPE_PYRAMID, PWGM_ELEMTYPE_QUAD, PWGM_ELEMTYPE_TET, PWGM_ELEMTYPE_TRI, PWGM_ELEMTYPE_WEDGE, PWP_DIMENSION_3D, PwUnsBlkAllocateElements(), and PwVlstGetBlkElemDimensionality().

◆ PwUnsBlkAllocateElements()

PWP_BOOL PwUnsBlkAllocateElements ( PWGM_HBLOCK  h,
const PWGM_ENUM_ELEMTYPE  cellType,
const PWP_UINT  count 
)

Allocates element storage in an unstructured block.

Parameters
hAn unstructured block handle obtained from PwVlstCreateUnsBlock().
cellTypeThe cell type for which storage is being allocated. One of PWGM_ELEMTYPE_HEX, PWGM_ELEMTYPE_TET, PWGM_ELEMTYPE_WEDGE, or PWGM_ELEMTYPE_PYRAMID.
countThe number of elements to allocate.
Returns
PWP_TRUE on success.
Note
Allocating elements is NOT required. However, it is a best practice to do so if these counts are easily obtained.
See also
PwUnsBlkAllocateElementCounts(), PwUnsBlkSetElement()
Sample usage:
See PwVlstCreateUnsBlock() for an example.

Definition at line 1263 of file apiGridModel.cxx.

References PWP_FALSE.

Referenced by PwUnsBlkAllocateElementCounts().

◆ PwUnsBlkSetElement()

PWP_BOOL PwUnsBlkSetElement ( PWGM_HBLOCK  h,
const PWP_UINT  ndx,
const PWGM_ELEMDATA eData 
)

Sets the connectivity for an unstructured block element.

Parameters
hAn unstructured block handle obtained from PwVlstCreateUnsBlock().
ndxThe block element index.
eDataThe block element connectivity. Only the eData.type, eData.vertCnt, and eData.index data members are used. The eData.vert data member is ignored.
Returns
PWP_TRUE on success.
See also
PwUnsBlkAllocateElements(), PwUnsBlkAllocateElementCounts()
Sample usage:
See PwVlstCreateUnsBlock() for an example.

Definition at line 1296 of file apiGridModel.cxx.

References PWP_FALSE.

◆ PwUnsDomAllocateElementCounts()

PWP_BOOL PwUnsDomAllocateElementCounts ( PWGM_HDOMAIN  h,
const PWGM_ELEMCOUNTS counts 
)

Allocates element storage in an unstructured domain.

Parameters
hAn unstructured domain handle obtained from PwVlstCreateUnsDomain() or PwVlstCreateUnsBoundary().
countsThe number of elements to allocate for each type. Only the PWGM_ELEMTYPE_TRI and PWGM_ELEMTYPE_QUAD entries are used. All others are ignored.
Returns
PWP_TRUE on success.
Note
Allocating elements is NOT required. However, it is a best practice to do so if these counts are easily obtained.
See also
PwUnsDomAllocateElements(), PwUnsDomSetElement()
Sample usage:
See PwVlstCreateUnsDomain() for an example.

Definition at line 1334 of file apiGridModel.cxx.

References PWGM_ECNT_Quad, PWGM_ECNT_Tri, PWGM_ELEMTYPE_QUAD, PWGM_ELEMTYPE_TRI, and PwUnsDomAllocateElements().

◆ PwUnsDomAllocateElements()

PWP_BOOL PwUnsDomAllocateElements ( PWGM_HDOMAIN  h,
const PWGM_ENUM_ELEMTYPE  cellType,
const PWP_UINT  count 
)

Allocates element storage in an unstructured domain.

Parameters
hAn unstructured domain handle obtained from PwVlstCreateUnsDomain() or PwVlstCreateUnsBoundary().
cellTypeThe cell type for which storage is being allocated. One of PWGM_ELEMTYPE_TRI or PWGM_ELEMTYPE_QUAD.
countThe number of elements to allocate.
Returns
PWP_TRUE on success.
Note
Allocating elements is NOT required. However, it is a best practice to do so if these counts are easily obtained.
See also
PwUnsDomAllocateElementCounts(), PwUnsDomSetElement()
Sample usage:
See PwVlstCreateUnsDomain() for an example.

Definition at line 1325 of file apiGridModel.cxx.

References PWP_FALSE.

Referenced by PwUnsDomAllocateElementCounts().

◆ PwUnsDomSetElement()

PWP_BOOL PwUnsDomSetElement ( PWGM_HDOMAIN  h,
const PWP_UINT  ndx,
const PWGM_ELEMDATA eData 
)

Sets the connectivity for an unstructured domain element.

Parameters
hAn unstructured domain handle obtained from PwVlstCreateUnsDomain() or PwVlstCreateUnsBoundary().
ndxThe domain element index.
eDataThe domain element connectivity. Only the eData.type, eData.vertCnt, and eData.index data members are used. The eData.vert data member is ignored.
Returns
PWP_TRUE on success.
See also
PwUnsDomAllocateElements(), PwUnsDomAllocateElementCounts()
Sample usage:
See PwVlstCreateUnsDomain() for an example.

Definition at line 1344 of file apiGridModel.cxx.

References PWP_FALSE.

◆ PwVlstAllocate()

PWP_BOOL PwVlstAllocate ( PWGM_HVERTEXLIST  h,
const PWP_UINT  count 
)

Allocates storage in an unstructured vertex list.

Parameters
hA vertex list handle.
countThe number of points to allocate.
Returns
PWP_TRUE on success.
Sample usage:
See PwModCreateUnsVertexList() for an example.

Definition at line 1247 of file apiGridModel.cxx.

◆ PwVlstCreateBlockAssembler()

PWGM_HBLOCKASSEMBLER PwVlstCreateBlockAssembler ( PWGM_HVERTEXLIST  h)

Creates an unstructured block face assembler that uses vertices from an unstructured vertex list.

Parameters
hA vertex list handle.
Returns
A block assembler handle.
See also
PwVlstCreateUnsBlock(), PwVlstCreateUnsDomain(), PwVlstCreateUnsBoundary(), PwModCreateCon()
Sample usage:

These snippets are from the GrdpTEST sample plugin included with the Plugin SDK.

Given this vertex list:

static bool
doCreateUnsVertList3(const GRDP_RTITEM &rti, PWGM_HVERTEXLIST &hVL,
PWGM_XYZVAL dx = 0, PWGM_XYZVAL dy = 0, PWGM_XYZVAL dz = 0)
{
// Create an empty vertex list for a 3-D grid.
// Could also use PwModCreateUnsVertexList3(rti.model)
// Allocate memory for 13 vertices and set each vertex XYZ value
return PwVlstAllocate(hVL, 13) &&
PwVlstSetXYZ(hVL, 0, 0.0 + dx, 0.0 + dy, 0.0 + dz) &&
PwVlstSetXYZ(hVL, 1, 1.0 + dx, 0.0 + dy, 0.0 + dz) &&
PwVlstSetXYZ(hVL, 2, 1.0 + dx, 1.0 + dy, 0.0 + dz) &&
PwVlstSetXYZ(hVL, 3, 0.0 + dx, 1.0 + dy, 0.0 + dz) &&
PwVlstSetXYZ(hVL, 4, 0.0 + dx, 0.0 + dy, 1.0 + dz) &&
PwVlstSetXYZ(hVL, 5, 1.0 + dx, 0.0 + dy, 1.0 + dz) &&
PwVlstSetXYZ(hVL, 6, 1.0 + dx, 1.0 + dy, 1.0 + dz) &&
PwVlstSetXYZ(hVL, 7, 0.0 + dx, 1.0 + dy, 1.0 + dz) &&
PwVlstSetXYZ(hVL, 8, 1.0 + dx, 2.0 + dy, 1.0 + dz) &&
PwVlstSetXYZ(hVL, 9, 0.0 + dx, 2.0 + dy, 1.0 + dz) &&
PwVlstSetXYZ(hVL, 10, 0.5 + dx, 0.5 + dy, 2.0 + dz) &&
PwVlstSetXYZ(hVL, 11, 0.5 + dx, 1.5 + dy, 2.0 + dz) &&
PwVlstSetXYZ(hVL, 12, 0.5 + dx, 2.0 + dy, 2.0 + dz);
}

The doCreateUnsBlkFaceBased() function creates an unstructured block and loads its elements:

static void
doCreateUnsBlkFaceBased(PWGM_HVERTEXLIST &hVL)
{
if (createBlkAsm(hVL, hAsm)) {
const PWGM_CONDKEY VcFluidKey = 22;
const PWGM_CONDDATA VcFulid{ "FLUID", 22, "", 0 };
PwAsmSetCondition(hAsm, VcFluidKey, VcFulid);
const PWGM_CONDKEY VcPlasmaKey = 44;
const PWGM_CONDDATA VcFulid22{ "PLASMA", 44, "", 0 };
PwAsmSetCondition(hAsm, VcPlasmaKey, VcFulid22);
// Owner/Neighbor cell indices
const PWP_UINT32 hex = 0;
const PWP_UINT32 pyr = 1;
const PWP_UINT32 wed = 2;
const PWP_UINT32 tet = 3;
// Face normal must point to interior of owner cell
pushFace(0, 1, 2, 3, hAsm, hex); // minZ
pushFace(1, 5, 6, 2, hAsm, hex); // maxX
pushFace(2, 6, 7, 3, hAsm, hex); // maxY
pushFace(3, 7, 4, 0, hAsm, hex); // minX
pushFace(0, 4, 5, 1, hAsm, hex); // minY
pushFace(5, 4, 7, 6, hAsm, hex, pyr); // maxZ, minZ
pushFace(5, 10, 6, hAsm, pyr); // maxX
pushFace(6, 10, 7, hAsm, pyr, wed); // maxY, minY
pushFace(7, 10, 4, hAsm, pyr); // pyramid minX
pushFace(4, 10, 5, hAsm, pyr); // pyramid minY
pushFace(6, 10, 11, 8, hAsm, wed); // maxX
pushFace(8, 11, 9, hAsm, wed, tet); // maxY, minY
pushFace(9, 11, 10, 7, hAsm, wed); // minX
pushFace(6, 8, 9, 7, hAsm, wed); // minZ
pushFace(8, 11, 12, hAsm, tet); // tet maxX
pushFace(8, 12, 9, hAsm, tet); // tet maxY
pushFace(9, 12, 11, hAsm, tet); // tet minX
PwAsmSetCellSpanConditionKey(hAsm, VcFluidKey, hex, pyr);
PwAsmSetCellSpanConditionKey(hAsm, VcPlasmaKey, wed, tet);
// BC WALL
PwDomSetName(hDom, "FaceBasedUnsDomain_WALL-1");
PWP_UINT n = 0;
PwUnsDomSetElement(hDom, n++, QUAD(0, 4, 5, 1));
PwUnsDomSetElement(hDom, n++, QUAD(0, 3, 7, 4));
PwUnsDomSetElement(hDom, n++, QUAD(3, 2, 6, 7));
PwUnsDomSetElement(hDom, n++, QUAD(1, 5, 6, 2));
PwUnsDomSetElement(hDom, n++, TRI(10, 5, 4));
PwUnsDomSetElement(hDom, n++, TRI(10, 4, 7));
PwUnsDomSetElement(hDom, n++, TRI(10, 6, 5));
PwUnsDomSetElement(hDom, n++, QUAD(7, 9, 11, 10));
PwUnsDomSetElement(hDom, n++, QUAD(7, 6, 8, 9));
PwUnsDomSetElement(hDom, n++, QUAD(10, 11, 8, 6));
// BC IN
PwDomSetName(hDom, "FaceBasedUnsDomain_IN-1");
PwDomSetConditionTypeName(hDom, "Inflow");
n = 0;
PwUnsDomSetElement(hDom, n++, QUAD(0, 1, 2, 3));
// BC OUT
PwDomSetName(hDom, "FaceBasedUnsDomain_OUT-1");
PwDomSetConditionTypeName(hDom, "Outflow");
n = 0;
PwUnsDomSetElement(hDom, n++, TRI(12, 8, 11));
PwUnsDomSetElement(hDom, n++, TRI(12, 11, 9));
PwUnsDomSetElement(hDom, n++, TRI(12, 9, 8));
}
}

The doCreateUnsDomFaceBased() function creates an unstructured domain and loads its elements:

static void
doCreateUnsDomFaceBased(PWGM_HVERTEXLIST &hVL)
{
if (createBlkAsm(hVL, hAsm)) {
// Owner/Neighbor cell indices
const PWP_UINT32 quad0 = 0;
const PWP_UINT32 tri1 = 1;
const PWP_UINT32 quad2 = 2;
const PWP_UINT32 tri3 = 3;
// The edge face indices must be ordered such that the owner cell is
// "to the left" of the edge when walking the cell's perimeter in the
// direction of the vertices. The right-handed cell normal is the "up"
// direction. In addition, all the 2D cell, right-handed normals must be
// consistently oriented (point to "the same side" of the mesh).
pushFace( 5, 1, hAsm, quad0);
pushFace( 1, 2, hAsm, quad0);
pushFace( 2, 6, hAsm, quad0);
pushFace( 6, 5, hAsm, quad0, tri1);
pushFace( 6, 10, hAsm, tri1, quad2);
pushFace(10, 5, hAsm, tri1);
pushFace( 6, 8, hAsm, quad2);
pushFace( 8, 11, hAsm, quad2, tri3);
pushFace(11, 10, hAsm, quad2);
pushFace( 8, 12, hAsm, tri3);
pushFace(12, 11, hAsm, tri3);
}
}

The doCreateUnsBlkFaceBased() helper functions:

inline static PWGM_ENUM_FACETYPE
faceType(const PWP_UINT32 neighbor)
{
// Boundary faces do not have a neighbor
return (PWP_UINT32_MAX == neighbor) ? PWGM_FACETYPE_BOUNDARY
}
inline static bool
pushFace(const PWP_UINT32 n0, const PWP_UINT32 n1, const PWP_UINT32 n2,
const PWP_UINT32 n3, PWGM_HBLOCKASSEMBLER hAsm, const PWP_UINT32 owner,
const PWP_UINT32 neighbor = PWP_UINT32_MAX)
{
// init quad face data
const PWGM_ASSEMBLER_DATA quad = {
faceType(neighbor), 4,{ n0, n1, n2, n3 }, owner, neighbor
};
return 0 != PwAsmPushElementFace(hAsm, &quad);
}
inline static bool
pushFace(const PWP_UINT32 n0, const PWP_UINT32 n1, const PWP_UINT32 n2,
PWGM_HBLOCKASSEMBLER hAsm, const PWP_UINT32 owner,
const PWP_UINT32 neighbor = PWP_UINT32_MAX)
{
// init tri face data
const PWGM_ASSEMBLER_DATA tri = {
faceType(neighbor), 3,{ n0, n1, n2 }, owner, neighbor
};
return 0 != PwAsmPushElementFace(hAsm, &tri);
}
inline static bool
pushFace(const PWP_UINT32 n0, const PWP_UINT32 n1, PWGM_HBLOCKASSEMBLER hAsm,
const PWP_UINT32 owner, const PWP_UINT32 neighbor = PWP_UINT32_MAX)
{
// init 2-D bar face data
const PWGM_ASSEMBLER_DATA bar = {
faceType(neighbor), 2,{ n0, n1 }, owner, neighbor
};
return 0 != PwAsmPushElementFace(hAsm, &bar);
}

Definition at line 1353 of file apiGridModel.cxx.

◆ PwVlstCreateUnsBlock()

PWGM_HBLOCK PwVlstCreateUnsBlock ( PWGM_HVERTEXLIST  h)

Creates an unstructured block that uses vertices from an unstructured vertex list.

Parameters
hA vertex list handle.
Returns
A block handle.
See also
PwVlstCreateUnsDomain(), PwVlstCreateUnsBoundary(), PwModCreateCon(), PwVlstCreateBlockAssembler()
Sample usage:

These snippets are from the GrdpTEST sample plugin included with the Plugin SDK.

Given this vertex list:

static bool
doCreateUnsVertList3(const GRDP_RTITEM &rti, PWGM_HVERTEXLIST &hVL,
PWGM_XYZVAL dx = 0, PWGM_XYZVAL dy = 0, PWGM_XYZVAL dz = 0)
{
// Create an empty vertex list for a 3-D grid.
// Could also use PwModCreateUnsVertexList3(rti.model)
// Allocate memory for 13 vertices and set each vertex XYZ value
return PwVlstAllocate(hVL, 13) &&
PwVlstSetXYZ(hVL, 0, 0.0 + dx, 0.0 + dy, 0.0 + dz) &&
PwVlstSetXYZ(hVL, 1, 1.0 + dx, 0.0 + dy, 0.0 + dz) &&
PwVlstSetXYZ(hVL, 2, 1.0 + dx, 1.0 + dy, 0.0 + dz) &&
PwVlstSetXYZ(hVL, 3, 0.0 + dx, 1.0 + dy, 0.0 + dz) &&
PwVlstSetXYZ(hVL, 4, 0.0 + dx, 0.0 + dy, 1.0 + dz) &&
PwVlstSetXYZ(hVL, 5, 1.0 + dx, 0.0 + dy, 1.0 + dz) &&
PwVlstSetXYZ(hVL, 6, 1.0 + dx, 1.0 + dy, 1.0 + dz) &&
PwVlstSetXYZ(hVL, 7, 0.0 + dx, 1.0 + dy, 1.0 + dz) &&
PwVlstSetXYZ(hVL, 8, 1.0 + dx, 2.0 + dy, 1.0 + dz) &&
PwVlstSetXYZ(hVL, 9, 0.0 + dx, 2.0 + dy, 1.0 + dz) &&
PwVlstSetXYZ(hVL, 10, 0.5 + dx, 0.5 + dy, 2.0 + dz) &&
PwVlstSetXYZ(hVL, 11, 0.5 + dx, 1.5 + dy, 2.0 + dz) &&
PwVlstSetXYZ(hVL, 12, 0.5 + dx, 2.0 + dy, 2.0 + dz);
}

The doCreateUnsBlkCellBased() function creates an unstructured block and loads its elements:

static void
doCreateUnsBlkCellBased(const PWGM_HVERTEXLIST &hVL)
{
if (PWGM_HBLOCK_ISVALID(hBlk)) {
// The "-1" suffix will get changed by Pointwise to
// "-2", "-3", etc. if there are duplicate names.
PwBlkSetName(hBlk, "CellBasedUnsBlock-1");
PwBlkSetConditionUserName(hBlk, "FLUID");
PwBlkSetConditionTypeName(hBlk, "Fluid");
// Individually allocate cells by type.
// Although allocating elements is NOT strictly
// required, it is a "best practice" to do so if
// these counts are easily obtained.
PWP_UINT n = 0;
PwUnsBlkSetElement(hBlk, n++, HEX(0, 1, 2, 3, 4, 5, 6, 7));
PwUnsBlkSetElement(hBlk, n++, PYR(4, 5, 6, 7, 10));
PwUnsBlkSetElement(hBlk, n++, WEDGE(6, 7, 10, 8, 9, 11));
PwUnsBlkSetElement(hBlk, n++, TET(8, 9, 11, 12));
// BC WALL
PwDomSetName(hDom, "CellBasedUnsDomain_WALL-1");
n = 0;
PwUnsDomSetElement(hDom, n++, QUAD(0, 4, 5, 1));
PwUnsDomSetElement(hDom, n++, QUAD(0, 3, 7, 4));
PwUnsDomSetElement(hDom, n++, QUAD(3, 2, 6, 7));
PwUnsDomSetElement(hDom, n++, QUAD(1, 5, 6, 2));
PwUnsDomSetElement(hDom, n++, TRI(10, 5, 4));
PwUnsDomSetElement(hDom, n++, TRI(10, 4, 7));
PwUnsDomSetElement(hDom, n++, TRI(10, 6, 5));
PwUnsDomSetElement(hDom, n++, QUAD(7, 9, 11, 10));
PwUnsDomSetElement(hDom, n++, QUAD(7, 6, 8, 9));
PwUnsDomSetElement(hDom, n++, QUAD(10, 11, 8, 6));
// BC IN
PwDomSetName(hDom, "CellBasedUnsDomain_IN-1");
PwDomSetConditionTypeName(hDom, "Inflow");
n = 0;
PwUnsDomSetElement(hDom, n++, QUAD(0, 1, 2, 3));
// BC OUT
PwDomSetName(hDom, "CellBasedUnsDomain_OUT-1");
PwDomSetConditionTypeName(hDom, "Outflow");
n = 0;
PwUnsDomSetElement(hDom, n++, TRI(12, 8, 11));
PwUnsDomSetElement(hDom, n++, TRI(12, 11, 9));
PwUnsDomSetElement(hDom, n++, TRI(12, 9, 8));
// Non-boundary domain
hDom = PwVlstCreateUnsDomain(hVL);
PwDomSetName(hDom, "CellBasedUnsDomain_NONE-1");
n = 0;
PwUnsDomSetElement(hDom, n++, QUAD(0, 1, 6, 7));
PwUnsDomSetElement(hDom, n++, QUAD(7, 6, 8, 11));
}
}

Definition at line 1255 of file apiGridModel.cxx.

◆ PwVlstCreateUnsBoundary()

PWGM_HDOMAIN PwVlstCreateUnsBoundary ( PWGM_HVERTEXLIST  h)

Used to create an unstructured domain that is part of an unstructured block boundary.

Definition at line 1313 of file apiGridModel.cxx.

References PwDomSetProperty(), and PwVlstCreateUnsDomain().

◆ PwVlstCreateUnsDomain()

PWGM_HDOMAIN PwVlstCreateUnsDomain ( PWGM_HVERTEXLIST  h)

Creates an unstructured domain that uses vertices from an unstructured vertex list.

A boundary condition will be created if a condition user name is assigned. The condition user id, type name, and type id values are optional.

Parameters
hA vertex list handle.
Returns
A domain handle.
See also
PwVlstCreateUnsBlock(), PwModCreateCon(), PwVlstCreateBlockAssembler(), PwDomSetConditionUserName(), PwDomSetConditionUserId(), PwDomSetConditionTypeName(), PwDomSetConditionTypeId(), PwDomSetCondition()
Sample usage:

These snippets are from the GrdpTEST sample plugin included with the Plugin SDK.

Given this vertex list:

static bool
doCreateUnsVertList3(const GRDP_RTITEM &rti, PWGM_HVERTEXLIST &hVL,
PWGM_XYZVAL dx = 0, PWGM_XYZVAL dy = 0, PWGM_XYZVAL dz = 0)
{
// Create an empty vertex list for a 3-D grid.
// Could also use PwModCreateUnsVertexList3(rti.model)
// Allocate memory for 13 vertices and set each vertex XYZ value
return PwVlstAllocate(hVL, 13) &&
PwVlstSetXYZ(hVL, 0, 0.0 + dx, 0.0 + dy, 0.0 + dz) &&
PwVlstSetXYZ(hVL, 1, 1.0 + dx, 0.0 + dy, 0.0 + dz) &&
PwVlstSetXYZ(hVL, 2, 1.0 + dx, 1.0 + dy, 0.0 + dz) &&
PwVlstSetXYZ(hVL, 3, 0.0 + dx, 1.0 + dy, 0.0 + dz) &&
PwVlstSetXYZ(hVL, 4, 0.0 + dx, 0.0 + dy, 1.0 + dz) &&
PwVlstSetXYZ(hVL, 5, 1.0 + dx, 0.0 + dy, 1.0 + dz) &&
PwVlstSetXYZ(hVL, 6, 1.0 + dx, 1.0 + dy, 1.0 + dz) &&
PwVlstSetXYZ(hVL, 7, 0.0 + dx, 1.0 + dy, 1.0 + dz) &&
PwVlstSetXYZ(hVL, 8, 1.0 + dx, 2.0 + dy, 1.0 + dz) &&
PwVlstSetXYZ(hVL, 9, 0.0 + dx, 2.0 + dy, 1.0 + dz) &&
PwVlstSetXYZ(hVL, 10, 0.5 + dx, 0.5 + dy, 2.0 + dz) &&
PwVlstSetXYZ(hVL, 11, 0.5 + dx, 1.5 + dy, 2.0 + dz) &&
PwVlstSetXYZ(hVL, 12, 0.5 + dx, 2.0 + dy, 2.0 + dz);
}

The doCreateUnsDomCellBased() function creates an unstructured domain and loads its elements:

static void
doCreateUnsDomCellBased(PWGM_HVERTEXLIST &hVL)
{
if (PWGM_HDOMAIN_ISVALID(hDom)) {
// The "-1" suffix will get changed by Pointwise to
// "-2", "-3", etc. if there are duplicate names.
PwDomSetName(hDom, "CellBasedUnsDomain-1");
PwDomSetConditionUserName(hDom, "FREE2");
// Individually allocate cells by type.
// Although allocating elements is NOT strictly
// required, it is a "best practice" to do so if
// these counts are easily obtained.
PwUnsDomSetElement(hDom, 0, QUAD(1, 2, 6, 5));
PwUnsDomSetElement(hDom, 1, TRI(5, 6, 10));
PwUnsDomSetElement(hDom, 2, QUAD(6, 8, 11, 10));
PwUnsDomSetElement(hDom, 3, TRI(8, 12, 11));
}
}

Used to create a stand-alone, "free" unstructured domain that is not intended to be part of a block's boundary.

Definition at line 1305 of file apiGridModel.cxx.

Referenced by PwVlstCreateUnsBoundary().

PwVlstCreateUnsBlock
PWGM_HBLOCK PwVlstCreateUnsBlock(PWGM_HVERTEXLIST vertlist)
Creates an unstructured block that uses vertices from an unstructured vertex list.
Definition: apiGridModel.cxx:1255
PWGM_HBLOCKASSEMBLER
An opaque handle to an unstructured block assembler.
Definition: apiGridModel.h:566
PwVlstCreateUnsBoundary
PWGM_HDOMAIN PwVlstCreateUnsBoundary(PWGM_HVERTEXLIST vertlist)
Definition: apiGridModel.cxx:1313
PWP_UINT32_MAX
#define PWP_UINT32_MAX
maximum valid PWP_UINT32 value
Definition: apiPWP.h:213
PWP_DIMENSION_3D
@ PWP_DIMENSION_3D
Definition: apiPWP.h:765
PWGM_ELEMTYPE_TET
@ PWGM_ELEMTYPE_TET
3D, 4-sided (tetrahedral) grid element
Definition: apiGridModel.h:677
PWP_UINT32
unsigned int PWP_UINT32
32-bit unsigned integer
Definition: apiPWP.h:210
PwBlkSetName
PWP_BOOL PwBlkSetName(PWGM_HBLOCK block, const char *name)
Set a block's name.
Definition: apiGridModel.cxx:840
PWGM_HDOMAIN
An opaque handle to a grid domain element.
Definition: apiGridModel.h:372
PWGM_ENUM_FACETYPE
PWGM_ENUM_FACETYPE
The facetypes supported by face streaming.
Definition: apiGridModel.h:1033
PwDomSetConditionUserId
PWP_BOOL PwDomSetConditionUserId(PWGM_HDOMAIN domain, const PWP_UINT32 userId)
Sets the condition data for a domain.
Definition: apiGridModel.cxx:1066
PWGM_HDOMAIN_ISVALID
#define PWGM_HDOMAIN_ISVALID(h)
returns non-zero value if handle is valid
Definition: apiGridModel.h:374
PwUnsDomAllocateElements
PWP_BOOL PwUnsDomAllocateElements(PWGM_HDOMAIN domain, const PWGM_ENUM_ELEMTYPE cellType, const PWP_UINT n)
Allocates element storage in an unstructured domain.
Definition: apiGridModel.cxx:1325
PwAsmPushElementFace
PWP_BOOL PwAsmPushElementFace(PWGM_HBLOCKASSEMBLER blkAsm, const PWGM_ASSEMBLER_DATA *face)
Adds a face to an unstructured block face assembler.
Definition: apiGridModel.cxx:1361
PWP_UINT
PWP_UINT32 PWP_UINT
unsigned integer same size as void*
Definition: apiPWP.h:285
PWP_DIMENSION_2D
@ PWP_DIMENSION_2D
Definition: apiPWP.h:764
PWGM_HBLOCK_ISVALID
#define PWGM_HBLOCK_ISVALID(h)
Returns non-zero value if handle is valid.
Definition: apiGridModel.h:348
PwAsmFinalize
PWP_BOOL PwAsmFinalize(PWGM_HBLOCKASSEMBLER blkAsm)
Stitches together all the faces added to the assembler into cells and blocks.
Definition: apiGridModel.cxx:1370
PWGM_CONDKEY
PWP_UINT32 PWGM_CONDKEY
The condition key integral type.
Definition: apiGridModel.h:1189
PwDomSetConditionUserName
PWP_BOOL PwDomSetConditionUserName(PWGM_HDOMAIN domain, const char *userName)
Sets the condition name for a domain.
Definition: apiGridModel.cxx:1059
PWGM_ELEMTYPE_TRI
@ PWGM_ELEMTYPE_TRI
2D, 3-sided grid element
Definition: apiGridModel.h:676
PWGM_ELEMTYPE_PYRAMID
@ PWGM_ELEMTYPE_PYRAMID
3D, 5-sided, quad-based grid element
Definition: apiGridModel.h:679
PwUnsBlkSetElement
PWP_BOOL PwUnsBlkSetElement(PWGM_HBLOCK block, const PWP_UINT ndx, const PWGM_ELEMDATA *eData)
Sets the connectivity for an unstructured block element.
Definition: apiGridModel.cxx:1296
PwBlkSetConditionUserId
PWP_BOOL PwBlkSetConditionUserId(PWGM_HBLOCK block, const PWP_UINT32 userId)
Sets the condition data for a grid entity.
Definition: apiGridModel.cxx:1023
GRDP_RTITEM
The data representing a grid importer instance.
Definition: apiGRDPUtils.h:117
PwVlstSetXYZ
PWP_BOOL PwVlstSetXYZ(PWGM_HVERTEXLIST vertlist, const PWP_UINT ndx, const PWGM_XYZVAL x, const PWGM_XYZVAL y, const PWGM_XYZVAL z)
Set the XYZ of a point in a 1D vertex list.
Definition: apiGridModel.cxx:900
PWGM_FACETYPE_INTERIOR
@ PWGM_FACETYPE_INTERIOR
The cell face is on the grid's interior.
Definition: apiGridModel.h:1040
PwAsmSetCellSpanConditionKey
PWP_BOOL PwAsmSetCellSpanConditionKey(PWGM_HBLOCKASSEMBLER blkAsm, const PWGM_CONDKEY key, const PWP_UINT32 startCell, const PWP_UINT32 endCell)
Tags a contiguous span of cells with the condition identified by key.
Definition: apiGridModel.cxx:1193
PWGM_HBLOCK
An opaque handle to a grid block element.
Definition: apiGridModel.h:345
PWGM_ELEMTYPE_WEDGE
@ PWGM_ELEMTYPE_WEDGE
3D, extruded, tri/quad grid element
Definition: apiGridModel.h:678
GRDP_RTITEM::model
PWGM_HGRIDMODEL model
Runtime grid model handle to import.
Definition: apiGRDPUtils.h:157
PwBlkSetConditionUserName
PWP_BOOL PwBlkSetConditionUserName(PWGM_HBLOCK block, const char *userName)
Sets the condition name for a grid entity.
Definition: apiGridModel.cxx:1016
PwVlstAllocate
PWP_BOOL PwVlstAllocate(PWGM_HVERTEXLIST vertlist, const PWP_UINT n)
Allocates storage in an unstructured vertex list.
Definition: apiGridModel.cxx:1247
PWGM_CONDDATA
Condition descriptor data type.
Definition: apiGridModel.h:644
PwBlkSetConditionTypeName
PWP_BOOL PwBlkSetConditionTypeName(PWGM_HBLOCK block, const char *typeName)
Sets the condition data for a grid entity.
Definition: apiGridModel.cxx:1032
PwVlstCreateUnsDomain
PWGM_HDOMAIN PwVlstCreateUnsDomain(PWGM_HVERTEXLIST vertlist)
Creates an unstructured domain that uses vertices from an unstructured vertex list.
Definition: apiGridModel.cxx:1305
PWGM_XYZVAL
PWP_REAL PWGM_XYZVAL
XYZ component data type.
Definition: apiGridModel.h:600
PWGM_FACETYPE_BOUNDARY
@ PWGM_FACETYPE_BOUNDARY
The cell face is on the grid's boundary.
Definition: apiGridModel.h:1036
PwUnsDomSetElement
PWP_BOOL PwUnsDomSetElement(PWGM_HDOMAIN domain, const PWP_UINT ndx, const PWGM_ELEMDATA *eData)
Sets the connectivity for an unstructured domain element.
Definition: apiGridModel.cxx:1344
PwDomSetConditionTypeName
PWP_BOOL PwDomSetConditionTypeName(PWGM_HDOMAIN domain, const char *typeName)
Sets the condition data for a domain.
Definition: apiGridModel.cxx:1075
PwDomSetName
PWP_BOOL PwDomSetName(PWGM_HDOMAIN domain, const char *name)
Set a domain's name.
Definition: apiGridModel.cxx:848
PwModCreateUnsVertexList
PWGM_HVERTEXLIST PwModCreateUnsVertexList(PWGM_HGRIDMODEL model, const PWP_ENUM_DIMENSION blkElemDimty)
Creates an empty, unstructured vertex list in a model.
Definition: apiGridModel.cxx:1223
PWGM_ASSEMBLER_DATA
Face descriptor data type. Used for face assembler functions.
Definition: apiGridModel.h:1211
PwAsmSetCondition
PWP_BOOL PwAsmSetCondition(PWGM_HBLOCKASSEMBLER h, const PWGM_CONDKEY key, const PWGM_CONDDATA &condData)
Sets the condition data of the condition identified by key.
Definition: apiGridModel.cxx:1181
PwUnsBlkAllocateElements
PWP_BOOL PwUnsBlkAllocateElements(PWGM_HBLOCK block, const PWGM_ENUM_ELEMTYPE cellType, const PWP_UINT count)
Allocates element storage in an unstructured block.
Definition: apiGridModel.cxx:1263
PWGM_HVERTEXLIST
Grid vertex list handle declaration.
Definition: apiGridModel.h:536
PWGM_ELEMTYPE_QUAD
@ PWGM_ELEMTYPE_QUAD
2D, 4-sided grid element
Definition: apiGridModel.h:675
PWGM_ELEMTYPE_HEX
@ PWGM_ELEMTYPE_HEX
3D, 6-sided (block) grid element
Definition: apiGridModel.h:674