abarret / multiphase-stokes

Solver a mixture of fluids based on IBAMR
1 stars 0 forks source link

Deallocate data if FRMThnForcing allocates it. #35

Closed abarret closed 1 year ago

bindi-nagda commented 1 year ago

@abarret I approved and merged this PR. But on second thought, shouldn't the line be: if (scr_is_allocated) d_adv_diff_hier_integrator->deallocatePatchData(thn_scr_idx) instead of using (!scr_is_allocated)?

abarret commented 1 year ago

No. We only want to deallocate data if we were responsible for allocating it. At the beginning of the function we have:

bool scr_is_allocated = d_adv_diff_hier_integrator->isAllocatedPatchData(thn_scr_idx);
if (!scr_is_allocated) d_adv_diff_hier_integrator->allocatePatchData(thn_scr_idx, data_time);
bindi-nagda commented 1 year ago

Ah, I get it now. I was looking at it in a different way.