示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Frequency"/> class.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="context"/> is <c>null</c>.</exception>
        public Frequency(IComponentBindingContext context) : base(context)
        {
            var state = context.GetState <IComplexSimulationState>();

            _variables = new OnePort <Complex>(state, context);
            _elements  = new ElementSet <Complex>(state.Solver, _variables.GetMatrixLocations(state.Map));
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Frequency"/> class.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="context"/> is <c>null</c>.</exception>
        public Frequency(ISwitchBindingContext context)
            : base(context)
        {
            var state = context.GetState <IComplexSimulationState>();

            _variables = new OnePort <Complex>(state.GetSharedVariable(context.Nodes[0]), state.GetSharedVariable(context.Nodes[1]));
            _elements  = new ElementSet <Complex>(state.Solver, _variables.GetMatrixLocations(state.Map));
        }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Frequency"/> class.
 /// </summary>
 /// <param name="context">The context.</param>
 /// <exception cref="ArgumentNullException">Thrown if <paramref name="context"/> is <c>null</c>.</exception>
 public Frequency(IComponentBindingContext context)
     : base(context)
 {
     context.Nodes.CheckNodes(2);
     _complex   = context.GetState <IComplexSimulationState>();
     _variables = new OnePort <Complex>(_complex, context);
     _elements  = new ElementSet <Complex>(_complex.Solver, _variables.GetMatrixLocations(_complex.Map));
 }
示例#4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Biasing"/> class.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="context"/> is <c>null</c>.</exception>
        public Biasing(IComponentBindingContext context) : base(context)
        {
            context.Nodes.CheckNodes(2);
            var state = context.GetState <IBiasingSimulationState>();

            _variables = new OnePort <double>(state, context);
            _elements  = new ElementSet <double>(state.Solver, _variables.GetMatrixLocations(state.Map));
        }
示例#5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Time"/> class.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="context"/> is <c>null</c>.</exception>
        public Time(IComponentBindingContext context) : base(context)
        {
            context.Nodes.CheckNodes(2);
            _biasing   = context.GetState <IBiasingSimulationState>();
            _time      = context.GetState <ITimeSimulationState>();
            _variables = new OnePort <double>(_biasing, context);
            _elements  = new ElementSet <double>(_biasing.Solver,
                                                 _variables.GetMatrixLocations(_biasing.Map),
                                                 _variables.GetRhsIndices(_biasing.Map));
            var method = context.GetState <IIntegrationMethod>();

            _qcap = method.CreateDerivative();
        }
示例#6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Biasing" /> class.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="context"/> is <c>null</c>.</exception>
        public Biasing(ISwitchBindingContext context)
            : base(context)
        {
            context.ThrowIfNull(nameof(context));

            _iteration       = context.GetState <IIterationSimulationState>();
            _controller      = context.ControlValue;
            ModelTemperature = context.ModelBehaviors.GetValue <ModelTemperature>();
            Parameters       = context.GetParameterSet <Parameters>();

            var state = context.GetState <IBiasingSimulationState>();

            _variables = new OnePort <double>(state.GetSharedVariable(context.Nodes[0]), state.GetSharedVariable(context.Nodes[1]));
            _elements  = new ElementSet <double>(state.Solver, _variables.GetMatrixLocations(state.Map));
        }