Skip to content

Commit

Permalink
more removal of geometry dependence in SF code
Browse files Browse the repository at this point in the history
  • Loading branch information
ajnonaka committed Jan 3, 2025
1 parent 84a4be0 commit 3cbab64
Show file tree
Hide file tree
Showing 32 changed files with 74 additions and 75 deletions.
4 changes: 2 additions & 2 deletions exec/DSMC/main_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ void main_driver(const char* argv)
//PrintMF(structFactPrimMF,0,-1);
//PrintMF(primInst,1,1);

//structFactPrim.FortStructure(structFactPrimMF,geom);
//structFactPrim.FortStructure(structFactPrimMF);

}
}
Expand Down Expand Up @@ -389,7 +389,7 @@ void main_driver(const char* argv)
//PrintMF(structFactPrimMF,0,-1);
//PrintMF(primInst,1,1);

//structFactPrim.FortStructure(structFactPrimMF,geom);
//structFactPrim.FortStructure(structFactPrimMF);

}
}
Expand Down
2 changes: 1 addition & 1 deletion exec/DSMC_granular/main_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ void main_driver(const char* argv)
MultiFab::Copy(structFactPrimMF,primInst,8,cnt_sf,numvars_sf,0);
cnt_sf += numvars_sf;

structFactPrim.FortStructure(structFactPrimMF,geom);
structFactPrim.FortStructure(structFactPrimMF);
}

if(istep > amrex::Math::abs(n_steps_skip) &&
Expand Down
2 changes: 1 addition & 1 deletion exec/Ek_calculator/main_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void main_driver(const char* argv)


// reset and compute structure factor
turbStructFact.FortStructure(vel,geom,1);
turbStructFact.FortStructure(vel,1);
turbStructFact.CallFinalize();

// integrate cov_mag over shells in k and write to file
Expand Down
4 changes: 2 additions & 2 deletions exec/cellbdytest_new/main_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1809,13 +1809,13 @@ void main_driver(const char* argv)

// charge
MultiFab::Copy(struct_cc_charge, charge, 0, 0, nvar_sf_charge, 0);
structFact_charge.FortStructure(struct_cc_charge,geomP);
structFact_charge.FortStructure(struct_cc_charge);

// velocity
for (int d=0; d<AMREX_SPACEDIM; ++d) {
ShiftFaceToCC(umac[d],0,struct_cc_vel,d,1);
}
structFact_vel.FortStructure(struct_cc_vel,geom);
structFact_vel.FortStructure(struct_cc_vel);

// plot structure factor on plot_int
if (istep%plot_int == 0) {
Expand Down
6 changes: 3 additions & 3 deletions exec/compressible_mui/sav_src/2020/m00.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -672,11 +672,11 @@ void main_driver(const char* argv)
MultiFab::Copy(structFactPrimMF, prim, 0, 0, structVarsPrim, 0);
MultiFab::Copy(structFactConsMF, cu, 0, 0, structVarsCons-1, 0);
MultiFab::Copy(structFactConsMF, prim, AMREX_SPACEDIM+1, structVarsCons-1, 1, 0); // temperature too
structFactPrim.FortStructure(structFactPrimMF,geom);
structFactCons.FortStructure(structFactConsMF,geom);
structFactPrim.FortStructure(structFactPrimMF);
structFactCons.FortStructure(structFactConsMF);
if(project_dir >= 0) {
ComputeVerticalAverage(prim, primVertAvg, geom, project_dir, 0, structVarsPrim);
structFactPrimVerticalAverage.FortStructure(primVertAvg,geom_flat);
structFactPrimVerticalAverage.FortStructure(primVertAvg);
}
}

Expand Down
6 changes: 3 additions & 3 deletions exec/compressible_mui/sav_src/2020/m01-cutemp_jsq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -684,11 +684,11 @@ void main_driver(const char* argv)
MultiFab::Copy(structFactPrimMF, prim, 0, 0, structVarsPrim, 0);
MultiFab::Copy(structFactConsMF, cu, 0, 0, structVarsCons-1, 0);
MultiFab::Copy(structFactConsMF, prim, AMREX_SPACEDIM+1, structVarsCons-1, 1, 0); // temperature too
structFactPrim.FortStructure(structFactPrimMF,geom);
structFactCons.FortStructure(structFactConsMF,geom);
structFactPrim.FortStructure(structFactPrimMF);
structFactCons.FortStructure(structFactConsMF);
if(project_dir >= 0) {
ComputeVerticalAverage(prim, primVertAvg, geom, project_dir, 0, structVarsPrim);
structFactPrimVerticalAverage.FortStructure(primVertAvg,geom_flat);
structFactPrimVerticalAverage.FortStructure(primVertAvg);
}
}

