From 433db1e10fee60cf4699f4981b2a786549172219 Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Mon, 20 Nov 2023 18:27:06 -0800 Subject: [PATCH] Test Ascent_Insitu_SOA Compiles --- Tests/Particles/Ascent_Insitu_SOA/main.cpp | 34 +++++++++++++++------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/Tests/Particles/Ascent_Insitu_SOA/main.cpp b/Tests/Particles/Ascent_Insitu_SOA/main.cpp index 333886864be..46e2af98422 100644 --- a/Tests/Particles/Ascent_Insitu_SOA/main.cpp +++ b/Tests/Particles/Ascent_Insitu_SOA/main.cpp @@ -1,6 +1,5 @@ #include #include -#include #include #if !defined(AMREX_PARTICLES) || !defined(AMREX_USE_CONDUIT) @@ -11,6 +10,9 @@ #include +#include + + using namespace amrex; static constexpr int NR = 7; @@ -118,7 +120,7 @@ class TestParticleContainer } auto& particle_tile = DefineAndReturnParticleTile(lev, mfi.index(), mfi.LocalTileIndex()); - auto old_size = particle_tile.GetArrayOfStructs().size(); + auto old_size = particle_tile.size(); auto new_size = old_size + host_real[0].size(); particle_tile.resize(new_size); @@ -170,19 +172,19 @@ struct TestParams int nlevs; }; -void testRedistribute(); +void testAscent (); int main (int argc, char* argv[]) { amrex::Initialize(argc,argv); amrex::Print() << "Running redistribute test \n"; - testRedistribute(); + testAscent(); amrex::Finalize(); } -void get_test_params(TestParams& params, const std::string& prefix) +void get_test_params (TestParams& params, const std::string& prefix) { ParmParse pp(prefix); pp.get("size", params.size); @@ -194,7 +196,7 @@ void get_test_params(TestParams& params, const std::string& prefix) pp.query("num_runtime_int", num_runtime_int); } -void testRedistribute () +void testAscent () { BL_PROFILE("testAscent"); TestParams params; @@ -250,6 +252,7 @@ void testRedistribute () { conduit::Node bp_mesh; + /* TODO amrex::MultiLevelToBlueprint( nlev, amrex::GetVecOfConstPtrs(mf), @@ -260,14 +263,25 @@ void testRedistribute () warpx.refRatio(), bp_mesh ); + */ // wrap pc for current species into a blueprint topology - amrex::ParticleContainerToBlueprint(*pc, + std::string const prefix = "particle"; + Vector particle_varnames; + for (int i = 0; i < pc.NumRealComps(); ++i) { + particle_varnames.push_back(prefix + "_real_" + std::to_string(i)); + } + Vector particle_int_varnames; + for (int i = 0; i < pc.NumIntComps(); ++i) { + particle_int_varnames.push_back(prefix + "_int_" + std::to_string(i)); + } + + amrex::ParticleContainerToBlueprint(pc, particle_varnames, particle_int_varnames, - a_bp_mesh, + bp_mesh, prefix); - // mesh + // publish ascent::Ascent ascent; conduit::Node opts; opts["exceptions"] = "catch"; @@ -278,7 +292,7 @@ void testRedistribute () // If you want to save blueprint HDF5 files w/o using an Ascent // extract, you can call the following AMReX helper: // const auto step = istep[0]; - // WriteBlueprintFiles(bp_mesh,"bp_export",step,"hdf5"); + // amrex::WriteBlueprintFiles(bp_mesh, "bp_export", step, "hdf5"); // render conduit::Node actions;