-
Notifications
You must be signed in to change notification settings - Fork 78
Conversation
@smarras79 and @OsKnoth: here's how you can get pressure (or other such computed fields) output to VTK. Please pick one of our experiments and I'll add code that uses this into it for you to use as a pattern. |
52b4067
to
e58c135
Compare
@jkozdon: could you take a look at this please and see if it looks okay to you? @smarras79: does this work for you? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Can we add a test? There are some other vtk tests, mainly to make sure the interfaces continue to work.
We could possibly move to only using this and defaulting to a version that dumps all the data in aux and state? Or alternatively should this be merged with the other vtk data dump functionality so you dump state, aux, and computed fields.
I'm also fine with leaving as is though, as far as I can tell it's correct.
This solution is not trivial. A user should not be worrying about writing code lines to simply have pressure (a fundamental quantity in fluid flow solver) written to VTK. |
@smarras79 Unfortunately the current design of the VTK output is really only intended for prognostic quantities; derived quantities are designed to go through the diagnostics system. Changing how this works will require significant changes to the codebase, which we don't have the resources to do at the moment. |
|
[closed by mistake] reopened |
The VTK is there to help debug the code because, as of now, it is the only format in climatemachine that writes data on the native numerical (DG) grid. This file contains quantities that are totally unimportant from the physical point of view of what problems we are solving (total energy, density, momentum, reference density). At the level of writing the VTK file, it is 1 call to the thermodynamic function that computes pressure from the equation of state that needs to be called, compute pressure, and write it to file. If this is not easy to do, then there is clearly something very wrong in the code structure and needs to be addressed as soon as possible. |
All efforts on output thus far have been focused on the Diagnostics module which currently only writes NetCDF. Some discussion of output formats is in #114. There are three tasks on the TODO list relating to diagnostics output:
These are listed in order of priority. We do not currently have any plans to enhance the VTK module beyond the capability introduced in this PR. |
e58c135
to
6c37cbc
Compare
@jkozdon: I added a test, but it feels a little silly; can you take a look please? |
@kpamnany #2006 may not be necessary if you are already doing #1441 |
Yeah. Our VTK tests are a bit silly, but we did run into a problem with interface changes in the past, so just wasn't sure if we wanted something that exercises the interface. I'm fine removing if you think it's not needed. |
I think we don't yet know if any of the standard NetCDF visualization tools people are using (ParaView, etc.) understand the UGRID conventions. If they do, then you're right. If they don't, then #1441 will only be useful for people writing their own visualization scripts and #2006 might be higher priority. |
I don't think the test adds enough value to make up for the overheads. |
6c37cbc
to
930875f
Compare
bors r+ |
Description
Allows writing of computed fields into VTK.
For example:
Then pass
cbfw
intoinvoke!
(orsolve!
) as a callback. You can use a similar pattern to add other computed fields; just add tuples to the vector passed in to theVTKFieldWriter
constructor.