Pointwise Plugin SDK
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  ret = true; // All is OK. Nothing to do.
276  }
277  else if ((maxPolynomialDegree >= 2) && (maxPolynomialDegree <= 4)) {
278  auto maxPolyDegStr = [maxPolynomialDegree]()-> const char *
279  {
280  static char ret[2] = { '\0' };
281  ret[0] = (char)('0' + maxPolynomialDegree);
282  return ret;
283  };
284  ret = caeuAssignInfoValue("MaxMeshPolynomialDegree", maxPolyDegStr());
285  }
286 
287  return PWP_CAST_BOOL(ret);
288 }
289 
290 
291 PWP_BOOL
292 caeuPublishMeshLinkValueDefinitions(const char *indexScheme)
293 {
294  const std::vector<std::string> Schemes{
295  "ZeroBased", "OneBased", "Custom"
296  };
297  // indexScheme one of: "ZeroBased", "OneBased", and "Custom"
298  const bool ret = (nullptr != indexScheme) && (Schemes.end() !=
299  std::find(Schemes.begin(), Schemes.end(), indexScheme)) &&
300  caeuAssignInfoValue("MeshLinkSupported", "true", true) &&
301  caeuAssignInfoValue("IndexScheme", indexScheme, true);
302  return PWP_CAST_BOOL(ret);
303 }
304 
305 
308 {
309  PWP_ENDIANNESS ret = PwuGetOsEndianness(); // assume Native
310  const char *str = 0;
311  if (PwModGetAttributeString(model, "FileByteOrder", &str)) {
312  // one of: Native|Swap|LittleEndian|BigEndian
313  if (0 == strcmp(str, "Swap")) {
315  }
316  else if (0 == strcmp(str, "LittleEndian")) {
317  ret = PWP_ENDIAN_LITTLE;
318  }
319  else if (0 == strcmp(str, "BigEndian")) {
320  ret = PWP_ENDIAN_BIG;
321  }
322  }
323  return ret;
324 }
325 
326 
327 PWP_BOOL
329 {
330  PWP_BOOL ret;
331  return PwModGetAttributeBOOL(model, "BoundaryConditionsOnly", &ret) ? ret :
332  PWP_FALSE;
333 }
334 
335 
338 {
339  PWP_ENUM_ENCODING ret = PWP_ENCODING_SIZE;
340  const char *str = 0;
341  if (PwModGetAttributeString(model, "FileFormat", &str)) {
342  // one of: ASCII|Binary|Unformatted
343  if (0 == strcmp(str, "ASCII")) {
344  ret = PWP_ENCODING_ASCII;
345  }
346  else if (0 == strcmp(str, "Binary")) {
347  ret = PWP_ENCODING_BINARY;
348  }
349  else if (0 == strcmp(str, "Unformatted")) {
351  }
352  // else something very wrong
353  }
354  return ret;
355 }
356 
357 
360 {
361  PWP_ENUM_PRECISION ret = PWP_PRECISION_SIZE;
362  const char *str = 0;
363  if (PwModGetAttributeString(model, "FilePrecision", &str)) {
364  // one of: Single|Double
365  if (0 == strcmp(str, "Single")) {
366  ret = PWP_PRECISION_SINGLE;
367  }
368  else if (0 == strcmp(str, "Double")) {
369  ret = PWP_PRECISION_DOUBLE;
370  }
371  // else something very wrong
372  }
373  return ret;
374 }
375 
376 
377 PWP_BOOL
379 {
380  PWP_BOOL ret;
381  return PwModGetAttributeBOOL(model, "GridStructuredAsUnstructured", &ret)
382  ? ret : PWP_FALSE;
383 }
384 
385 
386 
387 static int
388 openFileName(CAEP_RTITEM* pRti, const CAEP_WRITEINFO *pWriteInfo)
389 {
390  int ret = 0;
391  if ((nullptr != pRti) && pWriteInfo && pWriteInfo->fileDest &&
392  pWriteInfo->fileDest[0]) {
393  caeuFileClose(pRti, pWriteInfo); // sanity check
394  switch (pWriteInfo->encoding) {
395  case PWP_ENCODING_ASCII:
396  pRti->fp = pwpFileOpen(pWriteInfo->fileDest,
398  break;
399  case PWP_ENCODING_BINARY:
400  pRti->fp = pwpFileOpen(pWriteInfo->fileDest,
402  break;
404  pRti->fp = pwpFileOpen(pWriteInfo->fileDest,
406  break;
407  case PWP_ENCODING_SIZE: // silence compiler warning
408  break;
409  }
410  ret = (0 != pRti->fp);
411  }
412  return ret;
413 }
414 
415 
416 static int
417 fileDestCwdPush(const char *fileDest)
418 {
419  int ret = 0;
420  if (fileDest && fileDest[0]) {
421  char dir[FILENAME_MAX];
422  char *p;
423  strcpy(dir, fileDest);
424  p = strrchr(dir, '/');
425  if (p) {
426  // strip file/base name from end of path
427  *p = '\0';
428  if (0 == pwpCwdPush(dir)) {
429  ret = 1;
430  }
431  }
432  }
433  return ret;
434 }
435 
436 
437 int
438 caeuFileOpen(CAEP_RTITEM* pRti, const CAEP_WRITEINFO *pWriteInfo)
439 {
440  int ret = 0;
441  if (nullptr != pRti) {
442  switch (pRti->FormatInfo.fileDest) {
443  /* Plugin wants a full "/path/to/filename.ext"
444  */
446  if (fileDestCwdPush(pWriteInfo->fileDest)) {
447  if (!openFileName(pRti, pWriteInfo)) {
448  pwpCwdPop();
449  }
450  else {
451  ret = 1;
452  }
453  }
454  break;
455 
456  /* Plugin wants a base "/path/to/basefilename" (no ext)
457  */
459  /* Set the cwd to the given folder.
460  It is the plugin's job to open the appropriate files.
461  */
462  ret = fileDestCwdPush(pWriteInfo->fileDest);
463  break;
464 
465  /* Plugin wants a folder "/path/to/folder/" (no file or ext)
466  */
467  case PWP_FILEDEST_FOLDER:
468  /* Set the cwd to the given folder.
469  It is the plugin's job to open the appropriate files.
470  */
471  if (0 == pwpCwdPush(pWriteInfo->fileDest)) {
472  ret = 1;
473  }
474  break;
475  case PWP_FILEDEST_SIZE: // silence compiler warning
476  break;
477  }
478  }
479  return ret;
480 }
481 
482 static const char *invalid = "!invalid";
483 
484 
485 const char *
487 {
488  switch (enc) {
489  case PWP_ENCODING_ASCII: return "ascii";
490  case PWP_ENCODING_BINARY: return "binary";
491  case PWP_ENCODING_UNFORMATTED: return "unformatted";
492  case PWP_ENCODING_SIZE: // silence compiler warning
493  break;
494  }
495  return invalid;
496 }
497 
498 
499 const char *
501 {
502  switch (prec) {
503  case PWP_PRECISION_SINGLE: return "single";
504  case PWP_PRECISION_DOUBLE: return "double";
505  case PWP_PRECISION_SIZE: // silence compiler warning
506  break;
507  }
508  return invalid;
509 }
510 
511 
512 const char *
514 {
515  switch (dim) {
516  case PWP_DIMENSION_2D: return "2D";
517  case PWP_DIMENSION_3D: return "3D";
518  case PWP_DIMENSION_SIZE: // silence compiler warning
519  break;
520  }
521  return invalid;
522 }
PWP_FILEDEST_FILENAME
@ PWP_FILEDEST_FILENAME
Definition: apiPWP.h:744
caeuExportStructuredAsUnstructured
PWP_BOOL caeuExportStructuredAsUnstructured(PWGM_HGRIDMODEL model)
Get the user-requested structured grid handling.
Definition: apiCAEPUtils.cxx:378
caeuDimensionToText
const char * caeuDimensionToText(PWP_ENUM_DIMENSION dim)
Converts a PWP_ENUM_DIMENSION value to a text string representation.
Definition: apiCAEPUtils.cxx:513
caeuPrecisionToText
const char * caeuPrecisionToText(PWP_ENUM_PRECISION prec)
Converts a PWP_ENUM_PRECISION value to a text string representation.
Definition: apiCAEPUtils.cxx:500
caeuFilePrecision
PWP_ENUM_PRECISION caeuFilePrecision(PWGM_HGRIDMODEL model)
Get the user-requested file precision.
Definition: apiCAEPUtils.cxx:359
pwpBinary
@ pwpBinary
Definition: pwpPlatform.h:89
PWP_UINT32_MAX
#define PWP_UINT32_MAX
maximum valid PWP_UINT32 value
Definition: apiPWP.h:213
PWP_PRECISION_DOUBLE
@ PWP_PRECISION_DOUBLE
Definition: apiPWP.h:804
CAEPU_RT_CLKS_DIFF
#define CAEPU_RT_CLKS_DIFF(rti, startId, endId)
Returns the clock time difference between startId and endId as clocks[endId] - clocks[startId]....
Definition: apiCAEPUtils.h:930
PWP_DIMENSION_3D
@ PWP_DIMENSION_3D
Definition: apiPWP.h:765
PwuProgressEnd
void PwuProgressEnd(const char api[], PWP_BOOL ok)
Send a progress end message (PWP_MSGID_PROGEND) to the framework.
Definition: apiPWPUtils.cxx:163
PWP_ENUM_VALTYPE
PWP_ENUM_VALTYPE
Supported PWP-API getValue() transfer types.
Definition: apiPWP.h:696
CAEPU_CLKS_PROGINIT
@ CAEPU_CLKS_PROGINIT
Definition: apiCAEPUtils.h:104
caepRtItem
CAEP_RTITEM caepRtItem[]
The runtime array of CAEP_RTITEM items.
Definition: apiCAEP.cxx:30
PWP_UINT32
unsigned int PWP_UINT32
32-bit unsigned integer
Definition: apiPWP.h:210
CAEPU_CLKS_PROGEND
@ CAEPU_CLKS_PROGEND
Definition: apiCAEPUtils.h:108
CAEP_RTITEM::pApiData
PWU_RTITEM * pApiData
Pointer to the associated PWU_RTITEM structure.
Definition: apiCAEPUtils.h:133
pwpFileClose
int pwpFileClose(FILE *fp)
Closes a file opened with pwpFileOpen().
Definition: pwpPlatform.cxx:285
CAEP_RTITEM
The data representing a CAE exporter instance.
Definition: apiCAEPUtils.h:124
caeuFindFormatByName
CAEP_RTITEM * caeuFindFormatByName(const char name[])
Find an item in caepRtItem[] by it's name.
Definition: apiCAEPUtils.cxx:38
PWP_ENDIAN_BIG
@ PWP_ENDIAN_BIG
Definition: apiPWP.h:827
caeuPublishMeshLinkValueDefinitions
PWP_BOOL caeuPublishMeshLinkValueDefinitions(const char *indexScheme)
Enables support for the export of MeshLink data and publishes all needed value definitions.
Definition: apiCAEPUtils.cxx:292
PWP_INT32
int PWP_INT32
32-bit integer
Definition: apiPWP.h:207
pwpUnformatted
@ pwpUnformatted
Definition: pwpPlatform.h:93
caeuProgressIncr
PWP_BOOL caeuProgressIncr(CAEP_RTITEM *pRti)
Completes a progress tracking sub-step.
Definition: apiCAEPUtils.cxx:89
PwuProgressStatus
PWP_BOOL PwuProgressStatus(const char api[], PWP_UINT32 complete, PWP_UINT32 total)
Send a progress status message (PWP_MSGID_PROGSTATUS, value >= 0) to the framework.
Definition: apiPWPUtils.cxx:173
pwpFileOpen
FILE * pwpFileOpen(const char *filename, int mode)
Opens a file for I/O.
Definition: pwpPlatform.cxx:230
sendDiffTimeMsg
static void sendDiffTimeMsg(CAEP_RTITEM *pRti, const char txt[], clock_t diff)
Definition: apiCAEPUtils.cxx:114
PWGM_HGRIDMODEL
An opaque handle to a grid model.
Definition: apiGridModel.h:326
PwuPublishValueDefinition
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.
Definition: apiPWPUtils.cxx:909
caeuProgressEndStep
PWP_BOOL caeuProgressEndStep(CAEP_RTITEM *pRti)
Completes a progress tracking major step.
Definition: apiCAEPUtils.cxx:146
CAEPU_CLKS_ENDSTEP
@ CAEPU_CLKS_ENDSTEP
Definition: apiCAEPUtils.h:107
PwuProgressNextStep
PWP_BOOL PwuProgressNextStep(const char api[])
Send a progress "next step" message (PWP_MSGID_PROGSTATUS, value = -1) to the framework.
Definition: apiPWPUtils.cxx:189
sendClkDiffTimeMsg
static void sendClkDiffTimeMsg(CAEP_RTITEM *pRti, const char txt[], CAEPU_ENUM_CLOCKS startId, CAEPU_ENUM_CLOCKS endId)
Definition: apiCAEPUtils.cxx:136
PwuGetOsEndianness
PWP_ENDIANNESS PwuGetOsEndianness(void)
Query the OS's native endianness.
Definition: apiPWPUtils.cxx:218
caeuSendInfoMsg
void caeuSendInfoMsg(CAEP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
Send an info text message (PWP_MSGID_INFO) to the framework.
Definition: apiCAEPUtils.cxx:224
CAEPU_CLKS_TO_HMS
#define CAEPU_CLKS_TO_HMS(c, h, m, s)
Returns the clock value c decomposed into hours, minutes, and seconds (PWP_INT32)....
Definition: apiCAEPUtils.h:998
caeuSendDebugMsg
void caeuSendDebugMsg(CAEP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
Send a debug text message (PWP_MSGID_DEBUG) to the framework.
Definition: apiCAEPUtils.cxx:215
PWP_DIMENSION_2D
@ PWP_DIMENSION_2D
Definition: apiPWP.h:764
pwpAscii
@ pwpAscii
Definition: pwpPlatform.h:95
PwuSendWarningMsg
void PwuSendWarningMsg(const char api[], const char txt[], PWP_UINT32 code)
Send a warning text message (PWP_MSGID_WARNING) to the framework.
Definition: apiPWPUtils.cxx:123
apiGridModel.h
Pointwise Grid Model API Specification (PWGM-API)
PWP_ENUM_ENCODING
PWP_ENUM_ENCODING
File encoding values.
Definition: apiPWP.h:782
CAEP_INFO_GROUP
#define CAEP_INFO_GROUP
Definition: apiCAEP.h:53
PwuSendInfoMsg
void PwuSendInfoMsg(const char api[], const char txt[], PWP_UINT32 code)
Send an info text message (PWP_MSGID_INFO) to the framework.
Definition: apiPWPUtils.cxx:116
caeuProgressBeginStep
PWP_BOOL caeuProgressBeginStep(CAEP_RTITEM *pRti, PWP_UINT32 total)
Begins a progress tracking step.
Definition: apiCAEPUtils.cxx:70
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
PWP_FILEDEST_FOLDER
@ PWP_FILEDEST_FOLDER
Definition: apiPWP.h:746
caeuSendErrorMsg
void caeuSendErrorMsg(CAEP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
Send an error text message (PWP_MSGID_ERROR) to the framework.
Definition: apiCAEPUtils.cxx:242
sysFILEMODE
sysFILEMODE
Bit flags used for pwpFileOpen(mode)
Definition: pwpPlatform.h:60
caeuAssignInfoValue
PWP_BOOL caeuAssignInfoValue(const char key[], const char value[], bool createIfNotExists)
Creates a key/value pair that defines a CAE info attribute.
Definition: apiCAEPUtils.cxx:262
pwpPlatform.h
Cross Platform Functions.
CAEP_WRITEINFO::encoding
PWP_ENUM_ENCODING encoding
export file encoding.
Definition: apiCAEP.h:195
PwuSendErrorMsg
void PwuSendErrorMsg(const char api[], const char txt[], PWP_UINT32 code)
Send an error text message (PWP_MSGID_ERROR) to the framework.
Definition: apiPWPUtils.cxx:130
PWP_FILEDEST_BASENAME
@ PWP_FILEDEST_BASENAME
Definition: apiPWP.h:745
caeuFileEncoding
PWP_ENUM_ENCODING caeuFileEncoding(PWGM_HGRIDMODEL model)
Get the user-requested file encoding.
Definition: apiCAEPUtils.cxx:337
CAEPU_CLKS_PROGINCR
@ CAEPU_CLKS_PROGINCR
Definition: apiCAEPUtils.h:106
pwpCwdPop
int pwpCwdPop(void)
Restore the current directory.
Definition: pwpPlatform.cxx:486
caeuEncodeToText
const char * caeuEncodeToText(PWP_ENUM_ENCODING enc)
Converts a PWP_ENUM_ENCODING value to a text string representation.
Definition: apiCAEPUtils.cxx:486
caeuProgressInit
PWP_BOOL caeuProgressInit(CAEP_RTITEM *pRti, PWP_UINT32 cnt)
Initializes a progress tracking session.
Definition: apiCAEPUtils.cxx:53
openFileName
static int openFileName(CAEP_RTITEM *pRti, const CAEP_WRITEINFO *pWriteInfo)
Definition: apiCAEPUtils.cxx:388
pwpWrite
@ pwpWrite
Definition: pwpPlatform.h:77
caepFormatCnt
PWP_UINT32 caepFormatCnt
The number of entries in caepRtItem[] array.
Definition: apiCAEP.cxx:36
caeuSendWarningMsg
void caeuSendWarningMsg(CAEP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
Send a warning text message (PWP_MSGID_WARNING) to the framework.
Definition: apiCAEPUtils.cxx:233
CAEPU_CLKS_PROGUPDATE
@ CAEPU_CLKS_PROGUPDATE
Definition: apiCAEPUtils.h:103
PWP_FALSE
#define PWP_FALSE
PWP_BOOL logical "false" value.
Definition: apiPWP.h:306
CAEP_VALUE_GROUP
#define CAEP_VALUE_GROUP
Definition: apiCAEP.h:49
PwModGetAttributeBOOL
PWP_BOOL PwModGetAttributeBOOL(PWGM_HGRIDMODEL model, const char *name, PWP_BOOL *val)
Definition: apiGridModel.cxx:207
PWP_ENDIAN_LITTLE
@ PWP_ENDIAN_LITTLE
Definition: apiPWP.h:826
PWP_ENCODING_ASCII
@ PWP_ENCODING_ASCII
Definition: apiPWP.h:783
caeuPublishValueDefinition
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.
Definition: apiCAEPUtils.cxx:252
caeuExportBndryConditionsOnly
PWP_BOOL caeuExportBndryConditionsOnly(PWGM_HGRIDMODEL model)
Get the user-requested bc export option.
Definition: apiCAEPUtils.cxx:328
caeuFileOpen
int caeuFileOpen(CAEP_RTITEM *pRti, const CAEP_WRITEINFO *pWriteInfo)
Prepare pRti for file I/O as specified by pWriteInfo.
Definition: apiCAEPUtils.cxx:438
PWP_ENCODING_BINARY
@ PWP_ENCODING_BINARY
Definition: apiPWP.h:784
PWP_ENDIANNESS
PWP_ENDIANNESS
Flags used to indicate endianness or control endian behaviors in functions.
Definition: apiPWP.h:822
CAEPU_ENUM_CLOCKS
CAEPU_ENUM_CLOCKS
Supported CAEPU clock id values.
Definition: apiCAEPUtils.h:102
fileDestCwdPush
static int fileDestCwdPush(const char *fileDest)
Definition: apiCAEPUtils.cxx:417
PWP_BOOL
int PWP_BOOL
logical value
Definition: apiPWP.h:303
pwpFileDelete
int pwpFileDelete(const char *filename)
Delete a file.
Definition: pwpPlatform.cxx:429
caeuPublishHighOrderValueDefinitions
PWP_BOOL caeuPublishHighOrderValueDefinitions(const PWP_UINT32 maxPolynomialDegree)
Enables support for the export of high order meshes and publishes all needed value definitions.
Definition: apiCAEPUtils.cxx:271
caeuFindFormatById
CAEP_RTITEM * caeuFindFormatById(PWP_UINT32 id)
Find an item in caepRtItem[] by it's id.
Definition: apiCAEPUtils.cxx:23
CAEP_WRITEINFO
CAE export write control information.
Definition: apiCAEP.h:184
caeuFileClose
int caeuFileClose(CAEP_RTITEM *pRti, const CAEP_WRITEINFO *pWriteInfo)
Closes pRti for file I/O as specified by pWriteInfo.
Definition: apiCAEPUtils.cxx:176
PWP_TRUE
#define PWP_TRUE
PWP_BOOL logical "true" value.
Definition: apiPWP.h:309
PWU_RTITEM::apiInfo
PWP_APIINFO apiInfo
The PWP-API instance information.
Definition: apiPWPUtils.h:48
CAEP_FORMATINFO::fileDest
PWP_ENUM_FILEDEST fileDest
Specifies the desired output destination type.
Definition: apiCAEP.h:121
PwuSendDebugMsg
void PwuSendDebugMsg(const char api[], const char txt[], PWP_UINT32 code)
Send a debug text message (PWP_MSGID_DEBUG) to the framework.
Definition: apiPWPUtils.cxx:109
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
PWP_ENCODING_UNFORMATTED
@ PWP_ENCODING_UNFORMATTED
Definition: apiPWP.h:785
CAEP_WRITEINFO::fileDest
const char * fileDest
requested file destination.
Definition: apiCAEP.h:187
apiPWP.h
Pointwise Plugin API (PWP-API)
CAEPU_CLKS_BEGSTEP
@ CAEPU_CLKS_BEGSTEP
Definition: apiCAEPUtils.h:105
pwpCwdPush
int pwpCwdPush(const char *dir)
Change the current directory using a stack.
Definition: pwpPlatform.cxx:461
CAEP_RTITEM::FormatInfo
CAEP_FORMATINFO FormatInfo
The CAE Plugin format data.
Definition: apiCAEPUtils.h:129
CAEPU_CLKS_TO_MSECS
#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_ENUM_DIMENSION
PWP_ENUM_DIMENSION
Supported dimensionality values.
Definition: apiPWP.h:763
FILENAME_MAX
#define FILENAME_MAX
Definition: pwpPlatform.cxx:60
caeuFileByteOrder
PWP_ENDIANNESS caeuFileByteOrder(PWGM_HGRIDMODEL model)
Get the user-requested file byte order.
Definition: apiCAEPUtils.cxx:307
apiCAEPUtils.h
CAEP utilities.
PwuAssignValueEnum
PWP_BOOL PwuAssignValueEnum(const char group[], const char name[], const char value[], bool createIfNotExists)
Definition: apiPWPUtils.cxx:902
invalid
static const char * invalid
Definition: apiCAEPUtils.cxx:482
caeuProgressEnd
void caeuProgressEnd(CAEP_RTITEM *pRti, PWP_BOOL ok)
Ends all progress tracking.
Definition: apiCAEPUtils.cxx:161
CAEP_RTITEM::fp
FILE * fp
Runtime FILE pointer.
Definition: apiCAEPUtils.h:199
PWP_PRECISION_SINGLE
@ PWP_PRECISION_SINGLE
Definition: apiPWP.h:803
PWP_ENUM_PRECISION
PWP_ENUM_PRECISION
File precision values.
Definition: apiPWP.h:802
PWP_APIINFO::name
const char * name
full API spec name
Definition: apiPWP.h:655
PwuProgressBegin
PWP_BOOL PwuProgressBegin(const char api[], PWP_UINT32 totalSteps)
Send a progress begin message (PWP_MSGID_PROGBEGIN) to the framework.
Definition: apiPWPUtils.cxx:152