Export data using a set of coordinates #101
Replies: 2 comments 4 replies
-
Hi Nicolo, |
Beta Was this translation helpful? Give feedback.
-
Hi Nicolo, According to your reply, you are modifying the properties of an export node, in your case called Here's a code example that does something similar with the model from the import mph
# Load and solve the model.
client = mph.start()
model = client.load('capacitor.mph')
model.solve('static')
# Export data on structured grid.
node = model/'exports'/'data'
node.property("gridstruct", "spreadsheet")
node.property("gridx2", "range(-0.01, 0.001, +0.01)")
node.property("gridy2", "range(-0.01, 0.001, +0.01)")
model.export(node, 'data.txt') Here the export node is called What all these properties are called would be explained in the Comsol documentation. This is not replicated in the MPh documentation, as there are hundreds if not thousands of properties, across all node types. So what I do in such a case, I go through the steps in the GUI, save the model as a |
Beta Was this translation helpful? Give feedback.
-
Hi everyone,
First of all, thanks for MPh, it's really a great library!
I have a question regarding the extraction of solution results using a set of coordinates.
In my case, I am currently evaluating the electric potential in space using: (x, y, z, V) = model.evaluate(['x', 'y', 'z', 'V'])
Is there a way to specify a set of x,y,z coordinates where to evaluate the electric potential?
In the COMSOL GUI there is the option to select a grid of points, for example setting x as range(0,20,1000). Is it possible to do the same with MPh?
Thank you in advance!
Nicolo
Beta Was this translation helpful? Give feedback.
All reactions