Expand Down
6 changes: 3 additions & 3 deletions exec/compressible_mui/sav_src/2020/m01.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -672,11 +672,11 @@ void main_driver(const char* argv)
MultiFab::Copy(structFactPrimMF, prim, 0, 0, structVarsPrim, 0);
MultiFab::Copy(structFactConsMF, cu, 0, 0, structVarsCons-1, 0);
MultiFab::Copy(structFactConsMF, prim, AMREX_SPACEDIM+1, structVarsCons-1, 1, 0); // temperature too
structFactPrim.FortStructure(structFactPrimMF,geom);
structFactCons.FortStructure(structFactConsMF,geom);
structFactPrim.FortStructure(structFactPrimMF);
structFactCons.FortStructure(structFactConsMF);
if(project_dir >= 0) {
ComputeVerticalAverage(prim, primVertAvg, geom, project_dir, 0, structVarsPrim);
structFactPrimVerticalAverage.FortStructure(primVertAvg,geom_flat);
structFactPrimVerticalAverage.FortStructure(primVertAvg);
}
}

Expand Down
6 changes: 3 additions & 3 deletions exec/compressible_mui/sav_src/2020/m02.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -725,11 +725,11 @@ void main_driver(const char* argv)
MultiFab::Copy(structFactPrimMF, prim, 0, 0, structVarsPrim, 0);
MultiFab::Copy(structFactConsMF, cu, 0, 0, structVarsCons-1, 0);
MultiFab::Copy(structFactConsMF, prim, AMREX_SPACEDIM+1, structVarsCons-1, 1, 0); // temperature too
structFactPrim.FortStructure(structFactPrimMF,geom);
structFactCons.FortStructure(structFactConsMF,geom);
structFactPrim.FortStructure(structFactPrimMF);
structFactCons.FortStructure(structFactConsMF);
if(project_dir >= 0) {
ComputeVerticalAverage(prim, primVertAvg, geom, project_dir, 0, structVarsPrim);
structFactPrimVerticalAverage.FortStructure(primVertAvg,geom_flat);
structFactPrimVerticalAverage.FortStructure(primVertAvg);
}
}

Expand Down
6 changes: 3 additions & 3 deletions exec/compressible_mui/sav_src/2020/m10.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -681,11 +681,11 @@ void main_driver(const char* argv)
MultiFab::Copy(structFactPrimMF, prim, 0, 0, structVarsPrim, 0);
MultiFab::Copy(structFactConsMF, cu, 0, 0, structVarsCons-1, 0);
MultiFab::Copy(structFactConsMF, prim, AMREX_SPACEDIM+1, structVarsCons-1, 1, 0); // temperature too
structFactPrim.FortStructure(structFactPrimMF,geom);
structFactCons.FortStructure(structFactConsMF,geom);
structFactPrim.FortStructure(structFactPrimMF);
structFactCons.FortStructure(structFactConsMF);
if(project_dir >= 0) {
ComputeVerticalAverage(prim, primVertAvg, geom, project_dir, 0, structVarsPrim);
structFactPrimVerticalAverage.FortStructure(primVertAvg,geom_flat);
structFactPrimVerticalAverage.FortStructure(primVertAvg);
}
}

