Jump to content
Romain B

PyFlux: Get application type

Recommended Posts

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

Share this post


Link to post
Share on other sites

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

Romain B likes this

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...