Skip to content

Commit

Permalink
Changed function name get_u_const_factory to be consistent with cell-…
Browse files Browse the repository at this point in the history
…centered factory.
  • Loading branch information
skang67 committed Feb 11, 2025
1 parent ff1a582 commit 807acac
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 77 deletions.
12 changes: 6 additions & 6 deletions Source/EB/ERF_EB.H
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ class eb_ {
{ return m_eb_level; }

void WriteEBSurface (const amrex::BoxArray & ba,
const amrex::DistributionMapping & dmap,
const amrex::Geometry & geom,
const amrex::EBFArrayBoxFactory * ebf);
const amrex::DistributionMapping & dmap,
const amrex::Geometry & geom,
const amrex::EBFArrayBoxFactory * ebf);

eb_aux_ const* get_u_factory() { return &m_u_factory; }
eb_aux_ const* get_v_factory() { return &m_v_factory; }
eb_aux_ const* get_w_factory() { return &m_w_factory; }
eb_aux_ const* get_u_const_factory() { return &m_u_factory; }
eb_aux_ const* get_v_const_factory() { return &m_v_factory; }
eb_aux_ const* get_w_const_factory() { return &m_w_factory; }

class EBToPVD;

Expand Down
63 changes: 1 addition & 62 deletions Source/EB/ERF_EB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,65 +223,4 @@ WriteEBSurface (const BoxArray & ba, const DistributionMapping & dmap, const Geo

eb_to_pvd.EBGridCoverage(cpu, problo, dx, bx, my_flag_ptr->const_array());
}
}


// void
// eb_::
// map_eb_data(Geometry const& a_geom)
// {

// const MultiCutFab& bcent = m_factory->getBndryCent();
// const MultiCutFab& bnorm = m_factory->getBndryNormal();
// const auto& flags = m_factory->getMultiEBCellFlagFab();

// for (MFIter mfi(m_factory->getVolFrac(), false); mfi.isValid(); ++mfi) {

// const Box& bx = mfi.validbox();
// GpuArray<Real, AMREX_SPACEDIM> dx = a_geom.CellSizeArray();

// const auto& flagfab = flags[mfi];
// auto typ = flagfab.getType(bx);

// if (typ == FabType::covered) {
// } else if (typ == FabType::regular) {
// } else {

// // EB normal and face centroid
// Array4<Real> const& bcent_arr = bcent.array(mfi);
// Array4<Real> const& bnorm_arr = bnorm.array(mfi);

// ParallelFor(bx, [&] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
// {
// // Map bcent and bnorm to the isoparametric space for anisotropic grids.
// // (This step is needed because bcent in AMReX is isotropically normalized.)

// // Boundary centroid

// Real const norm_bcent = ( (bnorm_arr(i,j,k,0)*dx[0])*(bnorm_arr(i,j,k,0)*dx[0])
// + (bnorm_arr(i,j,k,1)*dx[1])*(bnorm_arr(i,j,k,1)*dx[1])
// + (bnorm_arr(i,j,k,2)*dx[2])*(bnorm_arr(i,j,k,2)*dx[2]) );

// bnorm_arr(i,j,k,0) = bnorm_arr(i,j,k,0) / norm_bcent * dx[1] * dx[2];
// bnorm_arr(i,j,k,1) = bnorm_arr(i,j,k,1) / norm_bcent * dx[0] * dx[2];
// bnorm_arr(i,j,k,2) = bnorm_arr(i,j,k,2) / norm_bcent * dx[0] * dx[1];

// // Boundary normal

// Real const bnorm_x = bnorm_arr(i,j,k,0) / dx[0];
// Real const bnorm_y = bnorm_arr(i,j,k,1) / dx[1];
// Real const bnorm_z = bnorm_arr(i,j,k,2) / dx[2];

// Real const norm_bnorm = sqrt( bnorm_x*bnorm_x + bnorm_y*bnorm_y + bnorm_z*bnorm_z);

// bnorm_arr(i,j,k,0) = bnorm_x / norm_bnorm;
// bnorm_arr(i,j,k,1) = bnorm_y / norm_bnorm;
// bnorm_arr(i,j,k,2) = bnorm_z / norm_bnorm;
// });

// }

// }

// }

}
18 changes: 9 additions & 9 deletions Source/ERF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -415,14 +415,14 @@ ERF::ERF_shared ()
} // MFIter


for (MFIter mfi(eb.get_u_factory()->getVolFrac(), false); mfi.isValid(); ++mfi) {
for (MFIter mfi(eb.get_u_const_factory()->getVolFrac(), false); mfi.isValid(); ++mfi) {

const Box& bx = mfi.validbox();

Array4<Real const> const& vfrac =(eb.get_u_factory()->getVolFrac()).const_array(mfi);
Array4<Real const> const& afrac_x =(eb.get_u_factory()->getAreaFrac()[0])->const_array(mfi);
Array4<Real const> const& afrac_y =(eb.get_u_factory()->getAreaFrac()[1])->const_array(mfi);
Array4<Real const> const& afrac_z =(eb.get_u_factory()->getAreaFrac()[2])->const_array(mfi);
Array4<Real const> const& vfrac =(eb.get_u_const_factory()->getVolFrac()).const_array(mfi);
Array4<Real const> const& afrac_x =(eb.get_u_const_factory()->getAreaFrac()[0])->const_array(mfi);
Array4<Real const> const& afrac_y =(eb.get_u_const_factory()->getAreaFrac()[1])->const_array(mfi);
Array4<Real const> const& afrac_z =(eb.get_u_const_factory()->getAreaFrac()[2])->const_array(mfi);

Print()<<"SK: ERF.cpp/ bx = " << bx << std::endl;
std::vector<std::string> filenames = {
Expand Down Expand Up @@ -453,11 +453,11 @@ ERF::ERF_shared ()

} // MFIter

for (MFIter mfi(eb.get_v_factory()->getVolFrac(), false); mfi.isValid(); ++mfi) {
for (MFIter mfi(eb.get_v_const_factory()->getVolFrac(), false); mfi.isValid(); ++mfi) {

const Box& bx = mfi.validbox();

Array4<Real const> const& vfrac =(eb.get_v_factory()->getVolFrac()).const_array(mfi);
Array4<Real const> const& vfrac =(eb.get_v_const_factory()->getVolFrac()).const_array(mfi);

Print()<<"SK: ERF.cpp/ bx = " << bx << std::endl;
std::vector<std::string> filenames = {
Expand Down Expand Up @@ -485,11 +485,11 @@ ERF::ERF_shared ()

} // MFIter

for (MFIter mfi(eb.get_w_factory()->getVolFrac(), false); mfi.isValid(); ++mfi) {
for (MFIter mfi(eb.get_w_const_factory()->getVolFrac(), false); mfi.isValid(); ++mfi) {

const Box& bx = mfi.validbox();

Array4<Real const> const& vfrac =(eb.get_w_factory()->getVolFrac()).const_array(mfi);
Array4<Real const> const& vfrac =(eb.get_w_const_factory()->getVolFrac()).const_array(mfi);

Print()<<"SK: ERF.cpp/ bx = " << bx << std::endl;
std::vector<std::string> filenames = {
Expand Down

0 comments on commit 807acac

Please sign in to comment.