Pointwise Plugin SDK
runtimeWrite.cxx
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * CaeXxxxx implementation of runtimeWrite(), runtimeCreate(), and
4  * runtimeDestroy()
5  *
6  * Proprietary software product of Pointwise, Inc.
7  * Copyright (c) 1995-2018 Pointwise, Inc.
8  * All rights reserved.
9  *
10  ***************************************************************************/
11 
12 #include "apiCAEP.h"
13 #include "apiCAEPUtils.h"
14 #include "apiGridModel.h"
15 #include "apiPWP.h"
16 #include "runtimeWrite.h"
17 #include "pwpPlatform.h"
18 
19 
20 #if 0
21 /**************************************/
22 static void
23 stepN(CAEP_RTITEM *pRti)
24 {
25  PWP_UINT32 cnt = 1; /* the # of MINOR progress sub-steps */
26  if (caeuProgressBeginStep(pRti, cnt)) {
27  while (cnt--) {
28  /*
29  // PUT YOUR SUB-STEP OUTPUT LOGIC HERE
30  */
31  /* incr to next sub-step */
32  caeuProgressIncr(pRti);
33  }
34  caeuProgressEndStep(pRti);
35  }
36 }
37 #endif
38 
39 
40 /**************************************/
43  const CAEP_WRITEINFO *pWriteInfo)
44 {
45  PWP_BOOL ret = PWP_FALSE;
46 
47  if (pRti && model && pWriteInfo) {
48  PWP_UINT32 cnt = 1; /* the # of MAJOR progress steps */
49 
50  if (caeuProgressInit(pRti, cnt)) {
51  /*
52  // PUT YOUR MAJOR-STEP OUTPUT LOGIC HERE
53  step1(pRti);
54  step2(pRti);
55  ...
56  stepN(pRti);
57  */
58  caeuProgressEnd(pRti, ret);
59  ret = !pRti->opAborted;
60  }
61  }
62  return ret;
63 }
64 
65 
68 {
69  PWP_BOOL ret = PWP_TRUE;
70 
71  //-----------------------------------------------------------------------
72  // BYTE ORDERING:
73  // Uncomment the appropriate lines below to control the byte ordering
74  // options supported by the solver. If "AllowedFileByteOrders" is not
75  // set, the plugin will use the platform's native byte ordering.
76  // Currently, Pointwise only runs on little endian, intel platforms. If
77  // the solver targeted by this plugin cannot import little endian files,
78  // you must force big endian export.
79  //-----------------------------------------------------------------------
80  //const char * orders = "BigEndian"; // force big endian export
81  //const char * orders = "LittleEndian"; // force little endian export
82  //const char * orders = "BigEndian|LittleEndian"; // support both
83  //ret = ret && caeuAssignInfoValue("AllowedFileByteOrders", orders, true);
84 
85  //-----------------------------------------------------------------------
86  // ELEMENT TOPOLOGY:
87  // Uncomment the lines below and edit the topos[] value to explicitly
88  // control the element topology options supported by the solver. If
89  // "AllowedElementTopologies" is not set, the allowed element topologies
90  // will be inferred from the supported element types.
91  //-----------------------------------------------------------------------
92  //const char topos[] = "Structured|Unstructured|Prismatic";
93  //ret = ret && caeuAssignInfoValue("AllowedElementTopologies", topos, true);
94 
95  // These attributes are for example only. You can publish any attribute
96  // needed for your solver.
97  //ret = ret &&
98  // caeuPublishValueDefinition("iterations", PWP_VALTYPE_UINT, "5",
99  // "RW", "Number of iterations", "0 2000") &&
100  // caeuPublishValueDefinition("magnitude", PWP_VALTYPE_INT, "-5",
101  // "RW", "Signed int magnitude", "-100 100") &&
102  // caeuPublishValueDefinition("mach", PWP_VALTYPE_REAL, "0.3", "RW",
103  // "Incoming flow velocity", "-Inf +Inf 0.0 50.0") &&
104  // caeuPublishValueDefinition("temperature", PWP_VALTYPE_REAL, "77.5",
105  // "RW", "Ambient temperature", "-Inf +Inf -100.0 3000.0") &&
106  // caeuPublishValueDefinition("temperature.units", PWP_VALTYPE_ENUM,
107  // "Fahrenheit", "RW", "Grid temperature units", TempUnitEnum) &&
108  // caeuPublishValueDefinition("units", PWP_VALTYPE_ENUM, "Inches",
109  // "RW", "Grid dimensional units", DimUnitEnum) &&
110  // caeuPublishValueDefinition("description", PWP_VALTYPE_STRING, "",
111  // "RW", "Grid description", "") &&
112  // caeuPublishValueDefinition("linear", PWP_VALTYPE_BOOL, "reject",
113  // "RW", "Grid is linear", "reject|accept");
114 
115  return ret;
116 }
117 
118 
119 PWP_VOID
121 {
122 }
PWP_BOOL runtimeWrite(CAEP_RTITEM *pRti, PWGM_HGRIDMODEL model, const CAEP_WRITEINFO *pWriteInfo)
unsigned int PWP_UINT32
32-bit unsigned integer
Definition: apiPWP.h:194
Pointwise Plugin API (PWP-API)
void PWP_VOID
no value
Definition: apiPWP.h:233
Pointwise Grid Model API Specification (PWGM-API)
PWP_BOOL runtimeCreate(CAEP_RTITEM *)
#define PWP_TRUE
PWP_BOOL logical "true" value.
Definition: apiPWP.h:227
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.
PWP_BOOL caeuProgressBeginStep(CAEP_RTITEM *pRti, PWP_UINT32 total)
Begins a progress tracking step.
CAEP utilities.
PWP_BOOL caeuProgressInit(CAEP_RTITEM *pRti, PWP_UINT32 cnt)
Initializes a progress tracking session.
int PWP_BOOL
logical value
Definition: apiPWP.h:221
CAE export write control information.
Definition: apiCAEP.h:186
Pointwise CAE Plugin API (CAEP-API)
PWP_VOID runtimeDestroy(CAEP_RTITEM *)
The data representing a CAE exporter instance.
Definition: apiCAEPUtils.h:126
void caeuProgressEnd(CAEP_RTITEM *pRti, PWP_BOOL ok)
Ends all progress tracking.
An opaque handle to a grid model.
Definition: apiGridModel.h:327
#define PWP_FALSE
PWP_BOOL logical "false" value.
Definition: apiPWP.h:224