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

fix 'pure virtual method called' error #774

Merged
merged 4 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion extern/amrex
Submodule amrex updated 78 files
+1 −0 .github/workflows/cuda.yml
+10 −14 .github/workflows/gcc.yml
+3 −3 .github/workflows/hip.yml
+5 −5 .github/workflows/intel.yml
+1 −1 .github/workflows/smoke.yml
+1 −1 .github/workflows/style/check_tabs.sh
+1 −1 .github/workflows/style/check_trailing_whitespaces.sh
+2 −2 Docs/sphinx_documentation/source/Basics.rst
+16 −3 Docs/sphinx_documentation/source/EB.rst
+2 −2 Docs/sphinx_documentation/source/RuntimeParameters.rst
+106 −0 Src/AmrCore/AMReX_FillPatchUtil.H
+221 −63 Src/AmrCore/AMReX_FillPatchUtil_I.H
+42 −1 Src/Base/AMReX_Arena.H
+65 −2 Src/Base/AMReX_Arena.cpp
+4 −1 Src/Base/AMReX_BArena.cpp
+0 −12 Src/Base/AMReX_CArena.H
+8 −31 Src/Base/AMReX_CArena.cpp
+183 −86 Src/Base/AMReX_CTOParallelForImpl.H
+76 −2 Src/Base/AMReX_CoordSys.cpp
+2 −2 Src/Base/AMReX_DistributionMapping.cpp
+83 −21 Src/Base/AMReX_Enum.H
+14 −1 Src/Base/AMReX_Geometry.H
+3 −3 Src/Base/AMReX_GpuPrint.H
+51 −0 Src/Base/AMReX_IOFormat.H
+3 −0 Src/Base/AMReX_IntVect.H
+67 −0 Src/Base/AMReX_Math.H
+7 −0 Src/Base/AMReX_NonLocalBC.H
+2 −0 Src/Base/AMReX_PArena.cpp
+265 −30 Src/Base/AMReX_ParmParse.H
+60 −32 Src/Base/AMReX_ParmParse.cpp
+50 −0 Src/Base/AMReX_PhysBCFunct.H
+2 −1 Src/Base/AMReX_RKIntegrator.H
+24 −0 Src/Base/AMReX_Stack.H
+2 −1 Src/Base/AMReX_TinyProfiler.H
+58 −30 Src/Base/AMReX_TinyProfiler.cpp
+3 −5 Src/Base/AMReX_VisMF.cpp
+5 −0 Src/Base/AMReX_iMultiFab.H
+45 −0 Src/Base/AMReX_iMultiFab.cpp
+4 −0 Src/Base/AMReX_parmparse_mod.F90
+2 −0 Src/Base/CMakeLists.txt
+3 −0 Src/Base/Make.package
+2 −13 Src/Base/Parser/AMReX_IParser_Exe.H
+2 −13 Src/Base/Parser/AMReX_Parser_Exe.H
+8 −12 Src/Base/Parser/AMReX_Parser_Y.H
+1 −2 Src/EB/AMReX_EB2_2D_C.cpp
+3 −1 Src/EB/AMReX_EB2_3D_C.cpp
+5 −2 Src/EB/AMReX_EB2_IndexSpace_STL.cpp
+5 −2 Src/EB/AMReX_EB2_IndexSpace_chkpt_file.cpp
+4 −0 Src/F_Interfaces/AmrCore/AMReX_fluxregister_mod.F90
+4 −0 Src/F_Interfaces/Base/AMReX_boxarray_mod.F90
+4 −0 Src/F_Interfaces/Base/AMReX_distromap_mod.F90
+4 −0 Src/F_Interfaces/Base/AMReX_fab_mod.F90
+4 −0 Src/F_Interfaces/Base/AMReX_geometry_mod.F90
+12 −0 Src/F_Interfaces/Base/AMReX_multifab_mod.F90
+8 −2 Src/F_Interfaces/Base/AMReX_multifabutil_fi.cpp
+25 −1 Src/F_Interfaces/Base/AMReX_multifabutil_mod.F90
+4 −0 Src/F_Interfaces/Base/AMReX_physbc_mod.F90
+4 −0 Src/F_Interfaces/LinearSolvers/AMReX_abeclaplacian_mod.F90
+4 −0 Src/F_Interfaces/LinearSolvers/AMReX_multigrid_mod.F90
+4 −0 Src/F_Interfaces/LinearSolvers/AMReX_poisson_mod.F90
+4 −0 Src/F_Interfaces/Particle/AMReX_particlecontainer_mod.F90
+1 −1 Src/LinearSolvers/MLMG/AMReX_MLABecLaplacian.H
+111 −73 Src/LinearSolvers/MLMG/AMReX_MLALaplacian.H
+2 −2 Src/LinearSolvers/MLMG/AMReX_MLCellLinOp.H
+10 −5 Src/LinearSolvers/MLMG/AMReX_MLLinOp.H
+111 −73 Src/LinearSolvers/MLMG/AMReX_MLPoisson.H
+20 −0 Src/Particle/AMReX_Particle_mod_K.H
+4 −2 Src/Particle/AMReX_WriteBinaryParticleData.H
+1 −1 Tests/CMakeLists.txt
+1 −2 Tests/Enum/inputs
+45 −0 Tests/Enum/main.cpp
+9 −0 Tests/ParmParse/CMakeLists.txt
+24 −0 Tests/ParmParse/GNUmakefile
+1 −0 Tests/ParmParse/Make.package
+64 −0 Tests/ParmParse/inputs
+143 −0 Tests/ParmParse/main.cpp
+1 −1 Tools/CMake/AMReXSetDefines.cmake
+2 −2 Tools/GNUMake/Make.defs
48 changes: 24 additions & 24 deletions src/problems/RadTube/test_radiation_tube.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,12 @@ RadSystem<TubeProblem>::DefineOpacityExponentsAndLowerValues(amrex::GpuArray<dou
return exponents_and_values;
}

