⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tm_icl.1316.0

📁 一个isight调用ansys接口的例子
💻 0
字号:
api_StartTask IBEAM

api_SetVersionInfo IBEAM \
   -mdolVersion 8.0

api_SetCompileOptions IBEAM \
   -errorLevel warn \
   -topologyFile {}

api_SetBlockComments IBEAM \
   Optimization PriorityRankedPlan { PLAN TO BE CONFIGURED BY ADVISOR:}

api_SetTaskHeader IBEAM \
   -description {
   } \
   -version 1.0 \
   -color Gray \
   -directorySearchList {
   } \
   -evaluation {doestudy DOEStudy1} \
   -controlMode user \
   -userMode interactive \
   -precision double \
   -elapseTime 259200 \
   -runCounter 21 \
   -autoPath {
   } \
   -auditEnable {
   } \
   -auditDisable {
   } \
   -checkPoint unknown \
   -boundsPolicy adjustvalue \
   -randGenInit default \
   -switchOn {
   } \
   -switchOff {
   }

api_SetInputs IBEAM \
   -parameters {
      {Flange 20.0 REAL unknown ""}
      {Width 20.0 REAL unknown ""}
      {HeightUp 20.0 REAL unknown ""}
      {Height 80.0 REAL unknown ""}
      {Length 200.0 REAL unknown ""}
   }

api_SetAuxiliaries IBEAM \
   -parameters {
   }

api_SetOutputs IBEAM \
   -parameters {
      {MaxSEQV REAL "%s" ""}
      {Volume REAL "%s" ""}
      {Objective REAL "%s" ""}
      {Feasibility INTEGER "%s" ""}
      {TaskProcessStatus REAL "%s" ""}
   }

api_SetGroup IBEAM OutputConstraintsGroup \
   { MaxSEQV }

api_SetGroup IBEAM InputConstraintsGroup \
   { Flange Width HeightUp Height }

api_SetGroup IBEAM VariablesGroup \
   { Flange Width HeightUp Height Length }

api_SetGroup IBEAM OutputsGroup \
   { MaxSEQV Volume }

api_SetGroup IBEAM AuxiliariesGroup \
   { }

api_SetGroup IBEAM InputsGroup \
   { Flange Width HeightUp Height Length }

api_SetInitialization IBEAM \
   -parameters {
   } \
   -expressions {
   }

api_SetCalculation IBEAM CalVolume \
   -type mdol \
   -parameters {
      Width
      Flange
      Height
      HeightUp
      Volume
   } \
   -expressions {
Volume = (Height*Width+2*(Flange*2+Width)*HeightUp)
}

   api_StartSimcode SolidEdge
      api_SetStandardInputFile beamvbs \
         -simcode SolidEdge \
         -templateFile "Template.txt" \
         -inputFile "beam.vbs" \
         -nameValueFile "MDOLGEN_IBEAM.1" \
         -translationFile "MDOLGEN_IBEAM.2" \
         -saveTranslationFile no \
         -parameters {
            Flange
            Width
            HeightUp
            Height
            Length
         } \
         -instructions { 
require  Flange Width HeightUp Height Length
    find "\"FlangeLeftUp\"," ignore 
    replace "50.0000000" with $Flange as "%f" ignore 
    find "\"Width\"," ignore 
    replace "20.0000000" with $Width as "%f" ignore 
    find "\"HeightUp\"," ignore 
    replace "20.000000" with $HeightUp as "%f" ignore 
    find "\"Height\"," ignore 
    replace "50.0000000" with $Height as "%f" ignore 
    find "\"Length\"," ignore 
    replace "360.0000000" with $Length as "%f" ignore
 }

   api_SetSimcode SolidEdge \
      -program "./beam.vbs" \
      -processType transient \
      -environment restored \
      -elapseTime 300 \
      -prolog {
         {WriteInputFiles beamvbs}
      } \
      -epilog {
      } \
      -executionTemplate {$Program}

   api_EndSimcode SolidEdge


   api_StartSimcode Ansys
      api_SetStandardOutputFile outputtxt \
         -simcode Ansys \
         -outputFile "output.txt" \
         -nameValueFile "MDOLGEN_IBEAM.3" \
         -translationFile "MDOLGEN_IBEAM.4" \
         -saveTranslationFile no \
         -parameters {
            MaxSEQV
         } \
         -instructions { 
find "*GET  SEQMAX    FROM  SORT  ITEM=MAX        VALUE=  " ignore 
read MaxSEQV as "%f"
provide $MaxSEQV
 }

   api_SetSimcode Ansys \
      -program {} \
      -scriptLanguage DOSBatch \
      -scriptText { 
cmd /c "C:\Program Files\Ansys Inc\v80\ANSYS\bin\intel\ansys80.exe" -b -i ./beam.lgw -o ./output.txt
 } \
      -processType transient \
      -environment restored \
      -elapseTime 300 \
      -prolog {
      } \
      -epilog {
         {ReadOutputFiles outputtxt}
      } \
      -executionTemplate {$Program}

   api_EndSimcode Ansys


   api_StartSimcode Del
   api_SetSimcode Del \
      -program {} \
      -scriptLanguage DOSBatch \
      -scriptText { 
del D:\beam\Beam.igs
del D:\beam\Beam.full
del D:\beam\file.lock
del D:\beam\output.txt
 } \
      -processType transient \
      -environment unrestored \
      -elapseTime 300 \
      -prolog {
      } \
      -epilog {
      } \
      -executionTemplate {$Program}

   api_EndSimcode Del


