gtopt::GasNodeLP class

Base classes

template<typename ObjectType>
class ObjectLP<GasNode>
Wrapper class that adds LP capabilities to objects.

Public types

using Element = GasNode
using object_type = GasNode
Type of the wrapped object.

Public static variables

static std::string_view BalanceName
static std::string_view GasNodeKey
static std::string_view PiName
static std::string_view PressureName
static std::string_view TypeKey
PAMPL sum(...) predicate keys shared by the gas element family.

Constructors, destructors, conversion operators

GasNodeLP(const GasNode& node, const InputContext& ic) explicit

Public functions

auto add_to_lp(SystemContext& sc, const ScenarioLP& scenario, const StageLP& stage, LinearProblem& lp) -> bool
auto add_to_output(OutputContext& out) const -> bool
auto balance_rows_at(const ScenarioLP& scenario, const StageLP& stage) const -> const auto&
auto class_name(this const Self& self) -> auto noexcept
auto elevation() const -> double noexcept
Elevation [m] (default 0).
auto gas_node(this auto&& self) -> auto&& noexcept
auto id() const -> auto noexcept
auto is_active(const StageLP& stage) const -> bool
Checks if object is active in given stage.
auto object() & -> GasNode& noexcept
Gets the wrapped object.
auto p_init() const -> std::optional<double> noexcept
Initial pressure [bar] (nullopt = unset).
auto pi_cols_at(const ScenarioLP& scenario, const StageLP& stage) const -> const auto&
auto pmax_at(StageUid s) const -> std::optional<double>
Maximum pressure [bar] at a stage (nullopt = unbounded).
auto pmin_at(StageUid s) const -> double
Minimum pressure [bar] at a stage (default 0).
auto set_id(Uid uid, Name name) -> auto& noexcept
Sets the object's identifier.
auto short_name(this const Self& self) -> auto noexcept
auto sv_key(this const Self& self, const ScenarioLP& scenario, const StageLP& stage, std::string_view col_name) -> auto noexcept
Generates a state variable key for the object.
auto sv_key(this const Self& self, const StageLP& stage, std::string_view col_name) -> auto noexcept
auto uid() const -> auto noexcept

Parameter accessors for PAMPL user-constraint resolution

auto param_pmin(StageUid s) const -> auto
auto param_pmax(StageUid s) const -> auto
auto param_pressure_cost(StageUid s) const -> auto

Typedef documentation

using gtopt::GasNodeLP::Element = GasNode

Alias for the wrapped data-struct type. Lets generic code reach the canonical LPClassName constant via T::Element::class_name where T is any LP wrapper inheriting from ObjectLP. Single source of truth for the class-name constant lives on the data struct (Bus::class_name, Reservoir::class_name, …); the LP wrappers no longer carry a duplicate ClassName member.

using gtopt::GasNodeLP::object_type = GasNode

Type of the wrapped object.

Function documentation

auto gtopt::GasNodeLP::class_name(this const Self& self) noexcept

auto gtopt::GasNodeLP::id() const noexcept

Returns The object's complete identifier (uid + name)

bool gtopt::GasNodeLP::is_active(const StageLP& stage) const

Checks if object is active in given stage.

Parameters
stage The stage to check
Returns true if active in stage, false otherwise

GasNode& gtopt::GasNodeLP::object() & noexcept

Gets the wrapped object.

Returns Reference to the wrapped object

auto& gtopt::GasNodeLP::set_id(Uid uid, Name name) noexcept

Sets the object's identifier.

Parameters
uid Unique identifier
name Human-readable name
Returns Reference to self for chaining

auto gtopt::GasNodeLP::short_name(this const Self& self) noexcept

auto gtopt::GasNodeLP::sv_key(this const Self& self, const ScenarioLP& scenario, const StageLP& stage, std::string_view col_name) noexcept

Generates a state variable key for the object.

Parameters
self Reference to the object
scenario Scenario context
stage Stage context
col_name The column name for the state variable
Returns StateVariable::Key

auto gtopt::GasNodeLP::sv_key(this const Self& self, const StageLP& stage, std::string_view col_name) noexcept

auto gtopt::GasNodeLP::uid() const noexcept

Returns The object's unique identifier