From 6d0fbf48c42ef41a221a79a25fc2078276636df5 Mon Sep 17 00:00:00 2001 From: David Grote Date: Fri, 28 Aug 2026 13:09:55 -0700 Subject: [PATCH] Fix access to global_debye_length with tiling --- .../Collision/BinaryCollision/BinaryCollision.H | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Source/Particles/Collision/BinaryCollision/BinaryCollision.H b/Source/Particles/Collision/BinaryCollision/BinaryCollision.H index 044935fb0ab..688fcf2101e 100644 --- a/Source/Particles/Collision/BinaryCollision/BinaryCollision.H +++ b/Source/Particles/Collision/BinaryCollision/BinaryCollision.H @@ -323,12 +323,11 @@ public: auto *tile_products_data = tile_products.data(); bool const use_global_debye_length = m_use_global_debye_length; - amrex::Real * global_debye_length_data = nullptr; + amrex::Array4 global_debye_length_array; if (use_global_debye_length) { WarpX & warpx = WarpX::GetInstance(); - amrex::MultiFab & global_debye_length = *warpx.m_fields.get(warpx::fields::FieldType::global_debye_length, lev); - amrex::FArrayBox & global_debye_length_fab = global_debye_length[mfi]; - global_debye_length_data = global_debye_length_fab.dataPtr(); + amrex::MultiFab * global_debye_length = warpx.m_fields.get(warpx::fields::FieldType::global_debye_length, lev); + global_debye_length_array = global_debye_length->array(mfi); } const amrex::Box tilebox = mfi.tilebox(); @@ -686,7 +685,7 @@ public: amrex::Real global_lamdb = 0.; if (use_global_debye_length) { - global_lamdb = global_debye_length_data[i_cell]; + global_lamdb = global_debye_length_array(global_index); } // Call the function in order to perform collisions @@ -1281,7 +1280,7 @@ public: amrex::Real global_lamdb = 0.; if (use_global_debye_length) { - global_lamdb = global_debye_length_data[i_cell]; + global_lamdb = global_debye_length_array(global_index); } // Call the function in order to perform collisions