diff --git a/homework3/starting_point/material_points_factory.cc b/homework3/starting_point/material_points_factory.cc index 6251fe4..f44e30d 100644 --- a/homework3/starting_point/material_points_factory.cc +++ b/homework3/starting_point/material_points_factory.cc @@ -1,47 +1,47 @@ #include "material_points_factory.hh" #include "compute_temperature.hh" #include "csv_reader.hh" #include "csv_writer.hh" #include "material_point.hh" #include #include /* -------------------------------------------------------------------------- */ std::unique_ptr MaterialPointsFactory::createParticle() { return std::make_unique(); } /* -------------------------------------------------------------------------- */ SystemEvolution& MaterialPointsFactory::createSimulation(const std::string& fname, Real timestep) { this->system_evolution = std::make_unique(std::make_unique()); CsvReader reader(fname); reader.read(this->system_evolution->getSystem()); // check if it is a square number auto N = this->system_evolution->getSystem().getNbParticles(); int side = std::sqrt(N); if (side * side != N) throw std::runtime_error("number of particles is not square"); - auto temperature = std::make_shared(); + auto temperature = std::make_shared(timestep); this->system_evolution->addCompute(temperature); return *system_evolution; } /* -------------------------------------------------------------------------- */ ParticlesFactoryInterface& MaterialPointsFactory::getInstance() { if (not ParticlesFactoryInterface::factory) ParticlesFactoryInterface::factory = new MaterialPointsFactory; return *factory; } /* -------------------------------------------------------------------------- */