25 amrex::RealBox rb({AMREX_D_DECL(0.,0.,0.)}, {AMREX_D_DECL(
L,
L,
L)});
26 amrex::Geometry::Setup(&rb, 0);
28 amrex::Box domain(amrex::IntVect{AMREX_D_DECL(0,0,0)},
ncells,
29 amrex::IntVect::TheCellVector());
37 geom[0].define(domain);
38 grids[0].define(domain);
49 IC::Trig2 ic(
geom,1.0,AMREX_D_DECL(0.0,0.0,0.0),AMREX_D_DECL(1,1,1));
68 Set::Scalar AMREX_D_DECL(theta1 = 0.0, theta2 = 0.0, theta3 = 0.0);
77 IC::Trig2 ic(
geom,fac,AMREX_D_DECL(theta1,theta2,theta3),AMREX_D_DECL(1,1,1));
84 const amrex::Real* DX =
geom[0].CellSize();
85 for ( amrex::MFIter mfi(*
phi[0],amrex::TilingIfNotGPU()); mfi.isValid(); ++mfi )
87 const amrex::Box& bx = mfi.tilebox();
88 amrex::Array4<const amrex::Real>
const& Phi =
phi[0]->array(mfi);
89 amrex::Array4<amrex::Real>
const& DPhi =
DphiNumeric[0]->array(mfi);
90 amrex::ParallelFor (bx,[=] AMREX_GPU_DEVICE(
int p,
int q,
int r){ DPhi(p,q,r) =
::Numeric::Stencil<Set::Scalar,i,j,k>::D(Phi,p,q,r,0,DX); });
104 if (error < tolerance)
return 0;
111 amrex::Vector<amrex::MultiFab> plotmf(1);
112 plotmf[0].define(
grids[0],
dmap[0], 3, 0);
113 for (amrex::MFIter mfi(plotmf[0],
false); mfi.isValid(); ++mfi)
115 amrex::Box bx = mfi.validbox();
116 plotmf[0][mfi].copy((*
phi[0])[mfi] ,bx, 0, bx, 0, 1);
117 plotmf[0][mfi].copy((*
DphiExact[0])[mfi] ,bx, 0, bx, 1, 1);
118 plotmf[0][mfi].copy((*
DphiNumeric[0])[mfi],bx, 0, bx, 2, 1);
120 amrex::WriteSingleLevelPlotfile(plotfile,plotmf[0],
varnames,
geom[0],0.0,1);