1.ANSYS同fortran相类似的函数ABS(x)Absolutevalueofx.SIGN(x,y)Absolutevalueofxwithsignofy.y=0resultsinpositivesign.EXP(x)Exponentialofx(ex).LOG(x)Naturallogofx(ln(x)).LOG10(x)Commonlogofx(log10(x)).SQRT(x)Squarerootofx.NINT(x)Nearestintegertox.MOD(x,y)Remainderofx/y,computedasx-(INT(x/y)*y).y=0returnszero(0).RAND(x,y)Randomnumber(uniformdistribution)intherangextoy(x=lowerbound,y=upperbound).GDIS(x,y)RandomsampleofaGaussian(normal)distributionwithmeanxandstandarddeviationy.SIN(x),COS(x),TAN(x)Sine,Cosine,andTangentofx.xisinradiansbydefault,butcanbechangedtodegreeswith*AFUN.SINH(x),COSH(x),TANH(x)Hyperbolicsine,Hyperboliccosine,andHyperbolictangentofx.ASIN(x),ACOS(x),ATAN(x)Arcsine,Arccosine,andArctangentofx.xmustbebetween-1.0and+1.0forASINandACOS.Outputisinradiansbydefault,butcanbechangedtodegreeswith*AFUN.Rangeofoutputis-pi/2to+pi/2forASINandATAN,and0topiforACOS.ATAN2(y,x)Arctangentofy/xwiththesignofeachcomponentconsidered.Outputisinradiansbydefault,butcanbechangedtodegreeswith*AFUN.Rangeofoutputis-pito+pi.VALCHR(CPARMNumericalvalueofCPARM(ifCPARMisnon-numeric,returns0.0).CHRVAL(PARM)CharactervalueofnumericalparameterPARM.Numberofdecimalplacesdependsonmagnitude.UPCASECPARMUppercaseequivalentofCPARM.LWCASE(CPARM)LowercaseequivalentofCPARM.2.ANSYS中控制函数APDLCommandActionItTakesUsageTips*DODefinesthestartofadoloop.Thecommandsfollowingthe*DOcommandexecute(uptothe*ENDDOcommand)repeatedlyuntilsomeloopcontrolissatisfied.Youcanalsocontrolloopingviathe*IFcommand.ANSYSallowsupto20levelsofnested“do”loops,although“do”loopsthatinclude/INPUT,*USE,oran“unknown”commandmacrosupportfewernestinglevelsbecausetheydointernalfileswitching.*DO,*ENDDO,*CYCLE,and*EXITcommandsina“do”loopmustallreadfromthesamefileorthekeyboard.Donotincludepickingoperationsina“do”loop.Becarefulifyouincludea/CLEARcommandwithinado-loop.The/CLEARcommanddoesnotclearthedo-loopstack,butitdoesclearallparametersincludingtheloopparameterinthe*DOstatementitself.YoucanavoidtheproblemofhavinganundefinedloopingvaluebyissuingaPARSAVcommandbeforethe/CLEARcommand,andthenfollowingthe/CLEARcommandwithaPARREScommand.*ENDDOEndsadoloopandstartstheloopingaction.Youmustuseone*ENDDOcommandforeachnesteddoloop.The*ENDDOand*DOcommandsforaloopmustbeonthesamefile.*CYCLEWhenexecutingadoloop,ANSYSbypassesallcommandsbetweentheYoucanusethecycleoptionconditionally(viathe*IFcommand).The*CYCLEcommandmust*CYCLEand*ENDDOcommands,then(ifapplicable)initiatesthenextloop.appearonthesamefileasthe*DOcommandandmustappearbeforethe*ENDDOcommand.*EXITExitsfromadoloop.Thecommandfollowingthe*ENDDOcommandexecutesnext.The*EXITand*DOcommandsforaloopmustbeonthesamefile.Youcanusetheexitoptionconditionally(viathe*IFcommand).*IFCausescommandstobereadconditionally.Youcanhaveupto10nestedlevelsof*IFblocks.Youcannotjumpinto,outof,orwithinadolooporanif-then-elseconstructtoa:labelline,andjumpingtoa:labellineisnotallowedwithkeyboardentry.Youcanissuea/CLEARcommandwithinanif-then-elseconstruct.The/CLEARcommanddoesnotclearthe*IFstackandthenumberof*IFlevelsisretained.An*ENDIFisnecessarytocloseanybranchinglogic.The/CLEARcommanddeletesallparameters,includinganythatareusedinyourbranchingcommands.YoucanavoidanyproblemsthatmightarisefromthedeletionofparametersbyissuingaPARSAVcommandbeforethe/CLEARcommand,andthenfollowingthe/CLEARcommandwithaPARREScommand.*ENDIFTerminatesanif-then-elseconstruct.(Seethe*IFdiscussionfordetails.)The*IFand*ENDIFcommandsmustappearinthesamefile.*ELSECreatesafinal,optionalblockseparatorwithinanif-then-elseconstruct.(Seethe*IFdiscussionfordetails.)The*ELSEand*IFcommandsmustappearinthesamefile.*ELSEIFCreatesanoptional,intermediateblockseparatorwithinanif-then-elseconstruct.IfOper=EQorNE,VAL1andVAL2canalsobecharacterstrings(enclosedinquotes)orparameters.The*IFand*ELSEIFcommandsmustbeonthesamefile.3.ANSYS中有关单元和节点的相关函数*get或者*vget,vget命令。或参考:ANSYSHELP中APDL部分的AppendixB.GETFunctionSummary。