Skip to content

Commit

Permalink
Try this.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrood-nrel committed Nov 13, 2024
1 parent b98ffef commit 4417d9e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions Source/PeleLMeX_FlowController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,12 @@ PeleLM::activeControl(int is_restart)
// -------------------------------------------
// Update m_ctrl_* Vectors if not restarting
if (is_restart == 0) {
amrex::Vector<amrex::Real> blank1(0);
amrex::Vector<amrex::Real> blank2(0);
amrex::Vector<amrex::Real> blank3(0);
m_ctrl_time_pts = blank1; // Used to avoid null pointer dereference warning
m_ctrl_velo_pts = blank2; // Used to avoid null pointer dereference warning
m_ctrl_cntl_pts = blank3; // Used to avoid null pointer dereference warning
m_ctrl_time_pts.insert(m_ctrl_time_pts.begin(), m_cur_time);
m_ctrl_velo_pts.insert(m_ctrl_velo_pts.begin(), m_ctrl_V_in);
m_ctrl_cntl_pts.insert(m_ctrl_cntl_pts.begin(), coft);
Expand Down
4 changes: 2 additions & 2 deletions Source/PeleLMeX_Regrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ PeleLM::regrid(int lbase, amrex::Real time, bool initial)

// Bcast the test dmap and remake level
if (remakeLevel != 0) {
Vector<int> pmap(0);
Vector<int> pmap(1);
if (
ParallelDescriptor::MyProc() ==
ParallelDescriptor::IOProcessorNumber()) {
Expand Down Expand Up @@ -239,7 +239,7 @@ PeleLM::regrid(int lbase, amrex::Real time, bool initial)

// Bcast the test dmap if we plan on remaking the level
if (remakeLevel != 0) {
Vector<int> pmap(0);
Vector<int> pmap(1);
if (
ParallelDescriptor::MyProc() ==
ParallelDescriptor::IOProcessorNumber()) {
Expand Down
2 changes: 1 addition & 1 deletion Source/PeleLMeX_Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ PeleLM::loadBalanceChemLev(int a_lev)

// Bcast the test dmap if better
if (updateDmap != 0) {
Vector<int> pmap(0);
Vector<int> pmap(1);
if (
ParallelDescriptor::MyProc() == ParallelDescriptor::IOProcessorNumber()) {
pmap = test_dmap.ProcessorMap();
Expand Down

0 comments on commit 4417d9e

Please sign in to comment.