From f6ae60ae44b5b03c5d1335330ddb1c7de6b54566 Mon Sep 17 00:00:00 2001 From: Urs Ganse Date: Mon, 26 Oct 2020 15:07:17 +0200 Subject: [PATCH 01/11] Swap threadsafe random number generator. Again. This time switched to std::defaut_random_engine, in the hope that it is implemented in a sane way on most platforms. --- projects/Dispersion/Dispersion.cpp | 24 +++++++++--------- projects/Distributions/Distributions.cpp | 14 ++++++----- projects/Fluctuations/Fluctuations.cpp | 20 ++++++++------- projects/MultiPeak/MultiPeak.cpp | 14 ++++++----- projects/project.cpp | 26 +++++--------------- projects/project.h | 31 +++++++++++++++--------- projects/testAmr/testAmr.cpp | 16 ++++++------ 7 files changed, 73 insertions(+), 72 deletions(-) diff --git a/projects/Dispersion/Dispersion.cpp b/projects/Dispersion/Dispersion.cpp index 5e47e4a4a..c6c11323d 100644 --- a/projects/Dispersion/Dispersion.cpp +++ b/projects/Dispersion/Dispersion.cpp @@ -216,18 +216,15 @@ namespace projects { creal dy = cellParams[CellParams::DY]; creal z = cellParams[CellParams::ZCRD]; creal dz = cellParams[CellParams::DZ]; - - CellID cellID = (int) ((x - Parameters::xmin) / dx) + - (int) ((y - Parameters::ymin) / dy) * Parameters::xcells_ini + - (int) ((z - Parameters::zmin) / dz) * Parameters::xcells_ini * Parameters::ycells_ini; - setRandomSeed(cellID); + std::default_random_engine rndState; + setRandomCellSeed(cell,rndState); - this->rndRho=getRandomNumber(); + this->rndRho=getRandomNumber(rndState); - this->rndVel[0]=getRandomNumber(); - this->rndVel[1]=getRandomNumber(); - this->rndVel[2]=getRandomNumber(); + this->rndVel[0]=getRandomNumber(rndState); + this->rndVel[1]=getRandomNumber(rndState); + this->rndVel[2]=getRandomNumber(rndState); } void Dispersion::setProjectBField( @@ -252,12 +249,13 @@ namespace projects { std::array* cell = perBGrid.get(x, y, z); const int64_t cellid = perBGrid.GlobalIDForCoords(x, y, z); - setRandomSeed(cellid); + std::default_random_engine rndState; + setRandomSeed(cellid,rndState); Real rndBuffer[3]; - rndBuffer[0]=getRandomNumber(); - rndBuffer[1]=getRandomNumber(); - rndBuffer[2]=getRandomNumber(); + rndBuffer[0]=getRandomNumber(rndState); + rndBuffer[1]=getRandomNumber(rndState); + rndBuffer[2]=getRandomNumber(rndState); cell->at(fsgrids::bfield::PERBX) = this->magXPertAbsAmp * (0.5 - rndBuffer[0]); cell->at(fsgrids::bfield::PERBY) = this->magYPertAbsAmp * (0.5 - rndBuffer[1]); diff --git a/projects/Distributions/Distributions.cpp b/projects/Distributions/Distributions.cpp index b7f03b2d0..88b2d3cb7 100644 --- a/projects/Distributions/Distributions.cpp +++ b/projects/Distributions/Distributions.cpp @@ -150,9 +150,10 @@ namespace projects { } void Distributions::calcCellParameters(spatial_cell::SpatialCell* cell,creal& t) { - setRandomCellSeed(cell); + std::default_random_engine rndState; + setRandomCellSeed(cell,rndState); for (uint i=0; i<2; i++) { - this->rhoRnd[i] = this->rho[i] + this->rhoPertAbsAmp[i] * (0.5 - getRandomNumber()); + this->rhoRnd[i] = this->rho[i] + this->rhoPertAbsAmp[i] * (0.5 - getRandomNumber(rndState)); } } @@ -179,7 +180,8 @@ namespace projects { const int64_t cellid = perBGrid.GlobalIDForCoords(x, y, z); const std::array xyz = perBGrid.getPhysicalCoords(x, y, z); - setRandomSeed(cellid); + std::default_random_engine rndState; + setRandomSeed(cellid,rndState); if (this->lambda != 0.0) { cell->at(fsgrids::bfield::PERBX) = this->dBx*cos(2.0 * M_PI * xyz[0] / this->lambda); @@ -187,9 +189,9 @@ namespace projects { cell->at(fsgrids::bfield::PERBZ) = this->dBz*cos(2.0 * M_PI * xyz[0] / this->lambda); } - cell->at(fsgrids::bfield::PERBX) += this->magXPertAbsAmp * (0.5 - getRandomNumber()); - cell->at(fsgrids::bfield::PERBY) += this->magYPertAbsAmp * (0.5 - getRandomNumber()); - cell->at(fsgrids::bfield::PERBZ) += this->magZPertAbsAmp * (0.5 - getRandomNumber()); + cell->at(fsgrids::bfield::PERBX) += this->magXPertAbsAmp * (0.5 - getRandomNumber(rndState)); + cell->at(fsgrids::bfield::PERBY) += this->magYPertAbsAmp * (0.5 - getRandomNumber(rndState)); + cell->at(fsgrids::bfield::PERBZ) += this->magZPertAbsAmp * (0.5 - getRandomNumber(rndState)); } } } diff --git a/projects/Fluctuations/Fluctuations.cpp b/projects/Fluctuations/Fluctuations.cpp index 131ae1704..d588a2d40 100644 --- a/projects/Fluctuations/Fluctuations.cpp +++ b/projects/Fluctuations/Fluctuations.cpp @@ -162,12 +162,13 @@ namespace projects { (int) ((y - Parameters::ymin) / dy) * Parameters::xcells_ini + (int) ((z - Parameters::zmin) / dz) * Parameters::xcells_ini * Parameters::ycells_ini; - setRandomSeed(cellID); + std::default_random_engine rndState; + setRandomCellSeed(cell,rndState); - this->rndRho=getRandomNumber(); - this->rndVel[0]=getRandomNumber(); - this->rndVel[1]=getRandomNumber(); - this->rndVel[2]=getRandomNumber(); + this->rndRho=getRandomNumber(rndState); + this->rndVel[0]=getRandomNumber(rndState); + this->rndVel[1]=getRandomNumber(rndState); + this->rndVel[2]=getRandomNumber(rndState); } void Fluctuations::setProjectBField( @@ -192,11 +193,12 @@ namespace projects { std::array* cell = perBGrid.get(x, y, z); const int64_t cellid = perBGrid.GlobalIDForCoords(x, y, z); - setRandomSeed(cellid); + std::default_random_engine rndState; + setRandomSeed(cellid,rndState); - cell->at(fsgrids::bfield::PERBX) = this->magXPertAbsAmp * (0.5 - getRandomNumber()); - cell->at(fsgrids::bfield::PERBY) = this->magYPertAbsAmp * (0.5 - getRandomNumber()); - cell->at(fsgrids::bfield::PERBZ) = this->magZPertAbsAmp * (0.5 - getRandomNumber()); + cell->at(fsgrids::bfield::PERBX) = this->magXPertAbsAmp * (0.5 - getRandomNumber(rndState)); + cell->at(fsgrids::bfield::PERBY) = this->magYPertAbsAmp * (0.5 - getRandomNumber(rndState)); + cell->at(fsgrids::bfield::PERBZ) = this->magZPertAbsAmp * (0.5 - getRandomNumber(rndState)); } } } diff --git a/projects/MultiPeak/MultiPeak.cpp b/projects/MultiPeak/MultiPeak.cpp index 941d54cca..7feda4f4d 100644 --- a/projects/MultiPeak/MultiPeak.cpp +++ b/projects/MultiPeak/MultiPeak.cpp @@ -213,8 +213,9 @@ namespace projects { } void MultiPeak::calcCellParameters(spatial_cell::SpatialCell* cell,creal& t) { - setRandomCellSeed(cell); - rhoRnd = 0.5 - getRandomNumber(); + std::default_random_engine rndState; + setRandomCellSeed(cell,rndState); + rhoRnd = 0.5 - getRandomNumber(rndState); } void MultiPeak::setProjectBField( @@ -239,7 +240,8 @@ namespace projects { const std::array xyz = perBGrid.getPhysicalCoords(x, y, z); std::array* cell = perBGrid.get(x, y, z); const int64_t cellid = perBGrid.GlobalIDForCoords(x, y, z); - setRandomSeed(cellid); + std::default_random_engine rndState; + setRandomSeed(cellid,rndState); if (this->lambda != 0.0) { cell->at(fsgrids::bfield::PERBX) = this->dBx*cos(2.0 * M_PI * xyz[0] / this->lambda); @@ -247,9 +249,9 @@ namespace projects { cell->at(fsgrids::bfield::PERBZ) = this->dBz*cos(2.0 * M_PI * xyz[0] / this->lambda); } - cell->at(fsgrids::bfield::PERBX) += this->magXPertAbsAmp * (0.5 - getRandomNumber()); - cell->at(fsgrids::bfield::PERBY) += this->magYPertAbsAmp * (0.5 - getRandomNumber()); - cell->at(fsgrids::bfield::PERBZ) += this->magZPertAbsAmp * (0.5 - getRandomNumber()); + cell->at(fsgrids::bfield::PERBX) += this->magXPertAbsAmp * (0.5 - getRandomNumber(rndState)); + cell->at(fsgrids::bfield::PERBY) += this->magYPertAbsAmp * (0.5 - getRandomNumber(rndState)); + cell->at(fsgrids::bfield::PERBZ) += this->magZPertAbsAmp * (0.5 - getRandomNumber(rndState)); } } } diff --git a/projects/project.cpp b/projects/project.cpp index d53312db3..fa86ed345 100644 --- a/projects/project.cpp +++ b/projects/project.cpp @@ -467,16 +467,8 @@ namespace projects { /** Get random number between 0 and 1.0. One should always first initialize the rng. * @param cell Spatial cell. * @return Uniformly distributed random number between 0 and 1.*/ - Real Project::getRandomNumber() const { -#ifdef _AIX - int64_t rndInt; - random_r(&rndInt, &rngDataBuffer); -#else - int32_t rndInt; - random_r(&rngDataBuffer, &rndInt); -#endif - Real rnd = (Real) rndInt / RAND_MAX; - return rnd; + Real Project::getRandomNumber(std::default_random_engine& randGen) const { + return std::uniform_real_distribution<>(0,1)(randGen); } /*! Set random seed (thread-safe). Seed is based on the seed read @@ -484,14 +476,8 @@ namespace projects { \param seedModifier d. Seed is based on the seed read in from cfg + the seedModifier parameter */ - - void Project::setRandomSeed(CellID seedModifier) const { - memset(&(this->rngDataBuffer), 0, sizeof(this->rngDataBuffer)); -#ifdef _AIX - initstate_r(this->seed+seedModifier, &(this->rngStateBuffer[0]), 256, NULL, &(this->rngDataBuffer)); -#else - initstate_r(this->seed+seedModifier, &(this->rngStateBuffer[0]), 256, &(this->rngDataBuffer)); -#endif + void Project::setRandomSeed(CellID seedModifier, std::default_random_engine& randGen) const { + randGen.seed(this->seed+seedModifier); } /*! @@ -501,7 +487,7 @@ namespace projects { \param cellParams The cell parameters list in each spatial cell */ - void Project::setRandomCellSeed(spatial_cell::SpatialCell* cell) const { + void Project::setRandomCellSeed(spatial_cell::SpatialCell* cell, std::default_random_engine& randGen) const { const creal x = cell->parameters[CellParams::XCRD]; const creal y = cell->parameters[CellParams::YCRD]; const creal z = cell->parameters[CellParams::ZCRD]; @@ -512,7 +498,7 @@ namespace projects { const CellID cellID = (int) ((x - Parameters::xmin) / dx) + (int) ((y - Parameters::ymin) / dy) * Parameters::xcells_ini + (int) ((z - Parameters::zmin) / dz) * Parameters::xcells_ini * Parameters::ycells_ini; - setRandomSeed(cellID); + setRandomSeed(cellID, randGen); } /* diff --git a/projects/project.h b/projects/project.h index d625c9955..1504f9fa5 100644 --- a/projects/project.h +++ b/projects/project.h @@ -23,7 +23,7 @@ #ifndef PROJECT_H #define PROJECT_H -#include "../definitions.h" +#include #include "../spatial_cell.hpp" #include #include @@ -167,18 +167,27 @@ namespace projects { virtual bool rescalesDensity(const uint popID) const; void rescaleDensity(spatial_cell::SpatialCell* cell,const uint popID) const; - /*! Set random seed (thread-safe). Seed is based on the seed read - in from cfg + the seedModifier parameter - * - \param seedModified d. Seed is based on the seed read in from cfg + the seedModifier parameter + /** Get random number between 0 and 1.0. One should always first initialize the rng. + * @param rngDataBuffer struct of type random_data + * @return Uniformly distributed random number between 0 and 1.*/ + Real getRandomNumber(std::default_random_engine& randGen) const; + + /** Set random seed (thread-safe). Seed is based on the seed read + * in from cfg + the seedModifier parameter + * @param seedModifier CellID value to use as seed modifier + * @param rngStateBuffer buffer where random number values are kept + * @param rngDataBuffer struct of type random_data */ - void setRandomSeed(uint64_t seedModifier) const; - /*! - Set random seed (thread-safe) that is always the same for - this particular cellID. Can be used to make reproducible - simulations that do not depend on number of processes or threads. + void setRandomSeed(uint64_t seedModifier, std::default_random_engine& randGen) const; + + /** Set random seed (thread-safe) that is always the same for + * this particular cellID. Can be used to make reproducible + * simulations that do not depend on number of processes or threads. + * @param cell SpatialCell used to infer CellID value to use as seed modifier + * @param rngStateBuffer buffer where random number values are kept + * @param rngDataBuffer struct of type random_data */ - void setRandomCellSeed(spatial_cell::SpatialCell* cell) const; + void setRandomCellSeed(spatial_cell::SpatialCell* cell, std::default_random_engine& randGen) const; private: uint seed; diff --git a/projects/testAmr/testAmr.cpp b/projects/testAmr/testAmr.cpp index 8aadcbf96..b0651fb05 100644 --- a/projects/testAmr/testAmr.cpp +++ b/projects/testAmr/testAmr.cpp @@ -214,8 +214,9 @@ namespace projects { } void testAmr::calcCellParameters(spatial_cell::SpatialCell* cell,creal& t) { - setRandomCellSeed(cell); - rhoRnd = 0.5 - getRandomNumber(); + std::default_random_engine rndState; + setRandomCellSeed(cell,rndState); + rhoRnd = 0.5 - getRandomNumber(rndState); } void testAmr::setProjectBField( @@ -242,17 +243,18 @@ namespace projects { const int64_t cellid = perBGrid.GlobalIDForCoords(x, y, z); - setRandomSeed(cellid); - + std::default_random_engine rndState; + setRandomSeed(cellid,rndState); + if (this->lambda != 0.0) { cell->at(fsgrids::bfield::PERBX) = this->dBx*cos(2.0 * M_PI * xyz[0] / this->lambda); cell->at(fsgrids::bfield::PERBY) = this->dBy*sin(2.0 * M_PI * xyz[0] / this->lambda); cell->at(fsgrids::bfield::PERBZ) = this->dBz*cos(2.0 * M_PI * xyz[0] / this->lambda); } - cell->at(fsgrids::bfield::PERBX) += this->magXPertAbsAmp * (0.5 - getRandomNumber()); - cell->at(fsgrids::bfield::PERBY) += this->magYPertAbsAmp * (0.5 - getRandomNumber()); - cell->at(fsgrids::bfield::PERBZ) += this->magZPertAbsAmp * (0.5 - getRandomNumber()); + cell->at(fsgrids::bfield::PERBX) += this->magXPertAbsAmp * (0.5 - getRandomNumber(rndState)); + cell->at(fsgrids::bfield::PERBY) += this->magYPertAbsAmp * (0.5 - getRandomNumber(rndState)); + cell->at(fsgrids::bfield::PERBZ) += this->magZPertAbsAmp * (0.5 - getRandomNumber(rndState)); } } } From ee05bc3233493da34f4c8a827c8f4ff7782a68b5 Mon Sep 17 00:00:00 2001 From: Urs Ganse Date: Thu, 6 Jan 2022 20:17:33 +0200 Subject: [PATCH 02/11] Remove last remains of random_r calls and their data buffers. This was found by trying to build on an architecture where random_r doesn't exist. (Android / Termux) --- projects/Dispersion/Dispersion.h | 1 - projects/project.cpp | 1 - projects/project.h | 2 -- vlasovsolver/vlasovmover.cpp | 17 +++-------------- 4 files changed, 3 insertions(+), 18 deletions(-) diff --git a/projects/Dispersion/Dispersion.h b/projects/Dispersion/Dispersion.h index f5d76e292..db65d1858 100644 --- a/projects/Dispersion/Dispersion.h +++ b/projects/Dispersion/Dispersion.h @@ -83,7 +83,6 @@ namespace projects { uint seed; char rngStateBuffer[256]; - random_data rngDataBuffer; static Real rndRho, rndVel[3]; #pragma omp threadprivate(rndRho,rndVel) diff --git a/projects/project.cpp b/projects/project.cpp index fa86ed345..609a36ef8 100644 --- a/projects/project.cpp +++ b/projects/project.cpp @@ -61,7 +61,6 @@ using namespace std; extern Logger logFile; char projects::Project::rngStateBuffer[256]; -random_data projects::Project::rngDataBuffer; /** Struct for creating a new velocity mesh. * The values are read from the configuration file and diff --git a/projects/project.h b/projects/project.h index 1504f9fa5..b9da62453 100644 --- a/projects/project.h +++ b/projects/project.h @@ -192,8 +192,6 @@ namespace projects { private: uint seed; static char rngStateBuffer[256]; - static random_data rngDataBuffer; - #pragma omp threadprivate(rngStateBuffer,rngDataBuffer) bool baseClassInitialized; /**< If true, base class has been initialized.*/ }; diff --git a/vlasovsolver/vlasovmover.cpp b/vlasovsolver/vlasovmover.cpp index 8694a3e34..0fa5a2225 100644 --- a/vlasovsolver/vlasovmover.cpp +++ b/vlasovsolver/vlasovmover.cpp @@ -402,23 +402,12 @@ void calculateAcceleration(const uint popID,const uint globalMaxSubcycles,const if (dt<0) subcycleDt = -subcycleDt; //generate pseudo-random order which is always the same irrespective of parallelization, restarts, etc. - char rngStateBuffer[256]; - random_data rngDataBuffer; - + std::default_random_engine rndState; // set seed, initialise generator and get value. The order is the same // for all cells, but varies with timestep. - memset(&(rngDataBuffer), 0, sizeof(rngDataBuffer)); - #ifdef _AIX - initstate_r(P::tstep, &(rngStateBuffer[0]), 256, NULL, &(rngDataBuffer)); - int64_t rndInt; - random_r(&rndInt, &rngDataBuffer); - #else - initstate_r(P::tstep, &(rngStateBuffer[0]), 256, &(rngDataBuffer)); - int32_t rndInt; - random_r(&rngDataBuffer, &rndInt); - #endif + rndState.seed(P::tstep); - uint map_order=rndInt%3; + uint map_order=std::uniform_int_distribution<>(0,2)(rndState); phiprof::start("cell-semilag-acc"); cpu_accelerate_cell(mpiGrid[cellID],popID,map_order,subcycleDt); phiprof::stop("cell-semilag-acc"); From 8c344be52890a2f4a3d3cca5d8acfdc9dc3b8805 Mon Sep 17 00:00:00 2001 From: Markus Battarbee Date: Wed, 30 Aug 2023 14:08:02 +0300 Subject: [PATCH 03/11] Changes to testpackage test velocity block definitions --- .../tests/Flowthrough_amr/Flowthrough_amr.cfg | 18 +++++++++--------- .../Flowthrough_trans_periodic.cfg | 18 +++++++++--------- .../Flowthrough_x_inflow_y_outflow.cfg | 18 +++++++++--------- .../Flowthrough_x_inflow_y_outflow_acc.cfg | 18 +++++++++--------- .../tests/Ionosphere_small/Fluctuations.cfg | 18 +++++++++--------- .../Ionosphere_small/Ionosphere_small.cfg | 18 +++++++++--------- .../Magnetosphere_3D_small.cfg | 18 +++++++++--------- .../Magnetosphere_polar_small.cfg | 18 +++++++++--------- .../Magnetosphere_small.cfg | 18 +++++++++--------- .../tests/restart_read/restart_read.cfg | 18 +++++++++--------- .../tests/restart_write/restart_write.cfg | 18 +++++++++--------- .../test_fp_fsolver_only_3D.cfg | 6 +++--- .../test_fp_substeps/test_fp_substeps.cfg | 6 +++--- .../transtest_2_maxw_500k_100k_20kms_20x20.cfg | 2 +- .../tests/transtest_amr/transtest_amr.cfg | 8 ++++---- 15 files changed, 110 insertions(+), 110 deletions(-) diff --git a/testpackage/tests/Flowthrough_amr/Flowthrough_amr.cfg b/testpackage/tests/Flowthrough_amr/Flowthrough_amr.cfg index fa7cf0f4e..b2c33b8bf 100644 --- a/testpackage/tests/Flowthrough_amr/Flowthrough_amr.cfg +++ b/testpackage/tests/Flowthrough_amr/Flowthrough_amr.cfg @@ -31,15 +31,15 @@ t_max = 182.0 dt = 2.0 [proton_vspace] -vx_min = -2e6 -vx_max = +2e6 -vy_min = -2e6 -vy_max = +2e6 -vz_min = -2e6 -vz_max = +2e6 -vx_length = 15 -vy_length = 15 -vz_length = 15 +vx_min = -1.92e6 +vx_max = +1.92e6 +vy_min = -1.92e6 +vy_max = +1.92e6 +vz_min = -1.92e6 +vz_max = +1.92e6 +vx_length = 16 +vy_length = 16 +vz_length = 16 [io] write_initial_state = 1 diff --git a/testpackage/tests/Flowthrough_trans_periodic/Flowthrough_trans_periodic.cfg b/testpackage/tests/Flowthrough_trans_periodic/Flowthrough_trans_periodic.cfg index fea58d0da..5692fc801 100644 --- a/testpackage/tests/Flowthrough_trans_periodic/Flowthrough_trans_periodic.cfg +++ b/testpackage/tests/Flowthrough_trans_periodic/Flowthrough_trans_periodic.cfg @@ -48,15 +48,15 @@ mass_units = PROTON charge = 1 [proton_vspace] -vx_min = -600000.0 -vx_max = +600000.0 -vy_min = -600000.0 -vy_max = +600000.0 -vz_min = -600000.0 -vz_max = +600000.0 -vx_length = 15 -vy_length = 15 -vz_length = 15 +vx_min = -640000.0 +vx_max = +640000.0 +vy_min = -640000.0 +vy_max = +640000.0 +vz_min = -640000.0 +vz_max = +640000.0 +vx_length = 16 +vy_length = 16 +vz_length = 16 [proton_sparse] minValue = 1.0e-15 diff --git a/testpackage/tests/Flowthrough_x_inflow_y_outflow/Flowthrough_x_inflow_y_outflow.cfg b/testpackage/tests/Flowthrough_x_inflow_y_outflow/Flowthrough_x_inflow_y_outflow.cfg index b25de181f..f4dc5ac23 100644 --- a/testpackage/tests/Flowthrough_x_inflow_y_outflow/Flowthrough_x_inflow_y_outflow.cfg +++ b/testpackage/tests/Flowthrough_x_inflow_y_outflow/Flowthrough_x_inflow_y_outflow.cfg @@ -47,15 +47,15 @@ mass_units = PROTON charge = 1 [proton_vspace] -vx_min = -600000.0 -vx_max = +600000.0 -vy_min = -600000.0 -vy_max = +600000.0 -vz_min = -600000.0 -vz_max = +600000.0 -vx_length = 15 -vy_length = 15 -vz_length = 15 +vx_min = -640000.0 +vx_max = +640000.0 +vy_min = -640000.0 +vy_max = +640000.0 +vz_min = -640000.0 +vz_max = +640000.0 +vx_length = 16 +vy_length = 16 +vz_length = 16 [proton_sparse] minValue = 1.0e-15 diff --git a/testpackage/tests/Flowthrough_x_inflow_y_outflow_acc/Flowthrough_x_inflow_y_outflow_acc.cfg b/testpackage/tests/Flowthrough_x_inflow_y_outflow_acc/Flowthrough_x_inflow_y_outflow_acc.cfg index c089ef51f..51ed46170 100644 --- a/testpackage/tests/Flowthrough_x_inflow_y_outflow_acc/Flowthrough_x_inflow_y_outflow_acc.cfg +++ b/testpackage/tests/Flowthrough_x_inflow_y_outflow_acc/Flowthrough_x_inflow_y_outflow_acc.cfg @@ -47,15 +47,15 @@ mass_units = PROTON charge = 1 [proton_vspace] -vx_min = -600000.0 -vx_max = +600000.0 -vy_min = -600000.0 -vy_max = +600000.0 -vz_min = -600000.0 -vz_max = +600000.0 -vx_length = 15 -vy_length = 15 -vz_length = 15 +vx_min = -640000.0 +vx_max = +640000.0 +vy_min = -640000.0 +vy_max = +640000.0 +vz_min = -640000.0 +vz_max = +640000.0 +vx_length = 16 +vy_length = 16 +vz_length = 16 [proton_sparse] minValue = 1.0e-15 diff --git a/testpackage/tests/Ionosphere_small/Fluctuations.cfg b/testpackage/tests/Ionosphere_small/Fluctuations.cfg index d3092ff10..f89cb3162 100644 --- a/testpackage/tests/Ionosphere_small/Fluctuations.cfg +++ b/testpackage/tests/Ionosphere_small/Fluctuations.cfg @@ -47,15 +47,15 @@ z_max = 1.5e5 dt = 2.05e-05 [proton_vspace] -vx_min = -4.0e6 -vx_max = +4.0e6 -vy_min = -4.0e6 -vy_max = +4.0e6 -vz_min = -4.0e6 -vz_max = +4.0e6 -vx_length = 67 # 100 km/s resolution - more isn't needed for protons -vy_length = 67 -vz_length = 67 +vx_min = -3.96e6 +vx_max = +3.96e6 +vy_min = -3.96e6 +vy_max = +3.96e6 +vz_min = -3.96e6 +vz_max = +3.96e6 +vx_length = 66 # 30 km/s resolution +vy_length = 66 +vz_length = 66 [proton_sparse] minValue = 1.0e-16 #minValue = 0e-14 diff --git a/testpackage/tests/Ionosphere_small/Ionosphere_small.cfg b/testpackage/tests/Ionosphere_small/Ionosphere_small.cfg index 00d1c3316..029b1a877 100644 --- a/testpackage/tests/Ionosphere_small/Ionosphere_small.cfg +++ b/testpackage/tests/Ionosphere_small/Ionosphere_small.cfg @@ -37,15 +37,15 @@ max_spatial_level = 1 refine_radius = 2.2e8 #about 35 RE [proton_vspace] -vx_min = -4.02e6 -vx_max = +4.02e6 -vy_min = -4.02e6 -vy_max = +4.02e6 -vz_min = -4.02e6 -vz_max = +4.02e6 -vx_length = 67 -vy_length = 67 -vz_length = 67 +vx_min = -3.96e6 +vx_max = +3.96e6 +vy_min = -3.96e6 +vy_max = +3.96e6 +vz_min = -3.96e6 +vz_max = +3.96e6 +vx_length = 66 # 30 km/s resolution +vy_length = 66 +vz_length = 66 [proton_sparse] minValue = 1.0e-15 diff --git a/testpackage/tests/Magnetosphere_3D_small/Magnetosphere_3D_small.cfg b/testpackage/tests/Magnetosphere_3D_small/Magnetosphere_3D_small.cfg index 4928f1dd6..27c353aa2 100644 --- a/testpackage/tests/Magnetosphere_3D_small/Magnetosphere_3D_small.cfg +++ b/testpackage/tests/Magnetosphere_3D_small/Magnetosphere_3D_small.cfg @@ -37,15 +37,15 @@ max_spatial_level = 1 refine_radius = 2.2e8 #about 35 RE [proton_vspace] -vx_min = -4.02e6 -vx_max = +4.02e6 -vy_min = -4.02e6 -vy_max = +4.02e6 -vz_min = -4.02e6 -vz_max = +4.02e6 -vx_length = 67 -vy_length = 67 -vz_length = 67 +vx_min = -3.96e6 +vx_max = +3.96e6 +vy_min = -3.96e6 +vy_max = +3.96e6 +vz_min = -3.96e6 +vz_max = +3.96e6 +vx_length = 66 # 30 km/s resolution +vy_length = 66 +vz_length = 66 [proton_sparse] minValue = 1.0e-15 diff --git a/testpackage/tests/Magnetosphere_polar_small/Magnetosphere_polar_small.cfg b/testpackage/tests/Magnetosphere_polar_small/Magnetosphere_polar_small.cfg index f8eb78f1e..a1d7a9b3d 100644 --- a/testpackage/tests/Magnetosphere_polar_small/Magnetosphere_polar_small.cfg +++ b/testpackage/tests/Magnetosphere_polar_small/Magnetosphere_polar_small.cfg @@ -37,15 +37,15 @@ t_max = 20.05 [proton_vspace] -vx_min = -2.0e6 -vx_max = +2.0e6 -vy_min = -2.0e6 -vy_max = +2.0e6 -vz_min = -2.0e6 -vz_max = +2.0e6 -vx_length = 25 -vy_length = 25 -vz_length = 25 +vx_min = -2.08e6 +vx_max = +2.08e6 +vy_min = -2.08e6 +vy_max = +2.08e6 +vz_min = -2.08e6 +vz_max = +2.08e6 +vx_length = 26 # 40 km/s resolution +vy_length = 26 +vz_length = 26 [proton_sparse] minValue = 1.0e-15 diff --git a/testpackage/tests/Magnetosphere_small/Magnetosphere_small.cfg b/testpackage/tests/Magnetosphere_small/Magnetosphere_small.cfg index c820e044b..621e45826 100644 --- a/testpackage/tests/Magnetosphere_small/Magnetosphere_small.cfg +++ b/testpackage/tests/Magnetosphere_small/Magnetosphere_small.cfg @@ -33,15 +33,15 @@ t_max = 10.1 #timestep_max = 100 [proton_vspace] -vx_min = -2.0e6 -vx_max = +2.0e6 -vy_min = -2.0e6 -vy_max = +2.0e6 -vz_min = -2.0e6 -vz_max = +2.0e6 -vx_length = 25 -vy_length = 25 -vz_length = 25 +vx_min = -2.08e6 +vx_max = +2.08e6 +vy_min = -2.08e6 +vy_max = +2.08e6 +vz_min = -2.08e6 +vz_max = +2.08e6 +vx_length = 26 # 40 km/s resolution +vy_length = 26 +vz_length = 26 [proton_sparse] minValue = 1.0e-15 diff --git a/testpackage/tests/restart_read/restart_read.cfg b/testpackage/tests/restart_read/restart_read.cfg index ff3295fed..76f993c23 100644 --- a/testpackage/tests/restart_read/restart_read.cfg +++ b/testpackage/tests/restart_read/restart_read.cfg @@ -50,15 +50,15 @@ mass_units = PROTON charge = 1 [proton_vspace] -vx_min = -600000.0 -vx_max = +600000.0 -vy_min = -600000.0 -vy_max = +600000.0 -vz_min = -600000.0 -vz_max = +600000.0 -vx_length = 15 -vy_length = 15 -vz_length = 15 +vx_min = -640000.0 +vx_max = +640000.0 +vy_min = -640000.0 +vy_max = +640000.0 +vz_min = -640000.0 +vz_max = +640000.0 +vx_length = 16 +vy_length = 16 +vz_length = 16 [proton_sparse] minValue = 1.0e-15 diff --git a/testpackage/tests/restart_write/restart_write.cfg b/testpackage/tests/restart_write/restart_write.cfg index dbe9170eb..061ee0b99 100644 --- a/testpackage/tests/restart_write/restart_write.cfg +++ b/testpackage/tests/restart_write/restart_write.cfg @@ -53,15 +53,15 @@ mass_units = PROTON charge = 1 [proton_vspace] -vx_min = -600000.0 -vx_max = +600000.0 -vy_min = -600000.0 -vy_max = +600000.0 -vz_min = -600000.0 -vz_max = +600000.0 -vx_length = 15 -vy_length = 15 -vz_length = 15 +vx_min = -640000.0 +vx_max = +640000.0 +vy_min = -640000.0 +vy_max = +640000.0 +vz_min = -640000.0 +vz_max = +640000.0 +vx_length = 16 +vy_length = 16 +vz_length = 16 [proton_sparse] minValue = 1.0e-15 diff --git a/testpackage/tests/test_fp_fsolver_only_3D/test_fp_fsolver_only_3D.cfg b/testpackage/tests/test_fp_fsolver_only_3D/test_fp_fsolver_only_3D.cfg index a9fbf8333..979936d54 100644 --- a/testpackage/tests/test_fp_fsolver_only_3D/test_fp_fsolver_only_3D.cfg +++ b/testpackage/tests/test_fp_fsolver_only_3D/test_fp_fsolver_only_3D.cfg @@ -45,9 +45,9 @@ vy_min = -2.0e4 vy_max = +2.0e4 vz_min = -2.0e4 vz_max = +2.0e4 -vx_length = 9 -vy_length = 9 -vz_length = 9 +vx_length = 10 +vy_length = 10 +vz_length = 10 [proton_sparse] minValue = 1.0e-15 diff --git a/testpackage/tests/test_fp_substeps/test_fp_substeps.cfg b/testpackage/tests/test_fp_substeps/test_fp_substeps.cfg index 72f8c2fae..10638e883 100644 --- a/testpackage/tests/test_fp_substeps/test_fp_substeps.cfg +++ b/testpackage/tests/test_fp_substeps/test_fp_substeps.cfg @@ -45,9 +45,9 @@ vy_min = -2.0e4 vy_max = +2.0e4 vz_min = -2.0e4 vz_max = +2.0e4 -vx_length = 9 -vy_length = 9 -vz_length = 9 +vx_length = 10 +vy_length = 10 +vz_length = 10 [proton_sparse] minValue = 1.0e-15 diff --git a/testpackage/tests/transtest_2_maxw_500k_100k_20kms_20x20/transtest_2_maxw_500k_100k_20kms_20x20.cfg b/testpackage/tests/transtest_2_maxw_500k_100k_20kms_20x20/transtest_2_maxw_500k_100k_20kms_20x20.cfg index 4c4be9db7..75cc56848 100644 --- a/testpackage/tests/transtest_2_maxw_500k_100k_20kms_20x20/transtest_2_maxw_500k_100k_20kms_20x20.cfg +++ b/testpackage/tests/transtest_2_maxw_500k_100k_20kms_20x20/transtest_2_maxw_500k_100k_20kms_20x20.cfg @@ -44,7 +44,7 @@ vz_max = +2.0e6 vx_length = 50 vy_length = 50 vz_length = 50 -max_refinement_level = 0 + [proton_sparse] minValue = 1.0e-16 diff --git a/testpackage/tests/transtest_amr/transtest_amr.cfg b/testpackage/tests/transtest_amr/transtest_amr.cfg index bb065566a..898a110dd 100644 --- a/testpackage/tests/transtest_amr/transtest_amr.cfg +++ b/testpackage/tests/transtest_amr/transtest_amr.cfg @@ -49,10 +49,10 @@ vy_min = -2.0e6 vy_max = +2.0e6 vz_min = -2.0e6 vz_max = +2.0e6 -vx_length = 1 -vy_length = 1 -vz_length = 1 -max_refinement_level = 1 +vx_length = 2 +vy_length = 2 +vz_length = 2 + [proton_sparse] minValue = 1.0e-16 From d5410020abfcb54a649bda58b7f3ff0911474bfc Mon Sep 17 00:00:00 2001 From: Markus Battarbee Date: Wed, 30 Aug 2023 14:11:38 +0300 Subject: [PATCH 04/11] removed transtest_amr --- testpackage/small_test_definitions.sh | 34 +++--- .../tests/transtest_amr/transtest_amr.cfg | 105 ------------------ 2 files changed, 13 insertions(+), 126 deletions(-) delete mode 100644 testpackage/tests/transtest_amr/transtest_amr.cfg diff --git a/testpackage/small_test_definitions.sh b/testpackage/small_test_definitions.sh index f85c9fe9d..a63dff17e 100644 --- a/testpackage/small_test_definitions.sh +++ b/testpackage/small_test_definitions.sh @@ -18,7 +18,7 @@ run_dir="run" test_dir="tests" # choose tests to run -run_tests=( 1 2 3 4 5 6 7 8 9 10 11 12 13 14 17 18 19) +run_tests=( 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 18 ) # acceleration test test_name[1]="acctest_2_maxw_500k_100k_20kms_10deg" @@ -124,32 +124,24 @@ comparison_phiprof[15]="phiprof_0.txt" variable_names[15]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v fg_b fg_b fg_b fg_e fg_e fg_e proton" variable_components[15]="0 0 1 2 0 1 2 0 1 2" -## Velocity AMR tests -# translation test -test_name[16]="transtest_amr" -comparison_vlsv[16]="fullf.0000001.vlsv" -comparison_phiprof[16]="phiprof_0.txt" -variable_names[16]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v proton" -variable_components[16]="0 0 1 2" - ## Spatial AMR tests # Flowthrough test -test_name[17]="Flowthrough_amr" +test_name[16]="Flowthrough_amr" +comparison_vlsv[16]="bulk.0000001.vlsv" +comparison_phiprof[16]="phiprof_0.txt" +variable_names[16]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v fg_b fg_b fg_b fg_e fg_e fg_e" +variable_components[16]="0 0 1 2 0 1 2 0 1 2" + +# Magnetosphere 3D +test_name[17]="Magnetosphere_3D_small" comparison_vlsv[17]="bulk.0000001.vlsv" comparison_phiprof[17]="phiprof_0.txt" variable_names[17]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v fg_b fg_b fg_b fg_e fg_e fg_e" variable_components[17]="0 0 1 2 0 1 2 0 1 2" -# Magnetosphere 3D -test_name[18]="Magnetosphere_3D_small" +# Ionosphere 3D +test_name[18]="Ionosphere_small" comparison_vlsv[18]="bulk.0000001.vlsv" comparison_phiprof[18]="phiprof_0.txt" -variable_names[18]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v fg_b fg_b fg_b fg_e fg_e fg_e" -variable_components[18]="0 0 1 2 0 1 2 0 1 2" - -# Ionosphere 3D -test_name[19]="Ionosphere_small" -comparison_vlsv[19]="bulk.0000001.vlsv" -comparison_phiprof[19]="phiprof_0.txt" -variable_names[19]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v fg_b fg_b fg_b fg_e fg_e fg_e ig_upmappedarea ig_fac ig_rhon ig_potential" -variable_components[19]="0 0 1 2 0 1 2 0 1 2 0 0 0 0" +variable_names[18]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v fg_b fg_b fg_b fg_e fg_e fg_e ig_upmappedarea ig_fac ig_rhon ig_potential" +variable_components[18]="0 0 1 2 0 1 2 0 1 2 0 0 0 0" diff --git a/testpackage/tests/transtest_amr/transtest_amr.cfg b/testpackage/tests/transtest_amr/transtest_amr.cfg deleted file mode 100644 index 898a110dd..000000000 --- a/testpackage/tests/transtest_amr/transtest_amr.cfg +++ /dev/null @@ -1,105 +0,0 @@ -dynamic_timestep = 1 -project = testAmr -ParticlePopulations = proton -propagate_field = 0 -propagate_vlasov_acceleration = 0 -propagate_vlasov_translation = 1 - -[proton_properties] -mass = 1 -mass_units = PROTON -charge = 1 - -[io] -diagnostic_write_interval = 1 -write_initial_state = 1 - -system_write_t_interval = 180.0 -system_write_file_name = fullf -system_write_distribution_stride = 1 -system_write_distribution_xline_stride = 0 -system_write_distribution_yline_stride = 0 -system_write_distribution_zline_stride = 0 - -[AMR] -max_spatial_level = 2 -box_half_width_x = 1 -box_half_width_y = 1 -box_half_width_z = 1 -box_center_x = 1.0e6 -box_center_y = 1.0e6 -box_center_z = 1.0e6 - -[gridbuilder] -x_length = 8 -y_length = 8 -z_length = 8 -x_min = -1.0e6 -x_max = 1.0e6 -y_min = -1.0e6 -y_max = 1.0e6 -z_min = -1.0e6 -z_max = 1.0e6 -t_max = 181.0 - -[proton_vspace] -vx_min = -2.0e6 -vx_max = +2.0e6 -vy_min = -2.0e6 -vy_max = +2.0e6 -vz_min = -2.0e6 -vz_max = +2.0e6 -vx_length = 2 -vy_length = 2 -vz_length = 2 - -[proton_sparse] -minValue = 1.0e-16 - -[boundaries] -periodic_x = yes -periodic_y = yes -periodic_z = yes - -[variables] -output = populations_vg_rho -output = fg_b -output = vg_pressure -output = populations_vg_v -output = fg_e -output = vg_rank -output = populations_vg_blocks -#output = populations_vg_acceleration_subcycles - -diagnostic = populations_vg_blocks -#diagnostic = vg_pressure -#diagnostic = populations_vg_rho -#diagnostic = populations_vg_rho_loss_adjust - -[testAmr] -#magnitude of 1.82206867e-10 gives a period of 360s, useful for testing... -Bx = 1.2e-10 -By = 0.8e-10 -Bz = 1.1135233442526334e-10 -magXPertAbsAmp = 0 -magYPertAbsAmp = 0 -magZPertAbsAmp = 0 -densityModel = uniform -nVelocitySamples = 3 - -[proton_testAmr] -n = 1 -Vx = 5e5 -Vy = 5e5 -Vz = 0.0 -Tx = 500000.0 -Ty = 500000.0 -Tz = 500000.0 -rho = 1.0e6 -rhoPertAbsAmp = 1.0e5 - -[loadBalance] -algorithm = RCB - -[bailout] -velocity_space_wall_block_margin = 0 From 5d7c213b9b007b20ff120184269ce90af0f3738d Mon Sep 17 00:00:00 2001 From: Markus Battarbee Date: Wed, 30 Aug 2023 16:46:29 +0300 Subject: [PATCH 05/11] Changed all projects and testpackage tests to use only single sampling in spatial and velocity space initialization. Removed deprecated tetAmr project. --- Makefile | 2 +- projects/Alfven/Alfven.cpp | 4 ++-- projects/Diffusion/Diffusion.cpp | 4 ++-- projects/Dispersion/Dispersion.cpp | 4 ++-- projects/Firehose/Firehose.cpp | 4 ++-- projects/Firehose/Firehose_save.cpp | 2 +- projects/Flowthrough/Flowthrough.cpp | 4 ++-- projects/Fluctuations/Fluctuations.cpp | 4 ++-- projects/Harris/Harris.cpp | 4 ++-- projects/IPShock/IPShock.cpp | 4 ++-- projects/KHB/KHB.cpp | 4 ++-- projects/Magnetosphere/Magnetosphere.cpp | 4 ++-- projects/MultiPeak/MultiPeak.cpp | 2 +- projects/Riemann1/Riemann1.cpp | 4 ++-- projects/Shock/Shock.cpp | 4 ++-- projects/Shocktest/Shocktest.cpp | 4 ++-- projects/project.cpp | 5 ----- projects/unsupported/KelvinHelmholtz/KelvinHelmholtz.cpp | 4 ++-- projects/{ => unsupported}/testAmr/testAmr.cfg | 0 projects/{ => unsupported}/testAmr/testAmr.cpp | 2 +- projects/{ => unsupported}/testAmr/testAmr.h | 0 testpackage/tests/Flowthrough_amr/Flowthrough_amr.cfg | 4 ++-- .../Flowthrough_trans_periodic.cfg | 4 ++-- .../Flowthrough_x_inflow_y_outflow.cfg | 4 ++-- .../Flowthrough_x_inflow_y_outflow_acc.cfg | 4 ++-- testpackage/tests/Ionosphere_small/Fluctuations.cfg | 8 ++++---- .../Selfgen_Waves_Periodic/Selfgen_Waves_Periodic.cfg | 2 +- .../acctest_1_maxw_500k_30kms_1deg.cfg | 2 +- .../acctest_2_maxw_500k_100k_20kms_10deg.cfg | 2 +- .../tests/acctest_3_substeps/acctest_3_substeps.cfg | 2 +- testpackage/tests/acctest_4_helium/acctest_4_helium.cfg | 2 +- .../acctest_5_proton_antiproton.cfg | 2 +- testpackage/tests/restart_read/restart_read.cfg | 4 ++-- testpackage/tests/restart_write/restart_write.cfg | 4 ++-- .../transtest_2_maxw_500k_100k_20kms_20x20.cfg | 2 +- 35 files changed, 55 insertions(+), 60 deletions(-) rename projects/{ => unsupported}/testAmr/testAmr.cfg (100%) rename projects/{ => unsupported}/testAmr/testAmr.cpp (99%) rename projects/{ => unsupported}/testAmr/testAmr.h (100%) diff --git a/Makefile b/Makefile index f5f59d580..33cb65189 100644 --- a/Makefile +++ b/Makefile @@ -145,7 +145,7 @@ OBJS = version.o memoryallocation.o backgroundfield.o quadr.o dipole.o linedipo project.o projectTriAxisSearch.o read_gaussian_population.o\ Alfven.o Diffusion.o Dispersion.o Distributions.o Firehose.o\ Flowthrough.o Fluctuations.o Harris.o KHB.o Larmor.o Magnetosphere.o MultiPeak.o\ - VelocityBox.o Riemann1.o Shock.o Template.o test_fp.o testAmr.o testHall.o test_trans.o\ + VelocityBox.o Riemann1.o Shock.o Template.o test_fp.o testHall.o test_trans.o\ IPShock.o object_wrapper.o\ verificationLarmor.o Shocktest.o grid.o ioread.o iowrite.o vlasiator.o logger.o\ common.o parameters.o readparameters.o spatial_cell.o\ diff --git a/projects/Alfven/Alfven.cpp b/projects/Alfven/Alfven.cpp index fecd952e8..f4b6bf6dc 100644 --- a/projects/Alfven/Alfven.cpp +++ b/projects/Alfven/Alfven.cpp @@ -65,8 +65,8 @@ namespace projects { RP::add(pop + "_Alfven.rho", "Number density (m^-3)", 1.0e8); RP::add(pop + "_Alfven.Temperature", "Temperature (K)", 0.86456498092); RP::add(pop + "_Alfven.A_vel", "Amplitude of the velocity perturbation", 0.1); - RP::add(pop + "_Alfven.nSpaceSamples", "Number of sampling points per spatial dimension", 2); - RP::add(pop + "_Alfven.nVelocitySamples", "Number of sampling points per velocity dimension", 5); + RP::add(pop + "_Alfven.nSpaceSamples", "Number of sampling points per spatial dimension", 1); + RP::add(pop + "_Alfven.nVelocitySamples", "Number of sampling points per velocity dimension", 1); } } diff --git a/projects/Diffusion/Diffusion.cpp b/projects/Diffusion/Diffusion.cpp index b3bd28c36..77f00895e 100644 --- a/projects/Diffusion/Diffusion.cpp +++ b/projects/Diffusion/Diffusion.cpp @@ -55,8 +55,8 @@ namespace projects { RP::add(pop + "_Diffusion.Temperature", "Temperature (K)", 2.0e6); RP::add(pop + "_Diffusion.Scale_x", "Scale length in x (m)", 100000.0); RP::add(pop + "_Diffusion.Scale_y", "Scale length in y (m)", 100000.0); - RP::add(pop + "_Diffusion.nSpaceSamples", "Number of sampling points per spatial dimension", 2); - RP::add(pop + "_Diffusion.nVelocitySamples", "Number of sampling points per velocity dimension", 5); + RP::add(pop + "_Diffusion.nSpaceSamples", "Number of sampling points per spatial dimension", 1); + RP::add(pop + "_Diffusion.nVelocitySamples", "Number of sampling points per velocity dimension", 1); } } diff --git a/projects/Dispersion/Dispersion.cpp b/projects/Dispersion/Dispersion.cpp index c6c11323d..dcce2604c 100644 --- a/projects/Dispersion/Dispersion.cpp +++ b/projects/Dispersion/Dispersion.cpp @@ -64,8 +64,8 @@ namespace projects { RP::add(pop + "_Dispersion.Temperature", "Temperature (K)", 2.0e6); RP::add(pop + "_Dispersion.densityPertRelAmp", "Relative amplitude of the density perturbation", 0.1); RP::add(pop + "_Dispersion.velocityPertAbsAmp", "Absolute amplitude of the velocity perturbation", 1.0e6); - RP::add(pop + "_Dispersion.nSpaceSamples", "Number of sampling points per spatial dimension", 2); - RP::add(pop + "_Dispersion.nVelocitySamples", "Number of sampling points per velocity dimension", 5); + RP::add(pop + "_Dispersion.nSpaceSamples", "Number of sampling points per spatial dimension", 1); + RP::add(pop + "_Dispersion.nVelocitySamples", "Number of sampling points per velocity dimension", 1); } } diff --git a/projects/Firehose/Firehose.cpp b/projects/Firehose/Firehose.cpp index 297cc5951..51c837b1c 100644 --- a/projects/Firehose/Firehose.cpp +++ b/projects/Firehose/Firehose.cpp @@ -66,8 +66,8 @@ namespace projects { RP::add(pop + "_Firehose.Vy2", "Bulk velocity y component, second peak (m/s)", 0.0); RP::add(pop + "_Firehose.Vz1", "Bulk velocity z component, first peak (m/s)", 0.0); RP::add(pop + "_Firehose.Vz2", "Bulk velocity z component, second peak (m/s)", 0.0); - RP::add(pop + "_Firehose.nSpaceSamples", "Number of sampling points per spatial dimension", 2); - RP::add(pop + "_Firehose.nVelocitySamples", "Number of sampling points per velocity dimension", 5); + RP::add(pop + "_Firehose.nSpaceSamples", "Number of sampling points per spatial dimension", 1); + RP::add(pop + "_Firehose.nVelocitySamples", "Number of sampling points per velocity dimension", 1); } } diff --git a/projects/Firehose/Firehose_save.cpp b/projects/Firehose/Firehose_save.cpp index dd2a733ca..bae5db5b3 100644 --- a/projects/Firehose/Firehose_save.cpp +++ b/projects/Firehose/Firehose_save.cpp @@ -67,7 +67,7 @@ bool addProjectParameters(){ RP::add("Firehose.Bx", "Magnetic field x component (T)", 0.0); RP::add("Firehose.By", "Magnetic field y component (T)", 0.0); RP::add("Firehose.Bz", "Magnetic field z component (T)", 0.0); - RP::add("Firehose.nVelocitySamples", "Number of sampling points per velocity dimension", 5); + RP::add("Firehose.nVelocitySamples", "Number of sampling points per velocity dimension", 1); return true; } diff --git a/projects/Flowthrough/Flowthrough.cpp b/projects/Flowthrough/Flowthrough.cpp index 03fd14a1f..29f1efa04 100644 --- a/projects/Flowthrough/Flowthrough.cpp +++ b/projects/Flowthrough/Flowthrough.cpp @@ -75,8 +75,8 @@ namespace projects { RP::add(pop + "_Flowthrough.VX0", "Initial bulk velocity in x-direction", 0.0); RP::add(pop + "_Flowthrough.VY0", "Initial bulk velocity in y-direction", 0.0); RP::add(pop + "_Flowthrough.VZ0", "Initial bulk velocity in z-direction", 0.0); - RP::add(pop + "_Flowthrough.nSpaceSamples", "Number of sampling points per spatial dimension", 2); - RP::add(pop + "_Flowthrough.nVelocitySamples", "Number of sampling points per velocity dimension", 5); + RP::add(pop + "_Flowthrough.nSpaceSamples", "Number of sampling points per spatial dimension", 1); + RP::add(pop + "_Flowthrough.nVelocitySamples", "Number of sampling points per velocity dimension", 1); } } diff --git a/projects/Fluctuations/Fluctuations.cpp b/projects/Fluctuations/Fluctuations.cpp index d588a2d40..581db0415 100644 --- a/projects/Fluctuations/Fluctuations.cpp +++ b/projects/Fluctuations/Fluctuations.cpp @@ -60,8 +60,8 @@ namespace projects { RP::add(pop + "_Fluctuations.Temperature", "Temperature (K)", 2.0e6); RP::add(pop + "_Fluctuations.densityPertRelAmp", "Amplitude factor of the density perturbation", 0.1); RP::add(pop + "_Fluctuations.velocityPertAbsAmp", "Amplitude of the velocity perturbation", 1.0e6); - RP::add(pop + "_Fluctuations.nSpaceSamples", "Number of sampling points per spatial dimension", 2); - RP::add(pop + "_Fluctuations.nVelocitySamples", "Number of sampling points per velocity dimension", 5); + RP::add(pop + "_Fluctuations.nSpaceSamples", "Number of sampling points per spatial dimension", 1); + RP::add(pop + "_Fluctuations.nVelocitySamples", "Number of sampling points per velocity dimension", 1); RP::add(pop + "_Fluctuations.maxwCutoff", "Cutoff for the maxwellian distribution", 1e-12); } } diff --git a/projects/Harris/Harris.cpp b/projects/Harris/Harris.cpp index 3541b77fa..dc0bcea4c 100644 --- a/projects/Harris/Harris.cpp +++ b/projects/Harris/Harris.cpp @@ -53,8 +53,8 @@ namespace projects { RP::add(pop + "_Harris.Temperature", "Temperature (K)", 2.0e6); RP::add(pop + "_Harris.rho", "Number density at infinity (m^-3)", 1.0e7); - RP::add(pop + "_Harris.nSpaceSamples", "Number of sampling points per spatial dimension.", 2); - RP::add(pop + "_Harris.nVelocitySamples", "Number of sampling points per velocity dimension.", 2); + RP::add(pop + "_Harris.nSpaceSamples", "Number of sampling points per spatial dimension.", 1); + RP::add(pop + "_Harris.nVelocitySamples", "Number of sampling points per velocity dimension.", 1); } } diff --git a/projects/IPShock/IPShock.cpp b/projects/IPShock/IPShock.cpp index d43897495..4d9290ba2 100644 --- a/projects/IPShock/IPShock.cpp +++ b/projects/IPShock/IPShock.cpp @@ -81,8 +81,8 @@ namespace projects { RP::add(pop + "_IPShock.rhod", "Downstream Number density (m^-3)", 1.0e7); RP::add(pop + "_IPShock.Temperatured", "Downstream Temperature (K)", 2.0e6); - RP::add(pop + "_IPShock.nSpaceSamples", "Number of sampling points per spatial dimension", 2); - RP::add(pop + "_IPShock.nVelocitySamples", "Number of sampling points per velocity dimension", 5); + RP::add(pop + "_IPShock.nSpaceSamples", "Number of sampling points per spatial dimension", 1); + RP::add(pop + "_IPShock.nVelocitySamples", "Number of sampling points per velocity dimension", 1); RP::add(pop + "_IPShock.maxwCutoff", "Cutoff for the maxwellian distribution", 1e-12); } diff --git a/projects/KHB/KHB.cpp b/projects/KHB/KHB.cpp index d4f332686..8968d1c79 100644 --- a/projects/KHB/KHB.cpp +++ b/projects/KHB/KHB.cpp @@ -60,8 +60,8 @@ namespace projects { RP::add("KHB.amp", "Initial perturbation amplitude (m)", 0.0); RP::add("KHB.offset", "Boundaries offset from 0 (m)", 0.0); RP::add("KHB.transitionWidth", "Width of tanh transition for all changing values", 0.0); - RP::add("KHB.nSpaceSamples", "Number of sampling points per spatial dimension", 2); - RP::add("KHB.nVelocitySamples", "Number of sampling points per velocity dimension", 5); + RP::add("KHB.nSpaceSamples", "Number of sampling points per spatial dimension", 1); + RP::add("KHB.nVelocitySamples", "Number of sampling points per velocity dimension", 1); } void KHB::getParameters() { diff --git a/projects/Magnetosphere/Magnetosphere.cpp b/projects/Magnetosphere/Magnetosphere.cpp index 0faae5116..cd5162aae 100644 --- a/projects/Magnetosphere/Magnetosphere.cpp +++ b/projects/Magnetosphere/Magnetosphere.cpp @@ -92,8 +92,8 @@ namespace projects { RP::add(pop + "_Magnetosphere.VX0", "Initial bulk velocity in x-direction", 0.0); RP::add(pop + "_Magnetosphere.VY0", "Initial bulk velocity in y-direction", 0.0); RP::add(pop + "_Magnetosphere.VZ0", "Initial bulk velocity in z-direction", 0.0); - RP::add(pop + "_Magnetosphere.nSpaceSamples", "Number of sampling points per spatial dimension", 2); - RP::add(pop + "_Magnetosphere.nVelocitySamples", "Number of sampling points per velocity dimension", 5); + RP::add(pop + "_Magnetosphere.nSpaceSamples", "Number of sampling points per spatial dimension", 1); + RP::add(pop + "_Magnetosphere.nVelocitySamples", "Number of sampling points per velocity dimension", 1); RP::add(pop + "_Magnetosphere.taperInnerRadius", "Inner radius of the zone with a density tapering from the ionospheric value to the background (m)", 0.0); RP::add(pop + "_Magnetosphere.taperOuterRadius", "Outer radius of the zone with a density tapering from the ionospheric value to the background (m)", 0.0); } diff --git a/projects/MultiPeak/MultiPeak.cpp b/projects/MultiPeak/MultiPeak.cpp index 5613e9764..1ebc81369 100644 --- a/projects/MultiPeak/MultiPeak.cpp +++ b/projects/MultiPeak/MultiPeak.cpp @@ -62,7 +62,7 @@ namespace projects { RP::add("MultiPeak.magYPertAbsAmp", "Absolute amplitude of the random magnetic perturbation along y (T)", 1.0e-9); RP::add("MultiPeak.magZPertAbsAmp", "Absolute amplitude of the random magnetic perturbation along z (T)", 1.0e-9); RP::add("MultiPeak.lambda", "B cosine perturbation wavelength (m)", 1.0); - RP::add("MultiPeak.nVelocitySamples", "Number of sampling points per velocity dimension", 2); + RP::add("MultiPeak.nVelocitySamples", "Number of sampling points per velocity dimension", 1); RP::add("MultiPeak.densityModel","Which spatial density model is used?",string("uniform")); // Per-population parameters diff --git a/projects/Riemann1/Riemann1.cpp b/projects/Riemann1/Riemann1.cpp index bc40cd261..d54bbc677 100644 --- a/projects/Riemann1/Riemann1.cpp +++ b/projects/Riemann1/Riemann1.cpp @@ -58,8 +58,8 @@ namespace projects { RP::add("Riemann.By2", "Magnetic field y component, right state (T)", 0.0); RP::add("Riemann.Bz1", "Magnetic field z component, left state (T)", 0.0); RP::add("Riemann.Bz2", "Magnetic field z component, right state (T)", 0.0); - RP::add("Riemann.nSpaceSamples", "Number of sampling points per spatial dimension", 2); - RP::add("Riemann.nVelocitySamples", "Number of sampling points per velocity dimension", 5); + RP::add("Riemann.nSpaceSamples", "Number of sampling points per spatial dimension", 1); + RP::add("Riemann.nVelocitySamples", "Number of sampling points per velocity dimension", 1); } void Riemann1::getParameters(){ diff --git a/projects/Shock/Shock.cpp b/projects/Shock/Shock.cpp index 32d38c1d8..3daaf7b1d 100644 --- a/projects/Shock/Shock.cpp +++ b/projects/Shock/Shock.cpp @@ -52,8 +52,8 @@ namespace projects { RP::add("Shock.magPertAmp", "Amplitude of the magnetic perturbation", 1.0e-9); RP::add("Shock.densityPertAmp", "Amplitude factor of the density perturbation", 0.1); RP::add("Shock.velocityPertAmp", "Amplitude of the velocity perturbation", 1.0e6); - RP::add("Shock.nSpaceSamples", "Number of sampling points per spatial dimension", 2); - RP::add("Shock.nVelocitySamples", "Number of sampling points per velocity dimension", 5); + RP::add("Shock.nSpaceSamples", "Number of sampling points per spatial dimension", 1); + RP::add("Shock.nVelocitySamples", "Number of sampling points per velocity dimension", 1); RP::add("Shock.maxwCutoff", "Cutoff for the maxwellian distribution", 1e-12); RP::add("Shock.Scale_x", "Scale length in x (m)", 2.0e6); RP::add("Shock.Scale_y", "Scale length in y (m)", 2.0e6); diff --git a/projects/Shocktest/Shocktest.cpp b/projects/Shocktest/Shocktest.cpp index 54c23a55a..02263654c 100644 --- a/projects/Shocktest/Shocktest.cpp +++ b/projects/Shocktest/Shocktest.cpp @@ -64,8 +64,8 @@ namespace projects { RP::add("Shocktest.By2", "Magnetic field y component, right state (T)", 0.0); RP::add("Shocktest.Bz1", "Magnetic field z component, left state (T)", 0.0); RP::add("Shocktest.Bz2", "Magnetic field z component, right state (T)", 0.0); - RP::add("Shocktest.nSpaceSamples", "Number of sampling points per spatial dimension", 2); - RP::add("Shocktest.nVelocitySamples", "Number of sampling points per velocity dimension", 5); + RP::add("Shocktest.nSpaceSamples", "Number of sampling points per spatial dimension", 1); + RP::add("Shocktest.nVelocitySamples", "Number of sampling points per velocity dimension", 1); } void Shocktest::getParameters(){ diff --git a/projects/project.cpp b/projects/project.cpp index ff61092e6..898de99c6 100644 --- a/projects/project.cpp +++ b/projects/project.cpp @@ -47,7 +47,6 @@ #include "IPShock/IPShock.h" #include "Template/Template.h" #include "test_fp/test_fp.h" -#include "testAmr/testAmr.h" #include "testHall/testHall.h" #include "test_trans/test_trans.h" #include "verificationLarmor/verificationLarmor.h" @@ -123,7 +122,6 @@ namespace projects { projects::IPShock::addParameters(); projects::Template::addParameters(); projects::test_fp::addParameters(); - projects::testAmr::addParameters(); projects::TestHall::addParameters(); projects::test_trans::addParameters(); projects::verificationLarmor::addParameters(); @@ -713,9 +711,6 @@ Project* createProject() { if(Parameters::projectName == "test_fp") { rvalue = new projects::test_fp; } - if(Parameters::projectName == "testAmr") { - rvalue = new projects::testAmr; - } if(Parameters::projectName == "testHall") { rvalue = new projects::TestHall; } diff --git a/projects/unsupported/KelvinHelmholtz/KelvinHelmholtz.cpp b/projects/unsupported/KelvinHelmholtz/KelvinHelmholtz.cpp index 8dcfdf7fa..a5b417141 100644 --- a/projects/unsupported/KelvinHelmholtz/KelvinHelmholtz.cpp +++ b/projects/unsupported/KelvinHelmholtz/KelvinHelmholtz.cpp @@ -59,8 +59,8 @@ namespace projects { RP::add("KelvinHelmholtz.amp", "Initial perturbation amplitude (m)", 0.0); RP::add("KelvinHelmholtz.offset", "Boundaries offset from 0 (m)", 0.0); RP::add("KelvinHelmholtz.transitionWidth", "Width of tanh transition for all changing values", 0.0); - RP::add("KelvinHelmholtz.nSpaceSamples", "Number of sampling points per spatial dimension", 2); - RP::add("KelvinHelmholtz.nVelocitySamples", "Number of sampling points per velocity dimension", 5); + RP::add("KelvinHelmholtz.nSpaceSamples", "Number of sampling points per spatial dimension", 1); + RP::add("KelvinHelmholtz.nVelocitySamples", "Number of sampling points per velocity dimension", 1); } void KelvinHelmholtz::getParameters() { diff --git a/projects/testAmr/testAmr.cfg b/projects/unsupported/testAmr/testAmr.cfg similarity index 100% rename from projects/testAmr/testAmr.cfg rename to projects/unsupported/testAmr/testAmr.cfg diff --git a/projects/testAmr/testAmr.cpp b/projects/unsupported/testAmr/testAmr.cpp similarity index 99% rename from projects/testAmr/testAmr.cpp rename to projects/unsupported/testAmr/testAmr.cpp index 7b9c88242..986789a43 100644 --- a/projects/testAmr/testAmr.cpp +++ b/projects/unsupported/testAmr/testAmr.cpp @@ -60,7 +60,7 @@ namespace projects { RP::add("testAmr.magYPertAbsAmp", "Absolute amplitude of the random magnetic perturbation along y (T)", 1.0e-9); RP::add("testAmr.magZPertAbsAmp", "Absolute amplitude of the random magnetic perturbation along z (T)", 1.0e-9); RP::add("testAmr.lambda", "B cosine perturbation wavelength (m)", 1.0); - RP::add("testAmr.nVelocitySamples", "Number of sampling points per velocity dimension", 2); + RP::add("testAmr.nVelocitySamples", "Number of sampling points per velocity dimension", 1); RP::add("testAmr.densityModel","Which spatial density model is used?",string("uniform")); RP::add("testAmr.maxSpatialRefinementLevel", "Maximum level for spatial refinement", 1.0); diff --git a/projects/testAmr/testAmr.h b/projects/unsupported/testAmr/testAmr.h similarity index 100% rename from projects/testAmr/testAmr.h rename to projects/unsupported/testAmr/testAmr.h diff --git a/testpackage/tests/Flowthrough_amr/Flowthrough_amr.cfg b/testpackage/tests/Flowthrough_amr/Flowthrough_amr.cfg index b2c33b8bf..3a3fa751b 100644 --- a/testpackage/tests/Flowthrough_amr/Flowthrough_amr.cfg +++ b/testpackage/tests/Flowthrough_amr/Flowthrough_amr.cfg @@ -102,8 +102,8 @@ VX0 = 1e5 VY0 = 0 VZ0 = 0 -nSpaceSamples = 2 -nVelocitySamples = 2 +nSpaceSamples = 1 +nVelocitySamples = 1 [loadBalance] algorithm = RCB diff --git a/testpackage/tests/Flowthrough_trans_periodic/Flowthrough_trans_periodic.cfg b/testpackage/tests/Flowthrough_trans_periodic/Flowthrough_trans_periodic.cfg index 5692fc801..d2ce42b81 100644 --- a/testpackage/tests/Flowthrough_trans_periodic/Flowthrough_trans_periodic.cfg +++ b/testpackage/tests/Flowthrough_trans_periodic/Flowthrough_trans_periodic.cfg @@ -80,8 +80,8 @@ rho = 1000000.0 VX0 = 4e5 VY0 = 4e5 VZ0 = 4e5 -nSpaceSamples = 2 -nVelocitySamples = 2 +nSpaceSamples = 1 +nVelocitySamples = 1 [bailout] velocity_space_wall_block_margin = 0 diff --git a/testpackage/tests/Flowthrough_x_inflow_y_outflow/Flowthrough_x_inflow_y_outflow.cfg b/testpackage/tests/Flowthrough_x_inflow_y_outflow/Flowthrough_x_inflow_y_outflow.cfg index f4dc5ac23..297a832d0 100644 --- a/testpackage/tests/Flowthrough_x_inflow_y_outflow/Flowthrough_x_inflow_y_outflow.cfg +++ b/testpackage/tests/Flowthrough_x_inflow_y_outflow/Flowthrough_x_inflow_y_outflow.cfg @@ -101,8 +101,8 @@ rho = 1000000.0 VX0 = 4e5 VY0 = 0 VZ0 = 0 -nSpaceSamples = 2 -nVelocitySamples = 2 +nSpaceSamples = 1 +nVelocitySamples = 1 [bailout] velocity_space_wall_block_margin = 0 diff --git a/testpackage/tests/Flowthrough_x_inflow_y_outflow_acc/Flowthrough_x_inflow_y_outflow_acc.cfg b/testpackage/tests/Flowthrough_x_inflow_y_outflow_acc/Flowthrough_x_inflow_y_outflow_acc.cfg index 51ed46170..a4702b416 100644 --- a/testpackage/tests/Flowthrough_x_inflow_y_outflow_acc/Flowthrough_x_inflow_y_outflow_acc.cfg +++ b/testpackage/tests/Flowthrough_x_inflow_y_outflow_acc/Flowthrough_x_inflow_y_outflow_acc.cfg @@ -101,8 +101,8 @@ rho = 1000000.0 VX0 = 4e5 VY0 = 0 VZ0 = 0 -nSpaceSamples = 2 -nVelocitySamples = 2 +nSpaceSamples = 1 +nVelocitySamples = 1 [bailout] velocity_space_wall_block_margin = 0 diff --git a/testpackage/tests/Ionosphere_small/Fluctuations.cfg b/testpackage/tests/Ionosphere_small/Fluctuations.cfg index f89cb3162..fbafad032 100644 --- a/testpackage/tests/Ionosphere_small/Fluctuations.cfg +++ b/testpackage/tests/Ionosphere_small/Fluctuations.cfg @@ -105,8 +105,8 @@ Temperature = 1.0e7 densityPertRelAmp = 0.0 velocityPertAbsAmp = 1000.0 maxwCutoff = 1.0e-16 -nSpaceSamples = 2 -nVelocitySamples = 2 +nSpaceSamples = 1 +nVelocitySamples = 1 [electron_Fluctuations] rho = 4e5 @@ -114,5 +114,5 @@ Temperature = 2.5e6 densityPertRelAmp = 0.0 velocityPertAbsAmp = 1000.0 maxwCutoff = 1.0e-21 -nSpaceSamples = 2 -nVelocitySamples = 2 +nSpaceSamples = 1 +nVelocitySamples = 1 diff --git a/testpackage/tests/Selfgen_Waves_Periodic/Selfgen_Waves_Periodic.cfg b/testpackage/tests/Selfgen_Waves_Periodic/Selfgen_Waves_Periodic.cfg index 3eac7f946..ee1a11d3d 100644 --- a/testpackage/tests/Selfgen_Waves_Periodic/Selfgen_Waves_Periodic.cfg +++ b/testpackage/tests/Selfgen_Waves_Periodic/Selfgen_Waves_Periodic.cfg @@ -77,7 +77,7 @@ magYPertAbsAmp = 0 magZPertAbsAmp = 0 densityModel = testcase -nVelocitySamples = 3 +nVelocitySamples = 1 [proton_MultiPeak] n = 2 diff --git a/testpackage/tests/acctest_1_maxw_500k_30kms_1deg/acctest_1_maxw_500k_30kms_1deg.cfg b/testpackage/tests/acctest_1_maxw_500k_30kms_1deg/acctest_1_maxw_500k_30kms_1deg.cfg index 4e73cbbdb..53610b1cc 100644 --- a/testpackage/tests/acctest_1_maxw_500k_30kms_1deg/acctest_1_maxw_500k_30kms_1deg.cfg +++ b/testpackage/tests/acctest_1_maxw_500k_30kms_1deg/acctest_1_maxw_500k_30kms_1deg.cfg @@ -113,7 +113,7 @@ lambda = 10 magXPertAbsAmp = 0 magYPertAbsAmp = 0 magZPertAbsAmp = 0 -nVelocitySamples = 4 +nVelocitySamples = 1 [proton_MultiPeak] n = 1 diff --git a/testpackage/tests/acctest_2_maxw_500k_100k_20kms_10deg/acctest_2_maxw_500k_100k_20kms_10deg.cfg b/testpackage/tests/acctest_2_maxw_500k_100k_20kms_10deg/acctest_2_maxw_500k_100k_20kms_10deg.cfg index 346331a9a..ee5eaa432 100644 --- a/testpackage/tests/acctest_2_maxw_500k_100k_20kms_10deg/acctest_2_maxw_500k_100k_20kms_10deg.cfg +++ b/testpackage/tests/acctest_2_maxw_500k_100k_20kms_10deg/acctest_2_maxw_500k_100k_20kms_10deg.cfg @@ -77,7 +77,7 @@ Bz = 1.1135233442526334e-10 magXPertAbsAmp = 0 magYPertAbsAmp = 0 magZPertAbsAmp = 0 -nVelocitySamples = 3 +nVelocitySamples = 1 [proton_MultiPeak] n = 2 diff --git a/testpackage/tests/acctest_3_substeps/acctest_3_substeps.cfg b/testpackage/tests/acctest_3_substeps/acctest_3_substeps.cfg index 4381c1f90..303640837 100644 --- a/testpackage/tests/acctest_3_substeps/acctest_3_substeps.cfg +++ b/testpackage/tests/acctest_3_substeps/acctest_3_substeps.cfg @@ -81,7 +81,7 @@ Bz = 1.1135233442526334e-10 magXPertAbsAmp = 0 magYPertAbsAmp = 0 magZPertAbsAmp = 0 -nVelocitySamples = 3 +nVelocitySamples = 1 [proton_MultiPeak] n = 2 diff --git a/testpackage/tests/acctest_4_helium/acctest_4_helium.cfg b/testpackage/tests/acctest_4_helium/acctest_4_helium.cfg index ff8b4d8c8..fc93ac49a 100644 --- a/testpackage/tests/acctest_4_helium/acctest_4_helium.cfg +++ b/testpackage/tests/acctest_4_helium/acctest_4_helium.cfg @@ -80,7 +80,7 @@ lambda = 10 magXPertAbsAmp = 0 magYPertAbsAmp = 0 magZPertAbsAmp = 0 -nVelocitySamples = 4 +nVelocitySamples = 1 [helium_MultiPeak] n = 1 diff --git a/testpackage/tests/acctest_5_proton_antiproton/acctest_5_proton_antiproton.cfg b/testpackage/tests/acctest_5_proton_antiproton/acctest_5_proton_antiproton.cfg index 8134fb6a3..f8c3d23e2 100644 --- a/testpackage/tests/acctest_5_proton_antiproton/acctest_5_proton_antiproton.cfg +++ b/testpackage/tests/acctest_5_proton_antiproton/acctest_5_proton_antiproton.cfg @@ -97,7 +97,7 @@ Bz = 1.1135233442526334e-10 magXPertAbsAmp = 0 magYPertAbsAmp = 0 magZPertAbsAmp = 0 -nVelocitySamples = 3 +nVelocitySamples = 1 [proton_MultiPeak] n = 2 diff --git a/testpackage/tests/restart_read/restart_read.cfg b/testpackage/tests/restart_read/restart_read.cfg index 76f993c23..36fc09563 100644 --- a/testpackage/tests/restart_read/restart_read.cfg +++ b/testpackage/tests/restart_read/restart_read.cfg @@ -104,8 +104,8 @@ rho = 1000000.0 VX0 = 4e5 VY0 = 0 VZ0 = 0 -nSpaceSamples = 2 -nVelocitySamples = 2 +nSpaceSamples = 1 +nVelocitySamples = 1 [bailout] velocity_space_wall_block_margin = 0 diff --git a/testpackage/tests/restart_write/restart_write.cfg b/testpackage/tests/restart_write/restart_write.cfg index 061ee0b99..e168f6cee 100644 --- a/testpackage/tests/restart_write/restart_write.cfg +++ b/testpackage/tests/restart_write/restart_write.cfg @@ -107,8 +107,8 @@ rho = 1000000.0 VX0 = 4e5 VY0 = 0 VZ0 = 0 -nSpaceSamples = 2 -nVelocitySamples = 2 +nSpaceSamples = 1 +nVelocitySamples = 1 [bailout] velocity_space_wall_block_margin = 0 diff --git a/testpackage/tests/transtest_2_maxw_500k_100k_20kms_20x20/transtest_2_maxw_500k_100k_20kms_20x20.cfg b/testpackage/tests/transtest_2_maxw_500k_100k_20kms_20x20/transtest_2_maxw_500k_100k_20kms_20x20.cfg index 75cc56848..00773fc06 100644 --- a/testpackage/tests/transtest_2_maxw_500k_100k_20kms_20x20/transtest_2_maxw_500k_100k_20kms_20x20.cfg +++ b/testpackage/tests/transtest_2_maxw_500k_100k_20kms_20x20/transtest_2_maxw_500k_100k_20kms_20x20.cfg @@ -77,7 +77,7 @@ magXPertAbsAmp = 0 magYPertAbsAmp = 0 magZPertAbsAmp = 0 -nVelocitySamples = 3 +nVelocitySamples = 1 [proton_MultiPeak] n = 1 From 3fee04882df863206eee379458f6ae426362eee4 Mon Sep 17 00:00:00 2001 From: Markus Battarbee Date: Thu, 31 Aug 2023 16:00:16 +0300 Subject: [PATCH 06/11] Increased block counts on some tests due to hiccup on lumi-c --- projects/Riemann1/Riemann1.cpp | 2 +- .../Flowthrough_trans_periodic.cfg | 6 +++--- .../Flowthrough_x_inflow_y_outflow.cfg | 6 +++--- .../Flowthrough_x_inflow_y_outflow_acc.cfg | 6 +++--- testpackage/tests/restart_read/restart_read.cfg | 6 +++--- testpackage/tests/restart_write/restart_write.cfg | 6 +++--- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/projects/Riemann1/Riemann1.cpp b/projects/Riemann1/Riemann1.cpp index d54bbc677..a4158decb 100644 --- a/projects/Riemann1/Riemann1.cpp +++ b/projects/Riemann1/Riemann1.cpp @@ -59,7 +59,7 @@ namespace projects { RP::add("Riemann.Bz1", "Magnetic field z component, left state (T)", 0.0); RP::add("Riemann.Bz2", "Magnetic field z component, right state (T)", 0.0); RP::add("Riemann.nSpaceSamples", "Number of sampling points per spatial dimension", 1); - RP::add("Riemann.nVelocitySamples", "Number of sampling points per velocity dimension", 1); + RP::add("Riemann.nVelocitySamples", "Number of sampling points per velocity dimension", 1); } void Riemann1::getParameters(){ diff --git a/testpackage/tests/Flowthrough_trans_periodic/Flowthrough_trans_periodic.cfg b/testpackage/tests/Flowthrough_trans_periodic/Flowthrough_trans_periodic.cfg index d2ce42b81..6742e540e 100644 --- a/testpackage/tests/Flowthrough_trans_periodic/Flowthrough_trans_periodic.cfg +++ b/testpackage/tests/Flowthrough_trans_periodic/Flowthrough_trans_periodic.cfg @@ -54,9 +54,9 @@ vy_min = -640000.0 vy_max = +640000.0 vz_min = -640000.0 vz_max = +640000.0 -vx_length = 16 -vy_length = 16 -vz_length = 16 +vx_length = 32 +vy_length = 32 +vz_length = 32 [proton_sparse] minValue = 1.0e-15 diff --git a/testpackage/tests/Flowthrough_x_inflow_y_outflow/Flowthrough_x_inflow_y_outflow.cfg b/testpackage/tests/Flowthrough_x_inflow_y_outflow/Flowthrough_x_inflow_y_outflow.cfg index 297a832d0..5d0861f41 100644 --- a/testpackage/tests/Flowthrough_x_inflow_y_outflow/Flowthrough_x_inflow_y_outflow.cfg +++ b/testpackage/tests/Flowthrough_x_inflow_y_outflow/Flowthrough_x_inflow_y_outflow.cfg @@ -53,9 +53,9 @@ vy_min = -640000.0 vy_max = +640000.0 vz_min = -640000.0 vz_max = +640000.0 -vx_length = 16 -vy_length = 16 -vz_length = 16 +vx_length = 32 +vy_length = 32 +vz_length = 32 [proton_sparse] minValue = 1.0e-15 diff --git a/testpackage/tests/Flowthrough_x_inflow_y_outflow_acc/Flowthrough_x_inflow_y_outflow_acc.cfg b/testpackage/tests/Flowthrough_x_inflow_y_outflow_acc/Flowthrough_x_inflow_y_outflow_acc.cfg index a4702b416..7eb5198a9 100644 --- a/testpackage/tests/Flowthrough_x_inflow_y_outflow_acc/Flowthrough_x_inflow_y_outflow_acc.cfg +++ b/testpackage/tests/Flowthrough_x_inflow_y_outflow_acc/Flowthrough_x_inflow_y_outflow_acc.cfg @@ -53,9 +53,9 @@ vy_min = -640000.0 vy_max = +640000.0 vz_min = -640000.0 vz_max = +640000.0 -vx_length = 16 -vy_length = 16 -vz_length = 16 +vx_length = 32 +vy_length = 32 +vz_length = 32 [proton_sparse] minValue = 1.0e-15 diff --git a/testpackage/tests/restart_read/restart_read.cfg b/testpackage/tests/restart_read/restart_read.cfg index 36fc09563..225e22b76 100644 --- a/testpackage/tests/restart_read/restart_read.cfg +++ b/testpackage/tests/restart_read/restart_read.cfg @@ -56,9 +56,9 @@ vy_min = -640000.0 vy_max = +640000.0 vz_min = -640000.0 vz_max = +640000.0 -vx_length = 16 -vy_length = 16 -vz_length = 16 +vx_length = 32 +vy_length = 32 +vz_length = 32 [proton_sparse] minValue = 1.0e-15 diff --git a/testpackage/tests/restart_write/restart_write.cfg b/testpackage/tests/restart_write/restart_write.cfg index e168f6cee..06105607e 100644 --- a/testpackage/tests/restart_write/restart_write.cfg +++ b/testpackage/tests/restart_write/restart_write.cfg @@ -59,9 +59,9 @@ vy_min = -640000.0 vy_max = +640000.0 vz_min = -640000.0 vz_max = +640000.0 -vx_length = 16 -vy_length = 16 -vz_length = 16 +vx_length = 32 +vy_length = 32 +vz_length = 32 [proton_sparse] minValue = 1.0e-15 From 35b0955d463ca52d8537de84d9071f5c4162d096 Mon Sep 17 00:00:00 2001 From: Markus Battarbee Date: Fri, 1 Sep 2023 10:00:25 +0300 Subject: [PATCH 07/11] Switched to much simplified Multipeak init --- projects/MultiPeak/MultiPeak.cpp | 162 +++++++++++++++++-------------- 1 file changed, 91 insertions(+), 71 deletions(-) diff --git a/projects/MultiPeak/MultiPeak.cpp b/projects/MultiPeak/MultiPeak.cpp index 1ebc81369..8159ba2c3 100644 --- a/projects/MultiPeak/MultiPeak.cpp +++ b/projects/MultiPeak/MultiPeak.cpp @@ -42,7 +42,7 @@ Real projects::MultiPeak::rhoRnd; namespace projects { MultiPeak::MultiPeak(): TriAxisSearch() { } - + MultiPeak::~MultiPeak() { } bool MultiPeak::initialize(void) { @@ -118,10 +118,10 @@ namespace projects { speciesParams.push_back(sP); } - + string densModelString; RP::get("MultiPeak.densityModel",densModelString); - + if (densModelString == "uniform") densityModel = Uniform; else if (densModelString == "testcase") densityModel = TestCase; } @@ -136,78 +136,98 @@ namespace projects { for (uint i=0; i= 3.9e5 && x <= 6.1e5) && (y >= 3.9e5 && y <= 6.1e5)) { - rhoFactor = 1.5; - } - break; - default: - rhoFactor = 1.0; - break; - } - - // Sample the distribution using N*N*N points - for (uint vi=0; vi= 3.9e5 && x <= 6.1e5) && (y >= 3.9e5 && y <= 6.1e5)) { + rhoFactor = 1.5; } - } - avg *= rhoFactor; - - // Compare the current and accumulated volume averages: - Real eps = max(numeric_limits::min(),avg * static_cast(1e-6)); - Real avgAccum = avgTotal / (avg + N3_sum); - Real avgCurrent = avg / (N*N*N); - if (fabs(avgCurrent-avgAccum)/(avgAccum+eps) < 0.01) ok = true; - else if (avg < avgLimit) ok = true; - else if (N > 10) { - ok = true; - } + break; + default: + rhoFactor = 1.0; + break; + } - avgTotal += avg; - N3_sum += N*N*N; - ++N; - } while (ok == false); + return rhoFactor * getDistribValue(vx+0.5*dvx,vy+0.5*dvy,vz+0.5*dvz,dvx,dvy,dvz,popID); - return avgTotal / N3_sum; + // #warning SpatialCell::getVelocityBlockMinValue() or dynamic algorithm not available without spatial cell data + // const Real avgLimit = 0.01*getObjectWrapper().particleSpecies[popID].sparseMinValue; + // do { + // Real avg = 0.0; // Volume average obtained during this sampling + // creal DVX = dvx / N; + // creal DVY = dvy / N; + // creal DVZ = dvz / N; + + // Real rhoFactor = 1.0; + // switch (densityModel) { + // case Uniform: + // rhoFactor = 1.0; + // break; + // case TestCase: + // rhoFactor = 1.0; + // if ((x >= 3.9e5 && x <= 6.1e5) && (y >= 3.9e5 && y <= 6.1e5)) { + // rhoFactor = 1.5; + // } + // break; + // default: + // rhoFactor = 1.0; + // break; + // } + + // // Sample the distribution using N*N*N points + // for (uint vi=0; vi::min(),avg * static_cast(1e-6)); + // Real avgAccum = avgTotal / (avg + N3_sum); + // Real avgCurrent = avg / (N*N*N); + // if (fabs(avgCurrent-avgAccum)/(avgAccum+eps) < 0.01) ok = true; + // else if (avg < avgLimit) ok = true; + // else if (N > 10) { + // ok = true; + // } + + // avgTotal += avg; + // N3_sum += N*N*N; + // ++N; + // } while (ok == false); + + // return avgTotal / N3_sum; } void MultiPeak::calcCellParameters(spatial_cell::SpatialCell* cell,creal& t) { @@ -225,12 +245,12 @@ namespace projects { bgField.initialize(this->Bx, this->By, this->Bz); - + setBackgroundField(bgField, BgBGrid); - + if(!P::isRestart) { auto localSize = perBGrid.getLocalSize().data(); - + #pragma omp parallel for collapse(3) for (int x = 0; x < localSize[0]; ++x) { for (int y = 0; y < localSize[1]; ++y) { @@ -240,13 +260,13 @@ namespace projects { const int64_t cellid = perBGrid.GlobalIDForCoords(x, y, z); std::default_random_engine rndState; setRandomSeed(cellid,rndState); - + if (this->lambda != 0.0) { cell->at(fsgrids::bfield::PERBX) = this->dBx*cos(2.0 * M_PI * xyz[0] / this->lambda); cell->at(fsgrids::bfield::PERBY) = this->dBy*sin(2.0 * M_PI * xyz[0] / this->lambda); cell->at(fsgrids::bfield::PERBZ) = this->dBz*cos(2.0 * M_PI * xyz[0] / this->lambda); } - + cell->at(fsgrids::bfield::PERBX) += this->magXPertAbsAmp * (0.5 - getRandomNumber(rndState)); cell->at(fsgrids::bfield::PERBY) += this->magYPertAbsAmp * (0.5 - getRandomNumber(rndState)); cell->at(fsgrids::bfield::PERBZ) += this->magZPertAbsAmp * (0.5 - getRandomNumber(rndState)); @@ -255,7 +275,7 @@ namespace projects { } } } - + std::vector > MultiPeak::getV0( creal x, creal y, @@ -270,5 +290,5 @@ namespace projects { } return centerPoints; } - + }// namespace projects From 0c95c9752b46979e074725dcfcbd3464e5956d2b Mon Sep 17 00:00:00 2001 From: Markus Battarbee Date: Fri, 1 Sep 2023 10:16:44 +0300 Subject: [PATCH 08/11] Fixed inflow Bz in samples/Magnetosphere3D --- samples/Magnetosphere3D/sw1.dat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/Magnetosphere3D/sw1.dat b/samples/Magnetosphere3D/sw1.dat index a8a70a464..899143c39 100644 --- a/samples/Magnetosphere3D/sw1.dat +++ b/samples/Magnetosphere3D/sw1.dat @@ -1 +1 @@ -0.0 1.0e6 0.5e6 -7.5e5 0.0 0.0 0.0 0.0 -5.0e-9 +0.0 1.0e6 0.5e6 -7.5e5 0.0 0.0 0.0 0.0 0.0 From d9bc02ce5cf78c4c7cea6ef19460a6b103f57acc Mon Sep 17 00:00:00 2001 From: Markus Battarbee Date: Mon, 4 Dec 2023 11:30:49 +0200 Subject: [PATCH 09/11] Delete testpackage/tests/Ionosphere_small/Fluctuations.cfg --- .../tests/Ionosphere_small/Fluctuations.cfg | 118 ------------------ 1 file changed, 118 deletions(-) delete mode 100644 testpackage/tests/Ionosphere_small/Fluctuations.cfg diff --git a/testpackage/tests/Ionosphere_small/Fluctuations.cfg b/testpackage/tests/Ionosphere_small/Fluctuations.cfg deleted file mode 100644 index fbafad032..000000000 --- a/testpackage/tests/Ionosphere_small/Fluctuations.cfg +++ /dev/null @@ -1,118 +0,0 @@ -project = Fluctuations -ParticlePopulations = proton -ParticlePopulations = electron -propagate_field = 1 -propagate_vlasov_acceleration = 1 -propagate_vlasov_translation = 1 -dynamic_timestep = 1 - -[proton_properties] -mass = 1 -mass_units = PROTON -charge = 1 - -[electron_properties] -mass = 10 -mass_units = ELECTRON -charge = -1 -test_population = 1 - -[io] -diagnostic_write_interval = 1 - -system_write_t_interval = 0.005 -system_write_file_name = bulk -system_write_distribution_stride = 0 -system_write_distribution_xline_stride = 0 -system_write_distribution_yline_stride = 0 -system_write_distribution_zline_stride = 0 - -#system_write_t_interval = 10 -#system_write_file_name = distributions -#system_write_distribution_stride = 1 -#system_write_distribution_xline_stride = 0 -#system_write_distribution_yline_stride = 0 -#system_write_distribution_zline_stride = 0 - -[gridbuilder] -x_length = 1000 -x_min = -150e6 -x_max = 150e6 -y_length = 1 -y_min = -1.5e5 -y_max = 1.5e5 -z_length = 1 -z_min = -1.5e5 -z_max = 1.5e5 -dt = 2.05e-05 - -[proton_vspace] -vx_min = -3.96e6 -vx_max = +3.96e6 -vy_min = -3.96e6 -vy_max = +3.96e6 -vz_min = -3.96e6 -vz_max = +3.96e6 -vx_length = 66 # 30 km/s resolution -vy_length = 66 -vz_length = 66 -[proton_sparse] -minValue = 1.0e-16 -#minValue = 0e-14 - -[electron_vspace] -vx_min = -4.2e7 #-1.26e8 #-1.008e8 -vx_max = +4.2e7 #+1.26e8 #+1.008e8 -vy_min = -4.2e7 #-1.26e8 #-1.008e8 -vy_max = +4.2e7 #+1.26e8 #+1.008e8 -vz_min = -4.2e7 #-1.26e8 #-1.008e8 -vz_max = +4.2e7 #+1.26e8 #+1.008e8 -# velocity cell size is 30 km/s times 14 (square root of mass ratio) / 2 (temperature ratio 1/4) -vx_length = 100 -vy_length = 100 -vz_length = 100 -[electron_sparse] -minValue = 1.e-21 - -[boundaries] -periodic_x = yes -periodic_y = yes -periodic_z = yes - -[variables] -output = populations_vg_rho -output = fg_b -output = vg_eje -output = fg_e -diagnostic = populations_vg_blocks - -[loadBalance] -algorithm = RCB -tolerance = 1.05 -rebalanceInterval = 50 - -[Fluctuations] -BX0 = 1.0e-9 -BY0 = 0.0 -BZ0 = 0.0 -magXPertAbsAmp = 0.0 -magYPertAbsAmp = 0.0 -magZPertAbsAmp = 0.0 - -[proton_Fluctuations] -rho = 4.0e5 -Temperature = 1.0e7 -densityPertRelAmp = 0.0 -velocityPertAbsAmp = 1000.0 -maxwCutoff = 1.0e-16 -nSpaceSamples = 1 -nVelocitySamples = 1 - -[electron_Fluctuations] -rho = 4e5 -Temperature = 2.5e6 -densityPertRelAmp = 0.0 -velocityPertAbsAmp = 1000.0 -maxwCutoff = 1.0e-21 -nSpaceSamples = 1 -nVelocitySamples = 1 From 2c8bb5367d0588e63b442d92eccac74c6b050774 Mon Sep 17 00:00:00 2001 From: Markus Battarbee Date: Mon, 4 Dec 2023 11:31:59 +0200 Subject: [PATCH 10/11] Update MultiPeak.cpp --- projects/MultiPeak/MultiPeak.cpp | 61 -------------------------------- 1 file changed, 61 deletions(-) diff --git a/projects/MultiPeak/MultiPeak.cpp b/projects/MultiPeak/MultiPeak.cpp index 8159ba2c3..99261b8f2 100644 --- a/projects/MultiPeak/MultiPeak.cpp +++ b/projects/MultiPeak/MultiPeak.cpp @@ -147,13 +147,6 @@ namespace projects { Real MultiPeak::calcPhaseSpaceDensity(creal& x, creal& y, creal& z, creal& dx, creal& dy, creal& dz, creal& vx, creal& vy, creal& vz, creal& dvx, creal& dvy, creal& dvz, const uint popID) const { - // Iterative sampling of the distribution function. Keep track of the - // accumulated volume average over the iterations. When the next - // iteration improves the average by less than 1%, return the value. - // Real avgTotal = 0.0; - // bool ok = false; - // uint N = nVelocitySamples; // Start by using nVelocitySamples - // int N3_sum = 0; // Sum of sampling points used so far const MultiPeakSpeciesParameters& sP = speciesParams[popID]; @@ -174,60 +167,6 @@ namespace projects { } return rhoFactor * getDistribValue(vx+0.5*dvx,vy+0.5*dvy,vz+0.5*dvz,dvx,dvy,dvz,popID); - - // #warning SpatialCell::getVelocityBlockMinValue() or dynamic algorithm not available without spatial cell data - // const Real avgLimit = 0.01*getObjectWrapper().particleSpecies[popID].sparseMinValue; - // do { - // Real avg = 0.0; // Volume average obtained during this sampling - // creal DVX = dvx / N; - // creal DVY = dvy / N; - // creal DVZ = dvz / N; - - // Real rhoFactor = 1.0; - // switch (densityModel) { - // case Uniform: - // rhoFactor = 1.0; - // break; - // case TestCase: - // rhoFactor = 1.0; - // if ((x >= 3.9e5 && x <= 6.1e5) && (y >= 3.9e5 && y <= 6.1e5)) { - // rhoFactor = 1.5; - // } - // break; - // default: - // rhoFactor = 1.0; - // break; - // } - - // // Sample the distribution using N*N*N points - // for (uint vi=0; vi::min(),avg * static_cast(1e-6)); - // Real avgAccum = avgTotal / (avg + N3_sum); - // Real avgCurrent = avg / (N*N*N); - // if (fabs(avgCurrent-avgAccum)/(avgAccum+eps) < 0.01) ok = true; - // else if (avg < avgLimit) ok = true; - // else if (N > 10) { - // ok = true; - // } - - // avgTotal += avg; - // N3_sum += N*N*N; - // ++N; - // } while (ok == false); - - // return avgTotal / N3_sum; } void MultiPeak::calcCellParameters(spatial_cell::SpatialCell* cell,creal& t) { From 0a949796e8d2bcfbe48a84e5df50dee2ebe7ea4a Mon Sep 17 00:00:00 2001 From: Urs Ganse Date: Mon, 4 Dec 2023 11:13:44 +0200 Subject: [PATCH 11/11] Fix CI yaml file for multiple runners --- .github/workflows/github-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-ci.yml b/.github/workflows/github-ci.yml index ff54c5637..b07cab13f 100644 --- a/.github/workflows/github-ci.yml +++ b/.github/workflows/github-ci.yml @@ -117,7 +117,7 @@ jobs: - name: Checkout source uses: actions/checkout@v3 - name: Make clean - run: make clean + run: VLASIATOR_ARCH=carrington_gcc_openmpi make clean - uses: ursg/gcc-problem-matcher@master - name: Compile vlasiator (Testpackage build) run: | @@ -147,7 +147,7 @@ jobs: uses: actions/checkout@v3 - uses: ursg/gcc-problem-matcher@master - name: Make clean - run: make clean + run: VLASIATOR_ARCH=carrington_gcc_openmpi make clean - name: Compile tools run: | export VLASIATOR_ARCH=carrington_gcc_openmpi