Ejemplo n.º 1
0
void SimulationConfig::populate(INIReader &reader) {
  accelerationScheme_ = reader.Get("simulation", "accel_scheme", "trap");
  if (accelerationScheme_ != "exponential" && accelerationScheme_ != "trap"
      && accelerationScheme_ != "instantaneous") {
    try {
      throw "Invalid value for acceleration scheme!";
    } catch (const char* e) {
      std::cout << e << std::endl;
      std::terminate();
    }
  }
  trapShakeTime_ = (float) reader.GetReal("simulation", "trap_shake_time", 1e-6);

  duration_ = (float) reader.GetReal("simulation", "duration", 6e-4);
  inglisTeller_ = reader.GetBoolean("simulation", "inglis_teller", false);
  maxVoltage_ = (float) reader.GetReal("simulation", "max_voltage", 100);
  targetVel_ = (float) reader.GetReal("simulation", "target_vel", 500);
  timeStep_ = (float) reader.GetReal("simulation", "time_step", 1e-6);
}
Ejemplo n.º 2
0
void ParticlesConfig::populate(INIReader &reader) {
  nParticles_ = static_cast<int>(reader.GetReal("particles", "n_particles",
                                                50000));
  k_ = reader.GetInteger("particles", "k", 20);
  kDist_ = reader.Get("particles", "k_dist", "single");
  if (kDist_ != "single" && kDist_ != "uniform" && kDist_ != "triangle") {
    try {
      throw "Invalid k distribution value!";
    } catch (const char* e) {
      std::cout << e << std::endl;
      std::terminate();
    }
  }

  n_ = reader.GetInteger("particles", "n", 25);
  positionDist_ = reader.Get("particles", "position_dist", "full");
  distRadius_ = (float) reader.GetReal("particles", "dist_radius", 0.5);
  distLength_ = (float) reader.GetReal("particles", "dist_length", 5);
  distOffset_ = (float) reader.GetReal("particles", "dist_offset", 22);
  temperature_ = (float) reader.GetReal("particles", "temperature", 1.0);
}