8#include "AMReX_Vector.H"
22 static constexpr const char*
name =
"random";
34 for (amrex::MFIter mfi(*a_field[lev], amrex::TilingIfNotGPU()); mfi.isValid(); ++mfi)
37 amrex::IndexType type = a_field[lev]->ixType();
38 if (type == amrex::IndexType::TheCellType()) bx = mfi.growntilebox();
39 else if (type == amrex::IndexType::TheNodeType()) bx = mfi.grownnodaltilebox();
43 for (
int n = 0; n < a_field[lev]->nComp(); n++)
45 amrex::ParallelFor(bx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k)
virtual void Add(const int &lev, Set::Field< T > &field, Set::Scalar time)=0
Set each point to a random value.
Random(amrex::Vector< amrex::Geometry > &_geom, IO::ParmParse &pp, std::string name)
static void Parse(Random &value, IO::ParmParse &pp)
void Add(const int &lev, Set::Field< Set::Scalar > &a_field, Set::Scalar)
Random(amrex::Vector< amrex::Geometry > &_geom, Set::Scalar a_mult)
static constexpr const char * name
void queryclass(std::string name, T *value, std::string file="", std::string func="", int line=-1)
int query_default(std::string name, T &value, T defaultvalue, std::string="", std::string="", int=-1)
amrex::Array4< T > Patch(int lev, amrex::MFIter &mfi) const &
Initialize a spherical inclusion.
Eigen::Matrix< amrex::Real, AMREX_SPACEDIM, 1 > Vector
void Abort(const char *msg)