You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi everyone,
I am trying to implement the LEM (Linear Eddy model ) using the capabilities of the amrex . To achieve so, I am creating a new BoxArray with different sizing which represent the lem element along the original mesh size. At some point, i need to communicate both meshes. I achieved so in serial way and the Box arrays contain only one box. How can be done using the parallel functions and using multiples box inside the boxarrays. Also i was wondering if its is possible to store objects in a multifab. Thanks in advance
for (int m = 0; m < ba_lem.size(); m++)
//Iteratioj over all the boxes contained at the same level
{
//Selection of the box to be iterated
amrex::Box const& box_lem = ba_lem[m];
amrex::Box const& box = ba[m];
//Definition of the limits
amrex::IntVect lo(box.loVect()[0], box.loVect()[1], box.loVect()[2]);
amrex::IntVect hi(box.hiVect()[0], box.hiVect()[1], box.hiVect()[2]);
amrex::IntVect lo_lem(box_lem.loVect()[0], box_lem.loVect()[1], box_lem.loVect()[2]);
amrex::IntVect hi_lem(box_lem.hiVect()[0], box_lem.hiVect()[1], box_lem.hiVect()[2]);
amrex::Print() << "Box " << lo << "" << hi << "\n";
amrex::Print() << "Box " << lo_lem << "" << hi_lem << "\n";
//Array to get the data at that boxconst amrex::Array4<amrex::Real>& fab_lem = mf_lem.array(m);
const amrex::Array4<amrex::Real>& fab = mf.array(m);
//Iteration over the boxamrex::Print () << fab << "Box iteration " << m << "\n";
for (int k = lo[2]; k <= hi[2]; ++k) {
for (int j = lo[1]; j <= hi[1]; ++j) {
for (int i = lo[0]; i <= hi[0]; ++i) {
fab(i,j,k,0) = dx[0]*i+2;
for (int l=0; l<num_lem_elements; l++){
fab_lem(i*num_lem_elements+l,j,k) = dx[0]*i+2;
}
}
}
}
//From here, can be conclude that no matter how is created, the iterations works//for the whole domain
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi everyone,
I am trying to implement the LEM (Linear Eddy model ) using the capabilities of the amrex . To achieve so, I am creating a new BoxArray with different sizing which represent the lem element along the original mesh size. At some point, i need to communicate both meshes. I achieved so in serial way and the Box arrays contain only one box. How can be done using the parallel functions and using multiples box inside the boxarrays. Also i was wondering if its is possible to store objects in a multifab. Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions