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

Update example for diagnostic use and to give explicit example #14

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

KAClough
Copy link
Member

@KAClough KAClough commented May 5, 2021

I updated to fix for diagnostic vars.

I also amended the example to make it more aligned with how it is used in practice - ie for reprocessing plot files rather than actual full checkpoint files. The use of extrapolating BCs allows you to use these even without the ghost cells having been written in sommerfeld directions. The example now also uses the boundary conditions so one can load symmetric cases.

I also added clang format.

@mirenradia
Copy link
Member

I've only had a very brief look but would it be possible to use the SphericalExtraction class from the main GRChombo repository and also format the parameter files nicely as @TaigoFr did in GRTLCollaboration/GRChombo#166?

@KAClough
Copy link
Member Author

KAClough commented Jun 2, 2021

@mirenradia I will update params but I quite liked having the CustomExtraction class as a very simple example of what can be done with all the code in one place. Do you object to it being here rather than in the GRChombo repo or do you just not like it?

@mirenradia
Copy link
Member

mirenradia commented Jun 2, 2021

If a user actually wants to do some kind of extraction of data on a surface, then it makes sense to use the much more comprehensive and accurate SurfaceExtraction class. In some sense it's also duplicating code/functionality which we already have elsewhere which we try to avoid doing. I imagine most use cases of this post processing example will involve using the SurfaceExtraction class anyway.

Do you object to it being here rather than in the GRChombo repo or do you just not like it?

I'm confused by this question. I have no objection to this example being here!

@KAClough
Copy link
Member Author

KAClough commented Jun 2, 2021

CustomExtraction doesn't do extraction on a surface, or clever integration or anything like that, it just takes values at a series of points, or it could do a single point if you just wanted to extract at the centre, say. For me the advantage was that it was quite transparent to read, whereas the SphericalExtraction classes are quite heavy and introduce additional complexity to the example. Having this here makes the example mostly self contained, without needing to refer to the main code.

@KAClough
Copy link
Member Author

KAClough commented Jun 2, 2021

Also, I plan to write another example which does a surface extraction to find a flux and reconciles this to a volume integral, so I thought it was nicer to keep this one different.

@mirenradia
Copy link
Member

CustomExtraction doesn't do extraction on a surface, or clever integration or anything like that, it just takes values at a series of points, or it could do a single point if you just wanted to extract at the centre, say. For me the advantage was that it was quite transparent to read, whereas the SphericalExtraction classes are quite heavy and introduce additional complexity to the example.

My worry is that a user will see this and adapt it to their needs (as most do) rather than using the SphericalExtraction class as they should do.

Having this here makes the example mostly self contained, without needing to refer to the main code.

I see your point but then I think it should do something that you would not be able to use SurfaceExtraction (or a derived class) for.

Also, I plan to write another example which does a surface extraction to find a flux and reconciles this to a volume integral, so I thought it was nicer to keep this one different.

Hmm, "I plan" to do a lot of things. That doesn't necessarily mean they're going to happen anytime soon 😜 I'll believe you when there is a PR open!

@KAClough
Copy link
Member Author

KAClough commented Jun 2, 2021

I think it is already something you would not use the surface classes for. How would you use the spherical extraction class to extract points along a line? I guess you could use the cylindrical extraction with only one point along the theta direction, but this would really be overkill.

@mirenradia
Copy link
Member

Ok, I guess I should have read the code in more detail before making an argument 😂 I guess it's OK in principle then.

I will make a more detailed review later.

@KAClough
Copy link
Member Author

KAClough commented Jun 2, 2021

I suppose if I had named it LineExtraction it would have been more informative :-)

I will update the params in the meantime.

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.

2 participants