14#if defined(__GNUC__) || defined(__clang__)
31#include <nlohmann/json.hpp>
32using json = nlohmann::json;
108 return std::stoi(
options[optionName]);
117 return std::stod(
options[optionName]);
125 if (
options[optionName] ==
"true")
127 else if (
options[optionName] ==
"false")
139void applySimulationParametersFromJson(
const json config,
Simulation &sim);
140void applySynchronousGeneratorParametersFromJson(
142 std::shared_ptr<CPS::EMT::Ph3::SynchronGeneratorDQ> syngen);
150 const char *mangled, *unmangled;
152 mangled =
typeid(T).name();
157 unmangled = abi::__cxa_demangle(mangled, NULL, NULL, &status);
166 if (
type.find(stripPrefix) == 0)
167 type =
type.substr(stripPrefix.size());
174std::vector<std::string>
tokenize(std::string s,
char delimiter);
176fs::path
findFile(
const fs::path &name,
const fs::path &hint = fs::path(),
177 const std::string &useEnv = std::string());
179std::list<fs::path>
findFiles(std::list<fs::path> filennames,
180 const fs::path &hint,
181 const std::string &useEnv = std::string());
spdlog::level::level_enum Level
CPS::Logger::Level cliLogLevel
Int getOptionInt(String optionName)
std::list< String > positional
Real getOptionReal(String optionName)
void parseArguments(int argc, char *argv[])
DPsim::DirectLinearSolverImpl directImpl
std::list< fs::path > positionalPaths() const
String getOptionString(String optionName)
CommandLineArgs(int argc, char *argv[], String name="dpsim", Real dt=0.001, Real d=1, Real sf=50, Int s=-1, CPS::Logger::Level ll=CPS::Logger::Level::info, CPS::Logger::Level clill=CPS::Logger::Level::off, Bool ss=false, Bool b=false, Bool si=false, CPS::Domain sd=CPS::Domain::DP, Solver::Type st=Solver::Type::MNA, DirectLinearSolverImpl mi=DirectLinearSolverImpl::KLU, String spn="plugin.so", String params="default.json")
Bool getOptionBool(String optionName)
struct DPsim::CommandLineArgs::@006274247107050243354147375320272025065223106110 solver
std::map< String, String > options
std::vector< Argument > mArguments
DPsim::Timer::StartClock::time_point startTime
CPS::Logger::Level logLevel
The Simulation holds a SystemTopology and a Solver.
struct dps_magma_data data
std::list< fs::path > findFiles(std::list< fs::path > filennames, const fs::path &hint, const std::string &useEnv=std::string())
String encodeXml(String &data)
static CPS::String type(const CPS::String &stripPrefix="CPS::")
std::vector< std::string > tokenize(std::string s, char delimiter)
fs::path findFile(const fs::path &name, const fs::path &hint=fs::path(), const std::string &useEnv=std::string())