Pointwise Plugin SDK
cstr/runtimeWrite.cxx
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * CaeXxxxx implementation of runtimeWrite(), runtimeCreate(), and
4  * runtimeDestroy()
5  *
6  * (C) 2021 Cadence Design Systems, Inc. All rights reserved worldwide.
7  *
8  ***************************************************************************/
9 
10 #include "apiCAEP.h"
11 #include "apiCAEPUtils.h"
12 #include "apiGridModel.h"
13 #include "apiPWP.h"
14 #include "runtimeWrite.h"
15 #include "pwpPlatform.h"
16 
17 
18 #if 0
19 static void
20 stepN(CAEP_RTITEM *pRti)
21 {
22  PWP_UINT32 cnt = 1; /* the # of MINOR progress sub-steps */
23  if (caeuProgressBeginStep(pRti, cnt)) {
24  while (cnt--) {
25  /*
26  // PUT YOUR SUB-STEP OUTPUT LOGIC HERE
27  */
28  /* incr to next sub-step */
29  caeuProgressIncr(pRti);
30  }
31  caeuProgressEndStep(pRti);
32  }
33 }
34 #endif
35 
36 
39 {
40  // The PWGM_HGRIDMODEL and CAEP_WRITEINFO function arguments are deprecated.
41  // The use of pRti->model and pRti->pWriteInfo is now preferred.
42  // The grid model data is accessed via pRti->model.
43  // The user or Glyph specified export options are available directly via
44  // pRti->pWriteInfo or using one of the CAEPU_RT_XXXX(pRti) macros.
45 
46  PWP_BOOL ret = PWP_FALSE;
47  PWP_UINT32 cnt = 1; // the # of MAJOR progress steps
48  if (caeuProgressInit(pRti, cnt)) {
49  // PUT YOUR MAJOR-STEP OUTPUT LOGIC HERE
50  //step1(pRti);
51  //step2(pRti);
52  //...
53  //stepN(pRti);
54  caeuProgressEnd(pRti, ret);
55  ret = !pRti->opAborted;
56  }
57 
58  return ret;
59 }
60 
61 
64 {
65  PWP_BOOL ret = PWP_TRUE;
66 
67  //-----------------------------------------------------------------------
68  // BYTE ORDERING:
69  // Uncomment the appropriate lines below to control the byte ordering
70  // options supported by the solver. If "AllowedFileByteOrders" is not
71  // set, the plugin will use the platform's native byte ordering.
72  // Currently, Pointwise only runs on little endian, intel platforms. If
73  // the solver targeted by this plugin cannot import little endian files,
74  // you must force big endian export.
75  //-----------------------------------------------------------------------
76  //const char * orders = "BigEndian"; // force big endian export
77  //const char * orders = "LittleEndian"; // force little endian export
78  //const char * orders = "BigEndian|LittleEndian"; // support both
79  //ret = ret && caeuAssignInfoValue("AllowedFileByteOrders", orders, true);
80 
81  //-----------------------------------------------------------------------
82  // ELEMENT TOPOLOGY:
83  // Uncomment the lines below and edit the topos[] value to explicitly
84  // control the element topology options supported by the solver. If
85  // "AllowedElementTopologies" is not set, the allowed element topologies
86  // will be inferred from the supported element types.
87  //-----------------------------------------------------------------------
88  //const char topos[] = "Structured|Unstructured|Prismatic";
89  //ret = ret && caeuAssignInfoValue("AllowedElementTopologies", topos, true);
90 
91  //-----------------------------------------------------------------------
92  // NON-INFLATED BC TYPE NAMES:
93  // Uncomment the lines below and edit the shadowTypes[] value to
94  // specify which of the defined BCs types are non-inflated. Normally, if a
95  // BC is applied to a floating baffle domain, or block-to-block connection
96  // domain, the interior points are "inflated" to create a zero thickness
97  // wall. However, if a non-inflated BC is used, the points are NOT
98  // inflated. These BC types are often used for flow-through or porous
99  // conditions.
100  //-----------------------------------------------------------------------
101  //const char * const shadowTypes = "bcname1|bcname2";
102  //ret = ret && caeuassigninfovalue("ShadowBcTypes", shadowTypes, true);
103 
104  // These attributes are for example only. You can publish any attribute
105  // needed for your solver.
106  //ret = ret &&
107  // caeuPublishValueDefinition("iterations", PWP_VALTYPE_UINT, "5",
108  // "RW", "Number of iterations", "0 2000") &&
109  // caeuPublishValueDefinition("magnitude", PWP_VALTYPE_INT, "-5",
110  // "RW", "Signed int magnitude", "-100 100") &&
111  // caeuPublishValueDefinition("mach", PWP_VALTYPE_REAL, "0.3", "RW",
112  // "Incoming flow velocity", "-Inf +Inf 0.0 50.0") &&
113  // caeuPublishValueDefinition("temperature", PWP_VALTYPE_REAL, "77.5",
114  // "RW", "Ambient temperature", "-Inf +Inf -100.0 3000.0") &&
115  // caeuPublishValueDefinition("temperature.units", PWP_VALTYPE_ENUM,
116  // "Fahrenheit", "RW", "Grid temperature units", TempUnitEnum) &&
117  // caeuPublishValueDefinition("units", PWP_VALTYPE_ENUM, "Inches",
118  // "RW", "Grid dimensional units", DimUnitEnum) &&
119  // caeuPublishValueDefinition("description", PWP_VALTYPE_STRING, "",
120  // "RW", "Grid description", "") &&
121  // caeuPublishValueDefinition("linear", PWP_VALTYPE_BOOL, "reject",
122  // "RW", "Grid is linear", "reject|accept");
123 
124  return ret;
125 }
126 
127 
128 PWP_VOID
130 {
131 }
PWP_UINT32
unsigned int PWP_UINT32
32-bit unsigned integer
Definition: apiPWP.h:210
CAEP_RTITEM
The data representing a CAE exporter instance.
Definition: apiCAEPUtils.h:124
caeuProgressIncr
PWP_BOOL caeuProgressIncr(CAEP_RTITEM *pRti)
Completes a progress tracking sub-step.
Definition: apiCAEPUtils.cxx:89
PWGM_HGRIDMODEL
An opaque handle to a grid model.
Definition: apiGridModel.h:326
PWP_VOID
void PWP_VOID
no value
Definition: apiPWP.h:317
caeuProgressEndStep
PWP_BOOL caeuProgressEndStep(CAEP_RTITEM *pRti)
Completes a progress tracking major step.
Definition: apiCAEPUtils.cxx:146
runtimeWrite.h
apiGridModel.h
Pointwise Grid Model API Specification (PWGM-API)
caeuProgressBeginStep
PWP_BOOL caeuProgressBeginStep(CAEP_RTITEM *pRti, PWP_UINT32 total)
Begins a progress tracking step.
Definition: apiCAEPUtils.cxx:70
pwpPlatform.h
Cross Platform Functions.
runtimeCreate
PWP_BOOL runtimeCreate(CAEP_RTITEM *)
Definition: cstr/runtimeWrite.cxx:63
apiCAEP.h
Pointwise CAE Plugin API (CAEP-API)
caeuProgressInit
PWP_BOOL caeuProgressInit(CAEP_RTITEM *pRti, PWP_UINT32 cnt)
Initializes a progress tracking session.
Definition: apiCAEPUtils.cxx:53
PWP_FALSE
#define PWP_FALSE
PWP_BOOL logical "false" value.
Definition: apiPWP.h:306
PWP_BOOL
int PWP_BOOL
logical value
Definition: apiPWP.h:303
CAEP_WRITEINFO
CAE export write control information.
Definition: apiCAEP.h:184
PWP_TRUE
#define PWP_TRUE
PWP_BOOL logical "true" value.
Definition: apiPWP.h:309
apiPWP.h
Pointwise Plugin API (PWP-API)
apiCAEPUtils.h
CAEP utilities.
caeuProgressEnd
void caeuProgressEnd(CAEP_RTITEM *pRti, PWP_BOOL ok)
Ends all progress tracking.
Definition: apiCAEPUtils.cxx:161
runtimeDestroy
PWP_VOID runtimeDestroy(CAEP_RTITEM *)
Definition: cstr/runtimeWrite.cxx:129
runtimeWrite
PWP_BOOL runtimeWrite(CAEP_RTITEM *pRti, PWGM_HGRIDMODEL, const CAEP_WRITEINFO *)
Definition: cstr/runtimeWrite.cxx:38