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

Eccentric hyper shell #8526

Merged
merged 4 commits into from Aug 14, 2019
Merged

Conversation

melaniegerault
Copy link
Contributor

This is an addition to GridGenerator to make an eccentric hyper shell, where the centers of the two circles (2D) or spheres (3D) are shifted.

@drwells
Copy link
Member

drwells commented Aug 8, 2019

Nice! Do you have a picture?

*
* A SphericalManifold is attached to the outer boundary with an id of 1 while
* another SphericalManifold is attached to the inner boundary with an id of
* 0. A TransfiniteInterpolationManifold is attached to all other cells and
Copy link
Member

Choose a reason for hiding this comment

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

✔️

// the original hyper_shell function assigns the same manifold id
// to all cells and faces. Set all manifolds ids to a different
// value (2), then use boundary ids to assign different manifolds to
// the inner (0) and outer manifolds (0). Use a transfinite manifold
Copy link
Member

Choose a reason for hiding this comment

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

Would you mind fixing the typo?

Copy link
Member

@drwells drwells left a comment

Choose a reason for hiding this comment

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

Nice work. Would you please also add pictures of the grid in 2D or 3D? You can upload them to GitHub and the principal developers can take it from there.

@@ -3004,6 +3003,58 @@ namespace GridGenerator
tria.set_manifold(0, SphericalManifold<2>(center));
}

template <int dim>
Copy link
Member

Choose a reason for hiding this comment

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

Please use three blank lines between definitions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should also be resolved in the last commit. Sorry, I don't know how show the update.

source/grid/grid_generator.cc Outdated Show resolved Hide resolved
std::set<Point<dim> *> vertices_to_move;

for (const auto &cell : tria.active_cell_iterators())
for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
Copy link
Member

Choose a reason for hiding this comment

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

You could use active_face_iterators instead to combine these two loops.

* in radial direction to form 6 cells), 12 for the rhombic dodecahedron,
* and 96. This choice dates from an older version of deal.II before the
* Manifold classes were implemented: today all three choices are roughly
* equivalent (after performing global refinement, of course).
Copy link
Member

Choose a reason for hiding this comment

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

I think it would be clearer (and future-compatible) to instead write that n_cells has the same meaning in this function as it does in hyper_shell.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This comment and the comment above should be resolved by my last commit, but I don't know how to bring the updated versions of the .cc and .h files in here!

@@ -146,7 +146,7 @@ namespace GridGenerator
// data, we do this only based on
// topology.

// For the mesh based on cube,
// For the mesh based on cube,
Copy link
Member

Choose a reason for hiding this comment

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

ha, nice catch!


template <int dim>
void
eccentric_hyper_shell(Triangulation<dim> &tria,
Copy link
Member

Choose a reason for hiding this comment

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

I think you actually copied the same function a second time here. If correct, you might want to remove it!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed! The second one was actually the correct one.
Do I need to add my new version of the file here if I already pushed a new commit with it on my fork?

@melaniegerault
Copy link
Contributor Author

Nice! Do you have a picture?

I should have pushed two png files into the image folder of the doc (called eccentric_hyper_shell_2D.png and eccentric_hyper_shell_3D.png). Otherwise, this is an attempt to attach them here!

eccentric_hyper_shell_2D
eccentric_hyper_shell_3D

@drwells
Copy link
Member

drwells commented Aug 10, 2019

I see that the pictures are in the repository. Would you please amend the documentation of the function to link to those pictures? We do this for most of the GridGenerator functions. Feel free to ask if you need some help in doing this!

@bangerth
Copy link
Member

Nice work!

/rebuild

@bangerth
Copy link
Member

@tamiko -- would you mind lifting your block?

@melaniegerault
Copy link
Contributor Author

I see that the pictures are in the repository. Would you please amend the documentation of the function to link to those pictures? We do this for most of the GridGenerator functions. Feel free to ask if you need some help in doing this!

I might need help indeed, because I'm worried I screwed up something with GitHub! I am stuck. git status tells me that "Your branch is ahead of 'origin/eccentric_hyper_shell' by 43 commits." and I have also seen my name involved in pull requests that I have nothing to do with. So before I can make the change, I have to figure out what I did wrong in git! Hilfe! :)

Besides, @tamiko pointed out that my figures were quite heavy with respect to the other ones in the documentation, so I made some new, less good looking ones. I attach them below. I have removed my old ones from the documentation, but I need to sort my git situation before I can push these new ones! Thanks a lot!

eccentric_hyper_shell_2D
eccentric_hyper_shell_3D

@melaniegerault
Copy link
Contributor Author

@tamiko -- would you mind lifting your block?

I think the block is from @drwells because I haven't been able to include the link to the figures in the documentation yet (see above). I don't want to push my stuff until I figure out if I'm doing something wrong with git!

@drwells
Copy link
Member

drwells commented Aug 13, 2019

Its me, not Matthias.

We need to do two things before we merge:

  1. clean up the history slightly (we got some extra merge commits; we should not have commits from @tamiko on this branch)
  2. Add the images inline, e.g.,
* @image html eccentric_hyper_shell_2d.pg

or whatever we called it.

Melanie Gerault and others added 4 commits August 14, 2019 12:32
Add an eccentric hyper shell geometry that is formed by two spheres
with different center points.
Add an eccentric hyper shell geometry that is formed by two spheres
with different center points.
Co-Authored-By: David Wells <drwells@email.unc.edu>
@tamiko
Copy link
Member

tamiko commented Aug 14, 2019

@drwells I have rebased the pull request. Please finish your review and merge :-)

