Ibarra-Medina-Krawlinker* ;)
--
https://mooseframework.org/mastodon
https://github.com/idaholab/mastodon
---
You received this message because you are subscribed to the Google Groups "mastodon-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mastodon-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mastodon-users/62f63bda-30d5-4da9-b8c8-fca71ecdafb0%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mastodon-users/BY5PR11MB3910002815FA9567F12851C995B00%40BY5PR11MB3910.namprd11.prod.outlook.com.
Hi Swetha,
Thanks for the suggestion. I had noticed the Utils that round to an integer value but didn't think that way around. Yes, you are correct I have many comparisons for the displacement of the spring based on which certain flags are turned or off for the calculation of spring forces and this code has been tested and works well in MATLAB.if ( _isdetpos[_qp] == false)
{
if ( _deformations[_qp](0) > ( _th_disp ))
{
_isdetpos[_qp] = true;
}}
My threshold displacement was 2.5 and for the displacement of 2.5 _isdetpos[_qp] should've been false but the precision error made it true.
The code that I am working on can be found at https://github.com/hrishiv/mastodon/blob/bilinearspring/src/materials/BilinearSpring.C
I have defined these flags (eg _isdamage) as MaterialProperty because these flags are turned on and off based on certain conditions and I don't use them immediately but have to wait for more timesteps for a certain condition to meet to use them. Can I define them as a variable so that the changed value is inherited to the next time step?
ThanksHrishiv
From: mastodo...@googlegroups.com <mastodo...@googlegroups.com> on behalf of Swetha Veeraraghavan <swetha.ve...@gmail.com>
Sent: Tuesday, May 26, 2020 5:16 AM
To: mastodon-users <mastodo...@googlegroups.com>
Subject: Re: [mastodon-users] Precision error while calculating deformations in the Linear Spring
Just of out curiosity, how is the change in the 11th significant digit affecting your algorithm? If you are comparing two real numbers x and y and checking if x > y or performing similar operations, you can set tolerances on those operations.
Check MooseUtils::absoluteFuzzyGreaterEqual and similar operations in https://github.com/idaholab/moose/blob/next/framework/include/utils/MooseUtils.h
Regards,Swetha
On Tue, 26 May 2020 at 16:34, Swetha Veeraraghavan <swetha.ve...@gmail.com> wrote:
Well I couldn't find a MathUtils function that rounds to a certain number of significant digits. There is a function that rounds to an integer though.
But you can write your own as a temporary work around. To round off a real number x upto say 4 significant digits, you would just have to do MathUitls::round(x*10000.0)/10000.0
Regards,Swetha
On Tue, 26 May 2020 at 09:35, HRISHIV NEUPANE <Hrishiv...@utah.edu> wrote:
I changed the code as per Swetha's suggestion and compiled MOOSE and then MASTODON and performed the simulation again but the problem that I mentioned earlier still persists.
Also, I have asked the same question in the MOOSE group but have not heard back from them.
In the meantime, I would be happy if somebody could tell me if there is a MathUtils to round off a real number to certain significant digits so that I could bypass the problem for now while this bug (probably) is being looked into by the core team.
ThanksHrishiv
From: mastodo...@googlegroups.com <mastodo...@googlegroups.com> on behalf of Swetha Veeraraghavan <swetha.ve...@gmail.com>
Sent: Sunday, May 24, 2020 10:44 AM
To: mastodon-users <mastodo...@googlegroups.com>
Subject: Re: [mastodon-users] Precision error while calculating deformations in the Linear Spring
Hi Hrishiv,
I had noticed an error in piecewise linear interpolated functions that was causing weird spikes in acceleration. Refer to this thread
The error in this case was in moose/framework/src/utils/LinearInterpolation.C line 79 due to tolerance issues.
Changing line 79 to "if (MooseUtils::absoluteFuzzyGreaterEqual(x, _x[i]) && MooseUtils::absoluteFuzzyLessThan(x, _x[i + 1])) instead of if (x >= _x[i] && x < _x[i + 1])" fixes this issue.
I haven't had a chance to submit a PR to fix this issue yet. But you can try this fix and see this works for you.
Regards,Swetha
On Sun, 24 May 2020 at 20:54, Christopher Wong <crswo...@gmail.com> wrote:
Ibarra-Medina-Krawlinker* ;)
--
https://mooseframework.org/mastodon
https://github.com/idaholab/mastodon
---
You received this message because you are subscribed to the Google Groups "mastodon-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mastodo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mastodon-users/62f63bda-30d5-4da9-b8c8-fca71ecdafb0%40googlegroups.com.
--
https://mooseframework.org/mastodon
https://github.com/idaholab/mastodon
---
You received this message because you are subscribed to the Google Groups "mastodon-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mastodo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mastodon-users/CAHhC%3De0hvdWJrUkiBQJv%2B7tBcDCCxxt1RqXx6Gbvc0Gf9XZqfQ%40mail.gmail.com.
--
https://mooseframework.org/mastodon
https://github.com/idaholab/mastodon
---
You received this message because you are subscribed to the Google Groups "mastodon-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mastodo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mastodon-users/BY5PR11MB3910002815FA9567F12851C995B00%40BY5PR11MB3910.namprd11.prod.outlook.com.
--
https://mooseframework.org/mastodon
https://github.com/idaholab/mastodon
---
You received this message because you are subscribed to the Google Groups "mastodon-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mastodo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mastodon-users/eb2ecca0-4eaf-4c90-a882-e901ce943136%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to mastodon-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mastodon-users/f37d7c2c-04cf-45cb-84c3-012d924aafc5%40googlegroups.com.