Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Export single domain scalar field to a text file

Please login with a confirmed email address before reporting spam

Hi, I have a 2D model composed by some domains. A scalar (modulus of electric field) is defined on these domains. I want to export to a text file (csv for example) those scalars along with the position x,y of where they are evaluated, preferably the center or corners of the mesh elements. I should end up with 3 columns at least: x, y, ec.normE. But I want to do this ONLY on one domain. The Export->Data node doesn't allow me to select the domain. Maybe I could extract the domain data from the result dataset? but how?

Any idea?

2 Replies Last Post 18 janv. 2017, 16:25 UTC−5
Gunnar Andersson COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 18 janv. 2017, 02:29 UTC−5

But I want to do this ONLY on one domain. The Export->Data node doesn't allow me to select the domain. Maybe I could extract the domain data from the result dataset?


Try this:

- Go to the data set that you want to export and create a duplicate of it.

- Add a selection to the duplicate data set.

- Use the duplicate data set in the data export node.

[QUOTE] But I want to do this ONLY on one domain. The Export->Data node doesn't allow me to select the domain. Maybe I could extract the domain data from the result dataset? [/QUOTE] Try this: - Go to the data set that you want to export and create a duplicate of it. - Add a selection to the duplicate data set. - Use the duplicate data set in the data export node.

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 18 janv. 2017, 16:25 UTC−5
Yes, this made it! Simple and neat. Thank you!
Yes, this made it! Simple and neat. Thank you!

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.