Minor changes in debug output, added information

to error messages
This commit is contained in:
2024-03-15 15:49:40 +01:00
parent 55c51f8434
commit 2fccef7132
19 changed files with 41 additions and 32 deletions
+1 -1
View File
@@ -85,7 +85,7 @@ EnergyBinning buildEnergyBinning(json_t* object) {
ASSERT_POSITIVE(&min_energy, "Min Energy must be positive");
double max_energy =
json_read_energy(json_object_by_path(object, {"MaxEnergy"}), "eV");
ASSERT_POSITIVE(&max_energy, "Min Energy must be positive");
ASSERT_POSITIVE(&max_energy, "Max Energy must be positive");
DEBUG_LEVEL_3("with number of bins: " + std::to_string(number_of_bins));
DEBUG_LEVEL_3("with min energy: " + std::to_string(min_energy));
+1 -1
View File
@@ -29,7 +29,7 @@ std::shared_ptr<DriftVelocity> buildDriftVelocityIncludingRedirection(
std::stringstream cpath;
if (parameter.jsonObjectFromBase(
json_path_append(path_to_drift_velocity, {"CreateSameAs"}))) {
DEBUG_LEVEL_2("Creating Drift velocity: CreateSameAs.");
DEBUG_LEVEL_2("Creating drift velocity: CreateSameAs.");
json_path path_to_same = json_path_get(parameter.jsonObjectFromBase(
json_path_append(path_to_drift_velocity, {"CreateSameAs"})));
std::stringstream path;
+2 -2
View File
@@ -15,7 +15,7 @@ std::shared_ptr<ElectricField> electricField(json_t* object) {
background = buildVectorField(
json_object_by_path(object, {"Background", "VectorField"}));
} else {
ERROR("Can not find background for electric field");
ERROR("Can not find background for electric field.");
}
if (json_object_by_path(object, {"Dynamic"})) {
@@ -23,7 +23,7 @@ std::shared_ptr<ElectricField> electricField(json_t* object) {
dynamic = buildVectorField(
json_object_by_path(object, {"Dynamic", "VectorField"}));
} else {
ERROR("Can not find dynamic for electric field");
ERROR("Can not find dynamic for electric field.");
}
return std::shared_ptr<ElectricField>(new ElectricField(background, dynamic));
@@ -29,7 +29,7 @@ std::shared_ptr<EnergyDistributionFunction> buildEnergyDistributionFunction(
return std::shared_ptr<EnergyDistributionFunction>(
new Constant(constant_eV));
}
ERROR("This Energy Distribution is not implemented");
ERROR("This Energy Distribution is not implemented.");
return nullptr;
}
+2 -2
View File
@@ -37,7 +37,7 @@ std::shared_ptr<Injector> buildInjector(
}
// EventPositionDistribution
DEBUG_LEVEL_2("Creating event distribution");
DEBUG_LEVEL_2("Creating event distribution.");
std::shared_ptr<ScalarField> field = buildScalarField(json_object_by_path(
object, {"EventPositionDistribution", "ScalarField"}));
@@ -76,7 +76,7 @@ std::shared_ptr<Injector> buildInjector(
position_limit_phi, position_limit_z));
// MotherDriftVelocity
DEBUG_LEVEL_2("Creating mother drift velocity");
DEBUG_LEVEL_2("Creating mother drift velocity.");
std::shared_ptr<DriftVelocity> drift_velocity = buildDriftVelocity(
parameter, json_path_append(path_to_injector, {"MotherDriftVelocity"}));
+7 -6
View File
@@ -43,7 +43,7 @@ void addInteractions(
std::string target_name =
json_string(json_object_by_path(value, {"Target"}));
DEBUG_LEVEL_3("with target" + target_name);
DEBUG_LEVEL_3("with target " + target_name);
std::shared_ptr<species::Specie> target =
findTarget(target_name, tracked_species, background_species);
@@ -180,7 +180,7 @@ void addInteractions(
ionization_energy_distribution, scattering_angle_distribution,
ionization_energy_eV));
} else {
ERROR("This ionization model is not implemented.");
ERROR("This ionization model is not implemented: " + ionization_model);
}
} else if (type == "Excitation") {
DEBUG_LEVEL_2("Adding interactions: Excitation");
@@ -228,6 +228,7 @@ void addInteractions(
specie->addInteraction(std::shared_ptr<interaction::Interaction>(
new interaction::ChargeExchange(cross_section, target)));
} else if (type == "Recombination") {
DEBUG_LEVEL_2("Adding interactions: Recombination");
std::string target_name =
json_string(json_object_by_path(value, {"Target"}));
std::shared_ptr<species::TrackedSpecie> target =
@@ -305,7 +306,7 @@ std::function<double(double)> buildTotalCrossSection(json_t* object) {
json_object_by_path(object, {"ExcitationFunction", "ExcitationState"}));
return buildExcitationCrossSection(excitation_state);
} else {
ERROR("This type of cross section is not implemented");
ERROR("This type of cross section is not implemented.");
return nullptr;
}
}
@@ -443,7 +444,7 @@ std::function<double(double)> buildExcitationCrossSection(
} else {
ERROR(
"This type of cross section ExcitationState is not implemented in "
"buildExcitationCrossSection.");
"buildExcitationCrossSection: " + excitation_state);
return nullptr;
}
}
@@ -513,7 +514,7 @@ std::shared_ptr<species::Specie> findTarget(
} else if (tracked_species.count(target_name)) {
return tracked_species.at(target_name);
} else {
ERROR("The specified target does not exist.");
ERROR("The specified target " + target_name + " does not exist.");
return nullptr;
}
};
@@ -525,7 +526,7 @@ std::shared_ptr<species::TrackedSpecie> findTracked(
if (tracked_species.count(target_name)) {
return tracked_species.at(target_name);
} else {
ERROR("The specified target does not exist.");
ERROR("The specified target " + target_name + " does not exist.");
return nullptr;
}
}
+1 -1
View File
@@ -25,7 +25,7 @@ std::shared_ptr<DeletionLogger> buildDeletionLogger(json_t* object) {
} else if (type_alias == "cluster_formation") {
used_types.push_back(DeletionType::cluster_formation);
} else {
ERROR("This deletion type is not known");
ERROR("This deletion type " + type_alias + " is not known.");
}
}
} else {
+1 -1
View File
@@ -27,7 +27,7 @@ double buildMass(json_t* object) {
if (SpeciesAlias::isAlias(name)) {
return SpeciesMasses::mass(SpeciesAlias::alias(name));
} else {
ERROR("This specie type is not known.");
ERROR("The specie type " + name + " is not known.");
return 0.;
}
} else if (json_object_by_path(object, {"value"})) {
+1 -1
View File
@@ -19,7 +19,7 @@ std::shared_ptr<Reflector> buildReflector(Parameter& parameter,
DEBUG_LEVEL_2("Create reflector: NoReflector");
return std::shared_ptr<Reflector>(new NoReflector());
} else {
ERROR("This reflector is not implemented");
ERROR("This reflector is not implemented.");
return nullptr;
}
}
+1 -1
View File
@@ -12,7 +12,7 @@ std::shared_ptr<ScalarField> buildScalarField(json_t* object) {
json_object_by_path(object, {"ScalarFieldFunctionInZ", "zFunction"}));
return std::shared_ptr<ScalarField>(new ScalarFieldFunctionInZ(z_function));
} else {
ERROR("This scalar field is not implemented");
ERROR("This scalar field is not implemented.");
return nullptr;
}
return nullptr;
@@ -47,7 +47,8 @@ std::shared_ptr<SimulationOutput> buildSimulationOutput(
output->addDensityFieldOutput(task);
}
} else {
ERROR("This species can not be outputted.");
ERROR("DensityFields: Species to be outputted have to be "
"given as an array or using the keyword \"all\".");
}
}
}
@@ -84,7 +85,8 @@ std::shared_ptr<SimulationOutput> buildSimulationOutput(
output->addCurrentBorderOutput(task);
}
} else {
ERROR("This species can not be outputted.");
ERROR("CurrentBorders: Species to be outputted have to be "
"given as an array or using the keyword \"all\".");
}
}
}
@@ -124,7 +126,8 @@ std::shared_ptr<SimulationOutput> buildSimulationOutput(
output->addDeletionLoggerOutput(task);
}
} else {
ERROR("This species can not be outputted.");
ERROR("DeletionLogger: Species to be outputted have to be "
"given as an array or using the keyword \"all\".");
}
}
}
@@ -140,7 +143,7 @@ std::shared_ptr<SimulationOutput> buildSimulationOutput(
intervall = 1;
}
ASSERT_POSITIVE(&intervall,
"The intervall for the potential must be positive");
"The intervall for the poisson solver output must be positive");
bool overwrite_last = json_bool(
json_object_by_path(object, {"PoissonSolver", "OverwriteLast"}));
+1 -1
View File
@@ -211,7 +211,7 @@ void SpeciesBuilder::fillMass() {
}
void SpeciesBuilder::fillCharge() {
DEBUG_LEVEL_2("Fill charges");
DEBUG_LEVEL_2("Fill charges.");
for (auto& b : background_species_info) {
b.second.charge_C = SpeciesCharges::charge(b.second.type);
}