Added linear and non linear chronos euler simulation model classes in order to be able to out-of-the-box use them with a factory class
This commit is contained in:
parent
68d5655214
commit
dd21445f52
|
@ -2,15 +2,23 @@
|
|||
|
||||
SimulationModelFactory::SimulationModelFactory() {}
|
||||
|
||||
std::unique_ptr<SimulationModel> SimulationModelFactory::create(
|
||||
const std::string &simulationModelLabel)
|
||||
std::unique_ptr<SimulationModel>
|
||||
SimulationModelFactory::create(const std::string& simulationModelLabel)
|
||||
{
|
||||
if (simulationModelLabel == DRMSimulationModel::label) {
|
||||
return std::make_unique<DRMSimulationModel>();
|
||||
} else if (simulationModelLabel == ChronosEulerSimulationModel::label) {
|
||||
return std::make_unique<ChronosEulerSimulationModel>();
|
||||
} else if (simulationModelLabel == ChronosEulerLinearSimulationModel::label) {
|
||||
return std::make_unique<ChronosEulerLinearSimulationModel>();
|
||||
} else if (simulationModelLabel ==
|
||||
ChronosEulerNonLinearSimulationModel::label) {
|
||||
return std::make_unique<ChronosEulerNonLinearSimulationModel>();
|
||||
} else if (simulationModelLabel == LinearSimulationModel::label) {
|
||||
return std::make_unique<LinearSimulationModel>();
|
||||
}
|
||||
std::cerr << "Simulation model used for computing the optimization results was "
|
||||
std::cerr
|
||||
<< "Simulation model used for computing the optimization results was "
|
||||
"not recognized"
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
|
|
|
@ -1,17 +1,19 @@
|
|||
#ifndef SIMULATIONMODELFACTORY_HPP
|
||||
#define SIMULATIONMODELFACTORY_HPP
|
||||
|
||||
#include "chronoseulerlinearsimulationmodel.hpp"
|
||||
#include "chronoseulernonlinearsimulationmodel.hpp"
|
||||
#include "chronoseulersimulationmodel.hpp"
|
||||
#include "der_leimer.hpp"
|
||||
#include "drmsimulationmodel.hpp"
|
||||
#include "linearsimulationmodel.hpp"
|
||||
#include <string>
|
||||
|
||||
class SimulationModelFactory
|
||||
{
|
||||
class SimulationModelFactory {
|
||||
public:
|
||||
SimulationModelFactory();
|
||||
static std::unique_ptr<SimulationModel> create(const std::string &simulationModelLabel);
|
||||
static std::unique_ptr<SimulationModel>
|
||||
create(const std::string &simulationModelLabel);
|
||||
};
|
||||
|
||||
#endif // SIMULATIONMODELFACTORY_HPP
|
||||
|
|
Loading…
Reference in New Issue