How to issue APDL commands in a particular solver phase for a multistep analysis?

Ayush Kumar
Member, Moderator, Employee Posts: 479
✭✭✭✭
I am performing a ModalSuperposition (MSUP) Harmonic analysis, when solved there are three solve phases:
- Modal Solve
- MSUP Harmonic Solve
- MSUP Expansion Solve
I want to add custom APDL commands only to the MSUP Harmonic Solve using an ACT load object.
Tagged:
0
Answers
-
You can do it by using the
<load>
object callbackgetcommands
with the location attributesolve
.The callback passes
ISolverData
object as a second function argument. This object has an attributeSolveType
, with which you can check for the solve phase of your multistep analysis. For example:XML:
<load name="DemoLoad" version="1" caption="DemoLoad" icon="tload" color="#00FFFF"> <callbacks> <getcommands location="solve">add_apdl_solve_commands</getcommands> </callbacks> </load>
Python:
def add_apdl_solve_commands(load, solver_data, stream): if solver_data.SolveType.ToString() == "MSUPHarmonic": stream.Write("/COM, **************************************************" + "\n") stream.Write("/COM, These commands will only be added before MSUP Harmonic Solve" + "\n")
PS:
SolveType
attribute is aSolveTypeEnum
and to list all the entries in this Enum, just do adir(SolveTypeEnum)
in Mechanical Scripting Console.6