Evaluate standard deviation of element size h

Please login with a confirmed email address before reporting spam

I consider a 3D model with a free tetrahedral mesh. I calculate the average of the element size h via "Derive Values" --> "Volume average". This part works. Now I would like to calculate the standard deviation of the element size, but I couldn't find out how to use the expression correctly. Comsol has already provided the template which I found via "add expressions":

stddev(op, expr) -> Standard deviation of op(expr, ...)

The first argument of stddev() has to be a string due to diverse error messages I got. Does anyone know what I need to write instead of "op"? Thank you for your help.


2 Replies Last Post Oct 28, 2020, 4:56 AM EDT
Gunnar Andersson COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 month ago Oct 27, 2020, 10:35 AM EDT
Updated: 1 month ago Oct 27, 2020, 10:36 AM EDT

The first argument to stddev() should be the name of an operator.

Some ways to achieve what you want:

  • Add a Nonlocal Coupling intop1 of type Integration to Component > Definitions, update the solution, and evaluate stddev('comp1.intop1',h) in a Global Evaluation.

  • Add a Nonlocal Coupling aveop1 of type Average to Component > Definitions, update the solution, and evaluate sqrt(aveop1((h-aveop1(h))^2)) in a Global Evaluation.

See https://www.comsol.com/forum/thread/40335/standard-deviation-over-a-data-set for a longer explanation.

The first argument to stddev() should be the name of an operator. Some ways to achieve what you want: * Add a Nonlocal Coupling intop1 of type Integration to Component > Definitions, update the solution, and evaluate stddev('comp1.intop1',h) in a Global Evaluation. * Add a Nonlocal Coupling aveop1 of type Average to Component > Definitions, update the solution, and evaluate sqrt(aveop1((h-aveop1(h))^2)) in a Global Evaluation. See https://www.comsol.com/forum/thread/40335/standard-deviation-over-a-data-set for a longer explanation.

Please login with a confirmed email address before reporting spam

Posted: 1 month ago Oct 28, 2020, 4:56 AM EDT

Thank you for your answer! Both ways work for my problem!

Thank you for your answer! Both ways work for my problem!

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.