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.

Integration domains with Join datasets

Please login with a confirmed email address before reporting spam

I am calculating electrostatics in 3D using Comsol 4.4. Using the same geometry and the same mesh, I create two different solutions, "es" and "es2", with different boundary conditions. I want to plot the dot product of the electric field from these two solutions. There was a recent tutorial on Join datasets (www.comsol.com/blogs/join-solutions-comsol-multiphysics/) which seems to be the tool to use.

It does not seem that I can use a "General" Join dataset. That appears to specify an operation on the scalar field that was solved for (the voltage V), assuming that the Join operation maintains the dimension of the dataset. Only then can I pick out the derived quantity (the electric field components) to plot or operate on.

Instead, I now use the "Explicit" option of the Join dataset. Then I get access to "data1()" and "data2()" which represent the two solutions. In plots, I can get the dot product that I want by explicitly giving the expression "(data1(es.Ex)*data2(es2.Ex) + data1(es.Ey)*data2(es2.Ey) + data1(es.Ez)*data2(es2.Ez)". For plotting, this works fine.

Integrating over the results gives me problems though. I want to enter the same expression as for the plot, and integrate this either over the volume of a subdomain or a surface that's defined in the geometry. However, as soon as I select "Join 1" as the dataset for the integration, all options for picking integration domain disappear. I cannot pick any other data set and still have access to "data1()" and "data2()". For the volume integral, I guess the integration domain is the whole extent of the geometry, but for the surface I don't even have a clue. How do I solve this? Is there an alternative method to run computations on the two data sets?

Best wishes
Martin Gustafsson

8 Replies Last Post 28.07.2015, 08:51 GMT-4
Gunnar Andersson COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 07.07.2014, 11:17 GMT-4

Integrating over the results gives me problems though. I want to enter the same expression as for the plot, and integrate this either over the volume of a subdomain or a surface that's defined in the geometry. However, as soon as I select "Join 1" as the dataset for the integration, all options for picking integration domain disappear.


Selections can only be specified for data sets that always correspond directly to a given geometry: Solution and Mesh data sets.

To do what you want, you can specify the selection in a different way:
- Create copies of the Solution data sets that you are using in the Join data sets.
- For each of the Solution data set copies: Add a selection to the data set using the context menu. Set the domain or boundary selection that you want to use.
- Change the Join data sets to point to the Solution data sets with selections.

[QUOTE] Integrating over the results gives me problems though. I want to enter the same expression as for the plot, and integrate this either over the volume of a subdomain or a surface that's defined in the geometry. However, as soon as I select "Join 1" as the dataset for the integration, all options for picking integration domain disappear. [/QUOTE] Selections can only be specified for data sets that always correspond directly to a given geometry: Solution and Mesh data sets. To do what you want, you can specify the selection in a different way: - Create copies of the Solution data sets that you are using in the Join data sets. - For each of the Solution data set copies: Add a selection to the data set using the context menu. Set the domain or boundary selection that you want to use. - Change the Join data sets to point to the Solution data sets with selections.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 13.07.2014, 18:51 GMT-4
Tack Gunnar, that worked!
Tack Gunnar, that worked!

Esubalewe Lakie Yedeg

Please login with a confirmed email address before reporting spam

Posted: 10 years ago 07.05.2015, 06:52 GMT-4


Integrating over the results gives me problems though. I want to enter the same expression as for the plot, and integrate this either over the volume of a subdomain or a surface that's defined in the geometry. However, as soon as I select "Join 1" as the dataset for the integration, all options for picking integration domain disappear.


Selections can only be specified for data sets that always correspond directly to a given geometry: Solution and Mesh data sets.

To do what you want, you can specify the selection in a different way:
- Create copies of the Solution data sets that you are using in the Join data sets.
- For each of the Solution data set copies: Add a selection to the data set using the context menu. Set the domain or boundary selection that you want to use.
- Change the Join data sets to point to the Solution data sets with selections.

Hej Gunnar,

I have used the above mentioned method to join solutions and integrate the square of the absolute difference along a boundary of the computational domain. But when I take the integrals of the joined solutions (joined along on the boundary using selection) I got the same value as I integrate over the entire domain.

How could this happen?

Regards,
[QUOTE] [QUOTE] Integrating over the results gives me problems though. I want to enter the same expression as for the plot, and integrate this either over the volume of a subdomain or a surface that's defined in the geometry. However, as soon as I select "Join 1" as the dataset for the integration, all options for picking integration domain disappear. [/QUOTE] Selections can only be specified for data sets that always correspond directly to a given geometry: Solution and Mesh data sets. To do what you want, you can specify the selection in a different way: - Create copies of the Solution data sets that you are using in the Join data sets. - For each of the Solution data set copies: Add a selection to the data set using the context menu. Set the domain or boundary selection that you want to use. - Change the Join data sets to point to the Solution data sets with selections. [/QUOTE] Hej Gunnar, I have used the above mentioned method to join solutions and integrate the square of the absolute difference along a boundary of the computational domain. But when I take the integrals of the joined solutions (joined along on the boundary using selection) I got the same value as I integrate over the entire domain. How could this happen? Regards,

Gunnar Andersson COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 10 years ago 07.05.2015, 06:55 GMT-4
But when I take the integrals of the joined solutions (joined along on the boundary using selection) I got the same value as I integrate over the entire domain.


Can you attach the model?

[QUOTE] But when I take the integrals of the joined solutions (joined along on the boundary using selection) I got the same value as I integrate over the entire domain.[/QUOTE] Can you attach the model?

Esubalewe Lakie Yedeg

Please login with a confirmed email address before reporting spam

Posted: 10 years ago 07.05.2015, 07:01 GMT-4
Can I send you by email?
Can I send you by email?

Gunnar Andersson COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 10 years ago 07.05.2015, 07:03 GMT-4
Send it in a support case.
Send it in a support case.

Esubalewe Lakie Yedeg

Please login with a confirmed email address before reporting spam

Posted: 10 years ago 07.05.2015, 07:15 GMT-4

Send it in a support case.

It is in the support ...
It has a Case number 1681361, if you can access it. I have also posted some of my other questions there.

Thank you!
[QUOTE] Send it in a support case. [/QUOTE] It is in the support ... It has a Case number 1681361, if you can access it. I have also posted some of my other questions there. Thank you!

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 28.07.2015, 08:51 GMT-4
Hi,
I want to solve a problem of triple integration with different limit. I want to use the "intop". Can anybody tell me how to fix it.
Thanks,
- Paramita
Hi, I want to solve a problem of triple integration with different limit. I want to use the "intop". Can anybody tell me how to fix it. Thanks, - Paramita

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.