Functions | |
Boolean_t | TecUtilDataValueSetByZoneVar (EntIndex_t Zone, EntIndex_t Var, LgIndex_t PointIndex, double Value) |
Assign a value to a field variable at a specific position. | |
Boolean_t | TecUtilDataValueSetByZoneVarX (ArgList_pa ArgList) |
Assign a value to a field variable at a specific position. | |
void | TecUtilDataValueShare (EntIndex_t SourceZone, EntIndex_t DestZone, EntIndex_t Var) |
Sets the properties of the variable so that it is shared between source and destination zones (using the source for values). | |
void | TecUtilDataValueCopy (EntIndex_t SourceZone, EntIndex_t DestZone, EntIndex_t Var) |
Copies the data from the source zone's variable to the destination zone. | |
Boolean_t | TecUtilDataValueAlloc (EntIndex_t Zone, EntIndex_t Var) |
Allocates the space needed for the variable. | |
Boolean_t | TecUtilDataValueAutoLOD (EntIndex_t Zone, EntIndex_t Var, DataValueStructure_e DataValueStructure, const char *FileName, FileOffset_t Offset, Int64_t Stride, Boolean_t IsDataNativeByteOrder) |
Specifies where in the data file the data for the specified variable resides. | |
ArbParam_t | TecUtilDataValueGetClientData (FieldData_pa FieldData) |
Return the custom load-on-demand client data from a field data handle. | |
Boolean_t | TecUtilDataValueCustomLOD (EntIndex_t Zone, EntIndex_t Var, LoadOnDemandVarLoad_pf VariableLoad, LoadOnDemandVarUnload_pf VariableUnload, LoadOnDemandVarCleanup_pf VariableCleanup, FieldValueGetFunction_pf GetValueFunction, FieldValueSetFunction_pf SetValueFunction, ArbParam_t ClientData) |
Registers with Tecplot the load-on-demand callbacks and client data for a specific variable. | |
Boolean_t | TecUtilDataValueUnload (EntIndex_t Zone, EntIndex_t Var) |
Instructs Tecplot to unload the variable. | |
Boolean_t | TecUtilDataValueBranchShared (EntIndex_t Zone, EntIndex_t Var) |
Branch off a shared variable. | |
void | TecUtilDataValueArraySetByRef (FieldData_pa DestFieldData, LgIndex_t DestOffset, LgIndex_t DestCount, void *SourceValueArray) |
Copies the specified number of values from the base of the source value array to the destination field data starting at the specified offset. | |
void | TecUtilDataValueSetByRef (FieldData_pa FD, LgIndex_t PointIndex, double Value) |
Assign a value to a field variable at a specific position. | |
void | TecUtilDataValueSetMinMaxByRef (FieldData_pa FieldData, double MinValue, double MaxValue) |
Set the minimum and maximum values for a tecplot variable using a field data reference. | |
void | TecUtilDataValueSetMinMaxByZoneVar (EntIndex_t Zone, EntIndex_t Var, double MinValue, double MaxValue) |
Set the minimum and maximum values for a tecplot variable using a zone and variable number. | |
void | TecUtilDataValueGetReadableRawPtr (EntIndex_t Zone, EntIndex_t Var, void **DataPtr, FieldDataType_e *FieldDataType) |
Get a read-only handle to the raw field data in the data set attached to the current frame. | |
void | TecUtilDataValueGetWritableRawPtr (EntIndex_t Zone, EntIndex_t Var, void **DataPtr, FieldDataType_e *FieldDataType) |
Get a read/write handle to the raw field data in the data set attached to the current frame. | |
LgIndex_t | TecUtilDataValueGetCountByRef (FieldData_pa FieldData) |
Gets the number of values associated with the field data reference. | |
double | TecUtilDataValueGetByZoneVar (EntIndex_t Zone, EntIndex_t Var, LgIndex_t PointIndex) |
Get a field data value. | |
FieldData_pa | TecUtilDataValueGetReadableNativeRef (EntIndex_t Zone, EntIndex_t Var) |
Get a read-only handle to the native data for the specified zone and variable in the data set attached to the current frame. | |
FieldData_pa | TecUtilDataValueGetReadableDerivedRef (EntIndex_t Zone, EntIndex_t Var) |
Get a read-only handle to the derived data for the specified zone and variable in the data set attached to the current frame. | |
FieldData_pa | TecUtilDataValueGetReadableNLRef (EntIndex_t Zone, EntIndex_t Var) |
Get a read-only handle to the node located data for the specified zone and variable in the data set attached to the current frame. | |
FieldData_pa | TecUtilDataValueGetReadableCCRef (EntIndex_t Zone, EntIndex_t Var) |
Get a read-only handle to the cell centered data for the specified zone and variable in the data set attached to the current frame. | |
FieldData_pa | TecUtilDataValueGetWritableNativeRef (EntIndex_t Zone, EntIndex_t Var) |
Get a native read/write handle to the data for the specified zone and variable in the data set attached to the current frame. | |
FieldValueGetFunction_pf | TecUtilDataValueRefGetGetFunc (FieldData_pa FD) |
Get the low-level "get value" function associated with a field data handle. | |
FieldValueSetFunction_pf | TecUtilDataValueRefGetSetFunc (FieldData_pa FD) |
Get the low-level "set value" function associated with a field data handle. | |
Boolean_t | TecUtilDataValueGetZoneVarByRef (FieldData_pa FD, EntIndex_t *Zone, EntIndex_t *Var) |
Get a candidate zone and variable associated with the given field data reference. | |
FieldDataType_e | TecUtilDataValueGetRefType (FieldData_pa FieldData) |
Get the field data type of a field data handle. | |
FieldDataType_e | TecUtilDataValueGetType (EntIndex_t Zone, EntIndex_t Var) |
Queries for the data type of the variable. | |
ValueLocation_e | TecUtilDataValueGetLocation (EntIndex_t Zone, EntIndex_t Var) |
Queries for the location of the variable. | |
ValueLocation_e | TecUtilDataValueGetLocationByRef (FieldData_pa FieldData) |
Queries for the location of the data values associated with the field data reference. | |
void | TecUtilDataValueArrayGetByRef (FieldData_pa SourceFieldData, LgIndex_t SourceOffset, LgIndex_t SourceCount, void *DestValueArray) |
Fetch an Array of values by reference. | |
double | TecUtilDataValueGetByRef (FieldData_pa FieldData, LgIndex_t PointIndex) |
Get a field data value. | |
Boolean_t | TecUtilDataValueGetMinMaxByZoneVar (EntIndex_t Zone, EntIndex_t Var, double *Min, double *Max) |
Get the minimum and maximum values for a tecplot variable using a zone and variable number. | |
void | TecUtilDataValueGetMinMaxByRef (FieldData_pa FieldData, double *Min, double *Max) |
Get the minimum and maximum values for a tecplot variable using the field data reference. | |
Boolean_t | TecUtilDataValueIsSharingOk (EntIndex_t SourceZone, EntIndex_t DestZone, EntIndex_t Var) |
Determine if it is ok to share a variable between zones. | |
Set_pa | TecUtilDataValueGetShareZoneSet (EntIndex_t Zone, EntIndex_t Var) |
Gets the set of zones that share the variable with the specified zone. | |
EntIndex_t | TecUtilDataValueGetShareCount (EntIndex_t Zone, EntIndex_t Var) |
Get a count for the number of times a particular variable is shared. | |
Boolean_t | TecUtilDataValueIsPassive (EntIndex_t Zone, EntIndex_t Var) |
Determine if a variable is passive for a particular zone. | |
Boolean_t | TecUtilDataValueIsLoaded (EntIndex_t Zone, EntIndex_t Var) |
Determine if a variable is loaded for a particular zone. |
Boolean_t TecUtilDataValueAlloc | ( | EntIndex_t | Zone, | |
EntIndex_t | Var | |||
) |
Allocates the space needed for the variable.
This function is used in conjunction with deferred variable creation. See the SV_DEFERVARCREATION option for TecUtilDataSetAddZoneX() and TecUtilDataSetAddVarX() for details.
Zone | The zone needing the variable allocated. | |
Var | The variable to be allocated. |
Current frame must have a data set with at least one zone.
INTEGER*4 FUNCTION TecUtilDataValueAlloc( & Zone, & Var) INTEGER*4 Zone INTEGER*4 Var
Python Syntax:
Results = TecUtil.DataValueAlloc(Zone, Var) Input: Zone int Var int Output: Results[0] ReturnVal boolean
Allocate the first variable of zone 3. Note that this example is only valid if the zone was added with the deferred variable creation option set to true.
IsOk = TecUtilDataValueAlloc(3, 1);
void TecUtilDataValueArrayGetByRef | ( | FieldData_pa | SourceFieldData, | |
LgIndex_t | SourceOffset, | |||
LgIndex_t | SourceCount, | |||
void * | DestValueArray | |||
) |
Fetch an Array of values by reference.
This function fetches the specified number of values from the source field data starting at the specified source item offset and copies them to the base of the destination value array. The destination value array must be of the same data type as the source field data. In addition, data of type FieldDataType_Bit is currently not supported for array access. This function is Thread Safe.
SourceFieldData | Field data containing the data to fetch. | |
SourceOffset | Member offset in the source field data to begin fetching values. | |
SourceCount | Number of values to fetch from the source field data. | |
DestValueArray | Pre-allocated array large enough to hold the requested members. The first member is placed at the base of the array. The native type of the array must match that of the field data. |
SourceFieldData The specified field data must be readable.
This function is not supported in Python.
void TecUtilDataValueArraySetByRef | ( | FieldData_pa | DestFieldData, | |
LgIndex_t | DestOffset, | |||
LgIndex_t | DestCount, | |||
void * | SourceValueArray | |||
) |
Copies the specified number of values from the base of the source value array to the destination field data starting at the specified offset.
The source value array must be of the same data type as the destination field data. In addition, data of type FieldDataType_Bit is currently not supported for array access. This function is Thread Safe.
DestFieldData | Field data to receive the source values. | |
DestOffset | Member offset in the destination field data to begin assigning values. DestOffset >= 1 and DestOffset <= DestCount. | |
DestCount | Number of values to assign to the destination field data. This value must not exceed the number of items supplied by SourceValueArray. | |
SourceValueArray | An array containing the members to copy. The first member is assumed to be at the base of the array. |
This function is not supported in Python.
Boolean_t TecUtilDataValueAutoLOD | ( | EntIndex_t | Zone, | |
EntIndex_t | Var, | |||
DataValueStructure_e | DataValueStructure, | |||
const char * | FileName, | |||
FileOffset_t | Offset, | |||
Int64_t | Stride, | |||
Boolean_t | IsDataNativeByteOrder | |||
) |
Specifies where in the data file the data for the specified variable resides.
The variable must be laid out in memory using the structure specified. Using this information Tecplot will automatically load and unload the variable when Tecplot deems it necessary. It is the responsibility of the add-on to ensure that the file remains present and unaltered while Tecplot maintains a reference to this file as Tecplot may unload and subsequently reload the variable at unspecified times.
This function is used in conjunction with deferred variable creation. See the SV_DEFERVARCREATION option for TecUtilDataSetAddZoneX() and TecUtilDataSetAddVarX() for details.
Zone | The zone of the variable to have Tecplot automatically load on demand. | |
Var | Variable to have Tecplot automatically load on demand. | |
DataValueStructure | Specifies the structure type to which the data in the file conforms. | |
FileName | Data file name containing the variable data laid out using Tecplot's binary block data format. | |
Offset | Absolute offset to the start of the variable data in the file. | |
Stride | The stride tells Tecplot how to skip through the file for nodal data. Only nodal data can specify a stride greater than one. A stride of one offers much higher load/unload performance than strides greater than one. | |
IsDataNativeByteOrder | Indicates if the byte ordering of the data in the file matches the machine's native byte ordering. |
Current frame must have a data set with at least one zone.
FileName Pointer must be a valid address and non-NULL.
Results = TecUtil.DataValueAutoLOD(Zone, Var, DataValueStructure, FileName, Offset, Stride, IsDataNativeByteOrder) Input: Zone int Var int DataValueStructure DataValueStructure_e (defined in TecVals.py) FileName string Offset long Stride long IsDataNativeByteOrder boolean Output: Results[0] ReturnVal boolean
Boolean_t TecUtilDataValueBranchShared | ( | EntIndex_t | Zone, | |
EntIndex_t | Var | |||
) |
The specified variable of the specified zone is branched so it is no longer shared with anything.
Zone | Zone in which the shared variable is located. | |
Var | Variable that will be branched |
Current frame must have a data set with at least one zone.
INTEGER*4 FUNCTION TecUtilDataValueBranchShared( & Zone, & Var) INTEGER*4 Zone INTEGER*4 Var
Python Syntax:
Results = TecUtil.DataValueBranchShared(Zone, Var) Input: Zone int Var int Output: Results[0] ReturnVal boolean
Branch variable 2 in zone 1.
TecUtilDataValueBranchShared(1, 2);
void TecUtilDataValueCopy | ( | EntIndex_t | SourceZone, | |
EntIndex_t | DestZone, | |||
EntIndex_t | Var | |||
) |
Copies the data from the source zone's variable to the destination zone.
The destination zone's variable must already be allocated or memory mapped and it may not be shared. Both zones must have the same structure (both Ordered with the same I,J, and K values; or both are finite-elements with the same element type and same number of nodes.
SourceZone | The zone number where the data values are based. | |
DestZone | The zone number where the data values will be copied from the source zone. | |
Var | The variable to be copied. |
Current frame must have a data set with at least one zone.
SUBROUTINE TecUtilDataValueCopy( & SourceZone, & DestZone, & Var) INTEGER*4 SourceZone INTEGER*4 DestZone INTEGER*4 Var
Python Syntax:
Results = TecUtil.DataValueCopy(SourceZone, DestZone, Var) Input: SourceZone int DestZone int Var int Output: Results[0] ReturnVal NONE
Copy the values from variable 1 of zone 2 to zone 3.
TecUtilDataValueCopy(2, 3, 1);
Boolean_t TecUtilDataValueCustomLOD | ( | EntIndex_t | Zone, | |
EntIndex_t | Var, | |||
LoadOnDemandVarLoad_pf | VariableLoad, | |||
LoadOnDemandVarUnload_pf | VariableUnload, | |||
LoadOnDemandVarCleanup_pf | VariableCleanup, | |||
FieldValueGetFunction_pf | GetValueFunction, | |||
FieldValueSetFunction_pf | SetValueFunction, | |||
ArbParam_t | ClientData | |||
) |
Registers with Tecplot the load-on-demand callbacks and client data for a specific variable.
Tecplot will notify the add-on via the callbacks when the variable needs to be loaded, unloaded, and cleaned up or when a value needs to be fetched or submitted.
All callbacks must be written in a thread-safe manner so that Tecplot can make concurrent requests to load (and/or unload) multiple variables. The easiest way to write thread-safe callbacks is to not use any shared state (i.e. global or static state) in order to perform the requested action but instead to use private client data to maintain all the information needed to perform the requested action.
It is important that GetValue and SetValue callbacks do NOT lock/unlock Tecplot or call TecUtil functions that require Tecplot to be locked as this will incur a performance penalty. GetValue and SetValue functions should be lightweight and fast.
Calls made back to Tecplot in response to a load, unload, or cleanup request should be limited to queries except in the case where data is being loaded into a variable. In addition, no state changes should be broadcast by the callbacks.
This function is used in conjunction with deferred variable creation. See the SV_DEFERVARCREATION option for TecUtilDataSetAddZoneX() and TecUtilDataSetAddVarX() for details.
Two methods for loading and accessing data are available for custom load-on-demand (see ADK Users Manual for details):
Zone | Zone containing the variable that will now be custom load-on-demand. | |
Var | Variable that will now be custom load-on-demand. | |
VariableLoad | Tecplot calls this callback when the variable is to be loaded. The VariableLoad() callback may never get called if the variable is not needed or it may get called immediately if load-on-demand capabilities are not available. Depending on the load-on-demand method the callback has different responsibilities:
| |
VariableUnload | Add-ons can supply NULL for this callback. Supplying NULL instructs Tecplot to handled the unloading (and subsequent reloading) of the variable without the intervention of the add-on, however Tecplot will be forced to write the data to its temporary directory when unloaded thereby incurring additional I/O expense. If the add-on does supply this callback, Tecplot calls it when the variable is to be unloaded. This query provides the add-on an opportunity to allow or deny a variable to be unloaded by returning TRUE or FALSE respectively. Unless there is a compelling reason, such as very expensive load costs (in which case NULL should probably be supplied for this callback), the add-on should honor Tecplot's request to unload the variable (i.e. the VariableUnload() callback should return TRUE). An add-on may also cleanup any private resources that are not needed when the variable is unloaded, however the add-on must still maintain enough information to load the variable again if requested by Tecplot. The VariableUnload() callback may never get called if the variable does not need to be unloaded nor will the VariableUnload() callback necessarily be called before the VariableCleanup() callback. This callback is called asynchronously. | |
VariableCleanup | Tecplot calls this callback when the variable is to be cleaned up. This allows the add-on to cleanup any private resources that were used in conjunction with identifying or loading this variable. After a variable is cleaned up Tecplot will never again request it to be loaded. Tecplot may or may not call the VariableUnload() callback before calling the VariableCleanup() callback. Additionally, the VariableCleanup() callback will be called even if the variable was never loaded. This callback is called asynchronously. | |
GetValueFunction | Tecplot calls this callback to fetch the value from the field data at the specified index. This callback is only registered by add-ons that are using the "Custom Load Value on Demand" method, otherwise pass NULL. This callback is called asynchronously. | |
SetValueFunction | Tecplot calls this callback to submit a value to the field data at the specified index. This callback is only registered by add-ons that are using the "Custom Load Value on Demand" method, otherwise pass NULL. By providing a SetValueFunction() callback the add-on is signifying it will store any changes to the field data until the variable is cleaned up. Most "Custom Load Value on Demand" add-ons should pass NULL for this callback and allow Tecplot to store variable modifications. This callback is called asynchronously. | |
ClientData | Private client data needed by the custom load-on-demand callbacks to perform the duties of loading, unloading, and cleaning up the variable or to perform the get or set requests. Tecplot stores the client data in the field data structure and must be retrieved by the callbacks using TecUtilDataValueGetClientData(). The client data should ONLY be retrieved in response to a custom load, unload, cleanup, get-value, or set-value callback. At no other time is the request valid. |
Current frame must have a data set with at least one zone.
double *ZeroVariableGetValue(const FieldData_pa FieldData, LgIndex_t PointIndex) { return 0.0; } . . . IsOk = TecUtilDataValueCustomLOD(3, 4, NULL, NULL, NULL, ZeroVariableGetValue, NULL, 0);
Following is an example of how to create a variable using the "Custom Load Variable on Demand" method by registering some simple load/unload/cleanup callbacks.
typedef struct { char *DataFileName; long SeekOffset; LgIndex_t NumValues; ...other information needed to load variable data } MyVariableClientData_s; Boolean_t MyVariableLoader(FieldData_pa FieldData) { REQUIRE(VALID_REF(FieldData)); MyVariableClientData_s *MyClientData = (MyVariableClientData_s *)TecUtilDataValueGetClientData(FieldData); // open the data file FILE *MyDataFile = fopen(MyClientData->DataFileName, "rb"); Boolean_t IsOk = (MyDataFile != NULL); // seek to the place in the file where the variable data is located IsOk = IsOk && (fseek(MyDataFile, MyClientData->SeekOffset, SEEK_SET) == 0); if (IsOk) { // load the data into the variable's field data IsOk = ReadMyDataInfoVariable(MyDataFile, MyClientData, FieldData); } // cleanup if (MyDataFile != NULL) fclose(MyDataFile); ENSURE(VALID_BOOLEAN(IsOk)); return IsOk; } Boolean_t MyVariableUnload(FieldData_pa FieldData) { REQUIRE(VALID_REF(FieldData)); // We don't have any private data to cleanup (i.e in addition to the // private client data which we don't cleanup here) so all we have to do // is return TRUE or FALSE letting Tecplot know that it can or can not // unload the variable. Boolean_t Result = TRUE; // ...tell Tecplot to go ahead and unload the variable ENSURE(VALID_BOOLEAN(Result)); return Result; } void MyVariableCleanup(FieldData_pa FieldData) { REQUIRE(VALID_REF(FieldData)); MyVariableClientData_s *MyClientData = (MyVariableClientData_s *)TecUtilDataValueGetClientData(FieldData); // cleanup privately allocated resources free(MyClientData->DataFileName); free(MyClientData); } . . . MyVariableClientData_s *MyClientData = (MyVariableClientData_s *)malloc(sizeof(MyVariableClientData_s)); const char *MyDataFileName = "MyDataFileName.dat"; MyClientData->MyDataFileName = (char *)malloc(strlen(MyDataFileName)+1); strcpy(MyClientData->MyDataFileName, MyDataFileName); MyClientData->SeekOffset = ... determined somewhere else MyClientData->NumValues = ... determined somewhere else ...initialize any other client data information needed to load variable data IsOk = TecUtilDataValueCustomLOD(3, 4, MyVariableLoader, MyVariableUnload, // most add-ons should pass NULL instead of MyVariableUnload MyVariableCleanup, NULL, // passing NULL for GetValue function signifies load-variable-on-demand NULL, (ArbParam_t)MyClientData);
Python Syntax:
This function is not supported in Python.
double TecUtilDataValueGetByRef | ( | FieldData_pa | FieldData, | |
LgIndex_t | PointIndex | |||
) |
To use this function you must have already obtained a handle to field data. This function is Thread Safe.
FieldData | A field data reference usually obtained via a call to one of the following functions: TecUtilDataValueGetReadableNativeRef(), TecUtilDataValueGetReadableDerivedRef(), TecUtilDataValueGetReadableNLRef(), or TecUtilDataValueGetReadableCCRef(). | |
PointIndex | Position in the array of field data values. Position starts at one. If FieldData came from an IJ- or IJK-ordered zone then the position is calculated by treating the two- or three-dimensional array as a one-dimensional array. |
FieldData The specified field data must be readable.
PointIndex must be at least 1 and no more than the number of data values in the field.
REAL*8 FUNCTION TecUtilDataValueGetByRef( & FieldDataPtr, & PointIndex) POINTER (FieldDataPtr, FieldData) INTEGER*4 PointIndex
Python Syntax:
Results = TecUtil.DataValueGetByRef(FieldData, PointIndex) Input: FieldData opaque pointer PointIndex int Output: Results[0] ReturnVal double
Get the first twenty data values for the second variable in zone 5:
FieldData_pa fd = TecUtilDataValueGetReadableNativeRef(5, 2); LgIndex_t numpts = TecUtilDataValueGetCountByRef(fd); if ( fd ) { int ii; for ( ii = 1; ii <= numpts; ii++ ) { double val = TecUtilDataValueGetByRef(fd, ii); // do something with val } }
double TecUtilDataValueGetByZoneVar | ( | EntIndex_t | Zone, | |
EntIndex_t | Var, | |||
LgIndex_t | PointIndex | |||
) |
This function does not require you to obtain the handle to the field data as does TecUtilDataValueGetByRef(), however, this function is not very efficient. Use TecUtilDataValueGetByRef() if you are getting multiple values from the same zone.
This function is Thread Safe.
Zone | The zone number | |
Var | The variable number | |
PointIndex | Position in the array of field data values. Position starts at one. If FieldData came from an IJ- or IJK-ordered zone then the position is calculated by treating the two- or three-dimensional array as a one-dimensional array |
Current frame must have a data set with at least one zone.
Zone Must specify a valid zone.
Var Must specify a valid variable.
PointIndex must be at least 1 and no more than the number of data values in the field.
REAL*8 FUNCTION TecUtilDataValueGetByZoneVar( & Zone, & Var, & PointIndex) INTEGER*4 Zone INTEGER*4 Var INTEGER*4 PointIndex
Python Syntax:
Results = TecUtil.DataValueGetByZoneVar(Zone, Var, PointIndex) Input: Zone int Var int PointIndex int Output: Results[0] ReturnVal double
Get the twenty-first value of the second variable of zone 5:
double dd = TecUtilDataValueGetByZoneVar(5, 2, 21); // Use val.
ArbParam_t TecUtilDataValueGetClientData | ( | FieldData_pa | FieldData | ) |
Return the custom load-on-demand client data from a field data handle.
The client data should ONLY be retrieved in response to a custom load, unload, cleanup, get-value, or set-value callback. At no other time is the request valid. This function is Thread Safe.
FieldData | Custom load-on-demand field data handle. |
This function is not supported in Python.
double MyGetValueFunction(const FieldData_pa FieldData, LgIndex_t PointIndex) { double Result; MyClientData_s *MyClientData = (MyClientData_s *)TecUtilDataValueGetClientData(FieldData); // calculate or extract the requested value from the client data . . . return Result; }
LgIndex_t TecUtilDataValueGetCountByRef | ( | FieldData_pa | FieldData | ) |
Gets the number of values associated with the field data reference.
This function is Thread Safe.
FieldData | Handle to the field data. Use TecUtilDataValueGetReadableNativeRef(), TecUtilDataValueGetReadableDerivedRef(), TecUtilDataValueGetReadableNLRef(), TecUtilDataValueGetReadableCCRef(), or TecUtilDataValueGetWritableNativeRef() to get readable or writable handles to the field data. |
INTEGER*4 FUNCTION TecUtilDataValueGetCountByRef(FieldDataPtr) & FieldDataPtr) POINTER (FieldDataPtr, FieldData)
Python Syntax:
Results = TecUtil.DataValueGetCountByRef(FieldData)
Input:
FieldData opaque pointer
Output:
Results[0] ReturnVal int
Determine how many values are associated with the second variable of zone 5.
FieldData_pa FD = TecUtilDataValueGetReadableNativeRef(5, 2); LgIndex_t NumValues = TecUtilDataValueGetCountByRef(FD);
ValueLocation_e TecUtilDataValueGetLocation | ( | EntIndex_t | Zone, | |
EntIndex_t | Var | |||
) |
Queries for the location of the variable.
This function is Thread Safe.
Zone | The zone number. | |
Var | The variable number |
Current frame must have a data set with at least one zone.
INTEGER*4 FUNCTION TecUtilDataValueGetLocation( & Zone, & Var) INTEGER*4 Zone INTEGER*4 Var
Python Syntax:
Results = TecUtil.DataValueGetLocation(Zone, Var) Input: Zone int Var int Output: Results[0] ReturnVal ValueLocation_e (defined in TecVals.py)
Get the value location of variable 2 in zone 5:
ValueLocation_e ValLoc = TecUtilDataValueGetLocation(5, 2);
ValueLocation_e TecUtilDataValueGetLocationByRef | ( | FieldData_pa | FieldData | ) |
Queries for the location of the data values associated with the field data reference.
This function is Thread Safe.
FieldData | Handle to the field data. Use TecUtilDataValueGetReadableNativeRef(), TecUtilDataValueGetReadableDerivedRef(), TecUtilDataValueGetReadableNLRef(), TecUtilDataValueGetReadableCCRef(), or TecUtilDataValueGetWritableNativeRef() to get readable or writable handles to the field data. |
INTEGER*4 FUNCTION TecUtilDataValueGetLocationByRef(FieldDataPtr) & FieldDataPtr) POINTER (FieldDataPtr, FieldData)
Python Syntax:
Results = TecUtil.DataValueGetLocationByRef(FieldData) Input: FieldData opaque pointer Output: Results[0] ReturnVal ValueLocation_e (defined in TecVals.py)
void TecUtilDataValueGetMinMaxByRef | ( | FieldData_pa | FieldData, | |
double * | Min, | |||
double * | Max | |||
) |
Get the minimum and maximum values for a tecplot variable using the field data reference.
This function is Thread Safe.
FieldData | A field data reference usually obtained via a call to one of the following functions: TecUtilDataValueGetReadableNativeRef(), TecUtilDataValueGetReadableDerivedRef(), TecUtilDataValueGetReadableNLRef(), or TecUtilDataValueGetReadableCCRef(). | |
Min | Returned minimum value. | |
Max | Returned maximum value. |
FieldData The specified field data must be readable.
Min Pointer must be a valid address and non-NULL.
Max Pointer must be a valid address and non-NULL.
SUBROUTINE TecUtilDataValueGetMinMaxByRef( & FieldDataPtr, & Min, & Max) POINTER (FieldDataPtr, FieldData) REAL*8 Min REAL*8 Max
Python Syntax:
Results = TecUtil.DataValueGetMinMaxByRef(FieldData) Input: FieldData opaque pointer Output: Results[0] Min double Results[1] Max double
Get the minimum and maximum values for the third variable in zone 2 in the current data set.
FieldData_pa FD; double Min; double Max; FD = TecUtilDataValueGetReadableNativeRef(2,3); TecUtilDataValueGetMinMaxByRef(FD,&Min,&Max);
Boolean_t TecUtilDataValueGetMinMaxByZoneVar | ( | EntIndex_t | Zone, | |
EntIndex_t | Var, | |||
double * | Min, | |||
double * | Max | |||
) |
Get the minimum and maximum values for a tecplot variable using a zone and variable number.
Zone | The zone number of the variable to be examinined for min/max values. | |
Var | The variable number to be examinined for min/max values. | |
Min | Returned minimum value. | |
Max | Returned maximum value. |
Current frame must have a data set with at least one zone.
Min Pointer must be a valid address and non-NULL.
Max Pointer must be a valid address and non-NULL.
SUBROUTINE TecUtilDataValueGetMinMaxByZoneVar( & Zone, & Var, & Min, & Max) INTEGER*4 Zone INTEGER*4 Var REAL*8 Min REAL*8 Max
Python Syntax:
Results = TecUtil.DataValueGetMinMaxByZoneVar(Zone, Var) Input: Zone int Var int Output: Results[0] ReturnVal boolean Results[1] Min double Results[2] Max double
Get the minimum and maximum values for the third variable in zone 2 in the current data set.
double Min; double Max; TecUtilDataValueGetMinMaxByZoneVar(2,3,&Min,&Max);
FieldData_pa TecUtilDataValueGetReadableCCRef | ( | EntIndex_t | Zone, | |
EntIndex_t | Var | |||
) |
Get a read-only handle to the cell centered data for the specified zone and variable in the data set attached to the current frame.
This function is Thread Safe.
Zone | Number of the zone for which to get the field data | |
Var | Number of the variable for which to get the field data |
Current frame must have a data set with at least one zone.
SUBROUTINE TecUtilDataValueGetReadableCCRef( & Zone, & Var, & ResultPtr) INTEGER*4 Zone INTEGER*4 Var POINTER (ResultPtr, Result)
Python Syntax:
Results = TecUtil.DataValueGetReadableCCRef(Zone, Var) Input: Zone int Var int Output: Results[0] ReturnVal opaque pointer
Function that loads the values of a field variable into a supplied double precision array. Assume the array is already dimensioned correctly and the dataset, zone, and variable exist.
static void ReadVals(double Var[], EntIndex_t ZoneNum, EntIndex_t VarNum) { FieldData_pa FieldData = TecUtilDataValueGetReadableCCRef(ZoneNum, VarNum); if (FieldData) { int i; LgIndex_t NumValues = TecUtilDataValueGetCountByRef(FieldData); // Remember that the GetByRef function is 1-based.... for (i = 0; i < NumPointsInZone; i++) Var[i] = TecUtilDataValueGetByRef(FieldData, i+1); } }
FieldData_pa TecUtilDataValueGetReadableDerivedRef | ( | EntIndex_t | Zone, | |
EntIndex_t | Var | |||
) |
Get a read-only handle to the derived data for the specified zone and variable in the data set attached to the current frame.
This function is Thread Safe.
Zone | Number of the zone for which to get the field data | |
Var | Number of the variable for which to get the field data |
Current frame must have a data set with at least one zone.
SUBROUTINE TecUtilDataValueGetReadableDerivedRef( & Zone, & Var, & ResultPtr) INTEGER*4 Zone INTEGER*4 Var POINTER (ResultPtr, Result)
Python Syntax:
Results = TecUtil.DataValueGetReadableDerivedRef(Zone, Var) Input: Zone int Var int Output: Results[0] ReturnVal opaque pointer
Function that loads the values of a field variable into a supplied double precision array. Assume the array is already dimensioned correctly and the dataset, zone, and variable exist.
static void ReadVals(double Var[], EntIndex_t ZoneNum, EntIndex_t VarNum) { FieldData_pa FieldData = TecUtilDataValueGetReadableDerivedRef(ZoneNum, VarNum); if (FieldData) { int i; LgIndex_t NumValues = TecUtilDataValueGetCountByRef(FieldData); // Remember that the GetByRef function is 1-based.... for (i = 0; i < NumPointsInZone; i++) Var[i] = TecUtilDataValueGetByRef(FieldData, i+1); } }
FieldData_pa TecUtilDataValueGetReadableNativeRef | ( | EntIndex_t | Zone, | |
EntIndex_t | Var | |||
) |
Get a read-only handle to the native data for the specified zone and variable in the data set attached to the current frame.
This function is Thread Safe.
Zone | Number of the zone for which to get the field data | |
Var | Number of the variable for which to get the field data |
Current frame must have a data set with at least one zone.
SUBROUTINE TecUtilDataValueGetReadableNativeRef( & Zone, & Var, & ResultPtr) INTEGER*4 Zone INTEGER*4 Var POINTER (ResultPtr, Result)
Python Syntax:
Results = TecUtil.DataValueGetReadableNativeRef(Zone, Var) Input: Zone int Var int Output: Results[0] ReturnVal opaque pointer
Function that loads the values of a field variable into a supplied double precision array. Assume the array is already dimensioned correctly and the dataset, zone, and variable exist.
static void ReadVals(double Var[], EntIndex_t ZoneNum, EntIndex_t VarNum) { FieldData_pa FieldData = TecUtilDataValueGetReadableNativeRef(ZoneNum, VarNum); if (FieldData) { int i; LgIndex_t NumValues = TecUtilDataValueGetCountByRef(FieldData); // Remember that the GetByRef function is 1-based.... for (i = 0; i < NumPointsInZone; i++) Var[i] = TecUtilDataValueGetByRef(FieldData, i+1); } }
FieldData_pa TecUtilDataValueGetReadableNLRef | ( | EntIndex_t | Zone, | |
EntIndex_t | Var | |||
) |
Get a read-only handle to the node located data for the specified zone and variable in the data set attached to the current frame.
This function is Thread Safe.
Zone | Number of the zone for which to get the field data | |
Var | Number of the variable for which to get the field data |
Current frame must have a data set with at least one zone.
SUBROUTINE TecUtilDataValueGetReadableNLRef( & Zone, & Var, & ResultPtr) INTEGER*4 Zone INTEGER*4 Var POINTER (ResultPtr, Result)
Python Syntax:
Results = TecUtil.DataValueGetReadableNLRef(Zone, Var) Input: Zone int Var int Output: Results[0] ReturnVal opaque pointer
Function that loads the values of a field variable into a supplied double precision array. Assume the array is already dimensioned correctly and the dataset, zone, and variable exist.
static void ReadVals(double Var[], EntIndex_t ZoneNum, EntIndex_t VarNum) { FieldData_pa FieldData = TecUtilDataValueGetReadableNLRef(ZoneNum, VarNum); if (FieldData) { int i; LgIndex_t NumValues = TecUtilDataValueGetCountByRef(FieldData); // Remember that the GetByRef function is 1-based.... for (i = 0; i < NumPointsInZone; i++) Var[i] = TecUtilDataValueGetByRef(FieldData, i+1); } }
void TecUtilDataValueGetReadableRawPtr | ( | EntIndex_t | Zone, | |
EntIndex_t | Var, | |||
void ** | DataPtr, | |||
FieldDataType_e * | FieldDataType | |||
) |
Get a read-only handle to the raw field data in the data set attached to the current frame.
If possible this function provides direct access to a Tecplot variable's internal representation. If performance is not a concern consider using TecUtilDataValueGetByRef(), TecUtilDataValueSetByRef(). If high performance is essential then use TecUtilDataValueArrayGetByRef(), and TecUtilDataValueArraySetByRef() which provide nearly equivalent performance to direct access. Alternatively for high performance consider using the field data's accessor functions by calling TecUtilDataValueRefGetGetFunc() and TecUtilDataValueRefGetSetFunc(). Note that these high performance functions are a very thin layer over a Tecplot variable's internal representation and unlike the raw field data pointer provided by this function, they are always available. This function is Thread Safe.
Zone | Number of the zone for which to get the raw field data. | |
Var | Number of the variable for which to get the raw field data. | |
DataPtr | Receives the address of the raw field data. May return NULL if the type is too complex. If the type is too complex, you may use TecUtilDataValueRefGetGetFunc() and TecUtilDataValueRefGetSetFunc() to get functions that will deal with the data at a lower level than TecUtilDataValueGetByRef() and TecUtilDataValueSetByRef(). | |
FieldDataType | Receives the data type of the raw field data. The following table shows the possible values for FieldDataType along with the corresponding data type that DataPtr references: |
FieldDataType DataPtr references ------------------------------------------- FieldDataType_Float float * FieldDataType_Double double * FieldDataType_Int32 Int32_t * FieldDataType_Int16 Int16_t * FieldDataType_Byte char * FieldDataType_Bit UInt32_t * FieldDataType_Invalid too complex
Current frame must have a data set with at least one zone.
DataPtr Pointer must be a valid address and non-NULL.
FieldDataType Pointer must be a valid address and non-NULL.
SUBROUTINE TecUtilDataValueGetReadableRawPtr( & Zone, & Var, & DataPtr, & FieldDataType) INTEGER*4 Zone INTEGER*4 Var POINTER (DataPtrPtr, DataPtr) INTEGER*4 FieldDataType
Python Syntax:
This function is not supported in Python.
Get the first and second value values of the second variable of zone 5 using a raw data pointer. Note that the first and second values are accessed by zero and one respectively since the raw data is accessed with a zero-base numbering system.
EntIndex_t zone = 5; EntIndex_t var = 2; void *raw_fd_ptr = NULL; FieldDataType_e field_data_type; TecUtilDataValueGetReadableRawPtr(zone, var, &raw_fd_ptr, &field_data_type); if ( raw_fd_ptr ) { if ( field_data_type == FieldData_Float ) { const float *float_ptr = (const float *)raw_fd_ptr; float v1 = float_ptr[0]; float v2 = float_ptr[1]; ... do something with the data } }
FieldDataType_e TecUtilDataValueGetRefType | ( | FieldData_pa | FieldData | ) |
Get the field data type of a field data handle.
This function is Thread Safe.
FieldData | The field data reference for which the data type is desired. |
INTEGER*4 FUNCTION TecUtilDataValueGetRefType(FieldDataPtr) POINTER (FieldDataPtr, FieldData)
Python Syntax:
Results = TecUtil.DataValueGetRefType(FieldData) Input: FieldData opaque pointer Output: Results[0] ReturnVal FieldDataType_e (defined in TecVals.py)
Get the type of the data for variable 2 in zone 5 of the data set attached to the current frame and do something special if that type is FieldDataType_Bit
FieldData_pa fd = TecUtilDataValueGetReadableNativeRef(5, 2); FieldDataType_e field_data_type = TecUtilDataValueGetRefType(fd); if (field_data_type == FieldDataType_Bit) { // do something special }
EntIndex_t TecUtilDataValueGetShareCount | ( | EntIndex_t | Zone, | |
EntIndex_t | Var | |||
) |
Get a count for the number of times a particular variable is shared.
This function is Thread Safe.
Zone | Zone in which the shared variable is located. | |
Var | Variable that is shared. |
INTEGER*4 FUNCTION TecUtilDataValueGetShareCount( & Zone, & Var) INTEGER*4 Zone INTEGER*4 Var
Python Syntax:
Results = TecUtil.DataValueGetShareCount(Zone, Var) Input: Zone int Var int Output: Results[0] ReturnVal int
Get share count of variable 2 in zone 1.
EntIndex_t ShareCount = TecUtilDataValueGetShareCount(1, 2);
Set_pa TecUtilDataValueGetShareZoneSet | ( | EntIndex_t | Zone, | |
EntIndex_t | Var | |||
) |
Gets the set of zones that share the variable with the specified zone.
If the specified zone's variable is shared then it is also a member of the resulting set otherwise an empty set is returned. This function is Thread Safe.
Zone | Zone for which sharing information is desired. | |
Var | Variable for which sharing information is desired. |
SUBROUTINE TecUtilDataValueGetShareZoneSet( & Zone, & Var, & ResultPtr) INTEGER*4 Zone INTEGER*4 Var POINTER (ResultPtr, Result)
Python Syntax:
Results = TecUtil.DataValueGetShareZoneSet(Zone, Var) Input: Zone int Var int Output: Results[0] ReturnVal sequence of ints
FieldDataType_e TecUtilDataValueGetType | ( | EntIndex_t | Zone, | |
EntIndex_t | Var | |||
) |
Queries for the data type of the variable.
This function is Thread Safe.
Zone | The zone number. | |
Var | The variable number |
Current frame must have a data set with at least one zone.
INTEGER*4 FUNCTION TecUtilDataValueGetType( & Zone, & Var) INTEGER*4 Zone INTEGER*4 Var
Python Syntax:
Results = TecUtil.DataValueGetType(Zone, Var) Input: Zone int Var int Output: Results[0] ReturnVal FieldDataType_e (defined in TecVals.py)
Get the data type of variable 2 in zone 5:
FieldDataType_e ValLoc = TecUtilDataValueGetType(5, 2);
FieldData_pa TecUtilDataValueGetWritableNativeRef | ( | EntIndex_t | Zone, | |
EntIndex_t | Var | |||
) |
Get a native read/write handle to the data for the specified zone and variable in the data set attached to the current frame.
It is important to realize that when altering the values this variable may in fact be shared. If you want the new values to only apply to the specific zone and variable associated with this handle then you must first call TecUtilDataValueBranchShared() prior to calling TecUtilDataValueGetWritableNativeRef(). This function is Thread Safe.
Zone | Number of the zone for which to get the field data | |
Var | Number of the variable for which to get the field data |
Current frame must have a data set with at least one zone.
SUBROUTINE TecUtilDataValueGetWritableNativeRef( & Zone, & Var, & ResultPtr) INTEGER*4 Zone INTEGER*4 Var POINTER (ResultPtr, Result)
Python Syntax:
Results = TecUtil.DataValueGetWritableNativeRef(Zone, Var) Input: Zone int Var int Output: Results[0] ReturnVal opaque pointer
Function that multiplies variable VarNum in Zone ZoneNum by 2.
static void MultiplyV3By2(EntIndex_t ZoneNum, EntIndex_t VarNum) { // Make sure we are only modifying var VarNum in zone ZoneNum. if (TecUtilDataValueBranchShared(ZoneNum,VarNum)) { FieldData_pa FieldData = TecUtilDataValueGetWritableNativeRef(ZoneNum, VarNum); if (FieldData) { int i; LgIndex_t NumValues = TecUtilDataValueGetCountByRef(FieldData); // Note 1-based for (i = 1; i <= NumPointsInZone; i++) { double OldValue = TecUtilDataValueGetByRef(FieldData, i); TecUtilDataValueSetByRef(FieldData,i,OldValue*2.0); } } } }
void TecUtilDataValueGetWritableRawPtr | ( | EntIndex_t | Zone, | |
EntIndex_t | Var, | |||
void ** | DataPtr, | |||
FieldDataType_e * | FieldDataType | |||
) |
Get a read/write handle to the raw field data in the data set attached to the current frame.
If possible this function provides direct access to a Tecplot variable's internal representation. If performance is not a concern consider using TecUtilDataValueGetByRef(), TecUtilDataValueSetByRef(). If high performance is essential then use TecUtilDataValueArrayGetByRef(), and TecUtilDataValueArraySetByRef() which provide nearly equivalent preformance to direct access. Alternatively for high performance consider using the field data's accessor functions by calling TecUtilDataValueRefGetGetFunc() and TecUtilDataValueRefGetSetFunc(). Note that these high performance functions are a very thin layer over a Tecplot variable's internal representation and unlike the raw field data pointer provided by this function, they are always available. This function is Thread Safe.
Zone | Number of the zone for which to get the raw field data. | |
Var | Number of the variable for which to get the raw field data. | |
DataPtr | Receives the address of the raw field data. May return NULL if the type is too complex. If the type is too complex, you may use TecUtilDataValueRefGetGetFunc() and TecUtilDataValueRefGetSetFunc() to get functions that will deal with the data at a lower level than TecUtilDataValueGetByRef() and TecUtilDataValueSetByRef(). | |
FieldDataType | Receives the data type of the raw field data. The following table shows the possible values for FieldDataType along with the corresponding data type that DataPtr references: |
FieldDataType DataPtr references ------------------------------------------- FieldDataType_Float float * FieldDataType_Double double * FieldDataType_Int32 Int32_t * FieldDataType_Int16 Int16_t * FieldDataType_Byte char * FieldDataType_Bit UInt32_t * FieldDataType_Invalid too complex
Current frame must have a data set with at least one zone.
DataPtr Pointer must be a valid address and non-NULL.
FieldDataType Pointer must be a valid address and non-NULL.
SUBROUTINE TecUtilDataValueGetWritableRawPtr( & Zone, & Var, & DataPtr, & FieldDataType) INTEGER*4 Zone INTEGER*4 Var POINTER (DataPtrPtr, DataPtr) INTEGER*4 FieldDataType
Python Syntax:
This function is not supported in Python.
Get and then set the first and second values of the second variable of zone 5 using a raw data pointer. Note that the first and second values are accessed by zero and one respectively since the raw data is accessed with a zero-base numbering system. Be sure to call TecUtilStateChanged() when you change the data in this way:
EntIndex_t zone = 5; EntIndex_t var = 2; void *raw_fd_ptr = NULL; FieldDataType_e field_data_type; TecUtilDataValueGetWritableRawPtr(zone, var, &raw_fd_ptr, &field_data_type); if ( raw_fd_ptr ) { if ( field_data_type == FieldData_Float ) { Set_pa altered_vars = TecUtilSetAlloc(TRUE); float *float_ptr = (float *)raw_fd_ptr; float v1 = float_ptr[0]; float v2 = float_ptr[1]; // alter v1 and v2 in some way v1 = 2.0 * v1; v2 = 2.0 * v2; float_ptr[0] = v1; float_ptr[1] = v2; // inform Tecplot of var value change TecUtilSetAddMember(altered_vars, var, TRUE); TecUtilStateChanged(StateChange_VarsAltered, (ArbParam_t)altered_vars); TecUtilSetDealloc(&altered_vars); } }
Boolean_t TecUtilDataValueGetZoneVarByRef | ( | FieldData_pa | FD, | |
EntIndex_t * | Zone, | |||
EntIndex_t * | Var | |||
) |
Get a candidate zone and variable associated with the given field data reference.
Note that if the variable is shared then more than one zone and variable combination exists, therefore the first zone and variable combination associated with the field data reference is returned. The following search rules are used: Active relevant zones are searched first and then all remaining enabled zones. This function is Thread Safe.
FD | A field data reference usually obtained via a call to one of the following functions: TecUtilDataValueGetReadableNativeRef(), TecUtilDataValueGetReadableDerivedRef(), TecUtilDataValueGetReadableNLRef(), TecUtilDataValueGetReadableCCRef(), or TecUtilDataValueGetWritableNativeRef(). | |
Zone | Pointer to the resulting candidate Zone associated with the field data. | |
Var | Pointer to the resulting Variable associated with the field data. |
Zone Pointer must be a valid address or NULL.
Var Pointer must be a valid address or NULL.
None.
Python Syntax:
Results = TecUtil.DataValueGetZoneVarByRef(FD) Input: FD opaque pointer Output: Results[0] ReturnVal boolean Results[1] Zone int Results[2] Var int
Get a candidate zone and variable associated with field data FD;
EntIndex_t Zone; EntIndex_t Var; FieldData_pa FD = TecUtilDataValueGetReadableNaiveRef(5, 2);; if (TecUtilDataValueGetZoneVarByRef(FD,&Zone,&Var)) { // Do something with Zone and Var. }
Boolean_t TecUtilDataValueIsLoaded | ( | EntIndex_t | Zone, | |
EntIndex_t | Var | |||
) |
Determine if a variable is loaded for a particular zone.
This function is Thread Safe.
Zone | The number of the zone to which the variable belongs. | |
Var | The number of the variable in question. |
INTEGER*4 FUNCTION TecUtilDataValueIsLoaded( & Zone, & Var) INTEGER*4 Zone INTEGER*4 Var
Python Syntax:
Results = TecUtil.DataValueIsLoaded(Zone, Var) Input: Zone int Var int Output: Results[0] ReturnVal boolean
Boolean_t TecUtilDataValueIsPassive | ( | EntIndex_t | Zone, | |
EntIndex_t | Var | |||
) |
Determine if a variable is passive for a particular zone.
Refer to the Data Format Guide for more information on passive variables. This function is Thread Safe.
Zone | The number of the zone to which the variable belongs. | |
Var | The number of the variable in question. |
Current frame must have a data set with at least one zone.
INTEGER*4 FUNCTION TecUtilDataValueIsPassive( & Zone, & Var) INTEGER*4 Zone INTEGER*4 Var
Python Syntax:
Results = TecUtil.DataValueIsPassive(Zone, Var) Input: Zone int Var int Output: Results[0] ReturnVal boolean
Boolean_t TecUtilDataValueIsSharingOk | ( | EntIndex_t | SourceZone, | |
EntIndex_t | DestZone, | |||
EntIndex_t | Var | |||
) |
Determine if it is ok to share a variable between zones.
For rules on sharing between zones, see TecUtilDataValueShare().
This function is Thread Safe.
SourceZone | The source zone (the zone where the values will be stored). | |
DestZone | The destination zone (the zone acquiring the shared values). | |
Var | The variable to be shared. |
Current frame must have a data set with at least one zone.
INTEGER*4 FUNCTION TecUtilDataValueIsSharingOk( & SourceZone, & DestZone, & Var) INTEGER*4 SourceZone INTEGER*4 DestZone INTEGER*4 Var
Python Syntax:
Results = TecUtil.DataValueIsSharingOk(SourceZone, DestZone, Var) Input: SourceZone int DestZone int Var int Output: Results[0] ReturnVal boolean
If sharing is ok for variable 7 between zones 3 and 5 then share the variable.
if (TecUtilDataValueIsSharingOk(3,5,7)) TecUtilDataValueShare(3,5,7);
FieldValueGetFunction_pf TecUtilDataValueRefGetGetFunc | ( | FieldData_pa | FD | ) |
Get the low-level "get value" function associated with a field data handle.
In general, using this function is faster than calling TecUtilDataValueGetByRef(). This function is Thread Safe.
FD | A field data reference usually obtained via a call to one of the following functions: TecUtilDataValueGetReadableNativeRef(), TecUtilDataValueGetReadableDerivedRef(), TecUtilDataValueGetReadableNLRef(), TecUtilDataValueGetReadableCCRef(), or TecUtilDataValueGetWritableNativeRef(). |
FD The specified field data must be readable.
This function is not supported in Python.
Efficiently get the first twenty-one values of the second variable of zone 5:
LgIndex pt; FieldData_pa FD = TecUtilDataValueGetReadableNaiveRef(5, 2); FieldValueGetFunction_pf GetFunction = TecUtilDataValueRefGetGetFunc(FD); for ( pt = 0; pt < 21; pt++ ) // use =0 and <21 becaused SetFunction is 0-based { double val = GetFunction(fd, pt); // Use val. }
FieldValueSetFunction_pf TecUtilDataValueRefGetSetFunc | ( | FieldData_pa | FD | ) |
Get the low-level "set value" function associated with a field data handle.
In general, using this function is faster than calling TecUtilDataValueSetByRef(). This function is Thread Safe.
FD | A field data handle usually obtained via TecUtilDataValueGetWritableNativeRef(). |
None.
Python Syntax:
This function is not supported in Python.
Efficiently set the twenty-first values of the second variable of zone 5 to 17.6:
Set_pa alteredVars = TecUtilSetAlloc(TRUE); LgIndex pt; FieldData_pa FD = TecUtilDataValueGetWritableNativeRef(5, 2); FieldValueSetFunction_pf setFunction = TecUtilDataValueRefSetGetFunc(FD); for ( pt = 0; pt < 21; pt++ ) // use =0 and <21 becaused setFunction is 0-based setFunction(fd, pt, 17.6); // inform Tecplot of var value change TecUtilSetAddMember(alteredVars, 2, TRUE); TecUtilStateChanged(StateChange_VarsAltered, (ArbParam_t)alteredVars); TecUtilSetDealloc(&alteredVars);
void TecUtilDataValueSetByRef | ( | FieldData_pa | FD, | |
LgIndex_t | PointIndex, | |||
double | Value | |||
) |
Assign a value to a field variable at a specific position.
If the zone referenced is IJ- or IJK-ordered, the position is calculated by treating the two- or three-dimensional array as a one-dimensional array. Be sure to call TecUtilStateChanged() after changing field data in this way. This function is Thread Safe.
FD | A field data reference usually obtained via a call to one of the following functions: TecUtilDataValueGetReadableNativeRef(), TecUtilDataValueGetReadableDerivedRef(), TecUtilDataValueGetReadableNLRef(), TecUtilDataValueGetReadableCCRef(), or TecUtilDataValueGetWritableRef(). | |
PointIndex | Position in the array of field data values. Position starts at one. For cell centered variables in ordered zones, the array includes values for IMax, JMax and KMax, even though these values are not used. You must account for these "ghost" cells in calculating the PointIndex. The formula for PointIndex in terms of I,J, and K is the same for both Nodal and cell centered variables. PointIndex = I + (J-1)*IMax + (K-1)*IMax*JMax; | |
Value | New value for the position in the field data. |
SUBROUTINE TecUtilDataValueSetByRef( & FDPtr, & PointIndex, & Value) POINTER (FDPtr, FD) INTEGER*4 PointIndex REAL*8 Value
Python Syntax:
Results = TecUtil.DataValueSetByRef(FD, PointIndex, Value) Input: FD opaque pointer PointIndex int Value double Output: Results[0] ReturnVal NONE
Set the first two values of the second variable of zone 5 to be 1.25 and 1.35 respectively:
Set_pa altered_vars; FieldData_pa fd = TecUtilDataValueGetWritableNativeRef(5, 2); if ( fd ) { TecUtilDataValueSetByRef(fd, 1, 1.25); TecUtilDataValueSetByRef(fd, 2, 1.35); // inform Tecplot of var value change altered_vars = TecUtilSetAlloc(TRUE); TecUtilSetAddMember(altered_vars, var, TRUE); TecUtilStateChanged(StateChange_VarsAltered, (ArbParam_t)altered_vars); TecUtilSetDealloc(&altered_vars); }
Boolean_t TecUtilDataValueSetByZoneVar | ( | EntIndex_t | Zone, | |
EntIndex_t | Var, | |||
LgIndex_t | PointIndex, | |||
double | Value | |||
) |
Assign a value to a field variable at a specific position.
This function does not require you to obtain the handle to the field data as does TecUtilDataValueSetByRef(), however this function is not very efficient. Use TecUtilDataValueSetByRef() if you are setting multiple values in the same zone. If the zone referenced is IJ- or IJK-ordered then the position is calculated by treating the two- or three-dimensional array as a one-dimensional array. TecUtilStateChanged() need not be called after changing data in this way since Tecplot will handle that for you.
Zone | The zone number. | |
Var | The variable number. | |
PointIndex | Position in the array of field data values. Position starts at one. | |
Value | New value for the position in the field data. |
Current frame must have a data set with at least one zone.
INTEGER*4 FUNCTION TecUtilDataValueSetByZoneVar( & Zone, & Var, & PointIndex, & Value) INTEGER*4 Zone INTEGER*4 Var INTEGER*4 PointIndex REAL*8 Value
Python Syntax:
Results = TecUtil.DataValueSetByZoneVar(Zone, Var, PointIndex, Value) Input: Zone int Var int PointIndex int Value double Output: Results[0] ReturnVal boolean
Set the first value of the second variable of zone 5 to be 0.0.
TecUtilDataValueSetByZoneVar(5, 2, 1, 0.0);
Boolean_t TecUtilDataValueSetByZoneVarX | ( | ArgList_pa | ArgList | ) |
Assign a value to a field variable at a specific position.
This function does not require you to obtain the handle to the field data as does TecUtilDataValueSetByRef(), however this function is not very efficient. Use TecUtilDataValueSetByRef() if you are setting multiple values in the same zone. If the zone referenced is IJ- or IJK-ordered then the position is calculated by treating the two- or three-dimensional array as a one-dimensional array. TecUtilStateChanged() need not be called after changing data in this way since Tecplot will handle that for you.
ArgList | Set of Arglist entries. This is built using calls to TecUtilArgListAppendXXXX functions. |
Type: | EntIndex_t |
Arg Function: | TecUtilArgListAppendInt() |
Required: | Yes |
Notes: | The zone number. |
Type: | EntIndex_t |
Arg Function: | TecUtilArgListAppendInt() |
Required: | Yes |
Notes: | The variable number. |
Type: | LgIndex_t |
Arg Function: | TecUtilArgListAppendInt() |
Required: | Yes |
Notes: | Position in the array of field data values. Position starts at one. |
Type: | double |
Arg Function: | TecUtilArgListAppendDouble() |
Required: | Yes |
Notes: | New value for the position in the field data. |
Type: | Boolean_t |
Arg Function: | TecUtilArgListAppendceInt() |
Default: | FALSE |
Required: | No |
Notes: | Branch variable automatically if it is currently shared. |
Must have one or more frames.
Current frame must have a data set with at least one zone.
INTEGER*4 FUNCTION TecUtilDataValueSetByZoneVarX(ArgListPtr) POINTER (ArgListPtr, ArgList)
Python Syntax:
Results = TecUtil.DataValueSetByZoneVarX(ArgList)
Input:
ArgList dictionary
Output:
Results[0] ReturnVal boolean
Set the first value of the second variable of zone 5 to be 0.0.
ArgList_pa ArgList; TecUtilLockStart(AddOnID); ArgList = TecUtilArgListAlloc(); TecUtilArgListAppendInt(ArgList, SV_ZONE, 1); TecUtilArgListAppendInt(ArgList, SV_VAR, 4); TecUtilArgListAppendInt(ArgList, SV_INDEX, 10); TecUtilArgListAppendDouble(ArgList, SV_VALUE, 123.4); TecUtilArgListAppendInt(ArgList, SV_AUTOBRANCH, (LgIndex_t)TRUE); TecUtilDataValueSetByZoneVarX(ArgList); TecUtilArgListDealloc(&ArgList); TecUtilLockFinish(AddOnID);
void TecUtilDataValueSetMinMaxByRef | ( | FieldData_pa | FieldData, | |
double | MinValue, | |||
double | MaxValue | |||
) |
Set the minimum and maximum values for a tecplot variable using a field data reference.
Although Tecplot will calculate the min/max value for a variable if one is not supplied there are cases where it is valuable to supply these values. If a loader add-on knows the min/max values it may save a significant amount of time to supply them. Additionally, if an add-on is loading variables using Tecplot's load-on-demand facility supplying the min/max value for a variable prevents Tecplot from having to load the variable in some situations, saving time and memory. It is important that the supplied values accurately represent the min/max values of the data and not a subset of the data. This function is Thread Safe.
FieldData | The field data handle of the variable to receive the min/max value assignments. | |
MinValue | Minimum variable value. | |
MaxValue | Maximum variable value. |
Current frame must have a data set with at least one zone.
FieldData Pointer must be a valid address and non-NULL.
SUBROUTINE TecUtilDataValueSetMinMaxByRef( & FieldDataPtr, & MinValue, & MaxValue) POINTER (FieldDataPtr, FieldData) REAL*8 MinValue REAL*8 MaxValue
Python Syntax:
Results = TecUtil.DataValueSetMinMaxByRef(FieldData, MinValue, MaxValue) Input: FieldData opaque pointer MinValue double MaxValue double Output: Results[0] ReturnVal NONE
Set the minimum and maximum values for a newly loaded variable.
... after defining the data to load, issue state change ... // supply the min/max value of the variable reference TecUtilDataValueSetMinMaxByRef(FieldData, MinValue, MaxValue);
Multiply the value of the 3rd variable of the 2nd zone and then tell Tecplot the new min/max value so it doesn't have to recalculate it.
double MinValue; double MaxValue; double Factor = 3.0; EntIndex_t Zone = 2; EntIneex_t Var = 3; FieldData_pa FieldData = TecUtilDataValueReadableGetRef(Zone, Var); TecUtilDataValueGetMinMaxByRef(FieldData, &MinValue, &MaxValue); // mutiply variable by the factor and issue a vars altered state change MyFuncToMultiplyVarByFactor(Zone, Var, Factor); //...not shown MyFuncToBroadcastStateChange(Zone, Var); //...not shown // assign the min/max values after a vars altered state change // as the state change call will invalidate the min/max values TecUtilDataValueSetMinMaxByRef(FieldData, MinValue*Factor, MaxValue*Factor);
void TecUtilDataValueSetMinMaxByZoneVar | ( | EntIndex_t | Zone, | |
EntIndex_t | Var, | |||
double | MinValue, | |||
double | MaxValue | |||
) |
Set the minimum and maximum values for a tecplot variable using a zone and variable number.
Although Tecplot will calculate the min/max value for a variable if one is not supplied there are cases where it is valuable to supply these values. If a loader add-on knows the min/max values it may save a significant amount of time to supply them. Additionally, if an add-on is loading variables using Tecplot's load-on-demand facility supplying the min/max value for a variable prevents Tecplot from having to load the variable in some situations, saving time and memory. It is important that the supplied values accurately represent the min/max values of the data and not a subset of the data. This function is Thread Safe.
Zone | The zone number of the variable to receive the min/max value assignments. | |
Var | The variable number to receive the min/max value assignments. | |
MinValue | Minimum variable value. | |
MaxValue | Maximum variable value. |
Current frame must have a data set with at least one zone.
SUBROUTINE TecUtilDataValueSetMinMaxByZoneVar( & Zone, & Var, & MinValue, & MaxValue) INTEGER*4 Zone INTEGER*4 Var REAL*8 MinValue REAL*8 MaxValue
Python Syntax:
Results = TecUtil.DataValueSetMinMaxByZoneVar(Zone, Var, MinValue, MaxValue) Input: Zone int Var int MinValue double MaxValue double Output: Results[0] ReturnVal NONE
Set the minimum and maximum values for a newly loaded variable.
... after defining the data to load, issue state change ... // supply the min/max value for the variable 2 of zone 5 TecUtilDataValueSetMinMaxByZoneVar(5, 2, MinValue, MaxValue);
Multiply the value of the 3rd variable of the 2nd zone and then tell Tecplot the new min/max value so it doesn't have to recalculate it.
double MinValue; double MaxValue; double Factor = 3.0; EntIndex_t Zone = 2; EntIneex_t Var = 3; TecUtilDataValueGetMinMaxByZoneVar(Zone Var, &MinValue, &MaxValue); // mutiply variable by the factor and issue a vars altered state change MyFuncToMultiplyVarByFactor(Zone, Var, Factor); //...not shown MyFuncToBroadcastStateChange(Zone, Var); //...not shown TecUtilDataValueSetMinMaxByZoneVar(Zone, Var, MinValue*Factor, MaxValue*Factor);
void TecUtilDataValueShare | ( | EntIndex_t | SourceZone, | |
EntIndex_t | DestZone, | |||
EntIndex_t | Var | |||
) |
Sets the properties of the variable so that it is shared between source and destination zones (using the source for values).
Both zones must have the same structure and value location: Ordered zones must have the same number of points if nodal but cell centered zones must specifically have the same I,J, and K values. Finite-element zones must have the same number of points if nodal or the same number of elements if cell centered. Sharing data between ordered and finite-element zones is only allowed if the values are nodal and the zones have the same number of points. Cell centered sharing is not allowed because ordered zones have ghost cells and finite-element zones do not.
SourceZone | The zone number where the data values are based. | |
DestZone | The zone number where the data values will be shared from the source zone. | |
Var | The variable to be shared. |
Current frame must have a data set with at least one zone.
SUBROUTINE TecUtilDataValueShare( & SourceZone, & DestZone, & Var) INTEGER*4 SourceZone INTEGER*4 DestZone INTEGER*4 Var
Python Syntax:
Results = TecUtil.DataValueShare(SourceZone, DestZone, Var) Input: SourceZone int DestZone int Var int Output: Results[0] ReturnVal NONE
Set the first variable of zone 3 to be shared with zone 2:
TecUtilDataValueShare(2, 3, 1);
Boolean_t TecUtilDataValueUnload | ( | EntIndex_t | Zone, | |
EntIndex_t | Var | |||
) |
Instructs Tecplot to unload the variable.
All field data references to the unloaded variable are invalid. If after unloading the variable you wish to inspect or modify the field data you must re-obtain a readable or writable field data reference or raw pointer.
This function is Thread Safe.
Zone | Zone containing the variable to unload. | |
Var | Variable to unload. |
Current frame must have a data set with at least one zone.
Results = TecUtil.DataValueUnload(Zone, Var) Input: Zone int Var int Output: Results[0] ReturnVal boolean