Replies: 1 comment
-
This kind of question gets asked a lot. Typically with a specific example in mind. Not just here, and not just for Python. If you don't know how to script it in Python, as a first step you should find out how to automate it in Java. This has nothing to do with MPh per se. Comsol can be scripted from programming languages other than Python, namely Java and Matlab. To quote from the documentation, section "Access the full Comsol API":
That section also explains how to translate that Java code to Python. And the section after that, "Navigate and alter the model", goes on to outline how to make the code more "pythonic" (idiomatic). Though that's really a matter of code style, which may not be your primary concern. If that doesn't help, or if you're wondering about the "most pythonic" way to go about, feel free to open a new "discussion" here. (Not an "issue", as it would be about usage, and not a problem with the library code as such.) You may also try your luck asking on Stack Overflow, Reddit, or the Comsol forum. You'll have more readers there. Just keep in mind that getting an answer depends on other users being familiar with your particular use case. Which is rare, given that Comsol is a complex beast. To increase your chances of getting an answer, here or anywhere, your question should come with the Comsol model that it's based on, either as a link or attachment, and code that can be copied and pasted to demonstrate the problem at hand. People are more likely to post an answer if they can test themselves that it's correct, rather than just hope that it may be. Feel free to ask a question and answer yourself, if you think the problem is of general interest. And note that you can "upvote" questions that were of interest to you. This helps draw attention to it, for other users who are looking for an answer. |
Beta Was this translation helpful? Give feedback.
-
Let's say I open a model file in the Comsol GUI, do a few changes, and then want to find out how to automate these. How do I proceed?
Beta Was this translation helpful? Give feedback.
All reactions