@drwells
Copy link
Member

drwells commented Aug 14, 2019

Let me take a look at the generated doxygen.

@melaniegerault
Copy link
Contributor Author

@drwells I have rebased the pull request. Please finish your review and merge :-)

No wait, don't merge ! See my comments above. I have to sort out my GitHub stuff before I can add the line you requested :-)

@drwells
Copy link
Member

drwells commented Aug 14, 2019

@melaniegerault take a look at the branch history. @tamiko cleaned things up very nicely for us.

@drwells
Copy link
Member

drwells commented Aug 14, 2019

We still need links to the pictures in the function documentation.

@tamiko
Copy link
Member

tamiko commented Aug 14, 2019

@melaniegerault Locally you will have to do something like

$ git remote update  # update all remote refs
$ git checkout eccentric_hyper_shell # make sure you're on the right branch
$ git reset --hard origin/eccentric_hyper_shell # to reset you local branch to the one in your github repo

@tamiko
Copy link
Member

tamiko commented Aug 14, 2019

@drwells @melaniegerault What about we merge and simply fix the link to the pictures in a follow-up PR?

@tamiko
Copy link
Member

tamiko commented Aug 14, 2019

@drwells Alternatively, feel free to simply push a commit with your intended changes to this PR. I am happy to review and merge afterwards.

@melaniegerault
Copy link
Contributor Author

@drwells Alternatively, feel free to simply push a commit with your intended changes to this PR. I am happy to review and merge afterwards.

I have the changes made locally, I'm just not sure how to push them properly. Trying now.

@drwells
Copy link
Member

drwells commented Aug 14, 2019

@tamiko has a good point: the easiest way forward is to merge this PR as-is and handle images in a followup PR.

@drwells
Copy link
Member

drwells commented Aug 14, 2019

@melaniegerault Would you mind holding on to your changes for the moment and then putting them on another branch in a moment once this is merged?

@melaniegerault
Copy link
Contributor Author

@tamiko has a good point: the easiest way forward is to merge this PR as-is and handle images in a followup PR.

@tamiko @drwells is it alright now?

@melaniegerault
Copy link
Contributor Author

@melaniegerault Would you mind holding on to your changes for the moment and then putting them on another branch in a moment once this is merged?

I pushed them a few minutes ago

@tamiko tamiko merged commit 8f86524 into dealii:master Aug 14, 2019
@tamiko
Copy link
Member

tamiko commented Aug 14, 2019

Merged. @drwells @melaniegerault Let's add a reference to the pictures in the documentation of the function in a separate PR.

@drwells
Copy link
Member

drwells commented Aug 14, 2019

@melaniegerault If you pushed changes recently they were not on this branch, otherwise we would see it somewhere in this PR. Do you know where they ended up?

@melaniegerault
Copy link
Contributor Author

nope, no idea! I was just looking for them. I think I might have erased them with the reset. How do I push them again if this is closed?

@drwells
Copy link
Member

drwells commented Aug 14, 2019

@melaniegerault We will have to set up a second PR with just those changes.

@melaniegerault
Copy link
Contributor Author

@drwells okay sounds good. Do you want to take the risk of letting me do that? :-)
I would like to, if you don't mind.

@drwells
Copy link
Member

drwells commented Aug 14, 2019

Its up to you. Its not my intent to torture you with GitHub stuff; I would be happy to apply the patch for you. If you are confident that you can set up another PR with just this change then, by all means, go for it!

@melaniegerault
Copy link
Contributor Author

That's the only way I'll learn! 😁

@melaniegerault
Copy link
Contributor Author

Do you want me to push my low res images to the doc folder or would you prefer to do that yourself?

@drwells
Copy link
Member

drwells commented Aug 14, 2019

This PR already added the pictures: all we need to add now are the links to them from the documentation.

@melaniegerault
Copy link
Contributor Author

Right, but as you can see, those are the heavy (~200 kb) figures, whereas @tamiko suggested I make lighter ones.

@drwells
Copy link
Member

drwells commented Aug 14, 2019

I am not too worried about the disk size (we already have a bunch of images that large), but they will look huge in the documentation unless we shrink them first.

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.

None yet

5 participants