summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/netlist/nltypes.h
diff options
context:
space:
mode:
author couriersud <couriersud@gmx.org>2020-05-01 16:13:34 +0200
committer couriersud <couriersud@gmx.org>2020-05-01 16:13:34 +0200
commitf74ad44550857d68b10e00fa01130271492e8761 (patch)
tree295fca1e0c592108dcf71f9f25712c549d2e3ff5 /src/lib/netlist/nltypes.h
parent40f8f99f9ae8a1dd709ef8e0cca488f533d22d41 (diff)
netlist: more magic number removal. (nw)
Diffstat (limited to 'src/lib/netlist/nltypes.h')
-rw-r--r--src/lib/netlist/nltypes.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/netlist/nltypes.h b/src/lib/netlist/nltypes.h
index 42ba576d0db..915abcafb11 100644
--- a/src/lib/netlist/nltypes.h
+++ b/src/lib/netlist/nltypes.h
@@ -33,8 +33,26 @@ namespace netlist
{
using BC = plib::constants<T>;
+ /// \brief constant startup gmin
+ ///
+ /// This should be used during object creation to initialize
+ /// conductivities with a reasonable value.
+ /// During reset, the object should than make use of exec().gmin()
+ /// to use the actual gmin() value.
static inline constexpr T cgmin() noexcept { return BC::magic(1e-9); } // NOLINT
+ // FIXME: Some objects used 1e-15 for initial gmin. Needs to be
+ // aligned with cgmin
+ static inline constexpr T cgminalt() noexcept { return BC::magic(1e-15); } // NOLINT
+
+ /// \brief Multiplier applied to VT in np diode models to determine range for constant model
+ ///
+ static inline constexpr T diode_min_cutoff_mult() noexcept { return BC::magic(-5.0); } // NOLINT
+
+ /// \brief Startup voltage used by np diode models
+ ///
+ static inline constexpr T diode_start_voltage() noexcept { return BC::magic(0.7); } // NOLINT
+
static inline constexpr T np_VT(T n=BC::one(), T temp=BC::T0()) noexcept
{ return n * temp * BC::k_b() / BC::Q_e(); }