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 {
44  // The PWGM_HGRIDMODEL and CAEP_WRITEINFO function arguments are deprecated.
45  // The use of pRti->model and pRti->pWriteInfo is now preferred.
46  // The grid model data is accessed via pRti->model.
47  // The user or Glyph specified export options are available directly via
48  // pRti->pWriteInfo or using one of the CAEPU_RT_XXXX(pRti) macros.
49  PWP_BOOL ret = PWP_FALSE;
50  PWP_UINT32 cnt = 1; // the # of MAJOR progress steps
51  if (caeuProgressInit(pRti, cnt)) {
52  // PUT YOUR MAJOR-STEP OUTPUT LOGIC HERE
53  //step1(pRti);
54  //step2(pRti);
55  //...
56  //stepN(pRti);
57  caeuProgressEnd(pRti, ret);
58  ret = !pRti->opAborted;
59  }
60  return ret;
61 }
62 
63 
66 {
67  PWP_BOOL ret = PWP_TRUE;
68 
69  //-----------------------------------------------------------------------
70  // BYTE ORDERING:
71  // Uncomment the appropriate lines below to control the byte ordering
72  // options supported by the solver. If "AllowedFileByteOrders" is not
73  // set, the plugin will use the platform's native byte ordering.
74  // Currently, Pointwise only runs on little endian, intel platforms. If
75  // the solver targeted by this plugin cannot import little endian files,
76  // you must force big endian export.
77  //-----------------------------------------------------------------------
78  //const char * orders = "BigEndian"; // force big endian export
79  //const char * orders = "LittleEndian"; // force little endian export
80  //const char * orders = "BigEndian|LittleEndian"; // support both
81  //ret = ret && caeuAssignInfoValue("AllowedFileByteOrders", orders, true);
82 
83  //-----------------------------------------------------------------------
84  // ELEMENT TOPOLOGY:
85  // Uncomment the lines below and edit the topos[] value to explicitly
86  // control the element topology options supported by the solver. If
87  // "AllowedElementTopologies" is not set, the allowed element topologies
88  // will be inferred from the supported element types.
89  //-----------------------------------------------------------------------
90  //const char topos[] = "Structured|Unstructured|Prismatic";
91  //ret = ret && caeuAssignInfoValue("AllowedElementTopologies", topos, true);
92 
93  //-----------------------------------------------------------------------
94  // NON-INFLATED BC TYPE NAMES:
95  // Uncomment the lines below and edit the shadowTypes[] value to
96  // specify which of the defined BCs types are non-inflated. Normally, if a
97  // BC is applied to a floating baffle domain, or block-to-block connection
98  // domain, the interior points are "inflated" to create a zero thickness
99  // wall. However, if a non-inflated BC is used, the points are NOT
100  // inflated. These BC types are often used for flow-through or porous
101  // conditions.
102  //-----------------------------------------------------------------------
103  //const char * const shadowTypes = "bcname1|bcname2";
104  //ret = ret && caeuassigninfovalue("ShadowBcTypes", shadowTypes, true);
105 
106  // These attributes are for example only. You can publish any attribute
107  // needed for your solver.
108  //ret = ret &&
109  // caeuPublishValueDefinition("iterations", PWP_VALTYPE_UINT, "5",
110  // "RW", "Number of iterations", "0 2000") &&
111  // caeuPublishValueDefinition("magnitude", PWP_VALTYPE_INT, "-5",
112  // "RW", "Signed int magnitude", "-100 100") &&
113  // caeuPublishValueDefinition("mach", PWP_VALTYPE_REAL, "0.3", "RW",
114  // "Incoming flow velocity", "-Inf +Inf 0.0 50.0") &&
115  // caeuPublishValueDefinition("temperature", PWP_VALTYPE_REAL, "77.5",
116  // "RW", "Ambient temperature", "-Inf +Inf -100.0 3000.0") &&
117  // caeuPublishValueDefinition("temperature.units", PWP_VALTYPE_ENUM,
118  // "Fahrenheit", "RW", "Grid temperature units", TempUnitEnum) &&
119  // caeuPublishValueDefinition("units", PWP_VALTYPE_ENUM, "Inches",
120  // "RW", "Grid dimensional units", DimUnitEnum) &&
121  // caeuPublishValueDefinition("description", PWP_VALTYPE_STRING, "",
122  // "RW", "Grid description", "") &&
123  // caeuPublishValueDefinition("linear", PWP_VALTYPE_BOOL, "reject",
124  // "RW", "Grid is linear", "reject|accept");
125 
126  return ret;
127 }
128 
129 
130 PWP_VOID
132 {
133 }
PWP_BOOL runtimeWrite(CAEP_RTITEM *pRti, PWGM_HGRIDMODEL, const CAEP_WRITEINFO *)
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