From 4475c6a05f78622615d3d87f556f1f11f0513f89 Mon Sep 17 00:00:00 2001 From: German Date: Mon, 3 Jan 2022 13:14:34 +0100 Subject: [PATCH 01/29] Adding inq functions commands. --- ansys/mapdl/core/_commands/inq_func.py | 881 +++++++++++++++++++++++++ ansys/mapdl/core/commands.py | 6 + 2 files changed, 887 insertions(+) create mode 100644 ansys/mapdl/core/_commands/inq_func.py diff --git a/ansys/mapdl/core/_commands/inq_func.py b/ansys/mapdl/core/_commands/inq_func.py new file mode 100644 index 0000000000..f445ae2193 --- /dev/null +++ b/ansys/mapdl/core/_commands/inq_func.py @@ -0,0 +1,881 @@ +"""Inquire undocumented functions""" + +class inq_function: + + def ndinqr(node, key): + """Get information about a node. + + *secondary functions:* set current node pointer to this node. + + Parameters + ---------- + node (int,sc,in) - node number + Should be 0 for key=11, DB_NUMDEFINED, + DB_NUMSELECTED, DB_MAXDEFINED, and + DB_MAXRECLENG + key (int,sc,in) - key as to information needed about + the node. + = DB_SELECTED - return select status: + ndinqr = 0 - node is undefined. + = -1 - node is unselected. + = 1 - node is selected. + = DB_NUMDEFINED - return number of defined nodes + = DB_NUMSELECTED - return number of selected nodes + = DB_MAXDEFINED - return highest node number defined + = DB_MAXRECLENG - return maximum record length (dp words) + = 2, return length (dp words) + = 3, + = 4, pointer to first data word + = 11, return void percent (integer) + = 17, pointer to start of index + = 117, return the maximum number of DP contact data stored for any node + = -1, + = -2, superelement flag + = -3, master dof bit pattern + = -4, active dof bit pattern + = -5, solid model attachment + = -6, pack nodal line parametric value + = -7, constraint bit pattern + = -8, force bit pattern + = -9, body force bit pattern + = -10, internal node flag + = -11, orientation node flag =1 is =0 isnot + = -11, contact node flag <0 + = -12, constraint bit pattern (for DSYM) + = -13, if dof constraint written to file.k (for LSDYNA only) + = -14, nodal coordinate system number (set by NROTATE) + =-101, pointer to node data record + =-102, pointer to angle record + =-103, + =-104, pointer to attached couplings + =-105, pointer to attacted constraint equations + =-106, pointer to nodal stresses + =-107, pointer to specified disp'S + =-108, pointer to specified forces + =-109, pointer to x/y/z record + =-110, + =-111, + =-112, pointer to nodal temperatures + =-113, pointer to nodal heat generations + =-114, + =-115, pointer to calculated displacements + =-116, + + Returns + ------- + ndinqr (int,func,out) - the returned value of ndinqr is based on + setting of key. + """ + pass + + def elmiqr(ielem, key): + """Get information about an element. + + *secondary functions:* set current element pointer to this element. + + Parameters + ---------- + ielem (int,sc,in) - element number + should be zero for key=11, DB_NUMDEFINED, + DB_NUMSELECTED, DB_MAXDEFINED, DB_MAXRECLENG, + or 199 + key (int,sc,in) - information flag. + = DB_SELECTED - return select status: (1) + elmiqr = 0 - element is undefined. + =-1 - element is unselected. + = 1 - element is selected. + = DB_NUMDEFINED - return number of defined elements (12) + = DB_NUMSELECTED - return number of selected elements (13) + = DB_MAXDEFINED - return maximum element number used (14) + = DB_MAXRECLENG - return maximum record length (15) + (int words) + = 2 - return length (int words) + = 3 - return layer number + (for cross reference files return number of entities) + = 4 - return address of first data word + = 5 - return length (in record type units) + = 6 - return compressed record number. + = 11 - return void percent (integer) + = 16 - return location of next record + (this increments the next record count) + = 17 - pointer to start of index + = 18 - return type of file. + elmiqr = 0 - integer + = 1 - double precision + = 2 - real + = 3 - complex + = 4 - character*8 + = 7 - index + = 19 - return virtual type of file. + elmiqr = 0 - fixed length (4.4 form) + = 1 - indexed variable length (layer data) + = 2 - xref data tables + = 3 - bitmap data (for 32 data item packed records) + = 4 - data tables (three dimensional arrays) + = 111 - return the maximum number of nodes stored for any element + = 123 - return the maximum number of DP contact data stored for any element + = -1 - material number ( = -EL_MAT) + -2 - element type ( = -EL_TYPE) + -3 - real constant number ( = -EL_REAL) + -4 - element section ID number ( = -EL_SECT) + -5 - coordinate system number ( = -EL_CSYS) + (see elmcmx for rest) + =-101 - pointer to element integers etc. + (see elmcmx with elmilg and 1 instead of -101) + + + Returns + ------- + elmiqr (int,sc,out) - the returned value of elmiqr is based on + setting of key. + """ + pass + + def kpinqr(knmi, key): + """Get information about a keypoints. + + *secondary functions:* set current keypoints pointer to this + keypoints. + + Parameters + ---------- + knmi (int,sc,in) - keypoints for inquire. may be 0 for + key=11 thru 15. + key (int,sc,in) - information flag. + = 1 - return select + = -1 - unselected + = 0 - undefined + = 1 - selected + = 2 - return length (data units) + = 3 - return layer number + (for cross reference files return + number of entities) + = 4 - return address of first data word + = 5 - return length (in record type units) + = 6 - return compressed record number. + = 11 - return void percent (integer) + = 12 - return number of defined + = 13 - return number of selected + = 14 - return highest number defined + = 15 - return maximum record length + (data units) + = 16 - return location of next record + (this increments the next + record count) + + = 18 - return type of file. + = 0 - integer + = 1 - double precision + = 2 - real + = 3 - complex + = 4 - character*8 + = 7 - index + = 19 - return virtual type of file. + = 0 - fixed length (4.4 form) + = 1 - indexed variable length + (layer data) + = 2 - xref data tables + = 3 - bitmap data (for 32 data + item packed records) + = 4 - data tables (three + dimensional arrays) + + = -1, material number + = -2, type + = -3, real number + = -4, node number, if meshed + = -5, pointer to attached point + = -6, esys number + = -7, element number, if meshed + = -8, Hardpoint stuff + = -9, area number associated with hardpoint + = -10, line number associated with hardpoint + = -11, Orientation kp flag + = -12, local integer workspace + = -101, pointer to keypoint data + = -102, pointer to keypoint + fluences + = -103, pointer to keypoint + moisture content + = -104, pointer to keypoint + voltage + = -105, pointer to keypoint + current density + = -106, pointer to keypoint + heat generations + = -107, pointer to keypoint + virtual displacements + = -108, pointer to parameter + data + = -109, pointer to keypoint + temperatures + = -110, pointer to keypoint + displacements + = -111, pointer to keypoint forces + = -112, pointer to line list + + Returns + ------- + kpinqr (int,sc,out) - for key=1 0=knmi is undefined. + -1=knmi is unselected. + 1=knmi is selected. + for key ne 1 returned data is based + on setting of key. + """ + pass + + def lsinqr(line, key): + """ + *primary function:* get information about a line segment. + + Parameters + ---------- + lnmi (int,sc,in) - line segment for inquire. may be 0 for + key=11 thru 15. + key (dp,sc,in) - key as to information needed about + the lnmi. + key= 1, return select + key= 2, return length (data units) + key= 3, + key= 11, return void percent (integer) + key= 12 return number of defined + key= 13, return number of selected + key= 14, return highest number defined + key= 15, return maximum record length + (data units) + key= 16, return location of next record + (this increments the next + record count) + key= 17, return next record from offset + key= -1, material number + key= -2, type + key= -3, real number + key= -4, number of nodes + key= -5, esys number + key= -6, number of elements + key= -7, pointer to line in foreign db + key= -8, # of elem divs in existing mesh + key= -9, keypoint 1 + key= -10, keypoint 2 + key= -11, color,translucency packed + key= -12, local integer workspace + (used in delete with sweeps) + key= -13, orientation kpa + key= -14, orientation kpb + key= -15, section id + key= -16, # of elem divs for next mesh + key= -17, 0=hard / 1=soft NDIV + key= -18, 0=hard / 1=soft SPACE + key=-101, pointer to line segment data + key=-102, + key=-103, + key=-104, + key=-105, pointer to node list + key=-106, + key=-107, pointer to element list + key=-108, pointer to parameter data + key=-109, + key=-110, pointer to line convections + key=-111, pointer to line constraints + key=-112, + key=-113, + key=-114, pointer to area list + key=-115, pointer to sub-line list + key=-116, pointer to line pressures + + Returns + ------- + lsinqr (int,sc,out) - for key=1 0=lnmi is undefined. + -1=lnmi is unselected. + 1=lnmi is selected. + for key ne 1 returned data is based + on setting of key. + + """ + pass + + def arinqr(anmi, key): + """Get information about a area. + + *secondary functions:* set current area pointer to this + area. + + Parameters + ---------- + anmi (int,sc,in) - area for inquire. may be 0 for + key=11 thru 15. + key (dp,sc,in) - key as to information needed about + the anmi. + key= 1, return select + key= 2, return length (data units) + key= 3, + key= 11, return void percent (integer) + key= 12 return number of defined + key= 13, return number of selected + key= 14, return highest number defined + key= 15, return maximum record length + (data units) + key= 16, return next record + (this increments the next + record count) + key= -1, material + key= -2, type. + key= -3, real. + key= -4, number of nodes. + key= -5, + key= -6, number of elements. + key= -7, pointer to area in foreign db + key= -8, element shape. + key= -9, mid-node element key. + key= -10, element coordinate system. + key= -11, area constraint information. + = 0 - no constraint on this area. + = 1 - symmetry constraint. + = 2 - anti-symmetry + = 3 - both symmetry and anti-symmetry + key= -12, local integer workspace + key= -13, + key= -14, + key= -15, section + key= -16, color and translucency packed. + key= -101, pointer to area data + key= -102, + key= -103, + key= -104, + key= -105, pointer to node list. + key= -106, pointer to parameter data + key= -107, pointer to element list. + key= -108, + key= -109, + key= -110, + key= -111, + key= -112, pointer to line loop list + key= -113, pointer to volume xref + key= -114, pointer to sub-area list + key= -115, pointer to area presaraes + key= -116, pointer to area convections + + Returns + ------- + arinqr (int,sc,out) - for key=1 0=anmi is undefined. + -1=anmi is unselected. + 1=anmi is selected. + for key ne 1 returned data is based + on setting of key. + """ + pass + + def vlinqr(vnmi, key): + """Get information about a volume. + + *secondary functions:* set current volume pointer to this + volume. + + Parameters + ---------- + vnmi (int,sc,in) - volume for inquire. may be 0 for + key=11 thru 15. + key (dp,sc,in) - key as to information needed about + the vnmi. + key= 1, return select + key= 2, return length (data units) + key= 3, + key= 11, return void percent (integer) + key= 12 return number of defined + key= 13, return number of selected + key= 14, return highest number defined + key= 15, return maximum record length + (data units) + key= 16, return next record + key= -1, material + key= -2, type. + key= -3, real. + key= -4, number of nodes. + key= -5, KZ1 - 1st kpt for elem Z + key= -6, number of elements. + key= -7, pointer to volume in foreign db + key= -8, element shape. + + key= -9, (section id)*10 + 2 + *** fsk qt-58121 5/2007 Rev11 SP1 *** + + key= -10, element coordinate system. + key= -11, KZ2 - 2nd kpt for elem Z + key= -12, color and translucancy packed + key= -101, pointer volume data file. + key= -102, + key= -103, + key= -104, + key= -105, pointer to node list. + key= -106, pointer to volume pvolmeter dat + key= -107, pointer to element list. + key= -108, + key= -109, + key= -110, pointer to sub-volume list + key= -111, + key= -112, pointer to area shell list + + Returns + ------- + vlinqr (int,sc,out) - for key=1 0=vnmi is undefined. + -1=vnmi is unselected. + 1=vnmi is selected. + for key ne 1 returned data is based + on setting of key. + """ + pass + + def rlinqr(nreal, key): + """Get information about a real constant set + + typ=int,dp,log,chr,dcp siz=sc,ar(n),fun intent=in,out,inout + + Parameters + ---------- + variable (typ,siz,intent) description + nreal (int,sc,in) - real constant table number + should be 0 for key=11, DB_NUMDEFINED, + DB_NUMSELECTED, DB_MAXDEFINED, and + DB_MAXRECLENG + key (int,sc,in) - information flag. + = 5 - return number of values stored for nreal. + return the REAL set width (number of fields) + = DB_SELECTED - return select status + rlinqr = 0 - real constant table is undefined. + =-1 - real constant table is unselected. + = 1 - real constant table is selected + = DB_NUMDEFINED - return number of defined real constant tables + = DB_NUMSELECTED - return number of selected real constant tables + = DB_MAXDEFINED - return highest real constant table defined + = DB_MAXRECLENG - return maximum record length (dp words) + + Returns + ------- + rlinqr (int,func,out) - the returned value of rlinqr is based on + setting of key. + mpg magnetic interface usage + + """ + pass + + def gapiqr(ngap, key): + """Get information about a dynamic gap set. + + Parameters + ---------- + ngap (int,sc,in) - gap number for inquire. + (must be zero for now) + key (int,sc,in) - key as to the information needed + key= 1, return select + key= 2, return length (data units) + key= 3, + key= 11, return void percent (integer) + key= 12 return number of defined + key= 13, return number of selected + key= 14, return highest number defined + key= 15, return maximum record length + (data units) + + Returns + ------- + gapiqr (int,sc,out) - returned data is based + on setting of key. + """ + pass + + def masiqr(node, key): + """Get information about masters. + + Parameters + ---------- + variable (typ,siz,intent) description + node (int,sc,in) - node number for inquire. + (must be zero for now) + key (int,sc,in) - key as to the information needed + key= 1, return select + key= 2, return length (data units) + key= 3, + key= 11, return void percent (integer) + key= 12 return number of defined + key= 13, return number of selected + key= 14, return highest number defined + key= 15, return maximum record length + (data units) + + Returns + ------- + variable (typ,siz,intent) description + masiqr (int,sc,out) - returned data is based + on setting of key. + """ + pass + + def ceinqr(nce, key): + """Get information about a constraint equation set + + Parameters + ---------- + nce (int,sc,in) - constraint equation number + key (int,sc,in) - inquiry key: + should be zero for key=11, DB_NUMDEFINED, + DB_NUMSELECTED, DB_MAXDEFINED, and + DB_MAXRECLENG + = DB_SELECTED - return select status + ceinqr = 1 - equation is selected + = 0 - equation is undefined + =-1 - equation is unselected + = DB_NUMDEFINED - return number of defined contraint equations + = DB_NUMSELECTED - return number of selected contraint equations + = DB_MAXDEFINED - return number of highest numbered constraint + equation defined + = DB_MAXRECLENG - return length of longest contraint equation set + (max record length) + = 2 - return length (data units) + = 3 - return layer number + = 4 - address of first data word + = 5 - return number of values stored for nce + = 11 - return void percent (integer) + = 16 - return location of next record + = CE_NONLINEAR - return 1 if CE is nonlinear + = CE_ELEMNUMBER - return associated element number + + Returns + ------- + ceinqr (int,func,out) - the returned value of ceinqr is based on + setting of key + """ + pass + + def cpinqr(ncp, key): + """Get information about a coupled set + + typ=int,dp,log,chr,dcp siz=sc,ar(n),fun intent=in,out,inout + + Parameters + ---------- + variable (typ,siz,intent) description + ncp (int,sc,in) - coupled set number + key (int,sc,in) - inquiry key: + should be zero for key=11, DB_NUMDEFINED, + DB_NUMSELECTED, DB_MAXDEFINED, and + DB_MAXRECLENG + = DB_SELECTED - return select status + cpinqr = 1 - coupled set is selected + = 0 - coupled set in undefined + =-1 - coupled set in unselected + = DB_NUMDEFINED - return number of defined coupled sets + = DB_NUMSELECTED - return number of selected coupled sets + = DB_MAXDEFINED - return the number of the highest numbered + coupled set + = DB_MAXRECLENG - return length of largest coupled set record + (max record length) + = 2 - return length (data units) + = 3 - return layer number + = 4 - return address of first data word + = 5 - return number of values stored for ncp + = 11 - return void percent (integer) + = 16 - return location of next record + = -1 - return master node for this eqn (this is + currently only used by solution DB object) + + Returns + ------- + cpinqr (int,func,out) - the returned value of cpinqr is based on + setting of key + + """ + pass + + def csyiqr(ncsy, key): + """Get information about a coordinate system + + Parameters + ---------- + ncsy (int,sc,in) - coordinate system reference number + should be zero for key= DB_NUMDEFINED + or DB_MAXDEFINED + key (int,sc,in) - information flag. + = DB_SELECTED - return status: + csyiqr = 0 - coordinate system is not defined + -1 - coordinate system is not selected + 1 - coordinate system is selected + = DB_NUMDEFINED - number of defined coordinate systems + = DB_MAXDEFINED - maximum coordinate system reference + number used. + + Returns + ------- + csyiqr (int,func,out) - the returned value of csyiqr is based on + setting of key. + """ + pass + + def etyiqr(itype, key): + """Get information about an element type. + + Parameters + ---------- + itype (int,sc,in) - element type number + Should be 0 for key=11, DB_NUMDEFINED, + DB_NUMSELECTED, DB_MAXDEFINED, and + DB_MAXRECLENG + key (int,sc,in) - information flag. + = DB_SELECTED - return select status: + etyiqr = 0 - element type is undefined. + =-1 - element type is unselected. + = 1 - element type is selected. + = DB_NUMDEFINED - return number of defined element types + = DB_NUMSELECTED - return number of selected element types + = DB_MAXDEFINED - return highest element type number defined + = DB_MAXRECLENG - return maximum record length (int words) + = -n, return element characteristic n from etycom for element + type itype. + n is correlated to the parameter names in echprm. + see elccmt for definitions of element characteristics. + note- this will not overwrite the current setting of + etycom. + + Returns + ------- + etyiqr (int,func,out) - the returned value of etyiqr is based on + setting of key. + """ + pass + + def foriqr(node, key): + """Get information about nodal loads. + + Parameters + ---------- + node (int,sc,in) - number of node being inquired about. + should be 0 for key=DB_MAXDEFINED or + DB_NUMDEFINED + key (dp,sc,in) - key as to information needed + = 1 - return force mask for node + = DB_MAXDEFINED, + DB_NUMDEFINED - return number of nodal loadings + in model + NOTE: both DB_MAXDEFINED and DB_NUMDEFINED + produce the same functionality + + Returns + ------- + foriqr (int,func,out) - the returned value of foriqr is based on + setting of key. + """ + pass + + def sectinqr(nsect, key): + """ + nsect - section id table number, should be 0 for key = 12, 13, 14 + key - information flag + = 1, select status + = 12, return number of defined section id tables + = 13, return number of selected section id tables + = 14, return highest section id table defined + Returns + ------- + for key = 1 + = 0, section id table is undefined. + = -1, section id table is unselected. + = 1, section id table is selected + """ + pass + + def mpinqr(mat, iprop, key): + """Get information about a material property. + + Parameters + ---------- + mat (int,sc,in) - material number + should be 0 for key=11, + DB_NUMDEFINED(12), + DB_MAXDEFINED(14), and + DB_MAXRECLENG(15) + + iprop (int,sc,in) - property reference number: + if iprop = 0, test for existence of any material property with this + material number (with key = DB_SELECTED(1)) + + ---- MP command labels -------- + EX = 1, EY = 2, EZ = 3, NUXY= 4, NUYZ= 5, NUXZ= 6, GXY = 7, GYZ = 8 + GXZ = 9, ALPX=10, ALPY=11, ALPZ=12, DENS=13, MU =14, DAMP=15, KXX =16 + KYY =17, KZZ =18, RSVX=19, RSVY=20, RSVZ=21, =22, HF =23, VISC=24 + EMIS=25, ENTH=26, LSST=27, PRXY=28, PRYZ=29, PRXZ=30, MURX=31, MURY=32 + MURZ=33, PERX=34, PERY=35, PERZ=36, MGXX=37, MGYY=38, MGZZ=39, EGXX=40 + EGYY=41, EGZZ=42, SBKX=43, SBKY=44, SBKZ=45, SONC=46, DMPS=47, ELIM=48 + USR1=49, USR2=50, USR3=51, USR4=51, FLUI=53, ORTH=54, CABL=55, RIGI=56 + HGLS=57, BVIS=58, QRAT=59, REFT=60, CTEX=61, CTEY=62, CTEZ=63, THSX=64, + THSY=65, THSZ=66, DMPR=67, LSSM=68, BETD=69, ALPD=70, RH =71, DXX =72, + DYY =73, DZZ =74, BETX=75, BETY=76, BETZ=77, CSAT=78, CREF=79, CVH =80, + UMID=81, UVID=82 + + (see mpinit for uncommented code and for TB command information) + + key (int,sc,in) - key as to the information needed + about material property. + = DB_SELECTED(1)- return select status: + mpinqr = 0 - material prop is undefined. + = 1 - material prop is selected. + = DB_NUMDEFINED(12) - number of defined material properties + = DB_MAXDEFINED(14) - highest material property number defined + = DB_MAXRECLENG(15) - maximum record length (dp words) + = 2 - return length (dp words) + = 3 - return number of temp. values + = 11 - return void percent (integer) + + Returns + ------- + mpinqr (int,func,out) - returned value of mpinqr is based on + setting of key. + + """ + pass + + def dget(node, idf, kcmplx): + """Get a constraint from the data bsae + + Parameters + ---------- + node (int,sc,in) - node number + idf (int,sc,in) - pointer to the dof (1-32) + (see dofcom) + 1 =ux, 2 =uy, 3 =uz + 4 =rotx, 5 =roty, 6 =rotz + 7 =ax, 8 =ay, 9 =az + 10=vx, 11=vy, 12=vz + 13-18=spares + 19=pres, 20=temp, 21=volt + 22=mag, 23=enke, 24=ends, + 25=emf, 26=curr, 27-32 SP01-SP06 + kcmplx (int,sc,in) - 0,real 1,imaginary 2,3- old values + + Returns + ------- + dget (dp,sc,out) - constraint value + (- HUGE if undefined) + """ + pass + + def fget(node, idf, kcmplx): + """Get a force from the data bsae + + Parameters + ---------- + node (int,sc,in) - node number + idf (int,sc,in) - pointer to the dof (1-32) + (see dofcom) + 1 =ux, 2 =uy, 3 =uz + 4 =rotx, 5 =roty, 6 =rotz + 7 =ax, 8 =ay, 9 =az + 10=vx, 11=vy, 12=vz + 13-18=spares + 19=pres, 20=temp, 21=volt + 22=mag, 23=enke, 24=ends, + 25=emf, 26=curr 27-32 spares + kcmplx (int,sc,in) - 0,real 1,imaginary 2,3- old values + + Returns + ------- + fget (dp,sc,out) - force value + (- HUGE if undefined) + """ + pass + + def erinqr(key): + """Obtain information from errors common + + Parameters + ---------- + key (int,sc,in) - item to be returned + 1=keyerr, 2=errfil, 3=numnot, 4=numwrn, + 5=numerr, 6=numfat, 7=maxmsg, 8=lvlerr, + 9=mxpcmd, 10=nercmd, 11=nertim,12=nomore, + 13=eropen,14=ikserr, 15=kystat,16=mxr4r5, + 17=mshkey, 19=opterr,20=flowrn, + 22=noreport,23=pdserr,24=mxpcmdw + 25=kystop,26=icloads, 27=ifkey, + 28=intrupt + + ---- below definitions copied from errcom 7/92 for user information + + *** key number= .......................... + (see ansysdef for parameter definitions) | + \/ + + keyerr - master error flag (ER_ERRORFLAG) + errfil - errors file unit number (ER_ERRORFILE) + numnot - total number of notes displayed (ER_NUMNOTE) + numwrn - total number of warnings displayed (ER_NUMWARNING) + numerr - total number of errors displayed (ER_NUMERROR) + numfat - total number of fatals displayed (ER_NUMFATAL) + maxmsg - max allowed number of displayed messages before abort(ER_MAXMESSAGE) + lvlerr - used basicly in solution (from cnvr command.) (ER_ERRORLEVEL) + -1=do not set keyerr for notes/errors/warnings. + -2=same as -1 but do not display message either. + mxpcmd - maximum number of messages allowed per command (ER_MAXCOMMAND) + nercmd - number of messages displayed for any one command (ER_NUMCOMMAND) + nertim - key as to how message cleared from u/i pop-up (ER_UICLEAR) + (as per rsg/pft 5/1/92 - only for "info" calls + -1=message is timed before removal + 0=message needs pick or keyboard before removal + 1=message stays up untill replaced by another message + nomore display any more messages (ER_NOMOREMSG) + 0=display messages + 1=display discontinue message and stop displaying + eropen - 0=errors file is closed (ER_FILEOPEN) + 1=errors file is opened + ikserr - 0=if interactive do not set keyerr (ER_INTERERROR) + - 1=if interactive set keyerr (used by mesher and tessalation) + kystat - flag to bypass keyopt tests in the elcxx routines (ER_KEYOPTTEST) + associated with status/panel info inquiries. + 0=do not bypass keyopt tests + 1=perform all keyopt tests + also flag to bypass setting of _STATUS upon resume + mxr4r5 - mixed rev4-rev5 input logic (*do,*if,*go,*if-go) (ER_MIXEDREV) + (used in chkmix called from rdmac) + 1=rev5 found (*do,*fi-then-*endif) + 2=rev4 found (*go,:xxx,*if,....,:xxx) + 3=warning printed. do not issue any more. + mshkey - cpu intensive meshing etc. this will cause (ER_MESHING) + "nertim (11)" to be set to -1 for "notes", 1 for "warnings", + and 0 for "errors". checking of this key is done in "anserr". + 0=not meshing or cpu intensive + 1=yes, meshing or cpu intensive + syerro - systop error code. read by anserr if set. (18) + opterr - 0=no error in main ansys during opt looping (ER_OPTLOOPING) + 1=an error has happened in main ansys during opt looping + flowrn - flag used by "floqa" as to list floqa.ans (20) + 0=list "floqa.ans" + 1="floqa.ans" has been listed. do not list again. + noreport- used in GUI for turning off errors due to strsub calls (22) + 0=process errors as usual + 1=do NOT report errors + pdserr - 0=no error in main ansys during pds looping (ER_PDSLOOPING) + 1=an error has happened in main ansys during pds looping + mxpcmdw- number of messages written to file.err for any one (24) + command + 0=write all errors to file.err + 1=only write displayed errors to file.err + icloads - key to forbid the iclist command from listing solution (26) + data instead of the input data. + 0=iclist is OK + 1=do not permit iclist + ifkey - key on whether or not to abort during /input on error (27) + 0=do not abort + 1=abort + intrupt - interrupt button, so executable returns no error (ER_INTERRUPT) + + espare - spare integer variables + + --- end of information from errcom + + Returns + ------- + erinqr (int,sc,out) - value corresponding to key + + mpg erinqr < el117,el115,el126,el109,el53,el96,el97,edg?: get error stat + + """ + pass + diff --git a/ansys/mapdl/core/commands.py b/ansys/mapdl/core/commands.py index caeea38176..be4814a522 100644 --- a/ansys/mapdl/core/commands.py +++ b/ansys/mapdl/core/commands.py @@ -17,6 +17,7 @@ display_, conn, misc, + inq_func ) @@ -187,6 +188,10 @@ class SolutionCommands( ): pass +class InqFunctions( + inq_func.inq_function +): + pass class Commands( APDLCommands, @@ -207,6 +212,7 @@ class Commands( conn.Conn, hidden._Hidden, map_cmd.MapCommand, + InqFunctions ): """Wrapped MAPDL commands""" From 142bb88429db027735dfc1993fe9141e65e80c82 Mon Sep 17 00:00:00 2001 From: German Date: Mon, 3 Jan 2022 17:26:59 +0100 Subject: [PATCH 02/29] Added MAPDL inquire functions --- ansys/mapdl/core/_commands/inq_func.py | 1732 ++++++++++++++---------- 1 file changed, 1024 insertions(+), 708 deletions(-) diff --git a/ansys/mapdl/core/_commands/inq_func.py b/ansys/mapdl/core/_commands/inq_func.py index f445ae2193..dd90be8989 100644 --- a/ansys/mapdl/core/_commands/inq_func.py +++ b/ansys/mapdl/core/_commands/inq_func.py @@ -2,880 +2,1196 @@ class inq_function: - def ndinqr(node, key): + def ndinqr(self, node, key, **kwargs): """Get information about a node. - *secondary functions:* set current node pointer to this node. + **Secondary Functions:** + Set current node pointer to this node. + + .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encoraged. + + **Please use it with caution.** Parameters ---------- - node (int,sc,in) - node number - Should be 0 for key=11, DB_NUMDEFINED, - DB_NUMSELECTED, DB_MAXDEFINED, and - DB_MAXRECLENG - key (int,sc,in) - key as to information needed about - the node. - = DB_SELECTED - return select status: - ndinqr = 0 - node is undefined. - = -1 - node is unselected. - = 1 - node is selected. - = DB_NUMDEFINED - return number of defined nodes - = DB_NUMSELECTED - return number of selected nodes - = DB_MAXDEFINED - return highest node number defined - = DB_MAXRECLENG - return maximum record length (dp words) - = 2, return length (dp words) - = 3, - = 4, pointer to first data word - = 11, return void percent (integer) - = 17, pointer to start of index - = 117, return the maximum number of DP contact data stored for any node - = -1, - = -2, superelement flag - = -3, master dof bit pattern - = -4, active dof bit pattern - = -5, solid model attachment - = -6, pack nodal line parametric value - = -7, constraint bit pattern - = -8, force bit pattern - = -9, body force bit pattern - = -10, internal node flag - = -11, orientation node flag =1 is =0 isnot - = -11, contact node flag <0 - = -12, constraint bit pattern (for DSYM) - = -13, if dof constraint written to file.k (for LSDYNA only) - = -14, nodal coordinate system number (set by NROTATE) - =-101, pointer to node data record - =-102, pointer to angle record - =-103, - =-104, pointer to attached couplings - =-105, pointer to attacted constraint equations - =-106, pointer to nodal stresses - =-107, pointer to specified disp'S - =-108, pointer to specified forces - =-109, pointer to x/y/z record - =-110, - =-111, - =-112, pointer to nodal temperatures - =-113, pointer to nodal heat generations - =-114, - =-115, pointer to calculated displacements - =-116, + node (int, sc, in) + node number. + It should be 0 for key=11, ``DB_NUMDEFINED``, + ``DB_NUMSELECTED``, ``DB_MAXDEFINED``, and + ``DB_MAXRECLENG``. + + key (int, sc, in) + key as to information needed about the node. + + * = DB_SELECTED - return select status: + + * = 0 - node is undefined. + * = -1 - node is unselected. + * = 1 - node is selected. + + * = ``DB_NUMDEFINED`` - return number of defined nodes + * = ``DB_NUMSELECTED`` - return number of selected nodes + * = ``DB_MAXDEFINED`` - return highest node number defined + * = ``DB_MAXRECLENG`` - return maximum record length (dp words) + * = 2, return length (dp words) + * = 3, + * = 4, pointer to first data word + * = 11, return void percent (integer) + * = 17, pointer to start of index + * = 117, return the maximum number of DP contact data stored for any node + * = -1, + * = -2, superelement flag + * = -3, master dof bit pattern + * = -4, active dof bit pattern + * = -5, solid model attachment + * = -6, pack nodal line parametric value + * = -7, constraint bit pattern + * = -8, force bit pattern + * = -9, body force bit pattern + * = -10, internal node flag + * = -11, orientation node flag =1 is =0 is not + * = -11, contact node flag <0 + * = -12, constraint bit pattern (for DSYM) + * = -13, if dof constraint written to file.k (for LSDYNA only) + * = -14, nodal coordinate system number (set by ``NROTATE``) + * =-101, pointer to node data record + * =-102, pointer to angle record + * =-103, + * =-104, pointer to attached couplings + * =-105, pointer to attacted constraint equations + * =-106, pointer to nodal stresses + * =-107, pointer to specified disp'S + * =-108, pointer to specified forces + * =-109, pointer to x/y/z record + * =-110, + * =-111, + * =-112, pointer to nodal temperatures + * =-113, pointer to nodal heat generations + * =-114, + * =-115, pointer to calculated displacements + * =-116 + + **kwargs + Extra arguments to be passed to ``Mapdl.run``. Returns ------- - ndinqr (int,func,out) - the returned value of ndinqr is based on - setting of key. + ndinqr (int, func, out) + The returned value of ``ndinqr`` is based on setting of key. """ - pass + return self.run(f"__temp__ = ndinqr({node}, {key})", **kwargs) - def elmiqr(ielem, key): + def elmiqr(self, ielem, key, **kwargs): """Get information about an element. - *secondary functions:* set current element pointer to this element. - + **Secondary Functions:** + Set current element pointer to this element. + + .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encoraged. + + **Please use it with caution.** + Parameters ---------- - ielem (int,sc,in) - element number - should be zero for key=11, DB_NUMDEFINED, - DB_NUMSELECTED, DB_MAXDEFINED, DB_MAXRECLENG, - or 199 - key (int,sc,in) - information flag. - = DB_SELECTED - return select status: (1) - elmiqr = 0 - element is undefined. - =-1 - element is unselected. - = 1 - element is selected. - = DB_NUMDEFINED - return number of defined elements (12) - = DB_NUMSELECTED - return number of selected elements (13) - = DB_MAXDEFINED - return maximum element number used (14) - = DB_MAXRECLENG - return maximum record length (15) - (int words) - = 2 - return length (int words) - = 3 - return layer number - (for cross reference files return number of entities) - = 4 - return address of first data word - = 5 - return length (in record type units) - = 6 - return compressed record number. - = 11 - return void percent (integer) - = 16 - return location of next record - (this increments the next record count) - = 17 - pointer to start of index - = 18 - return type of file. - elmiqr = 0 - integer - = 1 - double precision - = 2 - real - = 3 - complex - = 4 - character*8 - = 7 - index - = 19 - return virtual type of file. - elmiqr = 0 - fixed length (4.4 form) - = 1 - indexed variable length (layer data) - = 2 - xref data tables - = 3 - bitmap data (for 32 data item packed records) - = 4 - data tables (three dimensional arrays) - = 111 - return the maximum number of nodes stored for any element - = 123 - return the maximum number of DP contact data stored for any element - = -1 - material number ( = -EL_MAT) - -2 - element type ( = -EL_TYPE) - -3 - real constant number ( = -EL_REAL) - -4 - element section ID number ( = -EL_SECT) - -5 - coordinate system number ( = -EL_CSYS) - (see elmcmx for rest) - =-101 - pointer to element integers etc. - (see elmcmx with elmilg and 1 instead of -101) - + ielem (int, sc, in) + Element number. + It should be zero for key=11, ``DB_NUMDEFINED``, + ``DB_NUMSELECTED``, ``DB_MAXDEFINED``, ``DB_MAXRECLENG``, + or 199 + + key (int, sc, in) + information flag. + + * = DB_SELECTED - return select status: (1) + + * = 0 - element is undefined. + * =-1 - element is unselected. + * = 1 - element is selected. + + * = ``DB_NUMDEFINED`` - return number of defined elements (12) + * = ``DB_NUMSELECTED`` - return number of selected elements (13) + * = ``DB_MAXDEFINED`` - return maximum element number used (14) + * = ``DB_MAXRECLENG`` - return maximum record length (15) + * = 2 - return length (int words) + * = 3 - return layer number (for cross reference files return number of entities) + * = 4 - return address of first data word + * = 5 - return length (in record type units) + * = 6 - return compressed record number. + * = 11 - return void percent (integer) + * = 16 - return location of next record (this increments the next record count) + * = 17 - pointer to start of index + * = 18 - return type of file. + + * = 0 - integer + * = 1 - double precision + * = 2 - real + * = 3 - complex + * = 4 - character*8 + * = 7 - index + + * = 19 - return virtual type of file. + + * = 0 - fixed length (4.4 form) + * = 1 - indexed variable length (layer data) + * = 2 - xref data tables + * = 3 - bitmap data (for 32 data item packed records) + * = 4 - data tables (three dimensional arrays) + + * = 111 - return the maximum number of nodes stored for any element + * = 123 - return the maximum number of DP contact data stored for any element + * = -1 - material number ( = -EL_MAT) + * = -2 - element type ( = -EL_TYPE) + * = -3 - real constant number ( = -EL_REAL) + * = -4 - element section ID number ( = -EL_SECT) + * = -5 - coordinate system number ( = -EL_CSYS) + * =-101 - pointer to element integers etc. + + **kwargs + Extra arguments to be passed to ``Mapdl.run``. Returns ------- - elmiqr (int,sc,out) - the returned value of elmiqr is based on - setting of key. + elmiqr (int, sc, out) + The returned value of ``elmiqr`` is based on setting of key. """ - pass + return self.run(f"__temp__ = elmiqr({ielem}, {key})", **kwargs) - def kpinqr(knmi, key): + def kpinqr(self, knmi, key, **kwargs): """Get information about a keypoints. - *secondary functions:* set current keypoints pointer to this - keypoints. - + **Secondary Functions:** + Set current keypoints pointer to this + keypoints. + + .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encoraged. + + **Please use it with caution.** + Parameters ---------- - knmi (int,sc,in) - keypoints for inquire. may be 0 for - key=11 thru 15. - key (int,sc,in) - information flag. - = 1 - return select - = -1 - unselected - = 0 - undefined - = 1 - selected - = 2 - return length (data units) - = 3 - return layer number - (for cross reference files return - number of entities) - = 4 - return address of first data word - = 5 - return length (in record type units) - = 6 - return compressed record number. - = 11 - return void percent (integer) - = 12 - return number of defined - = 13 - return number of selected - = 14 - return highest number defined - = 15 - return maximum record length - (data units) - = 16 - return location of next record - (this increments the next - record count) - - = 18 - return type of file. - = 0 - integer - = 1 - double precision - = 2 - real - = 3 - complex - = 4 - character*8 - = 7 - index - = 19 - return virtual type of file. - = 0 - fixed length (4.4 form) - = 1 - indexed variable length - (layer data) - = 2 - xref data tables - = 3 - bitmap data (for 32 data - item packed records) - = 4 - data tables (three - dimensional arrays) - - = -1, material number - = -2, type - = -3, real number - = -4, node number, if meshed - = -5, pointer to attached point - = -6, esys number - = -7, element number, if meshed - = -8, Hardpoint stuff - = -9, area number associated with hardpoint - = -10, line number associated with hardpoint - = -11, Orientation kp flag - = -12, local integer workspace - = -101, pointer to keypoint data - = -102, pointer to keypoint - fluences - = -103, pointer to keypoint - moisture content - = -104, pointer to keypoint - voltage - = -105, pointer to keypoint - current density - = -106, pointer to keypoint - heat generations - = -107, pointer to keypoint - virtual displacements - = -108, pointer to parameter - data - = -109, pointer to keypoint - temperatures - = -110, pointer to keypoint - displacements - = -111, pointer to keypoint forces - = -112, pointer to line list + knmi (int, sc, in) + Keypoints for inquire. may be 0 for key=11 thru 15. + + key (int, sc, in) + Information flag. + + * = 1 - return select + + * = -1 - unselected + * = 0 - undefined + * = 1 - selected + + * = 2 - return length (data units) + * = 3 - return layer number + (for cross reference files return + number of entities) + * = 4 - return address of first data word + * = 5 - return length (in record type units) + * = 6 - return compressed record number. + * = 11 - return void percent (integer) + * = 12 - return number of defined + * = 13 - return number of selected + * = 14 - return highest number defined + * = 15 - return maximum record length + (data units) + * = 16 - return location of next record + (this increments the next + record count) + * = 18 - return type of file. + + * = 0 - integer + * = 1 - double precision + * = 2 - real + * = 3 - complex + * = 4 - character*8 + * = 7 - index + + * = 19 - return virtual type of file. + + * = 0 - fixed length (4.4 form) + * = 1 - indexed variable length + (layer data) + * = 2 - xref data tables + * = 3 - bitmap data (for 32 data + item packed records) + * = 4 - data tables (three + dimensional arrays) + + * = -1, material number + * = -2, type + * = -3, real number + * = -4, node number, if meshed + * = -5, pointer to attached point + * = -6, esys number + * = -7, element number, if meshed + * = -8, Hardpoint stuff + * = -9, area number associated with hardpoint + * = -10, line number associated with hardpoint + * = -11, Orientation kp flag + * = -12, local integer workspace + * = -101, pointer to keypoint data + * = -102, pointer to keypoint fluences + * = -103, pointer to keypoint moisture content + * = -104, pointer to keypoint voltage + * = -105, pointer to keypoint current density + * = -106, pointer to keypoint heat generations + * = -107, pointer to keypoint virtual displacements + * = -108, pointer to parameter data + * = -109, pointer to keypoint temperatures + * = -110, pointer to keypoint displacements + * = -111, pointer to keypoint forces + * = -112, pointer to line list + + **kwargs + Extra arguments to be passed to ``Mapdl.run``. Returns ------- - kpinqr (int,sc,out) - for key=1 0=knmi is undefined. - -1=knmi is unselected. - 1=knmi is selected. - for key ne 1 returned data is based - on setting of key. - """ - pass + kpinqr (int, sc, out) + For key=1 + + * 0 = ``knmi`` is undefined. + * -1 = ``knmi`` is unselected. + * 1 = ``knmi`` is selected. - def lsinqr(line, key): + For key not equal to 1 returned data is based + on setting of key. """ - *primary function:* get information about a line segment. - + return self.run(f"__temp__ = kpinqr({knmi}, {key})", **kwargs) + + def lsinqr(self, line, key, **kwargs): + """Get information about a line segment. + + .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encoraged. + + **Please use it with caution.** + Parameters ---------- - lnmi (int,sc,in) - line segment for inquire. may be 0 for - key=11 thru 15. - key (dp,sc,in) - key as to information needed about - the lnmi. - key= 1, return select - key= 2, return length (data units) - key= 3, - key= 11, return void percent (integer) - key= 12 return number of defined - key= 13, return number of selected - key= 14, return highest number defined - key= 15, return maximum record length - (data units) - key= 16, return location of next record - (this increments the next - record count) - key= 17, return next record from offset - key= -1, material number - key= -2, type - key= -3, real number - key= -4, number of nodes - key= -5, esys number - key= -6, number of elements - key= -7, pointer to line in foreign db - key= -8, # of elem divs in existing mesh - key= -9, keypoint 1 - key= -10, keypoint 2 - key= -11, color,translucency packed - key= -12, local integer workspace - (used in delete with sweeps) - key= -13, orientation kpa - key= -14, orientation kpb - key= -15, section id - key= -16, # of elem divs for next mesh - key= -17, 0=hard / 1=soft NDIV - key= -18, 0=hard / 1=soft SPACE - key=-101, pointer to line segment data - key=-102, - key=-103, - key=-104, - key=-105, pointer to node list - key=-106, - key=-107, pointer to element list - key=-108, pointer to parameter data - key=-109, - key=-110, pointer to line convections - key=-111, pointer to line constraints - key=-112, - key=-113, - key=-114, pointer to area list - key=-115, pointer to sub-line list - key=-116, pointer to line pressures + lnmi (int, sc, in) + Line segment for inquire. It should be 0 for key=11 thru 15. + + key (dp, sc, in) + key as to information needed about the ``lnmi``. + + * = 1, return select + * = 2, return length (data units) + * = 3, + * = 11, return void percent (integer) + * = 12 return number of defined + * = 13, return number of selected + * = 14, return highest number defined + * = 15, return maximum record length + (data units) + * = 16, return location of next record + (this increments the next + record count) + * = 17, return next record from offset + * = -1, material number + * = -2, type + * = -3, real number + * = -4, number of nodes + * = -5, esys number + * = -6, number of elements + * = -7, pointer to line in foreign db + * = -8, # of elem divs in existing mesh + * = -9, keypoint 1 + * = -10, keypoint 2 + * = -11, color,translucency packed + * = -12, local integer workspace + (used in delete with sweeps) + * = -13, orientation kpa + * = -14, orientation kpb + * = -15, section id + * = -16, # of elem divs for next mesh + * = -17, 0=hard / 1=soft NDIV + * = -18, 0=hard / 1=soft SPACE + * =-101, pointer to line segment data + * =-102, + * =-103, + * =-104, + * =-105, pointer to node list + * =-106, + * =-107, pointer to element list + * =-108, pointer to parameter data + * =-109, + * =-110, pointer to line convections + * =-111, pointer to line constraints + * =-112, + * =-113, + * =-114, pointer to area list + * =-115, pointer to sub-line list + * =-116, pointer to line pressures + + **kwargs + Extra arguments to be passed to ``Mapdl.run``. Returns ------- - lsinqr (int,sc,out) - for key=1 0=lnmi is undefined. - -1=lnmi is unselected. - 1=lnmi is selected. - for key ne 1 returned data is based - on setting of key. + lsinqr (int, sc, out) + For key=1 + + * 0 = ``lnmi`` is undefined. + * -1 = ``lnmi`` is unselected. + * 1 = ``lnmi`` is selected. + + For key not equal to 1 returned data is based + on setting of key. """ - pass + return self.run(f"__temp__ = lsinqr({line}, {key})", **kwargs) - def arinqr(anmi, key): + def arinqr(self, anmi, key, **kwargs): """Get information about a area. - *secondary functions:* set current area pointer to this - area. - + **Secondary Functions:** + Set current area pointer to this area. + + .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encoraged. + + **Please use it with caution.** + Parameters ---------- - anmi (int,sc,in) - area for inquire. may be 0 for - key=11 thru 15. - key (dp,sc,in) - key as to information needed about - the anmi. - key= 1, return select - key= 2, return length (data units) - key= 3, - key= 11, return void percent (integer) - key= 12 return number of defined - key= 13, return number of selected - key= 14, return highest number defined - key= 15, return maximum record length - (data units) - key= 16, return next record - (this increments the next - record count) - key= -1, material - key= -2, type. - key= -3, real. - key= -4, number of nodes. - key= -5, - key= -6, number of elements. - key= -7, pointer to area in foreign db - key= -8, element shape. - key= -9, mid-node element key. - key= -10, element coordinate system. - key= -11, area constraint information. - = 0 - no constraint on this area. - = 1 - symmetry constraint. - = 2 - anti-symmetry - = 3 - both symmetry and anti-symmetry - key= -12, local integer workspace - key= -13, - key= -14, - key= -15, section - key= -16, color and translucency packed. - key= -101, pointer to area data - key= -102, - key= -103, - key= -104, - key= -105, pointer to node list. - key= -106, pointer to parameter data - key= -107, pointer to element list. - key= -108, - key= -109, - key= -110, - key= -111, - key= -112, pointer to line loop list - key= -113, pointer to volume xref - key= -114, pointer to sub-area list - key= -115, pointer to area presaraes - key= -116, pointer to area convections + anmi (int, sc, in) + Area for inquire. may be 0 for key=11 thru 15. + + key (dp, sc, in) + Key as to information needed about the ``anmi``. + + * = 1, return select + * = 2, return length (data units) + * = 3, + * = 11, return void percent (integer) + * = 12 return number of defined + * = 13, return number of selected + * = 14, return highest number defined + * = 15, return maximum record length + (data units) + * = 16, return next record + (this increments the next record count) + * = -1, material + * = -2, type. + * = -3, real. + * = -4, number of nodes. + * = -5, + * = -6, number of elements. + * = -7, pointer to area in foreign db + * = -8, element shape. + * = -9, mid-node element key. + * = -10, element coordinate system. + * = -11, area constraint information. + * = 0 - no constraint on this area. + * = 1 - symmetry constraint. + * = 2 - anti-symmetry + * = 3 - both symmetry and anti-symmetry + * = -12, local integer workspace + * = -13, + * = -14, + * = -15, section + * = -16, color and translucency packed. + * = -101, pointer to area data + * = -102, + * = -103, + * = -104, + * = -105, pointer to node list. + * = -106, pointer to parameter data + * = -107, pointer to element list. + * = -108, + * = -109, + * = -110, + * = -111, + * = -112, pointer to line loop list + * = -113, pointer to volume xref + * = -114, pointer to sub-area list + * = -115, pointer to area presaraes + * = -116, pointer to area convections + + **kwargs + Extra arguments to be passed to ``Mapdl.run``. Returns ------- - arinqr (int,sc,out) - for key=1 0=anmi is undefined. - -1=anmi is unselected. - 1=anmi is selected. - for key ne 1 returned data is based - on setting of key. + arinqr (int, sc, out) + For key=1 + + * 0 = ``anmi`` is undefined. + * -1 = ``anmi`` is unselected. + * 1 = ``anmi`` is selected. + + For key ne 1 returned data is based + on setting of key. """ - pass + return self.run(f"__temp__ = arinqr({anmi}, {key})", **kwargs) - def vlinqr(vnmi, key): + def vlinqr(self, vnmi, key, **kwargs): """Get information about a volume. - *secondary functions:* set current volume pointer to this - volume. - + **Secondary Functions:** + Set current volume pointer to this volume. + + .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encoraged. + + **Please use it with caution.** + Parameters ---------- - vnmi (int,sc,in) - volume for inquire. may be 0 for - key=11 thru 15. - key (dp,sc,in) - key as to information needed about - the vnmi. - key= 1, return select - key= 2, return length (data units) - key= 3, - key= 11, return void percent (integer) - key= 12 return number of defined - key= 13, return number of selected - key= 14, return highest number defined - key= 15, return maximum record length - (data units) - key= 16, return next record - key= -1, material - key= -2, type. - key= -3, real. - key= -4, number of nodes. - key= -5, KZ1 - 1st kpt for elem Z - key= -6, number of elements. - key= -7, pointer to volume in foreign db - key= -8, element shape. - - key= -9, (section id)*10 + 2 - *** fsk qt-58121 5/2007 Rev11 SP1 *** - - key= -10, element coordinate system. - key= -11, KZ2 - 2nd kpt for elem Z - key= -12, color and translucancy packed - key= -101, pointer volume data file. - key= -102, - key= -103, - key= -104, - key= -105, pointer to node list. - key= -106, pointer to volume pvolmeter dat - key= -107, pointer to element list. - key= -108, - key= -109, - key= -110, pointer to sub-volume list - key= -111, - key= -112, pointer to area shell list + vnmi (int, sc, in) + Volume for inquire. may be 0 for key=11 thru 15. + + key (dp, sc, in) + Key as to information needed about the ``vnmi``. + + * = 1, return select + * = 2, return length (data units) + * = 3, + * = 11, return void percent (integer) + * = 12 return number of defined + * = 13, return number of selected + * = 14, return highest number defined + * = 15, return maximum record length (data units) + * = 16, return next record + * = -1, material + * = -2, type. + * = -3, real. + * = -4, number of nodes. + * = -5, KZ1 - 1st kpt for elem Z + * = -6, number of elements. + * = -7, pointer to volume in foreign db + * = -8, element shape. + * = -9, (section id)*10 + 2 + * = -10, element coordinate system. + * = -11, KZ2 - 2nd kpt for elem Z + * = -12, color and translucancy packed + * = -101, pointer volume data file. + * = -102, + * = -103, + * = -104, + * = -105, pointer to node list. + * = -106, pointer to volume pvolmeter dat + * = -107, pointer to element list. + * = -108, + * = -109, + * = -110, pointer to sub-volume list + * = -111, + * = -112, pointer to area shell list + + **kwargs + Extra arguments to be passed to ``Mapdl.run``. Returns ------- - vlinqr (int,sc,out) - for key=1 0=vnmi is undefined. - -1=vnmi is unselected. - 1=vnmi is selected. - for key ne 1 returned data is based - on setting of key. + vlinqr (int, sc, out) + For key=1 + + * 0 = ``vnmi`` is undefined. + * -1 = ``vnmi`` is unselected. + * 1 = ``vnmi`` is selected. + + For key ne 1 returned data is based + on setting of key. """ - pass + return self.run(f"__temp__ = vlinqr({vnmi}, {key})", **kwargs) - def rlinqr(nreal, key): - """Get information about a real constant set + def rlinqr(self, nreal, key, **kwargs): + """Get information about a real constant set. - typ=int,dp,log,chr,dcp siz=sc,ar(n),fun intent=in,out,inout + .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encoraged. + + **Please use it with caution.** Parameters ---------- - variable (typ,siz,intent) description - nreal (int,sc,in) - real constant table number - should be 0 for key=11, DB_NUMDEFINED, - DB_NUMSELECTED, DB_MAXDEFINED, and - DB_MAXRECLENG - key (int,sc,in) - information flag. - = 5 - return number of values stored for nreal. - return the REAL set width (number of fields) - = DB_SELECTED - return select status - rlinqr = 0 - real constant table is undefined. - =-1 - real constant table is unselected. - = 1 - real constant table is selected - = DB_NUMDEFINED - return number of defined real constant tables - = DB_NUMSELECTED - return number of selected real constant tables - = DB_MAXDEFINED - return highest real constant table defined - = DB_MAXRECLENG - return maximum record length (dp words) + variable (typ, siz, intent) + description + + nreal (int, sc, in) + Real constant table number + should be 0 for key=11, ``DB_NUMDEFINED``, + ``DB_NUMSELECTED``, ``DB_MAXDEFINED``, and + ``DB_MAXRECLENG``. + + key (int, sc, in) + Information flag. + + * = 5 - return number of values stored for nreal. + Return the REAL set width (number of fields) + * = ``DB_SELECTED`` - return select status + + * = 0 - real constant table is undefined. + * =-1 - real constant table is unselected. + * = 1 - real constant table is selected + + * = ``DB_NUMDEFINED`` - return number of defined real constant tables + * = ``DB_NUMSELECTED`` - return number of selected real constant tables + * = ``DB_MAXDEFINED`` - return highest real constant table defined + * = ``DB_MAXRECLENG`` - return maximum record length (dp words) + + **kwargs + Extra arguments to be passed to ``Mapdl.run``. Returns ------- - rlinqr (int,func,out) - the returned value of rlinqr is based on - setting of key. - mpg magnetic interface usage + rlinqr (int, func, out) + The returned value of ``rlinqr`` is based on setting of key. """ - pass + return self.run(f"__temp__ = rlinqr({nreal}, {key})", **kwargs) - def gapiqr(ngap, key): + def gapiqr(self, ngap, key, **kwargs): """Get information about a dynamic gap set. + .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encoraged. + + **Please use it with caution.** + Parameters ---------- - ngap (int,sc,in) - gap number for inquire. - (must be zero for now) - key (int,sc,in) - key as to the information needed - key= 1, return select - key= 2, return length (data units) - key= 3, - key= 11, return void percent (integer) - key= 12 return number of defined - key= 13, return number of selected - key= 14, return highest number defined - key= 15, return maximum record length - (data units) + ngap (int, sc, in) + gap number for inquire (must be zero for now). + + key (int, sc, in) + key as to the information needed + + * = 1, return select + * = 2, return length (data units) + * = 3, + * = 11, return void percent (integer) + * = 12 return number of defined + * = 13, return number of selected + * = 14, return highest number defined + * = 15, return maximum record length (data units) + + **kwargs + Extra arguments to be passed to ``Mapdl.run``. Returns ------- - gapiqr (int,sc,out) - returned data is based - on setting of key. + gapiqr (int, sc, out) + Returned data is based on setting of key. """ - pass + return self.run(f"__temp__ = gapiqr({ngap}, {key})", **kwargs) - def masiqr(node, key): + def masiqr(self, node, key, **kwargs): """Get information about masters. - + + .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encoraged. + + **Please use it with caution.** + Parameters ---------- - variable (typ,siz,intent) description - node (int,sc,in) - node number for inquire. - (must be zero for now) - key (int,sc,in) - key as to the information needed - key= 1, return select - key= 2, return length (data units) - key= 3, - key= 11, return void percent (integer) - key= 12 return number of defined - key= 13, return number of selected - key= 14, return highest number defined - key= 15, return maximum record length - (data units) + variable (typ, siz, intent) + Description + + node (int, sc, in) + Node number for inquire (must be zero for now). + + key (int, sc, in) + Key as to the information needed + + * = 1, return select + * = 2, return length (data units) + * = 3, + * = 11, return void percent (integer) + * = 12 return number of defined + * = 13, return number of selected + * = 14, return highest number defined + * = 15, return maximum record length (data units) + + **kwargs + Extra arguments to be passed to ``Mapdl.run``. Returns ------- - variable (typ,siz,intent) description - masiqr (int,sc,out) - returned data is based - on setting of key. + variable (typ, siz, intent) + Description + + masiqr (int, sc, out) + Returned data is based on setting of key. """ - pass + return self.run(f"__temp__ = masiqr({node}, {key})", **kwargs) - def ceinqr(nce, key): + def ceinqr(self, nce, key, **kwargs): """Get information about a constraint equation set + .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encoraged. + + **Please use it with caution.** + Parameters ---------- - nce (int,sc,in) - constraint equation number - key (int,sc,in) - inquiry key: - should be zero for key=11, DB_NUMDEFINED, - DB_NUMSELECTED, DB_MAXDEFINED, and - DB_MAXRECLENG - = DB_SELECTED - return select status - ceinqr = 1 - equation is selected - = 0 - equation is undefined - =-1 - equation is unselected - = DB_NUMDEFINED - return number of defined contraint equations - = DB_NUMSELECTED - return number of selected contraint equations - = DB_MAXDEFINED - return number of highest numbered constraint - equation defined - = DB_MAXRECLENG - return length of longest contraint equation set - (max record length) - = 2 - return length (data units) - = 3 - return layer number - = 4 - address of first data word - = 5 - return number of values stored for nce - = 11 - return void percent (integer) - = 16 - return location of next record - = CE_NONLINEAR - return 1 if CE is nonlinear - = CE_ELEMNUMBER - return associated element number + nce (int, sc, in) + Constraint equation number + key (int, sc, in) + Inquiry key. + It should be zero for key=11, ``DB_NUMDEFINED``, + ``DB_NUMSELECTED``, ``DB_MAXDEFINED``, and + ``DB_MAXRECLENG`` + + * = DB_SELECTED - return select status + + * = 1 - equation is selected + * = 0 - equation is undefined + * =-1 - equation is unselected + + * = ``DB_NUMDEFINED`` - return number of defined contraint equations + * = ``DB_NUMSELECTED`` - return number of selected contraint equations + * = ``DB_MAXDEFINED`` - return number of highest numbered constraint + equation defined + * = ``DB_MAXRECLENG`` - return length of longest contraint equation set + (max record length) + * = 2 - return length (data units) + * = 3 - return layer number + * = 4 - address of first data word + * = 5 - return number of values stored for nce + * = 11 - return void percent (integer) + * = 16 - return location of next record + * = ``CE_NONLINEAR`` - return 1 if CE is nonlinear + * = ``CE_ELEMNUMBER`` - return associated element number + + **kwargs + Extra arguments to be passed to ``Mapdl.run``. Returns ------- - ceinqr (int,func,out) - the returned value of ceinqr is based on - setting of key + ceinqr (int, func, out) + The returned value of ``ceinqr`` is based on setting of key """ - pass + return self.run(f"__temp__ = ceinqr({nce}, {key})", **kwargs) - def cpinqr(ncp, key): - """Get information about a coupled set + def cpinqr(self, ncp, key, **kwargs): + """Get information about a coupled set. - typ=int,dp,log,chr,dcp siz=sc,ar(n),fun intent=in,out,inout + .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encoraged. + + **Please use it with caution.** Parameters ---------- - variable (typ,siz,intent) description - ncp (int,sc,in) - coupled set number - key (int,sc,in) - inquiry key: - should be zero for key=11, DB_NUMDEFINED, - DB_NUMSELECTED, DB_MAXDEFINED, and - DB_MAXRECLENG - = DB_SELECTED - return select status - cpinqr = 1 - coupled set is selected - = 0 - coupled set in undefined - =-1 - coupled set in unselected - = DB_NUMDEFINED - return number of defined coupled sets - = DB_NUMSELECTED - return number of selected coupled sets - = DB_MAXDEFINED - return the number of the highest numbered - coupled set - = DB_MAXRECLENG - return length of largest coupled set record - (max record length) - = 2 - return length (data units) - = 3 - return layer number - = 4 - return address of first data word - = 5 - return number of values stored for ncp - = 11 - return void percent (integer) - = 16 - return location of next record - = -1 - return master node for this eqn (this is - currently only used by solution DB object) + variable (typ, siz, intent) + Description + + ncp (int, sc, in) + Coupled set number + + key (int, sc, in) + Inquiry key. It should be zero for key=11, ``DB_NUMDEFINED``, + ``DB_NUMSELECTED``, ``DB_MAXDEFINED``, and ``DB_MAXRECLENG`` + + * = DB_SELECTED - return select status + + * = 1 - coupled set is selected + * = 0 - coupled set in undefined + * =-1 - coupled set in unselected + + * = ``DB_NUMDEFINED`` - return number of defined coupled sets + * = ``DB_NUMSELECTED`` - return number of selected coupled sets + * = ``DB_MAXDEFINED`` - return the number of the highest numbered + coupled set + * = ``DB_MAXRECLENG`` - return length of largest coupled set record + (max record length) + * = 2 - return length (data units) + * = 3 - return layer number + * = 4 - return address of first data word + * = 5 - return number of values stored for ncp + * = 11 - return void percent (integer) + * = 16 - return location of next record + * = -1 - return master node for this eqn (this is + currently only used by solution DB object) + + **kwargs + Extra arguments to be passed to ``Mapdl.run``. Returns ------- - cpinqr (int,func,out) - the returned value of cpinqr is based on - setting of key + cpinqr (int, func, out) + The returned value of ``cpinqr`` is based on setting of key. """ - pass + return self.run(f"__temp__ = cpinqr({ncp}, {key})", **kwargs) - def csyiqr(ncsy, key): + def csyiqr(self, ncsy, key, **kwargs): """Get information about a coordinate system + .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encoraged. + + **Please use it with caution.** + Parameters ---------- - ncsy (int,sc,in) - coordinate system reference number - should be zero for key= DB_NUMDEFINED - or DB_MAXDEFINED - key (int,sc,in) - information flag. - = DB_SELECTED - return status: - csyiqr = 0 - coordinate system is not defined - -1 - coordinate system is not selected - 1 - coordinate system is selected - = DB_NUMDEFINED - number of defined coordinate systems - = DB_MAXDEFINED - maximum coordinate system reference - number used. + ncsy (int, sc, in) + Coordinate system reference number + should be zero for key= ``DB_NUMDEFINED`` + or ``DB_MAXDEFINED`` + + key (int, sc, in) + Information flag. + + * = ``DB_SELECTED`` - return status: + + * = 0 - coordinate system is not defined + * -1 - coordinate system is not selected + * 1 - coordinate system is selected + + * = ``DB_NUMDEFINED`` - number of defined coordinate systems + * = ``DB_MAXDEFINED`` - maximum coordinate system reference + number used. + + **kwargs + Extra arguments to be passed to ``Mapdl.run``. Returns ------- - csyiqr (int,func,out) - the returned value of csyiqr is based on - setting of key. + csyiqr (int, func, out) + The returned value of ``csyiqr`` is based on setting of key. """ - pass + return self.run(f"__temp__ = csyiqr({ncsy}, {key})", **kwargs) - def etyiqr(itype, key): + def etyiqr(self, itype, key, **kwargs): """Get information about an element type. + .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encoraged. + + **Please use it with caution.** + Parameters ---------- - itype (int,sc,in) - element type number - Should be 0 for key=11, DB_NUMDEFINED, - DB_NUMSELECTED, DB_MAXDEFINED, and - DB_MAXRECLENG - key (int,sc,in) - information flag. - = DB_SELECTED - return select status: - etyiqr = 0 - element type is undefined. - =-1 - element type is unselected. - = 1 - element type is selected. - = DB_NUMDEFINED - return number of defined element types - = DB_NUMSELECTED - return number of selected element types - = DB_MAXDEFINED - return highest element type number defined - = DB_MAXRECLENG - return maximum record length (int words) - = -n, return element characteristic n from etycom for element - type itype. - n is correlated to the parameter names in echprm. - see elccmt for definitions of element characteristics. - note- this will not overwrite the current setting of - etycom. + itype (int, sc, in) + Element type number. + It should be 0 for key=11, ``DB_NUMDEFINED``, + ``DB_NUMSELECTED``, ``DB_MAXDEFINED``, and + ``DB_MAXRECLENG`` + + key (int, sc, in) + Information flag. + + * = DB_SELECTED - return select status: + + * = 0 - element type is undefined. + * =-1 - element type is unselected. + * = 1 - element type is selected. + + * = ``DB_NUMDEFINED`` - return number of defined element types + * = ``DB_NUMSELECTED`` - return number of selected element types + * = ``DB_MAXDEFINED`` - return highest element type number defined + * = ``DB_MAXRECLENG`` - return maximum record length (int words) + * = -n, return element characteristic n from ``etycom`` for element + type itype. + ``n`` is correlated to the parameter names in ``echprm``. + see ``elccmt`` for definitions of element characteristics. + note- this will not overwrite the current setting of + ``etycom``. + + **kwargs + Extra arguments to be passed to ``Mapdl.run``. Returns ------- - etyiqr (int,func,out) - the returned value of etyiqr is based on - setting of key. + etyiqr (int, func, out) + The returned value of ``etyiqr`` is based on setting of key. """ - pass + return self.run(f"__temp__ = etyiqr({itype}, {key})", **kwargs) - def foriqr(node, key): + def foriqr(self, node, key, **kwargs): """Get information about nodal loads. - + + .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encoraged. + + **Please use it with caution.** + Parameters ---------- - node (int,sc,in) - number of node being inquired about. - should be 0 for key=DB_MAXDEFINED or - DB_NUMDEFINED - key (dp,sc,in) - key as to information needed - = 1 - return force mask for node - = DB_MAXDEFINED, - DB_NUMDEFINED - return number of nodal loadings - in model - NOTE: both DB_MAXDEFINED and DB_NUMDEFINED - produce the same functionality + node (int, sc, in) + Number of node being inquired about. + should be 0 for key=``DB_MAXDEFINED`` or + ``DB_NUMDEFINED``. + + key (dp, sc, in) + Key as to information needed + + * = 1 - return force mask for node + * = ``DB_MAXDEFINED``, - return number of nodal loadings in model. + * = ``DB_NUMDEFINED``. - return number of nodal loadings in model. + + .. note:: Both ``DB_MAXDEFINED`` and ``DB_NUMDEFINED``, produce the same functionality. + + **kwargs + Extra arguments to be passed to ``Mapdl.run``. Returns ------- - foriqr (int,func,out) - the returned value of foriqr is based on - setting of key. + foriqr (int, func, out) + The returned value of ``foriqr`` is based on setting of key. """ - pass + return self.run(f"__temp__ = foriqr({node}, {key})", **kwargs) + + def sectinqr(self, nsect, key, **kwargs): + """Get information about a section property. + + .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encoraged. + + **Please use it with caution.** + + Parameters + ---------- + nsect + Section id table number, it should be 0 for key = 12, 13, 14. - def sectinqr(nsect, key): - """ - nsect - section id table number, should be 0 for key = 12, 13, 14 key - information flag - = 1, select status - = 12, return number of defined section id tables - = 13, return number of selected section id tables - = 14, return highest section id table defined + * = 1, select status + * = 12, return number of defined section id tables + * = 13, return number of selected section id tables + * = 14, return highest section id table defined + + **kwargs + Extra arguments to be passed to ``Mapdl.run``. + Returns ------- for key = 1 - = 0, section id table is undefined. - = -1, section id table is unselected. - = 1, section id table is selected + * = 0, section id table is undefined. + * = -1, section id table is unselected. + * = 1, section id table is selected """ - pass + return self.run(f"__temp__ = sectinqr({nsect}, {key})", **kwargs) - def mpinqr(mat, iprop, key): + def mpinqr(self, mat, iprop, key, **kwargs): """Get information about a material property. + .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encoraged. + + **Please use it with caution.** + Parameters ---------- - mat (int,sc,in) - material number - should be 0 for key=11, - DB_NUMDEFINED(12), - DB_MAXDEFINED(14), and - DB_MAXRECLENG(15) - - iprop (int,sc,in) - property reference number: - if iprop = 0, test for existence of any material property with this - material number (with key = DB_SELECTED(1)) - - ---- MP command labels -------- - EX = 1, EY = 2, EZ = 3, NUXY= 4, NUYZ= 5, NUXZ= 6, GXY = 7, GYZ = 8 - GXZ = 9, ALPX=10, ALPY=11, ALPZ=12, DENS=13, MU =14, DAMP=15, KXX =16 - KYY =17, KZZ =18, RSVX=19, RSVY=20, RSVZ=21, =22, HF =23, VISC=24 - EMIS=25, ENTH=26, LSST=27, PRXY=28, PRYZ=29, PRXZ=30, MURX=31, MURY=32 - MURZ=33, PERX=34, PERY=35, PERZ=36, MGXX=37, MGYY=38, MGZZ=39, EGXX=40 - EGYY=41, EGZZ=42, SBKX=43, SBKY=44, SBKZ=45, SONC=46, DMPS=47, ELIM=48 - USR1=49, USR2=50, USR3=51, USR4=51, FLUI=53, ORTH=54, CABL=55, RIGI=56 - HGLS=57, BVIS=58, QRAT=59, REFT=60, CTEX=61, CTEY=62, CTEZ=63, THSX=64, - THSY=65, THSZ=66, DMPR=67, LSSM=68, BETD=69, ALPD=70, RH =71, DXX =72, - DYY =73, DZZ =74, BETX=75, BETY=76, BETZ=77, CSAT=78, CREF=79, CVH =80, - UMID=81, UVID=82 - - (see mpinit for uncommented code and for TB command information) - - key (int,sc,in) - key as to the information needed - about material property. - = DB_SELECTED(1)- return select status: - mpinqr = 0 - material prop is undefined. - = 1 - material prop is selected. - = DB_NUMDEFINED(12) - number of defined material properties - = DB_MAXDEFINED(14) - highest material property number defined - = DB_MAXRECLENG(15) - maximum record length (dp words) - = 2 - return length (dp words) - = 3 - return number of temp. values - = 11 - return void percent (integer) + mat (int, sc, in) + Material number + should be 0 for key=11, ``DB_NUMDEFINED(12)``, + ``DB_MAXDEFINED(14)``, and ``DB_MAXRECLENG(15)``. + + iprop (int, sc, in) + Property reference number (See notes). + + If iprop = 0, test for existence of any material property with this + material number (with key = DB_SELECTED(1)). + + .. seealso:: **MP command labels** + + EX = 1, EY = 2, EZ = 3, NUXY= 4, NUYZ= 5, NUXZ= 6, GXY = 7, GYZ = 8 + + GXZ = 9, ALPX=10, ALPY=11, ALPZ=12, DENS=13, MU =14, DAMP=15, KXX =16 + + KYY =17, KZZ =18, RSVX=19, RSVY=20, RSVZ=21, =22, HF =23, VISC=24 + + EMIS=25, ENTH=26, LSST=27, PRXY=28, PRYZ=29, PRXZ=30, MURX=31, MURY=32 + + MURZ=33, PERX=34, PERY=35, PERZ=36, MGXX=37, MGYY=38, MGZZ=39, EGXX=40 + + EGYY=41, EGZZ=42, SBKX=43, SBKY=44, SBKZ=45, SONC=46, DMPS=47, ELIM=48 + + USR1=49, USR2=50, USR3=51, USR4=51, FLUI=53, ORTH=54, CABL=55, RIGI=56 + + HGLS=57, BVIS=58, QRAT=59, REFT=60, CTEX=61, CTEY=62, CTEZ=63, THSX=64, + + THSY=65, THSZ=66, DMPR=67, LSSM=68, BETD=69, ALPD=70, RH =71, DXX =72, + + DYY =73, DZZ =74, BETX=75, BETY=76, BETZ=77, CSAT=78, CREF=79, CVH =80, + + UMID=81, UVID=82 + + + (see ``TB`` command for more information) + + + key (int, sc, in) + Key as to the information needed about material property. + + * = ``DB_SELECTED(1)``- return select status: + + * = 0 - material prop is undefined. + * = 1 - material prop is selected. + + * = ``DB_NUMDEFINED(12)`` - number of defined material properties + * = ``DB_MAXDEFINED(14)`` - highest material property number defined + * = ``DB_MAXRECLENG(15)`` - maximum record length (dp words) + * = 2 - return length (dp words) + * = 3 - return number of temp. values + * = 11 - return void percent (integer) + + **kwargs + Extra arguments to be passed to ``Mapdl.run``. Returns ------- - mpinqr (int,func,out) - returned value of mpinqr is based on - setting of key. + mpinqr (int, func, out) + Returned value of ``mpinqr`` is based on setting of key. """ - pass + return self.run(f"__temp__ = mpinqr({mat, iprop}, { key})", **kwargs) - def dget(node, idf, kcmplx): + def dget(self, node, idf, kcmplx, **kwargs): """Get a constraint from the data bsae + .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encoraged. + + **Please use it with caution.** + Parameters ---------- - node (int,sc,in) - node number - idf (int,sc,in) - pointer to the dof (1-32) - (see dofcom) - 1 =ux, 2 =uy, 3 =uz - 4 =rotx, 5 =roty, 6 =rotz - 7 =ax, 8 =ay, 9 =az - 10=vx, 11=vy, 12=vz - 13-18=spares - 19=pres, 20=temp, 21=volt - 22=mag, 23=enke, 24=ends, - 25=emf, 26=curr, 27-32 SP01-SP06 - kcmplx (int,sc,in) - 0,real 1,imaginary 2,3- old values + node (int, sc, in) + Node number + + idf (int, sc, in) + Pointer to the dof (1-32) + + * 1 = ux, + * 2 = uy + * 3 = uz + * 4 = rotx + * 5 = roty + * 6 = rotz + * 7 = ax + * 8 = ay + * 9 = az + * 10 = vx + * 11 = vy + * 12 = vz + * 13-18 = spares + * 19 = pres + * 20 = temp + * 21 = volt + * 22 = mag + * 23 = enke + * 24 = ends + * 25 = emf + * 26 = curr + * 27-32 = SP01-SP06 + + kcmplx (int, sc, in) + + * 0 = real + * 1 = imaginary + + **kwargs + Extra arguments to be passed to ``Mapdl.run``. Returns ------- - dget (dp,sc,out) - constraint value - (- HUGE if undefined) + dget (dp, sc, out) + Constraint value (High number if undefined) """ - pass + return self.run(f"__temp__ = dget({node}, {idf}, { kcmplx})", **kwargs) - def fget(node, idf, kcmplx): + def fget(self, node, idf, kcmplx, **kwargs): """Get a force from the data bsae + .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encoraged. + + **Please use it with caution.** + Parameters ---------- - node (int,sc,in) - node number - idf (int,sc,in) - pointer to the dof (1-32) - (see dofcom) - 1 =ux, 2 =uy, 3 =uz - 4 =rotx, 5 =roty, 6 =rotz - 7 =ax, 8 =ay, 9 =az - 10=vx, 11=vy, 12=vz - 13-18=spares - 19=pres, 20=temp, 21=volt - 22=mag, 23=enke, 24=ends, - 25=emf, 26=curr 27-32 spares - kcmplx (int,sc,in) - 0,real 1,imaginary 2,3- old values + node (int, sc, in) + Node number + + idf (int, sc, in) + Pointer to the dof (1-32) + + * 1 = ux + * 2 = uy + * 3 = uz + * 4 = rotx + * 5 = roty + * 6 = rotz + * 7 = ax + * 8 = ay + * 9 = az + * 10 = vx + * 11 = vy + * 12 = vz + * 13-18 = spares + * 19 = pres + * 20 = temp + * 21 = volt + * 22 = mag + * 23 = enke + * 24 = ends + * 25 = emf + * 26 = curr + * 27-32 = spares + + kcmplx (int, sc, in) + + * 0 = real + * 1 = imaginary + + **kwargs + Extra arguments to be passed to ``Mapdl.run``. Returns ------- - fget (dp,sc,out) - force value - (- HUGE if undefined) + fget (dp, sc, out) + Force value (High number if undefined) """ - pass + return self.run(f"__temp__ = fget({node}, {idf}, {kcmplx})", **kwargs) - def erinqr(key): + def erinqr(self, key, **kwargs): """Obtain information from errors common + .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encoraged. + + **Please use it with caution.** + Parameters ---------- - key (int,sc,in) - item to be returned - 1=keyerr, 2=errfil, 3=numnot, 4=numwrn, - 5=numerr, 6=numfat, 7=maxmsg, 8=lvlerr, - 9=mxpcmd, 10=nercmd, 11=nertim,12=nomore, - 13=eropen,14=ikserr, 15=kystat,16=mxr4r5, - 17=mshkey, 19=opterr,20=flowrn, - 22=noreport,23=pdserr,24=mxpcmdw - 25=kystop,26=icloads, 27=ifkey, - 28=intrupt - - ---- below definitions copied from errcom 7/92 for user information - - *** key number= .......................... - (see ansysdef for parameter definitions) | - \/ - - keyerr - master error flag (ER_ERRORFLAG) - errfil - errors file unit number (ER_ERRORFILE) - numnot - total number of notes displayed (ER_NUMNOTE) - numwrn - total number of warnings displayed (ER_NUMWARNING) - numerr - total number of errors displayed (ER_NUMERROR) - numfat - total number of fatals displayed (ER_NUMFATAL) - maxmsg - max allowed number of displayed messages before abort(ER_MAXMESSAGE) - lvlerr - used basicly in solution (from cnvr command.) (ER_ERRORLEVEL) - -1=do not set keyerr for notes/errors/warnings. - -2=same as -1 but do not display message either. - mxpcmd - maximum number of messages allowed per command (ER_MAXCOMMAND) - nercmd - number of messages displayed for any one command (ER_NUMCOMMAND) - nertim - key as to how message cleared from u/i pop-up (ER_UICLEAR) - (as per rsg/pft 5/1/92 - only for "info" calls - -1=message is timed before removal - 0=message needs pick or keyboard before removal - 1=message stays up untill replaced by another message - nomore display any more messages (ER_NOMOREMSG) - 0=display messages - 1=display discontinue message and stop displaying - eropen - 0=errors file is closed (ER_FILEOPEN) - 1=errors file is opened - ikserr - 0=if interactive do not set keyerr (ER_INTERERROR) - - 1=if interactive set keyerr (used by mesher and tessalation) - kystat - flag to bypass keyopt tests in the elcxx routines (ER_KEYOPTTEST) - associated with status/panel info inquiries. - 0=do not bypass keyopt tests - 1=perform all keyopt tests - also flag to bypass setting of _STATUS upon resume - mxr4r5 - mixed rev4-rev5 input logic (*do,*if,*go,*if-go) (ER_MIXEDREV) - (used in chkmix called from rdmac) - 1=rev5 found (*do,*fi-then-*endif) - 2=rev4 found (*go,:xxx,*if,....,:xxx) - 3=warning printed. do not issue any more. - mshkey - cpu intensive meshing etc. this will cause (ER_MESHING) - "nertim (11)" to be set to -1 for "notes", 1 for "warnings", - and 0 for "errors". checking of this key is done in "anserr". - 0=not meshing or cpu intensive - 1=yes, meshing or cpu intensive - syerro - systop error code. read by anserr if set. (18) - opterr - 0=no error in main ansys during opt looping (ER_OPTLOOPING) - 1=an error has happened in main ansys during opt looping - flowrn - flag used by "floqa" as to list floqa.ans (20) - 0=list "floqa.ans" - 1="floqa.ans" has been listed. do not list again. - noreport- used in GUI for turning off errors due to strsub calls (22) - 0=process errors as usual - 1=do NOT report errors - pdserr - 0=no error in main ansys during pds looping (ER_PDSLOOPING) - 1=an error has happened in main ansys during pds looping - mxpcmdw- number of messages written to file.err for any one (24) - command - 0=write all errors to file.err - 1=only write displayed errors to file.err - icloads - key to forbid the iclist command from listing solution (26) - data instead of the input data. - 0=iclist is OK - 1=do not permit iclist - ifkey - key on whether or not to abort during /input on error (27) - 0=do not abort - 1=abort - intrupt - interrupt button, so executable returns no error (ER_INTERRUPT) - - espare - spare integer variables - - --- end of information from errcom + key (int, sc, in) + Item to be returned. + + * 1 = keyerr (ER_ERRORFLAG) + Master error flag. + * 2 = errfil (ER_ERRORFILE) + Errors file unit number. + * 3 = numnot (ER_NUMNOTE) + Total number of notes displayed. + * 4 = numwrn (ER_NUMWARNING) + Total number of warnings displayed. + * 5 = numerr (ER_NUMERROR) + Total number of errors displayed. + * 6 = numfat (ER_NUMFATAL) + Total number of fatals displayed. + * 7 = maxmsg (ER_MAXMESSAGE) + Max allowed number of displayed messages before abort. + * 8 = lvlerr (ER_ERRORLEVEL) + Used basicly in solution (from cnvr command.) + + * -1 = do not set keyerr for notes/errors/warnings. + * -2 = same as -1 but do not display message either. + + * 9 = mxpcmd (ER_MAXCOMMAND) + Maximum number of messages allowed per command. + * 10 = nercmd (ER_NUMCOMMAND) + Number of messages displayed for any one command. + * 11 = nertim (ER_UICLEAR) + Key as to how message cleared from u/i pop-up (only for "info" calls) + + * -1 = message is timed before removal + * 0 = message needs pick or keyboard before removal + * 1 = message stays up untill replaced by another message + + * 12 = nomore (ER_NOMOREMSG) + Display no more messages + + * 0 = display messages + * 1 = display discontinue message and stop displaying + + * 13 = eropen (ER_FILEOPEN) + + * 0 = errors file is closed + * 1 = errors file is opened + + * 14 = ikserr (ER_INTERERROR) + + * 0 = if interactive do not set keyerr. + * -1 = if interactive set keyerr (used by mesher and tessalation) + + * 15 = kystat (ER_KEYOPTTEST) + Flag to bypass keyopt tests in the elcxx routines associated with status/panel info inquiries. + + * 0 = do not bypass keyopt tests + * 1 = perform all keyopt tests also flag to bypass setting of _STATUS upon resume + + * 16 = mxr4r5 (ER_MIXEDREV) + mixed rev4-rev5 input logic (*do,*if, *go, *if-go) + + * 1 = rev5 found (*do,*fi-then-*endif) + * 2 = rev4 found (*go,:xxx,*if, ...., :xxx) + * 3 = warning printed. do not issue any more. + + * 17 = mshkey (ER_MESHING) + CPU intensive meshing etc. + This will cause "nertim (11)" to be set to -1 for "notes", 1 for "warnings",and 0 for "errors". + Checking of this key is done in "anserr". + + * 0 = not meshing or cpu intensive + * 1 = yes, meshing or cpu intensive + + * 18 = syerro (18) + systop error code. read by anserr if set. + * 19 = opterr (ER_OPTLOOPING) + + * 0 = no error in main ansys during opt looping + * 1 = an error has happened in main ansys during opt looping + + * 20 = flowrn (20) + Flag used by "floqa" as to list ``floqa.ans``. + + * 0 = list ``floqa.ans`` + * 1 = ``floqa.ans`` has been listed. do not list again. + + * 22 = noreport (22) + Used in GUI for turning off errors due to strsub calls. + + * 0 = process errors as usual + * 1 = do NOT report errors + + * 23 = pdserr (ER_PDSLOOPING) + + * 0 = no error in main ansys during pds looping + * 1 = an error has happened in main ansys during pds looping + + * 24 = mxpcmdw (24) + Number of messages written to file.err for any command + + * 0 = write all errors to file.err + * 1 = only write displayed errors to file.err + + * 25 = kystop + No information is provided. + + * 26 = icloads (26) + K key to forbid the ``iclist`` command from listing solution data instead of the input data. + + * 0 = ``iclist`` is OK + * 1 = do not permit ``iclist`` + + * 27 = ifkey error (27) + key on whether or not to abort during ``/input`` on error. + + * 0 = do not abort + * 1 = abort + + * 28 = intrupt (ER_INTERRUPT) + Interrupt button, so executable returns no error. + + * spare - spare integer variables + + **kwargs + Extra arguments to be passed to ``Mapdl.run``. Returns ------- - erinqr (int,sc,out) - value corresponding to key - - mpg erinqr < el117,el115,el126,el109,el53,el96,el97,edg?: get error stat + erinqr (int, sc, out) + Value corresponding to key. """ - pass - + return self.run(f"__temp__ = erinqr({key})", **kwargs) From 0bc8cb4d7612001afba40cfe0a8ce16da6ac0a52 Mon Sep 17 00:00:00 2001 From: German Date: Mon, 3 Jan 2022 17:27:15 +0100 Subject: [PATCH 03/29] Added references to documentation --- doc/source/mapdl_commands/index.rst | 21 ++++++++++++++++++ doc/source/mapdl_commands/inqfun.rst | 32 ++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 doc/source/mapdl_commands/inqfun.rst diff --git a/doc/source/mapdl_commands/index.rst b/doc/source/mapdl_commands/index.rst index 4a7a885495..2460718177 100644 --- a/doc/source/mapdl_commands/index.rst +++ b/doc/source/mapdl_commands/index.rst @@ -307,3 +307,24 @@ Undocumented miscellaneous commands. :maxdepth: 1 misc + + + +***************************** +Undocumented Inquire Commands +***************************** + +Undocumented inquire commands. + +.. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encoraged. + + **Please use it with caution.** + + +.. toctree:: + :maxdepth: 1 + + inqfun + + diff --git a/doc/source/mapdl_commands/inqfun.rst b/doc/source/mapdl_commands/inqfun.rst new file mode 100644 index 0000000000..e07ab9ad2c --- /dev/null +++ b/doc/source/mapdl_commands/inqfun.rst @@ -0,0 +1,32 @@ +.. _ref_inqfun_api: + +***************************** +Undocumented Inquire Commands +***************************** + +.. currentmodule:: ansys.mapdl.core + +Undocumented inquire commands. + +.. autosummary:: + :toctree: _autosummary/ + + Mapdl.ndinqr + Mapdl.elmiqr + Mapdl.kpinqr + Mapdl.lsinqr + Mapdl.arinqr + Mapdl.vlinqr + Mapdl.rlinqr + Mapdl.gapiqr + Mapdl.masiqr + Mapdl.ceinqr + Mapdl.cpinqr + Mapdl.csyiqr + Mapdl.etyiqr + Mapdl.foriqr + Mapdl.sectinqr + Mapdl.mpinqr + Mapdl.dget + Mapdl.fget + Mapdl.erinqr From b9d32d102fa4e336690bd516edd51ee7dc210a90 Mon Sep 17 00:00:00 2001 From: German Date: Mon, 3 Jan 2022 17:46:48 +0100 Subject: [PATCH 04/29] Improving format. --- ansys/mapdl/core/_commands/inq_func.py | 260 +++++++++++++++---------- 1 file changed, 158 insertions(+), 102 deletions(-) diff --git a/ansys/mapdl/core/_commands/inq_func.py b/ansys/mapdl/core/_commands/inq_func.py index dd90be8989..6be0ff31b2 100644 --- a/ansys/mapdl/core/_commands/inq_func.py +++ b/ansys/mapdl/core/_commands/inq_func.py @@ -2,7 +2,7 @@ class inq_function: - def ndinqr(self, node, key, **kwargs): + def ndinqr(self, node, key, pname='__tmpvar__', **kwargs): """Get information about a node. **Secondary Functions:** @@ -15,13 +15,13 @@ def ndinqr(self, node, key, **kwargs): Parameters ---------- - node (int, sc, in) + node : (int, sc, in) node number. It should be 0 for key=11, ``DB_NUMDEFINED``, ``DB_NUMSELECTED``, ``DB_MAXDEFINED``, and ``DB_MAXRECLENG``. - key (int, sc, in) + key : (int, sc, in) key as to information needed about the node. * = DB_SELECTED - return select status: @@ -72,17 +72,20 @@ def ndinqr(self, node, key, **kwargs): * =-115, pointer to calculated displacements * =-116 + pname : str + Name of the variable where the queried value is stored. + **kwargs Extra arguments to be passed to ``Mapdl.run``. Returns ------- - ndinqr (int, func, out) + ndinqr : (int, func, out) The returned value of ``ndinqr`` is based on setting of key. """ - return self.run(f"__temp__ = ndinqr({node}, {key})", **kwargs) + return self.run(f"{pname} = ndinqr({node}, {key})", **kwargs) - def elmiqr(self, ielem, key, **kwargs): + def elmiqr(self, ielem, key, pname='__tmpvar__', **kwargs): """Get information about an element. **Secondary Functions:** @@ -95,13 +98,13 @@ def elmiqr(self, ielem, key, **kwargs): Parameters ---------- - ielem (int, sc, in) + ielem : (int, sc, in) Element number. It should be zero for key=11, ``DB_NUMDEFINED``, ``DB_NUMSELECTED``, ``DB_MAXDEFINED``, ``DB_MAXRECLENG``, or 199 - key (int, sc, in) + key : (int, sc, in) information flag. * = DB_SELECTED - return select status: (1) @@ -148,17 +151,20 @@ def elmiqr(self, ielem, key, **kwargs): * = -5 - coordinate system number ( = -EL_CSYS) * =-101 - pointer to element integers etc. + pname : str + Name of the variable where the queried value is stored. + **kwargs Extra arguments to be passed to ``Mapdl.run``. Returns ------- - elmiqr (int, sc, out) + elmiqr : (int, sc, out) The returned value of ``elmiqr`` is based on setting of key. """ - return self.run(f"__temp__ = elmiqr({ielem}, {key})", **kwargs) + return self.run(f"{pname} = elmiqr({ielem}, {key})", **kwargs) - def kpinqr(self, knmi, key, **kwargs): + def kpinqr(self, knmi, key, pname='__tmpvar__', **kwargs): """Get information about a keypoints. **Secondary Functions:** @@ -172,10 +178,10 @@ def kpinqr(self, knmi, key, **kwargs): Parameters ---------- - knmi (int, sc, in) + knmi : (int, sc, in) Keypoints for inquire. may be 0 for key=11 thru 15. - key (int, sc, in) + key : (int, sc, in) Information flag. * = 1 - return select @@ -245,12 +251,15 @@ def kpinqr(self, knmi, key, **kwargs): * = -111, pointer to keypoint forces * = -112, pointer to line list + pname : str + Name of the variable where the queried value is stored. + **kwargs Extra arguments to be passed to ``Mapdl.run``. Returns ------- - kpinqr (int, sc, out) + kpinqr : (int, sc, out) For key=1 * 0 = ``knmi`` is undefined. @@ -260,9 +269,9 @@ def kpinqr(self, knmi, key, **kwargs): For key not equal to 1 returned data is based on setting of key. """ - return self.run(f"__temp__ = kpinqr({knmi}, {key})", **kwargs) + return self.run(f"{pname} = kpinqr({knmi}, {key})", **kwargs) - def lsinqr(self, line, key, **kwargs): + def lsinqr(self, line, key, pname='__tmpvar__', **kwargs): """Get information about a line segment. .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. @@ -272,10 +281,10 @@ def lsinqr(self, line, key, **kwargs): Parameters ---------- - lnmi (int, sc, in) + lnmi : (int, sc, in) Line segment for inquire. It should be 0 for key=11 thru 15. - key (dp, sc, in) + key : (dp, sc, in) key as to information needed about the ``lnmi``. * = 1, return select @@ -326,13 +335,16 @@ def lsinqr(self, line, key, **kwargs): * =-114, pointer to area list * =-115, pointer to sub-line list * =-116, pointer to line pressures - + + pname : str + Name of the variable where the queried value is stored. + **kwargs Extra arguments to be passed to ``Mapdl.run``. Returns ------- - lsinqr (int, sc, out) + lsinqr : (int, sc, out) For key=1 * 0 = ``lnmi`` is undefined. @@ -343,9 +355,9 @@ def lsinqr(self, line, key, **kwargs): on setting of key. """ - return self.run(f"__temp__ = lsinqr({line}, {key})", **kwargs) + return self.run(f"{pname} = lsinqr({line}, {key})", **kwargs) - def arinqr(self, anmi, key, **kwargs): + def arinqr(self, anmi, key, pname='__tmpvar__', **kwargs): """Get information about a area. **Secondary Functions:** @@ -358,10 +370,10 @@ def arinqr(self, anmi, key, **kwargs): Parameters ---------- - anmi (int, sc, in) + anmi : (int, sc, in) Area for inquire. may be 0 for key=11 thru 15. - key (dp, sc, in) + key : (dp, sc, in) Key as to information needed about the ``anmi``. * = 1, return select @@ -411,13 +423,16 @@ def arinqr(self, anmi, key, **kwargs): * = -114, pointer to sub-area list * = -115, pointer to area presaraes * = -116, pointer to area convections - + + pname : str + Name of the variable where the queried value is stored. + **kwargs Extra arguments to be passed to ``Mapdl.run``. Returns ------- - arinqr (int, sc, out) + arinqr : (int, sc, out) For key=1 * 0 = ``anmi`` is undefined. @@ -427,9 +442,9 @@ def arinqr(self, anmi, key, **kwargs): For key ne 1 returned data is based on setting of key. """ - return self.run(f"__temp__ = arinqr({anmi}, {key})", **kwargs) + return self.run(f"{pname} = arinqr({anmi}, {key})", **kwargs) - def vlinqr(self, vnmi, key, **kwargs): + def vlinqr(self, vnmi, key, pname='__tmpvar__', **kwargs): """Get information about a volume. **Secondary Functions:** @@ -442,10 +457,10 @@ def vlinqr(self, vnmi, key, **kwargs): Parameters ---------- - vnmi (int, sc, in) + vnmi : (int, sc, in) Volume for inquire. may be 0 for key=11 thru 15. - key (dp, sc, in) + key : (dp, sc, in) Key as to information needed about the ``vnmi``. * = 1, return select @@ -482,12 +497,15 @@ def vlinqr(self, vnmi, key, **kwargs): * = -111, * = -112, pointer to area shell list + pname : str + Name of the variable where the queried value is stored. + **kwargs Extra arguments to be passed to ``Mapdl.run``. Returns ------- - vlinqr (int, sc, out) + vlinqr : (int, sc, out) For key=1 * 0 = ``vnmi`` is undefined. @@ -497,9 +515,9 @@ def vlinqr(self, vnmi, key, **kwargs): For key ne 1 returned data is based on setting of key. """ - return self.run(f"__temp__ = vlinqr({vnmi}, {key})", **kwargs) + return self.run(f"{pname} = vlinqr({vnmi}, {key})", **kwargs) - def rlinqr(self, nreal, key, **kwargs): + def rlinqr(self, nreal, key, pname='__tmpvar__', **kwargs): """Get information about a real constant set. .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. @@ -509,16 +527,16 @@ def rlinqr(self, nreal, key, **kwargs): Parameters ---------- - variable (typ, siz, intent) + variable : (typ, siz, intent) description - nreal (int, sc, in) + nreal : (int, sc, in) Real constant table number should be 0 for key=11, ``DB_NUMDEFINED``, ``DB_NUMSELECTED``, ``DB_MAXDEFINED``, and ``DB_MAXRECLENG``. - key (int, sc, in) + key : (int, sc, in) Information flag. * = 5 - return number of values stored for nreal. @@ -534,18 +552,21 @@ def rlinqr(self, nreal, key, **kwargs): * = ``DB_MAXDEFINED`` - return highest real constant table defined * = ``DB_MAXRECLENG`` - return maximum record length (dp words) + pname : str + Name of the variable where the queried value is stored. + **kwargs Extra arguments to be passed to ``Mapdl.run``. Returns ------- - rlinqr (int, func, out) + rlinqr : (int, func, out) The returned value of ``rlinqr`` is based on setting of key. """ - return self.run(f"__temp__ = rlinqr({nreal}, {key})", **kwargs) + return self.run(f"{pname} = rlinqr({nreal}, {key})", **kwargs) - def gapiqr(self, ngap, key, **kwargs): + def gapiqr(self, ngap, key, pname='__tmpvar__', **kwargs): """Get information about a dynamic gap set. .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. @@ -555,10 +576,10 @@ def gapiqr(self, ngap, key, **kwargs): Parameters ---------- - ngap (int, sc, in) + ngap : (int, sc, in) gap number for inquire (must be zero for now). - key (int, sc, in) + key : (int, sc, in) key as to the information needed * = 1, return select @@ -570,17 +591,20 @@ def gapiqr(self, ngap, key, **kwargs): * = 14, return highest number defined * = 15, return maximum record length (data units) + pname : str + Name of the variable where the queried value is stored. + **kwargs Extra arguments to be passed to ``Mapdl.run``. Returns ------- - gapiqr (int, sc, out) + gapiqr : (int, sc, out) Returned data is based on setting of key. """ - return self.run(f"__temp__ = gapiqr({ngap}, {key})", **kwargs) + return self.run(f"{pname} = gapiqr({ngap}, {key})", **kwargs) - def masiqr(self, node, key, **kwargs): + def masiqr(self, node, key, pname='__tmpvar__', **kwargs): """Get information about masters. .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. @@ -590,13 +614,13 @@ def masiqr(self, node, key, **kwargs): Parameters ---------- - variable (typ, siz, intent) + variable : (typ, siz, intent) Description - node (int, sc, in) + node : (int, sc, in) Node number for inquire (must be zero for now). - key (int, sc, in) + key : (int, sc, in) Key as to the information needed * = 1, return select @@ -608,20 +632,23 @@ def masiqr(self, node, key, **kwargs): * = 14, return highest number defined * = 15, return maximum record length (data units) + pname : str + Name of the variable where the queried value is stored. + **kwargs Extra arguments to be passed to ``Mapdl.run``. Returns ------- - variable (typ, siz, intent) + variable : (typ, siz, intent) Description - masiqr (int, sc, out) + masiqr : (int, sc, out) Returned data is based on setting of key. """ - return self.run(f"__temp__ = masiqr({node}, {key})", **kwargs) + return self.run(f"{pname} = masiqr({node}, {key})", **kwargs) - def ceinqr(self, nce, key, **kwargs): + def ceinqr(self, nce, key, pname='__tmpvar__', **kwargs): """Get information about a constraint equation set .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. @@ -631,9 +658,9 @@ def ceinqr(self, nce, key, **kwargs): Parameters ---------- - nce (int, sc, in) + nce : (int, sc, in) Constraint equation number - key (int, sc, in) + key : (int, sc, in) Inquiry key. It should be zero for key=11, ``DB_NUMDEFINED``, ``DB_NUMSELECTED``, ``DB_MAXDEFINED``, and @@ -660,17 +687,20 @@ def ceinqr(self, nce, key, **kwargs): * = ``CE_NONLINEAR`` - return 1 if CE is nonlinear * = ``CE_ELEMNUMBER`` - return associated element number + pname : str + Name of the variable where the queried value is stored. + **kwargs Extra arguments to be passed to ``Mapdl.run``. Returns ------- - ceinqr (int, func, out) + ceinqr : (int, func, out) The returned value of ``ceinqr`` is based on setting of key """ - return self.run(f"__temp__ = ceinqr({nce}, {key})", **kwargs) + return self.run(f"{pname} = ceinqr({nce}, {key})", **kwargs) - def cpinqr(self, ncp, key, **kwargs): + def cpinqr(self, ncp, key, pname='__tmpvar__', **kwargs): """Get information about a coupled set. .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. @@ -680,13 +710,13 @@ def cpinqr(self, ncp, key, **kwargs): Parameters ---------- - variable (typ, siz, intent) + variable : (typ, siz, intent) Description - ncp (int, sc, in) + ncp : (int, sc, in) Coupled set number - key (int, sc, in) + key : (int, sc, in) Inquiry key. It should be zero for key=11, ``DB_NUMDEFINED``, ``DB_NUMSELECTED``, ``DB_MAXDEFINED``, and ``DB_MAXRECLENG`` @@ -711,18 +741,21 @@ def cpinqr(self, ncp, key, **kwargs): * = -1 - return master node for this eqn (this is currently only used by solution DB object) + pname : str + Name of the variable where the queried value is stored. + **kwargs Extra arguments to be passed to ``Mapdl.run``. Returns ------- - cpinqr (int, func, out) + cpinqr : (int, func, out) The returned value of ``cpinqr`` is based on setting of key. """ - return self.run(f"__temp__ = cpinqr({ncp}, {key})", **kwargs) + return self.run(f"{pname} = cpinqr({ncp}, {key})", **kwargs) - def csyiqr(self, ncsy, key, **kwargs): + def csyiqr(self, ncsy, key, pname='__tmpvar__', **kwargs): """Get information about a coordinate system .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. @@ -732,12 +765,12 @@ def csyiqr(self, ncsy, key, **kwargs): Parameters ---------- - ncsy (int, sc, in) + ncsy : (int, sc, in) Coordinate system reference number should be zero for key= ``DB_NUMDEFINED`` or ``DB_MAXDEFINED`` - key (int, sc, in) + key : (int, sc, in) Information flag. * = ``DB_SELECTED`` - return status: @@ -750,17 +783,20 @@ def csyiqr(self, ncsy, key, **kwargs): * = ``DB_MAXDEFINED`` - maximum coordinate system reference number used. + pname : str + Name of the variable where the queried value is stored. + **kwargs Extra arguments to be passed to ``Mapdl.run``. Returns ------- - csyiqr (int, func, out) + csyiqr : (int, func, out) The returned value of ``csyiqr`` is based on setting of key. """ - return self.run(f"__temp__ = csyiqr({ncsy}, {key})", **kwargs) + return self.run(f"{pname} = csyiqr({ncsy}, {key})", **kwargs) - def etyiqr(self, itype, key, **kwargs): + def etyiqr(self, itype, key, pname='__tmpvar__', **kwargs): """Get information about an element type. .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. @@ -770,13 +806,13 @@ def etyiqr(self, itype, key, **kwargs): Parameters ---------- - itype (int, sc, in) + itype : (int, sc, in) Element type number. It should be 0 for key=11, ``DB_NUMDEFINED``, ``DB_NUMSELECTED``, ``DB_MAXDEFINED``, and ``DB_MAXRECLENG`` - key (int, sc, in) + key : (int, sc, in) Information flag. * = DB_SELECTED - return select status: @@ -796,17 +832,20 @@ def etyiqr(self, itype, key, **kwargs): note- this will not overwrite the current setting of ``etycom``. + pname : str + Name of the variable where the queried value is stored. + **kwargs Extra arguments to be passed to ``Mapdl.run``. Returns ------- - etyiqr (int, func, out) + etyiqr : (int, func, out) The returned value of ``etyiqr`` is based on setting of key. """ - return self.run(f"__temp__ = etyiqr({itype}, {key})", **kwargs) + return self.run(f"{pname} = etyiqr({itype}, {key})", **kwargs) - def foriqr(self, node, key, **kwargs): + def foriqr(self, node, key, pname='__tmpvar__', **kwargs): """Get information about nodal loads. .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. @@ -816,12 +855,12 @@ def foriqr(self, node, key, **kwargs): Parameters ---------- - node (int, sc, in) + node : (int, sc, in) Number of node being inquired about. should be 0 for key=``DB_MAXDEFINED`` or ``DB_NUMDEFINED``. - key (dp, sc, in) + key : (dp, sc, in) Key as to information needed * = 1 - return force mask for node @@ -830,17 +869,20 @@ def foriqr(self, node, key, **kwargs): .. note:: Both ``DB_MAXDEFINED`` and ``DB_NUMDEFINED``, produce the same functionality. + pname : str + Name of the variable where the queried value is stored. + **kwargs Extra arguments to be passed to ``Mapdl.run``. Returns ------- - foriqr (int, func, out) + foriqr : (int, func, out) The returned value of ``foriqr`` is based on setting of key. """ - return self.run(f"__temp__ = foriqr({node}, {key})", **kwargs) + return self.run(f"{pname} = foriqr({node}, {key})", **kwargs) - def sectinqr(self, nsect, key, **kwargs): + def sectinqr(self, nsect, key, pname='__tmpvar__', **kwargs): """Get information about a section property. .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. @@ -859,6 +901,9 @@ def sectinqr(self, nsect, key, **kwargs): * = 13, return number of selected section id tables * = 14, return highest section id table defined + pname : str + Name of the variable where the queried value is stored. + **kwargs Extra arguments to be passed to ``Mapdl.run``. @@ -869,9 +914,9 @@ def sectinqr(self, nsect, key, **kwargs): * = -1, section id table is unselected. * = 1, section id table is selected """ - return self.run(f"__temp__ = sectinqr({nsect}, {key})", **kwargs) + return self.run(f"{pname} = sectinqr({nsect}, {key})", **kwargs) - def mpinqr(self, mat, iprop, key, **kwargs): + def mpinqr(self, mat, iprop, key, pname='__tmpvar__', **kwargs): """Get information about a material property. .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. @@ -881,12 +926,12 @@ def mpinqr(self, mat, iprop, key, **kwargs): Parameters ---------- - mat (int, sc, in) + mat : (int, sc, in) Material number should be 0 for key=11, ``DB_NUMDEFINED(12)``, ``DB_MAXDEFINED(14)``, and ``DB_MAXRECLENG(15)``. - iprop (int, sc, in) + iprop : (int, sc, in) Property reference number (See notes). If iprop = 0, test for existence of any material property with this @@ -919,8 +964,7 @@ def mpinqr(self, mat, iprop, key, **kwargs): (see ``TB`` command for more information) - - key (int, sc, in) + key : (int, sc, in) Key as to the information needed about material property. * = ``DB_SELECTED(1)``- return select status: @@ -934,19 +978,22 @@ def mpinqr(self, mat, iprop, key, **kwargs): * = 2 - return length (dp words) * = 3 - return number of temp. values * = 11 - return void percent (integer) - + + pname : str + Name of the variable where the queried value is stored. + **kwargs Extra arguments to be passed to ``Mapdl.run``. Returns ------- - mpinqr (int, func, out) + mpinqr : (int, func, out) Returned value of ``mpinqr`` is based on setting of key. """ - return self.run(f"__temp__ = mpinqr({mat, iprop}, { key})", **kwargs) + return self.run(f"{pname} = mpinqr({mat, iprop}, { key})", **kwargs) - def dget(self, node, idf, kcmplx, **kwargs): + def dget(self, node, idf, kcmplx, pname='__tmpvar__', **kwargs): """Get a constraint from the data bsae .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. @@ -956,10 +1003,10 @@ def dget(self, node, idf, kcmplx, **kwargs): Parameters ---------- - node (int, sc, in) + node : (int, sc, in) Node number - idf (int, sc, in) + idf : (int, sc, in) Pointer to the dof (1-32) * 1 = ux, @@ -985,22 +1032,25 @@ def dget(self, node, idf, kcmplx, **kwargs): * 26 = curr * 27-32 = SP01-SP06 - kcmplx (int, sc, in) + kcmplx : (int, sc, in) * 0 = real * 1 = imaginary + pname : str + Name of the variable where the queried value is stored. + **kwargs Extra arguments to be passed to ``Mapdl.run``. Returns ------- - dget (dp, sc, out) + dget : (dp, sc, out) Constraint value (High number if undefined) """ - return self.run(f"__temp__ = dget({node}, {idf}, { kcmplx})", **kwargs) + return self.run(f"{pname} = dget({node}, {idf}, { kcmplx})", **kwargs) - def fget(self, node, idf, kcmplx, **kwargs): + def fget(self, node, idf, kcmplx, pname='__tmpvar__', **kwargs): """Get a force from the data bsae .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. @@ -1010,10 +1060,10 @@ def fget(self, node, idf, kcmplx, **kwargs): Parameters ---------- - node (int, sc, in) + node : (int, sc, in) Node number - idf (int, sc, in) + idf : (int, sc, in) Pointer to the dof (1-32) * 1 = ux @@ -1039,22 +1089,25 @@ def fget(self, node, idf, kcmplx, **kwargs): * 26 = curr * 27-32 = spares - kcmplx (int, sc, in) + kcmplx : (int, sc, in) * 0 = real * 1 = imaginary + pname : str + Name of the variable where the queried value is stored. + **kwargs Extra arguments to be passed to ``Mapdl.run``. Returns ------- - fget (dp, sc, out) + fget : (dp, sc, out) Force value (High number if undefined) """ - return self.run(f"__temp__ = fget({node}, {idf}, {kcmplx})", **kwargs) + return self.run(f"{pname} = fget({node}, {idf}, {kcmplx})", **kwargs) - def erinqr(self, key, **kwargs): + def erinqr(self, key, pname='__tmpvar__', **kwargs): """Obtain information from errors common .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. @@ -1064,7 +1117,7 @@ def erinqr(self, key, **kwargs): Parameters ---------- - key (int, sc, in) + key : (int, sc, in) Item to be returned. * 1 = keyerr (ER_ERRORFLAG) @@ -1185,13 +1238,16 @@ def erinqr(self, key, **kwargs): * spare - spare integer variables + pname : str + Name of the variable where the queried value is stored. + **kwargs Extra arguments to be passed to ``Mapdl.run``. Returns ------- - erinqr (int, sc, out) + erinqr : (int, sc, out) Value corresponding to key. """ - return self.run(f"__temp__ = erinqr({key})", **kwargs) + return self.run(f"{pname} = erinqr({key})", **kwargs) From ac46f9851feab8964a3b03e1b88cf8f8fa0a38d8 Mon Sep 17 00:00:00 2001 From: German Date: Mon, 3 Jan 2022 17:48:14 +0100 Subject: [PATCH 05/29] Adding gRPC wrappers. --- ansys/mapdl/core/mapdl_grpc.py | 152 +++++++++++++++++++++++++++++++++ 1 file changed, 152 insertions(+) diff --git a/ansys/mapdl/core/mapdl_grpc.py b/ansys/mapdl/core/mapdl_grpc.py index 3f35fc2d43..cab57071e7 100755 --- a/ansys/mapdl/core/mapdl_grpc.py +++ b/ansys/mapdl/core/mapdl_grpc.py @@ -1884,3 +1884,155 @@ def _distributed(self) -> bool: if self.__distributed is None: self.__distributed = self.parameters.numcpu > 1 return self.__distributed + + @wraps(_MapdlCore.ndinqr) + def ndinqr(self, node, key, **kwargs): + """Wrap the ``ndinqr`` method to take advantage of the gRPC methods.""" + _ = super().ndinqr(self, node, key, pname='__tmpvar__', **kwargs) + presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + self._run('__tmpvar__=') # Deleting temp parameter + return presponse.val[0] + + @wraps(_MapdlCore.elmiqr) + def elmiqr(self, ielem, key, **kwargs): + """Wrap the ``elmiqr`` method to take advantage of the gRPC methods.""" + _ = super().elmiqr(self, ielem, key, pname='__tmpvar__', **kwargs) + presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + self._run('__tmpvar__=') # Deleting temp parameter + return presponse.val[0] + + @wraps(_MapdlCore.kpinqr) + def kpinqr(self, knmi, key, **kwargs): + """Wrap the ``kpinqr`` method to take advantage of the gRPC methods.""" + _ = super().kpinqr(self, knmi, key, pname='__tmpvar__', **kwargs) + presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + self._run('__tmpvar__=') # Deleting temp parameter + return presponse.val[0] + + @wraps(_MapdlCore.lsinqr) + def lsinqr(self, line, key, **kwargs): + """Wrap the ``lsinqr`` method to take advantage of the gRPC methods.""" + _ = super().lsinqr(self, line, key, pname='__tmpvar__', **kwargs) + presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + self._run('__tmpvar__=') # Deleting temp parameter + return presponse.val[0] + + @wraps(_MapdlCore.arinqr) + def arinqr(self, anmi, key, **kwargs): + """Wrap the ``arinqr`` method to take advantage of the gRPC methods.""" + _ = super().arinqr(self, anmi, key, pname='__tmpvar__', **kwargs) + presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + self._run('__tmpvar__=') # Deleting temp parameter + return presponse.val[0] + + @wraps(_MapdlCore.vlinqr) + def vlinqr(self, vnmi, key, **kwargs): + """Wrap the ``vlinqr`` method to take advantage of the gRPC methods.""" + _ = super().vlinqr(self, vnmi, key, pname='__tmpvar__', **kwargs) + presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + self._run('__tmpvar__=') # Deleting temp parameter + return presponse.val[0] + + @wraps(_MapdlCore.rlinqr) + def rlinqr(self, nreal, key, **kwargs): + """Wrap the ``rlinqr`` method to take advantage of the gRPC methods.""" + _ = super().rlinqr(self, nreal, key, pname='__tmpvar__', **kwargs) + presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + self._run('__tmpvar__=') # Deleting temp parameter + return presponse.val[0] + + @wraps(_MapdlCore.gapiqr) + def gapiqr(self, ngap, key, **kwargs): + """Wrap the ``gapiqr`` method to take advantage of the gRPC methods.""" + _ = super().gapiqr(self, ngap, key, pname='__tmpvar__', **kwargs) + presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + self._run('__tmpvar__=') # Deleting temp parameter + return presponse.val[0] + + @wraps(_MapdlCore.masiqr) + def masiqr(self, node, key, **kwargs): + """Wrap the ``masiqr`` method to take advantage of the gRPC methods.""" + _ = super().masiqr(self, node, key, pname='__tmpvar__', **kwargs) + presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + self._run('__tmpvar__=') # Deleting temp parameter + return presponse.val[0] + + @wraps(_MapdlCore.ceinqr) + def ceinqr(self, nce, key, **kwargs): + """Wrap the ``ceinqr`` method to take advantage of the gRPC methods.""" + _ = super().ceinqr(self, nce, key, pname='__tmpvar__', **kwargs) + presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + self._run('__tmpvar__=') # Deleting temp parameter + return presponse.val[0] + + @wraps(_MapdlCore.cpinqr) + def cpinqr(self, ncp, key, **kwargs): + """Wrap the ``cpinqr`` method to take advantage of the gRPC methods.""" + _ = super().cpinqr(self, ncp, key, pname='__tmpvar__', **kwargs) + presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + self._run('__tmpvar__=') # Deleting temp parameter + return presponse.val[0] + + @wraps(_MapdlCore.csyiqr) + def csyiqr(self, ncsy, key, **kwargs): + """Wrap the ``csyiqr`` method to take advantage of the gRPC methods.""" + _ = super().csyiqr(self, ncsy, key, pname='__tmpvar__', **kwargs) + presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + self._run('__tmpvar__=') # Deleting temp parameter + return presponse.val[0] + + @wraps(_MapdlCore.etyiqr) + def etyiqr(self, itype, key, **kwargs): + """Wrap the ``etyiqr`` method to take advantage of the gRPC methods.""" + _ = super().etyiqr(self, itype, key, pname='__tmpvar__', **kwargs) + presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + self._run('__tmpvar__=') # Deleting temp parameter + return presponse.val[0] + + @wraps(_MapdlCore.foriqr) + def foriqr(self, node, key, **kwargs): + """Wrap the ``foriqr`` method to take advantage of the gRPC methods.""" + _ = super().foriqr(self, node, key, pname='__tmpvar__', **kwargs) + presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + self._run('__tmpvar__=') # Deleting temp parameter + return presponse.val[0] + + @wraps(_MapdlCore.sectinqr) + def sectinqr(self, nsect, key, **kwargs): + """Wrap the ``sectinqr`` method to take advantage of the gRPC methods.""" + _ = super().sectinqr(self, nsect, key, pname='__tmpvar__', **kwargs) + presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + self._run('__tmpvar__=') # Deleting temp parameter + return presponse.val[0] + + @wraps(_MapdlCore.mpinqr) + def mpinqr(self, mat, iprop, key, **kwargs): + """Wrap the ``mpinqr`` method to take advantage of the gRPC methods.""" + _ = super().mpinqr(self, mat, iprop, key, pname='__tmpvar__', **kwargs) + presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + self._run('__tmpvar__=') # Deleting temp parameter + return presponse.val[0] + + @wraps(_MapdlCore.dget) + def dget(self, node, idf, kcmplx, **kwargs): + """Wrap the ``dget`` method to take advantage of the gRPC methods.""" + _ = super().dget(self, node, idf, kcmplx, pname='__tmpvar__', **kwargs) + presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + self._run('__tmpvar__=') # Deleting temp parameter + return presponse.val[0] + + @wraps(_MapdlCore.fget) + def fget(self, node, idf, kcmplx, **kwargs): + """Wrap the ``fget`` method to take advantage of the gRPC methods.""" + _ = super().fget(self, node, idf, kcmplx, pname='__tmpvar__', **kwargs) + presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + self._run('__tmpvar__=') # Deleting temp parameter + return presponse.val[0] + + @wraps(_MapdlCore.erinqr) + def erinqr(self, key, **kwargs): + """Wrap the ``erinqr`` method to take advantage of the gRPC methods.""" + _ = super().erinqr(self, key, pname='__tmpvar__', **kwargs) + presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + self._run('__tmpvar__=') # Deleting temp parameter + return presponse.val[0] From 6aeae401f02205ef8d77048c38a7a3f87fbf6c94 Mon Sep 17 00:00:00 2001 From: German Date: Mon, 3 Jan 2022 17:58:58 +0100 Subject: [PATCH 06/29] Fixing style. --- ansys/mapdl/core/_commands/inq_func.py | 30 +++++++++++++------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/ansys/mapdl/core/_commands/inq_func.py b/ansys/mapdl/core/_commands/inq_func.py index 6be0ff31b2..2c827b226c 100644 --- a/ansys/mapdl/core/_commands/inq_func.py +++ b/ansys/mapdl/core/_commands/inq_func.py @@ -181,7 +181,7 @@ def kpinqr(self, knmi, key, pname='__tmpvar__', **kwargs): knmi : (int, sc, in) Keypoints for inquire. may be 0 for key=11 thru 15. - key : (int, sc, in) + key : (int, sc, in) Information flag. * = 1 - return select @@ -250,7 +250,7 @@ def kpinqr(self, knmi, key, pname='__tmpvar__', **kwargs): * = -110, pointer to keypoint displacements * = -111, pointer to keypoint forces * = -112, pointer to line list - + pname : str Name of the variable where the queried value is stored. @@ -496,7 +496,7 @@ def vlinqr(self, vnmi, key, pname='__tmpvar__', **kwargs): * = -110, pointer to sub-volume list * = -111, * = -112, pointer to area shell list - + pname : str Name of the variable where the queried value is stored. @@ -551,7 +551,7 @@ def rlinqr(self, nreal, key, pname='__tmpvar__', **kwargs): * = ``DB_NUMSELECTED`` - return number of selected real constant tables * = ``DB_MAXDEFINED`` - return highest real constant table defined * = ``DB_MAXRECLENG`` - return maximum record length (dp words) - + pname : str Name of the variable where the queried value is stored. @@ -590,7 +590,7 @@ def gapiqr(self, ngap, key, pname='__tmpvar__', **kwargs): * = 13, return number of selected * = 14, return highest number defined * = 15, return maximum record length (data units) - + pname : str Name of the variable where the queried value is stored. @@ -631,7 +631,7 @@ def masiqr(self, node, key, pname='__tmpvar__', **kwargs): * = 13, return number of selected * = 14, return highest number defined * = 15, return maximum record length (data units) - + pname : str Name of the variable where the queried value is stored. @@ -686,7 +686,7 @@ def ceinqr(self, nce, key, pname='__tmpvar__', **kwargs): * = 16 - return location of next record * = ``CE_NONLINEAR`` - return 1 if CE is nonlinear * = ``CE_ELEMNUMBER`` - return associated element number - + pname : str Name of the variable where the queried value is stored. @@ -740,7 +740,7 @@ def cpinqr(self, ncp, key, pname='__tmpvar__', **kwargs): * = 16 - return location of next record * = -1 - return master node for this eqn (this is currently only used by solution DB object) - + pname : str Name of the variable where the queried value is stored. @@ -782,7 +782,7 @@ def csyiqr(self, ncsy, key, pname='__tmpvar__', **kwargs): * = ``DB_NUMDEFINED`` - number of defined coordinate systems * = ``DB_MAXDEFINED`` - maximum coordinate system reference number used. - + pname : str Name of the variable where the queried value is stored. @@ -831,7 +831,7 @@ def etyiqr(self, itype, key, pname='__tmpvar__', **kwargs): see ``elccmt`` for definitions of element characteristics. note- this will not overwrite the current setting of ``etycom``. - + pname : str Name of the variable where the queried value is stored. @@ -868,7 +868,7 @@ def foriqr(self, node, key, pname='__tmpvar__', **kwargs): * = ``DB_NUMDEFINED``. - return number of nodal loadings in model. .. note:: Both ``DB_MAXDEFINED`` and ``DB_NUMDEFINED``, produce the same functionality. - + pname : str Name of the variable where the queried value is stored. @@ -900,7 +900,7 @@ def sectinqr(self, nsect, key, pname='__tmpvar__', **kwargs): * = 12, return number of defined section id tables * = 13, return number of selected section id tables * = 14, return highest section id table defined - + pname : str Name of the variable where the queried value is stored. @@ -1036,7 +1036,7 @@ def dget(self, node, idf, kcmplx, pname='__tmpvar__', **kwargs): * 0 = real * 1 = imaginary - + pname : str Name of the variable where the queried value is stored. @@ -1093,7 +1093,7 @@ def fget(self, node, idf, kcmplx, pname='__tmpvar__', **kwargs): * 0 = real * 1 = imaginary - + pname : str Name of the variable where the queried value is stored. @@ -1237,7 +1237,7 @@ def erinqr(self, key, pname='__tmpvar__', **kwargs): Interrupt button, so executable returns no error. * spare - spare integer variables - + pname : str Name of the variable where the queried value is stored. From 9e79a292090059f8532f4d782a4fab011b3dd429 Mon Sep 17 00:00:00 2001 From: German Date: Mon, 3 Jan 2022 18:34:00 +0100 Subject: [PATCH 07/29] Deleted extra self. --- ansys/mapdl/core/_commands/inq_func.py | 2 +- ansys/mapdl/core/mapdl_grpc.py | 38 +++++++++++++------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/ansys/mapdl/core/_commands/inq_func.py b/ansys/mapdl/core/_commands/inq_func.py index 2c827b226c..0fb040daf1 100644 --- a/ansys/mapdl/core/_commands/inq_func.py +++ b/ansys/mapdl/core/_commands/inq_func.py @@ -1048,7 +1048,7 @@ def dget(self, node, idf, kcmplx, pname='__tmpvar__', **kwargs): dget : (dp, sc, out) Constraint value (High number if undefined) """ - return self.run(f"{pname} = dget({node}, {idf}, { kcmplx})", **kwargs) + return self.run(f"{pname} = dget({node}, {idf}, {kcmplx})", **kwargs) def fget(self, node, idf, kcmplx, pname='__tmpvar__', **kwargs): """Get a force from the data bsae diff --git a/ansys/mapdl/core/mapdl_grpc.py b/ansys/mapdl/core/mapdl_grpc.py index cab57071e7..e3948a33ee 100755 --- a/ansys/mapdl/core/mapdl_grpc.py +++ b/ansys/mapdl/core/mapdl_grpc.py @@ -1888,7 +1888,7 @@ def _distributed(self) -> bool: @wraps(_MapdlCore.ndinqr) def ndinqr(self, node, key, **kwargs): """Wrap the ``ndinqr`` method to take advantage of the gRPC methods.""" - _ = super().ndinqr(self, node, key, pname='__tmpvar__', **kwargs) + _ = super().ndinqr(node, key, pname='__tmpvar__', **kwargs) presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) self._run('__tmpvar__=') # Deleting temp parameter return presponse.val[0] @@ -1896,7 +1896,7 @@ def ndinqr(self, node, key, **kwargs): @wraps(_MapdlCore.elmiqr) def elmiqr(self, ielem, key, **kwargs): """Wrap the ``elmiqr`` method to take advantage of the gRPC methods.""" - _ = super().elmiqr(self, ielem, key, pname='__tmpvar__', **kwargs) + _ = super().elmiqr(ielem, key, pname='__tmpvar__', **kwargs) presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) self._run('__tmpvar__=') # Deleting temp parameter return presponse.val[0] @@ -1904,7 +1904,7 @@ def elmiqr(self, ielem, key, **kwargs): @wraps(_MapdlCore.kpinqr) def kpinqr(self, knmi, key, **kwargs): """Wrap the ``kpinqr`` method to take advantage of the gRPC methods.""" - _ = super().kpinqr(self, knmi, key, pname='__tmpvar__', **kwargs) + _ = super().kpinqr(knmi, key, pname='__tmpvar__', **kwargs) presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) self._run('__tmpvar__=') # Deleting temp parameter return presponse.val[0] @@ -1912,7 +1912,7 @@ def kpinqr(self, knmi, key, **kwargs): @wraps(_MapdlCore.lsinqr) def lsinqr(self, line, key, **kwargs): """Wrap the ``lsinqr`` method to take advantage of the gRPC methods.""" - _ = super().lsinqr(self, line, key, pname='__tmpvar__', **kwargs) + _ = super().lsinqr(line, key, pname='__tmpvar__', **kwargs) presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) self._run('__tmpvar__=') # Deleting temp parameter return presponse.val[0] @@ -1920,7 +1920,7 @@ def lsinqr(self, line, key, **kwargs): @wraps(_MapdlCore.arinqr) def arinqr(self, anmi, key, **kwargs): """Wrap the ``arinqr`` method to take advantage of the gRPC methods.""" - _ = super().arinqr(self, anmi, key, pname='__tmpvar__', **kwargs) + _ = super().arinqr(anmi, key, pname='__tmpvar__', **kwargs) presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) self._run('__tmpvar__=') # Deleting temp parameter return presponse.val[0] @@ -1928,7 +1928,7 @@ def arinqr(self, anmi, key, **kwargs): @wraps(_MapdlCore.vlinqr) def vlinqr(self, vnmi, key, **kwargs): """Wrap the ``vlinqr`` method to take advantage of the gRPC methods.""" - _ = super().vlinqr(self, vnmi, key, pname='__tmpvar__', **kwargs) + _ = super().vlinqr(vnmi, key, pname='__tmpvar__', **kwargs) presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) self._run('__tmpvar__=') # Deleting temp parameter return presponse.val[0] @@ -1936,7 +1936,7 @@ def vlinqr(self, vnmi, key, **kwargs): @wraps(_MapdlCore.rlinqr) def rlinqr(self, nreal, key, **kwargs): """Wrap the ``rlinqr`` method to take advantage of the gRPC methods.""" - _ = super().rlinqr(self, nreal, key, pname='__tmpvar__', **kwargs) + _ = super().rlinqr(nreal, key, pname='__tmpvar__', **kwargs) presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) self._run('__tmpvar__=') # Deleting temp parameter return presponse.val[0] @@ -1944,7 +1944,7 @@ def rlinqr(self, nreal, key, **kwargs): @wraps(_MapdlCore.gapiqr) def gapiqr(self, ngap, key, **kwargs): """Wrap the ``gapiqr`` method to take advantage of the gRPC methods.""" - _ = super().gapiqr(self, ngap, key, pname='__tmpvar__', **kwargs) + _ = super().gapiqr(ngap, key, pname='__tmpvar__', **kwargs) presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) self._run('__tmpvar__=') # Deleting temp parameter return presponse.val[0] @@ -1952,7 +1952,7 @@ def gapiqr(self, ngap, key, **kwargs): @wraps(_MapdlCore.masiqr) def masiqr(self, node, key, **kwargs): """Wrap the ``masiqr`` method to take advantage of the gRPC methods.""" - _ = super().masiqr(self, node, key, pname='__tmpvar__', **kwargs) + _ = super().masiqr(node, key, pname='__tmpvar__', **kwargs) presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) self._run('__tmpvar__=') # Deleting temp parameter return presponse.val[0] @@ -1960,7 +1960,7 @@ def masiqr(self, node, key, **kwargs): @wraps(_MapdlCore.ceinqr) def ceinqr(self, nce, key, **kwargs): """Wrap the ``ceinqr`` method to take advantage of the gRPC methods.""" - _ = super().ceinqr(self, nce, key, pname='__tmpvar__', **kwargs) + _ = super().ceinqr(nce, key, pname='__tmpvar__', **kwargs) presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) self._run('__tmpvar__=') # Deleting temp parameter return presponse.val[0] @@ -1968,7 +1968,7 @@ def ceinqr(self, nce, key, **kwargs): @wraps(_MapdlCore.cpinqr) def cpinqr(self, ncp, key, **kwargs): """Wrap the ``cpinqr`` method to take advantage of the gRPC methods.""" - _ = super().cpinqr(self, ncp, key, pname='__tmpvar__', **kwargs) + _ = super().cpinqr(ncp, key, pname='__tmpvar__', **kwargs) presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) self._run('__tmpvar__=') # Deleting temp parameter return presponse.val[0] @@ -1976,7 +1976,7 @@ def cpinqr(self, ncp, key, **kwargs): @wraps(_MapdlCore.csyiqr) def csyiqr(self, ncsy, key, **kwargs): """Wrap the ``csyiqr`` method to take advantage of the gRPC methods.""" - _ = super().csyiqr(self, ncsy, key, pname='__tmpvar__', **kwargs) + _ = super().csyiqr(ncsy, key, pname='__tmpvar__', **kwargs) presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) self._run('__tmpvar__=') # Deleting temp parameter return presponse.val[0] @@ -1984,7 +1984,7 @@ def csyiqr(self, ncsy, key, **kwargs): @wraps(_MapdlCore.etyiqr) def etyiqr(self, itype, key, **kwargs): """Wrap the ``etyiqr`` method to take advantage of the gRPC methods.""" - _ = super().etyiqr(self, itype, key, pname='__tmpvar__', **kwargs) + _ = super().etyiqr(itype, key, pname='__tmpvar__', **kwargs) presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) self._run('__tmpvar__=') # Deleting temp parameter return presponse.val[0] @@ -1992,7 +1992,7 @@ def etyiqr(self, itype, key, **kwargs): @wraps(_MapdlCore.foriqr) def foriqr(self, node, key, **kwargs): """Wrap the ``foriqr`` method to take advantage of the gRPC methods.""" - _ = super().foriqr(self, node, key, pname='__tmpvar__', **kwargs) + _ = super().foriqr(node, key, pname='__tmpvar__', **kwargs) presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) self._run('__tmpvar__=') # Deleting temp parameter return presponse.val[0] @@ -2000,7 +2000,7 @@ def foriqr(self, node, key, **kwargs): @wraps(_MapdlCore.sectinqr) def sectinqr(self, nsect, key, **kwargs): """Wrap the ``sectinqr`` method to take advantage of the gRPC methods.""" - _ = super().sectinqr(self, nsect, key, pname='__tmpvar__', **kwargs) + _ = super().sectinqr(nsect, key, pname='__tmpvar__', **kwargs) presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) self._run('__tmpvar__=') # Deleting temp parameter return presponse.val[0] @@ -2008,7 +2008,7 @@ def sectinqr(self, nsect, key, **kwargs): @wraps(_MapdlCore.mpinqr) def mpinqr(self, mat, iprop, key, **kwargs): """Wrap the ``mpinqr`` method to take advantage of the gRPC methods.""" - _ = super().mpinqr(self, mat, iprop, key, pname='__tmpvar__', **kwargs) + _ = super().mpinqr(mat, iprop, key, pname='__tmpvar__', **kwargs) presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) self._run('__tmpvar__=') # Deleting temp parameter return presponse.val[0] @@ -2016,7 +2016,7 @@ def mpinqr(self, mat, iprop, key, **kwargs): @wraps(_MapdlCore.dget) def dget(self, node, idf, kcmplx, **kwargs): """Wrap the ``dget`` method to take advantage of the gRPC methods.""" - _ = super().dget(self, node, idf, kcmplx, pname='__tmpvar__', **kwargs) + _ = super().dget(node, idf, kcmplx, pname='__tmpvar__', **kwargs) presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) self._run('__tmpvar__=') # Deleting temp parameter return presponse.val[0] @@ -2024,7 +2024,7 @@ def dget(self, node, idf, kcmplx, **kwargs): @wraps(_MapdlCore.fget) def fget(self, node, idf, kcmplx, **kwargs): """Wrap the ``fget`` method to take advantage of the gRPC methods.""" - _ = super().fget(self, node, idf, kcmplx, pname='__tmpvar__', **kwargs) + _ = super().fget(node, idf, kcmplx, pname='__tmpvar__', **kwargs) presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) self._run('__tmpvar__=') # Deleting temp parameter return presponse.val[0] @@ -2032,7 +2032,7 @@ def fget(self, node, idf, kcmplx, **kwargs): @wraps(_MapdlCore.erinqr) def erinqr(self, key, **kwargs): """Wrap the ``erinqr`` method to take advantage of the gRPC methods.""" - _ = super().erinqr(self, key, pname='__tmpvar__', **kwargs) + _ = super().erinqr(key, pname='__tmpvar__', **kwargs) presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) self._run('__tmpvar__=') # Deleting temp parameter return presponse.val[0] From 733c52609d3bcf6d6f582926b058a7dc768678d7 Mon Sep 17 00:00:00 2001 From: German Date: Mon, 3 Jan 2022 18:34:09 +0100 Subject: [PATCH 08/29] Added unit test. --- tests/test_commands.py | 53 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/tests/test_commands.py b/tests/test_commands.py index e69de29bb2..2fb55ad82d 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -0,0 +1,53 @@ +import pytest +import inspect + + +LIST_OF_INQUIRE_FUNCTIONS = [ + 'ndinqr', + 'elmiqr', + 'kpinqr', + 'lsinqr', + 'arinqr', + 'vlinqr', + 'rlinqr', + 'gapiqr', + 'masiqr', + 'ceinqr', + 'cpinqr', + 'csyiqr', + 'etyiqr', + 'foriqr', + 'sectinqr', + 'mpinqr', + 'dget', + 'fget', + 'erinqr' + ] + +# Generic args +ARGS_INQ_FUNC = { + 'node': 1, + 'key': 0, + 'ielem': 1, + 'knmi': 1, + 'line': 1, + 'anmi': 1, + 'vnmi': 1, + 'nreal': 1, + 'ngap': 1, + 'nce': 1, + 'ncp': 1, + 'ncsy': 1, + 'itype': 1, + 'nsect': 1, + 'mat': 1, + 'iprop': 1, + 'idf': 1, + 'kcmplx': 1 + } +@pytest.mark.parametrize("func", LIST_OF_INQUIRE_FUNCTIONS) +def test_inquire_functions(mapdl, func): + func_ = getattr(mapdl, func) + func_args = inspect.getfullargspec(func_).args + args = [ARGS_INQ_FUNC[each_arg] for each_arg in func_args if each_arg not in ['self']] + assert any(isinstance(func_(*args), (float, int))) From c00f0dc06d1ec008cd96357bec393eb33068f187 Mon Sep 17 00:00:00 2001 From: German Date: Mon, 3 Jan 2022 18:39:54 +0100 Subject: [PATCH 09/29] Removing color which was giving sphinx formatting error. --- ansys/mapdl/core/_commands/inq_func.py | 43 +++++++++++++------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/ansys/mapdl/core/_commands/inq_func.py b/ansys/mapdl/core/_commands/inq_func.py index 0fb040daf1..bb345f75c9 100644 --- a/ansys/mapdl/core/_commands/inq_func.py +++ b/ansys/mapdl/core/_commands/inq_func.py @@ -80,7 +80,7 @@ def ndinqr(self, node, key, pname='__tmpvar__', **kwargs): Returns ------- - ndinqr : (int, func, out) + ndinqr (int, func, out) The returned value of ``ndinqr`` is based on setting of key. """ return self.run(f"{pname} = ndinqr({node}, {key})", **kwargs) @@ -159,7 +159,7 @@ def elmiqr(self, ielem, key, pname='__tmpvar__', **kwargs): Returns ------- - elmiqr : (int, sc, out) + elmiqr (int, sc, out) The returned value of ``elmiqr`` is based on setting of key. """ return self.run(f"{pname} = elmiqr({ielem}, {key})", **kwargs) @@ -181,7 +181,7 @@ def kpinqr(self, knmi, key, pname='__tmpvar__', **kwargs): knmi : (int, sc, in) Keypoints for inquire. may be 0 for key=11 thru 15. - key : (int, sc, in) + key : (int, sc, in) Information flag. * = 1 - return select @@ -259,7 +259,7 @@ def kpinqr(self, knmi, key, pname='__tmpvar__', **kwargs): Returns ------- - kpinqr : (int, sc, out) + kpinqr (int, sc, out) For key=1 * 0 = ``knmi`` is undefined. @@ -344,7 +344,7 @@ def lsinqr(self, line, key, pname='__tmpvar__', **kwargs): Returns ------- - lsinqr : (int, sc, out) + lsinqr (int, sc, out) For key=1 * 0 = ``lnmi`` is undefined. @@ -432,7 +432,7 @@ def arinqr(self, anmi, key, pname='__tmpvar__', **kwargs): Returns ------- - arinqr : (int, sc, out) + arinqr (int, sc, out) For key=1 * 0 = ``anmi`` is undefined. @@ -505,7 +505,7 @@ def vlinqr(self, vnmi, key, pname='__tmpvar__', **kwargs): Returns ------- - vlinqr : (int, sc, out) + vlinqr (int, sc, out) For key=1 * 0 = ``vnmi`` is undefined. @@ -560,7 +560,7 @@ def rlinqr(self, nreal, key, pname='__tmpvar__', **kwargs): Returns ------- - rlinqr : (int, func, out) + rlinqr (int, func, out) The returned value of ``rlinqr`` is based on setting of key. """ @@ -599,7 +599,7 @@ def gapiqr(self, ngap, key, pname='__tmpvar__', **kwargs): Returns ------- - gapiqr : (int, sc, out) + gapiqr (int, sc, out) Returned data is based on setting of key. """ return self.run(f"{pname} = gapiqr({ngap}, {key})", **kwargs) @@ -640,10 +640,10 @@ def masiqr(self, node, key, pname='__tmpvar__', **kwargs): Returns ------- - variable : (typ, siz, intent) + variable (typ, siz, intent) Description - masiqr : (int, sc, out) + masiqr (int, sc, out) Returned data is based on setting of key. """ return self.run(f"{pname} = masiqr({node}, {key})", **kwargs) @@ -695,7 +695,7 @@ def ceinqr(self, nce, key, pname='__tmpvar__', **kwargs): Returns ------- - ceinqr : (int, func, out) + ceinqr (int, func, out) The returned value of ``ceinqr`` is based on setting of key """ return self.run(f"{pname} = ceinqr({nce}, {key})", **kwargs) @@ -749,7 +749,7 @@ def cpinqr(self, ncp, key, pname='__tmpvar__', **kwargs): Returns ------- - cpinqr : (int, func, out) + cpinqr (int, func, out) The returned value of ``cpinqr`` is based on setting of key. """ @@ -791,7 +791,7 @@ def csyiqr(self, ncsy, key, pname='__tmpvar__', **kwargs): Returns ------- - csyiqr : (int, func, out) + csyiqr (int, func, out) The returned value of ``csyiqr`` is based on setting of key. """ return self.run(f"{pname} = csyiqr({ncsy}, {key})", **kwargs) @@ -840,7 +840,7 @@ def etyiqr(self, itype, key, pname='__tmpvar__', **kwargs): Returns ------- - etyiqr : (int, func, out) + etyiqr (int, func, out) The returned value of ``etyiqr`` is based on setting of key. """ return self.run(f"{pname} = etyiqr({itype}, {key})", **kwargs) @@ -877,7 +877,7 @@ def foriqr(self, node, key, pname='__tmpvar__', **kwargs): Returns ------- - foriqr : (int, func, out) + foriqr (int, func, out) The returned value of ``foriqr`` is based on setting of key. """ return self.run(f"{pname} = foriqr({node}, {key})", **kwargs) @@ -909,7 +909,8 @@ def sectinqr(self, nsect, key, pname='__tmpvar__', **kwargs): Returns ------- - for key = 1 + sectinqr + for key = 1 * = 0, section id table is undefined. * = -1, section id table is unselected. * = 1, section id table is selected @@ -987,7 +988,7 @@ def mpinqr(self, mat, iprop, key, pname='__tmpvar__', **kwargs): Returns ------- - mpinqr : (int, func, out) + mpinqr (int, func, out) Returned value of ``mpinqr`` is based on setting of key. """ @@ -1045,7 +1046,7 @@ def dget(self, node, idf, kcmplx, pname='__tmpvar__', **kwargs): Returns ------- - dget : (dp, sc, out) + dget (dp, sc, out) Constraint value (High number if undefined) """ return self.run(f"{pname} = dget({node}, {idf}, {kcmplx})", **kwargs) @@ -1102,7 +1103,7 @@ def fget(self, node, idf, kcmplx, pname='__tmpvar__', **kwargs): Returns ------- - fget : (dp, sc, out) + fget (dp, sc, out) Force value (High number if undefined) """ return self.run(f"{pname} = fget({node}, {idf}, {kcmplx})", **kwargs) @@ -1246,7 +1247,7 @@ def erinqr(self, key, pname='__tmpvar__', **kwargs): Returns ------- - erinqr : (int, sc, out) + erinqr (int, sc, out) Value corresponding to key. """ From 2cf1c55b49e82c50667d398a8edf524ac743f4d2 Mon Sep 17 00:00:00 2001 From: German Date: Mon, 3 Jan 2022 18:50:33 +0100 Subject: [PATCH 10/29] Style fixing. --- ansys/mapdl/core/_commands/inq_func.py | 43 +++++++++++++------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/ansys/mapdl/core/_commands/inq_func.py b/ansys/mapdl/core/_commands/inq_func.py index bb345f75c9..8a6bf2f107 100644 --- a/ansys/mapdl/core/_commands/inq_func.py +++ b/ansys/mapdl/core/_commands/inq_func.py @@ -52,8 +52,8 @@ def ndinqr(self, node, key, pname='__tmpvar__', **kwargs): * = -10, internal node flag * = -11, orientation node flag =1 is =0 is not * = -11, contact node flag <0 - * = -12, constraint bit pattern (for DSYM) - * = -13, if dof constraint written to file.k (for LSDYNA only) + * = -12, constraint bit pattern (for ``DSYM``) + * = -13, if dof constraint written to file.k (for ``LSDYNA`` only) * = -14, nodal coordinate system number (set by ``NROTATE``) * =-101, pointer to node data record * =-102, pointer to angle record @@ -131,7 +131,7 @@ def elmiqr(self, ielem, key, pname='__tmpvar__', **kwargs): * = 1 - double precision * = 2 - real * = 3 - complex - * = 4 - character*8 + * = 4 - character\*8 * = 7 - index * = 19 - return virtual type of file. @@ -168,8 +168,7 @@ def kpinqr(self, knmi, key, pname='__tmpvar__', **kwargs): """Get information about a keypoints. **Secondary Functions:** - Set current keypoints pointer to this - keypoints. + Set current keypoints pointer to this keypoints. .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. Hence its support is limited and it use is not encoraged. @@ -212,7 +211,7 @@ def kpinqr(self, knmi, key, pname='__tmpvar__', **kwargs): * = 1 - double precision * = 2 - real * = 3 - complex - * = 4 - character*8 + * = 4 - character\*8 * = 7 - index * = 19 - return virtual type of file. @@ -480,7 +479,7 @@ def vlinqr(self, vnmi, key, pname='__tmpvar__', **kwargs): * = -6, number of elements. * = -7, pointer to volume in foreign db * = -8, element shape. - * = -9, (section id)*10 + 2 + * = -9, (section id)\*10 + 2 * = -10, element coordinate system. * = -11, KZ2 - 2nd kpt for elem Z * = -12, color and translucancy packed @@ -732,13 +731,13 @@ def cpinqr(self, ncp, key, pname='__tmpvar__', **kwargs): coupled set * = ``DB_MAXRECLENG`` - return length of largest coupled set record (max record length) - * = 2 - return length (data units) - * = 3 - return layer number - * = 4 - return address of first data word - * = 5 - return number of values stored for ncp - * = 11 - return void percent (integer) - * = 16 - return location of next record - * = -1 - return master node for this eqn (this is + * = 2 - return length (data units) + * = 3 - return layer number + * = 4 - return address of first data word + * = 5 - return number of values stored for ncp + * = 11 - return void percent (integer) + * = 16 - return location of next record + * = -1 - return master node for this eqn (this is currently only used by solution DB object) pname : str @@ -776,8 +775,8 @@ def csyiqr(self, ncsy, key, pname='__tmpvar__', **kwargs): * = ``DB_SELECTED`` - return status: * = 0 - coordinate system is not defined - * -1 - coordinate system is not selected - * 1 - coordinate system is selected + * = -1 - coordinate system is not selected + * = 1 - coordinate system is selected * = ``DB_NUMDEFINED`` - number of defined coordinate systems * = ``DB_MAXDEFINED`` - maximum coordinate system reference @@ -829,8 +828,8 @@ def etyiqr(self, itype, key, pname='__tmpvar__', **kwargs): type itype. ``n`` is correlated to the parameter names in ``echprm``. see ``elccmt`` for definitions of element characteristics. - note- this will not overwrite the current setting of - ``etycom``. + + .. note:: This will not overwrite the current setting of ``etycom``. pname : str Name of the variable where the queried value is stored. @@ -1136,7 +1135,7 @@ def erinqr(self, key, pname='__tmpvar__', **kwargs): * 7 = maxmsg (ER_MAXMESSAGE) Max allowed number of displayed messages before abort. * 8 = lvlerr (ER_ERRORLEVEL) - Used basicly in solution (from cnvr command.) + Used basicly in solution (from ``cnvr`` command.) * -1 = do not set keyerr for notes/errors/warnings. * -2 = same as -1 but do not display message either. @@ -1175,10 +1174,10 @@ def erinqr(self, key, pname='__tmpvar__', **kwargs): * 1 = perform all keyopt tests also flag to bypass setting of _STATUS upon resume * 16 = mxr4r5 (ER_MIXEDREV) - mixed rev4-rev5 input logic (*do,*if, *go, *if-go) + mixed rev4-rev5 input logic (\*do,\*if, \*go, \*if-go) - * 1 = rev5 found (*do,*fi-then-*endif) - * 2 = rev4 found (*go,:xxx,*if, ...., :xxx) + * 1 = rev5 found (\*do,\*fi-then-\*endif) + * 2 = rev4 found (\*go,:xxx,\*if, ...., :xxx) * 3 = warning printed. do not issue any more. * 17 = mshkey (ER_MESHING) From f0d353da0b76ed3c0b0a395b05cfb2ee9dae77d8 Mon Sep 17 00:00:00 2001 From: German Date: Mon, 3 Jan 2022 18:52:35 +0100 Subject: [PATCH 11/29] Spelling typos. --- ansys/mapdl/core/_commands/inq_func.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ansys/mapdl/core/_commands/inq_func.py b/ansys/mapdl/core/_commands/inq_func.py index 8a6bf2f107..8d33c7f4e5 100644 --- a/ansys/mapdl/core/_commands/inq_func.py +++ b/ansys/mapdl/core/_commands/inq_func.py @@ -671,11 +671,11 @@ def ceinqr(self, nce, key, pname='__tmpvar__', **kwargs): * = 0 - equation is undefined * =-1 - equation is unselected - * = ``DB_NUMDEFINED`` - return number of defined contraint equations - * = ``DB_NUMSELECTED`` - return number of selected contraint equations + * = ``DB_NUMDEFINED`` - return number of defined constraint equations + * = ``DB_NUMSELECTED`` - return number of selected constraint equations * = ``DB_MAXDEFINED`` - return number of highest numbered constraint equation defined - * = ``DB_MAXRECLENG`` - return length of longest contraint equation set + * = ``DB_MAXRECLENG`` - return length of longest constraint equation set (max record length) * = 2 - return length (data units) * = 3 - return layer number @@ -1135,7 +1135,7 @@ def erinqr(self, key, pname='__tmpvar__', **kwargs): * 7 = maxmsg (ER_MAXMESSAGE) Max allowed number of displayed messages before abort. * 8 = lvlerr (ER_ERRORLEVEL) - Used basicly in solution (from ``cnvr`` command.) + Used basically in solution (from ``cnvr`` command.) * -1 = do not set keyerr for notes/errors/warnings. * -2 = same as -1 but do not display message either. @@ -1149,7 +1149,7 @@ def erinqr(self, key, pname='__tmpvar__', **kwargs): * -1 = message is timed before removal * 0 = message needs pick or keyboard before removal - * 1 = message stays up untill replaced by another message + * 1 = message stays up until replaced by another message * 12 = nomore (ER_NOMOREMSG) Display no more messages From 9486a57bae1c329280a306badb14117c2d0c8e96 Mon Sep 17 00:00:00 2001 From: German Date: Mon, 3 Jan 2022 19:14:39 +0100 Subject: [PATCH 12/29] Fxing test for non-grpc modes. --- tests/test_commands.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_commands.py b/tests/test_commands.py index 2fb55ad82d..3b3e773c91 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -50,4 +50,9 @@ def test_inquire_functions(mapdl, func): func_ = getattr(mapdl, func) func_args = inspect.getfullargspec(func_).args args = [ARGS_INQ_FUNC[each_arg] for each_arg in func_args if each_arg not in ['self']] - assert any(isinstance(func_(*args), (float, int))) + output = func_(*args) + if 'GRPC' in mapdl._name: + assert isinstance(output, (float, int)) + else: + assert isinstance(output, str) + assert '=' in output From 8d64031686bda72f1eb0884c620926ec2de7ab89 Mon Sep 17 00:00:00 2001 From: German Date: Mon, 3 Jan 2022 19:14:52 +0100 Subject: [PATCH 13/29] Fixing gramamr and format. --- ansys/mapdl/core/_commands/inq_func.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ansys/mapdl/core/_commands/inq_func.py b/ansys/mapdl/core/_commands/inq_func.py index 8d33c7f4e5..e01a092e00 100644 --- a/ansys/mapdl/core/_commands/inq_func.py +++ b/ansys/mapdl/core/_commands/inq_func.py @@ -604,7 +604,7 @@ def gapiqr(self, ngap, key, pname='__tmpvar__', **kwargs): return self.run(f"{pname} = gapiqr({ngap}, {key})", **kwargs) def masiqr(self, node, key, pname='__tmpvar__', **kwargs): - """Get information about masters. + """Get information about masters nodes. .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. Hence its support is limited and it use is not encoraged. @@ -648,7 +648,7 @@ def masiqr(self, node, key, pname='__tmpvar__', **kwargs): return self.run(f"{pname} = masiqr({node}, {key})", **kwargs) def ceinqr(self, nce, key, pname='__tmpvar__', **kwargs): - """Get information about a constraint equation set + """Get information about a constraint equation set. .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. Hence its support is limited and it use is not encoraged. @@ -755,7 +755,7 @@ def cpinqr(self, ncp, key, pname='__tmpvar__', **kwargs): return self.run(f"{pname} = cpinqr({ncp}, {key})", **kwargs) def csyiqr(self, ncsy, key, pname='__tmpvar__', **kwargs): - """Get information about a coordinate system + """Get information about a coordinate system. .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. Hence its support is limited and it use is not encoraged. @@ -910,6 +910,7 @@ def sectinqr(self, nsect, key, pname='__tmpvar__', **kwargs): ------- sectinqr for key = 1 + * = 0, section id table is undefined. * = -1, section id table is unselected. * = 1, section id table is selected @@ -994,7 +995,7 @@ def mpinqr(self, mat, iprop, key, pname='__tmpvar__', **kwargs): return self.run(f"{pname} = mpinqr({mat, iprop}, { key})", **kwargs) def dget(self, node, idf, kcmplx, pname='__tmpvar__', **kwargs): - """Get a constraint from the data bsae + """Get a constraint from the data base. .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. Hence its support is limited and it use is not encoraged. @@ -1051,7 +1052,7 @@ def dget(self, node, idf, kcmplx, pname='__tmpvar__', **kwargs): return self.run(f"{pname} = dget({node}, {idf}, {kcmplx})", **kwargs) def fget(self, node, idf, kcmplx, pname='__tmpvar__', **kwargs): - """Get a force from the data bsae + """Get a force load from the data base. .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. Hence its support is limited and it use is not encoraged. @@ -1108,7 +1109,7 @@ def fget(self, node, idf, kcmplx, pname='__tmpvar__', **kwargs): return self.run(f"{pname} = fget({node}, {idf}, {kcmplx})", **kwargs) def erinqr(self, key, pname='__tmpvar__', **kwargs): - """Obtain information from errors common + """Obtain information from common errors. .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. Hence its support is limited and it use is not encoraged. From c90392be8632e136989cfc7afaa85392a7152864 Mon Sep 17 00:00:00 2001 From: German Date: Mon, 3 Jan 2022 19:21:37 +0100 Subject: [PATCH 14/29] Fixing `mpinqr` func. --- ansys/mapdl/core/_commands/inq_func.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ansys/mapdl/core/_commands/inq_func.py b/ansys/mapdl/core/_commands/inq_func.py index e01a092e00..6633089057 100644 --- a/ansys/mapdl/core/_commands/inq_func.py +++ b/ansys/mapdl/core/_commands/inq_func.py @@ -891,10 +891,11 @@ def sectinqr(self, nsect, key, pname='__tmpvar__', **kwargs): Parameters ---------- - nsect + nsect : int Section id table number, it should be 0 for key = 12, 13, 14. - key - information flag + key : int + information flag * = 1, select status * = 12, return number of defined section id tables * = 13, return number of selected section id tables @@ -992,7 +993,7 @@ def mpinqr(self, mat, iprop, key, pname='__tmpvar__', **kwargs): Returned value of ``mpinqr`` is based on setting of key. """ - return self.run(f"{pname} = mpinqr({mat, iprop}, { key})", **kwargs) + return self.run(f"{pname} = mpinqr({mat}, {iprop}, {key})", **kwargs) def dget(self, node, idf, kcmplx, pname='__tmpvar__', **kwargs): """Get a constraint from the data base. From a8d0a3c19fe6e35b8e8c48fa73cfab871bcf35b9 Mon Sep 17 00:00:00 2001 From: German Date: Mon, 3 Jan 2022 19:49:19 +0100 Subject: [PATCH 15/29] Updated doc string of sectinqr with the command comments. --- ansys/mapdl/core/_commands/inq_func.py | 56 +++++++++++++++++++------- 1 file changed, 41 insertions(+), 15 deletions(-) diff --git a/ansys/mapdl/core/_commands/inq_func.py b/ansys/mapdl/core/_commands/inq_func.py index 6633089057..a06b4204a2 100644 --- a/ansys/mapdl/core/_commands/inq_func.py +++ b/ansys/mapdl/core/_commands/inq_func.py @@ -882,7 +882,7 @@ def foriqr(self, node, key, pname='__tmpvar__', **kwargs): return self.run(f"{pname} = foriqr({node}, {key})", **kwargs) def sectinqr(self, nsect, key, pname='__tmpvar__', **kwargs): - """Get information about a section property. + """Get information about a section id set. .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. Hence its support is limited and it use is not encoraged. @@ -891,15 +891,45 @@ def sectinqr(self, nsect, key, pname='__tmpvar__', **kwargs): Parameters ---------- - nsect : int - Section id table number, it should be 0 for key = 12, 13, 14. + variable : (typ,siz,intent) + Description - key : int - information flag - * = 1, select status - * = 12, return number of defined section id tables - * = 13, return number of selected section id tables - * = 14, return highest section id table defined + nsect : (int,sc,in) + Section id table number + should be 0 for key=11, ``DB_NUMDEFINED``, + ``DB_NUMSELECTED``, ``DB_MAXDEFINED``, and + ``DB_MAXRECLENG``. + + key : (int,sc,in) + Information flag. + * = DB_SELECTED - return select status + * = 0 - ection id table is undefined. + * =-1 - section id table is unselected. + * = 1 - section id table is selected + * = ``DB_NUMDEFINED`` - return number of defined section id tables + * = ``DB_NUMSELECTED`` - return number of selected section id tables + * = ``DB_MAXDEFINED`` - return highest section id table defined + * = ``DB_MAXRECLENG`` - return maximum record length (dp words) + * = 2 - return length (dp words) + * = 3 - return layer number (for cross reference files return number of entities) + * = 4 - return address of first data word + * = 5 - return length (in record type units) + * = 6 - return compressed record number. + * = 11 - return void percent (integer) + * = 16 - return location of next record (this increments the next record count) + * = 18 - return type of file. + * = 0 - integer + * = 1 - double precision + * = 2 - real + * = 3 - complex + * = 4 - character*8 + * = 7 - index + * = 19 - return virtual type of file. + * = 0 - fixed length (4.4 form) + * = 1 - indexed variable length (layer data) + * = 2 - xref data tables + * = 3 - bitmap data (for 32 data item packed records) + * = 4 - data tables (three dimensional arrays) pname : str Name of the variable where the queried value is stored. @@ -909,12 +939,8 @@ def sectinqr(self, nsect, key, pname='__tmpvar__', **kwargs): Returns ------- - sectinqr - for key = 1 - - * = 0, section id table is undefined. - * = -1, section id table is unselected. - * = 1, section id table is selected + sectinqr (int,func,out) + The returned value of sectinqr is based on setting of key. """ return self.run(f"{pname} = sectinqr({nsect}, {key})", **kwargs) From 93363e7ac0f767a143d1983d2e416cb1ada13f86 Mon Sep 17 00:00:00 2001 From: German Date: Mon, 3 Jan 2022 19:53:08 +0100 Subject: [PATCH 16/29] Using `scalar_param` instead of using our own request. --- ansys/mapdl/core/mapdl_grpc.py | 76 +++++++++++++++++----------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/ansys/mapdl/core/mapdl_grpc.py b/ansys/mapdl/core/mapdl_grpc.py index e3948a33ee..c7b9416d35 100755 --- a/ansys/mapdl/core/mapdl_grpc.py +++ b/ansys/mapdl/core/mapdl_grpc.py @@ -1889,150 +1889,150 @@ def _distributed(self) -> bool: def ndinqr(self, node, key, **kwargs): """Wrap the ``ndinqr`` method to take advantage of the gRPC methods.""" _ = super().ndinqr(node, key, pname='__tmpvar__', **kwargs) - presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + value = self.scalar_param(self, '__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter - return presponse.val[0] + return value @wraps(_MapdlCore.elmiqr) def elmiqr(self, ielem, key, **kwargs): """Wrap the ``elmiqr`` method to take advantage of the gRPC methods.""" _ = super().elmiqr(ielem, key, pname='__tmpvar__', **kwargs) - presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + value = self.scalar_param(self, '__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter - return presponse.val[0] + return value @wraps(_MapdlCore.kpinqr) def kpinqr(self, knmi, key, **kwargs): """Wrap the ``kpinqr`` method to take advantage of the gRPC methods.""" _ = super().kpinqr(knmi, key, pname='__tmpvar__', **kwargs) - presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + value = self.scalar_param(self, '__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter - return presponse.val[0] + return value @wraps(_MapdlCore.lsinqr) def lsinqr(self, line, key, **kwargs): """Wrap the ``lsinqr`` method to take advantage of the gRPC methods.""" _ = super().lsinqr(line, key, pname='__tmpvar__', **kwargs) - presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + value = self.scalar_param(self, '__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter - return presponse.val[0] + return value @wraps(_MapdlCore.arinqr) def arinqr(self, anmi, key, **kwargs): """Wrap the ``arinqr`` method to take advantage of the gRPC methods.""" _ = super().arinqr(anmi, key, pname='__tmpvar__', **kwargs) - presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + value = self.scalar_param(self, '__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter - return presponse.val[0] + return value @wraps(_MapdlCore.vlinqr) def vlinqr(self, vnmi, key, **kwargs): """Wrap the ``vlinqr`` method to take advantage of the gRPC methods.""" _ = super().vlinqr(vnmi, key, pname='__tmpvar__', **kwargs) - presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + value = self.scalar_param(self, '__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter - return presponse.val[0] + return value @wraps(_MapdlCore.rlinqr) def rlinqr(self, nreal, key, **kwargs): """Wrap the ``rlinqr`` method to take advantage of the gRPC methods.""" _ = super().rlinqr(nreal, key, pname='__tmpvar__', **kwargs) - presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + value = self.scalar_param(self, '__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter - return presponse.val[0] + return value @wraps(_MapdlCore.gapiqr) def gapiqr(self, ngap, key, **kwargs): """Wrap the ``gapiqr`` method to take advantage of the gRPC methods.""" _ = super().gapiqr(ngap, key, pname='__tmpvar__', **kwargs) - presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + value = self.scalar_param(self, '__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter - return presponse.val[0] + return value @wraps(_MapdlCore.masiqr) def masiqr(self, node, key, **kwargs): """Wrap the ``masiqr`` method to take advantage of the gRPC methods.""" _ = super().masiqr(node, key, pname='__tmpvar__', **kwargs) - presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + value = self.scalar_param(self, '__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter - return presponse.val[0] + return value @wraps(_MapdlCore.ceinqr) def ceinqr(self, nce, key, **kwargs): """Wrap the ``ceinqr`` method to take advantage of the gRPC methods.""" _ = super().ceinqr(nce, key, pname='__tmpvar__', **kwargs) - presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + value = self.scalar_param(self, '__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter - return presponse.val[0] + return value @wraps(_MapdlCore.cpinqr) def cpinqr(self, ncp, key, **kwargs): """Wrap the ``cpinqr`` method to take advantage of the gRPC methods.""" _ = super().cpinqr(ncp, key, pname='__tmpvar__', **kwargs) - presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + value = self.scalar_param(self, '__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter - return presponse.val[0] + return value @wraps(_MapdlCore.csyiqr) def csyiqr(self, ncsy, key, **kwargs): """Wrap the ``csyiqr`` method to take advantage of the gRPC methods.""" _ = super().csyiqr(ncsy, key, pname='__tmpvar__', **kwargs) - presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + value = self.scalar_param(self, '__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter - return presponse.val[0] + return value @wraps(_MapdlCore.etyiqr) def etyiqr(self, itype, key, **kwargs): """Wrap the ``etyiqr`` method to take advantage of the gRPC methods.""" _ = super().etyiqr(itype, key, pname='__tmpvar__', **kwargs) - presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + value = self.scalar_param(self, '__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter - return presponse.val[0] + return value @wraps(_MapdlCore.foriqr) def foriqr(self, node, key, **kwargs): """Wrap the ``foriqr`` method to take advantage of the gRPC methods.""" _ = super().foriqr(node, key, pname='__tmpvar__', **kwargs) - presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + value = self.scalar_param(self, '__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter - return presponse.val[0] + return value @wraps(_MapdlCore.sectinqr) def sectinqr(self, nsect, key, **kwargs): """Wrap the ``sectinqr`` method to take advantage of the gRPC methods.""" _ = super().sectinqr(nsect, key, pname='__tmpvar__', **kwargs) - presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + value = self.scalar_param(self, '__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter - return presponse.val[0] + return value @wraps(_MapdlCore.mpinqr) def mpinqr(self, mat, iprop, key, **kwargs): """Wrap the ``mpinqr`` method to take advantage of the gRPC methods.""" _ = super().mpinqr(mat, iprop, key, pname='__tmpvar__', **kwargs) - presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + value = self.scalar_param(self, '__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter - return presponse.val[0] + return value @wraps(_MapdlCore.dget) def dget(self, node, idf, kcmplx, **kwargs): """Wrap the ``dget`` method to take advantage of the gRPC methods.""" _ = super().dget(node, idf, kcmplx, pname='__tmpvar__', **kwargs) - presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + value = self.scalar_param(self, '__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter - return presponse.val[0] + return value @wraps(_MapdlCore.fget) def fget(self, node, idf, kcmplx, **kwargs): """Wrap the ``fget`` method to take advantage of the gRPC methods.""" _ = super().fget(node, idf, kcmplx, pname='__tmpvar__', **kwargs) - presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + value = self.scalar_param(self, '__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter - return presponse.val[0] + return value @wraps(_MapdlCore.erinqr) def erinqr(self, key, **kwargs): """Wrap the ``erinqr`` method to take advantage of the gRPC methods.""" _ = super().erinqr(key, pname='__tmpvar__', **kwargs) - presponse = self._stub.GetParameter(pb_types.ParameterRequest(name='__tmpvar__', array=False)) + value = self.scalar_param(self, '__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter - return presponse.val[0] + return value From 30a7eff1270d5cf548c5d6247724b4ed9e986551 Mon Sep 17 00:00:00 2001 From: German Date: Mon, 3 Jan 2022 21:58:42 +0100 Subject: [PATCH 17/29] Removing extra self. --- ansys/mapdl/core/mapdl_grpc.py | 38 +++++++++++++++++----------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/ansys/mapdl/core/mapdl_grpc.py b/ansys/mapdl/core/mapdl_grpc.py index c7b9416d35..ff9b34621a 100755 --- a/ansys/mapdl/core/mapdl_grpc.py +++ b/ansys/mapdl/core/mapdl_grpc.py @@ -1889,7 +1889,7 @@ def _distributed(self) -> bool: def ndinqr(self, node, key, **kwargs): """Wrap the ``ndinqr`` method to take advantage of the gRPC methods.""" _ = super().ndinqr(node, key, pname='__tmpvar__', **kwargs) - value = self.scalar_param(self, '__tmpvar__') + value = self.scalar_param('__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter return value @@ -1897,7 +1897,7 @@ def ndinqr(self, node, key, **kwargs): def elmiqr(self, ielem, key, **kwargs): """Wrap the ``elmiqr`` method to take advantage of the gRPC methods.""" _ = super().elmiqr(ielem, key, pname='__tmpvar__', **kwargs) - value = self.scalar_param(self, '__tmpvar__') + value = self.scalar_param('__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter return value @@ -1905,7 +1905,7 @@ def elmiqr(self, ielem, key, **kwargs): def kpinqr(self, knmi, key, **kwargs): """Wrap the ``kpinqr`` method to take advantage of the gRPC methods.""" _ = super().kpinqr(knmi, key, pname='__tmpvar__', **kwargs) - value = self.scalar_param(self, '__tmpvar__') + value = self.scalar_param('__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter return value @@ -1913,7 +1913,7 @@ def kpinqr(self, knmi, key, **kwargs): def lsinqr(self, line, key, **kwargs): """Wrap the ``lsinqr`` method to take advantage of the gRPC methods.""" _ = super().lsinqr(line, key, pname='__tmpvar__', **kwargs) - value = self.scalar_param(self, '__tmpvar__') + value = self.scalar_param('__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter return value @@ -1921,7 +1921,7 @@ def lsinqr(self, line, key, **kwargs): def arinqr(self, anmi, key, **kwargs): """Wrap the ``arinqr`` method to take advantage of the gRPC methods.""" _ = super().arinqr(anmi, key, pname='__tmpvar__', **kwargs) - value = self.scalar_param(self, '__tmpvar__') + value = self.scalar_param('__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter return value @@ -1929,7 +1929,7 @@ def arinqr(self, anmi, key, **kwargs): def vlinqr(self, vnmi, key, **kwargs): """Wrap the ``vlinqr`` method to take advantage of the gRPC methods.""" _ = super().vlinqr(vnmi, key, pname='__tmpvar__', **kwargs) - value = self.scalar_param(self, '__tmpvar__') + value = self.scalar_param('__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter return value @@ -1937,7 +1937,7 @@ def vlinqr(self, vnmi, key, **kwargs): def rlinqr(self, nreal, key, **kwargs): """Wrap the ``rlinqr`` method to take advantage of the gRPC methods.""" _ = super().rlinqr(nreal, key, pname='__tmpvar__', **kwargs) - value = self.scalar_param(self, '__tmpvar__') + value = self.scalar_param('__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter return value @@ -1945,7 +1945,7 @@ def rlinqr(self, nreal, key, **kwargs): def gapiqr(self, ngap, key, **kwargs): """Wrap the ``gapiqr`` method to take advantage of the gRPC methods.""" _ = super().gapiqr(ngap, key, pname='__tmpvar__', **kwargs) - value = self.scalar_param(self, '__tmpvar__') + value = self.scalar_param('__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter return value @@ -1953,7 +1953,7 @@ def gapiqr(self, ngap, key, **kwargs): def masiqr(self, node, key, **kwargs): """Wrap the ``masiqr`` method to take advantage of the gRPC methods.""" _ = super().masiqr(node, key, pname='__tmpvar__', **kwargs) - value = self.scalar_param(self, '__tmpvar__') + value = self.scalar_param('__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter return value @@ -1961,7 +1961,7 @@ def masiqr(self, node, key, **kwargs): def ceinqr(self, nce, key, **kwargs): """Wrap the ``ceinqr`` method to take advantage of the gRPC methods.""" _ = super().ceinqr(nce, key, pname='__tmpvar__', **kwargs) - value = self.scalar_param(self, '__tmpvar__') + value = self.scalar_param('__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter return value @@ -1969,7 +1969,7 @@ def ceinqr(self, nce, key, **kwargs): def cpinqr(self, ncp, key, **kwargs): """Wrap the ``cpinqr`` method to take advantage of the gRPC methods.""" _ = super().cpinqr(ncp, key, pname='__tmpvar__', **kwargs) - value = self.scalar_param(self, '__tmpvar__') + value = self.scalar_param('__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter return value @@ -1977,7 +1977,7 @@ def cpinqr(self, ncp, key, **kwargs): def csyiqr(self, ncsy, key, **kwargs): """Wrap the ``csyiqr`` method to take advantage of the gRPC methods.""" _ = super().csyiqr(ncsy, key, pname='__tmpvar__', **kwargs) - value = self.scalar_param(self, '__tmpvar__') + value = self.scalar_param('__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter return value @@ -1985,7 +1985,7 @@ def csyiqr(self, ncsy, key, **kwargs): def etyiqr(self, itype, key, **kwargs): """Wrap the ``etyiqr`` method to take advantage of the gRPC methods.""" _ = super().etyiqr(itype, key, pname='__tmpvar__', **kwargs) - value = self.scalar_param(self, '__tmpvar__') + value = self.scalar_param('__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter return value @@ -1993,7 +1993,7 @@ def etyiqr(self, itype, key, **kwargs): def foriqr(self, node, key, **kwargs): """Wrap the ``foriqr`` method to take advantage of the gRPC methods.""" _ = super().foriqr(node, key, pname='__tmpvar__', **kwargs) - value = self.scalar_param(self, '__tmpvar__') + value = self.scalar_param('__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter return value @@ -2001,7 +2001,7 @@ def foriqr(self, node, key, **kwargs): def sectinqr(self, nsect, key, **kwargs): """Wrap the ``sectinqr`` method to take advantage of the gRPC methods.""" _ = super().sectinqr(nsect, key, pname='__tmpvar__', **kwargs) - value = self.scalar_param(self, '__tmpvar__') + value = self.scalar_param('__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter return value @@ -2009,7 +2009,7 @@ def sectinqr(self, nsect, key, **kwargs): def mpinqr(self, mat, iprop, key, **kwargs): """Wrap the ``mpinqr`` method to take advantage of the gRPC methods.""" _ = super().mpinqr(mat, iprop, key, pname='__tmpvar__', **kwargs) - value = self.scalar_param(self, '__tmpvar__') + value = self.scalar_param('__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter return value @@ -2017,7 +2017,7 @@ def mpinqr(self, mat, iprop, key, **kwargs): def dget(self, node, idf, kcmplx, **kwargs): """Wrap the ``dget`` method to take advantage of the gRPC methods.""" _ = super().dget(node, idf, kcmplx, pname='__tmpvar__', **kwargs) - value = self.scalar_param(self, '__tmpvar__') + value = self.scalar_param('__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter return value @@ -2025,7 +2025,7 @@ def dget(self, node, idf, kcmplx, **kwargs): def fget(self, node, idf, kcmplx, **kwargs): """Wrap the ``fget`` method to take advantage of the gRPC methods.""" _ = super().fget(node, idf, kcmplx, pname='__tmpvar__', **kwargs) - value = self.scalar_param(self, '__tmpvar__') + value = self.scalar_param('__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter return value @@ -2033,6 +2033,6 @@ def fget(self, node, idf, kcmplx, **kwargs): def erinqr(self, key, **kwargs): """Wrap the ``erinqr`` method to take advantage of the gRPC methods.""" _ = super().erinqr(key, pname='__tmpvar__', **kwargs) - value = self.scalar_param(self, '__tmpvar__') + value = self.scalar_param('__tmpvar__') self._run('__tmpvar__=') # Deleting temp parameter return value From e42469f110e9e05c771bce196babe941b76393d0 Mon Sep 17 00:00:00 2001 From: German Date: Mon, 3 Jan 2022 23:02:34 +0100 Subject: [PATCH 18/29] Applying code review. --- ansys/mapdl/core/mapdl_grpc.py | 133 +++++++++++++++++++-------------- tests/test_commands.py | 1 + 2 files changed, 77 insertions(+), 57 deletions(-) diff --git a/ansys/mapdl/core/mapdl_grpc.py b/ansys/mapdl/core/mapdl_grpc.py index ff9b34621a..c52f58d19e 100755 --- a/ansys/mapdl/core/mapdl_grpc.py +++ b/ansys/mapdl/core/mapdl_grpc.py @@ -1888,151 +1888,170 @@ def _distributed(self) -> bool: @wraps(_MapdlCore.ndinqr) def ndinqr(self, node, key, **kwargs): """Wrap the ``ndinqr`` method to take advantage of the gRPC methods.""" - _ = super().ndinqr(node, key, pname='__tmpvar__', **kwargs) - value = self.scalar_param('__tmpvar__') - self._run('__tmpvar__=') # Deleting temp parameter + pname = '__tmpvar__' + super().ndinqr(node, key, pname=pname, mute=True, **kwargs) + value = self.scalar_param(pname) + self._run(f'{pname}=') # Deleting temp parameter return value @wraps(_MapdlCore.elmiqr) def elmiqr(self, ielem, key, **kwargs): """Wrap the ``elmiqr`` method to take advantage of the gRPC methods.""" - _ = super().elmiqr(ielem, key, pname='__tmpvar__', **kwargs) - value = self.scalar_param('__tmpvar__') - self._run('__tmpvar__=') # Deleting temp parameter + pname = '__tmpvar__' + super().elmiqr(ielem, key, pname=pname, mute=True, **kwargs) + value = self.scalar_param(pname) + self._run(f'{pname}=') # Deleting temp parameter return value @wraps(_MapdlCore.kpinqr) def kpinqr(self, knmi, key, **kwargs): """Wrap the ``kpinqr`` method to take advantage of the gRPC methods.""" - _ = super().kpinqr(knmi, key, pname='__tmpvar__', **kwargs) - value = self.scalar_param('__tmpvar__') - self._run('__tmpvar__=') # Deleting temp parameter + pname = '__tmpvar__' + super().kpinqr(knmi, key, pname=pname, mute=True, **kwargs) + value = self.scalar_param(pname) + self._run(f'{pname}=') # Deleting temp parameter return value @wraps(_MapdlCore.lsinqr) def lsinqr(self, line, key, **kwargs): """Wrap the ``lsinqr`` method to take advantage of the gRPC methods.""" - _ = super().lsinqr(line, key, pname='__tmpvar__', **kwargs) - value = self.scalar_param('__tmpvar__') - self._run('__tmpvar__=') # Deleting temp parameter + pname = '__tmpvar__' + super().lsinqr(line, key, pname=pname, mute=True, **kwargs) + value = self.scalar_param(pname) + self._run(f'{pname}=') # Deleting temp parameter return value @wraps(_MapdlCore.arinqr) def arinqr(self, anmi, key, **kwargs): """Wrap the ``arinqr`` method to take advantage of the gRPC methods.""" - _ = super().arinqr(anmi, key, pname='__tmpvar__', **kwargs) - value = self.scalar_param('__tmpvar__') - self._run('__tmpvar__=') # Deleting temp parameter + pname = '__tmpvar__' + super().arinqr(anmi, key, pname=pname, mute=True, **kwargs) + value = self.scalar_param(pname) + self._run(f'{pname}=') # Deleting temp parameter return value @wraps(_MapdlCore.vlinqr) def vlinqr(self, vnmi, key, **kwargs): """Wrap the ``vlinqr`` method to take advantage of the gRPC methods.""" - _ = super().vlinqr(vnmi, key, pname='__tmpvar__', **kwargs) - value = self.scalar_param('__tmpvar__') - self._run('__tmpvar__=') # Deleting temp parameter + pname = '__tmpvar__' + super().vlinqr(vnmi, key, pname=pname, mute=True, **kwargs) + value = self.scalar_param(pname) + self._run(f'{pname}=') # Deleting temp parameter return value @wraps(_MapdlCore.rlinqr) def rlinqr(self, nreal, key, **kwargs): """Wrap the ``rlinqr`` method to take advantage of the gRPC methods.""" - _ = super().rlinqr(nreal, key, pname='__tmpvar__', **kwargs) - value = self.scalar_param('__tmpvar__') - self._run('__tmpvar__=') # Deleting temp parameter + pname = '__tmpvar__' + super().rlinqr(nreal, key, pname=pname, mute=True, **kwargs) + value = self.scalar_param(pname) + self._run(f'{pname}=') # Deleting temp parameter return value @wraps(_MapdlCore.gapiqr) def gapiqr(self, ngap, key, **kwargs): """Wrap the ``gapiqr`` method to take advantage of the gRPC methods.""" - _ = super().gapiqr(ngap, key, pname='__tmpvar__', **kwargs) - value = self.scalar_param('__tmpvar__') - self._run('__tmpvar__=') # Deleting temp parameter + pname = '__tmpvar__' + super().gapiqr(ngap, key, pname=pname, mute=True, **kwargs) + value = self.scalar_param(pname) + self._run(f'{pname}=') # Deleting temp parameter return value @wraps(_MapdlCore.masiqr) def masiqr(self, node, key, **kwargs): """Wrap the ``masiqr`` method to take advantage of the gRPC methods.""" - _ = super().masiqr(node, key, pname='__tmpvar__', **kwargs) - value = self.scalar_param('__tmpvar__') - self._run('__tmpvar__=') # Deleting temp parameter + pname = '__tmpvar__' + super().masiqr(node, key, pname=pname, mute=True, **kwargs) + value = self.scalar_param(pname) + self._run(f'{pname}=') # Deleting temp parameter return value @wraps(_MapdlCore.ceinqr) def ceinqr(self, nce, key, **kwargs): """Wrap the ``ceinqr`` method to take advantage of the gRPC methods.""" - _ = super().ceinqr(nce, key, pname='__tmpvar__', **kwargs) - value = self.scalar_param('__tmpvar__') - self._run('__tmpvar__=') # Deleting temp parameter + pname = '__tmpvar__' + super().ceinqr(nce, key, pname=pname, mute=True, **kwargs) + value = self.scalar_param(pname) + self._run(f'{pname}=') # Deleting temp parameter return value @wraps(_MapdlCore.cpinqr) def cpinqr(self, ncp, key, **kwargs): """Wrap the ``cpinqr`` method to take advantage of the gRPC methods.""" - _ = super().cpinqr(ncp, key, pname='__tmpvar__', **kwargs) - value = self.scalar_param('__tmpvar__') - self._run('__tmpvar__=') # Deleting temp parameter + pname = '__tmpvar__' + super().cpinqr(ncp, key, pname=pname, mute=True, **kwargs) + value = self.scalar_param(pname) + self._run(f'{pname}=') # Deleting temp parameter return value @wraps(_MapdlCore.csyiqr) def csyiqr(self, ncsy, key, **kwargs): """Wrap the ``csyiqr`` method to take advantage of the gRPC methods.""" - _ = super().csyiqr(ncsy, key, pname='__tmpvar__', **kwargs) - value = self.scalar_param('__tmpvar__') - self._run('__tmpvar__=') # Deleting temp parameter + pname = '__tmpvar__' + super().csyiqr(ncsy, key, pname=pname, mute=True, **kwargs) + value = self.scalar_param(pname) + self._run(f'{pname}=') # Deleting temp parameter return value @wraps(_MapdlCore.etyiqr) def etyiqr(self, itype, key, **kwargs): """Wrap the ``etyiqr`` method to take advantage of the gRPC methods.""" - _ = super().etyiqr(itype, key, pname='__tmpvar__', **kwargs) - value = self.scalar_param('__tmpvar__') - self._run('__tmpvar__=') # Deleting temp parameter + pname = '__tmpvar__' + super().etyiqr(itype, key, pname=pname, mute=True, **kwargs) + value = self.scalar_param(pname) + self._run(f'{pname}=') # Deleting temp parameter return value @wraps(_MapdlCore.foriqr) def foriqr(self, node, key, **kwargs): """Wrap the ``foriqr`` method to take advantage of the gRPC methods.""" - _ = super().foriqr(node, key, pname='__tmpvar__', **kwargs) - value = self.scalar_param('__tmpvar__') - self._run('__tmpvar__=') # Deleting temp parameter + pname = '__tmpvar__' + super().foriqr(node, key, pname=pname, mute=True, **kwargs) + value = self.scalar_param(pname) + self._run(f'{pname}=') # Deleting temp parameter return value @wraps(_MapdlCore.sectinqr) def sectinqr(self, nsect, key, **kwargs): """Wrap the ``sectinqr`` method to take advantage of the gRPC methods.""" - _ = super().sectinqr(nsect, key, pname='__tmpvar__', **kwargs) - value = self.scalar_param('__tmpvar__') - self._run('__tmpvar__=') # Deleting temp parameter + pname = '__tmpvar__' + super().sectinqr(nsect, key, pname=pname, mute=True, **kwargs) + value = self.scalar_param(pname) + self._run(f'{pname}=') # Deleting temp parameter return value @wraps(_MapdlCore.mpinqr) def mpinqr(self, mat, iprop, key, **kwargs): """Wrap the ``mpinqr`` method to take advantage of the gRPC methods.""" - _ = super().mpinqr(mat, iprop, key, pname='__tmpvar__', **kwargs) - value = self.scalar_param('__tmpvar__') - self._run('__tmpvar__=') # Deleting temp parameter + pname = '__tmpvar__' + super().mpinqr(mat, iprop, key, pname=pname, mute=True, **kwargs) + value = self.scalar_param(pname) + self._run(f'{pname}=') # Deleting temp parameter return value @wraps(_MapdlCore.dget) def dget(self, node, idf, kcmplx, **kwargs): """Wrap the ``dget`` method to take advantage of the gRPC methods.""" - _ = super().dget(node, idf, kcmplx, pname='__tmpvar__', **kwargs) - value = self.scalar_param('__tmpvar__') - self._run('__tmpvar__=') # Deleting temp parameter + pname = '__tmpvar__' + super().dget(node, idf, kcmplx, pname=pname, mute=True, **kwargs) + value = self.scalar_param(pname) + self._run(f'{pname}=') # Deleting temp parameter return value @wraps(_MapdlCore.fget) def fget(self, node, idf, kcmplx, **kwargs): """Wrap the ``fget`` method to take advantage of the gRPC methods.""" - _ = super().fget(node, idf, kcmplx, pname='__tmpvar__', **kwargs) - value = self.scalar_param('__tmpvar__') - self._run('__tmpvar__=') # Deleting temp parameter + pname = '__tmpvar__' + super().fget(node, idf, kcmplx, pname=pname, mute=True, **kwargs) + value = self.scalar_param(pname) + self._run(f'{pname}=') # Deleting temp parameter return value @wraps(_MapdlCore.erinqr) def erinqr(self, key, **kwargs): """Wrap the ``erinqr`` method to take advantage of the gRPC methods.""" - _ = super().erinqr(key, pname='__tmpvar__', **kwargs) - value = self.scalar_param('__tmpvar__') - self._run('__tmpvar__=') # Deleting temp parameter + pname = '__tmpvar__' + super().erinqr(key, pname=pname, mute=True, **kwargs) + value = self.scalar_param(pname) + self._run(f'{pname}=') # Deleting temp parameter return value diff --git a/tests/test_commands.py b/tests/test_commands.py index 3b3e773c91..861d101a6a 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -45,6 +45,7 @@ 'idf': 1, 'kcmplx': 1 } + @pytest.mark.parametrize("func", LIST_OF_INQUIRE_FUNCTIONS) def test_inquire_functions(mapdl, func): func_ = getattr(mapdl, func) From 005344947298f483241f9de78c78965655319c50 Mon Sep 17 00:00:00 2001 From: German Date: Tue, 4 Jan 2022 01:04:25 +0100 Subject: [PATCH 19/29] Removing parameter deletion. --- ansys/mapdl/core/mapdl_grpc.py | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/ansys/mapdl/core/mapdl_grpc.py b/ansys/mapdl/core/mapdl_grpc.py index c52f58d19e..8eccffcdc6 100755 --- a/ansys/mapdl/core/mapdl_grpc.py +++ b/ansys/mapdl/core/mapdl_grpc.py @@ -1891,7 +1891,6 @@ def ndinqr(self, node, key, **kwargs): pname = '__tmpvar__' super().ndinqr(node, key, pname=pname, mute=True, **kwargs) value = self.scalar_param(pname) - self._run(f'{pname}=') # Deleting temp parameter return value @wraps(_MapdlCore.elmiqr) @@ -1900,7 +1899,6 @@ def elmiqr(self, ielem, key, **kwargs): pname = '__tmpvar__' super().elmiqr(ielem, key, pname=pname, mute=True, **kwargs) value = self.scalar_param(pname) - self._run(f'{pname}=') # Deleting temp parameter return value @wraps(_MapdlCore.kpinqr) @@ -1909,7 +1907,6 @@ def kpinqr(self, knmi, key, **kwargs): pname = '__tmpvar__' super().kpinqr(knmi, key, pname=pname, mute=True, **kwargs) value = self.scalar_param(pname) - self._run(f'{pname}=') # Deleting temp parameter return value @wraps(_MapdlCore.lsinqr) @@ -1918,7 +1915,6 @@ def lsinqr(self, line, key, **kwargs): pname = '__tmpvar__' super().lsinqr(line, key, pname=pname, mute=True, **kwargs) value = self.scalar_param(pname) - self._run(f'{pname}=') # Deleting temp parameter return value @wraps(_MapdlCore.arinqr) @@ -1927,7 +1923,6 @@ def arinqr(self, anmi, key, **kwargs): pname = '__tmpvar__' super().arinqr(anmi, key, pname=pname, mute=True, **kwargs) value = self.scalar_param(pname) - self._run(f'{pname}=') # Deleting temp parameter return value @wraps(_MapdlCore.vlinqr) @@ -1936,7 +1931,6 @@ def vlinqr(self, vnmi, key, **kwargs): pname = '__tmpvar__' super().vlinqr(vnmi, key, pname=pname, mute=True, **kwargs) value = self.scalar_param(pname) - self._run(f'{pname}=') # Deleting temp parameter return value @wraps(_MapdlCore.rlinqr) @@ -1945,7 +1939,6 @@ def rlinqr(self, nreal, key, **kwargs): pname = '__tmpvar__' super().rlinqr(nreal, key, pname=pname, mute=True, **kwargs) value = self.scalar_param(pname) - self._run(f'{pname}=') # Deleting temp parameter return value @wraps(_MapdlCore.gapiqr) @@ -1954,7 +1947,6 @@ def gapiqr(self, ngap, key, **kwargs): pname = '__tmpvar__' super().gapiqr(ngap, key, pname=pname, mute=True, **kwargs) value = self.scalar_param(pname) - self._run(f'{pname}=') # Deleting temp parameter return value @wraps(_MapdlCore.masiqr) @@ -1963,7 +1955,6 @@ def masiqr(self, node, key, **kwargs): pname = '__tmpvar__' super().masiqr(node, key, pname=pname, mute=True, **kwargs) value = self.scalar_param(pname) - self._run(f'{pname}=') # Deleting temp parameter return value @wraps(_MapdlCore.ceinqr) @@ -1972,7 +1963,6 @@ def ceinqr(self, nce, key, **kwargs): pname = '__tmpvar__' super().ceinqr(nce, key, pname=pname, mute=True, **kwargs) value = self.scalar_param(pname) - self._run(f'{pname}=') # Deleting temp parameter return value @wraps(_MapdlCore.cpinqr) @@ -1981,7 +1971,6 @@ def cpinqr(self, ncp, key, **kwargs): pname = '__tmpvar__' super().cpinqr(ncp, key, pname=pname, mute=True, **kwargs) value = self.scalar_param(pname) - self._run(f'{pname}=') # Deleting temp parameter return value @wraps(_MapdlCore.csyiqr) @@ -1990,7 +1979,6 @@ def csyiqr(self, ncsy, key, **kwargs): pname = '__tmpvar__' super().csyiqr(ncsy, key, pname=pname, mute=True, **kwargs) value = self.scalar_param(pname) - self._run(f'{pname}=') # Deleting temp parameter return value @wraps(_MapdlCore.etyiqr) @@ -1999,7 +1987,6 @@ def etyiqr(self, itype, key, **kwargs): pname = '__tmpvar__' super().etyiqr(itype, key, pname=pname, mute=True, **kwargs) value = self.scalar_param(pname) - self._run(f'{pname}=') # Deleting temp parameter return value @wraps(_MapdlCore.foriqr) @@ -2008,7 +1995,6 @@ def foriqr(self, node, key, **kwargs): pname = '__tmpvar__' super().foriqr(node, key, pname=pname, mute=True, **kwargs) value = self.scalar_param(pname) - self._run(f'{pname}=') # Deleting temp parameter return value @wraps(_MapdlCore.sectinqr) @@ -2017,7 +2003,6 @@ def sectinqr(self, nsect, key, **kwargs): pname = '__tmpvar__' super().sectinqr(nsect, key, pname=pname, mute=True, **kwargs) value = self.scalar_param(pname) - self._run(f'{pname}=') # Deleting temp parameter return value @wraps(_MapdlCore.mpinqr) @@ -2026,7 +2011,6 @@ def mpinqr(self, mat, iprop, key, **kwargs): pname = '__tmpvar__' super().mpinqr(mat, iprop, key, pname=pname, mute=True, **kwargs) value = self.scalar_param(pname) - self._run(f'{pname}=') # Deleting temp parameter return value @wraps(_MapdlCore.dget) @@ -2035,7 +2019,6 @@ def dget(self, node, idf, kcmplx, **kwargs): pname = '__tmpvar__' super().dget(node, idf, kcmplx, pname=pname, mute=True, **kwargs) value = self.scalar_param(pname) - self._run(f'{pname}=') # Deleting temp parameter return value @wraps(_MapdlCore.fget) @@ -2044,7 +2027,6 @@ def fget(self, node, idf, kcmplx, **kwargs): pname = '__tmpvar__' super().fget(node, idf, kcmplx, pname=pname, mute=True, **kwargs) value = self.scalar_param(pname) - self._run(f'{pname}=') # Deleting temp parameter return value @wraps(_MapdlCore.erinqr) @@ -2053,5 +2035,4 @@ def erinqr(self, key, **kwargs): pname = '__tmpvar__' super().erinqr(key, pname=pname, mute=True, **kwargs) value = self.scalar_param(pname) - self._run(f'{pname}=') # Deleting temp parameter return value From 7804855ee747e4863efdd65e647da3bf78f5b69b Mon Sep 17 00:00:00 2001 From: German Date: Tue, 4 Jan 2022 16:39:44 +0100 Subject: [PATCH 20/29] Applying code review. --- ansys/mapdl/core/mapdl_grpc.py | 154 +++++++++++++-------------------- 1 file changed, 58 insertions(+), 96 deletions(-) diff --git a/ansys/mapdl/core/mapdl_grpc.py b/ansys/mapdl/core/mapdl_grpc.py index 8eccffcdc6..d913afba67 100755 --- a/ansys/mapdl/core/mapdl_grpc.py +++ b/ansys/mapdl/core/mapdl_grpc.py @@ -65,7 +65,7 @@ from ansys.mapdl.core import __version__, _LOCAL_PORTS from ansys.mapdl.core import check_version - +TMP_VAR = '__tmpvar__' VOID_REQUEST = anskernel.EmptyRequest() # Default 256 MB message length @@ -1886,153 +1886,115 @@ def _distributed(self) -> bool: return self.__distributed @wraps(_MapdlCore.ndinqr) - def ndinqr(self, node, key, **kwargs): + def ndinqr(self, *args, **kwargs): """Wrap the ``ndinqr`` method to take advantage of the gRPC methods.""" - pname = '__tmpvar__' - super().ndinqr(node, key, pname=pname, mute=True, **kwargs) - value = self.scalar_param(pname) - return value + super().ndinqr(*args, pname=TMP_VAR, mute=True, **kwargs) + return self.scalar_param(TMP_VAR) @wraps(_MapdlCore.elmiqr) - def elmiqr(self, ielem, key, **kwargs): + def elmiqr(self, *args, **kwargs): """Wrap the ``elmiqr`` method to take advantage of the gRPC methods.""" - pname = '__tmpvar__' - super().elmiqr(ielem, key, pname=pname, mute=True, **kwargs) - value = self.scalar_param(pname) - return value + super().elmiqr(*args, pname=TMP_VAR, mute=True, **kwargs) + return self.scalar_param(TMP_VAR) @wraps(_MapdlCore.kpinqr) - def kpinqr(self, knmi, key, **kwargs): + def kpinqr(self, *args, **kwargs): """Wrap the ``kpinqr`` method to take advantage of the gRPC methods.""" - pname = '__tmpvar__' - super().kpinqr(knmi, key, pname=pname, mute=True, **kwargs) - value = self.scalar_param(pname) - return value + super().kpinqr(*args, pname=TMP_VAR, mute=True, **kwargs) + return self.scalar_param(TMP_VAR) @wraps(_MapdlCore.lsinqr) - def lsinqr(self, line, key, **kwargs): + def lsinqr(self, *args, **kwargs): """Wrap the ``lsinqr`` method to take advantage of the gRPC methods.""" - pname = '__tmpvar__' - super().lsinqr(line, key, pname=pname, mute=True, **kwargs) - value = self.scalar_param(pname) - return value + super().lsinqr(*args, pname=TMP_VAR, mute=True, **kwargs) + return self.scalar_param(TMP_VAR) @wraps(_MapdlCore.arinqr) - def arinqr(self, anmi, key, **kwargs): + def arinqr(self, *args, **kwargs): """Wrap the ``arinqr`` method to take advantage of the gRPC methods.""" - pname = '__tmpvar__' - super().arinqr(anmi, key, pname=pname, mute=True, **kwargs) - value = self.scalar_param(pname) - return value + super().arinqr(*args, pname=TMP_VAR, mute=True, **kwargs) + return self.scalar_param(TMP_VAR) @wraps(_MapdlCore.vlinqr) - def vlinqr(self, vnmi, key, **kwargs): + def vlinqr(self, *args, **kwargs): """Wrap the ``vlinqr`` method to take advantage of the gRPC methods.""" - pname = '__tmpvar__' - super().vlinqr(vnmi, key, pname=pname, mute=True, **kwargs) - value = self.scalar_param(pname) - return value + super().vlinqr(*args, pname=TMP_VAR, mute=True, **kwargs) + return self.scalar_param(TMP_VAR) @wraps(_MapdlCore.rlinqr) - def rlinqr(self, nreal, key, **kwargs): + def rlinqr(self, *args, **kwargs): """Wrap the ``rlinqr`` method to take advantage of the gRPC methods.""" - pname = '__tmpvar__' - super().rlinqr(nreal, key, pname=pname, mute=True, **kwargs) - value = self.scalar_param(pname) - return value + super().rlinqr(*args, pname=TMP_VAR, mute=True, **kwargs) + return self.scalar_param(TMP_VAR) @wraps(_MapdlCore.gapiqr) - def gapiqr(self, ngap, key, **kwargs): + def gapiqr(self, *args, **kwargs): """Wrap the ``gapiqr`` method to take advantage of the gRPC methods.""" - pname = '__tmpvar__' - super().gapiqr(ngap, key, pname=pname, mute=True, **kwargs) - value = self.scalar_param(pname) - return value + super().gapiqr(*args, pname=TMP_VAR, mute=True, **kwargs) + return self.scalar_param(TMP_VAR) @wraps(_MapdlCore.masiqr) - def masiqr(self, node, key, **kwargs): + def masiqr(self, *args, **kwargs): """Wrap the ``masiqr`` method to take advantage of the gRPC methods.""" - pname = '__tmpvar__' - super().masiqr(node, key, pname=pname, mute=True, **kwargs) - value = self.scalar_param(pname) - return value + super().masiqr(*args, pname=TMP_VAR, mute=True, **kwargs) + return self.scalar_param(TMP_VAR) @wraps(_MapdlCore.ceinqr) - def ceinqr(self, nce, key, **kwargs): + def ceinqr(self, *args, **kwargs): """Wrap the ``ceinqr`` method to take advantage of the gRPC methods.""" - pname = '__tmpvar__' - super().ceinqr(nce, key, pname=pname, mute=True, **kwargs) - value = self.scalar_param(pname) - return value + super().ceinqr(*args, pname=TMP_VAR, mute=True, **kwargs) + return self.scalar_param(TMP_VAR) @wraps(_MapdlCore.cpinqr) - def cpinqr(self, ncp, key, **kwargs): + def cpinqr(self, *args, **kwargs): """Wrap the ``cpinqr`` method to take advantage of the gRPC methods.""" - pname = '__tmpvar__' - super().cpinqr(ncp, key, pname=pname, mute=True, **kwargs) - value = self.scalar_param(pname) - return value + super().cpinqr(*args, pname=TMP_VAR, mute=True, **kwargs) + return self.scalar_param(TMP_VAR) @wraps(_MapdlCore.csyiqr) - def csyiqr(self, ncsy, key, **kwargs): + def csyiqr(self, *args, **kwargs): """Wrap the ``csyiqr`` method to take advantage of the gRPC methods.""" - pname = '__tmpvar__' - super().csyiqr(ncsy, key, pname=pname, mute=True, **kwargs) - value = self.scalar_param(pname) - return value + super().csyiqr(*args, pname=TMP_VAR, mute=True, **kwargs) + return self.scalar_param(TMP_VAR) @wraps(_MapdlCore.etyiqr) - def etyiqr(self, itype, key, **kwargs): + def etyiqr(self, *args, **kwargs): """Wrap the ``etyiqr`` method to take advantage of the gRPC methods.""" - pname = '__tmpvar__' - super().etyiqr(itype, key, pname=pname, mute=True, **kwargs) - value = self.scalar_param(pname) - return value + super().etyiqr(*args, pname=TMP_VAR, mute=True, **kwargs) + return self.scalar_param(TMP_VAR) @wraps(_MapdlCore.foriqr) - def foriqr(self, node, key, **kwargs): + def foriqr(self, *args, **kwargs): """Wrap the ``foriqr`` method to take advantage of the gRPC methods.""" - pname = '__tmpvar__' - super().foriqr(node, key, pname=pname, mute=True, **kwargs) - value = self.scalar_param(pname) - return value + super().foriqr(*args, pname=TMP_VAR, mute=True, **kwargs) + return self.scalar_param(TMP_VAR) @wraps(_MapdlCore.sectinqr) - def sectinqr(self, nsect, key, **kwargs): + def sectinqr(self, *args, **kwargs): """Wrap the ``sectinqr`` method to take advantage of the gRPC methods.""" - pname = '__tmpvar__' - super().sectinqr(nsect, key, pname=pname, mute=True, **kwargs) - value = self.scalar_param(pname) - return value + super().sectinqr(*args, pname=TMP_VAR, mute=True, **kwargs) + return self.scalar_param(TMP_VAR) @wraps(_MapdlCore.mpinqr) - def mpinqr(self, mat, iprop, key, **kwargs): + def mpinqr(self, *args, key, **kwargs): """Wrap the ``mpinqr`` method to take advantage of the gRPC methods.""" - pname = '__tmpvar__' - super().mpinqr(mat, iprop, key, pname=pname, mute=True, **kwargs) - value = self.scalar_param(pname) - return value + super().mpinqr(*args, key, pname=TMP_VAR, mute=True, **kwargs) + return self.scalar_param(TMP_VAR) @wraps(_MapdlCore.dget) - def dget(self, node, idf, kcmplx, **kwargs): + def dget(self, *args, **kwargs): """Wrap the ``dget`` method to take advantage of the gRPC methods.""" - pname = '__tmpvar__' - super().dget(node, idf, kcmplx, pname=pname, mute=True, **kwargs) - value = self.scalar_param(pname) - return value + super().dget(*args, pname=TMP_VAR, mute=True, **kwargs) + return self.scalar_param(TMP_VAR) @wraps(_MapdlCore.fget) - def fget(self, node, idf, kcmplx, **kwargs): + def fget(self, *args, **kwargs): """Wrap the ``fget`` method to take advantage of the gRPC methods.""" - pname = '__tmpvar__' - super().fget(node, idf, kcmplx, pname=pname, mute=True, **kwargs) - value = self.scalar_param(pname) - return value + super().fget(*args, pname=TMP_VAR, mute=True, **kwargs) + return self.scalar_param(TMP_VAR) @wraps(_MapdlCore.erinqr) - def erinqr(self, key, **kwargs): + def erinqr(self, *args, **kwargs): """Wrap the ``erinqr`` method to take advantage of the gRPC methods.""" - pname = '__tmpvar__' - super().erinqr(key, pname=pname, mute=True, **kwargs) - value = self.scalar_param(pname) - return value + super().erinqr(*args, pname=TMP_VAR, mute=True, **kwargs) + return self.scalar_param(TMP_VAR) From 9e557f19a669091982db4a03140a3cf74155b3c8 Mon Sep 17 00:00:00 2001 From: German Date: Tue, 4 Jan 2022 17:22:10 +0100 Subject: [PATCH 21/29] Implementing code review suggestions. --- ansys/mapdl/core/_commands/inq_func.py | 1033 ++++++++++++------------ tests/test_commands.py | 4 +- 2 files changed, 517 insertions(+), 520 deletions(-) diff --git a/ansys/mapdl/core/_commands/inq_func.py b/ansys/mapdl/core/_commands/inq_func.py index a06b4204a2..4741592f55 100644 --- a/ansys/mapdl/core/_commands/inq_func.py +++ b/ansys/mapdl/core/_commands/inq_func.py @@ -8,69 +8,69 @@ def ndinqr(self, node, key, pname='__tmpvar__', **kwargs): **Secondary Functions:** Set current node pointer to this node. - .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. - Hence its support is limited and it use is not encoraged. - + .. warning:: **DISCLAIMER**: This function is un-documented in the + official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encouraged. **Please use it with caution.** Parameters ---------- - node : (int, sc, in) + node : int or str node number. It should be 0 for key=11, ``DB_NUMDEFINED``, ``DB_NUMSELECTED``, ``DB_MAXDEFINED``, and ``DB_MAXRECLENG``. - key : (int, sc, in) + key : int or str key as to information needed about the node. - * = DB_SELECTED - return select status: - - * = 0 - node is undefined. - * = -1 - node is unselected. - * = 1 - node is selected. - - * = ``DB_NUMDEFINED`` - return number of defined nodes - * = ``DB_NUMSELECTED`` - return number of selected nodes - * = ``DB_MAXDEFINED`` - return highest node number defined - * = ``DB_MAXRECLENG`` - return maximum record length (dp words) - * = 2, return length (dp words) - * = 3, - * = 4, pointer to first data word - * = 11, return void percent (integer) - * = 17, pointer to start of index - * = 117, return the maximum number of DP contact data stored for any node - * = -1, - * = -2, superelement flag - * = -3, master dof bit pattern - * = -4, active dof bit pattern - * = -5, solid model attachment - * = -6, pack nodal line parametric value - * = -7, constraint bit pattern - * = -8, force bit pattern - * = -9, body force bit pattern - * = -10, internal node flag - * = -11, orientation node flag =1 is =0 is not - * = -11, contact node flag <0 - * = -12, constraint bit pattern (for ``DSYM``) - * = -13, if dof constraint written to file.k (for ``LSDYNA`` only) - * = -14, nodal coordinate system number (set by ``NROTATE``) - * =-101, pointer to node data record - * =-102, pointer to angle record - * =-103, - * =-104, pointer to attached couplings - * =-105, pointer to attacted constraint equations - * =-106, pointer to nodal stresses - * =-107, pointer to specified disp'S - * =-108, pointer to specified forces - * =-109, pointer to x/y/z record - * =-110, - * =-111, - * =-112, pointer to nodal temperatures - * =-113, pointer to nodal heat generations - * =-114, - * =-115, pointer to calculated displacements - * =-116 + * DB_SELECTED - return select status: + + * 0 - node is undefined. + * -1 - node is unselected. + * 1 - node is selected. + + * ``DB_NUMDEFINED`` - return number of defined nodes + * ``DB_NUMSELECTED`` - return number of selected nodes + * ``DB_MAXDEFINED`` - return highest node number defined + * ``DB_MAXRECLENG`` - return maximum record length (dp words) + * 2, return length (dp words) + * 3, + * 4, pointer to first data word + * 11, return void percent (integer) + * 17, pointer to start of index + * 117, return the maximum number of DP contact data stored for any node + * -1, + * -2, superelement flag + * -3, master dof bit pattern + * -4, active dof bit pattern + * -5, solid model attachment + * -6, pack nodal line parametric value + * -7, constraint bit pattern + * -8, force bit pattern + * -9, body force bit pattern + * -10, internal node flag + * -11, orientation node flag =1 is =0 is not + * -11, contact node flag <0 + * -12, constraint bit pattern (for ``DSYM``) + * -13, if dof constraint written to file.k (for ``LSDYNA`` only) + * -14, nodal coordinate system number (set by ``NROTATE``) + * -101, pointer to node data record + * -102, pointer to angle record + * -103, + * -104, pointer to attached couplings + * -105, pointer to attacted constraint equations + * -106, pointer to nodal stresses + * -107, pointer to specified disp'S + * -108, pointer to specified forces + * -109, pointer to x/y/z record + * -110, + * -111, + * -112, pointer to nodal temperatures + * -113, pointer to nodal heat generations + * -114, + * -115, pointer to calculated displacements + * -116 pname : str Name of the variable where the queried value is stored. @@ -80,7 +80,7 @@ def ndinqr(self, node, key, pname='__tmpvar__', **kwargs): Returns ------- - ndinqr (int, func, out) + str, int, or float The returned value of ``ndinqr`` is based on setting of key. """ return self.run(f"{pname} = ndinqr({node}, {key})", **kwargs) @@ -91,65 +91,65 @@ def elmiqr(self, ielem, key, pname='__tmpvar__', **kwargs): **Secondary Functions:** Set current element pointer to this element. - .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. - Hence its support is limited and it use is not encoraged. - + .. warning:: **DISCLAIMER**: This function is un-documented in the + official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encouraged. **Please use it with caution.** Parameters ---------- - ielem : (int, sc, in) + ielem : int or str Element number. It should be zero for key=11, ``DB_NUMDEFINED``, ``DB_NUMSELECTED``, ``DB_MAXDEFINED``, ``DB_MAXRECLENG``, or 199 - key : (int, sc, in) + key : int or str information flag. - * = DB_SELECTED - return select status: (1) - - * = 0 - element is undefined. - * =-1 - element is unselected. - * = 1 - element is selected. - - * = ``DB_NUMDEFINED`` - return number of defined elements (12) - * = ``DB_NUMSELECTED`` - return number of selected elements (13) - * = ``DB_MAXDEFINED`` - return maximum element number used (14) - * = ``DB_MAXRECLENG`` - return maximum record length (15) - * = 2 - return length (int words) - * = 3 - return layer number (for cross reference files return number of entities) - * = 4 - return address of first data word - * = 5 - return length (in record type units) - * = 6 - return compressed record number. - * = 11 - return void percent (integer) - * = 16 - return location of next record (this increments the next record count) - * = 17 - pointer to start of index - * = 18 - return type of file. - - * = 0 - integer - * = 1 - double precision - * = 2 - real - * = 3 - complex - * = 4 - character\*8 - * = 7 - index - - * = 19 - return virtual type of file. - - * = 0 - fixed length (4.4 form) - * = 1 - indexed variable length (layer data) - * = 2 - xref data tables - * = 3 - bitmap data (for 32 data item packed records) - * = 4 - data tables (three dimensional arrays) - - * = 111 - return the maximum number of nodes stored for any element - * = 123 - return the maximum number of DP contact data stored for any element - * = -1 - material number ( = -EL_MAT) - * = -2 - element type ( = -EL_TYPE) - * = -3 - real constant number ( = -EL_REAL) - * = -4 - element section ID number ( = -EL_SECT) - * = -5 - coordinate system number ( = -EL_CSYS) - * =-101 - pointer to element integers etc. + * DB_SELECTED - return select status: (1) + + * 0 - element is undefined. + * -1 - element is unselected. + * 1 - element is selected. + + * ``DB_NUMDEFINED`` - return number of defined elements (12) + * ``DB_NUMSELECTED`` - return number of selected elements (13) + * ``DB_MAXDEFINED`` - return maximum element number used (14) + * ``DB_MAXRECLENG`` - return maximum record length (15) + * 2 - return length (int words) + * 3 - return layer number (for cross reference files return number of entities) + * 4 - return address of first data word + * 5 - return length (in record type units) + * 6 - return compressed record number. + * 11 - return void percent (integer) + * 16 - return location of next record (this increments the next record count) + * 17 - pointer to start of index + * 18 - return type of file. + + * 0 - integer + * 1 - double precision + * 2 - real + * 3 - complex + * 4 - character\*8 + * 7 - index + + * 19 - return virtual type of file. + + * 0 - fixed length (4.4 form) + * 1 - indexed variable length (layer data) + * 2 - xref data tables + * 3 - bitmap data (for 32 data item packed records) + * 4 - data tables (three dimensional arrays) + + * 111 - return the maximum number of nodes stored for any element + * 123 - return the maximum number of DP contact data stored for any element + * -1 - material number ( = -EL_MAT) + * -2 - element type ( = -EL_TYPE) + * -3 - real constant number ( = -EL_REAL) + * -4 - element section ID number ( = -EL_SECT) + * -5 - coordinate system number ( = -EL_CSYS) + * -101 - pointer to element integers etc. pname : str Name of the variable where the queried value is stored. @@ -159,7 +159,7 @@ def elmiqr(self, ielem, key, pname='__tmpvar__', **kwargs): Returns ------- - elmiqr (int, sc, out) + int or str The returned value of ``elmiqr`` is based on setting of key. """ return self.run(f"{pname} = elmiqr({ielem}, {key})", **kwargs) @@ -170,85 +170,85 @@ def kpinqr(self, knmi, key, pname='__tmpvar__', **kwargs): **Secondary Functions:** Set current keypoints pointer to this keypoints. - .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. - Hence its support is limited and it use is not encoraged. - + .. warning:: **DISCLAIMER**: This function is un-documented in the + official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encouraged. **Please use it with caution.** Parameters ---------- - knmi : (int, sc, in) + knmi : int or str Keypoints for inquire. may be 0 for key=11 thru 15. - key : (int, sc, in) + key : int or str Information flag. - * = 1 - return select + * 1 - return select - * = -1 - unselected - * = 0 - undefined - * = 1 - selected + * -1 - unselected + * 0 - undefined + * 1 - selected - * = 2 - return length (data units) - * = 3 - return layer number + * 2 - return length (data units) + * 3 - return layer number (for cross reference files return number of entities) - * = 4 - return address of first data word - * = 5 - return length (in record type units) - * = 6 - return compressed record number. - * = 11 - return void percent (integer) - * = 12 - return number of defined - * = 13 - return number of selected - * = 14 - return highest number defined - * = 15 - return maximum record length + * 4 - return address of first data word + * 5 - return length (in record type units) + * 6 - return compressed record number. + * 11 - return void percent (integer) + * 12 - return number of defined + * 13 - return number of selected + * 14 - return highest number defined + * 15 - return maximum record length (data units) - * = 16 - return location of next record + * 16 - return location of next record (this increments the next record count) - * = 18 - return type of file. + * 18 - return type of file. - * = 0 - integer - * = 1 - double precision - * = 2 - real - * = 3 - complex - * = 4 - character\*8 - * = 7 - index + * 0 - integer + * 1 - double precision + * 2 - real + * 3 - complex + * 4 - character\*8 + * 7 - index - * = 19 - return virtual type of file. + * 19 - return virtual type of file. - * = 0 - fixed length (4.4 form) - * = 1 - indexed variable length + * 0 - fixed length (4.4 form) + * 1 - indexed variable length (layer data) - * = 2 - xref data tables - * = 3 - bitmap data (for 32 data + * 2 - xref data tables + * 3 - bitmap data (for 32 data item packed records) - * = 4 - data tables (three + * 4 - data tables (three dimensional arrays) - * = -1, material number - * = -2, type - * = -3, real number - * = -4, node number, if meshed - * = -5, pointer to attached point - * = -6, esys number - * = -7, element number, if meshed - * = -8, Hardpoint stuff - * = -9, area number associated with hardpoint - * = -10, line number associated with hardpoint - * = -11, Orientation kp flag - * = -12, local integer workspace - * = -101, pointer to keypoint data - * = -102, pointer to keypoint fluences - * = -103, pointer to keypoint moisture content - * = -104, pointer to keypoint voltage - * = -105, pointer to keypoint current density - * = -106, pointer to keypoint heat generations - * = -107, pointer to keypoint virtual displacements - * = -108, pointer to parameter data - * = -109, pointer to keypoint temperatures - * = -110, pointer to keypoint displacements - * = -111, pointer to keypoint forces - * = -112, pointer to line list + * -1, material number + * -2, type + * -3, real number + * -4, node number, if meshed + * -5, pointer to attached point + * -6, esys number + * -7, element number, if meshed + * -8, Hardpoint stuff + * -9, area number associated with hardpoint + * -10, line number associated with hardpoint + * -11, Orientation kp flag + * -12, local integer workspace + * -101, pointer to keypoint data + * -102, pointer to keypoint fluences + * -103, pointer to keypoint moisture content + * -104, pointer to keypoint voltage + * -105, pointer to keypoint current density + * -106, pointer to keypoint heat generations + * -107, pointer to keypoint virtual displacements + * -108, pointer to parameter data + * -109, pointer to keypoint temperatures + * -110, pointer to keypoint displacements + * -111, pointer to keypoint forces + * -112, pointer to line list pname : str Name of the variable where the queried value is stored. @@ -258,7 +258,7 @@ def kpinqr(self, knmi, key, pname='__tmpvar__', **kwargs): Returns ------- - kpinqr (int, sc, out) + int or str For key=1 * 0 = ``knmi`` is undefined. @@ -273,67 +273,67 @@ def kpinqr(self, knmi, key, pname='__tmpvar__', **kwargs): def lsinqr(self, line, key, pname='__tmpvar__', **kwargs): """Get information about a line segment. - .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. - Hence its support is limited and it use is not encoraged. - + .. warning:: **DISCLAIMER**: This function is un-documented in the + official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encouraged. **Please use it with caution.** Parameters ---------- - lnmi : (int, sc, in) + lnmi : int or str Line segment for inquire. It should be 0 for key=11 thru 15. - key : (dp, sc, in) + key : float or str key as to information needed about the ``lnmi``. - * = 1, return select - * = 2, return length (data units) - * = 3, - * = 11, return void percent (integer) - * = 12 return number of defined - * = 13, return number of selected - * = 14, return highest number defined - * = 15, return maximum record length + * 1, return select + * 2, return length (data units) + * 3, + * 11, return void percent (integer) + * 12 return number of defined + * 13, return number of selected + * 14, return highest number defined + * 15, return maximum record length (data units) - * = 16, return location of next record + * 16, return location of next record (this increments the next record count) - * = 17, return next record from offset - * = -1, material number - * = -2, type - * = -3, real number - * = -4, number of nodes - * = -5, esys number - * = -6, number of elements - * = -7, pointer to line in foreign db - * = -8, # of elem divs in existing mesh - * = -9, keypoint 1 - * = -10, keypoint 2 - * = -11, color,translucency packed - * = -12, local integer workspace + * 17, return next record from offset + * -1, material number + * -2, type + * -3, real number + * -4, number of nodes + * -5, esys number + * -6, number of elements + * -7, pointer to line in foreign db + * -8, # of elem divs in existing mesh + * -9, keypoint 1 + * -10, keypoint 2 + * -11, color,translucency packed + * -12, local integer workspace (used in delete with sweeps) - * = -13, orientation kpa - * = -14, orientation kpb - * = -15, section id - * = -16, # of elem divs for next mesh - * = -17, 0=hard / 1=soft NDIV - * = -18, 0=hard / 1=soft SPACE - * =-101, pointer to line segment data - * =-102, - * =-103, - * =-104, - * =-105, pointer to node list - * =-106, - * =-107, pointer to element list - * =-108, pointer to parameter data - * =-109, - * =-110, pointer to line convections - * =-111, pointer to line constraints - * =-112, - * =-113, - * =-114, pointer to area list - * =-115, pointer to sub-line list - * =-116, pointer to line pressures + * -13, orientation kpa + * -14, orientation kpb + * -15, section id + * -16, # of elem divs for next mesh + * -17, 0=hard / 1=soft NDIV + * -18, 0=hard / 1=soft SPACE + * -101, pointer to line segment data + * -102, + * -103, + * -104, + * -105, pointer to node list + * -106, + * -107, pointer to element list + * -108, pointer to parameter data + * -109, + * -110, pointer to line convections + * -111, pointer to line constraints + * -112, + * -113, + * -114, pointer to area list + * -115, pointer to sub-line list + * -116, pointer to line pressures pname : str Name of the variable where the queried value is stored. @@ -343,7 +343,7 @@ def lsinqr(self, line, key, pname='__tmpvar__', **kwargs): Returns ------- - lsinqr (int, sc, out) + int or str For key=1 * 0 = ``lnmi`` is undefined. @@ -362,66 +362,66 @@ def arinqr(self, anmi, key, pname='__tmpvar__', **kwargs): **Secondary Functions:** Set current area pointer to this area. - .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. - Hence its support is limited and it use is not encoraged. - + .. warning:: **DISCLAIMER**: This function is un-documented in the + official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encouraged. **Please use it with caution.** Parameters ---------- - anmi : (int, sc, in) + anmi : int or str Area for inquire. may be 0 for key=11 thru 15. - key : (dp, sc, in) + key : float or str Key as to information needed about the ``anmi``. - * = 1, return select - * = 2, return length (data units) - * = 3, - * = 11, return void percent (integer) - * = 12 return number of defined - * = 13, return number of selected - * = 14, return highest number defined - * = 15, return maximum record length + * 1, return select + * 2, return length (data units) + * 3, + * 11, return void percent (integer) + * 12 return number of defined + * 13, return number of selected + * 14, return highest number defined + * 15, return maximum record length (data units) - * = 16, return next record + * 16, return next record (this increments the next record count) - * = -1, material - * = -2, type. - * = -3, real. - * = -4, number of nodes. - * = -5, - * = -6, number of elements. - * = -7, pointer to area in foreign db - * = -8, element shape. - * = -9, mid-node element key. - * = -10, element coordinate system. - * = -11, area constraint information. - * = 0 - no constraint on this area. - * = 1 - symmetry constraint. - * = 2 - anti-symmetry - * = 3 - both symmetry and anti-symmetry - * = -12, local integer workspace - * = -13, - * = -14, - * = -15, section - * = -16, color and translucency packed. - * = -101, pointer to area data - * = -102, - * = -103, - * = -104, - * = -105, pointer to node list. - * = -106, pointer to parameter data - * = -107, pointer to element list. - * = -108, - * = -109, - * = -110, - * = -111, - * = -112, pointer to line loop list - * = -113, pointer to volume xref - * = -114, pointer to sub-area list - * = -115, pointer to area presaraes - * = -116, pointer to area convections + * -1, material + * -2, type. + * -3, real. + * -4, number of nodes. + * -5, + * -6, number of elements. + * -7, pointer to area in foreign db + * -8, element shape. + * -9, mid-node element key. + * -10, element coordinate system. + * -11, area constraint information. + * 0 - no constraint on this area. + * 1 - symmetry constraint. + * 2 - anti-symmetry + * 3 - both symmetry and anti-symmetry + * -12, local integer workspace + * -13, + * -14, + * -15, section + * -16, color and translucency packed. + * -101, pointer to area data + * -102, + * -103, + * -104, + * -105, pointer to node list. + * -106, pointer to parameter data + * -107, pointer to element list. + * -108, + * -109, + * -110, + * -111, + * -112, pointer to line loop list + * -113, pointer to volume xref + * -114, pointer to sub-area list + * -115, pointer to area presaraes + * -116, pointer to area convections pname : str Name of the variable where the queried value is stored. @@ -431,7 +431,7 @@ def arinqr(self, anmi, key, pname='__tmpvar__', **kwargs): Returns ------- - arinqr (int, sc, out) + int or str For key=1 * 0 = ``anmi`` is undefined. @@ -449,52 +449,52 @@ def vlinqr(self, vnmi, key, pname='__tmpvar__', **kwargs): **Secondary Functions:** Set current volume pointer to this volume. - .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. - Hence its support is limited and it use is not encoraged. - + .. warning:: **DISCLAIMER**: This function is un-documented in the + official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encouraged. **Please use it with caution.** Parameters ---------- - vnmi : (int, sc, in) + vnmi : int or str Volume for inquire. may be 0 for key=11 thru 15. - key : (dp, sc, in) + key : float or str Key as to information needed about the ``vnmi``. - * = 1, return select - * = 2, return length (data units) - * = 3, - * = 11, return void percent (integer) - * = 12 return number of defined - * = 13, return number of selected - * = 14, return highest number defined - * = 15, return maximum record length (data units) - * = 16, return next record - * = -1, material - * = -2, type. - * = -3, real. - * = -4, number of nodes. - * = -5, KZ1 - 1st kpt for elem Z - * = -6, number of elements. - * = -7, pointer to volume in foreign db - * = -8, element shape. - * = -9, (section id)\*10 + 2 - * = -10, element coordinate system. - * = -11, KZ2 - 2nd kpt for elem Z - * = -12, color and translucancy packed - * = -101, pointer volume data file. - * = -102, - * = -103, - * = -104, - * = -105, pointer to node list. - * = -106, pointer to volume pvolmeter dat - * = -107, pointer to element list. - * = -108, - * = -109, - * = -110, pointer to sub-volume list - * = -111, - * = -112, pointer to area shell list + * 1, return select + * 2, return length (data units) + * 3, + * 11, return void percent (integer) + * 12 return number of defined + * 13, return number of selected + * 14, return highest number defined + * 15, return maximum record length (data units) + * 16, return next record + * -1, material + * -2, type. + * -3, real. + * -4, number of nodes. + * -5, KZ1 - 1st kpt for elem Z + * -6, number of elements. + * -7, pointer to volume in foreign db + * -8, element shape. + * -9, (section id)\*10 + 2 + * -10, element coordinate system. + * -11, KZ2 - 2nd kpt for elem Z + * -12, color and translucancy packed + * -101, pointer volume data file. + * -102, + * -103, + * -104, + * -105, pointer to node list. + * -106, pointer to volume pvolmeter dat + * -107, pointer to element list. + * -108, + * -109, + * -110, pointer to sub-volume list + * -111, + * -112, pointer to area shell list pname : str Name of the variable where the queried value is stored. @@ -504,7 +504,7 @@ def vlinqr(self, vnmi, key, pname='__tmpvar__', **kwargs): Returns ------- - vlinqr (int, sc, out) + int or str For key=1 * 0 = ``vnmi`` is undefined. @@ -519,37 +519,34 @@ def vlinqr(self, vnmi, key, pname='__tmpvar__', **kwargs): def rlinqr(self, nreal, key, pname='__tmpvar__', **kwargs): """Get information about a real constant set. - .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. - Hence its support is limited and it use is not encoraged. - + .. warning:: **DISCLAIMER**: This function is un-documented in the + official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encouraged. **Please use it with caution.** Parameters ---------- - variable : (typ, siz, intent) - description - - nreal : (int, sc, in) + nreal : int or str Real constant table number should be 0 for key=11, ``DB_NUMDEFINED``, ``DB_NUMSELECTED``, ``DB_MAXDEFINED``, and ``DB_MAXRECLENG``. - key : (int, sc, in) + key : int or str Information flag. - * = 5 - return number of values stored for nreal. + * 5 - return number of values stored for nreal. Return the REAL set width (number of fields) - * = ``DB_SELECTED`` - return select status + * ``DB_SELECTED`` - return select status - * = 0 - real constant table is undefined. - * =-1 - real constant table is unselected. - * = 1 - real constant table is selected + * 0 - real constant table is undefined. + * -1 - real constant table is unselected. + * 1 - real constant table is selected - * = ``DB_NUMDEFINED`` - return number of defined real constant tables - * = ``DB_NUMSELECTED`` - return number of selected real constant tables - * = ``DB_MAXDEFINED`` - return highest real constant table defined - * = ``DB_MAXRECLENG`` - return maximum record length (dp words) + * ``DB_NUMDEFINED`` - return number of defined real constant tables + * ``DB_NUMSELECTED`` - return number of selected real constant tables + * ``DB_MAXDEFINED`` - return highest real constant table defined + * ``DB_MAXRECLENG`` - return maximum record length (dp words) pname : str Name of the variable where the queried value is stored. @@ -559,7 +556,7 @@ def rlinqr(self, nreal, key, pname='__tmpvar__', **kwargs): Returns ------- - rlinqr (int, func, out) + int or str The returned value of ``rlinqr`` is based on setting of key. """ @@ -568,27 +565,27 @@ def rlinqr(self, nreal, key, pname='__tmpvar__', **kwargs): def gapiqr(self, ngap, key, pname='__tmpvar__', **kwargs): """Get information about a dynamic gap set. - .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. - Hence its support is limited and it use is not encoraged. - + .. warning:: **DISCLAIMER**: This function is un-documented in the + official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encouraged. **Please use it with caution.** Parameters ---------- - ngap : (int, sc, in) + ngap : int or str gap number for inquire (must be zero for now). - key : (int, sc, in) + key : int or str key as to the information needed - * = 1, return select - * = 2, return length (data units) - * = 3, - * = 11, return void percent (integer) - * = 12 return number of defined - * = 13, return number of selected - * = 14, return highest number defined - * = 15, return maximum record length (data units) + * 1, return select + * 2, return length (data units) + * 3, + * 11, return void percent (integer) + * 12 return number of defined + * 13, return number of selected + * 14, return highest number defined + * 15, return maximum record length (data units) pname : str Name of the variable where the queried value is stored. @@ -598,7 +595,7 @@ def gapiqr(self, ngap, key, pname='__tmpvar__', **kwargs): Returns ------- - gapiqr (int, sc, out) + int or str Returned data is based on setting of key. """ return self.run(f"{pname} = gapiqr({ngap}, {key})", **kwargs) @@ -606,30 +603,27 @@ def gapiqr(self, ngap, key, pname='__tmpvar__', **kwargs): def masiqr(self, node, key, pname='__tmpvar__', **kwargs): """Get information about masters nodes. - .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. - Hence its support is limited and it use is not encoraged. - + .. warning:: **DISCLAIMER**: This function is un-documented in the + official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encouraged. **Please use it with caution.** Parameters ---------- - variable : (typ, siz, intent) - Description - - node : (int, sc, in) + node : int or str Node number for inquire (must be zero for now). - key : (int, sc, in) + key : int or str Key as to the information needed - * = 1, return select - * = 2, return length (data units) - * = 3, - * = 11, return void percent (integer) - * = 12 return number of defined - * = 13, return number of selected - * = 14, return highest number defined - * = 15, return maximum record length (data units) + * 1, return select + * 2, return length (data units) + * 3, + * 11, return void percent (integer) + * 12 return number of defined + * 13, return number of selected + * 14, return highest number defined + * 15, return maximum record length (data units) pname : str Name of the variable where the queried value is stored. @@ -639,10 +633,7 @@ def masiqr(self, node, key, pname='__tmpvar__', **kwargs): Returns ------- - variable (typ, siz, intent) - Description - - masiqr (int, sc, out) + masiqr int or str Returned data is based on setting of key. """ return self.run(f"{pname} = masiqr({node}, {key})", **kwargs) @@ -650,41 +641,44 @@ def masiqr(self, node, key, pname='__tmpvar__', **kwargs): def ceinqr(self, nce, key, pname='__tmpvar__', **kwargs): """Get information about a constraint equation set. - .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. - Hence its support is limited and it use is not encoraged. - + .. warning:: **DISCLAIMER**: This function is un-documented in the + official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encouraged. **Please use it with caution.** Parameters ---------- - nce : (int, sc, in) + nce : int or str Constraint equation number - key : (int, sc, in) + + key : int or str Inquiry key. It should be zero for key=11, ``DB_NUMDEFINED``, ``DB_NUMSELECTED``, ``DB_MAXDEFINED``, and ``DB_MAXRECLENG`` - * = DB_SELECTED - return select status - - * = 1 - equation is selected - * = 0 - equation is undefined - * =-1 - equation is unselected - - * = ``DB_NUMDEFINED`` - return number of defined constraint equations - * = ``DB_NUMSELECTED`` - return number of selected constraint equations - * = ``DB_MAXDEFINED`` - return number of highest numbered constraint - equation defined - * = ``DB_MAXRECLENG`` - return length of longest constraint equation set - (max record length) - * = 2 - return length (data units) - * = 3 - return layer number - * = 4 - address of first data word - * = 5 - return number of values stored for nce - * = 11 - return void percent (integer) - * = 16 - return location of next record - * = ``CE_NONLINEAR`` - return 1 if CE is nonlinear - * = ``CE_ELEMNUMBER`` - return associated element number + * DB_SELECTED - return select status + + * 1 - equation is selected + * 0 - equation is undefined + * -1 - equation is unselected + + * ``DB_NUMDEFINED`` - return number of defined constraint + equations. + * ``DB_NUMSELECTED`` - return number of selected constraint + equations. + * ``DB_MAXDEFINED`` - return number of highest numbered + constraint equation defined. + * ``DB_MAXRECLENG`` - return length of longest constraint + equation set (max record length) + * 2 - return length (data units) + * 3 - return layer number + * 4 - address of first data word + * 5 - return number of values stored for nce + * 11 - return void percent (integer) + * 16 - return location of next record + * ``CE_NONLINEAR`` - return 1 if CE is nonlinear + * ``CE_ELEMNUMBER`` - return associated element number pname : str Name of the variable where the queried value is stored. @@ -694,7 +688,7 @@ def ceinqr(self, nce, key, pname='__tmpvar__', **kwargs): Returns ------- - ceinqr (int, func, out) + int or str The returned value of ``ceinqr`` is based on setting of key """ return self.run(f"{pname} = ceinqr({nce}, {key})", **kwargs) @@ -702,42 +696,39 @@ def ceinqr(self, nce, key, pname='__tmpvar__', **kwargs): def cpinqr(self, ncp, key, pname='__tmpvar__', **kwargs): """Get information about a coupled set. - .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. - Hence its support is limited and it use is not encoraged. - + .. warning:: **DISCLAIMER**: This function is un-documented in the + official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encouraged. **Please use it with caution.** Parameters ---------- - variable : (typ, siz, intent) - Description - - ncp : (int, sc, in) + ncp : int or str Coupled set number - key : (int, sc, in) + key : int or str Inquiry key. It should be zero for key=11, ``DB_NUMDEFINED``, ``DB_NUMSELECTED``, ``DB_MAXDEFINED``, and ``DB_MAXRECLENG`` - * = DB_SELECTED - return select status + * DB_SELECTED - return select status - * = 1 - coupled set is selected - * = 0 - coupled set in undefined - * =-1 - coupled set in unselected + * 1 - coupled set is selected + * 0 - coupled set in undefined + * -1 - coupled set in unselected - * = ``DB_NUMDEFINED`` - return number of defined coupled sets - * = ``DB_NUMSELECTED`` - return number of selected coupled sets - * = ``DB_MAXDEFINED`` - return the number of the highest numbered + * ``DB_NUMDEFINED`` - return number of defined coupled sets + * ``DB_NUMSELECTED`` - return number of selected coupled sets + * ``DB_MAXDEFINED`` - return the number of the highest numbered coupled set - * = ``DB_MAXRECLENG`` - return length of largest coupled set record + * ``DB_MAXRECLENG`` - return length of largest coupled set record (max record length) - * = 2 - return length (data units) - * = 3 - return layer number - * = 4 - return address of first data word - * = 5 - return number of values stored for ncp - * = 11 - return void percent (integer) - * = 16 - return location of next record - * = -1 - return master node for this eqn (this is + * 2 - return length (data units) + * 3 - return layer number + * 4 - return address of first data word + * 5 - return number of values stored for ncp + * 11 - return void percent (integer) + * 16 - return location of next record + * -1 - return master node for this eqn (this is currently only used by solution DB object) pname : str @@ -748,7 +739,7 @@ def cpinqr(self, ncp, key, pname='__tmpvar__', **kwargs): Returns ------- - cpinqr (int, func, out) + int or str The returned value of ``cpinqr`` is based on setting of key. """ @@ -757,29 +748,29 @@ def cpinqr(self, ncp, key, pname='__tmpvar__', **kwargs): def csyiqr(self, ncsy, key, pname='__tmpvar__', **kwargs): """Get information about a coordinate system. - .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. - Hence its support is limited and it use is not encoraged. - + .. warning:: **DISCLAIMER**: This function is un-documented in the + official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encouraged. **Please use it with caution.** Parameters ---------- - ncsy : (int, sc, in) + ncsy : int or str Coordinate system reference number should be zero for key= ``DB_NUMDEFINED`` or ``DB_MAXDEFINED`` - key : (int, sc, in) + key : int or str Information flag. - * = ``DB_SELECTED`` - return status: + * ``DB_SELECTED`` - return status: - * = 0 - coordinate system is not defined - * = -1 - coordinate system is not selected - * = 1 - coordinate system is selected + * 0 - coordinate system is not defined + * -1 - coordinate system is not selected + * 1 - coordinate system is selected - * = ``DB_NUMDEFINED`` - number of defined coordinate systems - * = ``DB_MAXDEFINED`` - maximum coordinate system reference + * ``DB_NUMDEFINED`` - number of defined coordinate systems + * ``DB_MAXDEFINED`` - maximum coordinate system reference number used. pname : str @@ -790,7 +781,7 @@ def csyiqr(self, ncsy, key, pname='__tmpvar__', **kwargs): Returns ------- - csyiqr (int, func, out) + int or str The returned value of ``csyiqr`` is based on setting of key. """ return self.run(f"{pname} = csyiqr({ncsy}, {key})", **kwargs) @@ -798,38 +789,39 @@ def csyiqr(self, ncsy, key, pname='__tmpvar__', **kwargs): def etyiqr(self, itype, key, pname='__tmpvar__', **kwargs): """Get information about an element type. - .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. - Hence its support is limited and it use is not encoraged. - + .. warning:: **DISCLAIMER**: This function is un-documented in the + official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encouraged. **Please use it with caution.** Parameters ---------- - itype : (int, sc, in) + itype : int or str Element type number. It should be 0 for key=11, ``DB_NUMDEFINED``, ``DB_NUMSELECTED``, ``DB_MAXDEFINED``, and ``DB_MAXRECLENG`` - key : (int, sc, in) + key : int or str Information flag. - * = DB_SELECTED - return select status: + * DB_SELECTED - return select status: - * = 0 - element type is undefined. - * =-1 - element type is unselected. - * = 1 - element type is selected. + * 0 - element type is undefined. + * -1 - element type is unselected. + * 1 - element type is selected. - * = ``DB_NUMDEFINED`` - return number of defined element types - * = ``DB_NUMSELECTED`` - return number of selected element types - * = ``DB_MAXDEFINED`` - return highest element type number defined - * = ``DB_MAXRECLENG`` - return maximum record length (int words) - * = -n, return element characteristic n from ``etycom`` for element + * ``DB_NUMDEFINED`` - return number of defined element types + * ``DB_NUMSELECTED`` - return number of selected element types + * ``DB_MAXDEFINED`` - return highest element type number defined + * ``DB_MAXRECLENG`` - return maximum record length (int words) + * -n, return element characteristic n from ``etycom`` for element type itype. ``n`` is correlated to the parameter names in ``echprm``. see ``elccmt`` for definitions of element characteristics. - .. note:: This will not overwrite the current setting of ``etycom``. + .. note:: This will not overwrite the current setting of + ``etycom``. pname : str Name of the variable where the queried value is stored. @@ -839,7 +831,7 @@ def etyiqr(self, itype, key, pname='__tmpvar__', **kwargs): Returns ------- - etyiqr (int, func, out) + int or str The returned value of ``etyiqr`` is based on setting of key. """ return self.run(f"{pname} = etyiqr({itype}, {key})", **kwargs) @@ -847,26 +839,27 @@ def etyiqr(self, itype, key, pname='__tmpvar__', **kwargs): def foriqr(self, node, key, pname='__tmpvar__', **kwargs): """Get information about nodal loads. - .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. - Hence its support is limited and it use is not encoraged. - + .. warning:: **DISCLAIMER**: This function is un-documented in the + official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encouraged. **Please use it with caution.** Parameters ---------- - node : (int, sc, in) + node : int or str Number of node being inquired about. should be 0 for key=``DB_MAXDEFINED`` or ``DB_NUMDEFINED``. - key : (dp, sc, in) + key : float or str Key as to information needed - * = 1 - return force mask for node - * = ``DB_MAXDEFINED``, - return number of nodal loadings in model. - * = ``DB_NUMDEFINED``. - return number of nodal loadings in model. + * 1 - return force mask for node + * ``DB_MAXDEFINED``, - return number of nodal loadings in model. + * ``DB_NUMDEFINED``. - return number of nodal loadings in model. - .. note:: Both ``DB_MAXDEFINED`` and ``DB_NUMDEFINED``, produce the same functionality. + .. note:: Both ``DB_MAXDEFINED`` and ``DB_NUMDEFINED``, produce the + same functionality. pname : str Name of the variable where the queried value is stored. @@ -876,7 +869,7 @@ def foriqr(self, node, key, pname='__tmpvar__', **kwargs): Returns ------- - foriqr (int, func, out) + int or str The returned value of ``foriqr`` is based on setting of key. """ return self.run(f"{pname} = foriqr({node}, {key})", **kwargs) @@ -884,52 +877,51 @@ def foriqr(self, node, key, pname='__tmpvar__', **kwargs): def sectinqr(self, nsect, key, pname='__tmpvar__', **kwargs): """Get information about a section id set. - .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. - Hence its support is limited and it use is not encoraged. - + .. warning:: **DISCLAIMER**: This function is un-documented in the + official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encouraged. **Please use it with caution.** Parameters ---------- - variable : (typ,siz,intent) - Description - - nsect : (int,sc,in) + nsect : int or str Section id table number should be 0 for key=11, ``DB_NUMDEFINED``, ``DB_NUMSELECTED``, ``DB_MAXDEFINED``, and ``DB_MAXRECLENG``. - key : (int,sc,in) + key : int or str Information flag. - * = DB_SELECTED - return select status - * = 0 - ection id table is undefined. - * =-1 - section id table is unselected. - * = 1 - section id table is selected - * = ``DB_NUMDEFINED`` - return number of defined section id tables - * = ``DB_NUMSELECTED`` - return number of selected section id tables - * = ``DB_MAXDEFINED`` - return highest section id table defined - * = ``DB_MAXRECLENG`` - return maximum record length (dp words) - * = 2 - return length (dp words) - * = 3 - return layer number (for cross reference files return number of entities) - * = 4 - return address of first data word - * = 5 - return length (in record type units) - * = 6 - return compressed record number. - * = 11 - return void percent (integer) - * = 16 - return location of next record (this increments the next record count) - * = 18 - return type of file. - * = 0 - integer - * = 1 - double precision - * = 2 - real - * = 3 - complex - * = 4 - character*8 - * = 7 - index - * = 19 - return virtual type of file. - * = 0 - fixed length (4.4 form) - * = 1 - indexed variable length (layer data) - * = 2 - xref data tables - * = 3 - bitmap data (for 32 data item packed records) - * = 4 - data tables (three dimensional arrays) + * DB_SELECTED - return select status + * 0 - ection id table is undefined. + * -1 - section id table is unselected. + * 1 - section id table is selected + * ``DB_NUMDEFINED`` - return number of defined section id tables + * ``DB_NUMSELECTED`` - return number of selected section id tables + * ``DB_MAXDEFINED`` - return highest section id table defined + * ``DB_MAXRECLENG`` - return maximum record length (dp words) + * 2 - return length (dp words) + * 3 - return layer number (for cross reference files return number + of entities) + * 4 - return address of first data word + * 5 - return length (in record type units) + * 6 - return compressed record number. + * 11 - return void percent (integer) + * 16 - return location of next record (this increments the next + record count) + * 18 - return type of file. + * 0 - integer + * 1 - double precision + * 2 - real + * 3 - complex + * 4 - character*8 + * 7 - index + * 19 - return virtual type of file. + * 0 - fixed length (4.4 form) + * 1 - indexed variable length (layer data) + * 2 - xref data tables + * 3 - bitmap data (for 32 data item packed records) + * 4 - data tables (three dimensional arrays) pname : str Name of the variable where the queried value is stored. @@ -939,7 +931,7 @@ def sectinqr(self, nsect, key, pname='__tmpvar__', **kwargs): Returns ------- - sectinqr (int,func,out) + int or str The returned value of sectinqr is based on setting of key. """ return self.run(f"{pname} = sectinqr({nsect}, {key})", **kwargs) @@ -947,19 +939,19 @@ def sectinqr(self, nsect, key, pname='__tmpvar__', **kwargs): def mpinqr(self, mat, iprop, key, pname='__tmpvar__', **kwargs): """Get information about a material property. - .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. - Hence its support is limited and it use is not encoraged. - + .. warning:: **DISCLAIMER**: This function is un-documented in the + official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encouraged. **Please use it with caution.** Parameters ---------- - mat : (int, sc, in) + mat : int or str Material number should be 0 for key=11, ``DB_NUMDEFINED(12)``, ``DB_MAXDEFINED(14)``, and ``DB_MAXRECLENG(15)``. - iprop : (int, sc, in) + iprop : int or str Property reference number (See notes). If iprop = 0, test for existence of any material property with this @@ -992,20 +984,20 @@ def mpinqr(self, mat, iprop, key, pname='__tmpvar__', **kwargs): (see ``TB`` command for more information) - key : (int, sc, in) + key : int or str Key as to the information needed about material property. - * = ``DB_SELECTED(1)``- return select status: + * ``DB_SELECTED(1)``- return select status: - * = 0 - material prop is undefined. - * = 1 - material prop is selected. + * 0 - material prop is undefined. + * 1 - material prop is selected. - * = ``DB_NUMDEFINED(12)`` - number of defined material properties - * = ``DB_MAXDEFINED(14)`` - highest material property number defined - * = ``DB_MAXRECLENG(15)`` - maximum record length (dp words) - * = 2 - return length (dp words) - * = 3 - return number of temp. values - * = 11 - return void percent (integer) + * ``DB_NUMDEFINED(12)`` - number of defined material properties + * ``DB_MAXDEFINED(14)`` - highest material property number defined + * ``DB_MAXRECLENG(15)`` - maximum record length (dp words) + * 2 - return length (dp words) + * 3 - return number of temp. values + * 11 - return void percent (integer) pname : str Name of the variable where the queried value is stored. @@ -1015,7 +1007,7 @@ def mpinqr(self, mat, iprop, key, pname='__tmpvar__', **kwargs): Returns ------- - mpinqr (int, func, out) + int or str Returned value of ``mpinqr`` is based on setting of key. """ @@ -1024,17 +1016,17 @@ def mpinqr(self, mat, iprop, key, pname='__tmpvar__', **kwargs): def dget(self, node, idf, kcmplx, pname='__tmpvar__', **kwargs): """Get a constraint from the data base. - .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. - Hence its support is limited and it use is not encoraged. - + .. warning:: **DISCLAIMER**: This function is un-documented in the + official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encouraged. **Please use it with caution.** Parameters ---------- - node : (int, sc, in) + node : int or str Node number - idf : (int, sc, in) + idf : int or str Pointer to the dof (1-32) * 1 = ux, @@ -1060,7 +1052,7 @@ def dget(self, node, idf, kcmplx, pname='__tmpvar__', **kwargs): * 26 = curr * 27-32 = SP01-SP06 - kcmplx : (int, sc, in) + kcmplx : int or str * 0 = real * 1 = imaginary @@ -1073,7 +1065,7 @@ def dget(self, node, idf, kcmplx, pname='__tmpvar__', **kwargs): Returns ------- - dget (dp, sc, out) + float or str Constraint value (High number if undefined) """ return self.run(f"{pname} = dget({node}, {idf}, {kcmplx})", **kwargs) @@ -1081,17 +1073,17 @@ def dget(self, node, idf, kcmplx, pname='__tmpvar__', **kwargs): def fget(self, node, idf, kcmplx, pname='__tmpvar__', **kwargs): """Get a force load from the data base. - .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. - Hence its support is limited and it use is not encoraged. - + .. warning:: **DISCLAIMER**: This function is un-documented in the + official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encouraged. **Please use it with caution.** Parameters ---------- - node : (int, sc, in) + node : int or str Node number - idf : (int, sc, in) + idf : int or str Pointer to the dof (1-32) * 1 = ux @@ -1117,7 +1109,7 @@ def fget(self, node, idf, kcmplx, pname='__tmpvar__', **kwargs): * 26 = curr * 27-32 = spares - kcmplx : (int, sc, in) + kcmplx : int or str * 0 = real * 1 = imaginary @@ -1130,22 +1122,22 @@ def fget(self, node, idf, kcmplx, pname='__tmpvar__', **kwargs): Returns ------- - fget (dp, sc, out) - Force value (High number if undefined) + float or str + Force value (high number if undefined) """ return self.run(f"{pname} = fget({node}, {idf}, {kcmplx})", **kwargs) def erinqr(self, key, pname='__tmpvar__', **kwargs): """Obtain information from common errors. - .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. - Hence its support is limited and it use is not encoraged. - + .. warning:: **DISCLAIMER**: This function is un-documented in the + official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encouraged. **Please use it with caution.** Parameters ---------- - key : (int, sc, in) + key : int or str Item to be returned. * 1 = keyerr (ER_ERRORFLAG) @@ -1173,7 +1165,8 @@ def erinqr(self, key, pname='__tmpvar__', **kwargs): * 10 = nercmd (ER_NUMCOMMAND) Number of messages displayed for any one command. * 11 = nertim (ER_UICLEAR) - Key as to how message cleared from u/i pop-up (only for "info" calls) + Key as to how message cleared from u/i pop-up (only for "info" + calls) * -1 = message is timed before removal * 0 = message needs pick or keyboard before removal @@ -1196,10 +1189,12 @@ def erinqr(self, key, pname='__tmpvar__', **kwargs): * -1 = if interactive set keyerr (used by mesher and tessalation) * 15 = kystat (ER_KEYOPTTEST) - Flag to bypass keyopt tests in the elcxx routines associated with status/panel info inquiries. + Flag to bypass keyopt tests in the elcxx routines associated with + status/panel info inquiries. * 0 = do not bypass keyopt tests - * 1 = perform all keyopt tests also flag to bypass setting of _STATUS upon resume + * 1 = perform all keyopt tests also flag to bypass setting of + _STATUS upon resume * 16 = mxr4r5 (ER_MIXEDREV) mixed rev4-rev5 input logic (\*do,\*if, \*go, \*if-go) @@ -1210,7 +1205,8 @@ def erinqr(self, key, pname='__tmpvar__', **kwargs): * 17 = mshkey (ER_MESHING) CPU intensive meshing etc. - This will cause "nertim (11)" to be set to -1 for "notes", 1 for "warnings",and 0 for "errors". + This will cause "nertim (11)" to be set to -1 for "notes", 1 for + "warnings",and 0 for "errors". Checking of this key is done in "anserr". * 0 = not meshing or cpu intensive @@ -1250,7 +1246,8 @@ def erinqr(self, key, pname='__tmpvar__', **kwargs): No information is provided. * 26 = icloads (26) - K key to forbid the ``iclist`` command from listing solution data instead of the input data. + K key to forbid the ``iclist`` command from listing solution data + instead of the input data. * 0 = ``iclist`` is OK * 1 = do not permit ``iclist`` @@ -1274,7 +1271,7 @@ def erinqr(self, key, pname='__tmpvar__', **kwargs): Returns ------- - erinqr (int, sc, out) + int or str Value corresponding to key. """ diff --git a/tests/test_commands.py b/tests/test_commands.py index 861d101a6a..05666fea3d 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -22,7 +22,7 @@ 'dget', 'fget', 'erinqr' - ] +] # Generic args ARGS_INQ_FUNC = { @@ -44,7 +44,7 @@ 'iprop': 1, 'idf': 1, 'kcmplx': 1 - } + } @pytest.mark.parametrize("func", LIST_OF_INQUIRE_FUNCTIONS) def test_inquire_functions(mapdl, func): From 71c8e61f3f14e6214c1be74999fe9e2c2bb054eb Mon Sep 17 00:00:00 2001 From: German Date: Tue, 4 Jan 2022 17:22:18 +0100 Subject: [PATCH 22/29] Improving docs --- doc/source/mapdl_commands/index.rst | 3 +-- doc/source/mapdl_commands/inqfun.rst | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/source/mapdl_commands/index.rst b/doc/source/mapdl_commands/index.rst index 2460718177..8857ffa612 100644 --- a/doc/source/mapdl_commands/index.rst +++ b/doc/source/mapdl_commands/index.rst @@ -317,8 +317,7 @@ Undocumented Inquire Commands Undocumented inquire commands. .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. - Hence its support is limited and it use is not encoraged. - + Hence its support is limited and it use is not encouraged. **Please use it with caution.** diff --git a/doc/source/mapdl_commands/inqfun.rst b/doc/source/mapdl_commands/inqfun.rst index e07ab9ad2c..78dd8fee0a 100644 --- a/doc/source/mapdl_commands/inqfun.rst +++ b/doc/source/mapdl_commands/inqfun.rst @@ -6,6 +6,10 @@ Undocumented Inquire Commands .. currentmodule:: ansys.mapdl.core +.. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encouraged. + **Please use it with caution.** + Undocumented inquire commands. .. autosummary:: From 58d04ae19a48f3754ef3d2abe0175c0fee6f7aeb Mon Sep 17 00:00:00 2001 From: German Date: Tue, 4 Jan 2022 17:40:04 +0100 Subject: [PATCH 23/29] Adding `wrinqr` function --- ansys/mapdl/core/_commands/inq_func.py | 71 ++++++++++++++++++++++++++ ansys/mapdl/core/mapdl_grpc.py | 6 +++ 2 files changed, 77 insertions(+) diff --git a/ansys/mapdl/core/_commands/inq_func.py b/ansys/mapdl/core/_commands/inq_func.py index 4741592f55..3dc6f4e8b0 100644 --- a/ansys/mapdl/core/_commands/inq_func.py +++ b/ansys/mapdl/core/_commands/inq_func.py @@ -1276,3 +1276,74 @@ def erinqr(self, key, pname='__tmpvar__', **kwargs): """ return self.run(f"{pname} = erinqr({key})", **kwargs) + + def wrinqr(self, key, pname='__tmpvar__', **kwargs): + """Obtain information about output + + .. warning:: **DISCLAIMER**: This function is un-documented in the + official ANSYS Command Reference Guide. + Hence its support is limited and it use is not encouraged. + **Please use it with caution.** + + .. warning:: Caution: the following variables are "saved/resumed". + key=WR_COLINTER thru WR_SUPCOLMAX in "wrinqr/wrinfo". + + Parameters + ---------- + key : int or str + Key. + + * WR_PRINT (kprint) + Print flag. + + * 0 - no output + * 1 - print + + * WR_OUTPUT (outfil) + Current output unit number(iott). + * WR_MASTEROUT (frstot) + Master output file. + * WR_COLINTER (intcol) + Interactive columns per page. + * WR_COLBATCH (batcol) + Batch columns per page. + * WR_LINEINTER (intlin) + Interactive lines per page. + * WR_LINEBATCH (batlin) + Batch lines per page. + * WR_COMMASEP (CommaSep) + 1 for comma separated output. + * WR_CHARITEM (chrper) + Characters per output item. + * WR_CHARDECIMAL (chrdec) + Characters past decimal. + * WR_CHARINTEGER (chrint) + Characters in leading integer. + * WR_CHARTYPE (chrtyp) + + * 1 - using E format in output. + * 2 - using F format in output. + * 3 - using G format in output. + + * WR_SUPTITLE (keyhed) + Tlabel supress key. + * WR_SUPSUBTITLE (keytit) + Subtitle supress key. + * WR_SUPLSITER (keyid) + Ls,iter id supress key. + * WR_NOTELINE (keynot) + Note line supress key. + * WR_SUPCOLHEADER (keylab) + column header supress key. + * WR_SUPCOLMAX (keysum) + Column maximum supress key. + * WR_LISTOPT (ListOpt) + ListOpt from /output command. + + Returns + ------- + int or str + The value corresponding to key. + + """ + return self.run(f"{pname} = wrinqr({key})", **kwargs) diff --git a/ansys/mapdl/core/mapdl_grpc.py b/ansys/mapdl/core/mapdl_grpc.py index d913afba67..652965b31a 100755 --- a/ansys/mapdl/core/mapdl_grpc.py +++ b/ansys/mapdl/core/mapdl_grpc.py @@ -1998,3 +1998,9 @@ def erinqr(self, *args, **kwargs): """Wrap the ``erinqr`` method to take advantage of the gRPC methods.""" super().erinqr(*args, pname=TMP_VAR, mute=True, **kwargs) return self.scalar_param(TMP_VAR) + + @wraps(_MapdlCore.wrinqr) + def wrinqr(self, *args, **kwargs): + """Wrap the ``wrinqr`` method to take advantage of the gRPC methods.""" + super().wrinqr(*args, pname=TMP_VAR, mute=True, **kwargs) + return self.scalar_param(TMP_VAR) From 6da0d2937b381820ac7ccd95a2fc93c0e018b87f Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Tue, 4 Jan 2022 20:37:34 +0100 Subject: [PATCH 24/29] Update inq_func.py Removing space. --- ansys/mapdl/core/_commands/inq_func.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansys/mapdl/core/_commands/inq_func.py b/ansys/mapdl/core/_commands/inq_func.py index 3dc6f4e8b0..10971de793 100644 --- a/ansys/mapdl/core/_commands/inq_func.py +++ b/ansys/mapdl/core/_commands/inq_func.py @@ -1193,7 +1193,7 @@ def erinqr(self, key, pname='__tmpvar__', **kwargs): status/panel info inquiries. * 0 = do not bypass keyopt tests - * 1 = perform all keyopt tests also flag to bypass setting of + * 1 = perform all keyopt tests also flag to bypass setting of _STATUS upon resume * 16 = mxr4r5 (ER_MIXEDREV) From a8476d197ea26421b9d5f944399333fe01bb4d17 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Tue, 4 Jan 2022 20:40:00 +0100 Subject: [PATCH 25/29] Update inq_func.py Grammar fixing. --- ansys/mapdl/core/_commands/inq_func.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ansys/mapdl/core/_commands/inq_func.py b/ansys/mapdl/core/_commands/inq_func.py index 10971de793..6d5d02527b 100644 --- a/ansys/mapdl/core/_commands/inq_func.py +++ b/ansys/mapdl/core/_commands/inq_func.py @@ -1326,17 +1326,17 @@ def wrinqr(self, key, pname='__tmpvar__', **kwargs): * 3 - using G format in output. * WR_SUPTITLE (keyhed) - Tlabel supress key. + Tlabel suppress key. * WR_SUPSUBTITLE (keytit) - Subtitle supress key. + Subtitle suppress key. * WR_SUPLSITER (keyid) - Ls,iter id supress key. + Ls,iter id suppress key. * WR_NOTELINE (keynot) - Note line supress key. + Note line suppress key. * WR_SUPCOLHEADER (keylab) - column header supress key. + column header suppress key. * WR_SUPCOLMAX (keysum) - Column maximum supress key. + Column maximum suppress key. * WR_LISTOPT (ListOpt) ListOpt from /output command. From 80be1ce91187939a792ad649173805637ac18372 Mon Sep 17 00:00:00 2001 From: German Date: Tue, 4 Jan 2022 20:47:51 +0100 Subject: [PATCH 26/29] Getting back the args verbosity, to avoid breaking the test. --- ansys/mapdl/core/mapdl_grpc.py | 80 +++++++++++++++++----------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/ansys/mapdl/core/mapdl_grpc.py b/ansys/mapdl/core/mapdl_grpc.py index 652965b31a..91bb0f0f08 100755 --- a/ansys/mapdl/core/mapdl_grpc.py +++ b/ansys/mapdl/core/mapdl_grpc.py @@ -1886,121 +1886,121 @@ def _distributed(self) -> bool: return self.__distributed @wraps(_MapdlCore.ndinqr) - def ndinqr(self, *args, **kwargs): + def ndinqr(self, node, key, **kwargs): """Wrap the ``ndinqr`` method to take advantage of the gRPC methods.""" - super().ndinqr(*args, pname=TMP_VAR, mute=True, **kwargs) + super().ndinqr(node, key, pname=TMP_VAR, mute=True, **kwargs) return self.scalar_param(TMP_VAR) @wraps(_MapdlCore.elmiqr) - def elmiqr(self, *args, **kwargs): + def elmiqr(self, ielem, key, **kwargs): """Wrap the ``elmiqr`` method to take advantage of the gRPC methods.""" - super().elmiqr(*args, pname=TMP_VAR, mute=True, **kwargs) + super().elmiqr(ielem, key, pname=TMP_VAR, mute=True, **kwargs) return self.scalar_param(TMP_VAR) @wraps(_MapdlCore.kpinqr) - def kpinqr(self, *args, **kwargs): + def kpinqr(self, knmi, key, **kwargs): """Wrap the ``kpinqr`` method to take advantage of the gRPC methods.""" - super().kpinqr(*args, pname=TMP_VAR, mute=True, **kwargs) + super().kpinqr(knmi, key, pname=TMP_VAR, mute=True, **kwargs) return self.scalar_param(TMP_VAR) @wraps(_MapdlCore.lsinqr) - def lsinqr(self, *args, **kwargs): + def lsinqr(self, line, key, **kwargs): """Wrap the ``lsinqr`` method to take advantage of the gRPC methods.""" - super().lsinqr(*args, pname=TMP_VAR, mute=True, **kwargs) + super().lsinqr(line, key, pname=TMP_VAR, mute=True, **kwargs) return self.scalar_param(TMP_VAR) @wraps(_MapdlCore.arinqr) - def arinqr(self, *args, **kwargs): + def arinqr(self, anmi, key, **kwargs): """Wrap the ``arinqr`` method to take advantage of the gRPC methods.""" - super().arinqr(*args, pname=TMP_VAR, mute=True, **kwargs) + super().arinqr(anmi, key, pname=TMP_VAR, mute=True, **kwargs) return self.scalar_param(TMP_VAR) @wraps(_MapdlCore.vlinqr) - def vlinqr(self, *args, **kwargs): + def vlinqr(self, vnmi, key, **kwargs): """Wrap the ``vlinqr`` method to take advantage of the gRPC methods.""" - super().vlinqr(*args, pname=TMP_VAR, mute=True, **kwargs) + super().vlinqr(vnmi, key, pname=TMP_VAR, mute=True, **kwargs) return self.scalar_param(TMP_VAR) @wraps(_MapdlCore.rlinqr) - def rlinqr(self, *args, **kwargs): + def rlinqr(self, nreal, key, **kwargs): """Wrap the ``rlinqr`` method to take advantage of the gRPC methods.""" - super().rlinqr(*args, pname=TMP_VAR, mute=True, **kwargs) + super().rlinqr(nreal, key, pname=TMP_VAR, mute=True, **kwargs) return self.scalar_param(TMP_VAR) @wraps(_MapdlCore.gapiqr) - def gapiqr(self, *args, **kwargs): + def gapiqr(self, ngap, key, **kwargs): """Wrap the ``gapiqr`` method to take advantage of the gRPC methods.""" - super().gapiqr(*args, pname=TMP_VAR, mute=True, **kwargs) + super().gapiqr(ngap, key, pname=TMP_VAR, mute=True, **kwargs) return self.scalar_param(TMP_VAR) @wraps(_MapdlCore.masiqr) - def masiqr(self, *args, **kwargs): + def masiqr(self, node, key, **kwargs): """Wrap the ``masiqr`` method to take advantage of the gRPC methods.""" - super().masiqr(*args, pname=TMP_VAR, mute=True, **kwargs) + super().masiqr(node, key, pname=TMP_VAR, mute=True, **kwargs) return self.scalar_param(TMP_VAR) @wraps(_MapdlCore.ceinqr) - def ceinqr(self, *args, **kwargs): + def ceinqr(self, nce, key, **kwargs): """Wrap the ``ceinqr`` method to take advantage of the gRPC methods.""" - super().ceinqr(*args, pname=TMP_VAR, mute=True, **kwargs) + super().ceinqr(nce, key, pname=TMP_VAR, mute=True, **kwargs) return self.scalar_param(TMP_VAR) @wraps(_MapdlCore.cpinqr) - def cpinqr(self, *args, **kwargs): + def cpinqr(self, ncp, key, **kwargs): """Wrap the ``cpinqr`` method to take advantage of the gRPC methods.""" - super().cpinqr(*args, pname=TMP_VAR, mute=True, **kwargs) + super().cpinqr(ncp, key, pname=TMP_VAR, mute=True, **kwargs) return self.scalar_param(TMP_VAR) @wraps(_MapdlCore.csyiqr) - def csyiqr(self, *args, **kwargs): + def csyiqr(self, ncsy, key, **kwargs): """Wrap the ``csyiqr`` method to take advantage of the gRPC methods.""" - super().csyiqr(*args, pname=TMP_VAR, mute=True, **kwargs) + super().csyiqr(ncsy, key, pname=TMP_VAR, mute=True, **kwargs) return self.scalar_param(TMP_VAR) @wraps(_MapdlCore.etyiqr) - def etyiqr(self, *args, **kwargs): + def etyiqr(self, itype, key, **kwargs): """Wrap the ``etyiqr`` method to take advantage of the gRPC methods.""" - super().etyiqr(*args, pname=TMP_VAR, mute=True, **kwargs) + super().etyiqr(itype, key, pname=TMP_VAR, mute=True, **kwargs) return self.scalar_param(TMP_VAR) @wraps(_MapdlCore.foriqr) - def foriqr(self, *args, **kwargs): + def foriqr(self, node, key, **kwargs): """Wrap the ``foriqr`` method to take advantage of the gRPC methods.""" - super().foriqr(*args, pname=TMP_VAR, mute=True, **kwargs) + super().foriqr(node, key, pname=TMP_VAR, mute=True, **kwargs) return self.scalar_param(TMP_VAR) @wraps(_MapdlCore.sectinqr) - def sectinqr(self, *args, **kwargs): + def sectinqr(self, nsect, key, **kwargs): """Wrap the ``sectinqr`` method to take advantage of the gRPC methods.""" - super().sectinqr(*args, pname=TMP_VAR, mute=True, **kwargs) + super().sectinqr(nsect, key, pname=TMP_VAR, mute=True, **kwargs) return self.scalar_param(TMP_VAR) @wraps(_MapdlCore.mpinqr) - def mpinqr(self, *args, key, **kwargs): + def mpinqr(self, mat, iprop, key, **kwargs): """Wrap the ``mpinqr`` method to take advantage of the gRPC methods.""" - super().mpinqr(*args, key, pname=TMP_VAR, mute=True, **kwargs) + super().mpinqr(mat, iprop, key, pname=TMP_VAR, mute=True, **kwargs) return self.scalar_param(TMP_VAR) @wraps(_MapdlCore.dget) - def dget(self, *args, **kwargs): + def dget(self, node, idf, kcmplx, **kwargs): """Wrap the ``dget`` method to take advantage of the gRPC methods.""" - super().dget(*args, pname=TMP_VAR, mute=True, **kwargs) + super().dget(node, idf, kcmplx, pname=TMP_VAR, mute=True, **kwargs) return self.scalar_param(TMP_VAR) @wraps(_MapdlCore.fget) - def fget(self, *args, **kwargs): + def fget(self, node, idf, kcmplx, **kwargs): """Wrap the ``fget`` method to take advantage of the gRPC methods.""" - super().fget(*args, pname=TMP_VAR, mute=True, **kwargs) + super().fget(node, idf, kcmplx, pname=TMP_VAR, mute=True, **kwargs) return self.scalar_param(TMP_VAR) @wraps(_MapdlCore.erinqr) - def erinqr(self, *args, **kwargs): + def erinqr(self, key, **kwargs): """Wrap the ``erinqr`` method to take advantage of the gRPC methods.""" - super().erinqr(*args, pname=TMP_VAR, mute=True, **kwargs) + super().erinqr(key, pname=TMP_VAR, mute=True, **kwargs) return self.scalar_param(TMP_VAR) @wraps(_MapdlCore.wrinqr) - def wrinqr(self, *args, **kwargs): + def wrinqr(self, key, **kwargs): """Wrap the ``wrinqr`` method to take advantage of the gRPC methods.""" - super().wrinqr(*args, pname=TMP_VAR, mute=True, **kwargs) + super().wrinqr(key, pname=TMP_VAR, mute=True, **kwargs) return self.scalar_param(TMP_VAR) From 7a046b408cb3a88df0440207db346d2f7d20cbf7 Mon Sep 17 00:00:00 2001 From: German Date: Tue, 4 Jan 2022 21:05:21 +0100 Subject: [PATCH 27/29] Improved doc string. --- ansys/mapdl/core/_commands/inq_func.py | 42 ++++++++++++++------------ 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/ansys/mapdl/core/_commands/inq_func.py b/ansys/mapdl/core/_commands/inq_func.py index 6d5d02527b..629cb1b097 100644 --- a/ansys/mapdl/core/_commands/inq_func.py +++ b/ansys/mapdl/core/_commands/inq_func.py @@ -1286,58 +1286,60 @@ def wrinqr(self, key, pname='__tmpvar__', **kwargs): **Please use it with caution.** .. warning:: Caution: the following variables are "saved/resumed". - key=WR_COLINTER thru WR_SUPCOLMAX in "wrinqr/wrinfo". + key=``WR_COLINTER`` thru ``WR_SUPCOLMAX`` in "wrinqr/wrinfo". Parameters ---------- key : int or str Key. - * WR_PRINT (kprint) + * WR_PRINT (kprint) key = 1 Print flag. * 0 - no output * 1 - print - * WR_OUTPUT (outfil) + * WR_OUTPUT (outfil) key = 2 Current output unit number(iott). - * WR_MASTEROUT (frstot) + * WR_MASTEROUT (frstot) key = 4 Master output file. - * WR_COLINTER (intcol) + * WR_COLINTER (intcol) key = 5 Interactive columns per page. - * WR_COLBATCH (batcol) + * WR_COLBATCH (batcol) key = 6 Batch columns per page. - * WR_LINEINTER (intlin) + * WR_LINEINTER (intlin) key = 7 Interactive lines per page. - * WR_LINEBATCH (batlin) + * WR_LINEBATCH (batlin) key = 8 Batch lines per page. - * WR_COMMASEP (CommaSep) + * WR_COMMASEP (CommaSep) key = 9 1 for comma separated output. - * WR_CHARITEM (chrper) + * WR_CHARITEM (chrper) key = 11 Characters per output item. - * WR_CHARDECIMAL (chrdec) + * WR_CHARDECIMAL (chrdec) key = 12 Characters past decimal. - * WR_CHARINTEGER (chrint) + * WR_CHARINTEGER (chrint) key = 13 Characters in leading integer. - * WR_CHARTYPE (chrtyp) + * WR_CHARTYPE (chrtyp) key = 14 * 1 - using E format in output. * 2 - using F format in output. * 3 - using G format in output. - * WR_SUPTITLE (keyhed) + * WR_TEMPLINEBATCH ( ) key = 15 + Undocumented (50 default). + * WR_SUPTITLE (keyhed) key = 16 Tlabel suppress key. - * WR_SUPSUBTITLE (keytit) + * WR_SUPSUBTITLE (keytit) key = 17 Subtitle suppress key. - * WR_SUPLSITER (keyid) + * WR_SUPLSITER (keyid) key = 18 Ls,iter id suppress key. - * WR_NOTELINE (keynot) + * WR_NOTELINE (keynot) key = 19 Note line suppress key. - * WR_SUPCOLHEADER (keylab) + * WR_SUPCOLHEADER (keylab) key = 20 column header suppress key. - * WR_SUPCOLMAX (keysum) + * WR_SUPCOLMAX (keysum) key = 21 Column maximum suppress key. - * WR_LISTOPT (ListOpt) + * WR_LISTOPT (ListOpt) key = 22 ListOpt from /output command. Returns From db1339f78a954de53693b239524f2d77d8c59f4b Mon Sep 17 00:00:00 2001 From: German Date: Tue, 4 Jan 2022 21:39:59 +0100 Subject: [PATCH 28/29] Better docstrings --- ansys/mapdl/core/_commands/inq_func.py | 134 ++++++++++++------------- ansys/mapdl/core/mapdl_grpc.py | 2 +- 2 files changed, 68 insertions(+), 68 deletions(-) diff --git a/ansys/mapdl/core/_commands/inq_func.py b/ansys/mapdl/core/_commands/inq_func.py index 629cb1b097..87d85ba4fd 100644 --- a/ansys/mapdl/core/_commands/inq_func.py +++ b/ansys/mapdl/core/_commands/inq_func.py @@ -15,13 +15,13 @@ def ndinqr(self, node, key, pname='__tmpvar__', **kwargs): Parameters ---------- - node : int or str + node : int node number. It should be 0 for key=11, ``DB_NUMDEFINED``, ``DB_NUMSELECTED``, ``DB_MAXDEFINED``, and ``DB_MAXRECLENG``. - key : int or str + key : int key as to information needed about the node. * DB_SELECTED - return select status: @@ -98,13 +98,13 @@ def elmiqr(self, ielem, key, pname='__tmpvar__', **kwargs): Parameters ---------- - ielem : int or str + ielem : int Element number. It should be zero for key=11, ``DB_NUMDEFINED``, ``DB_NUMSELECTED``, ``DB_MAXDEFINED``, ``DB_MAXRECLENG``, or 199 - key : int or str + key : int information flag. * DB_SELECTED - return select status: (1) @@ -177,10 +177,10 @@ def kpinqr(self, knmi, key, pname='__tmpvar__', **kwargs): Parameters ---------- - knmi : int or str + knmi : int Keypoints for inquire. may be 0 for key=11 thru 15. - key : int or str + key : int Information flag. * 1 - return select @@ -280,10 +280,10 @@ def lsinqr(self, line, key, pname='__tmpvar__', **kwargs): Parameters ---------- - lnmi : int or str + lnmi : int Line segment for inquire. It should be 0 for key=11 thru 15. - key : float or str + key : float key as to information needed about the ``lnmi``. * 1, return select @@ -369,10 +369,10 @@ def arinqr(self, anmi, key, pname='__tmpvar__', **kwargs): Parameters ---------- - anmi : int or str + anmi : int Area for inquire. may be 0 for key=11 thru 15. - key : float or str + key : float Key as to information needed about the ``anmi``. * 1, return select @@ -438,8 +438,8 @@ def arinqr(self, anmi, key, pname='__tmpvar__', **kwargs): * -1 = ``anmi`` is unselected. * 1 = ``anmi`` is selected. - For key ne 1 returned data is based - on setting of key. + For key not equal to 1, the returned data is based + on setting of key. """ return self.run(f"{pname} = arinqr({anmi}, {key})", **kwargs) @@ -456,10 +456,10 @@ def vlinqr(self, vnmi, key, pname='__tmpvar__', **kwargs): Parameters ---------- - vnmi : int or str + vnmi : int Volume for inquire. may be 0 for key=11 thru 15. - key : float or str + key : float Key as to information needed about the ``vnmi``. * 1, return select @@ -526,13 +526,13 @@ def rlinqr(self, nreal, key, pname='__tmpvar__', **kwargs): Parameters ---------- - nreal : int or str + nreal : int Real constant table number should be 0 for key=11, ``DB_NUMDEFINED``, ``DB_NUMSELECTED``, ``DB_MAXDEFINED``, and ``DB_MAXRECLENG``. - key : int or str + key : int Information flag. * 5 - return number of values stored for nreal. @@ -572,10 +572,10 @@ def gapiqr(self, ngap, key, pname='__tmpvar__', **kwargs): Parameters ---------- - ngap : int or str + ngap : int gap number for inquire (must be zero for now). - key : int or str + key : int key as to the information needed * 1, return select @@ -610,10 +610,10 @@ def masiqr(self, node, key, pname='__tmpvar__', **kwargs): Parameters ---------- - node : int or str + node : int Node number for inquire (must be zero for now). - key : int or str + key : int Key as to the information needed * 1, return select @@ -633,7 +633,7 @@ def masiqr(self, node, key, pname='__tmpvar__', **kwargs): Returns ------- - masiqr int or str + masiqr int Returned data is based on setting of key. """ return self.run(f"{pname} = masiqr({node}, {key})", **kwargs) @@ -648,10 +648,10 @@ def ceinqr(self, nce, key, pname='__tmpvar__', **kwargs): Parameters ---------- - nce : int or str + nce : int Constraint equation number - key : int or str + key : int Inquiry key. It should be zero for key=11, ``DB_NUMDEFINED``, ``DB_NUMSELECTED``, ``DB_MAXDEFINED``, and @@ -703,10 +703,10 @@ def cpinqr(self, ncp, key, pname='__tmpvar__', **kwargs): Parameters ---------- - ncp : int or str + ncp : int Coupled set number - key : int or str + key : int Inquiry key. It should be zero for key=11, ``DB_NUMDEFINED``, ``DB_NUMSELECTED``, ``DB_MAXDEFINED``, and ``DB_MAXRECLENG`` @@ -755,12 +755,12 @@ def csyiqr(self, ncsy, key, pname='__tmpvar__', **kwargs): Parameters ---------- - ncsy : int or str + ncsy : int Coordinate system reference number should be zero for key= ``DB_NUMDEFINED`` or ``DB_MAXDEFINED`` - key : int or str + key : int Information flag. * ``DB_SELECTED`` - return status: @@ -796,13 +796,13 @@ def etyiqr(self, itype, key, pname='__tmpvar__', **kwargs): Parameters ---------- - itype : int or str + itype : int Element type number. It should be 0 for key=11, ``DB_NUMDEFINED``, ``DB_NUMSELECTED``, ``DB_MAXDEFINED``, and ``DB_MAXRECLENG`` - key : int or str + key : int Information flag. * DB_SELECTED - return select status: @@ -846,12 +846,12 @@ def foriqr(self, node, key, pname='__tmpvar__', **kwargs): Parameters ---------- - node : int or str + node : int Number of node being inquired about. should be 0 for key=``DB_MAXDEFINED`` or ``DB_NUMDEFINED``. - key : float or str + key : float Key as to information needed * 1 - return force mask for node @@ -884,13 +884,13 @@ def sectinqr(self, nsect, key, pname='__tmpvar__', **kwargs): Parameters ---------- - nsect : int or str + nsect : int Section id table number should be 0 for key=11, ``DB_NUMDEFINED``, ``DB_NUMSELECTED``, ``DB_MAXDEFINED``, and ``DB_MAXRECLENG``. - key : int or str + key : int Information flag. * DB_SELECTED - return select status * 0 - ection id table is undefined. @@ -946,12 +946,12 @@ def mpinqr(self, mat, iprop, key, pname='__tmpvar__', **kwargs): Parameters ---------- - mat : int or str + mat : int Material number should be 0 for key=11, ``DB_NUMDEFINED(12)``, ``DB_MAXDEFINED(14)``, and ``DB_MAXRECLENG(15)``. - iprop : int or str + iprop : int Property reference number (See notes). If iprop = 0, test for existence of any material property with this @@ -984,7 +984,7 @@ def mpinqr(self, mat, iprop, key, pname='__tmpvar__', **kwargs): (see ``TB`` command for more information) - key : int or str + key : int Key as to the information needed about material property. * ``DB_SELECTED(1)``- return select status: @@ -1023,10 +1023,10 @@ def dget(self, node, idf, kcmplx, pname='__tmpvar__', **kwargs): Parameters ---------- - node : int or str + node : int Node number - idf : int or str + idf : int Pointer to the dof (1-32) * 1 = ux, @@ -1052,7 +1052,7 @@ def dget(self, node, idf, kcmplx, pname='__tmpvar__', **kwargs): * 26 = curr * 27-32 = SP01-SP06 - kcmplx : int or str + kcmplx : int * 0 = real * 1 = imaginary @@ -1065,7 +1065,7 @@ def dget(self, node, idf, kcmplx, pname='__tmpvar__', **kwargs): Returns ------- - float or str + float Constraint value (High number if undefined) """ return self.run(f"{pname} = dget({node}, {idf}, {kcmplx})", **kwargs) @@ -1080,10 +1080,10 @@ def fget(self, node, idf, kcmplx, pname='__tmpvar__', **kwargs): Parameters ---------- - node : int or str + node : int Node number - idf : int or str + idf : int Pointer to the dof (1-32) * 1 = ux @@ -1109,7 +1109,7 @@ def fget(self, node, idf, kcmplx, pname='__tmpvar__', **kwargs): * 26 = curr * 27-32 = spares - kcmplx : int or str + kcmplx : int * 0 = real * 1 = imaginary @@ -1122,7 +1122,7 @@ def fget(self, node, idf, kcmplx, pname='__tmpvar__', **kwargs): Returns ------- - float or str + float Force value (high number if undefined) """ return self.run(f"{pname} = fget({node}, {idf}, {kcmplx})", **kwargs) @@ -1137,7 +1137,7 @@ def erinqr(self, key, pname='__tmpvar__', **kwargs): Parameters ---------- - key : int or str + key : int Item to be returned. * 1 = keyerr (ER_ERRORFLAG) @@ -1278,7 +1278,7 @@ def erinqr(self, key, pname='__tmpvar__', **kwargs): return self.run(f"{pname} = erinqr({key})", **kwargs) def wrinqr(self, key, pname='__tmpvar__', **kwargs): - """Obtain information about output + """Obtain information about output. .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. @@ -1290,56 +1290,56 @@ def wrinqr(self, key, pname='__tmpvar__', **kwargs): Parameters ---------- - key : int or str + key : int Key. - * WR_PRINT (kprint) key = 1 + * 1 kprint (WR_PRINT) Print flag. * 0 - no output * 1 - print - * WR_OUTPUT (outfil) key = 2 + * 2 - outfil (WR_OUTPUT) Current output unit number(iott). - * WR_MASTEROUT (frstot) key = 4 + * 4 - frstot (WR_MASTEROUT) Master output file. - * WR_COLINTER (intcol) key = 5 + * 5 - intcol (WR_COLINTER) Interactive columns per page. - * WR_COLBATCH (batcol) key = 6 + * 6 - batcol (WR_COLBATCH) Batch columns per page. - * WR_LINEINTER (intlin) key = 7 + * 7 - intlin (WR_LINEINTER) Interactive lines per page. - * WR_LINEBATCH (batlin) key = 8 + * 8 - batlin (WR_LINEBATCH) Batch lines per page. - * WR_COMMASEP (CommaSep) key = 9 + * 9 - CommaSep (WR_COMMASEP) 1 for comma separated output. - * WR_CHARITEM (chrper) key = 11 + * 11 - chrper (WR_CHARITEM) Characters per output item. - * WR_CHARDECIMAL (chrdec) key = 12 + * 12 - chrdec (WR_CHARDECIMAL) Characters past decimal. - * WR_CHARINTEGER (chrint) key = 13 + * 13 - chrint (WR_CHARINTEGER) Characters in leading integer. - * WR_CHARTYPE (chrtyp) key = 14 + * 14 - chrtyp (WR_CHARTYPE) * 1 - using E format in output. * 2 - using F format in output. * 3 - using G format in output. - * WR_TEMPLINEBATCH ( ) key = 15 + * 15 - (WR_TEMPLINEBATCH) Undocumented (50 default). - * WR_SUPTITLE (keyhed) key = 16 + * 16 - keyhed (WR_SUPTITLE) Tlabel suppress key. - * WR_SUPSUBTITLE (keytit) key = 17 + * 17 - keytit (WR_SUPSUBTITLE) Subtitle suppress key. - * WR_SUPLSITER (keyid) key = 18 + * 18 - keyid (WR_SUPLSITER) Ls,iter id suppress key. - * WR_NOTELINE (keynot) key = 19 + * 19 - keynot (WR_NOTELINE) Note line suppress key. - * WR_SUPCOLHEADER (keylab) key = 20 + * 20 - keylab (WR_SUPCOLHEADER) column header suppress key. - * WR_SUPCOLMAX (keysum) key = 21 + * 21 - keysum (WR_SUPCOLMAX) Column maximum suppress key. - * WR_LISTOPT (ListOpt) key = 22 + * 22 - ListOpt (WR_LISTOPT) ListOpt from /output command. Returns diff --git a/ansys/mapdl/core/mapdl_grpc.py b/ansys/mapdl/core/mapdl_grpc.py index 91bb0f0f08..762f562b42 100755 --- a/ansys/mapdl/core/mapdl_grpc.py +++ b/ansys/mapdl/core/mapdl_grpc.py @@ -2003,4 +2003,4 @@ def erinqr(self, key, **kwargs): def wrinqr(self, key, **kwargs): """Wrap the ``wrinqr`` method to take advantage of the gRPC methods.""" super().wrinqr(key, pname=TMP_VAR, mute=True, **kwargs) - return self.scalar_param(TMP_VAR) + return self.scalar_param(TMP_VAR) \ No newline at end of file From d4cfb7b8c61da4d34e05ee54732ef7746273bdc1 Mon Sep 17 00:00:00 2001 From: German Date: Tue, 4 Jan 2022 21:41:07 +0100 Subject: [PATCH 29/29] Better docstrings --- ansys/mapdl/core/_commands/inq_func.py | 134 ++++++++++++------------- 1 file changed, 67 insertions(+), 67 deletions(-) diff --git a/ansys/mapdl/core/_commands/inq_func.py b/ansys/mapdl/core/_commands/inq_func.py index 629cb1b097..87d85ba4fd 100644 --- a/ansys/mapdl/core/_commands/inq_func.py +++ b/ansys/mapdl/core/_commands/inq_func.py @@ -15,13 +15,13 @@ def ndinqr(self, node, key, pname='__tmpvar__', **kwargs): Parameters ---------- - node : int or str + node : int node number. It should be 0 for key=11, ``DB_NUMDEFINED``, ``DB_NUMSELECTED``, ``DB_MAXDEFINED``, and ``DB_MAXRECLENG``. - key : int or str + key : int key as to information needed about the node. * DB_SELECTED - return select status: @@ -98,13 +98,13 @@ def elmiqr(self, ielem, key, pname='__tmpvar__', **kwargs): Parameters ---------- - ielem : int or str + ielem : int Element number. It should be zero for key=11, ``DB_NUMDEFINED``, ``DB_NUMSELECTED``, ``DB_MAXDEFINED``, ``DB_MAXRECLENG``, or 199 - key : int or str + key : int information flag. * DB_SELECTED - return select status: (1) @@ -177,10 +177,10 @@ def kpinqr(self, knmi, key, pname='__tmpvar__', **kwargs): Parameters ---------- - knmi : int or str + knmi : int Keypoints for inquire. may be 0 for key=11 thru 15. - key : int or str + key : int Information flag. * 1 - return select @@ -280,10 +280,10 @@ def lsinqr(self, line, key, pname='__tmpvar__', **kwargs): Parameters ---------- - lnmi : int or str + lnmi : int Line segment for inquire. It should be 0 for key=11 thru 15. - key : float or str + key : float key as to information needed about the ``lnmi``. * 1, return select @@ -369,10 +369,10 @@ def arinqr(self, anmi, key, pname='__tmpvar__', **kwargs): Parameters ---------- - anmi : int or str + anmi : int Area for inquire. may be 0 for key=11 thru 15. - key : float or str + key : float Key as to information needed about the ``anmi``. * 1, return select @@ -438,8 +438,8 @@ def arinqr(self, anmi, key, pname='__tmpvar__', **kwargs): * -1 = ``anmi`` is unselected. * 1 = ``anmi`` is selected. - For key ne 1 returned data is based - on setting of key. + For key not equal to 1, the returned data is based + on setting of key. """ return self.run(f"{pname} = arinqr({anmi}, {key})", **kwargs) @@ -456,10 +456,10 @@ def vlinqr(self, vnmi, key, pname='__tmpvar__', **kwargs): Parameters ---------- - vnmi : int or str + vnmi : int Volume for inquire. may be 0 for key=11 thru 15. - key : float or str + key : float Key as to information needed about the ``vnmi``. * 1, return select @@ -526,13 +526,13 @@ def rlinqr(self, nreal, key, pname='__tmpvar__', **kwargs): Parameters ---------- - nreal : int or str + nreal : int Real constant table number should be 0 for key=11, ``DB_NUMDEFINED``, ``DB_NUMSELECTED``, ``DB_MAXDEFINED``, and ``DB_MAXRECLENG``. - key : int or str + key : int Information flag. * 5 - return number of values stored for nreal. @@ -572,10 +572,10 @@ def gapiqr(self, ngap, key, pname='__tmpvar__', **kwargs): Parameters ---------- - ngap : int or str + ngap : int gap number for inquire (must be zero for now). - key : int or str + key : int key as to the information needed * 1, return select @@ -610,10 +610,10 @@ def masiqr(self, node, key, pname='__tmpvar__', **kwargs): Parameters ---------- - node : int or str + node : int Node number for inquire (must be zero for now). - key : int or str + key : int Key as to the information needed * 1, return select @@ -633,7 +633,7 @@ def masiqr(self, node, key, pname='__tmpvar__', **kwargs): Returns ------- - masiqr int or str + masiqr int Returned data is based on setting of key. """ return self.run(f"{pname} = masiqr({node}, {key})", **kwargs) @@ -648,10 +648,10 @@ def ceinqr(self, nce, key, pname='__tmpvar__', **kwargs): Parameters ---------- - nce : int or str + nce : int Constraint equation number - key : int or str + key : int Inquiry key. It should be zero for key=11, ``DB_NUMDEFINED``, ``DB_NUMSELECTED``, ``DB_MAXDEFINED``, and @@ -703,10 +703,10 @@ def cpinqr(self, ncp, key, pname='__tmpvar__', **kwargs): Parameters ---------- - ncp : int or str + ncp : int Coupled set number - key : int or str + key : int Inquiry key. It should be zero for key=11, ``DB_NUMDEFINED``, ``DB_NUMSELECTED``, ``DB_MAXDEFINED``, and ``DB_MAXRECLENG`` @@ -755,12 +755,12 @@ def csyiqr(self, ncsy, key, pname='__tmpvar__', **kwargs): Parameters ---------- - ncsy : int or str + ncsy : int Coordinate system reference number should be zero for key= ``DB_NUMDEFINED`` or ``DB_MAXDEFINED`` - key : int or str + key : int Information flag. * ``DB_SELECTED`` - return status: @@ -796,13 +796,13 @@ def etyiqr(self, itype, key, pname='__tmpvar__', **kwargs): Parameters ---------- - itype : int or str + itype : int Element type number. It should be 0 for key=11, ``DB_NUMDEFINED``, ``DB_NUMSELECTED``, ``DB_MAXDEFINED``, and ``DB_MAXRECLENG`` - key : int or str + key : int Information flag. * DB_SELECTED - return select status: @@ -846,12 +846,12 @@ def foriqr(self, node, key, pname='__tmpvar__', **kwargs): Parameters ---------- - node : int or str + node : int Number of node being inquired about. should be 0 for key=``DB_MAXDEFINED`` or ``DB_NUMDEFINED``. - key : float or str + key : float Key as to information needed * 1 - return force mask for node @@ -884,13 +884,13 @@ def sectinqr(self, nsect, key, pname='__tmpvar__', **kwargs): Parameters ---------- - nsect : int or str + nsect : int Section id table number should be 0 for key=11, ``DB_NUMDEFINED``, ``DB_NUMSELECTED``, ``DB_MAXDEFINED``, and ``DB_MAXRECLENG``. - key : int or str + key : int Information flag. * DB_SELECTED - return select status * 0 - ection id table is undefined. @@ -946,12 +946,12 @@ def mpinqr(self, mat, iprop, key, pname='__tmpvar__', **kwargs): Parameters ---------- - mat : int or str + mat : int Material number should be 0 for key=11, ``DB_NUMDEFINED(12)``, ``DB_MAXDEFINED(14)``, and ``DB_MAXRECLENG(15)``. - iprop : int or str + iprop : int Property reference number (See notes). If iprop = 0, test for existence of any material property with this @@ -984,7 +984,7 @@ def mpinqr(self, mat, iprop, key, pname='__tmpvar__', **kwargs): (see ``TB`` command for more information) - key : int or str + key : int Key as to the information needed about material property. * ``DB_SELECTED(1)``- return select status: @@ -1023,10 +1023,10 @@ def dget(self, node, idf, kcmplx, pname='__tmpvar__', **kwargs): Parameters ---------- - node : int or str + node : int Node number - idf : int or str + idf : int Pointer to the dof (1-32) * 1 = ux, @@ -1052,7 +1052,7 @@ def dget(self, node, idf, kcmplx, pname='__tmpvar__', **kwargs): * 26 = curr * 27-32 = SP01-SP06 - kcmplx : int or str + kcmplx : int * 0 = real * 1 = imaginary @@ -1065,7 +1065,7 @@ def dget(self, node, idf, kcmplx, pname='__tmpvar__', **kwargs): Returns ------- - float or str + float Constraint value (High number if undefined) """ return self.run(f"{pname} = dget({node}, {idf}, {kcmplx})", **kwargs) @@ -1080,10 +1080,10 @@ def fget(self, node, idf, kcmplx, pname='__tmpvar__', **kwargs): Parameters ---------- - node : int or str + node : int Node number - idf : int or str + idf : int Pointer to the dof (1-32) * 1 = ux @@ -1109,7 +1109,7 @@ def fget(self, node, idf, kcmplx, pname='__tmpvar__', **kwargs): * 26 = curr * 27-32 = spares - kcmplx : int or str + kcmplx : int * 0 = real * 1 = imaginary @@ -1122,7 +1122,7 @@ def fget(self, node, idf, kcmplx, pname='__tmpvar__', **kwargs): Returns ------- - float or str + float Force value (high number if undefined) """ return self.run(f"{pname} = fget({node}, {idf}, {kcmplx})", **kwargs) @@ -1137,7 +1137,7 @@ def erinqr(self, key, pname='__tmpvar__', **kwargs): Parameters ---------- - key : int or str + key : int Item to be returned. * 1 = keyerr (ER_ERRORFLAG) @@ -1278,7 +1278,7 @@ def erinqr(self, key, pname='__tmpvar__', **kwargs): return self.run(f"{pname} = erinqr({key})", **kwargs) def wrinqr(self, key, pname='__tmpvar__', **kwargs): - """Obtain information about output + """Obtain information about output. .. warning:: **DISCLAIMER**: This function is un-documented in the official ANSYS Command Reference Guide. @@ -1290,56 +1290,56 @@ def wrinqr(self, key, pname='__tmpvar__', **kwargs): Parameters ---------- - key : int or str + key : int Key. - * WR_PRINT (kprint) key = 1 + * 1 kprint (WR_PRINT) Print flag. * 0 - no output * 1 - print - * WR_OUTPUT (outfil) key = 2 + * 2 - outfil (WR_OUTPUT) Current output unit number(iott). - * WR_MASTEROUT (frstot) key = 4 + * 4 - frstot (WR_MASTEROUT) Master output file. - * WR_COLINTER (intcol) key = 5 + * 5 - intcol (WR_COLINTER) Interactive columns per page. - * WR_COLBATCH (batcol) key = 6 + * 6 - batcol (WR_COLBATCH) Batch columns per page. - * WR_LINEINTER (intlin) key = 7 + * 7 - intlin (WR_LINEINTER) Interactive lines per page. - * WR_LINEBATCH (batlin) key = 8 + * 8 - batlin (WR_LINEBATCH) Batch lines per page. - * WR_COMMASEP (CommaSep) key = 9 + * 9 - CommaSep (WR_COMMASEP) 1 for comma separated output. - * WR_CHARITEM (chrper) key = 11 + * 11 - chrper (WR_CHARITEM) Characters per output item. - * WR_CHARDECIMAL (chrdec) key = 12 + * 12 - chrdec (WR_CHARDECIMAL) Characters past decimal. - * WR_CHARINTEGER (chrint) key = 13 + * 13 - chrint (WR_CHARINTEGER) Characters in leading integer. - * WR_CHARTYPE (chrtyp) key = 14 + * 14 - chrtyp (WR_CHARTYPE) * 1 - using E format in output. * 2 - using F format in output. * 3 - using G format in output. - * WR_TEMPLINEBATCH ( ) key = 15 + * 15 - (WR_TEMPLINEBATCH) Undocumented (50 default). - * WR_SUPTITLE (keyhed) key = 16 + * 16 - keyhed (WR_SUPTITLE) Tlabel suppress key. - * WR_SUPSUBTITLE (keytit) key = 17 + * 17 - keytit (WR_SUPSUBTITLE) Subtitle suppress key. - * WR_SUPLSITER (keyid) key = 18 + * 18 - keyid (WR_SUPLSITER) Ls,iter id suppress key. - * WR_NOTELINE (keynot) key = 19 + * 19 - keynot (WR_NOTELINE) Note line suppress key. - * WR_SUPCOLHEADER (keylab) key = 20 + * 20 - keylab (WR_SUPCOLHEADER) column header suppress key. - * WR_SUPCOLMAX (keysum) key = 21 + * 21 - keysum (WR_SUPCOLMAX) Column maximum suppress key. - * WR_LISTOPT (ListOpt) key = 22 + * 22 - ListOpt (WR_LISTOPT) ListOpt from /output command. Returns