49 RP::add(
"Fluctuations.BX0",
"Background field value (T)", 1.0e-9);
50 RP::add(
"Fluctuations.BY0",
"Background field value (T)", 2.0e-9);
51 RP::add(
"Fluctuations.BZ0",
"Background field value (T)", 3.0e-9);
52 RP::add(
"Fluctuations.magXPertAbsAmp",
"Amplitude of the magnetic perturbation along x", 1.0e-9);
53 RP::add(
"Fluctuations.magYPertAbsAmp",
"Amplitude of the magnetic perturbation along y", 1.0e-9);
54 RP::add(
"Fluctuations.magZPertAbsAmp",
"Amplitude of the magnetic perturbation along z", 1.0e-9);
60 RP::add(pop +
"_Fluctuations.rho",
"Number density (m^-3)", 1.0e7);
61 RP::add(pop +
"_Fluctuations.TemperatureX",
"Temperature (K)", 2.0e6);
62 RP::add(pop +
"_Fluctuations.TemperatureY",
"Temperature (K)", 2.0e6);
63 RP::add(pop +
"_Fluctuations.TemperatureZ",
"Temperature (K)", 2.0e6);
64 RP::add(pop +
"_Fluctuations.densityPertRelAmp",
"Amplitude factor of the density perturbation", 0.1);
65 RP::add(pop +
"_Fluctuations.velocityPertAbsAmp",
"Amplitude of the velocity perturbation", 1.0e6);
66 RP::add(pop +
"_Fluctuations.maxwCutoff",
"Cutoff for the maxwellian distribution", 1e-12);
74 RP::get(
"Fluctuations.BX0", this->
BX0);
75 RP::get(
"Fluctuations.BY0", this->
BY0);
76 RP::get(
"Fluctuations.BZ0", this->
BZ0);
85 RP::get(pop +
"_Fluctuations.rho", sP.
DENSITY);
86 RP::get(pop +
"_Fluctuations.TemperatureX", sP.
TEMPERATUREX);
87 RP::get(pop +
"_Fluctuations.TemperatureY", sP.
TEMPERATUREY);
88 RP::get(pop +
"_Fluctuations.TemperatureZ", sP.
TEMPERATUREZ);
91 RP::get(pop +
"_Fluctuations.maxwCutoff", sP.
maxwCutoff);
133 vmesh->getBlockInfo(blockGID,&blockCoords[0]);
134 creal vxBlock = blockCoords[0];
135 creal vyBlock = blockCoords[1];
136 creal vzBlock = blockCoords[2];
137 creal dvxCell = blockCoords[3];
138 creal dvyCell = blockCoords[4];
139 creal dvzCell = blockCoords[5];
141 creal vx = vxBlock + (
i+0.5)*dvxCell - initV0X;
142 creal vy = vyBlock + (
j+0.5)*dvyCell - initV0Y;
143 creal vz = vzBlock + (
k+0.5)*dvzCell - initV0Z;
174 creal vx = vx_in - initV0X;
175 creal vy = vy_in - initV0Y;
176 creal vz = vz_in - initV0Z;
183 std::default_random_engine rndState;
212 fsgrid.parallel_for([](
int timerId) -> phiprof::Timer {
return phiprof::Timer{timerId}; },
213 phiprof::initializeTimer(
"setProjectBField"), technical,
214 [=](
const fsgrid::Coordinates &coordinates,
const fsgrid::FsStencil& stencil,
cuint sysBoundaryFlag,
cuint sysBoundaryLayer) {
215 auto& cell = perb[stencil.ooo()];
217 const auto seedmodifier = coordinates.globalIDFromLocalCoordinates(stencil.i, stencil.j, stencil.k);
218 std::default_random_engine rndState_l;
219 rndState_l.seed(
seed+seedmodifier);
221 rndBuffer[0] = std::uniform_real_distribution<>(-0.5,0.5)(rndState_l);
222 rndBuffer[1] = std::uniform_real_distribution<>(-0.5,0.5)(rndState_l);
223 rndBuffer[2] = std::uniform_real_distribution<>(-0.5,0.5)(rndState_l);
238 std::array<Real, 3> V0 {{0.0, 0.0, 0.0}};
239 std::vector<std::array<Real, 3> > centerPoints;
240 centerPoints.push_back(V0);
#define ARCH_INNER_BODY(...)
void setBackgroundField(const FieldFunction &bgFunction, fsgrids::bgbspan bgb, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid, bool append)
void initialize(const double Bx, const double By, const double Bz)
virtual std::vector< std::array< Real, 3 > > getV0(creal x, creal y, creal z, const uint popID) const override
Return a vector containing the velocity coordinate of the centre of each ion population in the distri...
virtual bool initialize(void) override
virtual void calcCellParameters(spatial_cell::SpatialCell *cell, creal &t) override
virtual void getParameters(void) override
std::vector< FluctuationsSpeciesParameters > speciesParams
virtual Realf probePhaseSpace(spatial_cell::SpatialCell *cell, const uint popID, Real vx_in, Real vy_in, Real vz_in) const override
virtual Realf fillPhaseSpace(spatial_cell::SpatialCell *cell, const uint popID, const uint nRequested) const override
static void addParameters(void)
virtual void setProjectBField(fsgrids::perbspan perb, fsgrids::bgbspan bgb, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid) override
Real getRandomNumber(std::default_random_engine &randGen) const
virtual bool initialize()
virtual void getParameters()
void setRandomCellSeed(spatial_cell::SpatialCell *cell, std::default_random_engine &randGen) const
vmesh::VelocityMesh * get_velocity_mesh(const size_t &popID)
vmesh::VelocityBlockContainer * get_velocity_blocks(const size_t &popID)
vmesh::VelocityBlockContainer * dev_get_velocity_blocks(const size_t &popID)
vmesh::VelocityMesh * dev_get_velocity_mesh(const size_t &popID)
ARCH_HOSTDEV Realf * getData()
fsgrid::FsGrid< FS_STENCIL_WIDTH > FieldSolverGrid
ObjectWrapper & getObjectWrapper()
static void parallel_reduce(const uint(&limits)[NDim], Lambda loop_body, T &sum)
std::span< std::array< Real, fsgrids::bfield::N_BFIELD > > perbspan
std::span< technical > technicalspan
std::span< std::array< Real, bgbfield::N_BGB > > bgbspan
ARCH_HOSTDEV Realf TriMaxwellianPhaseSpaceDensity(creal &vx, creal &vy, creal &vz, creal &Tx, creal &Ty, creal &Tz, creal &rho, creal &mass)
std::vector< species::Species > particleSpecies