Pointwise Plugin SDK
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
apiCAEPUtils.cxx
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * Pointwise Plugin utility functions
4  *
5  * (C) 2021 Cadence Design Systems, Inc. All rights reserved worldwide.
6  *
7  ***************************************************************************/
8 
9 #include <algorithm>
10 #include <string>
11 #include <vector>
12 
13 #include <string.h>
14 
15 #include "apiPWP.h"
16 #include "apiCAEPUtils.h"
17 #include "apiGridModel.h"
18 #include "pwpPlatform.h"
19 
20 
21 
24 {
25  CAEP_RTITEM *ret = 0;
26  PWP_UINT32 ii;
27  for (ii=0; ii < caepFormatCnt; ++ii) {
28  if (id == caepRtItem[ii].FormatInfo.id) {
29  ret = &(caepRtItem[ii]);
30  break;
31  }
32  }
33  return ret;
34 }
35 
36 
38 caeuFindFormatByName (const char name[])
39 {
40  CAEP_RTITEM *ret = 0;
41  PWP_UINT32 ii;
42  for (ii=0; ii < caepFormatCnt; ++ii) {
43  if (0 == strcmp(caepRtItem[ii].FormatInfo.name, name)) {
44  ret = &(caepRtItem[ii]);
45  break;
46  }
47  }
48  return ret;
49 }
50 
51 
54 {
55  PWP_BOOL ret = PWP_FALSE;
56  if (nullptr != pRti) {
57  // Setting both to PWP_UINT32_MAX indicates are are before first step
58  pRti->progTotal = PWP_UINT32_MAX;
59  pRti->progComplete = PWP_UINT32_MAX;
60  pRti->clocks[CAEPU_CLKS_PROGUPDATE] =
61  pRti->clocks[CAEPU_CLKS_PROGINIT] = clock();
62  ret = PwuProgressBegin(pRti->pApiData->apiInfo.name, cnt);
63  pRti->opAborted = !ret;
64  }
65  return ret;
66 }
67 
68 
71 {
72  PWP_BOOL ret = PWP_CAST_BOOL((nullptr != pRti) && (0 != total) &&
73  !pRti->opAborted);
74  if (ret) {
75  const bool IsFirstStep = (PWP_UINT32_MAX == pRti->progComplete) &&
76  (PWP_UINT32_MAX == pRti->progTotal);
77  pRti->progComplete = 0;
78  pRti->progTotal = total;
79  if (!IsFirstStep) {
81  }
82  pRti->clocks[CAEPU_CLKS_BEGSTEP] = clock();
83  }
84  return ret;
85 }
86 
87 
90 {
91  PWP_BOOL ret = PWP_FALSE;
92  if ((nullptr != pRti) && !pRti->opAborted) {
93  // send update a max of 2 times per second
94  const clock_t DELAY = (CLOCKS_PER_SEC / 2);
95  pRti->clocks[CAEPU_CLKS_PROGINCR] = clock();
96  ++pRti->progComplete;
97  if (DELAY <= CAEPU_RT_CLKS_DIFF(pRti, CAEPU_CLKS_PROGUPDATE,
99  ret = PwuProgressStatus (pRti->pApiData->apiInfo.name,
100  pRti->progComplete, pRti->progTotal);
101  pRti->clocks[CAEPU_CLKS_PROGUPDATE] =
102  pRti->clocks[CAEPU_CLKS_PROGINCR];
103  pRti->opAborted |= !ret;
104  }
105  else {
106  ret = PWP_TRUE;
107  }
108  }
109  return ret;
110 }
111 
112 
113 static void
114 sendDiffTimeMsg(CAEP_RTITEM *pRti, const char txt[], clock_t diff)
115 {
116  if (nullptr != pRti) {
117  PWP_INT32 hours;
118  PWP_INT32 minutes;
119  PWP_INT32 seconds;
120  char msg[512];
121  char *p = msg;
122  if (txt && txt[0]) {
123  strcpy(p, txt);
124  strcat(p, ": ");
125  p += strlen(p);
126  }
127  CAEPU_CLKS_TO_HMS(diff, hours, minutes, seconds);
128  sprintf(p, "%ld:%02ld:%02ld (h:mm:ss) / %ld msec", (long)hours,
129  (long)minutes, (long)seconds, (long)CAEPU_CLKS_TO_MSECS(diff));
130  caeuSendDebugMsg(pRti, msg, 0);
131  }
132 }
133 
134 
135 static void
136 sendClkDiffTimeMsg(CAEP_RTITEM *pRti, const char txt[],
137  CAEPU_ENUM_CLOCKS startId, CAEPU_ENUM_CLOCKS endId)
138 {
139  if (nullptr != pRti) {
140  sendDiffTimeMsg(pRti, txt, CAEPU_RT_CLKS_DIFF(pRti, startId, endId));
141  }
142 }
143 
144 
145 PWP_BOOL
147 {
148  const PWP_BOOL ret = PWP_CAST_BOOL(nullptr != pRti);
149  if (ret) {
150  pRti->clocks[CAEPU_CLKS_ENDSTEP] = clock();
151  pRti->progComplete = 0;
152  pRti->progTotal = 0;
153  sendClkDiffTimeMsg(pRti, "Step time", CAEPU_CLKS_BEGSTEP,
155  }
156  return ret;
157 }
158 
159 
160 void
162 {
163  if (nullptr != pRti) {
164  pRti->clocks[CAEPU_CLKS_PROGEND] = clock();
165  pRti->progTotal = 0;
166  pRti->progComplete = 0;
167  pRti->clocks[CAEPU_CLKS_PROGUPDATE] = 0;
168  PwuProgressEnd(pRti->pApiData->apiInfo.name, ok);
169  sendClkDiffTimeMsg(pRti, "Export time", CAEPU_CLKS_PROGINIT,
171  }
172 }
173 
174 
175 int
176 caeuFileClose(CAEP_RTITEM* pRti, const CAEP_WRITEINFO *pWriteInfo)
177 {
178  int ret = 0;
179  if (nullptr != pRti) {
180  switch (pRti->FormatInfo.fileDest) {
182  if (pRti->fp) {
183  if (0 == pwpFileClose(pRti->fp)) {
184  if (pRti->opAborted) {
185  pwpFileDelete(pWriteInfo->fileDest);
186  }
187  else {
188  ret = 1;
189  }
190  }
191  pRti->fp = 0;
192  if (0 != pwpCwdPop()) {
193  ret = 0;
194  }
195  }
196  break;
197 
199  case PWP_FILEDEST_FOLDER:
200  /* restore cwd to the original folder.
201  */
202  if (0 == pwpCwdPop()) {
203  ret = 1;
204  }
205  break;
206  case PWP_FILEDEST_SIZE: // silence compiler warning
207  break;
208  }
209  }
210  return ret;
211 }
212 
213 
214 void
215 caeuSendDebugMsg(CAEP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
216 {
217  if (0 != pRti) {
218  PwuSendDebugMsg(pRti->pApiData->apiInfo.name, txt, code);
219  }
220 }
221 
222 
223 void
224 caeuSendInfoMsg(CAEP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
225 {
226  if (0 != pRti) {
227  PwuSendInfoMsg(pRti->pApiData->apiInfo.name, txt, code);
228  }
229 }
230 
231 
232 void
233 caeuSendWarningMsg(CAEP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
234 {
235  if (0 != pRti) {
236  PwuSendWarningMsg(pRti->pApiData->apiInfo.name, txt, code);
237  }
238 }
239 
240 
241 void
242 caeuSendErrorMsg(CAEP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
243 {
244  if (0 != pRti) {
245  PwuSendErrorMsg(pRti->pApiData->apiInfo.name, txt, code);
246  }
247 }
248 
249 
250 
251 PWP_BOOL
253  const char value[], const char access[], const char desc[],
254  const char range[])
255 {
256  return PwuPublishValueDefinition(CAEP_VALUE_GROUP, key, type, value, access,
257  desc, range);
258 }
259 
260 
261 PWP_BOOL
262 caeuAssignInfoValue(const char key[], const char value[],
263  bool createIfNotExists)
264 {
265  return PwuAssignValueEnum(CAEP_INFO_GROUP, key, value,
266  createIfNotExists);
267 }
268 
269 
270 PWP_BOOL
272 {
273  bool ret = false;
274  if (1 == maxPolynomialDegree) {
275  // All is OK. Do NOT publish HO attributes.
276  ret = true;
277  }
278  else if ((maxPolynomialDegree >= 2) && (maxPolynomialDegree <= 4)) {
279  auto maxPolyDegStr = [maxPolynomialDegree]()-> const char *
280  {
281  static char ret[2] = { '\0' };
282  ret[0] = (char)('0' + maxPolynomialDegree);
283  return ret;
284  };
285 
286  auto polyDegEnumStr = [maxPolynomialDegree]()-> const char *
287  {
288  static char ret[32] = { '\0' };
289  strcpy(ret, "Q1=1|Q2|Q3|Q4");
290  // truncate string at appropriate offset
291  ret[1 + (maxPolynomialDegree * 3)] = '\0';
292  return ret;
293  };
294 
295  ret = caeuAssignInfoValue("MaxMeshPolynomialDegree", maxPolyDegStr(),
296  true) &&
297  caeuPublishValueDefinition("ExportPolynomialDegree",
298  PWP_VALTYPE_ENUM, "Q1", "RW",
299  "Elevate the exported grid to this polynomial degree",
300  polyDegEnumStr()) &&
301  caeuPublishValueDefinition("ExportWCNSmoothingPasses",
302  PWP_VALTYPE_UINT, "1000", "RW",
303  "Maximun number of WCN smoothing passes", "0 10000") &&
304  caeuPublishValueDefinition("ExportWCNWeightingFactorMode",
305  PWP_VALTYPE_ENUM, "Calculate", "RW",
306  "WCN weighting factor mode", "UseValue|Calculate") &&
307  caeuPublishValueDefinition("ExportWCNWeightingFactor",
308  PWP_VALTYPE_REAL, "0.5", "RW",
309  "WCN weighting factor (for UseValue mode)", "0.0 1.0") &&
310  caeuPublishValueDefinition("ExportMaxIncludedAngle",
311  PWP_VALTYPE_REAL, "175.0", "RW",
312  "Max included angle (180 disables linear smoothing)",
313  "0.0 180.0") &&
314  caeuPublishValueDefinition("ExportStepSizeRelaxationFactor",
315  PWP_VALTYPE_REAL, "0.05", "RW", "Step size relaxation factor",
316  "0.0 0.5") &&
317  caeuPublishValueDefinition("ExportConvergenceCostThreshold",
318  PWP_VALTYPE_REAL, "0.8", "RW", "Convergence cost threshold",
319  "0.0 1.0") &&
320  caeuPublishValueDefinition("ExportWriteHOVTU", PWP_VALTYPE_BOOL,
321  "false", "RW", "If true, a VTU file will also be created.", "");
322  }
323 
324  return PWP_CAST_BOOL(ret);
325 }
326 
327 
328 PWP_BOOL
329 caeuPublishMeshLinkValueDefinitions(const char *indexScheme)
330 {
331  const std::vector<std::string> Schemes{
332  "ZeroBased", "OneBased", "Custom"
333  };
334  // indexScheme one of: "ZeroBased", "OneBased", and "Custom"
335  const bool ret = (nullptr != indexScheme) && (Schemes.end() !=
336  std::find(Schemes.begin(), Schemes.end(), indexScheme)) &&
337  caeuAssignInfoValue("MeshLinkSupported", "true", true) &&
338  caeuAssignInfoValue("IndexScheme", indexScheme, true);
339  return PWP_CAST_BOOL(ret);
340 }
341 
342 
345 {
346  PWP_ENDIANNESS ret = PwuGetOsEndianness(); // assume Native
347  const char *str = 0;
348  if (PwModGetAttributeString(model, "FileByteOrder", &str)) {
349  // one of: Native|Swap|LittleEndian|BigEndian
350  if (0 == strcmp(str, "Swap")) {
352  }
353  else if (0 == strcmp(str, "LittleEndian")) {
354  ret = PWP_ENDIAN_LITTLE;
355  }
356  else if (0 == strcmp(str, "BigEndian")) {
357  ret = PWP_ENDIAN_BIG;
358  }
359  }
360  return ret;
361 }
362 
363 
364 PWP_BOOL
366 {
367  PWP_BOOL ret;
368  return PwModGetAttributeBOOL(model, "BoundaryConditionsOnly", &ret) ? ret :
369  PWP_FALSE;
370 }
371 
372 
375 {
376  PWP_ENUM_ENCODING ret = PWP_ENCODING_SIZE;
377  const char *str = 0;
378  if (PwModGetAttributeString(model, "FileFormat", &str)) {
379  // one of: ASCII|Binary|Unformatted
380  if (0 == strcmp(str, "ASCII")) {
381  ret = PWP_ENCODING_ASCII;
382  }
383  else if (0 == strcmp(str, "Binary")) {
384  ret = PWP_ENCODING_BINARY;
385  }
386  else if (0 == strcmp(str, "Unformatted")) {
388  }
389  // else something very wrong
390  }
391  return ret;
392 }
393 
394 
397 {
398  PWP_ENUM_PRECISION ret = PWP_PRECISION_SIZE;
399  const char *str = 0;
400  if (PwModGetAttributeString(model, "FilePrecision", &str)) {
401  // one of: Single|Double
402  if (0 == strcmp(str, "Single")) {
403  ret = PWP_PRECISION_SINGLE;
404  }
405  else if (0 == strcmp(str, "Double")) {
406  ret = PWP_PRECISION_DOUBLE;
407  }
408  // else something very wrong
409  }
410  return ret;
411 }
412 
413 
414 PWP_BOOL
416 {
417  PWP_BOOL ret;
418  return PwModGetAttributeBOOL(model, "GridStructuredAsUnstructured", &ret)
419  ? ret : PWP_FALSE;
420 }
421 
422 
423 
424 static int
425 openFileName(CAEP_RTITEM* pRti, const CAEP_WRITEINFO *pWriteInfo)
426 {
427  int ret = 0;
428  if ((nullptr != pRti) && pWriteInfo && pWriteInfo->fileDest &&
429  pWriteInfo->fileDest[0]) {
430  caeuFileClose(pRti, pWriteInfo); // sanity check
431  switch (pWriteInfo->encoding) {
432  case PWP_ENCODING_ASCII:
433  pRti->fp = pwpFileOpen(pWriteInfo->fileDest,
435  break;
436  case PWP_ENCODING_BINARY:
437  pRti->fp = pwpFileOpen(pWriteInfo->fileDest,
439  break;
441  pRti->fp = pwpFileOpen(pWriteInfo->fileDest,
443  break;
444  case PWP_ENCODING_SIZE: // silence compiler warning
445  break;
446  }
447  ret = (0 != pRti->fp);
448  }
449  return ret;
450 }
451 
452 
453 static int
454 fileDestCwdPush(const char *fileDest)
455 {
456  int ret = 0;
457  if (fileDest && fileDest[0]) {
458  char dir[FILENAME_MAX];
459  char *p;
460  strcpy(dir, fileDest);
461  p = strrchr(dir, '/');
462  if (p) {
463  // strip file/base name from end of path
464  *p = '\0';
465  if (0 == pwpCwdPush(dir)) {
466  ret = 1;
467  }
468  }
469  }
470  return ret;
471 }
472 
473 
474 int
475 caeuFileOpen(CAEP_RTITEM* pRti, const CAEP_WRITEINFO *pWriteInfo)
476 {
477  int ret = 0;
478  if (nullptr != pRti) {
479  switch (pRti->FormatInfo.fileDest) {
480  /* Plugin wants a full "/path/to/filename.ext"
481  */
483  if (fileDestCwdPush(pWriteInfo->fileDest)) {
484  if (!openFileName(pRti, pWriteInfo)) {
485  pwpCwdPop();
486  }
487  else {
488  ret = 1;
489  }
490  }
491  break;
492 
493  /* Plugin wants a base "/path/to/basefilename" (no ext)
494  */
496  /* Set the cwd to the given folder.
497  It is the plugin's job to open the appropriate files.
498  */
499  ret = fileDestCwdPush(pWriteInfo->fileDest);
500  break;
501 
502  /* Plugin wants a folder "/path/to/folder/" (no file or ext)
503  */
504  case PWP_FILEDEST_FOLDER:
505  /* Set the cwd to the given folder.
506  It is the plugin's job to open the appropriate files.
507  */
508  if (0 == pwpCwdPush(pWriteInfo->fileDest)) {
509  ret = 1;
510  }
511  break;
512  case PWP_FILEDEST_SIZE: // silence compiler warning
513  break;
514  }
515  }
516  return ret;
517 }
518 
519 static const char *invalid = "!invalid";
520 
521 
522 const char *
524 {
525  switch (enc) {
526  case PWP_ENCODING_ASCII: return "ascii";
527  case PWP_ENCODING_BINARY: return "binary";
528  case PWP_ENCODING_UNFORMATTED: return "unformatted";
529  case PWP_ENCODING_SIZE: // silence compiler warning
530  break;
531  }
532  return invalid;
533 }
534 
535 
536 const char *
538 {
539  switch (prec) {
540  case PWP_PRECISION_SINGLE: return "single";
541  case PWP_PRECISION_DOUBLE: return "double";
542  case PWP_PRECISION_SIZE: // silence compiler warning
543  break;
544  }
545  return invalid;
546 }
547 
548 
549 const char *
551 {
552  switch (dim) {
553  case PWP_DIMENSION_2D: return "2D";
554  case PWP_DIMENSION_3D: return "3D";
555  case PWP_DIMENSION_SIZE: // silence compiler warning
556  break;
557  }
558  return invalid;
559 }
#define CAEPU_CLKS_TO_HMS(c, h, m, s)
Returns the clock value c decomposed into hours, minutes, and seconds (PWP_INT32). That is, c == (h * 3600 + m * 60 + s) * CLOCKS_PER_SEC.
Definition: apiCAEPUtils.h:998
static const char * invalid
PWP_ENUM_VALTYPE
Supported PWP-API getValue() transfer types.
Definition: apiPWP.h:696
static void sendClkDiffTimeMsg(CAEP_RTITEM *pRti, const char txt[], CAEPU_ENUM_CLOCKS startId, CAEPU_ENUM_CLOCKS endId)
#define CAEP_INFO_GROUP
Definition: apiCAEP.h:53
transfer value is a PWP_REAL
Definition: apiPWP.h:700
PWP_ENUM_ENCODING encoding
export file encoding.
Definition: apiCAEP.h:195
unsigned int PWP_UINT32
32-bit unsigned integer
Definition: apiPWP.h:210
CAEP_RTITEM * caeuFindFormatById(PWP_UINT32 id)
Find an item in caepRtItem[] by it&#39;s id.
PWU_RTITEM * pApiData
Pointer to the associated PWU_RTITEM structure.
Definition: apiCAEPUtils.h:133
Pointwise Plugin API (PWP-API)
PWP_BOOL PwuPublishValueDefinition(const char group[], const char name[], PWP_ENUM_VALTYPE type, const char value[], const char access[], const char desc[], const char range[])
Create a value.
sysFILEMODE
Bit flags used for pwpFileOpen(mode)
Definition: pwpPlatform.h:60
void PwuSendInfoMsg(const char api[], const char txt[], PWP_UINT32 code)
Send an info text message (PWP_MSGID_INFO) to the framework.
const char * caeuEncodeToText(PWP_ENUM_ENCODING enc)
Converts a PWP_ENUM_ENCODING value to a text string representation.
int caeuFileOpen(CAEP_RTITEM *pRti, const CAEP_WRITEINFO *pWriteInfo)
Prepare pRti for file I/O as specified by pWriteInfo.
PWP_BOOL caeuPublishHighOrderValueDefinitions(const PWP_UINT32 maxPolynomialDegree)
Enables support for the export of high order meshes and publishes all needed value definitions...
#define CAEP_VALUE_GROUP
Definition: apiCAEP.h:49
PWP_BOOL PwuProgressBegin(const char api[], PWP_UINT32 totalSteps)
Send a progress begin message (PWP_MSGID_PROGBEGIN) to the framework.
int pwpFileClose(FILE *fp)
Closes a file opened with pwpFileOpen().
Pointwise Grid Model API Specification (PWGM-API)
#define CAEPU_RT_CLKS_DIFF(rti, startId, endId)
Returns the clock time difference between startId and endId as clocks[endId] - clocks[startId]. The ids are validated.
Definition: apiCAEPUtils.h:930
PWP_ENUM_PRECISION
File precision values.
Definition: apiPWP.h:802
CAEP_FORMATINFO FormatInfo
The CAE Plugin format data.
Definition: apiCAEPUtils.h:129
const char * caeuDimensionToText(PWP_ENUM_DIMENSION dim)
Converts a PWP_ENUM_DIMENSION value to a text string representation.
FILE * pwpFileOpen(const char *filename, int mode)
Opens a file for I/O.
CAEPU_ENUM_CLOCKS
Supported CAEPU clock id values.
Definition: apiCAEPUtils.h:102
#define PWP_CAST_BOOL(v)
Cast a value to a PWP_BOOL value (PWP_TRUE or PWP_FALSE)
Definition: apiPWP.h:312
#define PWP_TRUE
PWP_BOOL logical &quot;true&quot; value.
Definition: apiPWP.h:309
void caeuSendErrorMsg(CAEP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
Send an error text message (PWP_MSGID_ERROR) to the framework.
const char * fileDest
requested file destination.
Definition: apiCAEP.h:187
PWP_BOOL caeuProgressIncr(CAEP_RTITEM *pRti)
Completes a progress tracking sub-step.
PWP_BOOL caeuProgressEndStep(CAEP_RTITEM *pRti)
Completes a progress tracking major step.
Cross Platform Functions.
void caeuSendWarningMsg(CAEP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
Send a warning text message (PWP_MSGID_WARNING) to the framework.
static int openFileName(CAEP_RTITEM *pRti, const CAEP_WRITEINFO *pWriteInfo)
#define CAEPU_CLKS_TO_MSECS(c)
Returns the clock value c as milli seconds (PWP_INT32). Only whole ms values are possible.
Definition: apiCAEPUtils.h:973
PWP_BOOL caeuProgressBeginStep(CAEP_RTITEM *pRti, PWP_UINT32 total)
Begins a progress tracking step.
PWP_UINT32 caepFormatCnt
The number of entries in caepRtItem[] array.
Definition: apiCAEP.cxx:36
CAEP_RTITEM caepRtItem[]
The runtime array of CAEP_RTITEM items.
Definition: apiCAEP.cxx:30
FILE * fp
Runtime FILE pointer.
Definition: apiCAEPUtils.h:199
transfer value is a PWP_BOOL
Definition: apiPWP.h:702
CAEP utilities.
int caeuFileClose(CAEP_RTITEM *pRti, const CAEP_WRITEINFO *pWriteInfo)
Closes pRti for file I/O as specified by pWriteInfo.
PWP_BOOL PwuAssignValueEnum(const char group[], const char name[], const char value[], bool createIfNotExists)
void PwuSendWarningMsg(const char api[], const char txt[], PWP_UINT32 code)
Send a warning text message (PWP_MSGID_WARNING) to the framework.
PWP_ENUM_DIMENSION
Supported dimensionality values.
Definition: apiPWP.h:763
int pwpCwdPop(void)
Restore the current directory.
PWP_BOOL caeuProgressInit(CAEP_RTITEM *pRti, PWP_UINT32 cnt)
Initializes a progress tracking session.
PWP_BOOL caeuAssignInfoValue(const char key[], const char value[], bool createIfNotExists)
Creates a key/value pair that defines a CAE info attribute.
PWP_BOOL PwModGetAttributeString(PWGM_HGRIDMODEL model, const char *name, const char **val)
Get an attribute value as a specific type.
int PWP_BOOL
logical value
Definition: apiPWP.h:303
PWP_ENUM_ENCODING caeuFileEncoding(PWGM_HGRIDMODEL model)
Get the user-requested file encoding.
PWP_ENUM_ENCODING
File encoding values.
Definition: apiPWP.h:782
CAE export write control information.
Definition: apiCAEP.h:184
void caeuSendDebugMsg(CAEP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
Send a debug text message (PWP_MSGID_DEBUG) to the framework.
transfer value is a PWP_UINT
Definition: apiPWP.h:699
void PwuSendDebugMsg(const char api[], const char txt[], PWP_UINT32 code)
Send a debug text message (PWP_MSGID_DEBUG) to the framework.
transfer value is a const char*
Definition: apiPWP.h:701
void PwuSendErrorMsg(const char api[], const char txt[], PWP_UINT32 code)
Send an error text message (PWP_MSGID_ERROR) to the framework.
CAEP_RTITEM * caeuFindFormatByName(const char name[])
Find an item in caepRtItem[] by it&#39;s name.
const char * caeuPrecisionToText(PWP_ENUM_PRECISION prec)
Converts a PWP_ENUM_PRECISION value to a text string representation.
int pwpFileDelete(const char *filename)
Delete a file.
PWP_BOOL caeuPublishMeshLinkValueDefinitions(const char *indexScheme)
Enables support for the export of MeshLink data and publishes all needed value definitions.
PWP_ENDIANNESS caeuFileByteOrder(PWGM_HGRIDMODEL model)
Get the user-requested file byte order.
PWP_BOOL caeuPublishValueDefinition(const char key[], PWP_ENUM_VALTYPE type, const char value[], const char access[], const char desc[], const char range[])
Creates a collection of key/value pairs that represent a published CAE attribute definition.
void caeuSendInfoMsg(CAEP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
Send an info text message (PWP_MSGID_INFO) to the framework.
void PwuProgressEnd(const char api[], PWP_BOOL ok)
Send a progress end message (PWP_MSGID_PROGEND) to the framework.
const char * name
full API spec name
Definition: apiPWP.h:655
static int fileDestCwdPush(const char *fileDest)
PWP_ENUM_PRECISION caeuFilePrecision(PWGM_HGRIDMODEL model)
Get the user-requested file precision.
PWP_ENDIANNESS
Flags used to indicate endianness or control endian behaviors in functions.
Definition: apiPWP.h:822
The data representing a CAE exporter instance.
Definition: apiCAEPUtils.h:124
PWP_ENUM_FILEDEST fileDest
Specifies the desired output destination type.
Definition: apiCAEP.h:121
#define FILENAME_MAX
Definition: pwpPlatform.cxx:60
void caeuProgressEnd(CAEP_RTITEM *pRti, PWP_BOOL ok)
Ends all progress tracking.
An opaque handle to a grid model.
Definition: apiGridModel.h:326
#define PWP_UINT32_MAX
maximum valid PWP_UINT32 value
Definition: apiPWP.h:213
int pwpCwdPush(const char *dir)
Change the current directory using a stack.
PWP_BOOL PwuProgressStatus(const char api[], PWP_UINT32 complete, PWP_UINT32 total)
Send a progress status message (PWP_MSGID_PROGSTATUS, value &gt;= 0) to the framework.
PWP_BOOL PwModGetAttributeBOOL(PWGM_HGRIDMODEL model, const char *name, PWP_BOOL *val)
PWP_ENDIANNESS PwuGetOsEndianness(void)
Query the OS&#39;s native endianness.
PWP_BOOL PwuProgressNextStep(const char api[])
Send a progress &quot;next step&quot; message (PWP_MSGID_PROGSTATUS, value = -1) to the framework.
PWP_APIINFO apiInfo
The PWP-API instance information.
Definition: apiPWPUtils.h:48
PWP_BOOL caeuExportStructuredAsUnstructured(PWGM_HGRIDMODEL model)
Get the user-requested structured grid handling.
#define PWP_FALSE
PWP_BOOL logical &quot;false&quot; value.
Definition: apiPWP.h:306
int PWP_INT32
32-bit integer
Definition: apiPWP.h:207
PWP_BOOL caeuExportBndryConditionsOnly(PWGM_HGRIDMODEL model)
Get the user-requested bc export option.
static void sendDiffTimeMsg(CAEP_RTITEM *pRti, const char txt[], clock_t diff)