Template Class BusLinePartitionInterface

Inheritance Relationships

Base Type

Class Documentation

template<class ScalarT, typename IdxT>
class BusLinePartitionInterface : public GridKit::PowerElectronics::PartitionInterface<ScalarT, IdxT>

Partition interface between a bus and a line.

The BusLinePartitionInterface provides a mechanism for a partition to access the current injection it requires from a line located in a neighboring partition, without evaluating the line within the local partition.

The interface tracks four variables associated with the bus-line connection. The first two variables belong to the bus participating in the partition boundary, while the last two belong to the line connected to that bus. All four variables are treated as external variables by the interface.

During partitioning, the interface is added to the partition containing the bus. Since the first two interface variables belong to components within the partition, the subsystem maps them to its local variables. The last two variables belong to the line in the neighboring partition and are therefore identified by the subsystem as external variables.

During subsystem evaluation, the interface uses these external line variables to provide the corresponding current injection to the bus equations. The current contribution is added to or subtracted from the bus residual according to which end of the line is connected to the bus.

Template Parameters:
  • ScalarT – Scalar type used for state and residual values.

  • IdxT – Index type used for component and variable indices.

Public Functions

virtual int allocate() final

Allocate all internal memory used by the model.

Post:

Changing the model by changing its internal topology (i.e. size(), nnz(), sparsity pattern in getCsrJacobian(), etc.) may invalidate the model until allocate() is called again. Calling any function that requires allocate() to be called in between modifying the model and reallocating may invoke undefined behaviour.

virtual int tagDifferentiable() final

Fill the tag() vector with proper indicators.

Note

For some models, this may be a no-op, and the vector returned by tag() will still be empty.

Pre:

allocate() must have been called.

virtual int setAbsoluteTolerance(RealT) final

Compute the absolute tolerance for each variable in the model.

This represents a “noise” level close to zero for which pure relative error cannot be used.

Parameters:

rel_tol – The relative tolerance which can be used to pick the absolute tolerance.

Returns:

int 0 if successful, non-zero otherwise.

virtual int evaluateInternalResidual() final

Evaluate all residuals for the component’s internal variables, writing them through f_int_.

Returns:

An error code, or 0 if successful.

virtual int evaluateExternalResidual() final

Evaluate all residual contributions for the component’s external variables, accumulating them through f_ext_.

Returns:

An error code, or 0 if successful.