Loading ...
Sorry, an error occurred while loading the content.

2706RE: [Tecplot_Talk] Get maximum value of a single zone

Expand Messages
  • Alter, Stephen J. (LARC-D305)
    Sep 9, 2008

      Yep. I had to switch from Var to Zone; that’s what I get from programming from memory and not testing it. Sorry for the confusion. With respect to the “Value String” you should not be placing text in there. Only the value of the string. So VarMin3 is |MinC| in the macro when variable 3 is assigned to the contour variable of the plot. By default, C1 is the contour variable, and that’s what MinC returns. Look at the Scripting manual to determine the internal macro variables like the MinC and MaxC; MaxVar[nnn] is not a valid construct in the macro. Hence, Tecplot sees this as a string to assign to a valuestring.

       

      BTW, you can also change the format by including %2.2f at the end of VarMin3 such as &(AuxZone[10]:VarMin3%.2f) and the string will be reduced to two significant digits on the right hand side of the decimal. That way you’re not stuck with the 12 significant digits. It becomes an issue if you are loading in 32-bit data. Tecplot uses double precision for everything inside. So if your data is 32-bit, you need to be cautious about the number of significant digits you display on a plot.

       

      The formatting of text can be found in the scripting manual and the User’s Manual.

       

      From: Tecplot_Talk@yahoogroups.com [mailto:Tecplot_Talk@yahoogroups.com] On Behalf Of Puetz, Oliver (E F PR SU)
      Sent: Tuesday, September 09, 2008 10:06 AM
      To: Tecplot_Talk@yahoogroups.com
      Subject: AW: [Tecplot_Talk] Get maximum value of a single zone

       

      Hello Stephen,

       

      I have to change "AuxDataLocation = Var" to "AuxDataLocation = Zone". Thi is my code

       

      $!Loop |NumZones|
        $!VarSet |SourceZone| = |loop|
        $!ActiveFieldMaps = [|SourceZone|]
        $!Loop |NumVars|
          $!SetAuxData
            AuxDataLocation = Zone
            Zone = |SourceZone|
            Name = "VarMin|loop|"
            ValueString = "MinVAR[|loop|]"
          $!SetAuxData
            AuxDataLocation = Zone
            Zone = |SourceZone|
            Name = "VarMax|loop|"
            ValueString = "MaxVAR[|loop|]"
        $!EndLoop
      $!EndLoop

      But in the variable, the value is MAXVAR[13] instead of the real value.

       

      ?!?

       

      Oliver

       

       

       


      Von: Tecplot_Talk@yahoogroups.com [mailto:Tecplot_Talk@yahoogroups.com] Im Auftrag von Alter, Stephen J. (LARC-D305)
      Gesendet: Dienstag, 9. September 2008 15:31
      An: Tecplot_Talk@yahoogroups.com
      Betreff: RE: [Tecplot_Talk] Get maximum value of a single zone

      You will have to use a macro to assign auxiliary data to each zone to contain the information you want to display. An example would be:

      #!MC 1100

      # This macro assigns the min and max of each zone for each variable to an auxiliary data entry.

      $!Loop |NumZones|

        $!VarSet |SourceZone| = |loop|

        $!ActiveFieldMaps = [|SourceZone|]

        $!Loop |NumVars|

          $!GlobalContour [C1]

            Var = |loop|

          $!SetAuxData

            AuxDataLocation = Var

            Zone = |SourceZone|

            Name = “VarMin|loop|”

            ValueString = “|MinC|”

          $!SetAuxData

            AuxDataLocation = Var

            Zone = |SourceZone|

            Name = “VarMax|loop|”

            ValueString = “|MaxC|”

        $!EndLoop

      $!EndLoop

      In this macro, using the “ActiveFieldMaps” causes only one zone to be active. In the past, Tecplot’s |MinC| and |MaxC| in the macro language would return the minimum of the contour variable for the active zones. With only one active zone, this should be the values you want for each variable of each zone as the macro cycles through the variables. After running the macro, you can then use the dynamic text command &(AuxZone[10]:VarMin3) to get the minimum of variable 3 in zone 10.

      Good luck.

      From: Tecplot_Talk@yahoogroups.com [mailto:Tecplot_Talk@yahoogroups.com] On Behalf Of Puetz, Oliver (E F PR SU)
      Sent: Tuesday, September 09, 2008 6:52 AM
      To: Tecplot_Talk@yahoogroups.com
      Subject: [Tecplot_Talk] Get maximum value of a single zone

      Hello,

      I want to output the maximum value of a zone in a text field

      With

          &(MINVAR[10])

      the oveall maximum of all zones will be outputted.

      Does anyone knows, how to catch the maximum only for a given zone?

      Thanks and regards

      Oliver

    • Show all 6 messages in this topic