46 RP::add(
"VerificationLarmor.BX0",
"Background field value (T)", 0.0);
47 RP::add(
"VerificationLarmor.BY0",
"Background field value (T)", 0.0);
48 RP::add(
"VerificationLarmor.BZ0",
"Background field value (T)", 0.0);
49 RP::add(
"VerificationLarmor.VX0",
"Bulk velocity in x", 0.0);
50 RP::add(
"VerificationLarmor.VY0",
"Bulk velocity in y", 0.0);
51 RP::add(
"VerificationLarmor.VZ0",
"Bulk velocity in z", 0.0);
52 RP::add(
"VerificationLarmor.X0",
"Initial Position", 0.0);
53 RP::add(
"VerificationLarmor.Y0",
"Initial Position", 0.0);
54 RP::add(
"VerificationLarmor.Z0",
"Initial Position", 0.0);
55 RP::add(
"VerificationLarmor.rho",
"Number density (m^-3)", 1.0e7);
63 std::cerr <<
"The selected project does not support multiple particle populations! Aborting in " << __FILE__ <<
" line " << __LINE__ << std::endl;
66 RP::get(
"VerificationLarmor.BX0", this->
BX0);
67 RP::get(
"VerificationLarmor.BY0", this->
BY0);
68 RP::get(
"VerificationLarmor.BZ0", this->
BZ0);
69 RP::get(
"VerificationLarmor.VX0", this->
VX0);
70 RP::get(
"VerificationLarmor.VY0", this->
VY0);
71 RP::get(
"VerificationLarmor.VZ0", this->
VZ0);
72 RP::get(
"VerificationLarmor.X0", this->
X0);
73 RP::get(
"VerificationLarmor.Y0", this->
Y0);
74 RP::get(
"VerificationLarmor.Z0", this->
Z0);
75 RP::get(
"VerificationLarmor.rho", this->
DENSITY);
99 if (fabs(x-this->
X0)>=
dx ||
100 fabs(y-this->
Y0)>=dy ||
101 fabs(z-this->
Z0)>=dz) {
102 std::memset(bufferData, 0, nRequested*
WID3*
sizeof(
Realf));
106 static bool isSet=
false;
108 #pragma omp threadprivate(isSet)
112 for (uint blockLID=0; blockLID<nRequested; ++blockLID) {
116 vmesh->getBlockInfo(blockGID,&blockCoords[0]);
117 creal vxBlock = blockCoords[0];
118 creal vyBlock = blockCoords[1];
119 creal vzBlock = blockCoords[2];
120 creal dvxCell = blockCoords[3];
121 creal dvyCell = blockCoords[4];
122 creal dvzCell = blockCoords[5];
123 for (uint kc=0; kc<
WID; ++kc) {
124 for (uint jc=0; jc<
WID; ++jc) {
125 for (uint ic=0; ic<
WID; ++ic) {
126 creal vx = vxBlock + (ic+0.5)*dvxCell - this->
VX0;
127 creal vy = vyBlock + (jc+0.5)*dvyCell - this->
VY0;
128 creal vz = vzBlock + (kc+0.5)*dvzCell - this->
VZ0;
133 if (fabs(vx)<dvxCell &&
137 value = initRho/(dvxCell*dvyCell*dvzCell);
139 bufferData[blockLID*
WID3 + kc*
WID2 + jc*
WID + ic] = value;
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 bool initialize()
virtual void getParameters()
virtual Realf fillPhaseSpace(spatial_cell::SpatialCell *cell, const uint popID, const uint nRequested) const override
virtual void getParameters(void) override
virtual bool initialize(void) override
virtual void setProjectBField(fsgrids::perbspan perb, fsgrids::bgbspan bgb, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid) override
virtual ~verificationLarmor()
virtual void calcCellParameters(spatial_cell::SpatialCell *cell, creal &t) override
static void addParameters(void)
vmesh::VelocityMesh * get_velocity_mesh(const size_t &popID)
vmesh::VelocityBlockContainer * get_velocity_blocks(const size_t &popID)
std::array< Real, CellParams::N_SPATIAL_CELL_PARAMS > parameters
ARCH_HOSTDEV Realf * getData()
fsgrid::FsGrid< FS_STENCIL_WIDTH > FieldSolverGrid
ObjectWrapper & getObjectWrapper()
std::span< std::array< Real, fsgrids::bfield::N_BFIELD > > perbspan
std::span< technical > technicalspan
std::span< std::array< Real, bgbfield::N_BGB > > bgbspan
std::vector< species::Species > particleSpecies