|
22 | 22 |
|
23 | 23 |
|
24 | 24 | class Abbreviations: |
| 25 | + |
25 | 26 | def abbr(self, abbr="", string="", **kwargs): |
26 | | - """Defines an abbreviation. |
| 27 | + r"""Defines an abbreviation. |
27 | 28 |
|
28 | | - APDL Command: ``*ABBR`` |
| 29 | + Mechanical APDL Command: `\*ABBR <https://ansyshelp.ansys.com/Views/Secured/corp/v232/en//ans_cmd/Hlp_C_ABBR.html>`_ |
29 | 30 |
|
30 | 31 | Parameters |
31 | 32 | ---------- |
32 | | - abbr |
33 | | - The abbreviation (up to 8 alphanumeric characters) used to |
34 | | - represent the string String. If Abbr is the same as an existing |
35 | | - ANSYS command, the abbreviation overrides. Avoid using an Abbr |
36 | | - which is the same as an ANSYS command. |
37 | | -
|
38 | | - string |
39 | | - String of characters (60 maximum) represented by Abbr. |
40 | | - Cannot include a $ or any of the commands ``C***``, /COM, |
41 | | - /GOPR, /NOPR, /QUIT, /UI, or ``*END``. |
42 | | -
|
43 | | - Use the ``*IF`` groups may not be abbreviated. If String |
44 | | - is blank, the abbreviation is deleted. To abbreviate |
45 | | - multiple commands, create an "unknown command" macro or |
46 | | - define String to execute a macro file [``*USE``] |
47 | | - containing the desired commands. |
| 33 | + abbr : str |
| 34 | + The abbreviation (up to 8 alphanumeric characters) used to represent the string ``String`` . If |
| 35 | + ``Abbr`` is the same as an existing Mechanical APDL command, the abbreviation overrides. Avoid using an |
| 36 | + ``Abbr`` which is the same as an Mechanical APDL command. |
| 37 | +
|
| 38 | + string : str |
| 39 | + String of characters (60 maximum) represented by ``Abbr`` . Cannot include a $ or any of the |
| 40 | + commands :ref:`c`, :ref:`com`, :ref:`gopr`, :ref:`nopr`, :ref:`quit`, :ref:`ui`, or |
| 41 | + :ref:`end` . Parameter names and commands of the :ref:`do` and Use the :ref:`if` groups may not |
| 42 | + be abbreviated. If ``String`` is blank, the abbreviation is deleted. To abbreviate multiple |
| 43 | + commands, create an "unknown command" macro or define ``String`` to execute a macro file ( |
| 44 | + :ref:`use` ) containing the desired commands. |
48 | 45 |
|
49 | 46 | Notes |
50 | 47 | ----- |
51 | | - Once the abbreviation Abbr is defined, you can issue it at the |
52 | | - beginning of a command line and follow it with a blank (or with a comma |
53 | | - and appended data), and the program will substitute the string String |
54 | | - for Abbr as the line is executed. Up to 100 abbreviations may exist at |
55 | | - any time and are available throughout the program. Abbreviations may be |
56 | | - redefined or deleted at any time. |
57 | | -
|
58 | | - Use ``*STATUS`` to display the current list of abbreviations. For |
59 | | - abbreviations repeated with ``*REPEAT``, substitution occurs before the |
60 | | - repeat increments are applied. There are a number of abbreviations that |
61 | | - are predefined by the program (these can be deleted by using the blank |
62 | | - String option described above). Note that String will be written to the |
63 | | - File.LOG. |
| 48 | + Once the abbreviation ``Abbr`` is defined, you can issue it at the beginning of a command line and follow it with a blank (or with a comma and appended data), and the program will substitute the string ``String`` for ``Abbr`` as the line is executed. Up to 100 abbreviations may exist at any time and are available throughout the program. Abbreviations may be redefined or deleted at any time. |
| 49 | +
|
| 50 | + Use :ref:`starstatus` to display the current list of abbreviations. For abbreviations repeated with :ref:`repeat`, substitution occurs before the repeat increments are applied. There are a number of abbreviations that are predefined by the program (these can be deleted by using the blank ``String`` option described above). Note that ``String`` will be written to the ``File.LOG`` . |
64 | 51 |
|
65 | 52 | This command is valid in any processor. |
66 | 53 | """ |
67 | 54 | command = f"*ABBR,{abbr},{string}" |
68 | 55 | return self.run(command, **kwargs) |
69 | 56 |
|
70 | | - def abbres(self, lab="", fname="", ext="", **kwargs): |
71 | | - """Reads abbreviations from a coded file. |
| 57 | + def abbres(self, lab="", **kwargs): |
| 58 | + r"""Reads abbreviations from a coded file. |
72 | 59 |
|
73 | | - APDL Command: ABBRES |
| 60 | + Mechanical APDL Command: `ABBRES <https://ansyshelp.ansys.com/Views/Secured/corp/v232/en//ans_cmd/Hlp_C_ABBRES.html>`_ |
74 | 61 |
|
75 | 62 | Parameters |
76 | 63 | ---------- |
77 | | - lab |
| 64 | + lab : str |
78 | 65 | Label that specifies the read operation: |
79 | 66 |
|
80 | | - NEW |
81 | | - Replace current abbreviation set with these abbreviations (default). |
| 67 | + * ``NEW`` - Replace current abbreviation set with these abbreviations (default). |
82 | 68 |
|
83 | | - CHANGE |
84 | | - Extend current abbreviation set with these abbreviations, replacing any of the |
85 | | - same name that already exist. |
| 69 | + * ``CHANGE`` - Extend current abbreviation set with these abbreviations, replacing any of |
| 70 | + the |
| 71 | + same name that already exist. |
86 | 72 |
|
87 | | - fname |
88 | | - File name and directory path (248 characters maximum, including the |
89 | | - characters needed for the directory path). An unspecified |
90 | | - directory path defaults to the working directory; in this case, you |
91 | | - can use all 248 characters for the file name. |
| 73 | + fname : str |
| 74 | + File name and directory path (248 characters maximum, including the characters needed for the directory path). An unspecified directory path defaults to the working directory; in this case, you can use all 248 characters for the file name. |
| 75 | + The file name defaults to ``Jobname`` . |
92 | 76 |
|
93 | | - ext |
| 77 | + ext : str |
94 | 78 | Filename extension (eight-character maximum). |
| 79 | + The extension defaults to ABBR if ``Fname`` is blank. |
95 | 80 |
|
96 | 81 | Notes |
97 | 82 | ----- |
98 | | - The abbreviation file may have been written with the ABBSAV command. Do |
99 | | - not issue ABBRES,NEW while inside an executing abbreviation. Doing so |
100 | | - will cause all data for the executing abbreviation to be deleted. |
| 83 | + The abbreviation file may have been written with the :ref:`abbsav` command. Do not issue :ref:`abbres` ,NEW while inside an executing abbreviation. Doing so will cause all data for the executing abbreviation to be deleted. |
101 | 84 |
|
102 | 85 | This command is valid in any processor. |
103 | 86 | """ |
104 | | - command = f"ABBRES,{lab},{fname},{ext}" |
| 87 | + command = f"ABBRES,{lab}" |
105 | 88 | return self.run(command, **kwargs) |
106 | 89 |
|
107 | | - def abbsav(self, lab="", fname="", ext="", **kwargs): |
108 | | - """Writes the current abbreviation set to a coded file. |
| 90 | + def abbsav(self, lab="", **kwargs): |
| 91 | + r"""Writes the current abbreviation set to a coded file. |
109 | 92 |
|
110 | | - APDL Command: ABBSAV |
| 93 | + Mechanical APDL Command: `ABBSAV <https://ansyshelp.ansys.com/Views/Secured/corp/v232/en//ans_cmd/Hlp_C_ABBSAV.html>`_ |
111 | 94 |
|
112 | 95 | Parameters |
113 | 96 | ---------- |
114 | | - lab |
115 | | - Label that specifies the write operation. |
116 | | -
|
117 | | - ALL - Write all abbreviations (default). |
| 97 | + lab : str |
| 98 | + Label that specifies the write operation: |
118 | 99 |
|
119 | | - fname |
120 | | - File name and directory path (248 characters maximum, |
121 | | - including the characters needed for the directory path). |
122 | | - An unspecified directory path defaults to the working |
123 | | - directory; in this case, you can use all 248 characters |
124 | | - for the file name. |
| 100 | + * ``ALL`` - Write all abbreviations (default). |
125 | 101 |
|
126 | | - The file name defaults to Jobname. |
| 102 | + fname : str |
| 103 | + File name and directory path (248 characters maximum, including the characters needed for the directory path). An unspecified directory path defaults to the working directory; in this case, you can use all 248 characters for the file name. |
| 104 | + The file name defaults to ``Jobname`` . |
127 | 105 |
|
128 | | - ext |
129 | | - Filename extension (eight-character maximum). The |
130 | | - extension defaults to ABBR if Fname is blank. |
| 106 | + ext : str |
| 107 | + Filename extension (eight-character maximum). |
| 108 | + The extension defaults to ABBR if ``Fname`` is blank. |
131 | 109 |
|
132 | 110 | Notes |
133 | 111 | ----- |
134 | | - Existing abbreviations on this file, if any, will be overwritten. The |
135 | | - abbreviation file may be read with the ABBRES command. |
| 112 | + Existing abbreviations on this file, if any, will be overwritten. The abbreviation file may be read with the :ref:`abbres` command. |
136 | 113 |
|
137 | 114 | This command is valid in any processor. |
138 | 115 | """ |
139 | | - command = f"ABBSAV,{lab},{fname},{ext}" |
| 116 | + command = f"ABBSAV,{lab}" |
140 | 117 | return self.run(command, **kwargs) |
141 | 118 |
|
142 | 119 | def ucmd(self, cmd="", srnum="", **kwargs): |
143 | | - """Assigns a user-defined command name. |
| 120 | + r"""Assigns a user-defined command name. |
144 | 121 |
|
145 | | - APDL Command: /UCMD |
| 122 | + Mechanical APDL Command: `/UCMD <https://ansyshelp.ansys.com/Views/Secured/corp/v232/en//ans_cmd/Hlp_C_UCMD.html>`_ |
146 | 123 |
|
147 | 124 | Parameters |
148 | 125 | ---------- |
149 | | - cmd |
150 | | - User-defined command name. Only the first four characters are |
151 | | - significant. Must not conflict with any ANSYS command name or any |
152 | | - user "unknown command" macro name. |
153 | | -
|
154 | | - srnum |
155 | | - User subroutine number (1 to 10) programmed for this command. For |
156 | | - example, the command /UCMD,MYCMD,3 will execute subroutine USER03 |
157 | | - whenever the command MYCMD is entered. Use a blank command name to |
158 | | - disassociate SRNUM from its command. For example, /UCMD,,3 removes |
159 | | - MYCMD as a command. |
| 126 | + cmd : str |
| 127 | + User-defined command name. Only the first four characters are significant. Must not conflict |
| 128 | + with any Mechanical APDL command name or any user unknown-command macro name. |
| 129 | +
|
| 130 | + srnum : str |
| 131 | + User subroutine number (1 to 10) programmed for this command. For example, the command |
| 132 | + :ref:`ucmd` ,MYCMD,3 will execute subroutine USER03 whenever the command MYCMD is entered. Use a |
| 133 | + blank command name to disassociate ``SRNUM`` from its command. For example, :ref:`ucmd` ,,3 |
| 134 | + removes MYCMD as a command. |
160 | 135 |
|
161 | 136 | Notes |
162 | 137 | ----- |
163 | | - Assigns a user-defined command name to a user-programmable (system- |
164 | | - dependent) subroutine. This feature allows user-defined commands to be |
165 | | - programmed into the ANSYS program. Once programmed, this command can |
166 | | - be input to the program like other commands, and can also be included |
167 | | - in the ANSYS start-up file. See ``*ULIB`` for another way of defining user |
168 | | - commands. |
169 | | -
|
170 | | - Up to 10 subroutines are available for user-defined commands (USER01 to |
171 | | - USER10). Users must have system permission, system access, and |
172 | | - knowledge to write, compile, and link the appropriate subprocessors |
173 | | - into the ANSYS program at the site where it is to be run. All routines |
174 | | - should be written in FORTRAN. For more information on FORTRAN compilers |
175 | | - please refer to either the ANSYS, Inc. Windows Installation Guide or |
176 | | - the ANSYS, Inc. Linux Installation Guide for details specific to your |
177 | | - platform or operating system. The USER01 routine is commented and |
178 | | - should be listed from the distribution media (system dependent) for |
179 | | - more details. Issue /UCMD,STAT to list all user-defined command names. |
180 | | - Since a user-programmed command is a nonstandard use of the program, |
181 | | - the verification of any ANSYS run incorporating these commands is |
182 | | - entirely up to the user. In any contact with ANSYS customer support |
183 | | - regarding the performance of a custom version of the ANSYS program, you |
184 | | - should explicitly state that a user programmable feature has been used. |
185 | | - See the Advanced Analysis Guide for a general description of user- |
186 | | - programmable features and Guide to User-Programmable Features for a |
187 | | - detailed description of these features. |
| 138 | + Assigns a user-defined command name to a user-programmable (system-dependent) subroutine. This feature allows user-defined commands to be programmed into Mechanical APDL. Once programmed, this command can be input to the program like other commands, and can also be included in the Mechanical APDL start-up file. |
| 139 | +
|
| 140 | + Up to 10 subroutines are available for user-defined commands (USER01 to USER10). You must have system permission, system access, and knowledge to write, compile, and link the appropriate subprocessors into Mechanical APDL at your site. |
| 141 | +
|
| 142 | + All routines should be written in FORTRAN. For more information about FORTRAN compilers, refer to either the `Ansys, Inc. Windows Installation Guide <https://ansyshelp.ansys.com/Views/Secured/corp/v232/en/installation/win_product_table.html>`_ or the `Ansys, Inc. Linux Installation Guide <https://ansyshelp.ansys.com/Views/Secured/corp/v232/en/installation/lin_product_table.html>`_ for details specific to your platform or operating system. |
| 143 | +
|
| 144 | + The USER01 routine is commented and should be listed from the distribution media (system dependent) for more details. |
| 145 | +
|
| 146 | + Issue :ref:`ucmd` ,STAT to list all user-defined command names. |
| 147 | +
|
| 148 | + Because a user-programmed command is a nonstandard use of the program, the verification of any Mechanical APDL run incorporating these commands is your responsibility. In any contact with Mechanical APDL customer support regarding the performance of a custom version of Mechanical APDL, explicitly state that a user-programmable feature has been used. |
| 149 | +
|
| 150 | + See `User-Programmable Features (UPFs) <https://ansyshelp.ansys.com/Views/Secured/corp/v232/en/ans_adv/Hlp_G_ADV7_1.html#aRzouq21ldm>`_ `Guide to User-Programmable Features <https://ansyshelp.ansys.com/Views/Secured/corp/v232/en/ans_prog/ansysprog_aero_fullycoupled.html>`_ |
| 151 | +
|
| 152 | + See :ref:`ulib` for another way of defining user commands. |
188 | 153 |
|
189 | 154 | This command is valid only at the Begin Level. |
190 | 155 | """ |
|
0 commit comments