Skip to content
Snippets Groups Projects
  1. Apr 10, 2024
  2. Apr 09, 2024
    • Florian Atteneder's avatar
      `GRHD`: Implement reflection bdry conditions for `valencia1d, spherical1d,... · 89bde3a2
      Florian Atteneder authored
      `GRHD`: Implement reflection bdry conditions for `valencia1d, spherical1d, rescaled_spherical1d` formulations (!131, !131)
      
      It works nicely with `spherical1d, rescaled_spherical1d`, but fails miserably with `valencia1d`.
      Not sure what the problem there is, because for both `rescaled_spherical1d` and `valencia1d` I need to interpolate onto the origin after unscaling the conservatives,
      because the volume factor comes with an extra `r` that makes the conservatives vanish there.
      However, for `valencia1d` and `spherical1d` I also have singular source terms, which I don't have in `rescaled_spherical1d`.
      89bde3a2
    • Florian Atteneder's avatar
      `@with_signature`: avoid tuple limit by using `get_variable` unpacking... · 8bb97adc
      Florian Atteneder authored
      `@with_signature`: avoid tuple limit by using `get_variable` unpacking directly in function body (!130, !130)
      
      The implementation of the `doublecartoon` formulation in `GRHD` finally hit the tuple length limit, above which tuples are stack allocated and, thus, incur a drastic performance hit due to extra allocs.
      
      Here we update `@with_signature` so that we no longer have to pass arguments through tuples,
      but instead we look them up with the `get_variable` method from `mesh.cache`.
      This way we also do the unpacking now directly inside the macro-generated function body.
      
      Its not an ideal solution, because now `@with_signature` can no longer be used without the `get_variable` method from `dg1d`, which increases coupling.
      But for the moment I don't bother, and I shall worry about that whenever I decided to move `@with_signature` into a separate pkg, if ever.
      
      ---
      
      The `get_variable` method and `Cache` could also use a bit of benchmarking and optimizations.
      E.g. atm we perform three lookups
      - `isregistered` to check if the variable is available
      - `Cache.variables_to_fields` to determine in which variable group the variable can be found
      - `getproperty(::Variable, ::Symbol)` to get the variable
      
      Clearly, this could be improved, but we leave that for the future.
      
      ---
      
      Obviously, I also updated the tests. But I refused to setup now `Cache`s for each test case.
      Instead I just added a dispatch `get_variable(::NamedTuple, ::Symbol)` and a `cache` argument to the expanded function so that the tests didn't so much adjustments.
      8bb97adc
  3. Apr 08, 2024
    • Florian Atteneder's avatar
      GRHD: Fix rescaled_spherical1d formulation (!128,... · 6db7df71
      Florian Atteneder authored
      GRHD: Fix rescaled_spherical1d formulation (!128, !128)
      
      A few issues have silently accumulated because we did not add a reftest when we introduced this formulation.
      This PR fixes them and adds a reftest.
      6db7df71
    • Florian Atteneder's avatar
      GRHD: Add reftest for doublecartoon formulation (!129,... · 4073fda4
      Florian Atteneder authored
      GRHD: Add reftest for doublecartoon formulation (!129, !129)
      4073fda4
    • Florian Atteneder's avatar
      GRHD: Revert changes from !114 regarding spherical1d formulation... · 9a36fa5e
      Florian Atteneder authored
      GRHD: Revert changes from !114 regarding spherical1d formulation (!127, !127)
      
      Although we had a reftest added for the TOV test with `spherical1d`, we had not enabled the comparison of data. As such the test was almost useless. This is fixed here for this test. But we should add more reftests for other formulations in separate PRs.
      9a36fa5e
    • Florian Atteneder's avatar
      GRHD Fixup atmosphere freezing logic (!126,... · bb45e414
      Florian Atteneder authored
      GRHD Fixup atmosphere freezing logic (!126, !126)
      
      We need to account for the fact that global solution is degenerated on cell interfaces.
      Because of that we need to cast our data stencil wider when we check for resets on a bdry.
      bb45e414
    • Florian Atteneder's avatar
      GRHD: Implement reflection bdry conditions for doublecartoon formulation and... · f9332c88
      Florian Atteneder authored
      GRHD: Implement reflection bdry conditions for doublecartoon formulation and TOV test. (!125, !125)
      
      I decided to implement the symmetry conditions now differently than I did for the other formulations (`spherical1d, rescaled_spherical1d, valencia1d`).
      That is, I now compute the bdry values of the state variable separately before I call `bdryllf_...`.
      The values are computed such that
      - for variables that are even wrt `r -> -r` trafos, the x derivative of the nodal approximation at the origin vanishes,
      - for variables that are odd wrt `r -> -r` trafos, the value of the nodal approximation at the origin vanishes.
      Given this data (stored in `bdry_D, bdry_Sx, bdry_tau`), I then impose the bdry conditions weakly by using the LLF flux and the previously computed
      bdry values as exterior states.
      I also tested computing the exterior states according to `q^+ = -q^- + 2 q_BC`, where `q_BC` are the previously computed values, but did not find that
      this has significant effect.
      
      What is interesting is that this implementation (doublecartoon + reflection bdry conds.) can now be evolved without symmetrizing the state vector explicitly
      and it appears to be stable, e.g. no blowup at the origin.
      I wonder whether adapting this way of imposing bdry conditions for other formulations would also help with stability, although I am not sure anymore
      if they suffered from blowups in the reflected case.
      Note that all other formulations suffer from the problem of division by zero, which we dynamically fix up by explicit symmetrization. Imposing the bdry
      conditions then differently won't fix that issue.
      
      However, for now we keep the bdry conditions in the other formulations as they currently are.
      
      ---
      
      More thoughts about bdry values:
      - Like I said above, all other formulations use the values from initial data as bdry values, which makes sense because the solution is supposed to be static.
      One should check if using instead bdry values such that the symmetry conditions are satisfied actually works better and/or is factually more accurate.
      The latter might be plausible, because numerical dissipation (espcially with AV) might just cause a decrease in the central density.
      Using instead the initial data as bdry values would try to keep the central density as it is, despite the star solution being altered.
      - For the mirrored domain test we can have a grid setup in which the cells faces fall onto the origin. It would make sense to test if using similarly
      constructed interface values for the LLF flux at the interfaces that lie at the origin. Maybe that could also cure the stability issue we see in
      all the mirrored runs.
      f9332c88
  4. Apr 06, 2024
  5. Apr 05, 2024
    • Florian Atteneder's avatar
      Improvements to TOV evolutions, pt 3 (!114) · 4c60aa71
      Florian Atteneder authored
      * manually undo the insertion of the refvol factor into spherical1d
      formulation
      
      the formulae without the refvol factor should already be correct
      in particular, they correspond to the choice where all three
      metrics (physical one, conformal one and reference one) all agree
      I will document this properly in a follow up PR were I also
      disentangle all formulations
      
      * rename llf and bdryllf to refer to spherical1d formulation
      
      * update example parfile
      
      * fix derivatives of induced metric in initial data
      
      * remove unused variables
      
      * fix sign in 4 metric determinant
      
      * fixup minus and fix doublecartoon corrections at x=0
      
      * fix todo conflict
      
      * some todos
      
      * implement symmetrizer around origin, but disable it for now
      
      * fix computation of state variables in llf_doublecartoon
      
      * some debug statements
      
      * implement the doublecartoon correction
      
      * implement the doublecartoon correction
      
      * remove not evolved y,z components and fixup nomenclature
      
      * add doublecartoon implementation
      
      * factor out data reader from initial data setup
      
      * update parfile
      
      * add more tov examples
      
      * fix spherical1d to account for reference volume element
      
      * fixup impose_symmetry! for valencia1d
      
      * reset tau when it falls below 0
      
      this is needed to run with lower atmosphere densities
      
      * impose symmetry on state variables before c2p
      
      * callbacks: fix atm freezing logic
      
      * c2p: todos
      
      * implement valancia1d version that works with tov test
      
      * add grhd_bondi example that uses valencia1d formulation
      
      * implement valencia1d version
      
      * add valencia1d option for formulation parameter
      
      * c2p: more verbose log output
      
      * register more variables for rescaled_spherical1d
      
      * fix dispatch in setup.jl
      
      * verify formulation parameter
      
      * add bdryllf for rescaled_spherical1d
      
      * stop gap for unhandled cases of singularities in impose_symmetry functions
      4c60aa71
  6. Apr 04, 2024
  7. Apr 03, 2024
  8. Apr 02, 2024
  9. Mar 05, 2024
    • Florian Atteneder's avatar
      Implement `u_norm2` 0d output for ScalarEq projects (!119) · 51ed2d8e
      Florian Atteneder authored
      * update 2d reftests to check 2d output
      
      also reduced number of output variables and
      times in order to save storage
      
      * IntegrationTests: error when reference data is missing
      
      * fix filename of 2d output
      
      * also test 0d output with fv_muscl_burgers_sine reftest
      
      * fix u_norm2 computation for FVElement
      
      * reftests: update advection_sine_analysis
      
      * implement u_norm2 0d analysis variable
      51ed2d8e
    • Florian Atteneder's avatar
      genearlize slope limiting to meshes (!118) · 5ad92b21
      Florian Atteneder authored
      * undo method redefintion
      
      * reftests: update fv_muscl_burgers_sine
      
      note: fv_muscl_burgers_sine gives an asymmetric result when we use
      upwinding (muscl_omega=1.0) which is probably wrong
      
      * fixup update_test script
      
      * remove dead code
      
      * utilize limit_slope! method in ScalarEq/rhs.jl
      
      * Implement integration for FVElement meshes with slope limited data
      
      * extract slope limiter from ScalarEq/rhs.jl FV methods
      
      fixup hrsc prms
      
      * remove dead code
      
      * reftest: update fv_muscl_burgers_sine to use aligned_ts for outputs
      5ad92b21
  10. Mar 04, 2024
    • Florian Atteneder's avatar
      Split output into 0d, 1d, 2d files (!117) · d89dbf27
      Florian Atteneder authored
      * bump version
      
      * reftests: replace old output.h5 files with output0d/1d/2d.h5 files
      
      * reftests: update all parfiles to use the new output parameters
      
      * teach IntegrationTests how to deal with new output files
      
      * update unit tests
      
      * SaveCallbacks: handle file format properly
      
      * Let SaveCallback append the file extensions
      
      * for now restrict substep and interpolating output to 1d and h5 format
      
      remove substep_format1d, substep_format2d parameters
      
      * queue in all SaveCallbacks
      
      * only use variables0d/1d/2d/ to determine if that output is enabled
      
      * SaveCallback: adjust terminal value logic for absent format specifier
      
      * Adjust Output parameters
      
      - remove enabled0d/1d/2d
      - only output if a non-empty string value of format0d/format1d/format2d
        is provided
      - replace variable with variable0d/1d/2d so that output is split into
        three files
      
      * Teach TimeAlignedSaveCallback to adjust time steps
      of multiple SaveCallbacks at once
      
      * define Base.append overload to work with AbstractVectors
      
      * type annotate kwargs for SaveCallback
      d89dbf27
    • Florian Atteneder's avatar
      fix invalidations by upgrading to Jacobi@v0.70 (!106) · 297f3726
      Florian Atteneder authored
      * bump ci julia version to 1.10
      
      * update manifest
      
      * ignore experiments folder
      
      * compat Jacobi
      
      * fix invalidations by upgrading to Jacobi@v0.6.2
      
      requires to dev my fork here:
      https://github.com/fatteneder/Jacobi.jl/tree/fa/bump-polynomials
      297f3726
  11. Feb 26, 2024
  12. Feb 19, 2024
    • Florian Atteneder's avatar
      Improvements to TOV evolutions, pt 2 (!113) · 4531207e
      Florian Atteneder authored
      * wip: stash some tov examples
      
      * update grhd ref tests to use c2p_freeze_atm_reset = false to restore previous behavior
      
      * init c2p_freeze_atm
      
      * fixup logic of freezing atm
      
      * introduce c2p_freeze_atm flag which allows to define when an atmosphere can propagate
      
      * fix time step computation to use maximum of smoothed_mu
      
      * rescale smoothed viscosity by the extrema of D
      
      * add more example parfiles for tov case
      
      * enable c2p_freeze_atm_reset option
      
      * add cons2prim_rescaled_spherical1d_freeze_flags
      
      * add c2p_freeze_atm_reset option
      
      * document perturbation_rho parameter
      
      * update examples
      
      * experiment with partially frozen c2p flags
      
      * don't bernstein in AV computation
      
      * add c2p with partially frozen reset flags
      
      * use buffers for logarithmic AV indicators
      
      * remove isinvalid
      
      * remove dead code
      
      * avoid splat constructor from CallbackSet
      
      * add punctuation to some parameter doc strings
      4531207e
  13. Feb 13, 2024
    • Florian Atteneder's avatar
      Add option to output data from substeps (!112) · 227743ee
      Florian Atteneder authored
      * add more colors to highlight in which files comparisons failed
      
      * IntegrationTests: always use terminal coloring to highlight results
      
      * update update_test script
      
      * include substep outputting in some reftests
      
      * teach IntegrationTests about substep_output.h5
      
      * add unit test
      
      * move substep savecallback logic into convert_to_remote_savecallback!
      
      only add remote savecallback when requested
      
      * enable substep output
      
      * introduce AbstractCallbackTrigger and CallbackTrigger
      
      * add parameters
      227743ee
  14. Feb 12, 2024
    • Florian Atteneder's avatar
      Remove experiments folder and add more TOV FV examples (!111) · 2269ba71
      Florian Atteneder authored
      * remove experiments folder
      
      * grhd_tov: add more slope limiter examples
      2269ba71
    • Florian Atteneder's avatar
      Implement FV sloper limiter for GRHD (!110) · 1622accc
      Florian Atteneder authored
      * add fv_tvb_mirrored.toml TOV example
      
      * add reftest fv_superbee_grhd_bondi_accretion
      
      * implement rhs_slope_limiter!
      
      * need init_ variables also for FV because of bdry conditions
      
      * no need to compute fluxes when setting up initial data
      
      * fixup callbacks
      
      * add fv_grhd_bondi_accretion reftest
      
      * a separate register! for FV
      
      * disambiguate rhs! dispatch
      
      * SRHD: remove unused variables from fv method
      
      * dispatch on mesh for register!
      
      * splice in fv method dispatch
      
      * add new parameters
      1622accc
    • Florian Atteneder's avatar
      Implement FV slope limiter for SRHD (!109) · cef37243
      Florian Atteneder authored
      * SRHD: add reftest srhd_simple_wave_fv_tvb
      
      * SRHD: Implement slope limiter methods
      
      * SRHD: clean up c2p
      
      * SRHD: use Brent's method in c2p because A42 is currently bugged
      
      * only init relevant bdry variables
      
      * register more vars
      
      * wrap existing FV method as rhs_fv_central
      
      * thin out internal rhs! usage
      
      * organize rhs.jl
      
      * a registration for new hrsc method
      
      * rename _register_variables! to register!
      
      * add new parameters
      cef37243
  15. Feb 11, 2024
    • Florian Atteneder's avatar
      Add FV slope limiter methods to some projects (!108) · baec483a
      Florian Atteneder authored
      * EulerEq: add more ref tests for FV slope limiters
      
      * EulerEq: rename hrsc option 'muscl' to 'slope_limiter' and implement
      more limiters
      
      * TCI: implement maxmod
      
      * EulerEq: compute max speed for each substep
      
      * add ref test fv_muscl_euler_isentropic_flow
      
      * fix doc string of LLF
      
      * TCI: make minmod non-allocating
      
      * log invalid dt
      
      * EulerEq: make muscl scheme run
      
      * EulerEq: PoC muscl scheme
      
      * EulerEq: run callbacks, initialdata only when certain variables are registered
      
      * EulerEq: Add LV dependency
      
      * evolve: init stages before capturing them
      
      * EulerEq: strip down rhs! args
      
      * rename _register_variables! to register! in EulerEq
      
      * add new parameters to EulerEq project
      
      * fix fn name
      
      * remove unused file
      
      * add reftest fv_muscl_burgers_sine
      
      * fixup muscl implementation; also make it work with arbitrary fluxes
      
      * fix parameter check
      
      * rename prm hrsc_omega to muscl_omega
      
      * add ref test for muscl scheme
      
      * implement muscl scheme
      
      * implement new parameters
      baec483a
  16. Feb 07, 2024
    • Florian Atteneder's avatar
      Improvements to TOV evolutions (!107) · 5de00c71
      Florian Atteneder authored
      * fix reftest output coloring when non interactive
      
      * add TODO branches for bdry conds
      
      * fixup check for coordinate signularity on grid
      
      * implement different bdry conditions for bondi and tov problem
      
      also update bondi reftest
      
      * more example parfiles
      
      * c2p: fix computation of W
      
      * make training wheel ID work independent of method
      
      * fix ID interpolation for FV method
      
      * cleanup fv_rhs.jl
      
      * skip symmetry imposition if signularity is not on grid
      
      * mirror TOV initial data for mirrored domains
      
      * add bernstein tov example
      
      * implement bernsteining
      
      * add missing cache wrapper for bdry variables
      
      * reconstruct dynamic variables after viscosity computation
      
      * add perturbation_rho parameter
      
      * add a D dependency to viscosity
      
      * allow to only evolve initial data in star's interior
      
      * add rho h W^2 variable for analysis
      
      * make initial viscosity work
      
      * allow slightly negative energies
      
      * pull out y0 from vr limiter in cons2prim
      
      * add training_wheels options which smooths initial dynamical variables
      
      * update example parfiles
      
      * update tov examples
      
      * wip: tinker with c2p and viscosity computation in atmospheric regions
      
      * filter AV from atmosphere cells
      
      * enable inflow condition on inner boundary
      
      * fix imposition of EoS bounds in cons2prim
      
      also disabling lower bracket adjustment, because it seems to be wrong
      with this the FV method can now run
      
      * cleanup cons2prim
      
      * wip: tinkering with cons2prim
      
      * compute AV for initial data
      
      * implement av_drag option
      
      * wip: tinker with c2p routine
      
      * add c2p analysis vars
      
      * stabilize origin of TOV with Neumann bdry conditions
      
      * implement entropy_variables_rescaled_spherical1d
      
      * use log(D) for MDA viscosity because it is more sensitive
      
      * fix maxspeed_rescaled_spherical1d
      
      * example parfile that allows to evolve the tov for quite a while
      
      * apply velocity limiter from dumbser at the end of cons2prim
      
      * fix maxspeed
      5de00c71
  17. Jan 25, 2024
    • Florian Atteneder's avatar
      Implement a balanced Burgers equation (!105) · a864ea1e
      Florian Atteneder authored
      * add update_test helper script
      
      * add ref test balancedburgers_kink_avmda
      
      * fix time step computation for AV method
      
      * simplify inf clipping
      
      * mda: use local instead of global speed to compute baseline av
      
      * favor likely case in if in mda computation
      
      * implement av dragging
      
      * add av_drag parameter
      
      * spice up IntergrationTests logging with colors
      
      * fix 0th order AV smoother
      
      * implement BalancedBurgers equation
      
      * fix fv stepping to also add dt to source term
      a864ea1e
  18. Jan 24, 2024
    • Florian Atteneder's avatar
      Fix time stepping for FV methods (!104) · ce264598
      Florian Atteneder authored
      * cleanup
      
      * rm old ERK evolutions
      
      * fixup fv ref tests
      
      * rename rk steppers to ode_step!
      
      * for FV methods forward dt from evolution via cache
      
      fixes mismatch in dt values that were used in the time stepper and the
      rhs functions
      the mismatch was caused by the time stepper always applying the CFL
      (and output callbacks could further shorten the proposed time step)
      eventually, this lead to wrong propagation speeds, which can be seen
      by the test results of fv_advection_sine (we expect same profile as
      initial data after two revolutions, but we actually saw 2.5)
      
      only add dt for FV evolutions
      
      * fixup kwarg forwarding in register_variables
      ce264598
  19. Jan 15, 2024
Loading