Skip to content

Max uniform refinement #1599

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

Merged
merged 5 commits into from
Jul 31, 2025
Merged

Max uniform refinement #1599

merged 5 commits into from
Jul 31, 2025

Conversation

voferreira
Copy link
Collaborator

@voferreira voferreira commented Jul 30, 2025

Description

The maximum number of mesh adapt parameter was not taken into account while using uniform mesh adaptation in transient simulations.

Solution

Added a check for it prior to running the global refinement.

Testing

A simple application test was added.

Documentation

N/A. The current documentation is sufficient.\

Miscellaneous (will be removed when merged)

Checklist (will be removed when merged)

See this page for more information about the pull request process.

Code related list:

  • All in-code documentation related to this PR is up to date (Doxygen format)
  • Copyright headers are present and up to date
  • Lethe documentation is up to date
  • Fix has unit test(s) (preferred) or application test(s), and restart files are in the generator folder
  • The branch is rebased onto master
  • Changelog (CHANGELOG.md) is up to date
  • Code is indented with indent-all and .prm files (examples and tests) with prm-indent

Pull request related list:

  • Labels are applied
  • There are at least 2 reviewers (or 1 if small feature) excluding the responsible for the merge
  • If this PR closes an issue or is related to a project, it is linked in the "Projects" or "Development" section
  • If the fix is temporary, an issue is opened
  • The PR description is cleaned and ready for merge

Copy link
Contributor

@blaisb blaisb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just 2 small comments.

Comment on lines 1191 to 1193
auto &tria = *dynamic_cast<parallel::distributed::Triangulation<dim> *>(
this->triangulation.get());
if (tria.n_levels() >
this->simulation_parameters.mesh_adaptation.maximum_refinement_level)
return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need this dynamic cast here.
The very base triangulation class: https://dealii.org/current/doxygen/deal.II/classTriangulation.html#a777f035a17e91a4d822971516ca11db5

Has this function n_levels. ( see n_levels)

So I don't think you need to case before this refinement.
For sure we don't support refining simplex meshes, so that could be asserted to prevent a bug ( I don't know what happens if you try to refine a simplex mesh now)

Comment on lines 140 to 150
subsection heat transfer
set verbosity = quiet
set method = gmres
set relative residual = 1e-3
set minimum residual = 1e-8
set preconditioner = ilu
set ilu preconditioner fill = 0
set ilu preconditioner absolute tolerance = 1e-12
set ilu preconditioner relative tolerance = 1.00
set max krylov vectors = 200
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heat transfer isdisabled in this test case right?

Copy link
Contributor

@blaisb blaisb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1-2 small things and then it's good to go

@voferreira
Copy link
Collaborator Author

@blaisb Sorry for not using the default parameters. I will pay more attention next time I take a prm as reference.

@brunaccampos brunaccampos added Ready to merge after CHANGELOG/Rebase This PR is ready to merge once the CHANGELOG file has been updated. and removed Reviewed and ready to merge labels Jul 30, 2025
@blaisb
Copy link
Contributor

blaisb commented Jul 31, 2025

@blaisb Sorry for not using the default parameters. I will pay more attention next time I take a prm as reference.

It's not a big deal, happens to me all the time don't worry about it

@blaisb
Copy link
Contributor

blaisb commented Jul 31, 2025

@voferreira can you just add a changelog entry? This would be ready for merge directly after that :).

voferreira and others added 5 commits July 31, 2025 11:43
Sorry me! I did not catch it myself while using another prm as a reference. I will be more careful with using default parameters for tests

Co-authored-by: Bruno Blais <[email protected]>
@voferreira voferreira force-pushed the max-uniform-refinement branch from 3b46edf to 6ad4c25 Compare July 31, 2025 15:43
@voferreira
Copy link
Collaborator Author

@blaisb I just added the entry.

@blaisb blaisb added Reviewed and ready to merge and removed Ready to merge after CHANGELOG/Rebase This PR is ready to merge once the CHANGELOG file has been updated. labels Jul 31, 2025
@blaisb blaisb merged commit d839c2f into master Jul 31, 2025
7 checks passed
@blaisb blaisb deleted the max-uniform-refinement branch July 31, 2025 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants