Removed drawing infrastructure
This commit is contained in:
@@ -113,60 +113,6 @@ void Injector::setWeights(const double physical_number, const int numerical_numb
|
||||
#endif
|
||||
}
|
||||
|
||||
void Injector::drawNewParticleFromDensityField(std::mt19937* engine,
|
||||
std::shared_ptr<species::TrackedSpecie> specie,
|
||||
std::vector<particle::Particle>& queue,
|
||||
std::shared_ptr<MagneticField> magnetic_field,
|
||||
const double weight_factor) {
|
||||
blitz::TinyVector<int, 5> index = specie->randomIndex()->index();
|
||||
|
||||
const double num_part_in_bin = specie->densityForDrawing()->particleNumber(index);
|
||||
|
||||
if(num_part_in_bin == 0) {
|
||||
#if defined(debug_level2) || defined(debug_level3)
|
||||
std::stringstream out;
|
||||
out << "index: "<< index <<" has no particles";
|
||||
// DEBUG_LEVEL_2(out.str());
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
// draw the position
|
||||
CylinderCoordinate position =
|
||||
specie->positionDistributionFromDensity()->drawPosition(engine,
|
||||
index(0), index(1), index(2));
|
||||
// draw the velocity
|
||||
CartesianVector velocity(blitz::TinyVector<double, 3>(0,0,0));
|
||||
|
||||
// in case the magnetic field is 0 at the current position draw the velocity
|
||||
// with respect to the z-axis otherwise use the magnetic field
|
||||
if(kinematic::norm(magnetic_field->value(position).
|
||||
cartesianEntries(position)) == 0) {
|
||||
velocity = specie->velocityDistributionFromDensityField()->
|
||||
drawVelocity(index, engine);
|
||||
} else {
|
||||
velocity = specie->velocityDistributionFromDensityField()->
|
||||
drawVelocity(index, engine, position, magnetic_field);
|
||||
}
|
||||
|
||||
#if defined(debug_level2) || defined(debug_level3)
|
||||
std::stringstream out;
|
||||
out << specie->name() << ":\n";
|
||||
out << "\ndrawn index: " << index;
|
||||
out << "\nnumber of particles (" << specie->name() << ") at index: " << num_part_in_bin;
|
||||
out << "\ndrawn position: " << position.cylinderEntries();
|
||||
out << "\ndrawn velocity: " << velocity.cartesianEntries();
|
||||
if(num_part_in_bin > 0)
|
||||
DEBUG_LEVEL_2(out.str());
|
||||
#endif
|
||||
|
||||
particle::Particle drawn_particle(specie, position,
|
||||
velocity, weight_factor*num_part_in_bin);
|
||||
|
||||
queue.push_back(drawn_particle);
|
||||
|
||||
}
|
||||
|
||||
double Injector::timePassed() const {
|
||||
return 1 / activity_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user