Plot one variable without reevaluation in different plots

Please login with a confirmed email address before reporting spam

I calculate average values using several non local couplings. I use these values in different plots in different summations. Each of these plots takes quite a while to create because all of the averages are reevaluated, even if it is the same result data set and they don't change.

Can I somehow evaluate the averages once and then reuse them in the different plots to save computation time? I have tried to use derived values, but can not access the resulting table to do the necessary summations...


5 Replies Last Post 10 déc. 2024, 13:02 UTC−5
Edgar J. Kaiser Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 4 weeks ago 28 nov. 2024, 04:13 UTC−5

Hi Finn,

yes, post processing with nonlocal couplings can be pretty time consuming. The ordinary variables are not part of the solution and thus need to be calculated again and again whenever they are called. A method that worked for me in the past is to write the result from the nonlocal coupling into a global state variable. State variables ARE part of the solution and no recalculation is needed when they get called in the post processing. The state variables do not carry a unit, so you must take care of correct units by yourself.

Cheers Edgar

-------------------
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
Hi Finn, yes, post processing with nonlocal couplings can be pretty time consuming. The ordinary variables are not part of the solution and thus need to be calculated again and again whenever they are called. A method that worked for me in the past is to write the result from the nonlocal coupling into a global state variable. State variables ARE part of the solution and no recalculation is needed when they get called in the post processing. The state variables do not carry a unit, so you must take care of correct units by yourself. Cheers Edgar

Please login with a confirmed email address before reporting spam

Posted: 4 weeks ago 28 nov. 2024, 16:54 UTC−5

Thank you I will try to do that!

Thank you I will try to do that!

Please login with a confirmed email address before reporting spam

Posted: 2 weeks ago 10 déc. 2024, 07:12 UTC−5

Hi Finn,

yes, post processing with nonlocal couplings can be pretty time consuming. The ordinary variables are not part of the solution and thus need to be calculated again and again whenever they are called. A method that worked for me in the past is to write the result from the nonlocal coupling into a global state variable. State variables ARE part of the solution and no recalculation is needed when they get called in the post processing. The state variables do not carry a unit, so you must take care of correct units by yourself.

Cheers Edgar

I tried to implement it. but it increased the solution time quiet a lot unless I select one point as geometric entity. Unfortunately I can not evaluate the state variables. When i try to evaluate a variable under derived variables, I says the variable is undefined.

>Hi Finn, > >yes, post processing with nonlocal couplings can be pretty time consuming. The ordinary variables are not part of the solution and thus need to be calculated again and again whenever they are called. >A method that worked for me in the past is to write the result from the nonlocal coupling into a global state variable. State variables ARE part of the solution and no recalculation is needed when they get called in the post processing. The state variables do not carry a unit, so you must take care of correct units by yourself. > >Cheers >Edgar I tried to implement it. but it increased the solution time quiet a lot unless I select one point as geometric entity. Unfortunately I can not evaluate the state variables. When i try to evaluate a variable under derived variables, I says the variable is undefined.


Edgar J. Kaiser Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 2 weeks ago 10 déc. 2024, 07:54 UTC−5

Hi Finn,

I only used global state variables and didn't find a significant increase in computation time even in large models and extensive integrations or averages. If you need to tie the state to a geometrical entity (e.g. a point) you will need to do a respective evaluation e.g. a point evaluation. A global state will be available in a global evaluation.

Cheers Edgar

-------------------
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
Hi Finn, I only used global state variables and didn't find a significant increase in computation time even in large models and extensive integrations or averages. If you need to tie the state to a geometrical entity (e.g. a point) you will need to do a respective evaluation e.g. a point evaluation. A global state will be available in a global evaluation. Cheers Edgar

Please login with a confirmed email address before reporting spam

Posted: 2 weeks ago 10 déc. 2024, 13:02 UTC−5

Hello Edgar,

thanks for answering. I was a bit confused. If using state variables on component level they are bound to a geometric entity like point, boundary, domain. If instead defined globally that is not necessary and the impact on computation time is little.

I was a bit confused how to set up state variables correctly now I use:

variable_name for State

0 for initial value

if(1>0, expression, variable_name) for update expression

I have them updated at end of step.

Now the variable access is lightning fast!

Thank you!

Hello Edgar, thanks for answering. I was a bit confused. If using state variables on component level they are bound to a geometric entity like point, boundary, domain. If instead defined globally that is not necessary and the impact on computation time is little. I was a bit confused how to set up state variables correctly now I use: variable_name for State 0 for initial value if(1>0, expression, variable_name) for update expression I have them updated at end of step. Now the variable access is lightning fast! Thank you!

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.