CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Tecplot (https://www.cfd-online.com/Forums/tecplot/)
-   -   Data comparision using 'if' for tecplot macros (https://www.cfd-online.com/Forums/tecplot/99991-data-comparision-using-if-tecplot-macros.html)

oth April 17, 2012 23:53

Data comparision using 'if' for tecplot macros
 
Hi,

I've written a macro for comparing my output data to a constant value. My output file is a 3-dimensional block type data. In total there are 120 zones and 19 variables. I want to compare each and every point from all the zones with a constant value. I'm trying to compare the variables value like this :

$!LOOP |var|
----
----
$!LOOP |zone|
----
----
$!IF |V|var|[|zone|](i,j,k)| == 1
$!ALTERDATA
----
----
$!ENDIF
$!ENDLOOP
$!ENDLOOP

var - variable number ;
zone - zone number;
i,j,k - indexes of an arbitrary point;

but it's saying that's not the correct format etc.

Could someone help me with this?

Thanks,
Othniel

SergeAS April 18, 2012 01:04

Quote:

Originally Posted by oth (Post 355278)
Hi,

I've written a macro for comparing my output data to a constant value. My output file is a 3-dimensional block type data. In total there are 120 zones and 19 variables. I want to compare each and every point from all the zones with a constant value. I'm trying to compare the variables value like this :

$!LOOP |var|
----
----
$!LOOP |zone|
----
----
$!IF |V|var|[|zone|](i,j,k)| == 1
$!ALTERDATA
----
----
$!ENDIF
$!ENDLOOP
$!ENDLOOP

var - variable number ;
zone - zone number;
i,j,k - indexes of an arbitrary point;

but it's saying that's not the correct format etc.

Could someone help me with this?

Thanks,
Othniel

In your case I would first apply the operation "Value Blanking"

oth April 18, 2012 01:18

Hi,

Thanks for the reply. Actually I can understand what you are saying. If we use 'value blanking' we can eliminate data which we don't need, but in this case I want to further modify the data after comparison with the constant value. Like, I want to count the number of data points whose value is equal to 1. I would like to know how to correctly use the IF statement there.

Thanks,
Othniel

SergeAS April 18, 2012 02:21

Quote:

Originally Posted by oth (Post 355287)
Hi,

I want to count the number of data points whose value is equal to 1.

Thanks,
Othniel

In this case the best way (ImHO) it is use "Integrate" option.


All times are GMT -4. The time now is 05:30.