Closed AshGannon closed 5 months ago
I only ended up changing the denominator of eps.
@AshGannon do you have a sense for when the epsilon is too small and when it isn't? Are we safe hard-coding it like you have, or should it depend on something problem specific?
The tolerance already depends on the problem through the time step. It's obviously not ideal to have a "magic" number in the code but when dealing with round-off you usually don't have a choice.
The PR is not passing the CI but that's because we need to merge #253 first.
@AshGannon do you have a sense for when the epsilon is too small and when it isn't? Are we safe hard-coding it like you have, or should it depend on something problem specific?
Bruno's answer is better.
Bruno mentioned to me that he originally chose 1e12 because you can expect an accuracy of about 12 digits with double precision. He also uses this eps for power and time in deposition_along_scan_path. In my hourglass simulation, the dwell time is set to 0, so my deposition_time.begin() happened to be 1e-12. The deposition_time was also not set. Since double eps = (*deposition_times.begin())/abs(activation_time_end - time); worked in this example, double eps = 1e-12/(time - time_old) might work generally. It's almost the same as dt/1e12, but you accumulate error in dt as time goes on.
Retest this please
@stvdwtt I'm not sure what you mean. Retest the 1e-10? Or the dt/time-time_old? I ran the latter over the weekend, the mesh fully activated and the results were very close at the times I checked (just spot checked). Are you seeing something odd with the 1e-10?
@AshGannon Sorry! That wasn't directed at you -- that's the command for the continuous integration tests to run again. I just merged in Bruno's PR and my understanding is that the tests in this PR should pass now. Assuming they do, we'll merge this.
We use an epsilon to get the "expected" behavior when the deposition time and the time match should match exactly but don't because of floating point accuracy. I changed eps to be computed using the deposition start time and error between the time step and activation time.