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

WIP: Export of discontinuous fields to VTK #867

Draft
wants to merge 92 commits into
base: master
Choose a base branch
from

Conversation

KnutAM
Copy link
Member

@KnutAM KnutAM commented Jan 8, 2024

Until VTK supports discontinuous fields, this patch, building on top of #692 makes a vtk grid that is geometrically discontinuous as well, allowing discontinuous interpolations to be visualized.

TODO

  • Add tests using apply_analytical! to validate continuity when it should be
  • Document how to use this, perhaps a how-to postprocess with L2-projection of fluxes (which could be extended to Hdiv with WIP: New vector interpolations and mappings #798) ?

@KnutAM KnutAM changed the base branch from kam/VTKStream to master May 19, 2024 17:01
@KnutAM KnutAM changed the base branch from master to kam/VTKStream May 19, 2024 17:33
Base automatically changed from kam/VTKStream to master May 19, 2024 21:47
@KnutAM
Copy link
Member Author

KnutAM commented May 24, 2024

Test case

Generated to validate the discontinuous, tests for different reference shapes will be needed before merge...

image

DG tutorial (dg penalization variation)

The results looks quite strange, any idea if this is reasonable @AbdAlazezAhmed / @termi-official ? (I'm wondering if something is off in the export, but test case looks correct)

$\mu = 4.0 / h_e = (1 + O)^D / h_e$ (same result for $\mu = 2.0 / h_e $

image

$\mu = 1.0 / h_e $
image

$\mu = 0.5 / h_e $
image

@termi-official
Copy link
Member

Test case

Generated to validate the discontinuous, tests for different reference shapes will be needed before merge...

Any reason not to use apply_analytical! for the first tests?

DG tutorial (dg penalization variation)

The results looks quite strange, any idea if this is reasonable @AbdAlazezAhmed / @termi-official ? (I'm wondering if something is off in the export, but test case looks correct)

Looks correct for me. The parameter which you tune is basically a penalty on the jump in the gradients between the elements. Please notice in the first figure in the section above that your gradients are essentially continuous with large jumps between elements. Just look at the formula for 1D and I think you will understand what happens. :) Also, a too small value for the penalty parameter makes the forumlation unstable, which is why you see this weird checkerboarding pattern.

@KnutAM
Copy link
Member Author

KnutAM commented May 25, 2024

Any reason not to use apply_analytical! for the first tests?

Since it uses the nodal coordinate, the result wouldn't be discontinuous. But it is a good point adding that to validate the the result is continuous when it should!

Please notice in the first figure in the section above that your gradients are essentially continuous with large jumps between elements.

Yes, that was the idea of the test to generate such a case :)

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

Successfully merging this pull request may close these issues.

None yet

3 participants