From b043d5348c0363d1b0474dfe4b26c610869bb1a7 Mon Sep 17 00:00:00 2001 From: "David J. Gardner" Date: Mon, 17 Jun 2024 11:32:00 -0700 Subject: [PATCH] copy new state to old --- ExampleCodes/SUNDIALS/Source/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ExampleCodes/SUNDIALS/Source/main.cpp b/ExampleCodes/SUNDIALS/Source/main.cpp index 71e7ab83..0b4b1a01 100644 --- a/ExampleCodes/SUNDIALS/Source/main.cpp +++ b/ExampleCodes/SUNDIALS/Source/main.cpp @@ -195,8 +195,8 @@ void main_main () // advance from state_old at time to state_new at time + dt integrator.advance(state_old, state_new, time, dt); - // swap old/new and update time by dt - std::swap(state_old, state_new); + // update old state and update time by dt + amrex::MultiFab::Copy(state_old[0], state_new[0], 0, 0, Ncomp, Nghost); time += dt; // Tell the I/O Processor to write out which step we're doing