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

Add time-dependent isotropic goal-oriented demo #112

Merged
merged 11 commits into from
Dec 2, 2024

Conversation

acse-ej321
Copy link
Collaborator

@jwallwork23 - I found the cause of #107 : it was in how I was declaring my meshes passed into the GoalOrientedMeshSeq. I was declaring meshes = [UnitSquareMesh[n,n, diagonal="left"] * n_meshes which worked when the enrichment_method was set to 'p' but produced an error when accessing the transfer method between meshes when the enrichment_method was set to 'h'. Presumably the mesh is a shallow copy with the above expression.

Even though this turned into a user error, I found this while compiling the MFC for burger's demo using goal-oriented isotropic adaptation which may partially address #28 instead?

Creating a pull request here to get feedback on the additional demo.

@jwallwork23 jwallwork23 added the documentation Improvements or additions to documentation label Feb 28, 2024
@jwallwork23 jwallwork23 added this to the Version 1 milestone Feb 28, 2024
Copy link
Member

@jwallwork23 jwallwork23 left a comment

Choose a reason for hiding this comment

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

Thanks very much for the new demo, @acse-ej321 - this is great! A few fairly minor comments.

I see what you mean about the bug. I'll see if I can get Goalie to raise an exception when the user asks it to enrich shallow copies and (if successful) will raise a separate PR.

demos/burgers-isotropic.py Outdated Show resolved Hide resolved
demos/burgers-isotropic.py Outdated Show resolved Hide resolved
demos/burgers-isotropic.py Outdated Show resolved Hide resolved
demos/burgers-isotropic.py Outdated Show resolved Hide resolved
demos/burgers-isotropic.py Outdated Show resolved Hide resolved
demos/burgers-isotropic.py Outdated Show resolved Hide resolved
demos/burgers-isotropic.py Outdated Show resolved Hide resolved
demos/burgers-isotropic.py Outdated Show resolved Hide resolved
@jwallwork23 jwallwork23 changed the title time dependent heirarchy transfer issue Add time-dependent isotropic goal-oriented demo Apr 15, 2024
@jwallwork23 jwallwork23 linked an issue Apr 15, 2024 that may be closed by this pull request
Copy link
Member

@ddundo ddundo left a comment

Choose a reason for hiding this comment

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

Thanks for this @acse-ej321! Quite a few comments but they're mostly minor and some are repeated since you are showing two methods :)

demos/burgers-goal_oriented.py Show resolved Hide resolved
demos/burgers-goal_oriented.py Outdated Show resolved Hide resolved
demos/burgers-goal_oriented.py Outdated Show resolved Hide resolved
demos/burgers-goal_oriented.py Outdated Show resolved Hide resolved
demos/burgers-goal_oriented.py Outdated Show resolved Hide resolved
demos/burgers-goal_oriented.py Outdated Show resolved Hide resolved
demos/burgers-goal_oriented.py Outdated Show resolved Hide resolved
demos/burgers-goal_oriented.py Outdated Show resolved Hide resolved
demos/burgers-goal_oriented.py Outdated Show resolved Hide resolved
demos/burgers-goal_oriented.py Outdated Show resolved Hide resolved
@acse-ej321 acse-ej321 requested a review from ddundo November 13, 2024 12:03
@ddundo
Copy link
Member

ddundo commented Nov 13, 2024

Thanks for updating @acse-ej321 :) I started re-reviewing now and see that some links still don't work. E.g., in the first line of text, the correct link should be <./burgers-hessian.py.html>. Would you mind building the docs and just making sure everything looks good there first please? Other formatting looks good to me now!

@acse-ej321
Copy link
Collaborator Author

@ddundo - I had to rebuild all the demos which took some time, but the links worked for me locally after updating the path on a few.

Copy link
Member

@ddundo ddundo left a comment

Choose a reason for hiding this comment

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

Thanks @acse-ej321! I don't really trust my local doc build so I thought it's better to double check :)

This looks good to me! I left 2 more comments but will approve if you just want to go ahead and merge as it is now :)

Comment on lines +191 to +194
pyrint(
f" subinterval {i}, complexity: {complexity:4.0f}"
f", dofs: {ndofs:4d}, elements: {nelem:4d}"
)
Copy link
Member

Choose a reason for hiding this comment

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

Since in both methods it is the QoI which converges, I think it would be good to print that as well at each iteration.

Comment on lines +319 to +325
hessians[0].intersect(hessians[1])
metric_timestep.set_parameters(mp)

# Deduce an anisotropic metric from the error indicator field
metric_timestep.compute_anisotropic_dwr_metric(
indi, hessians[0], interpolant="L2"
)
Copy link
Member

Choose a reason for hiding this comment

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

I 'm a bit worried using hessians[0] might be a bit confusing. I'd prefer something like intersected_hessian = hessians[0].intersect(hessians[1]) and then passing intersected_hessian to compute_anisotropic_dwr_metric.

Copy link
Member

@jwallwork23 jwallwork23 left a comment

Choose a reason for hiding this comment

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

Looks great, thanks for this contribution @acse-ej321! Nice to have a demo that's highly suited to the anisotropic approach. Just a few requests and then it's good to go.

Please could you open a linked docs PR to add it into the demo list for Goalie?

I made my revisions in suggestion mode. If you view in the Files Changed tab then you can go through and add ones you agree with to a batch before committing them. That way, they get added as a single commit, whereas adding them in the Conversation tab makes a commit for each and runs the CI many times.

demos/burgers-goal_oriented.py Outdated Show resolved Hide resolved
demos/burgers-goal_oriented.py Outdated Show resolved Hide resolved
demos/burgers-goal_oriented.py Outdated Show resolved Hide resolved
demos/burgers-goal_oriented.py Outdated Show resolved Hide resolved
demos/burgers-goal_oriented.py Outdated Show resolved Hide resolved
demos/burgers-goal_oriented.py Outdated Show resolved Hide resolved
demos/burgers-goal_oriented.py Outdated Show resolved Hide resolved
acse-ej321 added a commit to mesh-adaptation/docs that referenced this pull request Nov 18, 2024
Linked to mesh-adaptation/goalie#112 and
mesh-adaptation/goalie#28

Adds unsteady, goal-oriented demo from Goalie to documentation.
@acse-ej321 acse-ej321 merged commit 6930fea into main Dec 2, 2024
1 check passed
@acse-ej321 acse-ej321 deleted the 110_hierarchy_transfer branch December 2, 2024 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Time-dependent goal-oriented mesh adaptation demo
3 participants