From 13c251b584490c6da921c85d9265421702ab757f Mon Sep 17 00:00:00 2001 From: Geoffroy Lesur Date: Wed, 18 Oct 2023 11:00:33 +0200 Subject: [PATCH] fix merge with master add changelog fix test suite for -noplot --- CHANGELOG.md | 5 ++++- pytools/idfx_test.py | 2 +- src/fluid/fluid.hpp | 5 ++++- src/output/output.cpp | 45 +++---------------------------------------- src/output/xdmf.cpp | 2 -- src/output/xdmf.hpp | 3 --- 6 files changed, 12 insertions(+), 50 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1b44e06..9c95bcb9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,10 +27,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - fixed a bug that led to race condition when using GPU offloading, axis boundary condition and domain decomposition along X3 (!309) - fixed a bug that led to inconsistent results with MPI and UCT_HLLx EMF reconstruction schemes (!310) - fixed a bug that could result in .dmp file duplication on restart (!354) +- Moving developement onto github.com. Some references to merge requests will likely be lost. - fixed a bug in v2.0 developement branch that resulted in broekn dump files when MHD was enabled with DIMENSIONS<3 (#174) - IDEFIX_Debug now automatically introduce Kokkos::fence at the end of each idefix_for, enforcing synchronisation between host and device when debugging (#188) -- Moving developement onto github.com. Some references to merge requests will likely be lost. - Do not use git lfs anymore due to bandwidth restrictions imposed by github (#183) +- use proper cell centroid PLM reconstruction when using non-cartesian coordinates (#196) +- fixed a bug that could lead to low (O(1e-10)) leakage of conserved quantities along the axis (#196) +- changed radial pressure curvature term so that machine precision balance is achieved for constant pressure flows in every geometry (#196) ### Added - Self-gravity (!186) diff --git a/pytools/idfx_test.py b/pytools/idfx_test.py index 69d6429e..ce718f37 100644 --- a/pytools/idfx_test.py +++ b/pytools/idfx_test.py @@ -28,7 +28,7 @@ def __init__ (self): idefix_dir_env = os.getenv("IDEFIX_DIR") parser.add_argument("-noplot", - dest="plot", + dest="noplot", help="disable plotting in standard tests", action="store_false") diff --git a/src/fluid/fluid.hpp b/src/fluid/fluid.hpp index f6177d85..ae809b48 100644 --- a/src/fluid/fluid.hpp +++ b/src/fluid/fluid.hpp @@ -15,12 +15,15 @@ #include "idefix.hpp" #include "grid.hpp" #include "fluid_defs.hpp" +#include "eos.hpp" #include "thermalDiffusion.hpp" #include "bragThermalDiffusion.hpp" #include "selfGravity.hpp" #include "vtk.hpp" #include "dump.hpp" -#include "eos.hpp" +#ifdef WITH_HDF5 +#include "xdmf.hpp" +#endif // forward class declaration class DataBlock; diff --git a/src/output/output.cpp b/src/output/output.cpp index b1c473d1..15f0bf8f 100644 --- a/src/output/output.cpp +++ b/src/output/output.cpp @@ -11,7 +11,6 @@ #include "fluid.hpp" #include "slice.hpp" - Output::Output(Input &input, DataBlock &data) { idfx::pushRegion("Output::Output"); // initialise the output objects for each format @@ -66,24 +65,6 @@ Output::Output(Input &input, DataBlock &data) { } } - - // Initialise xdmf outputs - if(input.CheckEntry("Output","xdmf")>0) { - xdmfPeriod = input.Get("Output","xdmf",0); - if(xdmfPeriod>=0.0) { // backward compatibility (negative value means no file) - xdmfLast = data.t - xdmfPeriod; // write something in the next CheckForWrite() - #ifdef WITH_HDF5 - xdmfEnabled = true; - #else - xdmfEnabled = false; - IDEFIX_ERROR("Attention: HDF5 library not linked when building Idefix!"); - #endif - } - } - #ifdef WITH_HDF5 - xdmf.Init(input,data); // Always initialised in case of emergency xdmf output - #endif - // intialise dump outputs if(input.CheckEntry("Output","dmp")>0) { dumpPeriod = input.Get("Output","dmp",0); @@ -120,6 +101,9 @@ Output::Output(Input &input, DataBlock &data) { data.dump->RegisterVariable(&dumpLast, "dumpLast"); data.dump->RegisterVariable(&analysisLast, "analysisLast"); data.dump->RegisterVariable(&vtkLast, "vtkLast"); + #ifdef WITH_HDF5 + data.dump->RegisterVariable(&xdmfLast, "xdmfLast"); + #endif idfx::popRegion(); } @@ -312,29 +296,6 @@ void Output::ForceWriteXdmf(DataBlock &data) { } #endif -#ifdef WITH_HDF5 -void Output::ForceWriteXdmf(DataBlock &data) { - idfx::pushRegion("Output::ForceWriteXdmf"); - - if(!forceNoWrite) { - if(userDefVariablesEnabled) { - if(haveUserDefVariablesFunc) { - // Call user-def function to fill the userdefined variable arrays - idfx::pushRegion("UserDef::User-defined variables function"); - userDefVariablesFunc(data, userDefVariables); - idfx::popRegion(); - } else { - IDEFIX_ERROR("Cannot output user-defined variables without " - "enrollment of your user-defined variables function"); - } - } - xdmfLast += xdmfPeriod; - xdmf.Write(data, *this); - } - idfx::popRegion(); -} -#endif - void Output::EnrollAnalysis(AnalysisFunc myFunc) { idfx::pushRegion("Output::EnrollAnalysis"); if(!analysisEnabled) { diff --git a/src/output/xdmf.cpp b/src/output/xdmf.cpp index 702f89ec..7f2baf7d 100644 --- a/src/output/xdmf.cpp +++ b/src/output/xdmf.cpp @@ -185,7 +185,6 @@ Xdmf::Xdmf(Input &input, DataBlock *datain) { D_EXPAND( x1_cell = grid.x[IDIR](i + data->gbeg[IDIR]); , x2_cell = grid.x[JDIR](j + data->gbeg[JDIR]); , x3_cell = grid.x[KDIR](k + data->gbeg[KDIR]); ) - } #if (GEOMETRY == CARTESIAN) || (GEOMETRY == CYLINDRICAL) node_coord(0,k,j,i) = x1; @@ -251,7 +250,6 @@ Xdmf::Xdmf(Input &input, DataBlock *datain) { this->mpi_data_start[dir] = data->gbeg[2-dir]-grid.nghost[2-dir]; this->mpi_data_size[dir] = grid.np_int[2-dir]; this->mpi_data_subsize[dir] = data->np_int[2-dir]; - } #elif (DIMENSIONS == 2) for(int dir = 0; dir < DIMENSIONS ; dir++) { diff --git a/src/output/xdmf.hpp b/src/output/xdmf.hpp index 4966827f..b2fb6628 100644 --- a/src/output/xdmf.hpp +++ b/src/output/xdmf.hpp @@ -8,7 +8,6 @@ #ifndef OUTPUT_XDMF_HPP_ #define OUTPUT_XDMF_HPP_ #include - #include #include #include "idefix.hpp" @@ -30,7 +29,6 @@ class Output; class DataBlock; - class Xdmf { friend class Dump; @@ -123,5 +121,4 @@ void Xdmf::RegisterVariable(T& in, std::string name, int var) { xdmfScalarMap.emplace(name, ScalarField(in, var)); } } - #endif // OUTPUT_XDMF_HPP_