Extracting system matrices #47
Replies: 1 comment
-
Hi Web, I'm afraid I cannot help you much in that regard. No, MPh does not provide an equivalent of the higher-level Matlab functions that you mention. However, I'm very sure it should be possible to get that information via the Java API. Because I don't see how the Matlab API would have any "additional insights" into the model. The Comsol model is ultimately a Java object. And the Matlab API is a wrapper around the Java API, just like the Python API is. I've implemented some convenience functions that resemble those of the Matlab API. Matlab's You are in a much better position than I am to reverse-engineer what these other functions do. You already have a model and therefore an expected outcome to test against. I, for one, don't even have Matlab (anymore). Note that the Python API would still be helpful to get to the bottom of this. That's because you can use "introspection" on the interactive Python prompt to look at the data returned by the methods of the Java API. So this comes down to exploring the (Java) model tree by hand and finding the right method calls. And it's much easier to do this in Python rather than in Java itself. I would not be opposed to including these higher-level functions in MPh, such as for the mesh info and stats. But at this point I also don't know how they'd map to the lower-level methods of the Java API. |
Beta Was this translation helpful? Give feedback.
-
functions on extracting system matrices required
Hi, John.
We are going to use python to develop a software which need comsol to build a model.
We used to use matlab functions to extracting system information as follows:
system matrices to extract:
str = mphmatrix(model, <soltag>, 'out', out)
info = mphxmeshinfo(model,'soltag','sol1','studysteptag','v1');
[stats,data] = mphmeshstats(model);
We try to use JAVA API to get these things, but not work.
After that, we found your python API, but don't know if your project have these functions.
if any, please tell us. if not, can you consider to develop that?
best,
web
Beta Was this translation helpful? Give feedback.
All reactions