Expand Down
6 changes: 3 additions & 3 deletions exec/compressible_mui/sav_src/2020/m11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -685,11 +685,11 @@ void main_driver(const char* argv)
MultiFab::Copy(structFactPrimMF, prim, 0, 0, structVarsPrim, 0);
MultiFab::Copy(structFactConsMF, cu, 0, 0, structVarsCons-1, 0);
MultiFab::Copy(structFactConsMF, prim, AMREX_SPACEDIM+1, structVarsCons-1, 1, 0); // temperature too
structFactPrim.FortStructure(structFactPrimMF,geom);
structFactCons.FortStructure(structFactConsMF,geom);
structFactPrim.FortStructure(structFactPrimMF);
structFactCons.FortStructure(structFactConsMF);
if(project_dir >= 0) {
ComputeVerticalAverage(prim, primVertAvg, geom, project_dir, 0, structVarsPrim);
structFactPrimVerticalAverage.FortStructure(primVertAvg,geom_flat);
structFactPrimVerticalAverage.FortStructure(primVertAvg);
}
}

Expand Down
6 changes: 3 additions & 3 deletions exec/compressible_mui/sav_src/2020/m12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -687,11 +687,11 @@ void main_driver(const char* argv)
MultiFab::Copy(structFactPrimMF, prim, 0, 0, structVarsPrim, 0);
MultiFab::Copy(structFactConsMF, cu, 0, 0, structVarsCons-1, 0);
MultiFab::Copy(structFactConsMF, prim, AMREX_SPACEDIM+1, structVarsCons-1, 1, 0); // temperature too
structFactPrim.FortStructure(structFactPrimMF,geom);
structFactCons.FortStructure(structFactConsMF,geom);
structFactPrim.FortStructure(structFactPrimMF);
structFactCons.FortStructure(structFactConsMF);
if(project_dir >= 0) {
ComputeVerticalAverage(prim, primVertAvg, geom, project_dir, 0, structVarsPrim);
structFactPrimVerticalAverage.FortStructure(primVertAvg,geom_flat);
structFactPrimVerticalAverage.FortStructure(primVertAvg);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -700,11 +700,11 @@ void main_driver(const char* argv)
MultiFab::Copy(structFactPrimMF, prim, 0, 0, structVarsPrim, 0);
MultiFab::Copy(structFactConsMF, cu, 0, 0, structVarsCons-1, 0);
MultiFab::Copy(structFactConsMF, prim, AMREX_SPACEDIM+1, structVarsCons-1, 1, 0); // temperature too
structFactPrim.FortStructure(structFactPrimMF,geom);
structFactCons.FortStructure(structFactConsMF,geom);
structFactPrim.FortStructure(structFactPrimMF);
structFactCons.FortStructure(structFactConsMF);
if(project_dir >= 0) {
ComputeVerticalAverage(prim, primVertAvg, geom, project_dir, 0, structVarsPrim);
structFactPrimVerticalAverage.FortStructure(primVertAvg,geom_flat);
structFactPrimVerticalAverage.FortStructure(primVertAvg);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -713,11 +713,11 @@ void main_driver(const char* argv)
MultiFab::Copy(structFactPrimMF, prim, 0, 0, structVarsPrim, 0);
MultiFab::Copy(structFactConsMF, cu, 0, 0, structVarsCons-1, 0);
MultiFab::Copy(structFactConsMF, prim, AMREX_SPACEDIM+1, structVarsCons-1, 1, 0); // temperature too
structFactPrim.FortStructure(structFactPrimMF,geom);
structFactCons.FortStructure(structFactConsMF,geom);
structFactPrim.FortStructure(structFactPrimMF);
structFactCons.FortStructure(structFactConsMF);
if(project_dir >= 0) {
ComputeVerticalAverage(prim, primVertAvg, geom, project_dir, 0, structVarsPrim);
structFactPrimVerticalAverage.FortStructure(primVertAvg,geom_flat);
structFactPrimVerticalAverage.FortStructure(primVertAvg);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -852,8 +852,8 @@ void main_driver(const char* argv)
MultiFab::Copy(structFactPrimMF, prim, 0, 0, structVarsPrim, 0);
MultiFab::Copy(structFactConsMF, cu, 0, 0, structVarsCons-1, 0);
MultiFab::Copy(structFactConsMF, prim, AMREX_SPACEDIM+1, structVarsCons-1, 1, 0); // temperature too
structFactPrim.FortStructure(structFactPrimMF,geom);
structFactCons.FortStructure(structFactConsMF,geom);
structFactPrim.FortStructure(structFactPrimMF);
structFactCons.FortStructure(structFactConsMF);
if(project_dir >= 0) {
MultiFab primFlattened; // flattened multifab defined below
if (slicepoint < 0) {
Expand All @@ -864,7 +864,7 @@ void main_driver(const char* argv)
// we rotate this flattened MultiFab to have normal in the z-direction since
// SWFFT only presently supports flattened MultiFabs with z-normal.
MultiFab primFlattenedRot = RotateFlattenedMF(primFlattened);
structFactPrimFlattened.FortStructure(primFlattenedRot,geom_flat);
structFactPrimFlattened.FortStructure(primFlattenedRot);
}
}

Expand Down
10 changes: 5 additions & 5 deletions exec/hydro/main_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ void main_driver(const char* argv)
for(int d=0; d<AMREX_SPACEDIM; d++) {
ShiftFaceToCC(umac[d], 0, structFactMF, d, 1);
}
structFact.FortStructure(structFactMF,geom);
structFact.FortStructure(structFactMF);
if(project_dir >= 0) {
MultiFab Flattened; // flattened multifab defined below
if (slicepoint < 0) {
Expand All @@ -488,7 +488,7 @@ void main_driver(const char* argv)
// our structure factor class assumes this for flattened
MultiFab FlattenedRot = RotateFlattenedMF(Flattened);
FlattenedRotMaster.ParallelCopy(FlattenedRot,0,0,structVars);
structFactFlattened.FortStructure(FlattenedRotMaster,geom_flat);
structFactFlattened.FortStructure(FlattenedRotMaster);
}
}

Expand Down Expand Up @@ -574,7 +574,7 @@ void main_driver(const char* argv)
for(int d=0; d<AMREX_SPACEDIM; d++) {
ShiftFaceToCC(umac[d], 0, structFactMF, d, 1);
}
structFact.FortStructure(structFactMF,geom);
structFact.FortStructure(structFactMF);
if(project_dir >= 0) {
MultiFab Flattened; // flattened multifab defined below
if (slicepoint < 0) {
Expand All @@ -585,7 +585,7 @@ void main_driver(const char* argv)
// we rotate this flattened MultiFab to have normal in the z-direction since
// our structure factor class assumes this for flattened
MultiFab FlattenedRot = RotateFlattenedMF(Flattened);
structFactFlattened.FortStructure(FlattenedRot,geom_flat);
structFactFlattened.FortStructure(FlattenedRot);
}
}

Expand Down Expand Up @@ -616,7 +616,7 @@ void main_driver(const char* argv)
ShiftFaceToCC(umac[d], 0, structFactMF, d, 1);
}
// reset and compute structure factor
turbStructFact.FortStructure(structFactMF,geom,1);
turbStructFact.FortStructure(structFactMF,1);
turbStructFact.CallFinalize();

// integrate cov_mag over shells in k and write to file
Expand Down
4 changes: 2 additions & 2 deletions exec/immersedIons/main_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1579,13 +1579,13 @@ void main_driver(const char* argv)

// charge
MultiFab::Copy(struct_cc_charge, charge, 0, 0, nvar_sf_charge, 0);
structFact_charge.FortStructure(struct_cc_charge,geomP);
structFact_charge.FortStructure(struct_cc_charge);

// velocity
for (int d=0; d<AMREX_SPACEDIM; ++d) {
ShiftFaceToCC(umac[d],0,struct_cc_vel,d,1);
}
structFact_vel.FortStructure(struct_cc_vel,geom);
structFact_vel.FortStructure(struct_cc_vel);

// plot structure factor on plot_int
if (istep%plot_int == 0) {
Expand Down
2 changes: 1 addition & 1 deletion exec/immersed_boundary/cell_body/main_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ void main_driver(const char * argv) {
// for(int d=0; d<AMREX_SPACEDIM; d++) {
// ShiftFaceToCC(umac[d], 0, struct_in_cc, d, 1);
// }
// structFact.FortStructure(struct_in_cc,geom);
// structFact.FortStructure(struct_in_cc);
//
// }

Expand Down
2 changes: 1 addition & 1 deletion exec/immersed_boundary/channel_dumbbell/main_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ void main_driver(const char * argv) {
for(int d=0; d<AMREX_SPACEDIM; d++) {
ShiftFaceToCC(umac[d], 0, struct_in_cc, d, 1);
}
// structFact.FortStructure(struct_in_cc,geom);
// structFact.FortStructure(struct_in_cc);
}

Real step_stop_time = ParallelDescriptor::second() - step_strt_time;
Expand Down
2 changes: 1 addition & 1 deletion exec/immersed_boundary/channel_multiblob/main_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ void main_driver(const char * argv) {
for(int d=0; d<AMREX_SPACEDIM; d++) {
ShiftFaceToCC(umac[d], 0, struct_in_cc, d, 1);
}
// structFact.FortStructure(struct_in_cc,geom);
// structFact.FortStructure(struct_in_cc);
}

Real step_stop_time = ParallelDescriptor::second() - step_strt_time;
Expand Down
2 changes: 1 addition & 1 deletion exec/immersed_boundary/channel_rigid/main_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ void main_driver(const char * argv) {
for(int d=0; d<AMREX_SPACEDIM; d++) {
ShiftFaceToCC(umac[d], 0, struct_in_cc, d, 1);
}
structFact.FortStructure(struct_in_cc,geom);
structFact.FortStructure(struct_in_cc);
}

Real step_stop_time = ParallelDescriptor::second() - step_strt_time;
Expand Down
2 changes: 1 addition & 1 deletion exec/immersed_boundary/flagellum/main_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ void main_driver(const char * argv) {
// for(int d=0; d<AMREX_SPACEDIM; d++) {
// ShiftFaceToCC(umac[d], 0, struct_in_cc, d, 1);
// }
// structFact.FortStructure(struct_in_cc,geom);
// structFact.FortStructure(struct_in_cc);
//
// }

Expand Down
2 changes: 1 addition & 1 deletion exec/immersed_boundary/taylor_line/main_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ void main_driver(const char * argv) {
// for(int d=0; d<AMREX_SPACEDIM; d++) {
// ShiftFaceToCC(umac[d], 0, struct_in_cc, d, 1);
// }
// structFact.FortStructure(struct_in_cc,geom);
// structFact.FortStructure(struct_in_cc);
//
// }

Expand Down
4 changes: 2 additions & 2 deletions exec/multispec/main_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ void main_driver(const char* argv)
for(int d=0; d<nspecies; d++) {
MultiFab::Divide(structFactMF,rhotot_old,0,AMREX_SPACEDIM+d+1,1,0);
}
structFact.FortStructure(structFactMF,geom);
structFact.FortStructure(structFactMF);
}

// write initial plotfile and structure factor
Expand Down Expand Up @@ -578,7 +578,7 @@ void main_driver(const char* argv)
for(int d=0; d<nspecies; d++) {
MultiFab::Divide(structFactMF,rhotot_new,0,AMREX_SPACEDIM+d+1,1,0);
}
structFact.FortStructure(structFactMF,geom);
structFact.FortStructure(structFactMF);
}


Expand Down
2 changes: 1 addition & 1 deletion exec/structFactTest/main_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ void main_driver(const char* argv)
/////////////////////////////////


structFact.FortStructure(struct_cc,geom);
structFact.FortStructure(struct_cc);

structFact.WritePlotFile(0,0.,geom,"plt_SF");

Expand Down
2 changes: 1 addition & 1 deletion src_analysis/StructFact.H
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public:
const Vector< int >& s_pairB_in,
const int& verbosity_in=0);

void FortStructure(const amrex::MultiFab&, const Geometry&,
void FortStructure(const amrex::MultiFab&,
const int& reset=0);

void Reset();
Expand Down
1 change: 0 additions & 1 deletion src_analysis/StructFact.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ void StructFact::define(const BoxArray& ba_in,
}

void StructFact::FortStructure(const MultiFab& variables,
const Geometry& geom,
const int& reset)
{
BL_PROFILE_VAR("StructFact::FortStructure()",FortStructure);
Expand Down
Loading

0 comments on commit 3cbab64

Please sign in to comment.