Class LocalSolverState<T, S>
A simulation state that has a local solver.
Implements
Inherited Members
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 |
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
Solution
Gets the solution to the solved equations.
Declaration
public override IVector<T> Solution { get; }
Property Value
Type | Description |
---|---|
IVector<T> | The solution. |
Overrides
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
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 |
|
Methods
Apply()
Applies the local solver to the parent solver.
Declaration
public virtual bool Apply()
Returns
Type | Description |
---|---|
bool |
|
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
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
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if |
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 |
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()