Parallel evaluation of expressions in Global Evaluation

Breno Topology optimization and Finite Element specialist

Please login with a confirmed email address before reporting spam

Is it possible for Expressions in a Results->Derived Values->Global Evaluation node to all be computed in parallel?

I'm running view factor calculations, which require surface integrations and the evaluation of the rad.radopu function. The stationary solver (for a Surface-To-Surface Radiation problem) takes only 2 and a half minutes, while the view factor calculations take up to two hours... It seems that the evaluations are performed using only one core of my CPU.

For reference, my setup is similar to this COMSOL tutorial: https://www.comsol.com/model/view-factor-computation-20701. except that I define the surface areas and the view factors in a Variables node.


3 Replies Last Post 2025年8月22日 GMT+8 22:46
Edgar J. Kaiser Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 1 day ago 2025年8月22日 GMT+8 01:58

Hi Breno,

I am frequently having similar issues with complex post processing. Defining variables doesn't help because they get evaluated again when called in post processing. One workaround can be to define global state variables and assign the variables to them. State variables are stored in the solution and are available without reevaluation. States do not carry a unit and you must take care of the units by yourself.

Expensive expressions are obviously calculated much faster within the solver code than in post processing code.

Cheers Edgar

-------------------
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
Hi Breno, I am frequently having similar issues with complex post processing. Defining variables doesn't help because they get evaluated again when called in post processing. One workaround can be to define global state variables and assign the variables to them. State variables are stored in the solution and are available without reevaluation. States do not carry a unit and you must take care of the units by yourself. Expensive expressions are obviously calculated much faster within the solver code than in post processing code. Cheers Edgar

Breno Topology optimization and Finite Element specialist

Please login with a confirmed email address before reporting spam

Posted: 11 hours ago 2025年8月22日 GMT+8 19:59

Hello Edgar,

I like the idea. Though, after trying to implement it, after about 3 hours of solution, it stopped with an error, where apparently a variable was not defined (?). This seems difficult to debug. I'd need to start small with, e.g. that view factor tutorial. If you use state variables, COMSOL has to "compile" that in the equations, right? Or maybe I just set them up wrong...

I used "Boundary" geometric entities for my state variables, because they have to be evaluated as boundary surface integrations, but also set an order of 0, since they are scalars. I'm not sure if this is correct. Additionally, I set "Update: Only Initialization". Maybe there's a simplification that can be done in the Study/Solver node to improve performance?

Anyway, in the end I "solved" my problem by using normal variables in one file, running the problem, saving the file with the results, then copying and pasting this file multiple times. Open each of these files, and finally Evaluate different sets of expressions in each of them, in parallel. Definitely far from a pretty solution, but it works.

Cheers, Breno

Hello Edgar, I like the idea. Though, after trying to implement it, after about 3 hours of solution, it stopped with an error, where apparently a variable was not defined (?). This seems difficult to debug. I'd need to start small with, e.g. that view factor tutorial. If you use state variables, COMSOL has to "compile" that in the equations, right? Or maybe I just set them up wrong... I used "Boundary" geometric entities for my state variables, because they have to be evaluated as boundary surface integrations, but also set an order of 0, since they are scalars. I'm not sure if this is correct. Additionally, I set "Update: Only Initialization". Maybe there's a simplification that can be done in the Study/Solver node to improve performance? Anyway, in the end I "solved" my problem by using normal variables in one file, running the problem, saving the file with the results, then copying and pasting this file multiple times. Open each of these files, and finally Evaluate different sets of expressions in each of them, in parallel. Definitely far from a pretty solution, but it works. Cheers, Breno

Edgar J. Kaiser Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 9 hours ago 2025年8月22日 GMT+8 22:46

Hi Breno,

I understood that you are calculating integrals and the integral is a global value that doesn't need to be tied to a geometric entity. I am only using global states.

Cheers Edgar

-------------------
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
Hi Breno, I understood that you are calculating integrals and the integral is a global value that doesn't need to be tied to a geometric entity. I am only using global states. Cheers Edgar

Reply

Please read the discussion forum rules before posting.

Please log in to post a reply.

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.