Go to the documentation of this file.
9 #ifndef _APICAEPUTILS_H_
10 #define _APICAEPUTILS_H_
62 #if !defined(CAEP_RUNTIME_INSTDATADECL)
63 # define CAEP_RUNTIME_INSTDATADECL
115 CAEPU_CLKS_LAST = CAEPU_CLKS_SIZE-1
245 clock_t clocks[CAEPU_CLKS_SIZE];
649 const char value[],
const char access[],
const char desc[],
668 bool createIfNotExists =
true);
772 #define CAEPU_RT_DIM(rti) (rti)->pWriteInfo->dimension
778 #define CAEPU_RT_DIM_TEXT(rti) \
779 caeuDimensionToText((rti)->pWriteInfo->dimension)
784 #define CAEPU_RT_DIM_IS(rti, d) PWP_CAST_BOOL((d) == CAEPU_RT_DIM(rti))
789 #define CAEPU_RT_DIM_3D(rti) CAEPU_RT_DIM_IS(rti, PWP_DIMENSION_3D)
794 #define CAEPU_RT_DIM_2D(rti) CAEPU_RT_DIM_IS(rti, PWP_DIMENSION_2D)
800 #define CAEPU_RT_PREC(rti) (rti)->pWriteInfo->precision
806 #define CAEPU_RT_PREC_TEXT(rti) \
807 caeuPrecisionToText((rti)->pWriteInfo->precision)
812 #define CAEPU_RT_PREC_IS(rti, prec) PWP_CAST_BOOL((prec) == CAEPU_RT_PREC(rti))
817 #define CAEPU_RT_PREC_SINGLE(rti) CAEPU_RT_PREC_IS(rti, PWP_PRECISION_SINGLE)
822 #define CAEPU_RT_PREC_DOUBLE(rti) CAEPU_RT_PREC_IS(rti, PWP_PRECISION_DOUBLE)
828 #define CAEPU_RT_ENCODING(rti) (rti)->pWriteInfo->encoding
834 #define CAEPU_RT_ENCODING_TEXT(rti) \
835 caeuEncodeToText((rti)->pWriteInfo->encoding)
840 #define CAEPU_RT_ENC_IS(rti, e) PWP_CAST_BOOL((e) == CAEPU_RT_ENCODING(rti))
845 #define CAEPU_RT_ENC_ASCII(rti) CAEPU_RT_ENC_IS(rti, PWP_ENCODING_ASCII)
850 #define CAEPU_RT_ENC_BINARY(rti) CAEPU_RT_ENC_IS(rti, PWP_ENCODING_BINARY)
855 #define CAEPU_RT_ENC_UNFORMATTED(rti) \
856 CAEPU_RT_ENC_IS(rti, PWP_ENCODING_UNFORMATTED)
863 #define CAEPU_RT_IS_ABORTED(rti) PWP_CAST_BOOL((rti)->opAborted)
868 #define CAEPU_RT_ABORT(rti) ((rti)->opAborted = PWP_TRUE)
910 #define CAEPU_RT_TRY(rti, theOp) \
911 ((rti)->opAborted ? PWP_FALSE : \
912 (((rti)->opAborted = !(theOp)), !CAEPU_RT_IS_ABORTED(rti)))
918 #define CAEPU_IS_CLKS_ID(id) \
919 PWP_CAST_BOOL(((id) >= 0) && ((id) <= CAEPU_CLKS_LAST))
924 #define CAEPU_RT_CLKS_ID(rti, id) (CAEPU_IS_CLKS_ID(id)? (rti)->clocks[id]: 0)
930 #define CAEPU_RT_CLKS_DIFF(rti, startId, endId) \
931 ((CAEPU_IS_CLKS_ID(startId) && CAEPU_IS_CLKS_ID(endId)) ? \
932 ((rti)->clocks[endId] - (rti)->clocks[startId]) : 0)
938 #define CAEPU_RT_CLKS_POLL(rti, id) \
939 CAEPU_RT_CLKS_DIFF(rti, id, CAEPU_CLKS_PROGINCR)
945 #define CAEPU_RT_CLKS_POLL_STEP(rti) \
946 CAEPU_RT_CLKS_POLL(rti, CAEPU_CLKS_BEGSTEP)
952 #define CAEPU_RT_CLKS_DIFF_STEP(rti) \
953 CAEPU_RT_CLKS_DIFF(rti, CAEPU_CLKS_BEGSTEP, CAEPU_CLKS_ENDSTEP)
959 #define CAEPU_RT_CLKS_POLL_TOTAL(rti) \
960 CAEPU_RT_CLKS_POLL(rti, CAEPU_CLKS_PROGINIT)
966 #define CAEPU_RT_CLKS_DIFF_TOTAL(rti) \
967 CAEPU_RT_CLKS_DIFF(rti, CAEPU_CLKS_PROGINIT, CAEPU_CLKS_PROGEND)
973 #define CAEPU_CLKS_TO_MSECS(c) ((PWP_INT32)((c) * 1000) / CLOCKS_PER_SEC)
979 #define CAEPU_CLKS_TO_SECS(c) ((PWP_INT32)(c) / CLOCKS_PER_SEC)
985 #define CAEPU_CLKS_TO_MINS(c) (CAEPU_CLKS_TO_SECS(c) / 60)
991 #define CAEPU_CLKS_TO_HOURS(c) (CAEPU_CLKS_TO_MINS(c) / 60)
998 #define CAEPU_CLKS_TO_HMS(c, h, m, s) \
999 (s = CAEPU_CLKS_TO_SECS(c)), \
1000 (h = s / 3600), (s -= h * 3600), \
1007 #define CAEPU_CLKS_TO_FSECS(c) ((PWP_FLOAT)(c) / (PWP_FLOAT)CLOCKS_PER_SEC)
PWP_BOOL caeuExportStructuredAsUnstructured(PWGM_HGRIDMODEL model)
Get the user-requested structured grid handling.
const char * caeuDimensionToText(PWP_ENUM_DIMENSION dim)
Converts a PWP_ENUM_DIMENSION value to a text string representation.
const char * caeuPrecisionToText(PWP_ENUM_PRECISION prec)
Converts a PWP_ENUM_PRECISION value to a text string representation.
PWP_ENUM_PRECISION caeuFilePrecision(PWGM_HGRIDMODEL model)
Get the user-requested file precision.
PWP_BOOL elemType[PWGM_ELEMTYPE_SIZE]
Array of supported element-type flags.
Customizes the typedef CAEP_RTITEM declaration.
PWP_ENUM_VALTYPE
Supported PWP-API getValue() transfer types.
CAEP_BCINFO * pBCInfo
Pointer to an array of supported BC definitions.
PWU_UNFDATA unfData
Unformatted file I/O data.
CAEP_RTITEM caepRtItem[]
The runtime array of CAEP_RTITEM items.
The runtime data representing a PWP-API suported by a plugin.
PWU_RTITEM * pApiData
Pointer to the associated PWU_RTITEM structure.
The data representing a CAE exporter instance.
CAEP_RTITEM * caeuFindFormatByName(const char name[])
Find an item in caepRtItem[] by it's name.
PWP_BOOL caeuPublishMeshLinkValueDefinitions(const char *indexScheme)
Enables support for the export of MeshLink data and publishes all needed value definitions.
PWP_BOOL caeuProgressIncr(CAEP_RTITEM *pRti)
Completes a progress tracking sub-step.
An opaque handle to a grid model.
PWP_BOOL caeuProgressEndStep(CAEP_RTITEM *pRti)
Completes a progress tracking major step.
void caeuSendInfoMsg(CAEP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
Send an info text message (PWP_MSGID_INFO) to the framework.
void caeuSendDebugMsg(CAEP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
Send a debug text message (PWP_MSGID_DEBUG) to the framework.
PWP_UINT32 BCCnt
The number of BC definitions.
Pointwise Grid Model API Specification (PWGM-API)
PWP_UINT32 VCCnt
The number of VC definitions.
PWP_ENUM_ENCODING
File encoding values.
const char ** pFileExt
Pointer to an array of valid file extensions.
PWP_BOOL caeuProgressBeginStep(CAEP_RTITEM *pRti, PWP_UINT32 total)
Begins a progress tracking step.
void caeuSendErrorMsg(CAEP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
Send an error text message (PWP_MSGID_ERROR) to the framework.
PWP_BOOL caeuAssignInfoValue(const char key[], const char value[], bool createIfNotExists=true)
Creates a key/value pair that defines a CAE info attribute.
#define CAEP_RUNTIME_INSTDATADECL
Implementation defined CAE runtime instance data macro.
PWP_ENUM_ENCODING caeuFileEncoding(PWGM_HGRIDMODEL model)
Get the user-requested file encoding.
const char * caeuEncodeToText(PWP_ENUM_ENCODING enc)
Converts a PWP_ENUM_ENCODING value to a text string representation.
Pointwise CAE Plugin API (CAEP-API)
PWP_BOOL caeuProgressInit(CAEP_RTITEM *pRti, PWP_UINT32 cnt)
Initializes a progress tracking session.
CAEP_VCINFO * pVCInfo
Pointer to an array of supported VC definitions.
PWP_UINT32 caepFormatCnt
The number of entries in caepRtItem[] array.
void caeuSendWarningMsg(CAEP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
Send a warning text message (PWP_MSGID_WARNING) to the framework.
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.
PWP_BOOL caeuExportBndryConditionsOnly(PWGM_HGRIDMODEL model)
Get the user-requested bc export option.
int caeuFileOpen(CAEP_RTITEM *pRti, const CAEP_WRITEINFO *pWriteInfo)
Prepare pRti for file I/O as specified by pWriteInfo.
PWP_ENDIANNESS
Flags used to indicate endianness or control endian behaviors in functions.
CAEPU_ENUM_CLOCKS
Supported CAEPU clock id values.
PWP_BOOL caeuPublishHighOrderValueDefinitions(const PWP_UINT32 maxPolynomialDegree)
Enables support for the export of high order meshes and publishes all needed value definitions.
Volume condition definition information.
PWGM_HGRIDMODEL model
Runtime grid model handle to export.
CAEP_RTITEM * caeuFindFormatById(PWP_UINT32 id)
Find an item in caepRtItem[] by it's id.
CAE export write control information.
int caeuFileClose(CAEP_RTITEM *pRti, const CAEP_WRITEINFO *pWriteInfo)
Closes pRti for file I/O as specified by pWriteInfo.
Boundary condition definition information.
const CAEP_WRITEINFO * pWriteInfo
Runtime export CAEP_WRITEINFO data.
PWP_UINT32 ExtCnt
The number of valid file extensions.
Data and functions useful to PWP-API compliant plugins.
Pointwise Plugin API (PWP-API)
CAEP_FORMATINFO FormatInfo
The CAE Plugin format data.
PWP_ENUM_DIMENSION
Supported dimensionality values.
PWP_ENDIANNESS caeuFileByteOrder(PWGM_HGRIDMODEL model)
Get the user-requested file byte order.
void caeuProgressEnd(CAEP_RTITEM *pRti, PWP_BOOL ok)
Ends all progress tracking.
FILE * fp
Runtime FILE pointer.
PWP_ENUM_PRECISION
File precision values.
Unformatted file data block.