parameters: (objective_function=None)
docstring: gets the adjoint suffix given an objective function
docstring_summary: gets the adjoint suffix given an objective function
docstring_tokens: gets the adjoint suffix given an objective function
function: def get_adjointSuffix(objective_function=None):
      """ gets the adjoint suffix given an objective function """
      
      # adjoint name map
      name_map = { "DRAG"                        : "cd"        ,
                   "LIFT"                        : "cl"        ,
                   "SIDEFORCE"                   : "csf"       ,
                   "MOMENT_X"                    : "cmx"       ,
                   "MOMENT_Y"                    : "cmy"       ,
                   "MOMENT_Z"                    : "cmz"       ,
                   "FORCE_X"                     : "cfx"       ,
                   "FORCE_Y"                     : "cfy"       ,
                   "FORCE_Z"                     : "cfz"       ,
                   "EFFICIENCY"                  : "eff"       ,
                   "INVERSE_DESIGN_PRESSURE"     : "invpress"  ,
                   "INVERSE_DESIGN_HEAT"         : "invheat"   ,
                   "MAXIMUM_HEATFLUX"            : "maxheat"   ,
                   "TOTAL_HEATFLUX"              : "totheat"   ,
                   "EQUIVALENT_AREA"             : "ea"        ,
                   "NEARFIELD_PRESSURE"          : "nfp"       ,
                   "THRUST"                      : "ct"        ,
                   "TORQUE"                      : "cq"        ,
                   "FIGURE_OF_MERIT"             : "merit"     ,
                   "BUFFET"                      : "buffet"    ,
                   "SURFACE_TOTAL_PRESSURE"      : "pt"        ,
                   "SURFACE_STATIC_PRESSURE"     : "pe"        ,
                   "SURFACE_MASSFLOW"            : "mfr"       ,
                   "SURFACE_MACH"                : "mach"      ,
                   "SURFACE_UNIFORMITY"          : "uniform"   ,
                   "SURFACE_SECONDARY"           : "second"    ,
                   "SURFACE_MOM_DISTORTION"      : "distort"   ,
                   "SURFACE_SECOND_OVER_UNIFORM" : "sou"       ,
                   "SURFACE_PRESSURE_DROP"       : "dp"        ,
                   "CUSTOM_OBJFUNC"              : "custom"    ,
                   "KINETIC_ENERGY_LOSS"         : "ke"        ,
                   "TOTAL_PRESSURE_LOSS"         : "pl"        ,
                   "ENTROPY_GENERATION"          : "entg"      ,
                   "EULERIAN_WORK"               : "ew"        ,
                   "FLOW_ANGLE_OUT"              : "fao"       ,
                   "FLOW_ANGLE_IN"               : "fai"       ,
                   "MASS_FLOW_OUT"               : "mfo"       ,
                   "MASS_FLOW_IN"                : "mfi"       ,
                   "TOTAL_EFFICIENCY"            : "teff"      ,
                   "TOTAL_STATIC_EFFICIENCY"     : "tseff"     ,
                   "COMBO"                       : "combo"}
      
      # if none or false, return map
      if not objective_function:
          return name_map
      else:
          # remove white space
          objective = ''.join(objective_function.split())
          objective = objective.split(",")
          nObj = len(objective)
          if (nObj>1):
              return "combo"
          if objective[0] in name_map:
              return name_map[objective[0]]
      
          # otherwise...
          else:
              raise Exception('Unrecognized adjoint function name')
function_tokens: def get_adjointSuffix ( objective_function = None ) : # adjoint name map name_map = { "DRAG" : "cd" , "LIFT" : "cl" , "SIDEFORCE" : "csf" , "MOMENT_X" : "cmx" , "MOMENT_Y" : "cmy" , "MOMENT_Z" : "cmz" , "FORCE_X" : "cfx" , "FORCE_Y" : "cfy" , "FORCE_Z" : "cfz" , "EFFICIENCY" : "eff" , "INVERSE_DESIGN_PRESSURE" : "invpress" , "INVERSE_DESIGN_HEAT" : "invheat" , "MAXIMUM_HEATFLUX" : "maxheat" , "TOTAL_HEATFLUX" : "totheat" , "EQUIVALENT_AREA" : "ea" , "NEARFIELD_PRESSURE" : "nfp" , "THRUST" : "ct" , "TORQUE" : "cq" , "FIGURE_OF_MERIT" : "merit" , "BUFFET" : "buffet" , "SURFACE_TOTAL_PRESSURE" : "pt" , "SURFACE_STATIC_PRESSURE" : "pe" , "SURFACE_MASSFLOW" : "mfr" , "SURFACE_MACH" : "mach" , "SURFACE_UNIFORMITY" : "uniform" , "SURFACE_SECONDARY" : "second" , "SURFACE_MOM_DISTORTION" : "distort" , "SURFACE_SECOND_OVER_UNIFORM" : "sou" , "SURFACE_PRESSURE_DROP" : "dp" , "CUSTOM_OBJFUNC" : "custom" , "KINETIC_ENERGY_LOSS" : "ke" , "TOTAL_PRESSURE_LOSS" : "pl" , "ENTROPY_GENERATION" : "entg" , "EULERIAN_WORK" : "ew" , "FLOW_ANGLE_OUT" : "fao" , "FLOW_ANGLE_IN" : "fai" , "MASS_FLOW_OUT" : "mfo" , "MASS_FLOW_IN" : "mfi" , "TOTAL_EFFICIENCY" : "teff" , "TOTAL_STATIC_EFFICIENCY" : "tseff" , "COMBO" : "combo" } # if none or false, return map if not objective_function : return name_map else : # remove white space objective = '' . join ( objective_function . split ( ) ) objective = objective . split ( "," ) nObj = len ( objective ) if ( nObj > 1 ) : return "combo" if objective [ 0 ] in name_map : return name_map [ objective [ 0 ] ] # otherwise... else : raise Exception ( 'Unrecognized adjoint function name' )