Show / Hide Table of Contents

Class LocalSolverState<T, S>

A simulation state that has a local solver.

Inheritance
object
SubcircuitSolverState<T, S>
LocalSolverState<T, S>
Biasing.LocalSimulationState
Frequency.LocalSimulationState
Implements
ISolverSimulationState<T>
ISimulationState
IVariableFactory<IVariable<T>>
IVariableDictionary<IVariable<T>>
IReadOnlyDictionary<string, IVariable<T>>
IReadOnlyCollection<KeyValuePair<string, IVariable<T>>>
IEnumerable<KeyValuePair<string, IVariable<T>>>
IEnumerable
Inherited Members
SubcircuitSolverState<T, S>.Name
SubcircuitSolverState<T, S>.Parent
SubcircuitSolverState<T, S>.Solver
SubcircuitSolverState<T, S>.Solution
SubcircuitSolverState<T, S>.Map
SubcircuitSolverState<T, S>.GetSharedVariable(string)
SubcircuitSolverState<T, S>.CreatePrivateVariable(string, IUnit)
SubcircuitSolverState<T, S>.Comparer
SubcircuitSolverState<T, S>.Add(string, IVariable<T>)
SubcircuitSolverState<T, S>.ContainsKey(string)
SubcircuitSolverState<T, S>.TryGetValue(string, out IVariable<T>)
SubcircuitSolverState<T, S>.this[string]
SubcircuitSolverState<T, S>.Keys
SubcircuitSolverState<T, S>.Values
SubcircuitSolverState<T, S>.Count
SubcircuitSolverState<T, S>.GetEnumerator()
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: SpiceSharp.Components.Subcircuits
Assembly: SpiceSharp.dll
Syntax
public abstract class LocalSolverState<T, S> : SubcircuitSolverState<T, S>, ISolverSimulationState<T>, ISimulationState, IVariableFactory<IVariable<T>>, IVariableDictionary<IVariable<T>>, IReadOnlyDictionary<string, IVariable<T>>, IReadOnlyCollection<KeyValuePair<string, IVariable<T>>>, IEnumerable<KeyValuePair<string, IVariable<T>>>, IEnumerable where S : ISolverSimulationState<T>
Type Parameters
Name Description
T

The solver value type.

S

The parent simulation state type.

Constructors

LocalSolverState(string, S, ISparsePivotingSolver<T>)

Initializes a new instance of the LocalSolverState<T, S> class.

Declaration
protected LocalSolverState(string name, S parent, ISparsePivotingSolver<T> solver)
Parameters
Type Name Description
string name

The name of the subcircuit instance.

S parent

The parent simulation state.

ISparsePivotingSolver<T> solver

The local solver.

Exceptions
Type Condition
ArgumentNullException

Thrown if name, parent or solver is null.

Fields

LocalSolution

The local solution vector.

Declaration
protected IVector<T> LocalSolution
Field Value
Type Description
IVector<T>

Properties

Map

Gets the IVariableMap that maps variables to indices for the solver.

Declaration
public override IVariableMap Map { get; }
Property Value
Type Description
IVariableMap

The variable map.

Overrides
SubcircuitSolverState<T, S>.Map

Solution

Gets the solution to the solved equations.

Declaration
public override IVector<T> Solution { get; }
Property Value
Type Description
IVector<T>

The solution.

Overrides
SubcircuitSolverState<T, S>.Solution

Solver

Gets the solver used to solve the system of equations.

Declaration
public override ISparsePivotingSolver<T> Solver { get; }
Property Value
Type Description
ISparsePivotingSolver<T>

The solver.

Overrides
SubcircuitSolverState<T, S>.Solver

Updated

Gets or sets a value indicating whether this LocalSolverState<T, S> has updated its solution.

Declaration
protected bool Updated { get; }
Property Value
Type Description
bool

true if updated; otherwise, false.

Methods

Apply()

Applies the local solver to the parent solver.

Declaration
public virtual bool Apply()
Returns
Type Description
bool

true if the application was successful; otherwise, false.

Exceptions
Type Condition
NoEquivalentSubcircuitException

Thrown if no equivalent contributions could be calculated.

ApplyTransposed()

Applies forward substitution for the transposed/adjoint matrix.

Declaration
public virtual void ApplyTransposed()

CreatePrivateVariable(string, IUnit)

Creates a variable that is private to whoever requested it. The factory will not shared this variable with anyone else, and the name is only used for display purposes.

Declaration
public override IVariable<T> CreatePrivateVariable(string name, IUnit unit)
Parameters
Type Name Description
string name

The name of the private variable.

IUnit unit

The unit of the variable.

Returns
Type Description
IVariable<T>

The private variable.

Overrides
SubcircuitSolverState<T, S>.CreatePrivateVariable(string, IUnit)

GetSharedVariable(string)

Gets a variable that can be shared with other behaviors by the factory. If another variable already exists with the same name, that is returned instead.

Declaration
public override IVariable<T> GetSharedVariable(string name)
Parameters
Type Name Description
string name

The name of the shared variable.

Returns
Type Description
IVariable<T>

The shared variable.

Overrides
SubcircuitSolverState<T, S>.GetSharedVariable(string)
Exceptions
Type Condition
ArgumentNullException

Thrown if name is null.

Initialize(IReadOnlyList<Bridge<string>>)

Initializes the specified shared.

Declaration
public virtual void Initialize(IReadOnlyList<Bridge<string>> nodes)
Parameters
Type Name Description
IReadOnlyList<Bridge<string>> nodes

The node map.

Exceptions
Type Condition
ArgumentNullException

Thrown if nodes is null.

Update()

Updates the state with the new solution.

Declaration
public virtual void Update()

UpdateTransposed()

Updates the state with the new solution for the transposed version.

Declaration
public virtual void UpdateTransposed()

Implements

ISolverSimulationState<T>
ISimulationState
IVariableFactory<V>
IVariableDictionary<V>
IReadOnlyDictionary<TKey, TValue>
IReadOnlyCollection<T>
IEnumerable<T>
IEnumerable

Extension Methods

Utility.ThrowIfNull<T>(T, string)
Utility.ThrowIfEmpty<T>(IEnumerable<T>, string)

See Also

ISolverSimulationState<T>
In this article
Back to top Generated by DocFX