// declare global variables
// initial conditions read from file
amrex::Gpu::HostVector<double> x_arr;
amrex::Gpu::HostVector<double> rho_arr;
amrex::Gpu::HostVector<double> Pgas_arr;
amrex::Gpu::HostVector<double> Erad_arr;

amrex::Gpu::DeviceVector<double> x_arr_g;
amrex::Gpu::DeviceVector<double> rho_arr_g;
amrex::Gpu::DeviceVector<double> Pgas_arr_g;
amrex::Gpu::DeviceVector<double> Erad_arr_g;
template <> struct SimulationData<TubeProblem> {
amrex::Gpu::DeviceVector<double> x_arr_g;
amrex::Gpu::DeviceVector<double> rho_arr_g;
amrex::Gpu::DeviceVector<double> Pgas_arr_g;
amrex::Gpu::DeviceVector<double> Erad_arr_g;
};

template <> void QuokkaSimulation<TubeProblem>::preCalculateInitialConditions()
{
Expand All @@ -107,6 +102,11 @@ template <> void QuokkaSimulation<TubeProblem>::preCalculateInitialConditions()
std::string header;
std::getline(fstream, header);

std::vector<double> x_arr;
std::vector<double> rho_arr;
std::vector<double> Pgas_arr;
std::vector<double> Erad_arr;

for (std::string line; std::getline(fstream, line);) {
std::istringstream iss(line);
std::vector<double> values;
Expand All @@ -124,16 +124,16 @@ template <> void QuokkaSimulation<TubeProblem>::preCalculateInitialConditions()
Erad_arr.push_back(Erad);
}

x_arr_g.resize(x_arr.size());
rho_arr_g.resize(rho_arr.size());
Pgas_arr_g.resize(Pgas_arr.size());
Erad_arr_g.resize(Erad_arr.size());
userData_.x_arr_g.resize(x_arr.size());
userData_.rho_arr_g.resize(rho_arr.size());
userData_.Pgas_arr_g.resize(Pgas_arr.size());
userData_.Erad_arr_g.resize(Erad_arr.size());

// copy to device
amrex::Gpu::copyAsync(amrex::Gpu::hostToDevice, x_arr.begin(), x_arr.end(), x_arr_g.begin());
amrex::Gpu::copyAsync(amrex::Gpu::hostToDevice, rho_arr.begin(), rho_arr.end(), rho_arr_g.begin());
amrex::Gpu::copyAsync(amrex::Gpu::hostToDevice, Pgas_arr.begin(), Pgas_arr.end(), Pgas_arr_g.begin());
amrex::Gpu::copyAsync(amrex::Gpu::hostToDevice, Erad_arr.begin(), Erad_arr.end(), Erad_arr_g.begin());
amrex::Gpu::copyAsync(amrex::Gpu::hostToDevice, x_arr.begin(), x_arr.end(), userData_.x_arr_g.begin());
amrex::Gpu::copyAsync(amrex::Gpu::hostToDevice, rho_arr.begin(), rho_arr.end(), userData_.rho_arr_g.begin());
amrex::Gpu::copyAsync(amrex::Gpu::hostToDevice, Pgas_arr.begin(), Pgas_arr.end(), userData_.Pgas_arr_g.begin());
amrex::Gpu::copyAsync(amrex::Gpu::hostToDevice, Erad_arr.begin(), Erad_arr.end(), userData_.Erad_arr_g.begin());
amrex::Gpu::streamSynchronizeAll();
}

Expand All @@ -145,11 +145,11 @@ template <> void QuokkaSimulation<TubeProblem>::setInitialConditionsOnGrid(quokk
const amrex::Box &indexRange = grid_elem.indexRange_;
const amrex::Array4<double> &state_cc = grid_elem.array_;

auto const &x_ptr = x_arr_g.dataPtr();
auto const &rho_ptr = rho_arr_g.dataPtr();
auto const &Pgas_ptr = Pgas_arr_g.dataPtr();
auto const &Erad_ptr = Erad_arr_g.dataPtr();
int x_size = static_cast<int>(x_arr_g.size());
auto const &x_ptr = userData_.x_arr_g.dataPtr();
auto const &rho_ptr = userData_.rho_arr_g.dataPtr();
auto const &Pgas_ptr = userData_.Pgas_arr_g.dataPtr();
auto const &Erad_ptr = userData_.Erad_arr_g.dataPtr();
int x_size = static_cast<int>(userData_.x_arr_g.size());

const auto radBoundaries_g = RadSystem_Traits<TubeProblem>::radBoundaries;

Expand Down
Loading