Coding Conventions
Scaling of quantities and logging rules that code in DPsim has to follow.
Conventions that apply across the codebase. For the process of getting a change merged, see contributing.
This is a summary of general guidelines for the development of DPsim.
Scaling of Voltages and Currents
Voltage quantities are expressed either as phase-to-phase RMS values (denominated as RMS3PH) or as phase-to-ground peak values (denominated as PEAK1PH):
- Initialisation quantities (e.g.
initialSingleVoltageofSimPowerComp) asRMS3PHvalues - Simulation quantities in both
SPandDPdomain (e.g.mIntfVoltageofDP::Ph1::PiLine) asRMS3PH values - Simulation quantities in the
EMTdomain (e.g.mIntfVoltageofEMT::Ph3::Transformer) asPEAK1PHvalues
Current quantities are expressed either as RMS or as PEAK values:
- Simulation quantities in both
SPandDPdomain (e.g.mIntfCurrentofDP::Ph1::PiLine) asRMSvalues - Simulation quantities in the
EMTdomain (e.g.mIntfCurrentofEMT::Ph3::Transformer) asPEAKvalues
Logging
Debug or trace should be the default log level for information that might be nice to have but not necessary for every simulation case.
Calls to the logger that might occur during simulation must use spdlog macros, like SPDLOG_LOGGER_INFO.
Last modified 03.08.2026: pybind: restore SystemTopology.add as a deprecated alias (#622) (a0db078)