Skip to content

Commit

Permalink
Account for storing pos in rdata
Browse files Browse the repository at this point in the history
  • Loading branch information
jmsexton03 committed Feb 2, 2024
1 parent 10c45ad commit 05ccb59
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions Exec/ParticleFilterTest/DarkMatterParticleContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ struct ShellFilter
if(m_radius_inner<=0 || m_radius_outer<=0)
return false;
if(src.m_aos[i].id()>0) {
Real xlen = src.m_aos[i].pos(0) - m_center[0];
Real ylen = src.m_aos[i].pos(1) - m_center[1];
Real zlen = src.m_aos[i].pos(2) - m_center[2];
Real xlen = src.m_aos[i].rdata(0+1+3) - m_center[0];
Real ylen = src.m_aos[i].rdata(1+1+3) - m_center[1];
Real zlen = src.m_aos[i].rdata(2+1+3) - m_center[2];
Real mag = sqrt(xlen*xlen+ylen*ylen+zlen*zlen);
Real theta = atan(ylen/xlen);
Real phi = acos(zlen/mag);
Expand All @@ -121,9 +121,9 @@ struct ShellFilter
for(int jdir=jdirf;jdir<=jdirc;jdir++)
for(int kdir=kdirf;kdir<=kdirc;kdir++)
{
xlen = src.m_aos[i].pos(0)+(idir)*(m_phi[0]-m_plo[0]) - m_center[0];
ylen = src.m_aos[i].pos(1)+(jdir)*(m_phi[1]-m_plo[1]) - m_center[1];
zlen = src.m_aos[i].pos(2)+(kdir)*(m_phi[2]-m_plo[2]) - m_center[2];
xlen = src.m_aos[i].rdata(0+1+3)+(idir)*(m_phi[0]-m_plo[0]) - m_center[0];
ylen = src.m_aos[i].rdata(1+1+3)+(jdir)*(m_phi[1]-m_plo[1]) - m_center[1];
zlen = src.m_aos[i].rdata(2+1+3)+(kdir)*(m_phi[2]-m_plo[2]) - m_center[2];
Real mag = sqrt(xlen*xlen+ylen*ylen+zlen*zlen);
result=result? true : (mag>m_radius_inner && mag<m_radius_outer);
// Print()<<xlen<<"\t"<<ylen<<"\t"<<zlen<<"\t"<<mag<<"\t"<<m_radius_inner<<"\t"<<m_radius_outer<<"\t"<<result<<std::endl;
Expand Down Expand Up @@ -553,21 +553,21 @@ void store_dm_particle_single (amrex::ParticleContainer<1+AMREX_SPACEDIM, 0>::Su
zlen = p.pos(2)+(kdir)*(phi[2]-plo[2]) - center[2];
Real mag = sqrt(xlen*xlen+ylen*ylen+zlen*zlen);
result=result? true : (mag>radius_inner && mag<radius_outer);
if(result) {
if((mag>radius_inner && mag<radius_outer)) {
int comp=0;
p2.rdata(comp+1+3+3) = p.pos(comp)+(idir)*(phi[comp]-plo[comp]);
p2.pos(comp) = p.pos(comp)+(idir)*(phi[comp]-plo[comp]);
comp=1;
p2.rdata(comp+1+3+3) = p.pos(comp)+(jdir)*(phi[comp]-plo[comp]);
p2.pos(comp) = p.pos(comp)+(jdir)*(phi[comp]-plo[comp]);
comp=2;
p2.rdata(comp+1+3+3) = p.pos(comp)+(kdir)*(phi[comp]-plo[comp]);
p2.pos(comp) = p.pos(comp)+(kdir)*(phi[comp]-plo[comp]);
}
// Print()<<xlen<<"\t"<<ylen<<"\t"<<zlen<<"\t"<<mag<<"\t"<<m_radius_inner<<"\t"<<m_radius_outer<<"\t"<<result<<std::endl;
}
for (int comp=0; comp < nc; ++comp) {
p2.rdata(comp+1+3)=p.pos(comp);
p2.rdata(comp+1+3+3) = p.pos(comp) + dt_a_cur_inv * p.rdata(comp+1);
p2.rdata(comp+1)=p.rdata(comp+1);
p2.pos(comp)=p.pos(comp);
// p2.pos(comp)=p.pos(comp);
p2.id()=p.id();
p2.cpu()=p.cpu();
}
Expand Down

0 comments on commit 05ccb59

Please sign in to comment.