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 ParaView Catalyst in-situ visualization capability #222

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

Commits on Feb 7, 2023

  1. Configuration menu
    Copy the full SHA
    5ca50df View commit details
    Browse the repository at this point in the history
  2. Add Make.insitu

    This file allows GRChombo examples to be built with Catalyst. Also add
    some more work on the CatalystAdaptor code.
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    8bf6560 View commit details
    Browse the repository at this point in the history
  3. Remove code that strips spaces in isystem flag

    This can be handled by the updated mkdep script in GRTLCollaboration/Chombo#32.
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    2bbabed View commit details
    Browse the repository at this point in the history
  4. Add script to cache output from paraview-config

    paraview-config is extremely slow and we only want to call it once and
    use the cached output otherwise.
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    276c3d9 View commit details
    Browse the repository at this point in the history
  5. Add CatalystAdaptor to GRAMR

    Also add compile_commands.json database.
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    1ab1957 View commit details
    Browse the repository at this point in the history
  6. Add Catalyst parameters

    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    2955d39 View commit details
    Browse the repository at this point in the history
  7. Add CatalystAdaptor::build_vtk_grid function

    This currently passes ghosted boxes to Catalyst.
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    cd576ce View commit details
    Browse the repository at this point in the history
  8. Add CatalystAdaptor::add_vars

    In theory only the variables requested in the script should be sent to
    Catalyst.
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    8707946 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    ae6cddc View commit details
    Browse the repository at this point in the history
  10. Modify construction of vtkOverlappingAMR

    * Change constructor for each vtkAMRBox.
    * Generate ghost array for each vtkUniformGrid.
    * Audit grid at the end of construction.
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    cf8069c View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    8c82572 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    06ea334 View commit details
    Browse the repository at this point in the history
  13. Add another Catalyst volume rendering script

    This one includes resampling to an image and no raytracing.
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    a95360e View commit details
    Browse the repository at this point in the history
  14. Attempt to fix building of VTK grid

    Note that now the vtkAMRBox indices are (0,0,0) where the lower
    corner of the ghosted domain on the coarsest level is e.g. (-3,-3,-3)
    in Chombo indices.
    In theory this might make it annoying to calculate coordinates, but
    these should be calculated from the associated vtkUniformGrid objects
    anyway which have their origin at the correct place (i.e. Chombo's
    (0,0,0)).
    This is necessary as VTK expects the "origin" of the vtkAMRBoxes to be
    the lower bound.
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    43dd07b View commit details
    Browse the repository at this point in the history
  15. Refactor calling of Catalyst CoProcess

    Also change back to the old construction of vtkUniformGrids. I think the
    one that used the vtkAMRBoxes assumed node centering leading to the
    wrong dimensions.
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    1574003 View commit details
    Browse the repository at this point in the history
  16. Modify Catalyst Scripts

    These have been generated from more representative data of the current
    parameter file.
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    f88ce83 View commit details
    Browse the repository at this point in the history
  17. Update ParaView Catalyst scripts

    Add some recent new ones and remove some old ones.
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    fee88cd View commit details
    Browse the repository at this point in the history
  18. Create insitu makefile target

    This includes "Insitu" in the filename. Note that the default example
    executable will be built and linked with ParaView Catalyst if
    PARAVIEW_DIR is set correctly but will not be named accordingly.
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    5df0a4e View commit details
    Browse the repository at this point in the history
  19. Implement catalyst_vars parameter

    This allows the user to restrict which variables are passed to Catalyst.
    In theory this could be determined from the Catalyst script but the
    functions to determine this don't seem to work well with newer Catalyst
    scripts (i.e. those generated by v5.9 or later) and always request all
    variables.
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    d666910 View commit details
    Browse the repository at this point in the history
  20. Add support for multiple Catalyst scripts

    In order to do this, parameter names have been changed.
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    f828470 View commit details
    Browse the repository at this point in the history
  21. Make VTK/Catalyst log to a pout file

    This reduces VTK log output to stderr and instead sends it to a
    catalyst_pout (this name can be changed with the catalyst_pout_prefix
    parameter) file (for each rank) under the usual pout_subpath like the
    normal Chombo output (in the case MPI=TRUE). There is also a
    catalyst_verbosity parameter which controls both the verbosity of the
    VTK log output and the messages from CatalystAdaptor in the normal pout
    file.
    
    The -rdynamic flag will also be passed to the linker for the insitu
    build target so that the VTK log stack trace (which is output in the
    case of some termination signal) has more information for the [GR]Chombo
    part of the stack.
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    f3d9c37 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    502c025 View commit details
    Browse the repository at this point in the history
  23. Add Catalyst Insitu readme

    This provides instructions on building and using ParaView Catalyst
    in-situ visualization with a GRChombo example.
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    9e9ec91 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    ce6528d View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    4f6d9fb View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    76603c8 View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    2df36c9 View commit details
    Browse the repository at this point in the history
  28. Fix incorrect casting from IntVect to RealVect

    Also refactor error/warning in CatalystAdaptor
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    63b4a70 View commit details
    Browse the repository at this point in the history
  29. Add user to include extra VTK/ParaVIew components

    These can be specified with the XTRA_VTK_COMPONENT_FLAGS and
    XTRA_PARAVIEW_COMPONENT_FLAGS variables in the makefile which will be
    passed to paraview-config.
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    774340d View commit details
    Browse the repository at this point in the history
  30. Add Catalyst Insitu test

    This uses a script generated by ParaView 5.9.1 to extract an image of a
    slice and compares this image to a known valid one.
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    951b69e View commit details
    Browse the repository at this point in the history
  31. Fix CatalystAdaptor bug with no diagnostic vars

    This bug is not apparent in the case OPT=HIGH (so NDEBUG is defined) as
    the Chombo asserts are skipped but appears otherwise.
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    d36b883 View commit details
    Browse the repository at this point in the history
  32. Fix various problems with CatalystInsituTest

    * vtkPVVersion.h not present in all builds so replace with vtkPVConfig.h
    * Need to add the ParaView::RemotingCore component for the above header
    * Replace error from vtkImageDifference with thresholded error otherwise
    the test is way too sensitive
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    6b0344d View commit details
    Browse the repository at this point in the history
  33. Make ParaView version checking more portable

    Unfortunately it still won't work in some cases but I don't think
    there's an easy way to do so.
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    9bc6a0e View commit details
    Browse the repository at this point in the history
  34. Make Catalyst aware of the output_path parameter

    This means that any outputs for visualization pipelines will be created
    under this path.
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    59dd99a View commit details
    Browse the repository at this point in the history
  35. Add catalyst_remove_ghosts parameter

    This allows copying Chombo arrays to Catalyst without ghost cells (for
    debugging purposes).
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    1b9c294 View commit details
    Browse the repository at this point in the history
  36. Fix dimensions of vtkAMRBox

    These should be the same as that of the corresponding vtkUniformGrids.
    Thanks to Dave Demarle (@demarle) for finding this.
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    518c653 View commit details
    Browse the repository at this point in the history
  37. Add support for ParaView v5.8

    Switch to using a Catalyst v1.0 script for the test so that it will work
    with ParaView v5.8. Also add a header file to determine the ParaView
    version (not currently used but possibly useful in future).
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    02d5a3c View commit details
    Browse the repository at this point in the history
  38. Configuration menu
    Copy the full SHA
    468e59e View commit details
    Browse the repository at this point in the history
  39. Make VTK use the same number of threads as GRChombo

    If the VTK_SMP_MAX_THREADS environment variable is not set, the number of
    VTK SMP threads is set to the same as the number of OpenMP threads.
    
    Also add some small comments to CatalystAdaptor.hpp.
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    352ee3c View commit details
    Browse the repository at this point in the history
  40. Make preCatalystCoProcess fill ghosts by default

    The ghosts are filled for variables requested at the previous CoProcess.
    One can also pass a non-positive interval of variables to fillAllGhosts
    which will just make it return without doing any ghost filling.
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    6395ba8 View commit details
    Browse the repository at this point in the history
  41. Configuration menu
    Copy the full SHA
    27b8951 View commit details
    Browse the repository at this point in the history
  42. Fix potential segfault with BinaryBH example

    This would occur if Catalyst was used but the extraction parameters were
    not set (so minimum extraction_level parameter doesn't exist).
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    1b35751 View commit details
    Browse the repository at this point in the history
  43. Pass ghost cell info to Catalyst

    Cells that are marked as ghosts will no longer be visible in ParaView
    (e.g. those in the outer boundary).
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    8b6ee34 View commit details
    Browse the repository at this point in the history
  44. Add ability to write VTK XML files from Catalyst

    This writes the created vtkOverlappingAMR object to a file. It's mainly
    for debugging but I guess in theory it allows a user to save the state
    of the grid at any timestep on any level rather than just a whole
    coarsest level timestep.
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    59a5022 View commit details
    Browse the repository at this point in the history
  45. Initialize vtkUniformGrids from vtkAMRBoxs

    This shifts the set `origin` of the `vtkUniformGrid`s from the
    `global_origin` at (0,0,0) (in Chombo coordinates) to that of the low
    corner of the box. This seems to disagree with what is done in the
    ParaView Catalyst CxxOverlappingAMRExample but makes the outputted VTK
    XML files appear more sensible when loaded in ParaView.
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    5cedc26 View commit details
    Browse the repository at this point in the history
  46. Refactor Catalyst parameter code

    Now, all of the Catalyst parameters used in `CatalystAdaptor` are in a
    `CatalystAdaptor::m_p`, a struct of type `CatalystAdaptor::params_t`.
    This will make it easier to add/modify parameters. Previously multiple
    functions across the `CatalystAdaptor` and `GRAMR` classes as well as a
    Setup function needed to be modified every time a Catalyst parameter was
    changed. Note that some parameters are used elsewhere (e.g.
    `catalyst_coprocess_level` in `GRAMRLevel` and are therefore not part of
    `CatalystAdaptor::params_t`.
    
    Some parameters have been renamed in order to make them more consistent
    (all Catalyst parameters are now prefixed with `catalyst_`). The Insitu
    README has been updated accordingly.
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    a2bc9fa View commit details
    Browse the repository at this point in the history
  47. Add VTK XML file parameters

    This allows the user to make Catalyst write VTK XML files for the 3D AMR
    data that is passed to Catalyst at each Catalyst coprocess and specify
    the filename prefix of these files.
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    362ff95 View commit details
    Browse the repository at this point in the history
  48. Make CatalystInsituTest check PNG is modified

    The test should not pass with a PNG from a previous run if Catalyst
    fails to run for whatever reason.
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    068c213 View commit details
    Browse the repository at this point in the history
  49. Fix incorrect comparison on file modification time

    This was probably obvious but the `tv_nsec` member of a `timespec`
    struct is only the number of nanoseconds since the last full second so
    it is necessary to compare the `tv_sec` member first.
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    69c3755 View commit details
    Browse the repository at this point in the history
  50. Delete generated PNG at start of CatalystInsituTest

    Remove all the code that checks the modified timestamps and simply just
    delete the old file at the start. This way, if nothing is generated, the
    test will definitely fail.
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    49628de View commit details
    Browse the repository at this point in the history
  51. Fix slice visualization artifacts

    The key step is to apply vtkParallelAMRUtilities::StripGhostLayers
    (which removes layers of fine ghost cells that only partially cover
    coarse cells) and vtkParallelAMRUtilties::BlankCells (which blanks out
    coarser cells that are covered by finer cells on a different rank -- I
    thought this was automatic previously) to the vtkOverlappingAMR object
    (this is done in the [VisIt Chombo
    Reader](https://gitlab.kitware.com/paraview/visitbridge/-/blob/df098f4148a96d62c388861c1d476039e02224ae/databases/AvtAlgorithms/vtkAvtSTMDFileFormatAlgorithm.cxx#L511-L514)).
    Since the former might require deep copying (in case stripping happens),
    a temporary vtkOverlappingAMR object is instantiated in
    CatalystAdaptor::coprocess which is used to create the grid and add the
    fields. This is then copied (either shallow or deep as necessary) to the
    m_vtk_grid_ptr member which is passed to Catalyst. Note that now, no
    cells are manually marked as ghosts in CatalystAdaptor::build_vtk_grid
    as I observed gaps when doing so. The only marking of ghosts now comes
    from BlankCells.
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    7d81232 View commit details
    Browse the repository at this point in the history
  52. Fix parameter name typo

    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    64cf4ad View commit details
    Browse the repository at this point in the history
  53. Configuration menu
    Copy the full SHA
    5698b55 View commit details
    Browse the repository at this point in the history
  54. Make make exit earlier if there are Catalyst problems

    Previously the paraview-config command could fail and the build would
    continue going which made it difficult for the user to see where the
    problem is. Also commands that exit with non-zero exit codes are no
    longer cached by the cache.sh script so that the paraview-config error
    always appears.
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    3a3eed0 View commit details
    Browse the repository at this point in the history
  55. Fix in-situ building with old Make versions

    These don't have the .SHELLSTATUS variable.
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    800deed View commit details
    Browse the repository at this point in the history
  56. Make GitHub action use latest ParaView version

    Also update CMake version to 3.22.6.
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    5b6d28f View commit details
    Browse the repository at this point in the history
  57. Update Catalyst README

    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    15851dd View commit details
    Browse the repository at this point in the history
  58. Add passing of GRChombo parameters to Catalyst

    These are set as environment variables which can be recovered in the
    Catalyst Python script. Also update slice_chi.py.
    mirenradia committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    e78dee1 View commit details
    Browse the repository at this point in the history
  59. Configuration menu
    Copy the full SHA
    7ada53b View commit details
    Browse the repository at this point in the history
  60. Configuration menu
    Copy the full SHA
    8974a0c View commit details
    Browse the repository at this point in the history
  61. Configuration menu
    Copy the full SHA
    d84a86a View commit details
    Browse the repository at this point in the history

Commits on Feb 14, 2023

  1. Fix compilation with old VTK versions

    The vtkPythonInterpreter::SetRedirectOutput() function was introduced
    with VTK version 9.1.0.
    mirenradia committed Feb 14, 2023
    Configuration menu
    Copy the full SHA
    cee3031 View commit details
    Browse the repository at this point in the history

Commits on Feb 15, 2023

  1. Configuration menu
    Copy the full SHA
    d084a76 View commit details
    Browse the repository at this point in the history