42 const bool& computeSecond,
43 const bool& computePopulationMomentsOnly,
44 const bool& doNotSkip) {
52 if (computePopulationMomentsOnly ==
false) {
79 for (
int i=0;
i<3; ++
i) {
103 if (!computePopulationMomentsOnly) {
113 if(!computePopulationMomentsOnly) {
120 if (computeSecond ==
false) {
153 pop.
P[
i] = mass * array[
i];
156 if (!computePopulationMomentsOnly) {
179 dccrg::Dccrg<SpatialCell,dccrg::Cartesian_Geometry>& mpiGrid,
180 const std::vector<CellID>& cells,
181 const bool& computeSecond,
182 const bool initialCompute) {
191 phiprof::Timer computeMomentsTimer {
"Compute _R moments"};
193 #pragma omp parallel for schedule(dynamic,1)
194 for (
size_t c=0;
c<cells.size(); ++
c) {
229 for (
int i=0;
i<3; ++
i) {
248 pop.
RHO_R = array[0];
261 #pragma omp parallel for schedule(static)
262 for (
size_t c=0;
c<cells.size(); ++
c) {
276 if (computeSecond ==
false) {
281 #pragma omp parallel for schedule(dynamic,1)
282 for (
size_t c=0;
c<cells.size(); ++
c) {
317 for (
size_t i = 0;
i <
nMom2; ++
i) {
318 pop.
P_R[
i] = mass * array[
i];
343 dccrg::Dccrg<SpatialCell,dccrg::Cartesian_Geometry>& mpiGrid,
344 const std::vector<CellID>& cells,
345 const bool& computeSecond,
346 const bool initialCompute) {
355 phiprof::Timer computeMomentsTimer {
"Compute _V moments"};
358 #pragma omp parallel for schedule(dynamic,1)
359 for (
size_t c=0;
c<cells.size(); ++
c) {
395 for (
int i=0;
i<3; ++
i) {
415 pop.
RHO_V = array[0];
429 #pragma omp parallel for schedule(static)
430 for (
size_t c=0;
c<cells.size(); ++
c) {
444 if (computeSecond ==
false) {
449 #pragma omp parallel for schedule(dynamic,1)
450 for (
size_t c=0;
c<cells.size(); ++
c) {
487 for (
size_t i = 0;
i <
nMom2; ++
i) {
488 pop.
P_V[
i] = mass * array[
i];
void calculateCellMoments(spatial_cell::SpatialCell *cell, const bool &computeSecond, const bool &computePopulationMomentsOnly, const bool &doNotSkip)
void calculateMoments_R(dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, const std::vector< CellID > &cells, const bool &computeSecond, const bool initialCompute)
void calculateMoments_V(dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, const std::vector< CellID > &cells, const bool &computeSecond, const bool initialCompute)
void blockVelocitySecondMoments(vmesh::VelocityBlockContainer *blockContainer, const REAL averageVX, const REAL averageVY, const REAL averageVZ, REAL(&array)[SIZE], uint nBlocks)
void blockVelocityFirstMoments(vmesh::VelocityBlockContainer *blockContainer, REAL(&array)[SIZE], uint nBlocks)
vmesh::VelocityMesh * get_velocity_mesh(const size_t &popID)
vmesh::VelocityBlockContainer * get_velocity_blocks(const size_t &popID)
Population & get_population(const uint popID)
std::array< Real, CellParams::N_SPATIAL_CELL_PARAMS > parameters
vmesh::VelocityBlockContainer * dev_get_velocity_blocks(const size_t &popID)
vmesh::VelocityMesh * dev_get_velocity_mesh(const size_t &popID)
size_t size(bool dummy=0) const
Real divideIfNonZero(creal numerator, creal denominator)
Helper function.
void gpu_calculateMoments_V(dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, const std::vector< CellID > &cells_in, const bool computeSecond, const bool initialCompute)
void gpu_calculateMoments_R(dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, const std::vector< CellID > &cells_in, const bool computeSecond, const bool initialCompute)
ObjectWrapper & getObjectWrapper()
std::vector< species::Species > particleSpecies