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 1342 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 1350 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 1333 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 1195 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 1212 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 1205 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 1245 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 1235 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 1268 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 1306 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 1297 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 1316 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 1219 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 1325 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 1227 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 1285 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 1277 of file apiGridModel.cxx.

Referenced by PwVlstCreateUnsBoundary().