Pointwise Plugin SDK
apiGridModel.cxx
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * CAEP Plugin example
4  *
5  * (C) 2021 Cadence Design Systems, Inc. All rights reserved worldwide.
6  *
7  ***************************************************************************/
8 
9 // See comments in core code for information on adding new PWGM API functions.
10 
11 #include <cctype>
12 #include <climits>
13 #include <cerrno>
14 #include <sstream>
15 #include <string>
16 
17 // Define these on the build command line for verbose build messages
18 // #define SHOW_PWP_MESSAGES
19 // #define SHOW_PWGM_MESSAGES
20 #include "apiGridModel.h"
21 
22 #include "apiPWPUtils.h"
23 
24 // If this asserts, PWGM_ASSEMBLER_DATA has increased in size! This will
25 // increase memory usage during face grid importing. Are you sure?
27 
29 #define MODEL_OUT PWGM_HGRIDMODEL_OUT_GMIMPL(model)
30 #define BLKMODEL_OUT PWGM_HBLOCK_OUT_GMIMPL(block)
31 #define DOMMODEL_OUT PWGM_HDOMAIN_OUT_GMIMPL(domain)
32 #define VERTMODEL_OUT PWGM_HVERTEX_OUT_GMIMPL(vertex)
33 #define ELEMMODEL_OUT PWGM_HELEMENT_OUT_GMIMPL(element)
34 #define BNDRYMODEL_OUT PWGM_HBNDRY_OUT_GMIMPL(boundary)
35 #define CNXNMODEL_OUT PWGM_HCNXN_OUT_GMIMPL(connection)
36 
37 #define MODEL_IN PWGM_HGRIDMODEL_IN_GMIMPL(model)
38 #define BLKMODEL_IN PWGM_HBLOCK_IN_GMIMPL(block)
39 #define DOMMODEL_IN PWGM_HDOMAIN_IN_GMIMPL(domain)
40 #define CONMODEL_IN PWGM_HCONNECTOR_IN_GMIMPL(connector)
41 #define VLISTMODEL_IN PWGM_HVERTEXLIST_IN_GMIMPL(vertlist)
42 #define BLKASMMODEL_IN PWGM_HBLOCKASSEMBLER_IN_GMIMPL(blkAsm)
43 
44 static const PWGM_HBLOCK badBlock = PWGM_HBLOCK_INIT;
45 static const PWGM_HDOMAIN badDomain = PWGM_HDOMAIN_INIT;
46 
47 #if !defined(PWGM_HIDE_IMPORT_API)
48 static const PWGM_HCONNECTOR badConnector = PWGM_HCONNECTOR_INIT;
49 static const PWGM_HVERTEXLIST badVertexList = PWGM_HVERTEXLIST_INIT;
50 static const PWGM_HBLOCKASSEMBLER badAssembler = PWGM_HBLOCKASSEMBLER_INIT;
51 
52 static const char * PropSubType{ "SubType" };
53 static const char * PropUserName{ "UserName" };
54 static const char * PropUserId{ "UserId" };
55 static const char * PropTypeName{ "TypeName" };
56 static const char * PropTypeId{ "TypeId" };
57 
58 static const char * SubTypeBoundary{ "Boundary" };
59 
60 #endif /* PWGM_HIDE_IMPORT_API */
61 
62 #if !defined(PWGM_HIDE_UNSTRUCTURED_API)
63 static const PWGM_HVERTEX badVertex = PWGM_HVERTEX_INIT;
64 static const PWGM_HELEMENT badElement = PWGM_HELEMENT_INIT;
65 #endif /* PWGM_HIDE_UNSTRUCTURED_API */
66 
67 #if !defined(PWGM_HIDE_STRUCTURED_API)
68 static const PWGM_HBNDRY badBoundary = PWGM_HBNDRY_INIT;
69 static const PWGM_HCNXN badConnection = PWGM_HCNXN_INIT;
70 #endif /* PWGM_HIDE_STRUCTURED_API */
71 
72 
73 #ifdef WINDOWS
74 # define strcasecmp stricmp
75 # define strncasecmp strnicmp
76 #endif /* WINDOWS */
77 
79 
80 
81 
84 {
85  return (MODEL_OUT && MODEL_OUT->PwModBlockCountCB) ?
86  MODEL_OUT->PwModBlockCountCB(model) : 0;
87 }
88 
89 
92 {
93  return (MODEL_OUT && MODEL_OUT->PwModEnumBlocksCB) ?
94  MODEL_OUT->PwModEnumBlocksCB(model, ndx) : badBlock;
95 }
96 
97 
100 {
101  return (pCondData && PWGM_HBLOCK_ISVALID(block) && BLKMODEL_OUT &&
102  BLKMODEL_OUT->PwBlkConditionCB) ?
103  BLKMODEL_OUT->PwBlkConditionCB(block, pCondData) : PWP_FALSE;
104 }
105 
106 
107 PWP_BOOL
108 PwBlock(PWGM_HBLOCK block, PWGM_BLOCKDATA *pBlockData)
109 {
110  return (pBlockData && PWGM_HBLOCK_ISVALID(block) && BLKMODEL_OUT &&
111  BLKMODEL_OUT->PwBlockCB) ? BLKMODEL_OUT->PwBlockCB(block, pBlockData) :
112  PWP_FALSE;
113 }
114 
115 
116 PWP_BOOL
117 PwBlkSetExportName(PWGM_HBLOCK block, const char *name)
118 {
119  return (PWGM_HBLOCK_ISVALID(block) && BLKMODEL_OUT &&
120  BLKMODEL_OUT->PwBlkSetExportNameCB) ?
121  BLKMODEL_OUT->PwBlkSetExportNameCB(block, name) : PWP_FALSE;
122 }
123 
124 
125 PWP_BOOL
126 PwModGetAttributeValue(PWGM_HGRIDMODEL model, const char *name,
127  PWP_ENUM_VALTYPE bufType, void *buf, PWP_UINT count)
128 {
129  return (MODEL_OUT && MODEL_OUT->PwModGetAttributeValueCB) ?
130  MODEL_OUT->PwModGetAttributeValueCB(model, name, bufType, buf, count) :
131  PWP_FALSE;
132 }
133 
134 
135 PWP_BOOL
136 PwModGetAttributeString(PWGM_HGRIDMODEL model, const char *name,
137  const char ** val)
138 {
139  return PwModGetAttributeValue(model, name, PWP_VALTYPE_STRING, val, 1);
140 }
141 
142 
143 PWP_BOOL
144 PwModGetAttributeUINT(PWGM_HGRIDMODEL model, const char *name,
145  PWP_UINT *val)
146 {
147  return PwModGetAttributeValue(model, name, PWP_VALTYPE_UINT, val, 1);
148 }
149 
150 
151 PWP_BOOL
152 PwModGetAttributeUINT32(PWGM_HGRIDMODEL model, const char *name,
153  PWP_UINT32 *val)
154 {
155  PWP_UINT locVal = 0;
156  PWP_BOOL ret = PwModGetAttributeUINT(model, name, &locVal);
157  if (ret && val) {
158  *val = (PWP_UINT32)locVal;
159  }
160  return ret;
161 }
162 
163 
164 PWP_BOOL
165 PwModGetAttributeINT(PWGM_HGRIDMODEL model, const char *name,
166  PWP_INT *val)
167 {
168  return PwModGetAttributeValue(model, name, PWP_VALTYPE_INT, val, 1);
169 }
170 
171 
172 PWP_BOOL
173 PwModGetAttributeINT32(PWGM_HGRIDMODEL model, const char *name,
174  PWP_INT32 *val)
175 {
176  PWP_INT locVal = 0;
177  PWP_BOOL ret = val && PwModGetAttributeINT(model, name, &locVal);
178  if (ret && val) {
179  *val = (PWP_INT32)locVal;
180  }
181  return ret;
182 }
183 
184 
185 PWP_BOOL
186 PwModGetAttributeREAL(PWGM_HGRIDMODEL model, const char *name,
187  PWP_REAL *val)
188 {
189  return PwModGetAttributeValue(model, name, PWP_VALTYPE_REAL, val, 1);
190 }
191 
192 
193 PWP_BOOL
194 PwModGetAttributeFLOAT(PWGM_HGRIDMODEL model, const char *name,
195  PWP_FLOAT *val)
196 {
197  PWP_REAL locVal = 0;
198  PWP_BOOL ret = val && PwModGetAttributeREAL(model, name, &locVal);
199  if (ret && val) {
200  *val = (PWP_FLOAT)locVal;
201  }
202  return ret;
203 }
204 
205 
206 PWP_BOOL
207 PwModGetAttributeBOOL(PWGM_HGRIDMODEL model, const char *name,
208  PWP_BOOL *val)
209 {
210  return PwModGetAttributeValue(model, name, PWP_VALTYPE_BOOL, val, 1);
211 }
212 
213 
214 PWP_BOOL
215 PwModGetAttributeEnum(PWGM_HGRIDMODEL model, const char *name,
216  const char ** val)
217 {
218  return PwModGetAttributeValue(model, name, PWP_VALTYPE_ENUM, val, 1);
219 }
220 
221 
222 #if !defined(PWGM_HIDE_UNSTRUCTURED_API)
223 
224 
227 {
228  return (MODEL_OUT && MODEL_OUT->PwModDomainCountCB) ?
229  MODEL_OUT->PwModDomainCountCB(model) : 0;
230 }
231 
232 
235 {
236  return (MODEL_OUT && MODEL_OUT->PwModEnumDomainsCB) ?
237  MODEL_OUT->PwModEnumDomainsCB(model, ndx) : badDomain;
238 }
239 
240 
243 {
244  return (MODEL_OUT && MODEL_OUT->PwModEnumVerticesCB) ?
245  MODEL_OUT->PwModEnumVerticesCB(model, ndx) : badVertex;
246 }
247 
248 
251 {
252  return (MODEL_OUT && MODEL_OUT->PwModVertexCountCB) ?
253  MODEL_OUT->PwModVertexCountCB(model) : 0;
254 }
255 
256 
257 PWP_BOOL
259  void *data)
260 {
261  return (MODEL_OUT && MODEL_OUT->PwModCustomIndexSchemeReadyCB) ?
262  MODEL_OUT->PwModCustomIndexSchemeReadyCB(model, cb, data) : PWP_FALSE;
263 }
264 
265 PWP_BOOL
268  PWGM_ENDSTREAMCB endCB, void *userData)
269 {
270  return (MODEL_OUT && MODEL_OUT->PwModStreamFacesCB) ?
271  MODEL_OUT->PwModStreamFacesCB(model, order, beginCB, faceCB, endCB,
272  userData) : PWP_FALSE;
273 }
274 
275 
278 {
279  return (MODEL_OUT && MODEL_OUT->PwModEnumElementCountCB) ?
280  MODEL_OUT->PwModEnumElementCountCB(model, pCounts) : 0;
281 }
282 
283 
286 {
287  return (MODEL_OUT && MODEL_OUT->PwModEnumElementsCB) ?
288  MODEL_OUT->PwModEnumElementsCB(model, ndx) : badElement;
289 }
290 
291 
292 PWP_BOOL
294 {
295  return (MODEL_OUT && MODEL_OUT->PwModAppendEnumElementOrderCB) ?
296  MODEL_OUT->PwModAppendEnumElementOrderCB(model, order) : 0;
297 }
298 
299 
300 PWP_VOID
302 {
303  // PWGM_ELEMTYPE_SIZE triggers core to reset the ordering
304  PwModAppendEnumElementOrder(model, PWGM_ELEMORDER_SIZE);
305 }
306 
307 
310 {
311  return (PWGM_HBLOCK_ISVALID(block) && BLKMODEL_OUT->PwBlkElementCountCB) ?
312  BLKMODEL_OUT->PwBlkElementCountCB(block, pCounts) : 0;
313 }
314 
315 
318 {
319  return (PWGM_HBLOCK_ISVALID(block) && BLKMODEL_OUT->PwBlkEnumElementsCB) ?
320  BLKMODEL_OUT->PwBlkEnumElementsCB(block, ndx) : badElement;
321 }
322 
323 
326 {
327  return (PWGM_HDOMAIN_ISVALID(domain) && DOMMODEL_OUT->PwDomElementCountCB) ?
328  DOMMODEL_OUT->PwDomElementCountCB(domain, pCounts) : 0;
329 }
330 
331 
334 {
335  return (PWGM_HDOMAIN_ISVALID(domain) && DOMMODEL_OUT->PwDomEnumElementsCB) ?
336  DOMMODEL_OUT->PwDomEnumElementsCB(domain, ndx) : badElement;
337 }
338 
339 
340 PWP_BOOL
342 {
343  return (pCondData && PWGM_HDOMAIN_ISVALID(domain) &&
344  DOMMODEL_OUT->PwDomConditionCB) ?
345  DOMMODEL_OUT->PwDomConditionCB(domain, pCondData) : PWP_FALSE;
346 }
347 
348 
349 PWP_BOOL
351 {
352  return (pVertData && PWGM_HVERTEX_ISVALID(vertex) &&
353  VERTMODEL_OUT->PwVertDataModCB) ?
354  VERTMODEL_OUT->PwVertDataModCB(vertex, pVertData) : PWP_FALSE;
355 }
356 
357 
358 PWP_BOOL
360 {
361  return (pIndex && PWGM_HVERTEX_ISVALID(vertex) &&
362  VERTMODEL_OUT->PwVertIndexModCB) ?
363  VERTMODEL_OUT->PwVertIndexModCB(vertex, pIndex) : PWP_FALSE;
364 }
365 
366 
367 PWP_BOOL
369 {
370  return (pVal && PWGM_HVERTEX_ISVALID(vertex) &&
371  VERTMODEL_OUT->PwVertXyzValCB) ?
372  VERTMODEL_OUT->PwVertXyzValCB(vertex, which, pVal) : PWP_FALSE;
373 }
374 
375 
376 PWP_BOOL
378 {
379  return (pElemData && PWGM_HELEMENT_ISVALID(element) &&
380  ELEMMODEL_OUT->PwElemDataModCB) ?
381  ELEMMODEL_OUT->PwElemDataModCB(element, pElemData) : PWP_FALSE;
382 }
383 
384 
385 PWP_BOOL
387 {
388  return (pEnumElemData && PWGM_HELEMENT_ISVALID(element) &&
389  ELEMMODEL_OUT->PwElemDataModEnumCB) ?
390  ELEMMODEL_OUT->PwElemDataModEnumCB(element, pEnumElemData) : PWP_FALSE;
391 }
392 
393 const char *
395 {
396  const char * ret = "!Invalid";
397  switch (faceOrder) {
398  case PWGM_FACEORDER_DONTCARE: ret = "DontCare"; break;
399  case PWGM_FACEORDER_BOUNDARYFIRST: ret = "BoundaryFirst"; break;
400  case PWGM_FACEORDER_INTERIORFIRST: ret = "InteriorFirst"; break;
401  case PWGM_FACEORDER_BOUNDARYONLY: ret = "BoundaryOnly"; break;
402  case PWGM_FACEORDER_INTERIORONLY: ret = "InteriorOnly"; break;
403  case PWGM_FACEORDER_BCGROUPSFIRST: ret = "BcGroupsFirst"; break;
404  case PWGM_FACEORDER_BCGROUPSLAST: ret = "BcGroupsLast"; break;
405  case PWGM_FACEORDER_BCGROUPSONLY: ret = "BcGroupsOnly"; break;
406  case PWGM_FACEORDER_VCGROUPSBCLAST: ret = "VcGroupsBcLast"; break;
407  case PWGM_FACEORDER_BCGROUPSONLY_BYVC: ret = "BcGroupsOnlyByVc"; break;
408  case PWGM_FACEORDER_SIZE: break; // silence compiler warning
409  }
410  return ret;
411 }
412 
413 
414 const char *
416 {
417  const char * ret = "!Invalid";
418  switch (type) {
419  case PWGM_ELEMTYPE_BAR: ret = "Bar"; break;
420  case PWGM_ELEMTYPE_HEX: ret = "Hex"; break;
421  case PWGM_ELEMTYPE_QUAD: ret = "Quad"; break;
422  case PWGM_ELEMTYPE_TRI: ret = "Tri"; break;
423  case PWGM_ELEMTYPE_TET: ret = "Tet"; break;
424  case PWGM_ELEMTYPE_WEDGE: ret = "Wedge"; break;
425  case PWGM_ELEMTYPE_PYRAMID: ret = "Pyramid"; break;
426  case PWGM_ELEMTYPE_POINT: ret = "Point"; break;
427  case PWGM_ELEMTYPE_SIZE: // silence compiler warning
428  default: break;
429  }
430  return ret;
431 }
432 
433 #endif // !defined(PWGM_HIDE_UNSTRUCTURED_API)
434 
435 
436 
437 //***************************************************************************
438 //***************************************************************************
439 //***************************************************************************
440 //***************************************************************************
441 
442 #if !defined(PWGM_HIDE_STRUCTURED_API)
443 
444 
447 {
448  return (MODEL_OUT && MODEL_OUT->PwModBoundaryCountCB) ?
449  MODEL_OUT->PwModBoundaryCountCB(model) : 0;
450 }
451 
452 
455 {
456  return (MODEL_OUT && MODEL_OUT->PwModEnumBoundariesCB) ?
457  MODEL_OUT->PwModEnumBoundariesCB(model, ndx) : badBoundary;
458 }
459 
460 
463 {
464  return (MODEL_OUT && MODEL_OUT->PwModConnectionCountCB) ?
465  MODEL_OUT->PwModConnectionCountCB(model) : 0;
466 }
467 
468 
471 {
472  return (MODEL_OUT && MODEL_OUT->PwModEnumConnectionsCB) ?
473  MODEL_OUT->PwModEnumConnectionsCB(model, ndx) : badConnection;
474 }
475 
476 
477 PWP_BOOL
479  PWGM_BNDRYDATA *pBndryData)
480 {
481  return (MODEL_OUT && MODEL_OUT->PwModNdxBoundaryCB) ?
482  MODEL_OUT->PwModNdxBoundaryCB(model, ndx, pBndryData) :
483  PWP_FALSE;
484 }
485 
486 
487 PWP_BOOL
489  PWGM_BNDRYDATA *pBndryData, PWGM_CONDDATA *pCondData)
490 {
491  return (MODEL_OUT && MODEL_OUT->PwModNdxBoundaryAndConditionCB &&
492  (pBndryData || pCondData)) ?
493  MODEL_OUT->PwModNdxBoundaryAndConditionCB(model, ndx, pBndryData,
494  pCondData) : PWP_FALSE;
495 }
496 
497 
498 PWP_BOOL
500  PWGM_CNXNDATA *pCnxnData)
501 {
502  return (MODEL_OUT && MODEL_OUT->PwModNdxConnectionCB && pCnxnData) ?
503  MODEL_OUT->PwModNdxConnectionCB(model, ndx, pCnxnData) : PWP_FALSE;
504 }
505 
506 
507 PWP_BOOL
509 {
510  return (BLKMODEL_OUT && BLKMODEL_OUT->PwBlkSizeCB) ?
511  BLKMODEL_OUT->PwBlkSizeCB(block, pSize) : PWP_FALSE;
512 }
513 
514 
515 PWP_BOOL
517 {
518  return (BLKMODEL_OUT && BLKMODEL_OUT->PwBlkNdxVertDataCB) ?
519  BLKMODEL_OUT->PwBlkNdxVertDataCB(block, ndx3, pVertData) : PWP_FALSE;
520 }
521 
522 
523 PWP_BOOL
525  void *data)
526 {
527  return (MODEL_OUT && MODEL_OUT->PwModCustomIndex3SchemeReadyCB) ?
528  MODEL_OUT->PwModCustomIndex3SchemeReadyCB(model, cb, data) : PWP_FALSE;
529 }
530 
531 
534 {
535  return (BLKMODEL_OUT && BLKMODEL_OUT->PwBlkBoundaryCountCB) ?
536  BLKMODEL_OUT->PwBlkBoundaryCountCB(block) : 0;
537 }
538 
539 
542 {
543  return (BLKMODEL_OUT && BLKMODEL_OUT->PwBlkEnumBoundariesCB) ?
544  BLKMODEL_OUT->PwBlkEnumBoundariesCB(block, ndx) : badBoundary;
545 }
546 
547 
550 {
551  return (BLKMODEL_OUT && BLKMODEL_OUT->PwBlkConnectionCountCB) ?
552  BLKMODEL_OUT->PwBlkConnectionCountCB(block) : 0;
553 }
554 
555 
558 {
559  return (BLKMODEL_OUT && BLKMODEL_OUT->PwBlkEnumConnectionsCB) ?
560  BLKMODEL_OUT->PwBlkEnumConnectionsCB(block, ndx) : badConnection;
561 }
562 
563 
564 PWP_BOOL
566 {
567  return (BLKMODEL_OUT && BLKMODEL_OUT->PwBlkNdxBoundaryCB && pBndryData) ?
568  BLKMODEL_OUT->PwBlkNdxBoundaryCB(block, ndx, pBndryData) : PWP_FALSE;
569 }
570 
571 
572 PWP_BOOL
574  PWGM_BNDRYDATA *pBndryData, PWGM_CONDDATA *pCondData)
575 {
576  return (BLKMODEL_OUT && BLKMODEL_OUT->PwBlkNdxBoundaryAndConditionCB &&
577  (pBndryData || pCondData)) ?
578  BLKMODEL_OUT->PwBlkNdxBoundaryAndConditionCB(block, ndx, pBndryData,
579  pCondData) : PWP_FALSE;
580 }
581 
582 
583 PWP_BOOL
585 {
586  return (BLKMODEL_OUT && BLKMODEL_OUT->PwBlkNdxConnectionCB && pCnxnData) ?
587  BLKMODEL_OUT->PwBlkNdxConnectionCB(block, ndx, pCnxnData) : PWP_FALSE;
588 }
589 
590 
591 PWP_BOOL
592 PwBoundary(PWGM_HBNDRY boundary, PWGM_BNDRYDATA *pBndryData)
593 {
594  return (BNDRYMODEL_OUT && BNDRYMODEL_OUT->PwBoundaryCB && pBndryData) ?
595  BNDRYMODEL_OUT->PwBoundaryCB(boundary, pBndryData) : PWP_FALSE;
596 }
597 
598 
599 PWP_BOOL
601 {
602  return (BNDRYMODEL_OUT && BNDRYMODEL_OUT->PwBndryConditionCB) ?
603  BNDRYMODEL_OUT->PwBndryConditionCB(boundary, pCondData) : PWP_FALSE;
604 }
605 
606 
607 PWP_BOOL
608 PwConnection(PWGM_HCNXN connection, PWGM_CNXNDATA *pCnxnData)
609 {
610  return (CNXNMODEL_OUT && CNXNMODEL_OUT->PwConnectionCB && pCnxnData) ?
611  CNXNMODEL_OUT->PwConnectionCB(connection, pCnxnData) : PWP_FALSE;
612 }
613 
614 
615 PWP_BOOL
617 {
618  // XFORM2 XFORM
619  // ------ -------
620  // A B C A B 0 C
621  // D E F ==> D E 0 F
622  // 0 0 1 0
623  PWP_BOOL ret = (pX2 && pX3) ? PWP_TRUE : PWP_FALSE;
624  if (ret) {
625  // row 0
626  pX3->m[0][0] = pX2->m[0][0];
627  pX3->m[0][1] = pX2->m[0][1];
628  pX3->m[0][2] = 0;
629  pX3->m[0][0] = pX2->m[0][2];
630  // row 1
631  pX3->m[1][0] = pX2->m[1][0];
632  pX3->m[1][1] = pX2->m[1][1];
633  pX3->m[1][2] = 0;
634  pX3->m[1][0] = pX2->m[1][2];
635  // row 2
636  pX3->m[2][0] = 0;
637  pX3->m[2][1] = 0;
638  pX3->m[2][2] = 1;
639  pX3->m[2][0] = 0;
640  }
641  return ret;
642 }
643 
644 
645 PWP_BOOL
647 {
648  // XFORM XFORM2
649  // ------- ------
650  // A B C D A B D
651  // E F G H ==> E F H
652  // I J K L
653  PWP_BOOL ret = (pX2 && pX3) ? PWP_TRUE : PWP_FALSE;
654  if (ret) {
655  // row 0
656  pX2->m[0][0] = pX3->m[0][0];
657  pX2->m[0][1] = pX3->m[0][1];
658  pX2->m[0][2] = pX3->m[0][3];
659  // row 1
660  pX2->m[1][0] = pX3->m[1][0];
661  pX2->m[1][1] = pX3->m[1][1];
662  pX2->m[1][2] = pX3->m[1][3];
663  }
664  return ret;
665 }
666 
667 
670 {
671  PWGM_INDEX3 ret;
672  ret.i = pX3->m[0][0] * ijk.i + pX3->m[0][1] * ijk.j + pX3->m[0][2] * ijk.k
673  + pX3->m[0][3];
674  ret.j = pX3->m[1][0] * ijk.i + pX3->m[1][1] * ijk.j + pX3->m[1][2] * ijk.k
675  + pX3->m[1][3];
676  ret.k = pX3->m[2][0] * ijk.i + pX3->m[2][1] * ijk.j + pX3->m[2][2] * ijk.k
677  + pX3->m[2][3];
678  return ret;
679 }
680 
681 
684  PWP_BOOL *pFlipped)
685 {
686  PWGM_ENUM_IJK transformedAxis = PWGM_IJK_SIZE; /* invalid */
687  PWGM_INDEX3 ijk = { 0, 0, 0 };
688  PWGM_INDEX3 ijk2 = { 0, 0, 0 };
689  if (pFlipped) {
690  *pFlipped = PWP_FALSE;
691  }
692  /* construct axis vec for localAxis that will be rotated below */
693  switch (localAxis) {
694  case PWGM_IJK_I: ijk.i = 1; break;
695  case PWGM_IJK_J: ijk.j = 1; break;
696  case PWGM_IJK_K: ijk.k = 1; break;
697  case PWGM_IJK_SIZE: break; // silence compiler warning
698  }
699  /* apply rotation only */
700  ijk2.i = pX3->m[0][0] * ijk.i + pX3->m[0][1] * ijk.j + pX3->m[0][2] * ijk.k;
701  ijk2.j = pX3->m[1][0] * ijk.i + pX3->m[1][1] * ijk.j + pX3->m[1][2] * ijk.k;
702  ijk2.k = pX3->m[2][0] * ijk.i + pX3->m[2][1] * ijk.j + pX3->m[2][2] * ijk.k;
703  /* determine which axis it is in the transformed coord system */
704  if ((0 != ijk2.i) && (0 == ijk2.j) && (0 == ijk2.k)) {
705  transformedAxis = PWGM_IJK_I;
706  if (pFlipped) {
707  *pFlipped = ((1 == ijk2.i) ? PWP_FALSE : PWP_TRUE);
708  }
709  }
710  else if ((0 != ijk2.j) && (0 == ijk2.i) && (0 == ijk2.k)) {
711  transformedAxis = PWGM_IJK_J;
712  if (pFlipped) {
713  *pFlipped = ((1 == ijk2.j) ? PWP_FALSE : PWP_TRUE);
714  }
715  }
716  else if ((0 != ijk2.k) && (0 == ijk2.i) && (0 == ijk2.j)) {
717  transformedAxis = PWGM_IJK_K;
718  if (pFlipped) {
719  *pFlipped = ((1 == ijk2.k) ? PWP_FALSE : PWP_TRUE);
720  }
721  }
722  return transformedAxis;
723 }
724 
725 
728 {
729  PWGM_INDEX3 ret;
730  ret.i = pX2->m[0][0] * ijk.i + pX2->m[0][1] * ijk.j + pX2->m[0][2];
731  ret.j = pX2->m[1][0] * ijk.i + pX2->m[1][1] * ijk.j + pX2->m[1][2];
732  ret.k = ijk.k;
733  return ret;
734 }
735 
736 
739  PWP_BOOL *pFlipped)
740 {
741  PWGM_ENUM_IJK ret = PWGM_IJK_SIZE;
742  PWGM_INDEX_XFORM x3;
743  if (PwXform2to3(pX2, &x3)) {
744  ret = PwXformFollows(&x3, localAxis, pFlipped);
745  }
746  return ret;
747 }
748 
749 
750 PWP_BOOL
752 {
753  return (ijk.i >= pRange->beg.i) && (ijk.i <= pRange->end.i) &&
754  (ijk.j >= pRange->beg.j) && (ijk.j <= pRange->end.j) &&
755  (ijk.k >= pRange->beg.k) && (ijk.k <= pRange->end.k);
756 }
757 
758 #endif // !defined(PWGM_HIDE_STRUCTURED_API)
759 
760 
761 
762 //***************************************************************************
763 //***************************************************************************
764 //***************************************************************************
765 //***************************************************************************
766 
767 #if !defined(PWGM_HIDE_IMPORT_API)
768 
771 {
772  return (MODEL_IN && MODEL_IN->PwModCreateConCB) ?
773  MODEL_IN->PwModCreateConCB(model, size) : badConnector;
774 }
775 
776 
779 {
780  return (BLKMODEL_IN && BLKMODEL_IN->PwBlkGetVertexListCB) ?
781  BLKMODEL_IN->PwBlkGetVertexListCB(block) : badVertexList;
782 }
783 
784 
787 {
788  return (DOMMODEL_IN && DOMMODEL_IN->PwDomGetVertexListCB) ?
789  DOMMODEL_IN->PwDomGetVertexListCB(domain) : badVertexList;
790 }
791 
792 
795 {
796  return (CONMODEL_IN && CONMODEL_IN->PwConGetVertexListCB) ?
797  CONMODEL_IN->PwConGetVertexListCB(connector) : badVertexList;
798 }
799 
800 
801 PWP_BOOL
802 PwConSetName(PWGM_HCONNECTOR connector, const char *name)
803 {
804  return (CONMODEL_IN && CONMODEL_IN->PwConSetNameCB) ?
805  CONMODEL_IN->PwConSetNameCB(connector, name) : PWP_FALSE;
806 }
807 
808 
809 PWP_BOOL
810 PwBlkSetName(PWGM_HBLOCK block, const char *name)
811 {
812  return (BLKMODEL_IN && BLKMODEL_IN->PwBlkSetNameCB) ?
813  BLKMODEL_IN->PwBlkSetNameCB(block, name) : PWP_FALSE;
814 }
815 
816 
817 PWP_BOOL
818 PwDomSetName(PWGM_HDOMAIN domain, const char *name)
819 {
820  return (DOMMODEL_IN && DOMMODEL_IN->PwDomSetNameCB) ?
821  DOMMODEL_IN->PwDomSetNameCB(domain, name) : PWP_FALSE;
822 }
823 
824 
825 PWP_BOOL
827 {
828  return (VLISTMODEL_IN && VLISTMODEL_IN->PwVlstIsUnstructuredCB) ?
829  VLISTMODEL_IN->PwVlstIsUnstructuredCB(vertlist) : PWP_FALSE;
830 }
831 
832 
833 PWP_BOOL
835 {
836  return (VLISTMODEL_IN && VLISTMODEL_IN->PwVlstIsUnstructuredCB) ?
837  !VLISTMODEL_IN->PwVlstIsUnstructuredCB(vertlist) : PWP_FALSE;
838 }
839 
840 
841 PWP_UINT
843 {
844  return (VLISTMODEL_IN && VLISTMODEL_IN->PwVlstGetIndexDimensionalityCB) ?
845  VLISTMODEL_IN->PwVlstGetIndexDimensionalityCB(vertlist) : 0;
846 }
847 
848 
851 {
852  return (VLISTMODEL_IN && VLISTMODEL_IN->PwVlstGetBlkElemDimensionalityCB) ?
853  VLISTMODEL_IN->PwVlstGetBlkElemDimensionalityCB(vertlist) :
854  PWP_DIMENSION_SIZE;
855 }
856 
857 
858 PWP_BOOL
860  const PWGM_ENUM_XYZ which, const PWGM_XYZVAL val)
861 {
862  const PWGM_INDEX3 ndx3 = { PWP_INT32(ndx), 0, 0 };
863  return (VLISTMODEL_IN && VLISTMODEL_IN->PwVlstSetXYZVal3CB) ?
864  VLISTMODEL_IN->PwVlstSetXYZVal3CB(vertlist, ndx3, which, val) :
865  PWP_FALSE;
866 }
867 
868 
869 PWP_BOOL
870 PwVlstSetXYZ(PWGM_HVERTEXLIST vertlist, const PWP_UINT ndx, const PWGM_XYZVAL x,
871  const PWGM_XYZVAL y, const PWGM_XYZVAL z)
872 {
873  const PWGM_INDEX3 ndx3 = { PWP_INT32(ndx), 0, 0 };
874  return (VLISTMODEL_IN && VLISTMODEL_IN->PwVlstSetXYZ3CB) ?
875  VLISTMODEL_IN->PwVlstSetXYZ3CB(vertlist, ndx3, x, y, z) : PWP_FALSE;
876 }
877 
878 
879 PWP_BOOL
881  const PWGM_VERTDATA &v)
882 {
883  const PWGM_INDEX3 ndx3 = { PWP_INT32(ndx), 0, 0 };
884  return (VLISTMODEL_IN && VLISTMODEL_IN->PwVlstSetXYZ3CB) ?
885  VLISTMODEL_IN->PwVlstSetXYZ3CB(vertlist, ndx3, v.x, v.y, v.z) :
886  PWP_FALSE;
887 }
888 
889 
890 PWP_BOOL
892  const PWGM_ENUM_XYZ which, const PWGM_XYZVAL val)
893 {
894  const PWGM_INDEX3 ndx3 = { ndx2.i, ndx2.j, 0 };
895  return (VLISTMODEL_IN && VLISTMODEL_IN->PwVlstSetXYZVal3CB) ?
896  VLISTMODEL_IN->PwVlstSetXYZVal3CB(vertlist, ndx3, which, val) :
897  PWP_FALSE;
898 }
899 
900 
901 PWP_BOOL
903  const PWGM_XYZVAL x, const PWGM_XYZVAL y, const PWGM_XYZVAL z)
904 {
905  const PWGM_INDEX3 ndx3 = { ndx2.i, ndx2.j, 0 };
906  return (VLISTMODEL_IN && VLISTMODEL_IN->PwVlstSetXYZ3CB) ?
907  VLISTMODEL_IN->PwVlstSetXYZ3CB(vertlist, ndx3, x, y, z) : PWP_FALSE;
908 }
909 
910 
911 PWP_BOOL
913  const PWGM_VERTDATA &v)
914 {
915  const PWGM_INDEX3 ndx3 = { ndx2.i, ndx2.j, 0 };
916  return (VLISTMODEL_IN && VLISTMODEL_IN->PwVlstSetXYZ3CB) ?
917  VLISTMODEL_IN->PwVlstSetXYZ3CB(vertlist, ndx3, v.x, v.y, v.z) :
918  PWP_FALSE;
919 }
920 
921 
922 PWP_BOOL
924  const PWGM_ENUM_XYZ which, const PWGM_XYZVAL val)
925 {
926  return (VLISTMODEL_IN && VLISTMODEL_IN->PwVlstSetXYZVal3CB) ?
927  VLISTMODEL_IN->PwVlstSetXYZVal3CB(vertlist, ndx3, which, val) :
928  PWP_FALSE;
929 }
930 
931 
932 PWP_BOOL
934  const PWGM_XYZVAL x, const PWGM_XYZVAL y, const PWGM_XYZVAL z)
935 {
936  return (VLISTMODEL_IN && VLISTMODEL_IN->PwVlstSetXYZ3CB) ?
937  VLISTMODEL_IN->PwVlstSetXYZ3CB(vertlist, ndx3, x, y, z) : PWP_FALSE;
938 }
939 
940 
941 PWP_BOOL
943  const PWGM_VERTDATA &v)
944 {
945  return (VLISTMODEL_IN && VLISTMODEL_IN->PwVlstSetXYZ3CB) ?
946  VLISTMODEL_IN->PwVlstSetXYZ3CB(vertlist, ndx3, v.x, v.y, v.z) :
947  PWP_FALSE;
948 }
949 
950 
951 PWP_BOOL
952 PwBlkSetProperty(PWGM_HBLOCK block, const char *key, const char *val)
953 {
954  return (BLKMODEL_IN && BLKMODEL_IN->PwBlkSetPropertyCB) ?
955  BLKMODEL_IN->PwBlkSetPropertyCB(block, key, val) : PWP_FALSE;
956 }
957 
958 
959 PWP_BOOL
960 PwDomSetProperty(PWGM_HDOMAIN domain, const char *key, const char *val)
961 {
962  return (DOMMODEL_IN && DOMMODEL_IN->PwDomSetPropertyCB) ?
963  DOMMODEL_IN->PwDomSetPropertyCB(domain, key, val) : PWP_FALSE;
964 }
965 
966 
967 PWP_BOOL
968 PwConSetProperty(PWGM_HCONNECTOR connector, const char *key, const char *val)
969 {
970  return (CONMODEL_IN && CONMODEL_IN->PwConSetPropertyCB) ?
971  CONMODEL_IN->PwConSetPropertyCB(connector, key, val) : PWP_FALSE;
972 }
973 
974 
975 PWP_BOOL
977  const char *key, const char *val)
978 {
979  return (BLKASMMODEL_IN && BLKASMMODEL_IN->PwAsmSetPropertyCB) ?
980  BLKASMMODEL_IN->PwAsmSetPropertyCB(blkAsm, propertySetId, key, val) :
981  PWP_FALSE;
982 }
983 
984 
985 PWP_BOOL
986 PwBlkSetConditionUserName(PWGM_HBLOCK block, const char *userName)
987 {
988  return PwBlkSetProperty(block, PropUserName, userName);
989 }
990 
991 
992 PWP_BOOL
994 {
995  std::ostringstream oss;
996  oss << userId;
997  return PwBlkSetProperty(block, PropUserId, oss.str().c_str());
998 }
999 
1000 
1001 PWP_BOOL
1002 PwBlkSetConditionTypeName(PWGM_HBLOCK block, const char *typeName)
1003 {
1004  return PwBlkSetProperty(block, PropTypeName, typeName);
1005 }
1006 
1007 
1008 PWP_BOOL
1010 {
1011  std::ostringstream oss;
1012  oss << typeId;
1013  return PwBlkSetProperty(block, PropTypeId, oss.str().c_str());
1014 }
1015 
1016 
1017 PWP_BOOL
1019 {
1020  const bool ret = PwBlkSetConditionUserName(block, condData.name) &&
1021  PwBlkSetConditionUserId(block, condData.id) &&
1022  PwBlkSetConditionTypeName(block, condData.type) &&
1023  PwBlkSetConditionTypeId(block, condData.tid);
1024  return PWP_CAST_BOOL(ret);
1025 }
1026 
1027 
1028 PWP_BOOL
1029 PwDomSetConditionUserName(PWGM_HDOMAIN domain, const char *userName)
1030 {
1031  return PwDomSetProperty(domain, PropUserName, userName);
1032 }
1033 
1034 
1035 PWP_BOOL
1037 {
1038  std::ostringstream oss;
1039  oss << userId;
1040  return PwDomSetProperty(domain, PropUserId, oss.str().c_str());
1041 }
1042 
1043 
1044 PWP_BOOL
1045 PwDomSetConditionTypeName(PWGM_HDOMAIN domain, const char *typeName)
1046 {
1047  return PwDomSetProperty(domain, PropTypeName, typeName);
1048 }
1049 
1050 
1051 PWP_BOOL
1053 {
1054  std::ostringstream oss;
1055  oss << typeId;
1056  return PwDomSetProperty(domain, PropTypeId, oss.str().c_str());
1057 }
1058 
1059 
1060 PWP_BOOL
1062 {
1063  const bool ret = PwDomSetConditionUserName(domain, condData.name) &&
1064  PwDomSetConditionUserId(domain, condData.id) &&
1065  PwDomSetConditionTypeName(domain, condData.type) &&
1066  PwDomSetConditionTypeId(domain, condData.tid);
1067  return PWP_CAST_BOOL(ret);
1068 }
1069 
1070 
1071 PWP_BOOL
1072 PwConSetConditionUserName(PWGM_HCONNECTOR connector, const char *userName)
1073 {
1074  return PwConSetProperty(connector, PropUserName, userName);
1075 }
1076 
1077 
1078 PWP_BOOL
1080 {
1081  std::ostringstream oss;
1082  oss << userId;
1083  return PwConSetProperty(connector, PropUserId, oss.str().c_str());
1084 }
1085 
1086 
1087 PWP_BOOL
1088 PwConSetConditionTypeName(PWGM_HCONNECTOR connector, const char *typeName)
1089 {
1090  return PwConSetProperty(connector, PropTypeName, typeName);
1091 }
1092 
1093 
1094 PWP_BOOL
1096 {
1097  std::ostringstream oss;
1098  oss << typeId;
1099  return PwConSetProperty(connector, PropTypeId, oss.str().c_str());
1100 }
1101 
1102 
1103 PWP_BOOL
1105 {
1106  const bool ret = PwConSetConditionUserName(connector, condData.name) &&
1107  PwConSetConditionUserId(connector, condData.id) &&
1108  PwConSetConditionTypeName(connector, condData.type) &&
1109  PwConSetConditionTypeId(connector, condData.tid);
1110  return PWP_CAST_BOOL(ret);
1111 }
1112 
1113 
1114 PWP_BOOL
1116  const char *userName)
1117 {
1118  return PwAsmSetProperty(h, (PWP_UINT32)key, PropUserName, userName);
1119 }
1120 
1121 
1122 PWP_BOOL
1124  const PWP_UINT32 userId)
1125 {
1126  std::ostringstream oss;
1127  oss << userId;
1128  return PwAsmSetProperty(h, (PWP_UINT32)key, PropUserId, oss.str().c_str());
1129 }
1130 
1131 
1132 PWP_BOOL
1134  const char *typeName)
1135 {
1136  return PwAsmSetProperty(h, (PWP_UINT32)key, PropTypeName, typeName);
1137 }
1138 
1139 
1140 PWP_BOOL
1142  const PWP_UINT32 typeId)
1143 {
1144  std::ostringstream oss;
1145  oss << typeId;
1146  return PwAsmSetProperty(h, (PWP_UINT32)key, PropTypeId, oss.str().c_str());
1147 }
1148 
1149 
1150 PWP_BOOL
1152  const PWGM_CONDDATA &condData)
1153 {
1154  const bool ret = PwAsmSetConditionUserName(h, key, condData.name) &&
1155  PwAsmSetConditionUserId(h, key, condData.id) &&
1156  PwAsmSetConditionTypeName(h, key, condData.type) &&
1157  PwAsmSetConditionTypeId(h, key, condData.tid);
1158  return PWP_CAST_BOOL(ret);
1159 }
1160 
1161 
1162 PWP_BOOL
1164  const PWGM_CONDKEY key, const PWP_UINT32 startCell,
1165  const PWP_UINT32 endCell)
1166 {
1167  return (BLKASMMODEL_IN && BLKASMMODEL_IN->PwAsmSetCellSpanConditionKeyCB) ?
1168  BLKASMMODEL_IN->PwAsmSetCellSpanConditionKeyCB(blkAsm, key, startCell, endCell) :
1169  PWP_FALSE;
1170 }
1171 
1172 
1173 PWP_BOOL
1175  const PWP_UINT32 cell)
1176 {
1177  return PwAsmSetCellSpanConditionKey(assembler, key, cell, cell);
1178 }
1179 
1180 
1181 PWP_BOOL
1182 PwVlstReadFile(PWGM_HVERTEXLIST vertlist, FILE *file,
1183  const PWGM_XYZ_CLUSTERING fileClustering,
1184  const PWP_ENDIANNESS fileByteOrder, const PWP_ENUM_PRECISION filePrecision)
1185 {
1186  return (VLISTMODEL_IN && VLISTMODEL_IN->PwVlstReadFileCB) ?
1187  VLISTMODEL_IN->PwVlstReadFileCB(vertlist, file, fileClustering,
1188  fileByteOrder, filePrecision) : PWP_FALSE;
1189 }
1190 
1191 
1194  const PWP_ENUM_DIMENSION blkElemDimty)
1195 {
1196  return (MODEL_IN && MODEL_IN->PwModCreateUnsVertexListCB) ?
1197  MODEL_IN->PwModCreateUnsVertexListCB(model, blkElemDimty) :
1198  badVertexList;
1199 }
1200 
1201 
1204 {
1206 }
1207 
1208 
1211 {
1213 }
1214 
1215 
1216 PWP_BOOL
1218 {
1219  return VLISTMODEL_IN && VLISTMODEL_IN->PwVlstAllocateCB &&
1220  VLISTMODEL_IN->PwVlstAllocateCB(vertlist, n);
1221 }
1222 
1223 
1226 {
1227  return (VLISTMODEL_IN && VLISTMODEL_IN->PwVlstCreateUnsBlockCB) ?
1228  VLISTMODEL_IN->PwVlstCreateUnsBlockCB(vertlist) : badBlock;
1229 }
1230 
1231 
1232 PWP_BOOL
1234  const PWP_UINT count)
1235 {
1236  return (BLKMODEL_IN && BLKMODEL_IN->PwUnsBlkAllocateElementsCB) ?
1237  BLKMODEL_IN->PwUnsBlkAllocateElementsCB(block, cellType, count) :
1238  PWP_FALSE;
1239 }
1240 
1241 
1242 PWP_BOOL
1244 {
1246  PwBlkGetVertexList(block))) {
1247  // only assign 3-D block element counts
1249  PWGM_ECNT_Hex(counts)) &&
1251  PWGM_ECNT_Pyramid(counts)) &&
1253  PWGM_ECNT_Tet(counts)) &&
1255  PWGM_ECNT_Wedge(counts));
1256  }
1257  // only assign 2-D block element counts
1259  PWGM_ECNT_Quad(counts)) &&
1261  PWGM_ECNT_Tri(counts));
1262 }
1263 
1264 
1265 PWP_BOOL
1267  const PWGM_ELEMDATA *eData)
1268 {
1269  return (BLKMODEL_IN && BLKMODEL_IN->PwUnsBlkSetElementCB) ?
1270  BLKMODEL_IN->PwUnsBlkSetElementCB(block, ndx, eData) : PWP_FALSE;
1271 }
1272 
1273 
1276 {
1277  return (VLISTMODEL_IN && VLISTMODEL_IN->PwVlstCreateUnsDomainCB) ?
1278  VLISTMODEL_IN->PwVlstCreateUnsDomainCB(vertlist) : badDomain;
1279 }
1280 
1281 
1284 {
1285  PWGM_HDOMAIN hDom = PwVlstCreateUnsDomain(vertlist);
1286  if (!PwDomSetProperty(hDom, PropSubType, SubTypeBoundary)) {
1287  // not good
1288  hDom = PWGM_HDOMAIN_INIT;
1289  }
1290  return hDom;
1291 }
1292 
1293 
1294 PWP_BOOL
1296  const PWP_UINT n)
1297 {
1298  return (DOMMODEL_IN && DOMMODEL_IN->PwUnsDomAllocateElementsCB) ?
1299  DOMMODEL_IN->PwUnsDomAllocateElementsCB(domain, cellType, n): PWP_FALSE;
1300 }
1301 
1302 
1303 PWP_BOOL
1305 {
1307  PWGM_ECNT_Tri(counts)) &&
1309  PWGM_ECNT_Quad(counts));
1310 }
1311 
1312 
1313 PWP_BOOL
1315  const PWGM_ELEMDATA *eData)
1316 {
1317  return (DOMMODEL_IN && DOMMODEL_IN->PwUnsDomSetElementCB) ?
1318  DOMMODEL_IN->PwUnsDomSetElementCB(domain, ndx, eData) : PWP_FALSE;
1319 }
1320 
1321 
1324 {
1325  return (VLISTMODEL_IN && VLISTMODEL_IN->PwVlstCreateBlockAssemblerCB) ?
1326  VLISTMODEL_IN->PwVlstCreateBlockAssemblerCB(vertlist) : badAssembler;
1327 }
1328 
1329 
1330 PWP_BOOL
1332  const PWGM_ASSEMBLER_DATA *face)
1333 {
1334  return (BLKASMMODEL_IN && BLKASMMODEL_IN->PwAsmPushElementFaceCB) ?
1335  BLKASMMODEL_IN->PwAsmPushElementFaceCB(blkAsm, face) : PWP_FALSE;
1336 }
1337 
1338 
1339 PWP_BOOL
1341 {
1342  return (BLKASMMODEL_IN && BLKASMMODEL_IN->PwAsmFinalizeCB) ?
1343  BLKASMMODEL_IN->PwAsmFinalizeCB(blkAsm) : PWP_FALSE;
1344 }
1345 
1346 
1349 {
1350  return (BLKASMMODEL_IN && BLKASMMODEL_IN->PwAsmGetVertexListCB) ?
1351  BLKASMMODEL_IN->PwAsmGetVertexListCB(blkAsm) : badVertexList;
1352 }
1353 
1354 
1357 {
1358  return (MODEL_IN && MODEL_IN->PwModCreateStrBlockCB) ?
1359  MODEL_IN->PwModCreateStrBlockCB(model, blkSize) : badBlock;
1360 }
1361 
1362 
1365 {
1366  return (MODEL_IN && MODEL_IN->PwModCreateStrDomainCB) ?
1367  MODEL_IN->PwModCreateStrDomainCB(model, domSize) : badDomain;
1368 }
1369 
1370 #endif // !defined(PWGM_HIDE_IMPORT_API)
faceCB
static PWP_UINT32 faceCB(PWGM_FACESTREAM_DATA *data)
Definition: CaeUnsGridModel.cxx:58
PWGM_INDEX3::j
PWP_INT32 j
j-coordinate used for 3D and 2D grids
Definition: apiGridModel.h:861
PWP_VALTYPE_STRING
@ PWP_VALTYPE_STRING
transfer value is a const char*
Definition: apiPWP.h:697
PwAsmSetCellConditionKey
PWP_BOOL PwAsmSetCellConditionKey(PWGM_HBLOCKASSEMBLER assembler, const PWGM_CONDKEY key, const PWP_UINT32 cell)
Tags a single cells with the condition identified by key.
Definition: apiGridModel.cxx:1174
PwVlstCreateUnsBlock
PWGM_HBLOCK PwVlstCreateUnsBlock(PWGM_HVERTEXLIST vertlist)
Creates an unstructured block that uses vertices from an unstructured vertex list.
Definition: apiGridModel.cxx:1225
PWGM_HELEMENT
Grid element handle declaration.
Definition: apiGridModel.h:427
PWGM_FACEORDER_BCGROUPSONLY
@ PWGM_FACEORDER_BCGROUPSONLY
BoundaryOnly grouped by BCs.
Definition: apiGridModel.h:1038
PwBlkNdxVertData
PWP_BOOL PwBlkNdxVertData(PWGM_HBLOCK block, PWGM_INDEX3 ndx3, PWGM_VERTDATA *pVertData)
Get the block's vertex data at the given index location.
Definition: apiGridModel.cxx:516
PwElemDataModEnum
PWP_BOOL PwElemDataModEnum(PWGM_HELEMENT element, PWGM_ENUMELEMDATA *pEnumElemData)
Get the enumerated element data relative to the model's index space.
Definition: apiGridModel.cxx:386
PWGM_HBLOCKASSEMBLER
An opaque handle to an unstructured block assembler.
Definition: apiGridModel.h:566
PwVlstCreateUnsBoundary
PWGM_HDOMAIN PwVlstCreateUnsBoundary(PWGM_HVERTEXLIST vertlist)
Definition: apiGridModel.cxx:1283
PwModNdxBoundary
PWP_BOOL PwModNdxBoundary(PWGM_HGRIDMODEL model, PWP_UINT32 ndx, PWGM_BNDRYDATA *pBndryData)
Get the data for the model's nth structured boundary.
Definition: apiGridModel.cxx:478
PwModEnumVertices
PWGM_HVERTEX PwModEnumVertices(PWGM_HGRIDMODEL model, PWP_UINT32 ndx)
Sequentially enumerate the model vertex elements.
Definition: apiGridModel.cxx:242
PwVertIndexMod
PWP_BOOL PwVertIndexMod(PWGM_HVERTEX vertex, PWP_UINT32 *pIndex)
Get the vertex index relative to the model's index space.
Definition: apiGridModel.cxx:359
PwModCreateUnsVertexList2
PWGM_HVERTEXLIST PwModCreateUnsVertexList2(PWGM_HGRIDMODEL model)
Creates an empty, unstructured vertex list in a model for 2-D blocks and 1-D domains.
Definition: apiGridModel.cxx:1210
PwDomElementCount
PWP_UINT32 PwDomElementCount(PWGM_HDOMAIN domain, PWGM_ELEMCOUNTS *pCounts)
Get the number of domain elements.
Definition: apiGridModel.cxx:325
PwVlstSetXYZ2
PWP_BOOL PwVlstSetXYZ2(PWGM_HVERTEXLIST vertlist, const PWGM_INDEX2 ndx2, const PWGM_XYZVAL x, const PWGM_XYZVAL y, const PWGM_XYZVAL z)
Set the XYZ of a point in a 2D structured vertex list.
Definition: apiGridModel.cxx:902
PwFaceOrderToText
const char * PwFaceOrderToText(PWGM_ENUM_FACEORDER faceOrder)
Maps a PWGM_ENUM_FACEORDER value to a human readable string.
Definition: apiGridModel.cxx:394
PwVlstSetXYZ2Data
PWP_BOOL PwVlstSetXYZ2Data(PWGM_HVERTEXLIST vertlist, const PWGM_INDEX2 ndx2, const PWGM_VERTDATA &v)
Set the XYZ of a point in a 2D structured vertex list using a PWGM_VERTDATA value.
Definition: apiGridModel.cxx:912
PwModEnumDomains
PWGM_HDOMAIN PwModEnumDomains(PWGM_HGRIDMODEL model, PWP_UINT32 ndx)
Sequentially enumerate the model domain elements.
Definition: apiGridModel.cxx:234
PWP_DIMENSION_3D
@ PWP_DIMENSION_3D
Definition: apiPWP.h:765
PwXform2Follows
PWGM_ENUM_IJK PwXform2Follows(const PWGM_INDEX_XFORM2 *pX2, PWGM_ENUM_IJK localAxis, PWP_BOOL *pFlipped)
For a given localAxis, determine the corresponding axis in the transformed system.
Definition: apiGridModel.cxx:738
PwVlstSetXYZVal2
PWP_BOOL PwVlstSetXYZVal2(PWGM_HVERTEXLIST vertlist, const PWGM_INDEX2 ndx2, const PWGM_ENUM_XYZ which, const PWGM_XYZVAL val)
Set an XYZ component of a point in a 2D structured vertex list.
Definition: apiGridModel.cxx:891
PWP_ENUM_VALTYPE
PWP_ENUM_VALTYPE
Supported PWP-API getValue() transfer types.
Definition: apiPWP.h:696
PWGM_ELEMTYPE_TET
@ PWGM_ELEMTYPE_TET
3D, 4-sided (tetrahedral) grid element
Definition: apiGridModel.h:677
PwConSetConditionUserId
PWP_BOOL PwConSetConditionUserId(PWGM_HCONNECTOR connector, const PWP_UINT32 userId)
Sets the condition data for a connector.
Definition: apiGridModel.cxx:1079
PWGM_FACEORDER_VCGROUPSBCLAST
@ PWGM_FACEORDER_VCGROUPSBCLAST
InteriorFirst grouped by VCs then BCs.
Definition: apiGridModel.h:1039
PWP_UINT32
unsigned int PWP_UINT32
32-bit unsigned integer
Definition: apiPWP.h:210
PwModNdxBoundaryAndCondition
PWP_BOOL PwModNdxBoundaryAndCondition(PWGM_HGRIDMODEL model, PWP_UINT32 ndx, PWGM_BNDRYDATA *pBndryData, PWGM_CONDDATA *pCondData)
Get the PWGM_BNDRYDATA and PWGM_CONDDATA for the model's nth structured boundary.
Definition: apiGridModel.cxx:488
PWGM_FACESTREAMCB
PWP_UINT32(* PWGM_FACESTREAMCB)(PWGM_FACESTREAM_DATA *data)
The face stream callback function signature.
Definition: apiGridModel.h:1136
PWGM_IJK_J
@ PWGM_IJK_J
J-component id.
Definition: apiGridModel.h:988
PwBlkSetName
PWP_BOOL PwBlkSetName(PWGM_HBLOCK block, const char *name)
Set a block's name.
Definition: apiGridModel.cxx:810
PwModVertexCount
PWP_UINT32 PwModVertexCount(PWGM_HGRIDMODEL model)
Get the number of model vertex elements.
Definition: apiGridModel.cxx:250
PwUnsDomAllocateElementCounts
PWP_BOOL PwUnsDomAllocateElementCounts(PWGM_HDOMAIN domain, const PWGM_ELEMCOUNTS &counts)
Allocates element storage in an unstructured domain.
Definition: apiGridModel.cxx:1304
PWGM_FACEORDER_BOUNDARYFIRST
@ PWGM_FACEORDER_BOUNDARYFIRST
all cell faces in boundary, interior order
Definition: apiGridModel.h:1032
PwVlstSetXYZ3Data
PWP_BOOL PwVlstSetXYZ3Data(PWGM_HVERTEXLIST vertlist, const PWGM_INDEX3 ndx3, const PWGM_VERTDATA &v)
Set the XYZ of a point in a 3D structured vertex list using a PWGM_VERTDATA value.
Definition: apiGridModel.cxx:942
PwModDomainCount
PWP_UINT32 PwModDomainCount(PWGM_HGRIDMODEL model)
Get the number of domain elements in the model.
Definition: apiGridModel.cxx:226
PWGM_CONDDATA::id
PWP_UINT32 id
grid-defined condition id
Definition: apiGridModel.h:646
PWGM_HDOMAIN
An opaque handle to a grid domain element.
Definition: apiGridModel.h:372
PWGM_CONDDATA::tid
PWP_UINT32 tid
cae-defined condition id
Definition: apiGridModel.h:648
PwBlock
PWP_BOOL PwBlock(PWGM_HBLOCK block, PWGM_BLOCKDATA *pBlockData)
Get the block data.
Definition: apiGridModel.cxx:108
PwDomSetConditionUserId
PWP_BOOL PwDomSetConditionUserId(PWGM_HDOMAIN domain, const PWP_UINT32 userId)
Sets the condition data for a domain.
Definition: apiGridModel.cxx:1036
PwModCreateStrBlock
PWGM_HBLOCK PwModCreateStrBlock(PWGM_HGRIDMODEL model, const PWGM_STR_SIZE blkSize)
Creates a structured block in a model.
Definition: apiGridModel.cxx:1356
PwBlkEnumElements
PWGM_HELEMENT PwBlkEnumElements(PWGM_HBLOCK block, PWP_UINT32 ndx)
Sequentially enumerate the block elements.
Definition: apiGridModel.cxx:317
PwModEnumElementCount
PWP_UINT32 PwModEnumElementCount(PWGM_HGRIDMODEL model, PWGM_ELEMCOUNTS *pCounts)
Get the number of enumerated model block elements.
Definition: apiGridModel.cxx:277
PwDomSetConditionTypeId
PWP_BOOL PwDomSetConditionTypeId(PWGM_HDOMAIN domain, const PWP_UINT32 typeId)
Sets the condition data for a domain.
Definition: apiGridModel.cxx:1052
PWGM_FACEORDER_DONTCARE
@ PWGM_FACEORDER_DONTCARE
all cell faces in any order
Definition: apiGridModel.h:1031
PWGM_INDEXMAPPERCB
PWP_UINT64(* PWGM_INDEXMAPPERCB)(const PWP_UINT64 pwgmNdx, void *data)
The custom, unstructured IndexScheme mapper callback function signature.
Definition: apiGridModel.h:1196
PWGM_CONDDATA::name
const char * name
grid-defined condition name
Definition: apiGridModel.h:645
PWP_INT32
int PWP_INT32
32-bit integer
Definition: apiPWP.h:207
PWGM_VERTDATA::x
PWGM_XYZVAL x
x-component
Definition: apiGridModel.h:608
PwBlkSize
PWP_BOOL PwBlkSize(PWGM_HBLOCK block, PWGM_STR_SIZE *pSize)
Get the block's vertex-size.
Definition: apiGridModel.cxx:508
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:1295
PWGM_HGRIDMODEL
An opaque handle to a grid model.
Definition: apiGridModel.h:326
PwBlkNdxBoundary
PWP_BOOL PwBlkNdxBoundary(PWGM_HBLOCK block, PWP_UINT32 ndx, PWGM_BNDRYDATA *pBndryData)
Get the data for the block's nth structured boundary.
Definition: apiGridModel.cxx:565
PWP_VOID
void PWP_VOID
no value
Definition: apiPWP.h:317
ASSERT_COMPILE
ASSERT_COMPILE(sizeof(PWGM_ASSEMBLER_DATA)<=sizeof(PWP_UINT32) *8)
PwAsmPushElementFace
PWP_BOOL PwAsmPushElementFace(PWGM_HBLOCKASSEMBLER blkAsm, const PWGM_ASSEMBLER_DATA *face)
Adds a face to an unstructured block face assembler.
Definition: apiGridModel.cxx:1331
PWGM_ENDSTREAMCB
PWP_UINT32(* PWGM_ENDSTREAMCB)(PWGM_ENDSTREAM_DATA *data)
The face stream callback function signature.
Definition: apiGridModel.h:1152
PWGM_FACEORDER_BCGROUPSONLY_BYVC
@ PWGM_FACEORDER_BCGROUPSONLY_BYVC
BoundariesOnly grouped by VCs.
Definition: apiGridModel.h:1040
PWP_UINT
PWP_UINT32 PWP_UINT
unsigned integer same size as void*
Definition: apiPWP.h:285
PwModDefaultEnumElementOrder
PWP_VOID PwModDefaultEnumElementOrder(PWGM_HGRIDMODEL model)
Reset the enumElements() ordering sequence to the default (none).
Definition: apiGridModel.cxx:301
PwBndryCondition
PWP_BOOL PwBndryCondition(PWGM_HBNDRY boundary, PWGM_CONDDATA *pCondData)
Get the boundary's condition data.
Definition: apiGridModel.cxx:600
PwAsmSetConditionTypeName
PWP_BOOL PwAsmSetConditionTypeName(PWGM_HBLOCKASSEMBLER h, const PWGM_CONDKEY key, const char *typeName)
Sets the type name of the condition identified by key.
Definition: apiGridModel.cxx:1133
PwConSetName
PWP_BOOL PwConSetName(PWGM_HCONNECTOR connector, const char *name)
Set a connector's name.
Definition: apiGridModel.cxx:802
PWGM_HCNXN
An opaque handle to a structured, inter-block connection.
Definition: apiGridModel.h:482
PWP_DIMENSION_2D
@ PWP_DIMENSION_2D
Definition: apiPWP.h:764
PwModGetAttributeUINT32
PWP_BOOL PwModGetAttributeUINT32(PWGM_HGRIDMODEL model, const char *name, PWP_UINT32 *val)
Definition: apiGridModel.cxx:152
PwModGetAttributeFLOAT
PWP_BOOL PwModGetAttributeFLOAT(PWGM_HGRIDMODEL model, const char *name, PWP_FLOAT *val)
Definition: apiGridModel.cxx:194
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:1340
PwXform3to2
PWP_BOOL PwXform3to2(const PWGM_INDEX_XFORM *pX3, PWGM_INDEX_XFORM2 *pX2)
Convert a 3D transform matrix to it's 2D equivalent.
Definition: apiGridModel.cxx:646
PWGM_INDEX_XFORM2::m
PWP_INT32 m[2][3]
m[row][col]
Definition: apiGridModel.h:904
PWGM_CONDKEY
PWP_UINT32 PWGM_CONDKEY
The condition key integral type.
Definition: apiGridModel.h:1160
PwDomSetConditionUserName
PWP_BOOL PwDomSetConditionUserName(PWGM_HDOMAIN domain, const char *userName)
Sets the condition name for a domain.
Definition: apiGridModel.cxx:1029
PWGM_CONDDATA::type
const char * type
cae-defined condition physical type name
Definition: apiGridModel.h:647
endCB
static PWP_UINT32 endCB(PWGM_ENDSTREAM_DATA *data)
Definition: CaeUnsGridModel.cxx:65
PwModEnumConnections
PWGM_HCNXN PwModEnumConnections(PWGM_HGRIDMODEL model, PWP_UINT32 ndx)
Sequentially enumerate the model's connections.
Definition: apiGridModel.cxx:470
apiGridModel.h
Pointwise Grid Model API Specification (PWGM-API)
PWGM_ELEMDATA
Element descriptor data type.
Definition: apiGridModel.h:735
PWGM_ENUM_ELEMORDER
PWGM_ENUM_ELEMORDER
Types of element orderings.
Definition: apiGridModel.h:697
PwBlkElementCount
PWP_UINT32 PwBlkElementCount(PWGM_HBLOCK block, PWGM_ELEMCOUNTS *pCounts)
Get the number of block elements.
Definition: apiGridModel.cxx:309
PWGM_INDEX_XFORM2
The 2D transform matrix data type.
Definition: apiGridModel.h:903
PWGM_IJK_K
@ PWGM_IJK_K
K-component id.
Definition: apiGridModel.h:989
PWGM_INDEX3::i
PWP_INT32 i
i-coordinate used for 3D and 2D grids
Definition: apiGridModel.h:860
PWGM_ELEMTYPE_TRI
@ PWGM_ELEMTYPE_TRI
2D, 3-sided grid element
Definition: apiGridModel.h:676
PWGM_HVERTEX_ISVALID
#define PWGM_HVERTEX_ISVALID(h)
returns non-zero value if handle is valid
Definition: apiGridModel.h:400
PWGM_INDEX3
Structured grid ijk index data type.
Definition: apiGridModel.h:859
PwElemDataMod
PWP_BOOL PwElemDataMod(PWGM_HELEMENT element, PWGM_ELEMDATA *pElemData)
Get the element data relative to the model's index space.
Definition: apiGridModel.cxx:377
PwDomEnumElements
PWGM_HELEMENT PwDomEnumElements(PWGM_HDOMAIN domain, PWP_UINT32 ndx)
Sequentially enumerate the domain elements.
Definition: apiGridModel.cxx:333
PWP_CAST_BOOL
#define PWP_CAST_BOOL(v)
Cast a value to a PWP_BOOL value (PWP_TRUE or PWP_FALSE)
Definition: apiPWP.h:312
PWGM_ECNT_Tri
#define PWGM_ECNT_Tri(ecs)
Extract the Tri count from a PWGM_ELEMCOUNTS struct.
Definition: apiGridModel.h:795
PwBlkNdxConnection
PWP_BOOL PwBlkNdxConnection(PWGM_HBLOCK block, PWP_UINT32 ndx, PWGM_CNXNDATA *pCnxnData)
Get the data for the block's nth connection.
Definition: apiGridModel.cxx:584
PWGM_ELEMTYPE_POINT
@ PWGM_ELEMTYPE_POINT
0D, point grid element
Definition: apiGridModel.h:680
PWGM_ELEMTYPE_PYRAMID
@ PWGM_ELEMTYPE_PYRAMID
3D, 5-sided, quad-based grid element
Definition: apiGridModel.h:679
PWGM_ECNT_Tet
#define PWGM_ECNT_Tet(ecs)
Extract the Tet count from a PWGM_ELEMCOUNTS struct.
Definition: apiGridModel.h:801
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:1266
PwModBlockCount
PWP_UINT32 PwModBlockCount(PWGM_HGRIDMODEL model)
Get the number of block elements in the model.
Definition: apiGridModel.cxx:83
PWGM_FACEORDER_INTERIORFIRST
@ PWGM_FACEORDER_INTERIORFIRST
all cell faces in interior, boundary order
Definition: apiGridModel.h:1033
PwModCustomIndex3SchemeReady
PWP_BOOL PwModCustomIndex3SchemeReady(PWGM_HGRIDMODEL model, PWGM_INDEX3MAPPERCB cb, void *data)
Notifys the Pointwise export framework that the custom, structured index3 map is ready.
Definition: apiGridModel.cxx:524
PWP_VALTYPE_REAL
@ PWP_VALTYPE_REAL
transfer value is a PWP_REAL
Definition: apiPWP.h:700
PwBlkSetConditionUserId
PWP_BOOL PwBlkSetConditionUserId(PWGM_HBLOCK block, const PWP_UINT32 userId)
Sets the condition data for a grid entity.
Definition: apiGridModel.cxx:993
PWGM_INDEX3MAPPERCB
PWGM_INDEX3(* PWGM_INDEX3MAPPERCB)(const PWGM_INDEX3 pwgmNdx, void *data)
The custom, structured Index3Scheme mapper callback function signature.
Definition: apiGridModel.h:1204
PWGM_ELEMTYPE_BAR
@ PWGM_ELEMTYPE_BAR
1D, linear grid element
Definition: apiGridModel.h:673
PwAsmSetConditionTypeId
PWP_BOOL PwAsmSetConditionTypeId(PWGM_HBLOCKASSEMBLER h, const PWGM_CONDKEY key, const PWP_UINT32 typeId)
Sets the type id of the condition identified by key.
Definition: apiGridModel.cxx:1141
PwBlkCondition
PWP_BOOL PwBlkCondition(PWGM_HBLOCK block, PWGM_CONDDATA *pCondData)
Get the block condition data.
Definition: apiGridModel.cxx:99
PwInRange
PWP_BOOL PwInRange(PWGM_INDEX3 ijk, const PWGM_STR_RANGE *pRange)
Determines if an PWGM_INDEX3 is within a PWGM_STR_RANGE.
Definition: apiGridModel.cxx:751
PWGM_BEGINSTREAMCB
PWP_UINT32(* PWGM_BEGINSTREAMCB)(PWGM_BEGINSTREAM_DATA *data)
The begin stream callback function signature.
Definition: apiGridModel.h:1070
PwDomCondition
PWP_BOOL PwDomCondition(PWGM_HDOMAIN domain, PWGM_CONDDATA *pCondData)
Get the domain condition data.
Definition: apiGridModel.cxx:341
PWGM_INDEX2
Structured grid ijk index data type.
Definition: apiGridModel.h:868
PWGM_ECNT_Quad
#define PWGM_ECNT_Quad(ecs)
Extract the Quad count from a PWGM_ELEMCOUNTS struct.
Definition: apiGridModel.h:789
PWP_REAL
double PWP_REAL
64-bit real
Definition: apiPWP.h:264
PwBlkEnumConnections
PWGM_HCNXN PwBlkEnumConnections(PWGM_HBLOCK block, PWP_UINT32 ndx)
Sequentially enumerate the block's connections.
Definition: apiGridModel.cxx:557
PwVlstSetXYZData
PWP_BOOL PwVlstSetXYZData(PWGM_HVERTEXLIST vertlist, const PWP_UINT ndx, const PWGM_VERTDATA &v)
Set the XYZ of a point in a 1D vertex list using a PWGM_VERTDATA value.
Definition: apiGridModel.cxx:880
PwModEnumBoundaries
PWGM_HBNDRY PwModEnumBoundaries(PWGM_HGRIDMODEL model, PWP_UINT32 ndx)
Sequentially enumerate the model's boundaries.
Definition: apiGridModel.cxx:454
PwModCreateStrDomain
PWGM_HDOMAIN PwModCreateStrDomain(PWGM_HGRIDMODEL model, const PWGM_STR_SIZE domSize)
Creates a structured domain in a model.
Definition: apiGridModel.cxx:1364
PWGM_ENUM_ELEMTYPE
PWGM_ENUM_ELEMTYPE
Element type ids.
Definition: apiGridModel.h:672
PwAsmSetConditionUserId
PWP_BOOL PwAsmSetConditionUserId(PWGM_HBLOCKASSEMBLER h, const PWGM_CONDKEY key, const PWP_UINT32 userId)
Sets the user id of the condition identified by key.
Definition: apiGridModel.cxx:1123
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:870
PWGM_VERTDATA
Vertex descriptor data type.
Definition: apiGridModel.h:607
PWGM_FACEORDER_BCGROUPSFIRST
@ PWGM_FACEORDER_BCGROUPSFIRST
BoundaryFirst grouped by BCs.
Definition: apiGridModel.h:1036
PWGM_ECNT_Wedge
#define PWGM_ECNT_Wedge(ecs)
Extract the Wedge count from a PWGM_ELEMCOUNTS struct.
Definition: apiGridModel.h:807
PwBlkEnumBoundaries
PWGM_HBNDRY PwBlkEnumBoundaries(PWGM_HBLOCK block, PWP_UINT32 ndx)
Sequentially enumerate the block's boundaries.
Definition: apiGridModel.cxx:541
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:1163
PWGM_INDEX2::j
PWP_INT32 j
j-coordinate used for 2D grids
Definition: apiGridModel.h:870
PwXformApply
PWGM_INDEX3 PwXformApply(const PWGM_INDEX_XFORM *pX3, PWGM_INDEX3 ijk)
Apply a PWGM_INDEX_XFORM transform to a PWGM_INDEX3 value.
Definition: apiGridModel.cxx:669
PWGM_FACEORDER_BCGROUPSLAST
@ PWGM_FACEORDER_BCGROUPSLAST
InteriorFirst grouped by BCs.
Definition: apiGridModel.h:1037
PwVlstReadFile
PWP_BOOL PwVlstReadFile(PWGM_HVERTEXLIST vertlist, FILE *file, const PWGM_XYZ_CLUSTERING fileClustering, const PWP_ENDIANNESS fileByteOrder, const PWP_ENUM_PRECISION filePrecision)
Definition: apiGridModel.cxx:1182
PWGM_HBLOCK
An opaque handle to a grid block element.
Definition: apiGridModel.h:345
PWGM_STR_RANGE::end
PWGM_INDEX3 end
ending index
Definition: apiGridModel.h:882
PWGM_BLOCKDATA
Block data type.
Definition: apiGridModel.h:976
PwModGetAttributeREAL
PWP_BOOL PwModGetAttributeREAL(PWGM_HGRIDMODEL model, const char *name, PWP_REAL *val)
Definition: apiGridModel.cxx:186
PWGM_ELEMCOUNTS
Element count information.
Definition: apiGridModel.h:757
PwVlstIsStructured
PWP_BOOL PwVlstIsStructured(PWGM_HVERTEXLIST vertlist)
Check the type of a vertex list.
Definition: apiGridModel.cxx:834
PWP_FALSE
#define PWP_FALSE
PWP_BOOL logical "false" value.
Definition: apiPWP.h:306
PwModGetAttributeValue
PWP_BOOL PwModGetAttributeValue(PWGM_HGRIDMODEL model, const char *name, PWP_ENUM_VALTYPE bufType, void *buf, PWP_UINT count)
Get an attribute's value.
Definition: apiGridModel.cxx:126
PwModGetAttributeBOOL
PWP_BOOL PwModGetAttributeBOOL(PWGM_HGRIDMODEL model, const char *name, PWP_BOOL *val)
Definition: apiGridModel.cxx:207
PWGM_ELEMTYPE_WEDGE
@ PWGM_ELEMTYPE_WEDGE
3D, extruded, tri/quad grid element
Definition: apiGridModel.h:678
PwModConnectionCount
PWP_UINT32 PwModConnectionCount(PWGM_HGRIDMODEL model)
Get the number of structured grid connections in the model.
Definition: apiGridModel.cxx:462
PwModBoundaryCount
PWP_UINT32 PwModBoundaryCount(PWGM_HGRIDMODEL model)
Get the number of structured grid boundaries in the model.
Definition: apiGridModel.cxx:446
PwAsmSetProperty
PWP_BOOL PwAsmSetProperty(PWGM_HBLOCKASSEMBLER blkAsm, const PWP_UINT32 propertySetId, const char *key, const char *val)
Sets the text value of a property identified by key.
Definition: apiGridModel.cxx:976
PWP_FLOAT
float PWP_FLOAT
32-bit real
Definition: apiPWP.h:261
PWGM_INDEX3::k
PWP_INT32 k
k-coordinate used for 3D grids only
Definition: apiGridModel.h:862
PwVlstSetXYZVal3
PWP_BOOL PwVlstSetXYZVal3(PWGM_HVERTEXLIST vertlist, const PWGM_INDEX3 ndx3, const PWGM_ENUM_XYZ which, const PWGM_XYZVAL val)
Set an XYZ component of a point in a 3D structured vertex list.
Definition: apiGridModel.cxx:923
PwVertXyzVal
PWP_BOOL PwVertXyzVal(PWGM_HVERTEX vertex, PWGM_ENUM_XYZ which, PWGM_XYZVAL *pVal)
Get a vertex's x, y, or z component value.
Definition: apiGridModel.cxx:368
PWGM_BNDRYDATA
Structured grid boundary data type.
Definition: apiGridModel.h:951
PWGM_FACEORDER_BOUNDARYONLY
@ PWGM_FACEORDER_BOUNDARYONLY
only boundary cell faces
Definition: apiGridModel.h:1034
PwVlstSetXYZVal
PWP_BOOL PwVlstSetXYZVal(PWGM_HVERTEXLIST vertlist, const PWP_UINT ndx, const PWGM_ENUM_XYZ which, const PWGM_XYZVAL val)
Set an XYZ component of a point in a 1D vertex list.
Definition: apiGridModel.cxx:859
PwBlkSetConditionUserName
PWP_BOOL PwBlkSetConditionUserName(PWGM_HBLOCK block, const char *userName)
Sets the condition name for a grid entity.
Definition: apiGridModel.cxx:986
PWGM_ECNT_Pyramid
#define PWGM_ECNT_Pyramid(ecs)
Extract the Pyramid count from a PWGM_ELEMCOUNTS struct.
Definition: apiGridModel.h:813
PwBlkGetVertexList
PWGM_HVERTEXLIST PwBlkGetVertexList(PWGM_HBLOCK block)
Get the vertex list associated with an unstructured or structured block.
Definition: apiGridModel.cxx:778
PwVlstCreateBlockAssembler
PWGM_HBLOCKASSEMBLER PwVlstCreateBlockAssembler(PWGM_HVERTEXLIST vertlist)
Creates an unstructured block face assembler that uses vertices from an unstructured vertex list.
Definition: apiGridModel.cxx:1323
PWGM_VERTDATA::y
PWGM_XYZVAL y
y-component
Definition: apiGridModel.h:609
PWGM_STR_RANGE::beg
PWGM_INDEX3 beg
begining index
Definition: apiGridModel.h:881
PwBlkConnectionCount
PWP_UINT32 PwBlkConnectionCount(PWGM_HBLOCK block)
Get the number of connections in the block.
Definition: apiGridModel.cxx:549
PwBlkSetConditionTypeId
PWP_BOOL PwBlkSetConditionTypeId(PWGM_HBLOCK block, const PWP_UINT32 typeId)
Sets the condition data for a grid entity.
Definition: apiGridModel.cxx:1009
PWGM_VERTDATA::z
PWGM_XYZVAL z
z-component
Definition: apiGridModel.h:610
PWGM_INDEX_XFORM
The 3D transform matrix data type.
Definition: apiGridModel.h:892
PWP_ENDIANNESS
PWP_ENDIANNESS
Flags used to indicate endianness or control endian behaviors in functions.
Definition: apiPWP.h:822
PwModGetAttributeINT
PWP_BOOL PwModGetAttributeINT(PWGM_HGRIDMODEL model, const char *name, PWP_INT *val)
Definition: apiGridModel.cxx:165
PwModCreateUnsVertexList3
PWGM_HVERTEXLIST PwModCreateUnsVertexList3(PWGM_HGRIDMODEL model)
Creates an empty, unstructured vertex list in a model for 3-D blocks and 2-D domains.
Definition: apiGridModel.cxx:1203
PWGM_INDEX2::i
PWP_INT32 i
i-coordinate used for 2D grids
Definition: apiGridModel.h:869
PWP_INT
PWP_INT32 PWP_INT
integer same size as void*
Definition: apiPWP.h:282
PwConGetVertexList
PWGM_HVERTEXLIST PwConGetVertexList(PWGM_HCONNECTOR connector)
Get the vertex list associated with a connector.
Definition: apiGridModel.cxx:794
PWP_VALTYPE_BOOL
@ PWP_VALTYPE_BOOL
transfer value is a PWP_BOOL
Definition: apiPWP.h:702
PwModEnumElements
PWGM_HELEMENT PwModEnumElements(PWGM_HGRIDMODEL model, PWP_UINT32 ndx)
Sequentially enumerate the model's block elements.
Definition: apiGridModel.cxx:285
PWP_BOOL
int PWP_BOOL
logical value
Definition: apiPWP.h:303
PWP_VALTYPE_INT
@ PWP_VALTYPE_INT
transfer value is a PWP_INT
Definition: apiPWP.h:698
PwModGetAttributeINT32
PWP_BOOL PwModGetAttributeINT32(PWGM_HGRIDMODEL model, const char *name, PWP_INT32 *val)
Definition: apiGridModel.cxx:173
PwVlstAllocate
PWP_BOOL PwVlstAllocate(PWGM_HVERTEXLIST vertlist, const PWP_UINT n)
Allocates storage in an unstructured vertex list.
Definition: apiGridModel.cxx:1217
PwVertDataMod
PWP_BOOL PwVertDataMod(PWGM_HVERTEX vertex, PWGM_VERTDATA *pVertData)
Get the vertex data relative to the model's index space.
Definition: apiGridModel.cxx:350
PwUnsBlkAllocateElementCounts
PWP_BOOL PwUnsBlkAllocateElementCounts(PWGM_HBLOCK block, const PWGM_ELEMCOUNTS &counts)
Allocates element storage in an unstructured block.
Definition: apiGridModel.cxx:1243
PwConSetConditionUserName
PWP_BOOL PwConSetConditionUserName(PWGM_HCONNECTOR connector, const char *userName)
Sets the condition name for a connector.
Definition: apiGridModel.cxx:1072
PwModNdxConnection
PWP_BOOL PwModNdxConnection(PWGM_HGRIDMODEL model, PWP_UINT32 ndx, PWGM_CNXNDATA *pCnxnData)
Get the data for the model's nth connection.
Definition: apiGridModel.cxx:499
PwXform2to3
PWP_BOOL PwXform2to3(const PWGM_INDEX_XFORM2 *pX2, PWGM_INDEX_XFORM *pX3)
Convert a 2D transform matrix to it's 3D equivalent.
Definition: apiGridModel.cxx:616
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:1002
PWGM_HBNDRY
An opaque handle to a structured block boundary.
Definition: apiGridModel.h:457
PwDomSetCondition
PWP_BOOL PwDomSetCondition(PWGM_HDOMAIN domain, const PWGM_CONDDATA &condData)
Sets the condition data for a domain.
Definition: apiGridModel.cxx:1061
PwXformFollows
PWGM_ENUM_IJK PwXformFollows(const PWGM_INDEX_XFORM *pX3, PWGM_ENUM_IJK localAxis, PWP_BOOL *pFlipped)
For a given localAxis, determine the corresponding axis in the transformed system.
Definition: apiGridModel.cxx:683
PWP_TRUE
#define PWP_TRUE
PWP_BOOL logical "true" value.
Definition: apiPWP.h:309
PWGM_STR_SIZE
PWGM_INDEX3 PW_DLL_IMPEXP PWGM_STR_SIZE
Structured grid ijk size data type.
Definition: apiGridModel.h:875
PwBlkSetCondition
PWP_BOOL PwBlkSetCondition(PWGM_HBLOCK block, const PWGM_CONDDATA &condData)
Sets the condition data for a grid entity.
Definition: apiGridModel.cxx:1018
PwModEnumBlocks
PWGM_HBLOCK PwModEnumBlocks(PWGM_HGRIDMODEL model, PWP_UINT32 ndx)
Sequentially enumerate the model block elements.
Definition: apiGridModel.cxx:91
PwVlstCreateUnsDomain
PWGM_HDOMAIN PwVlstCreateUnsDomain(PWGM_HVERTEXLIST vertlist)
Creates an unstructured domain that uses vertices from an unstructured vertex list.
Definition: apiGridModel.cxx:1275
PWGM_XYZVAL
PWP_REAL PWGM_XYZVAL
XYZ component data type.
Definition: apiGridModel.h:600
PwConSetCondition
PWP_BOOL PwConSetCondition(PWGM_HCONNECTOR connector, const PWGM_CONDDATA &condData)
Sets the condition data for a connector.
Definition: apiGridModel.cxx:1104
PwBlkBoundaryCount
PWP_UINT32 PwBlkBoundaryCount(PWGM_HBLOCK block)
Get the number of boundaries in the block.
Definition: apiGridModel.cxx:533
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:1314
PwModGetAttributeString
PWP_BOOL PwModGetAttributeString(PWGM_HGRIDMODEL model, const char *name, const char **val)
Get an attribute value as a specific type.
Definition: apiGridModel.cxx:136
PwDomSetConditionTypeName
PWP_BOOL PwDomSetConditionTypeName(PWGM_HDOMAIN domain, const char *typeName)
Sets the condition data for a domain.
Definition: apiGridModel.cxx:1045
PWGM_IJK_I
@ PWGM_IJK_I
I-component id.
Definition: apiGridModel.h:987
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.
Definition: apiGridModel.cxx:266
PwConSetConditionTypeId
PWP_BOOL PwConSetConditionTypeId(PWGM_HCONNECTOR connector, const PWP_UINT32 typeId)
Sets the condition data for a connector.
Definition: apiGridModel.cxx:1095
PWGM_FACEORDER_INTERIORONLY
@ PWGM_FACEORDER_INTERIORONLY
only interior cell faces
Definition: apiGridModel.h:1035
PwVlstSetXYZ3
PWP_BOOL PwVlstSetXYZ3(PWGM_HVERTEXLIST vertlist, const PWGM_INDEX3 ndx3, const PWGM_XYZVAL x, const PWGM_XYZVAL y, const PWGM_XYZVAL z)
Set the XYZ of a point in a 3D structured vertex list.
Definition: apiGridModel.cxx:933
PwConSetProperty
PWP_BOOL PwConSetProperty(PWGM_HCONNECTOR connector, const char *key, const char *val)
Sets the text value of a property identified by key.
Definition: apiGridModel.cxx:968
PWP_VALTYPE_ENUM
@ PWP_VALTYPE_ENUM
transfer value is a const char*
Definition: apiPWP.h:701
PWGM_CNXNDATA
Structured grid, inter-block, connection data type.
Definition: apiGridModel.h:961
PWGM_HVERTEX
An opaque handle to a grid vertex element.
Definition: apiGridModel.h:398
apiPWPUtils.h
Data and functions useful to PWP-API compliant plugins.
PwModAppendEnumElementOrder
PWP_BOOL PwModAppendEnumElementOrder(PWGM_HGRIDMODEL model, PWGM_ENUM_ELEMORDER order)
Append an element order to the enumElements() ordering sequence.
Definition: apiGridModel.cxx:293
PwConnection
PWP_BOOL PwConnection(PWGM_HCNXN connection, PWGM_CNXNDATA *pCnxnData)
Get the connection data.
Definition: apiGridModel.cxx:608
PwDomSetName
PWP_BOOL PwDomSetName(PWGM_HDOMAIN domain, const char *name)
Set a domain's name.
Definition: apiGridModel.cxx:818
PwConSetConditionTypeName
PWP_BOOL PwConSetConditionTypeName(PWGM_HCONNECTOR connector, const char *typeName)
Sets the condition data for a connector.
Definition: apiGridModel.cxx:1088
PwModCreateUnsVertexList
PWGM_HVERTEXLIST PwModCreateUnsVertexList(PWGM_HGRIDMODEL model, const PWP_ENUM_DIMENSION blkElemDimty)
Creates an empty, unstructured vertex list in a model.
Definition: apiGridModel.cxx:1193
PwVlstGetIndexDimensionality
PWP_UINT PwVlstGetIndexDimensionality(PWGM_HVERTEXLIST vertlist)
Get the index dimensionality of a vertex list.
Definition: apiGridModel.cxx:842
PwDomGetVertexList
PWGM_HVERTEXLIST PwDomGetVertexList(PWGM_HDOMAIN domain)
Get the vertex list associated with an unstructured or structured domain.
Definition: apiGridModel.cxx:786
PwBlkSetProperty
PWP_BOOL PwBlkSetProperty(PWGM_HBLOCK block, const char *key, const char *val)
Sets the text value of a property identified by key.
Definition: apiGridModel.cxx:952
PwBoundary
PWP_BOOL PwBoundary(PWGM_HBNDRY boundary, PWGM_BNDRYDATA *pBndryData)
Get the boundary data.
Definition: apiGridModel.cxx:592
PWGM_HCONNECTOR
An opaque handle to a grid connector element.
Definition: apiGridModel.h:507
PWP_ENUM_DIMENSION
PWP_ENUM_DIMENSION
Supported dimensionality values.
Definition: apiPWP.h:763
PWGM_ECNT_Hex
#define PWGM_ECNT_Hex(ecs)
Extract the Hex count from a PWGM_ELEMCOUNTS struct.
Definition: apiGridModel.h:783
PWP_VALTYPE_UINT
@ PWP_VALTYPE_UINT
transfer value is a PWP_UINT
Definition: apiPWP.h:699
PWGM_ASSEMBLER_DATA
Face descriptor data type. Used for face assembler functions.
Definition: apiGridModel.h:1182
PWGM_ENUM_IJK
PWGM_ENUM_IJK
IJK component type ids.
Definition: apiGridModel.h:986
PwBlkNdxBoundaryAndCondition
PWP_BOOL PwBlkNdxBoundaryAndCondition(PWGM_HBLOCK block, PWP_UINT32 ndx, PWGM_BNDRYDATA *pBndryData, PWGM_CONDDATA *pCondData)
Get the PWGM_BNDRYDATA and PWGM_CONDDATA for the block's nth structured boundary.
Definition: apiGridModel.cxx:573
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:1151
beginCB
static PWP_UINT32 beginCB(PWGM_BEGINSTREAM_DATA *data)
Definition: CaeUnsGridModel.cxx:51
PWGM_ENUM_XYZ
PWGM_ENUM_XYZ
XYZ component type ids.
Definition: apiGridModel.h:821
PwAsmSetConditionUserName
PWP_BOOL PwAsmSetConditionUserName(PWGM_HBLOCKASSEMBLER h, const PWGM_CONDKEY key, const char *userName)
Sets the user name of the condition identified by key.
Definition: apiGridModel.cxx:1115
PwAsmGetVertexList
PWGM_HVERTEXLIST PwAsmGetVertexList(PWGM_HBLOCKASSEMBLER blkAsm)
Get the vertex list associated with an unstructured block assembler.
Definition: apiGridModel.cxx:1348
PWGM_ENUM_FACEORDER
PWGM_ENUM_FACEORDER
The orderings supported by face streaming.
Definition: apiGridModel.h:1030
PwDomSetProperty
PWP_BOOL PwDomSetProperty(PWGM_HDOMAIN domain, const char *key, const char *val)
Sets the text value of a property identified by key.
Definition: apiGridModel.cxx:960
PwModCustomIndexSchemeReady
PWP_BOOL PwModCustomIndexSchemeReady(PWGM_HGRIDMODEL model, PWGM_INDEXMAPPERCB cb, void *data)
Notifys the Pointwise export framework that the custom, unstructured index map is ready.
Definition: apiGridModel.cxx:258
PwXform2Apply
PWGM_INDEX3 PwXform2Apply(const PWGM_INDEX_XFORM2 *pX2, PWGM_INDEX3 ijk)
Apply a PWGM_INDEX_XFORM2 transform to a PWGM_INDEX3 value.
Definition: apiGridModel.cxx:727
PWGM_ENUMELEMDATA
Enumerated model element descriptor data type.
Definition: apiGridModel.h:747
PwModCreateCon
PWGM_HCONNECTOR PwModCreateCon(PWGM_HGRIDMODEL model, PWP_UINT size)
Creates a connector in a model.
Definition: apiGridModel.cxx:770
PWP_ENUM_PRECISION
PWP_ENUM_PRECISION
File precision values.
Definition: apiPWP.h:802
PWGM_STR_RANGE
Structured grid ijk range data type.
Definition: apiGridModel.h:880
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:1233
PwVlstIsUnstructured
PWP_BOOL PwVlstIsUnstructured(PWGM_HVERTEXLIST vertlist)
Check the type of a vertex list.
Definition: apiGridModel.cxx:826
PwVlstGetBlkElemDimensionality
PWP_ENUM_DIMENSION PwVlstGetBlkElemDimensionality(PWGM_HVERTEXLIST vertlist)
Get the block element dimensionality of a vertex list.
Definition: apiGridModel.cxx:850
PWGM_HVERTEXLIST
Grid vertex list handle declaration.
Definition: apiGridModel.h:536
PwElemTypeToText
const char * PwElemTypeToText(PWGM_ENUM_ELEMTYPE type)
Maps a PWGM_ENUM_ELEMTYPE value to a human readable string.
Definition: apiGridModel.cxx:415
PwModGetAttributeUINT
PWP_BOOL PwModGetAttributeUINT(PWGM_HGRIDMODEL model, const char *name, PWP_UINT *val)
Definition: apiGridModel.cxx:144
PWGM_HELEMENT_ISVALID
#define PWGM_HELEMENT_ISVALID(h)
returns non-zero value if handle is valid
Definition: apiGridModel.h:429
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
PwModGetAttributeEnum
PWP_BOOL PwModGetAttributeEnum(PWGM_HGRIDMODEL model, const char *name, const char **val)
Definition: apiGridModel.cxx:215
PWGM_INDEX_XFORM::m
PWP_INT32 m[3][4]
m[row][col]
Definition: apiGridModel.h:893
PwBlkSetExportName
PWP_BOOL PwBlkSetExportName(PWGM_HBLOCK block, const char *name)
Set the name used to identify the block or group of blocks in the exported grid.
Definition: apiGridModel.cxx:117