Line data Source code
1 : #include "SimulationConfig.hpp" 2 : 3 13 : cell::config::MembraneType& cell::findMembraneTypeByName(cell::SimulationConfig& simulationConfig, 4 : std::string membraneTypeName) 5 : { 6 13 : if (membraneTypeName == "" || membraneTypeName == cell::config::cellMembraneTypeName) 7 5 : return simulationConfig.cellMembraneType; 8 : 9 8 : auto membraneType = std::find_if(simulationConfig.membraneTypes.begin(), simulationConfig.membraneTypes.end(), 10 11 : [&](const auto& membraneType) { return membraneType.name == membraneTypeName; }); 11 8 : if (membraneType == simulationConfig.membraneTypes.end()) 12 0 : throw ExceptionWithLocation("No membrane type \"" + membraneTypeName + "\" found in the config"); 13 : 14 8 : return *membraneType; 15 : }