Removed comments and added examples
This commit is contained in:
@@ -74,14 +74,12 @@ blitz::Array<double, 2> Hdf5Reader::readD2Double(std::string path) {
|
||||
blitz::Array<double, 1> Hdf5Reader::readD1Double(std::string path) {
|
||||
hid_t file = H5Fopen(absolute_filename_.c_str(), H5F_ACC_RDONLY, H5P_DEFAULT);
|
||||
|
||||
// H5Eset_auto(H5E_DEFAULT, NULL, NULL);
|
||||
hid_t dataset = H5Dopen2(file, path.c_str(), H5P_DEFAULT);
|
||||
hid_t dataspace = H5Dget_space(dataset);
|
||||
if (dataset < 0) {
|
||||
ERROR("The given dataset could not be opened");
|
||||
}
|
||||
// turn error report back onby hdf5 because of check H5Dopen2
|
||||
// H5Eset_auto(H5E_DEFAULT, H5E_DEFAULT, H5E_DEFAULT);
|
||||
|
||||
const int ndims = H5Sget_simple_extent_ndims(dataspace);
|
||||
hsize_t dims[ndims];
|
||||
|
||||
@@ -41,12 +41,10 @@ std::function<double(double)> function1D(json_t* object) {
|
||||
std::string x_values_key = json_string(
|
||||
json_object_by_path(object, {"PiecewiseLinearFromFile", "xValuesKey"}));
|
||||
blitz::Array<double, 1> x_values_array = reader.readD1Double(x_values_key);
|
||||
// DEBUG_LEVEL_3("with x values: " + x_values_array);
|
||||
|
||||
std::string y_values_key = json_string(
|
||||
json_object_by_path(object, {"PiecewiseLinearFromFile", "yValuesKey"}));
|
||||
blitz::Array<double, 1> y_values_array = reader.readD1Double(y_values_key);
|
||||
// DEBUG_LEVEL_3("with y values: " + y_values_array);
|
||||
|
||||
std::vector<double> x_values(x_values_array.begin(), x_values_array.end());
|
||||
std::vector<double> y_values(y_values_array.begin(), y_values_array.end());
|
||||
|
||||
@@ -13,7 +13,6 @@ InteractionOutput Recombination::performInteraction(
|
||||
RandomNumbers* generator) {
|
||||
DEBUG_LEVEL_3("Perform recombination.");
|
||||
|
||||
// energy dependent deletions in the future
|
||||
const double energy_eV = 0.;
|
||||
recombination_target_->dynamicDensityField()->logDeletion(particle.position(),
|
||||
energy_eV);
|
||||
|
||||
@@ -135,23 +135,6 @@ void BorisMover::movementStep(
|
||||
u_plus_z + (q * electric_field(2) * maximal_time_step_s_) / (2. * m);
|
||||
const blitz::TinyVector<double, 3> u_new(u_new_x, u_new_y, u_new_z);
|
||||
|
||||
/*
|
||||
Might be slower, but essentially the same code
|
||||
const blitz::TinyVector<double, 3> u_minus =
|
||||
v + (q * electric_field * maximal_time_step_s_) / (2. * m);
|
||||
const double gamma = kinematic::relativisticGamma(u_minus);;
|
||||
const blitz::TinyVector<double, 3> temp_1 =
|
||||
(q * magnetic_field * maximal_time_step_s_) / (2. * m * gamma);
|
||||
const blitz::TinyVector<double, 3> u_prime =
|
||||
u_minus + (blitz::cross(u_minus, temp_1));
|
||||
const blitz::TinyVector<double, 3> temp_2 =
|
||||
(2. * temp_1) / (1. + (blitz::dot(temp_1, temp_1)));
|
||||
const blitz::TinyVector<double, 3> u_plus =
|
||||
u_minus + (blitz::cross(u_prime, temp_2));
|
||||
const blitz::TinyVector<double, 3> u_new =
|
||||
u_plus + (q * electric_field * maximal_time_step_s_) / (2. * m);
|
||||
*/
|
||||
|
||||
particle->velocity(CartesianVector(u_new));
|
||||
|
||||
const CartesianCoordinate distance(u_new * maximal_time_step_s_);
|
||||
@@ -196,8 +179,6 @@ void DriftMover::move(particle::Particle* particle,
|
||||
const blitz::TinyVector<double, 3> B =
|
||||
magnetic_field->value(old_position).cartesianEntries(old_position);
|
||||
const double B_norm = kinematic::norm(B);
|
||||
// Todo: add calculation of divB here
|
||||
// use Kassiopeia paper for reference
|
||||
|
||||
const blitz::TinyVector<double, 3> v_parallel =
|
||||
kinematic::parallelVector(old_velocity.cartesianEntries(), B);
|
||||
|
||||
@@ -3,20 +3,6 @@
|
||||
#include "simulation/species.h"
|
||||
|
||||
namespace particle {
|
||||
/*
|
||||
Particle::Particle(std::shared_ptr<species::TrackedSpecie> specie,
|
||||
Coordinate* position,
|
||||
Vector* velocity)
|
||||
: specie_(specie),
|
||||
position_(CylinderCoordinate(*position)),
|
||||
velocity_(CartesianVector(*velocity, *position)),
|
||||
id_(this->last_id_),
|
||||
time_alive_s_(0.),
|
||||
time_in_bin_s_(0.),
|
||||
interaction_counter_(0) {
|
||||
last_id_++;
|
||||
}
|
||||
*/
|
||||
|
||||
Particle::Particle(std::shared_ptr<species::TrackedSpecie> specie,
|
||||
const Coordinate& position,
|
||||
|
||||
@@ -228,7 +228,6 @@ void Simulation::processUntilTermination(
|
||||
std::to_string(particle.kineticEnergy_eV()));
|
||||
std::stringstream output_ss;
|
||||
output_ss << "Position (cyl): " << particle.position().cylinderEntries();
|
||||
// output_ss << "\n (cart): " << particle.position().cartesianEntries();
|
||||
DEBUG_LEVEL_3(output_ss.str());
|
||||
|
||||
SimulationTimer::eventStartPoint(std::string("Interaction"));
|
||||
|
||||
Reference in New Issue
Block a user