Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strict tolerance checks for CompositeGridFunctionEstimator #5

Open
anaegel opened this issue Nov 8, 2024 · 5 comments
Open

Strict tolerance checks for CompositeGridFunctionEstimator #5

anaegel opened this issue Nov 8, 2024 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@anaegel
Copy link
Member

anaegel commented Nov 8, 2024

The current implementation (as of 3c01ad1) of CompositeGridFunctionEstimator accepts a step, if
(1)

$$ \sum_i |\delta|_i^2 \le TOL^2 \sum_i |u|_i^2 $$

In some cases, a stricter tolerance is desirable. In particular, we may want to enforce the tolerance in in a component-wise fashion:
(2)

$$\max_i \frac { |\delta|_i } { |u|_i } \le TOL$$

I suggest to a add function 'use_strict_relative_norms' to enforce this.

=> Note that (2) induces (1)!

@anaegel anaegel self-assigned this Nov 8, 2024
@anaegel anaegel added the enhancement New feature or request label Nov 8, 2024
@anaegel
Copy link
Member Author

anaegel commented Nov 8, 2024

Commits 4925273 and 16e65f2 address this. Please feel free to comment @LogashenkoDL, @lus0a, @junxiW, @Nordegraf and everybody ;-)!

@anaegel
Copy link
Member Author

anaegel commented Nov 8, 2024

Here's a small example:

local limexErrorEst = CompositeGridFunctionEstimator()
local weightedMetricSpace = CompositeSpace()

local scalePSquared = 1.0
local scaleCSquared = 1.0
local spaceP = VelEnergyComponentSpace("p", 2, ConstUserMatrix(scalePSquared))
local spaceC = L2ComponentSpace("c", 2, scaleCSquared)

weightedMetricSpace:add(spaceC)
weightedMetricSpace:add(spaceP)

limexErrorEst:add(weightedMetricSpace)
limexErrorEst:use_strict_relative_norms(true)

@Nordegraf
Copy link

This improved the time step sizes for the lens testcase greatly! I'm running more simulations with more refinements, but for up to 7 refinements this is a clear improvement.

timesteps

@anaegel
Copy link
Member Author

anaegel commented Nov 12, 2024

This improved the time step sizes for the lens testcase greatly! I'm running more simulations with more refinements, but for up to 7 refinements this is a clear improvement.

@Nordegraf: Thx for the feedback! Note that, if required, you can now also try to include the H1 semi-norm for the concentration:

local spaceC2 = H1SemiComponentSpace("c", 2)
weightedMetricSpace:add(spaceC2)

No additional scaling is required!

@anaegel
Copy link
Member Author

anaegel commented Nov 15, 2024

One drawback of

$$\max_i \frac { | \delta |_i } { |u|_i } \le TOL$$

is, that it is ill-posed for $| \delta|_i \approx |u|_i \approx 0$. Alternatively, one can use

$$\max_i \frac { | \delta |_i^2 } { | u |_i^2 + \epsilon \frac{1}{1+ | u |_i^2 + | \delta |_i^2 }} \le TOL^2$$

which yields

$$ \sum_{i=1}^n | \delta |_i^2 \le TOL^2 ( \sum_i |u |_i^2 + \epsilon n ) $$

This is realized in 2a5c62a.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants