PyFlux: Get application type
Hi,
I'm back with questions regarding Python/PyFlux. I'm trying to determine the current application in a script. I have two questions:
1. In my tests, I found out that my current application is always Application[2]. Why is there no Application[0], and why is Application[1] the pre-processor?
2. When I type 'Application[2]' in the PyFlux command line, I get 'ApplicationMagneticTransient3D[2]', which would be good for me to determine the application. Yet, when I assign it to a variable 'myVar = Application[2]', a print of that variable returns '2'. I can't seem to get the information I want. There must be a python mechanism that I don't understand, and it might be useful for several other tasks in Flux.
Thank you very much in advance!
Romain
Answers
-
Hello,
The Application[1] is always the preprocessor. Application[2] is for the physical application.
I propose you to use a specific command (which is valid for all Flux entities):
A=Application[2].getPyFluxCommand()
print A
It should display something like this for transient application:
ApplicationMagneticTransient2D(domain2D=Domain2DPlane(lengthUnit=LengthUnit['MILLIMETER'],
depth='75'),
solverFE=SolverFEFlux3D(),
coilCoefficient=CoilCoefficientAutomatic(),
transientInitialization=TransientInitializationStaticComputation())
I hope it will help.regards
Patrick
0 -
Hello Patrick,
Fantastic! Thank you very much.
Romain
0