Skip to content

supporting nlev>0 in BTD output #4526

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 16 commits into
base: development
Choose a base branch
from

Conversation

RevathiJambunathan
Copy link
Member

I have taken @prkkumar 's PR (#4197)
and modified to include some more bug fixes.

Current status :
BTD field output for multiple levels is now working.

@@ -187,10 +187,10 @@ private:
amrex::Vector<amrex::IntVect> m_snapshot_ncells_lab;
/** Vector of Box-dimension in boosted-frame index space
* for each back-transformed snapshot */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* for each back-transformed snapshot */
* for each back-transformed snapshot (inner vector)
* and level (outer vector) */

@@ -187,10 +187,10 @@ private:
amrex::Vector<amrex::IntVect> m_snapshot_ncells_lab;
/** Vector of Box-dimension in boosted-frame index space
* for each back-transformed snapshot */
amrex::Vector<amrex::Box> m_snapshot_box;
amrex::Vector< amrex::Vector <amrex::Box> > m_snapshot_box;
/** Vector of Box-dimension in boosted-frame index space corresponding to the
* buffer that covers a part of the full backtransformed snapshot */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* buffer that covers a part of the full backtransformed snapshot */
* buffer that covers a part of the full backtransformed snapshot
* (inner vector) and level (outer vector) */

@@ -238,7 +238,7 @@ private:
/** Vector of k-indices in the hi-end along the moving window direction for the buffer being filled
* for each snapshot.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* for each snapshot.
* for each snapshot (inner vector) and level (outer vector) */

@@ -307,8 +307,8 @@ private:
* returns bool = true is buffer is full, that is,
when buffer counter is equal to m_buffer_size
*/
bool buffer_full (int i_buffer) {
return (k_index_zlab(i_buffer,0) == m_buffer_box[i_buffer].smallEnd(m_moving_window_dir));
bool buffer_full (int i_buffer, const int lev) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
bool buffer_full (int i_buffer, const int lev) {
bool buffer_full (int i_buffer, int lev) {

Comment on lines +415 to +416
int get_buffer_k_index_hi (int i_buffer, const int lev) override {return m_buffer_k_index_hi[i_buffer][lev]; }
void set_buffer_k_index_hi (int i_buffer, int kindex, const int lev) override {m_buffer_k_index_hi[i_buffer][lev] = kindex;}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
int get_buffer_k_index_hi (int i_buffer, const int lev) override {return m_buffer_k_index_hi[i_buffer][lev]; }
void set_buffer_k_index_hi (int i_buffer, int kindex, const int lev) override {m_buffer_k_index_hi[i_buffer][lev] = kindex;}
int get_buffer_k_index_hi (int i_buffer, int lev) override {return m_buffer_k_index_hi[i_buffer][lev]; }
void set_buffer_k_index_hi (int i_buffer, int kindex, int lev) override {m_buffer_k_index_hi[i_buffer][lev] = kindex;}

@@ -412,8 +412,8 @@ private:

amrex::Real gettlab (int i_buffer) override {return m_t_lab[i_buffer];}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add doxygen strings for function use and parameters :)

Comment on lines +304 to +310
auto is_buffer_full = false;
//const int nlevels = m_particles_buffer[i_buffer][0]->numLevels();
for (int lev = 0 ; lev < nmax_lev; ++lev) {
is_buffer_full = buffer_full(i_buffer, lev);
}

// or
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting indent is off here a bit :)

@@ -825,9 +835,12 @@ BTDiagnostics::PrepareFieldDataForOutput ()
// and box-indices
DefineSnapshotGeometry(i_buffer, lev);
}
//amrex::Print() << "lev = " << lev << " : DefineFieldBufferMultiFab called -- " << "\n";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//amrex::Print() << "lev = " << lev << " : DefineFieldBufferMultiFab called -- " << "\n";

@@ -801,12 +811,12 @@ BTDiagnostics::PrepareFieldDataForOutput ()
warpx.Geom(lev).periodicity());
}
// Flattening out MF over levels
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused code :)

Comment on lines +919 to +920
//amrex::Print() << "buffer_ba = " << buffer_ba << "\n";
//amrex::Print() << "buffer_dmap = " << buffer_dmap << "\n";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//amrex::Print() << "buffer_ba = " << buffer_ba << "\n";
//amrex::Print() << "buffer_dmap = " << buffer_dmap << "\n";

@ax3l ax3l requested a review from dpgrote December 17, 2023 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: boosted frame boosted frame components & logic component: diagnostics all types of outputs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants