/// <summary> /// Initializes a new instance of the <see cref="Biasing"/> class. /// </summary> /// <param name="context">The binding context.</param> /// <exception cref="ArgumentNullException">Thrown if <paramref name="context"/> is <c>null</c>.</exception> public Biasing(IComponentBindingContext context) : base(context) { var state = context.GetState <IBiasingSimulationState>(); _config = context.GetSimulationParameterSet <BiasingParameters>(); _iteration = context.GetState <IIterationSimulationState>(); _args = new MosfetContributionEventArgs(_contributions); context.TryGetState(out _time); context.TryGetState(out _method); _variables = new MosfetVariables <double>(context, state); // Get matrix pointers _elements = new ElementSet <double>(state.Solver, _variables.GetMatrixLocations(state.Map), _variables.GetRhsIndices(state.Map)); }
/// <summary> /// Initializes a new instance of the <see cref="Biasing"/> class. /// </summary> /// <param name="context">The binding context.</param> /// <exception cref="ArgumentNullException">Thrown if <paramref name="context"/> is <c>null</c>.</exception> public Biasing(IComponentBindingContext context) : base(context) { var state = context.GetState <IBiasingSimulationState>(); _config = context.GetSimulationParameterSet <BiasingParameters>(); _iteration = context.GetState <IIterationSimulationState>(); _args = new MosfetContributionEventArgs(_contributions); context.TryGetState(out _time); context.TryGetState(out _method); _variables = new MosfetVariables <double>(Name, state, context.Nodes, !ModelParameters.DrainResistance.Equals(0.0) || !ModelParameters.SheetResistance.Equals(0.0) && Parameters.DrainSquares > 0, !ModelParameters.SourceResistance.Equals(0.0) || !ModelParameters.SheetResistance.Equals(0.0) && Parameters.SourceSquares > 0); // Get matrix pointers _elements = new ElementSet <double>(state.Solver, _variables.GetMatrixLocations(state.Map), _variables.GetRhsIndices(state.Map)); }