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.

Subdomain integration in Comsol Script

Please login with a confirmed email address before reporting spam

How do you do subdomain integration in comsol script. I just want to find integral of u over one subdomain.

5 Replies Last Post Jul 1, 2009, 8:23 a.m. EDT

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 26, 2009, 4:47 p.m. EDT
Why don't you use GUI > Postprocessing > Subdomain Integration and input u as a parameter.
Why don't you use GUI > Postprocessing > Subdomain Integration and input u as a parameter.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 26, 2009, 5:57 p.m. EDT

Why don't you use GUI > Postprocessing > Subdomain Integration and input u as a parameter.


Thanks, but can't use GUI because I need to repeat the calculation several times with different model parameters and integrate the solution u for each iteration and store it for further processing/analysis. That's why I need to use Comsol Script.
[QUOTE] Why don't you use GUI > Postprocessing > Subdomain Integration and input u as a parameter. [/QUOTE] Thanks, but can't use GUI because I need to repeat the calculation several times with different model parameters and integrate the solution u for each iteration and store it for further processing/analysis. That's why I need to use Comsol Script.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 26, 2009, 10:00 p.m. EDT
Sorry may be I'm wrong,
but you can for example use parametric analysis, then plot your u (in subdomain integration) and then save data from plot.
Sorry may be I'm wrong, but you can for example use parametric analysis, then plot your u (in subdomain integration) and then save data from plot.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jul 1, 2009, 6:25 a.m. EDT

How do you do subdomain integration in comsol script. I just want to find integral of u over one subdomain.


The standard trick:
Use the GUI, calculate the integral from the postprocessing menu.
Save the model as an .m-file.
Open the m-file and see what happened in the end of the file.
You should find a line containing the 'postint' command. The syntax is pretty straightforward look in the manual fort more details.

As I said, whatever command corresponding to the "GUI buttons" could be found this way.
regards Nisse
[QUOTE] How do you do subdomain integration in comsol script. I just want to find integral of u over one subdomain. [/QUOTE] The standard trick: Use the GUI, calculate the integral from the postprocessing menu. Save the model as an .m-file. Open the m-file and see what happened in the end of the file. You should find a line containing the 'postint' command. The syntax is pretty straightforward look in the manual fort more details. As I said, whatever command corresponding to the "GUI buttons" could be found this way. regards Nisse

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jul 1, 2009, 8:23 a.m. EDT
Thanks Nisse,
yes, I tried what you recommended and works. My final implementation was even simpler and more flexible using the postint command.
Cheers




How do you do subdomain integration in comsol script. I just want to find integral of u over one subdomain.


The standard trick:
Use the GUI, calculate the integral from the postprocessing menu.
Save the model as an .m-file.
Open the m-file and see what happened in the end of the file.
You should find a line containing the 'postint' command. The syntax is pretty straightforward look in the manual fort more details.

As I said, whatever command corresponding to the "GUI buttons" could be found this way.
regards Nisse


Thanks Nisse, yes, I tried what you recommended and works. My final implementation was even simpler and more flexible using the postint command. Cheers [QUOTE] [QUOTE] How do you do subdomain integration in comsol script. I just want to find integral of u over one subdomain. [/QUOTE] The standard trick: Use the GUI, calculate the integral from the postprocessing menu. Save the model as an .m-file. Open the m-file and see what happened in the end of the file. You should find a line containing the 'postint' command. The syntax is pretty straightforward look in the manual fort more details. As I said, whatever command corresponding to the "GUI buttons" could be found this way. regards Nisse [/QUOTE]

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.