16 static constexpr
const char*
name =
"sphere";
28 Sphere(amrex::Vector<amrex::Geometry>& _geom):
IC(_geom) {}
41 Define(_radius, _center, _type, _alpha_in, _alpha_out);
59 bool cellcentered = (a_field[0]->boxArray().ixType() == amrex::IndexType(amrex::IntVect::TheCellVector()));
60 int ncomp = a_field[0]->nComp();
62 for (amrex::MFIter mfi(*a_field[lev], amrex::TilingIfNotGPU()); mfi.isValid(); ++mfi)
64 amrex::Box bx = mfi.tilebox();
67 amrex::Array4<Set::Scalar>
const& field = a_field[lev]->array(mfi);
68 amrex::ParallelFor(bx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k)
74 AMREX_D_TERM(x =
geom[lev].ProbLo()[0] + ((amrex::Real)(i)+0.5) *
geom[lev].CellSize()[0];,
75 y =
geom[lev].ProbLo()[1] + ((amrex::Real)(j)+0.5) *
geom[lev].CellSize()[1];,
76 z =
geom[lev].ProbLo()[2] + ((amrex::Real)(k)+0.5) *
geom[lev].CellSize()[2];);
80 AMREX_D_TERM(x =
geom[lev].ProbLo()[0] + (amrex::Real)(i)*
geom[lev].CellSize()[0];,
81 y =
geom[lev].ProbLo()[1] + (amrex::Real)(j)*
geom[lev].CellSize()[1];,
82 z =
geom[lev].ProbLo()[2] + (amrex::Real)(k)*
geom[lev].CellSize()[2];);
87 if (
type == Type::XYZ)
95 else if (
type == Type::XY)
103 else if (
type == Type::YZ)
111 else if (
type == Type::ZX)
123 if (ncomp > 1) field(i, j, k, 1) = 0.;
128 if (ncomp > 1) field(i, j, k, 1) = 1;
144 value.
type = Type::YZ;
146 value.
type = Type::ZX;
148 value.
type = Type::XY;
150 value.
type = Type::XYZ;