aboutsummaryrefslogtreecommitdiff
path: root/Source/Utils/WarpXAlgorithmSelection.cpp
diff options
context:
space:
mode:
authorGravatar Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> 2021-05-25 01:27:37 +0200
committerGravatar GitHub <noreply@github.com> 2021-05-24 16:27:37 -0700
commitc18569f0a67bdf5f33c8b0ecab147dfb7a52bff5 (patch)
tree653935717161876b48aec64fa070fabba110f9d4 /Source/Utils/WarpXAlgorithmSelection.cpp
parentbaaf307780c4caecfb98f88faec878a7afa9d7d9 (diff)
downloadWarpX-c18569f0a67bdf5f33c8b0ecab147dfb7a52bff5.tar.gz
WarpX-c18569f0a67bdf5f33c8b0ecab147dfb7a52bff5.tar.zst
WarpX-c18569f0a67bdf5f33c8b0ecab147dfb7a52bff5.zip
Add generic field reduction reduced diag (#1944)
* Add generic field reduction reduced diag * Make ComputeFieldReduction public * Apply suggestions from code review * Apply suggestions from Luca and Edoardo * Fix syntax error * Fix typo in example input file Co-authored-by: Luca Fedeli <luca.fedeli@for.unipi.it>
Diffstat (limited to 'Source/Utils/WarpXAlgorithmSelection.cpp')
-rw-r--r--Source/Utils/WarpXAlgorithmSelection.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/Utils/WarpXAlgorithmSelection.cpp b/Source/Utils/WarpXAlgorithmSelection.cpp
index cdf896eb2..63423763d 100644
--- a/Source/Utils/WarpXAlgorithmSelection.cpp
+++ b/Source/Utils/WarpXAlgorithmSelection.cpp
@@ -93,6 +93,12 @@ const std::map<std::string, int> ParticleBCType_algo_to_int = {
{"default", ParticleBoundaryType::Absorbing}
};
+const std::map<std::string, int> ReductionType_algo_to_int = {
+ {"maximum", ReductionType::Maximum},
+ {"minimum", ReductionType::Minimum},
+ {"integral", ReductionType::Sum}
+};
+
int
GetAlgorithmInteger( amrex::ParmParse& pp, const char* pp_search_key ){
@@ -124,6 +130,8 @@ GetAlgorithmInteger( amrex::ParmParse& pp, const char* pp_search_key ){
algo_to_int = MaxwellSolver_medium_algo_to_int;
} else if (0 == std::strcmp(pp_search_key, "macroscopic_sigma_method")) {
algo_to_int = MacroscopicSolver_algo_to_int;
+ } else if (0 == std::strcmp(pp_search_key, "reduction_type")) {
+ algo_to_int = ReductionType_algo_to_int;
} else {
std::string pp_search_string = pp_search_key;
amrex::Abort("Unknown algorithm type: " + pp_search_string);