23 static constexpr const char*
name =
"sphere";
35 Sphere(amrex::Vector<amrex::Geometry>& _geom):
IC(_geom) {}
48 Define(_radius, _center, _type, _alpha_in, _alpha_out);
66 bool cellcentered = (a_field[0]->boxArray().ixType() == amrex::IndexType(amrex::IntVect::TheCellVector()));
67 int ncomp = a_field[0]->nComp();
69 for (amrex::MFIter mfi(*a_field[lev], amrex::TilingIfNotGPU()); mfi.isValid(); ++mfi)
71 amrex::Box bx = mfi.tilebox();
74 amrex::Array4<Set::Scalar>
const& field = a_field[lev]->array(mfi);
75 amrex::ParallelFor(bx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k)
81 AMREX_D_TERM(x =
geom[lev].ProbLo()[0] + ((amrex::Real)(i)+0.5) *
geom[lev].CellSize()[0];,
82 y =
geom[lev].ProbLo()[1] + ((amrex::Real)(j)+0.5) *
geom[lev].CellSize()[1];,
83 z =
geom[lev].ProbLo()[2] + ((amrex::Real)(k)+0.5) *
geom[lev].CellSize()[2];);
87 AMREX_D_TERM(x =
geom[lev].ProbLo()[0] + (amrex::Real)(i)*
geom[lev].CellSize()[0];,
88 y =
geom[lev].ProbLo()[1] + (amrex::Real)(j)*
geom[lev].CellSize()[1];,
89 z =
geom[lev].ProbLo()[2] + (amrex::Real)(k)*
geom[lev].CellSize()[2];);
130 if (ncomp > 1) field(i, j, k, 1) = 0.;
135 if (ncomp > 1) field(i, j, k, 1) = 1;
#define pp_query_validate(...)
#define pp_query_default(...)
#define pp_queryclass(...)
amrex::Vector< amrex::Geometry > & geom
void Define(Set::Scalar a_radius, Set::Vector a_center, Type a_type, Set::Scalar a_alpha_in, Set::Scalar a_alpha_out)
Type
Sphere is also used for a cylindrical case, but switching from the default type to the desired orient...
Sphere(amrex::Vector< amrex::Geometry > &_geom, IO::ParmParse &pp)
Sphere(amrex::Vector< amrex::Geometry > &_geom)
static void Parse(Sphere &value, IO::ParmParse &pp)
void Add(const int &lev, Set::Field< Set::Scalar > &a_field, Set::Scalar)
Sphere(amrex::Vector< amrex::Geometry > &_geom, Set::Scalar _radius, Set::Vector _center, Type _type=Type::XYZ, Set::Scalar _alpha_in=1, Set::Scalar _alpha_out=0)
Constructor defining radius, center, dimension/orientation, and field values within and outside of th...
Sphere(amrex::Vector< amrex::Geometry > &_geom, IO::ParmParse &pp, std::string name)
static constexpr const char * name
Initialize a spherical inclusion.
Eigen::Matrix< amrex::Real, AMREX_SPACEDIM, 1 > Vector