-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e61b34c
commit 6325940
Showing
7 changed files
with
175 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
|
||
|
||
set(CPPDICT_SRCDIR ${CMAKE_CURRENT_SOURCE_DIR}/subprojects/cppdict) | ||
set(CPPDICT_VERSION master) | ||
phare_github_get_or_update(cppdict ${CPPDICT_SRCDIR} LaboratoryOfPlasmaPhysics/cppdict ${CPPDICT_VERSION}) | ||
if(NOT DEFINED PHARE_CPPDICT_VERION) | ||
SET(PHARE_CPPDICT_VERION "superserial") | ||
endif() | ||
|
||
set(CPPDICT_SRCDIR ${CMAKE_CURRENT_SOURCE_DIR}/subprojects/cppdict) | ||
# phare_github_get_or_update(cppdict ${CPPDICT_SRCDIR} LaboratoryOfPlasmaPhysics/cppdict ${PHARE_CPPDICT_VERION}) | ||
phare_github_get_or_update(cppdict ${CPPDICT_SRCDIR} PhilipDeegan/cppdict ${PHARE_CPPDICT_VERION}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
# https://github.com/LLNL/SAMRAI/releases/tag/v-4-3-0 | ||
SET(PHARE_SAMRAI_VERSION "v4.3.0") | ||
|
||
# https://github.com/pybind/pybind11/releases/tag/v2.13.6 | ||
SET(PHARE_PYBIND11_VERSION "v2.13.6") | ||
|
||
# https://github.com/BlueBrain/HighFive/releases/tag/v2.10.0 | ||
SET(PHARE_HIGHFIVE_VERSION "v2.10.0") | ||
|
||
# https://github.com/LaboratoryOfPlasmaPhysics/cppdict/releases/tag/v1.0.0 | ||
SET(PHARE_CPPDICT_VERION "v1.0.0") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
|
||
#include "phare_core.hpp" | ||
|
||
#include "core/numerics/ion_updater/ion_updater.hpp" | ||
#include "tests/core/data/vecfield/test_vecfield_fixtures.hpp" | ||
#include "tests/core/data/tensorfield/test_tensorfield_fixtures.hpp" | ||
#include "tests/initializer/init_functions.hpp" | ||
|
||
using namespace PHARE::initializer::test_fn::func_1d; | ||
using InitFunctionT = PHARE::initializer::InitFunction<1>; | ||
|
||
PHARE::initializer::PHAREDict createDict() | ||
{ | ||
PHARE::initializer::PHAREDict dict; | ||
dict["ions"]["nbrPopulations"] = std::size_t{2}; | ||
dict["ions"]["pop0"]["name"] = std::string{"protons"}; | ||
dict["ions"]["pop0"]["mass"] = 1.; | ||
dict["ions"]["pop0"]["particle_initializer"]["name"] | ||
= std::string{"MaxwellianParticleInitializer"}; | ||
dict["ions"]["pop0"]["particle_initializer"]["density"] = static_cast<InitFunctionT>(density); | ||
|
||
dict["ions"]["pop0"]["particle_initializer"]["bulk_velocity_x"] | ||
= static_cast<InitFunctionT>(vx); | ||
|
||
dict["ions"]["pop0"]["particle_initializer"]["bulk_velocity_y"] | ||
= static_cast<InitFunctionT>(vy); | ||
|
||
dict["ions"]["pop0"]["particle_initializer"]["bulk_velocity_z"] | ||
= static_cast<InitFunctionT>(vz); | ||
|
||
|
||
dict["ions"]["pop0"]["particle_initializer"]["thermal_velocity_x"] | ||
= static_cast<InitFunctionT>(vthx); | ||
|
||
dict["ions"]["pop0"]["particle_initializer"]["thermal_velocity_y"] | ||
= static_cast<InitFunctionT>(vthy); | ||
|
||
dict["ions"]["pop0"]["particle_initializer"]["thermal_velocity_z"] | ||
= static_cast<InitFunctionT>(vthz); | ||
|
||
|
||
dict["ions"]["pop0"]["particle_initializer"]["nbrPartPerCell"] = int{100}; | ||
dict["ions"]["pop0"]["particle_initializer"]["charge"] = -1.; | ||
dict["ions"]["pop0"]["particle_initializer"]["basis"] = std::string{"Cartesian"}; | ||
|
||
dict["ions"]["pop1"]["name"] = std::string{"alpha"}; | ||
dict["ions"]["pop1"]["mass"] = 1.; | ||
dict["ions"]["pop1"]["particle_initializer"]["name"] | ||
= std::string{"MaxwellianParticleInitializer"}; | ||
dict["ions"]["pop1"]["particle_initializer"]["density"] = static_cast<InitFunctionT>(density); | ||
|
||
dict["ions"]["pop1"]["particle_initializer"]["bulk_velocity_x"] | ||
= static_cast<InitFunctionT>(vx); | ||
|
||
dict["ions"]["pop1"]["particle_initializer"]["bulk_velocity_y"] | ||
= static_cast<InitFunctionT>(vy); | ||
|
||
dict["ions"]["pop1"]["particle_initializer"]["bulk_velocity_z"] | ||
= static_cast<InitFunctionT>(vz); | ||
|
||
|
||
dict["ions"]["pop1"]["particle_initializer"]["thermal_velocity_x"] | ||
= static_cast<InitFunctionT>(vthx); | ||
|
||
dict["ions"]["pop1"]["particle_initializer"]["thermal_velocity_y"] | ||
= static_cast<InitFunctionT>(vthy); | ||
|
||
dict["ions"]["pop1"]["particle_initializer"]["thermal_velocity_z"] | ||
= static_cast<InitFunctionT>(vthz); | ||
|
||
|
||
dict["ions"]["pop1"]["particle_initializer"]["nbrPartPerCell"] = int{100}; | ||
dict["ions"]["pop1"]["particle_initializer"]["charge"] = -1.; | ||
dict["ions"]["pop1"]["particle_initializer"]["basis"] = std::string{"Cartesian"}; | ||
|
||
dict["electromag"]["name"] = std::string{"EM"}; | ||
dict["electromag"]["electric"]["name"] = std::string{"E"}; | ||
dict["electromag"]["magnetic"]["name"] = std::string{"B"}; | ||
|
||
dict["electromag"]["magnetic"]["initializer"]["x_component"] = static_cast<InitFunctionT>(bx); | ||
dict["electromag"]["magnetic"]["initializer"]["y_component"] = static_cast<InitFunctionT>(by); | ||
dict["electromag"]["magnetic"]["initializer"]["z_component"] = static_cast<InitFunctionT>(bz); | ||
|
||
dict["electrons"]["pressure_closure"]["name"] = std::string{"isothermal"}; | ||
dict["electrons"]["pressure_closure"]["Te"] = 0.12; | ||
|
||
return dict; | ||
} | ||
|
||
|
||
|
||
int main(int argc, char** argv) | ||
{ | ||
std::string const filename = "pharedict.dat"; | ||
PHARE::initializer::dump_phare_dict(createDict(), filename); | ||
// auto const dict = PHARE::initializer::load_phare_dict(filename); | ||
|
||
auto const dict = PHARE::initializer::PHAREDictHandler::load(filename); | ||
|
||
int r = 0; | ||
|
||
r += dict["ions"]["nbrPopulations"].to<std::size_t>() != 2; | ||
|
||
r += dict["ions"]["pop0"]["particle_initializer"]["nbrPartPerCell"].to<int>() != 100; | ||
r += dict["ions"]["pop1"]["particle_initializer"]["nbrPartPerCell"].to<int>() != 100; | ||
|
||
r += dict["electromag"]["magnetic"]["initializer"]["x_component"].isValue(); // NOT SERIALIZABLE | ||
|
||
r += dict["electrons"]["pressure_closure"]["Te"].to<double>() != 0.12; | ||
|
||
return r; | ||
} |