MPh-py / MPh

Pythonic scripting interface for Comsol Multiphysics
https://mph.readthedocs.io
MIT License
263 stars 67 forks source link

Evaluation of other dataset types #26

Closed john-hen closed 2 years ago

john-hen commented 3 years ago

As pointed out by @max3-2 in #22 and briefly discussed in #16, the evaluate() method of the Model class should support the evaluation of expressions on all dataset types, or at least the most common ones.

Currently supported are expressions in domains from datasets that directly map to a solution (using Comsol's Eval feature), global evaluations (using Global in the numerical() branch of the Java API), and expressions on particle data (using EvalPoint).

Currently not supported are cut points and cut planes, and probably more. The proposal is to add support for these in evaluate(). Ideally, mapping to the adequate Comsol feature should be completely transparent to the MPh user. Use-case examples for these other dataset types should be added to the demonstration model capacitor.mph so that the implementation can be covered by the test suite.

john-hen commented 3 years ago

This issue is on hold. In that I, for one, am not working on this. As it stands, the evaluate() method does everything I need it to do.

Work on this might resume if someone contributes a demonstration model. That is, a simple model (as simple as possible, a minimal example) that uses one of these other (more esoteric) dataset types and makes clear what output evaluate() should return in that use case. Coding this is most likely the less time-consuming part as the Comsol API is well documented. More important is the demo model. Not just to clarify expectations, also to serve as a test case to be integrated into MPh's test suite.

It should be noted that in many cases there may be another, and perhaps better, way to achieve the same thing in application code. For example, instead of evaluating on a cut-point dataset, one could also define a domain point probe (if the point's coordinates are given) or a point probe (if the point is a vertex) or even an integration operator (for more flexibility), and then evaluate the corresponding global expression.

john-hen commented 2 years ago

Closing this for lack of demand. If anyone thinks Model.evaluate() should support dataset types other than the ones it already does, please open a new issue and make it about the specific dataset type you think is needed (rather than the generic "other" as per the title of this issue here). Also please heed the previous comments and provide a rationale for why that would be a useful addition.