api_StartProcess IBEAM
api_SetTaskProcess IBEAM \
   -prolog {
   } \
   -epilog {
      {ScaleConstraints}
      {CalculateObjective}
      {PostEvent TaskProcessCompleted}
   } \
   -controlParameters {
   } \
   -control {
      {EvaluateSequential {
            EvaluateSimcode Del
            EvaluateSimcode SolidEdge
            EvaluateCalculation CalVolume
            EvaluateSimcode Ansys
         }
      }
   }

api_EndProcess IBEAM


api_SetDataStorage IBEAM \
   -restore no \
   -dataLog {"IBEAM.db" overwrite on {
      }
   } \
   -dataLookUp {on {
         "IBEAM.db"
      }
   } \
   -matchMode Exact \
   -matchTolerance {} \
   -levels { 0 1 2 3 4 5 6 7 8 9 } \
   -storeGrad yes \
   -storeApprox yes \
   -condition {} \
   -parameters {
   }

api_StartOptimization IBEAM
api_SetOptimizationPlan IBEAM PriorityRankedPlan \
   -prolog {
   } \
   -epilog {
   } \
   -description {} \
   -defaultUpperBound 1E15 \
   -useScaling yes \
   -terminationCriteria { \
   } \
   -variables {
      Flange
      Width
      HeightUp
      Height
   } \
   -potentialVariables {
      Flange
      Width
      HeightUp
      Height
      Length
   } \
   -variableScaling {
      {Flange 1.0}
      {Width 1.0}
      {HeightUp 1.0}
      {Height 1.0}
      {Length 1.0}
   } \
   -inputConstraints {
      {Flange lower 10.0}
      {Flange upper 30.0}
      {Width lower 10.0}
      {Width upper 30.0}
      {HeightUp lower 10.0}
      {HeightUp upper 30.0}
      {Height lower 50.0}
      {Height upper 100.0}
   } \
   -potentialObjectives {
      Flange
      Width
      HeightUp
      Height
      Length
      MaxSEQV
      Volume
   } \
   -objectives {
      {Volume minimize 1.0 1.0}
   } \
   -outputConstraints {
      {MaxSEQV upper 10000000.0 1.0 1.0}
      {TaskProcessStatus upper 0.0 1.0 1.0}
   } \
   -controlParameters {
   } \
   -control {
   }

api_EndOptimization IBEAM


api_SetDOEPlan IBEAM DOEPlan1 \
   -description {} \
   -technique "OrthogonalArray" \
   -factors {
      {Length \
         -factorType control \
         -baseLine 200.0 \
         -levelType percent \
         -levels {
            -25.0
            -8.333
            8.333
            25.0
         }
      }
   } \
   -interactionMode user \
   -interactions {
   }

api_SetDOEStudy IBEAM DOEStudy1 \
   -description {} \
   -plan DOEPlan1 \
   -responseParms {
      MaxSEQV
   } \
   -responseCalcs {
   } \
   -resultFile "doe_Study.DOEStudy1" \
   -prologue {
      {
}
   } \
   -epilogue {
      {
}
   } \
   -objectiveType parameter \
   -objective MaxSEQV \
   -direction minimize \
   -setToOptimum no

api_SetTaskPlan IBEAM \
   -stopTaskPlanOnError no \
   -prologue {
   } \
   -epilogue {
   } \
   -controlParameters {
   } \
   -control {
      {EvaluateOptimizePlan PriorityRankedPlan}
   }

api_SetCheckPoint IBEAM \
   -files {
   } \
   -save {
   } \
   -restore {
   }

api_SetTaskCleanup IBEAM \
   -parameters {
   } \
   -expressions {
   } \
   -deleteFiles {
      "MDOLGEN_IBEAM.1"
      "MDOLGEN_IBEAM.2"
      "MDOLGEN_IBEAM.3"
      "MDOLGEN_IBEAM.4"
   }

api_SetProcedures IBEAM \
   -tclSourceFiles {
   } \
   -procedures {
   }

api_EndTask IBEAM

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -