Exemplo n.º 1
0
            //NETLIB_CONSTRUCTOR(solver)
            //detail.family_setter_t m_famsetter;
            //template <class CLASS>
            public nld_solver(object owner, string name)
                : base(owner, name)
            {
                m_fb_step = new logic_input_t(this, "FB_step");
                m_Q_step  = new logic_output_t(this, "Q_step");
                m_freq    = new param_double_t(this, "FREQ", 48000.0);

                /* iteration parameters */
                m_gs_sor   = new param_double_t(this, "SOR_FACTOR", 1.059);
                m_method   = new param_str_t(this, "METHOD", "MAT_CR");
                m_accuracy = new param_double_t(this, "ACCURACY", 1e-7);
                m_gs_loops = new param_int_t(this, "GS_LOOPS", 9);              // Gauss-Seidel loops

                /* general parameters */
                m_gmin            = new param_double_t(this, "GMIN", nl_config_global.NETLIST_GMIN_DEFAULT);
                m_pivot           = new param_logic_t(this, "PIVOT", false /*0*/);                                            // use pivoting - on supported solvers
                m_nr_loops        = new param_int_t(this, "NR_LOOPS", 250);                                                   // Newton-Raphson loops
                m_nr_recalc_delay = new param_double_t(this, "NR_RECALC_DELAY", netlist_time.NLTIME_FROM_NS(10).as_double()); // Delay to next solve attempt if nr loops exceeded
                m_parallel        = new param_int_t(this, "PARALLEL", 0);

                /* automatic time step */
                m_dynamic_ts     = new param_logic_t(this, "DYNAMIC_TS", false /*0*/);
                m_dynamic_lte    = new param_double_t(this, "DYNAMIC_LTE", 1e-5);          // diff/timestep
                m_dynamic_min_ts = new param_double_t(this, "DYNAMIC_MIN_TIMESTEP", 1e-6); // nl_double timestep resolution

                m_log_stats = new param_logic_t(this, "LOG_STATS", true);                  // log statistics on shutdown
                m_params    = new solver_parameters_t();


                // internal staff

                connect(m_fb_step, m_Q_step);
            }
Exemplo n.º 2
0
            // ----------------------------------------------------------------------------------------
            // matrix_solver
            // ----------------------------------------------------------------------------------------
            protected matrix_solver_t(netlist_base_t anetlist, string name, eSortType sort, solver_parameters_t params_)
                : base(anetlist, name)
            {
                m_params              = params_;
                m_stat_calculations   = new state_var <int>(this, "m_stat_calculations", 0);
                m_stat_newton_raphson = new state_var <int>(this, "m_stat_newton_raphson", 0);
                m_stat_vsolver_calls  = new state_var <int>(this, "m_stat_vsolver_calls", 0);
                m_iterative_fail      = new state_var <int>(this, "m_iterative_fail", 0);
                m_iterative_total     = new state_var <int>(this, "m_iterative_total", 0);
                m_last_step           = new state_var <netlist_time>(this, "m_last_step", netlist_time.zero());
                m_fb_sync             = new logic_input_t(this, "FB_sync");
                m_Q_sync              = new logic_output_t(this, "Q_sync");
                m_ops  = 0;
                m_sort = sort;


                connect_post_start(m_fb_sync, m_Q_sync);
            }
Exemplo n.º 3
0
            //typedef FT float_type;
            //typedef matrix_solver_direct_t<FT, 1> base_type;


            public matrix_solver_direct1_t(netlist_base_t anetlist, string name, solver_parameters_t params_)
                : base(1, anetlist, name, params_, 1)
            {
            }
Exemplo n.º 4
0
            //plib::dynproc<void, double * RESTRICT, double * RESTRICT, double * RESTRICT> m_proc;


            public matrix_solver_GCR_t(int SIZE, netlist_base_t anetlist, string name, solver_parameters_t params_, UInt32 size)
                : base(anetlist, name, matrix_solver_t.eSortType.ASCENDING, params_)
            {
                this.SIZE = SIZE;


                for (int i = 0; i < m_term_cr.Length; i++)
                {
                    m_term_cr[i] = new std.vector <uint16_t>();
                }


                m_dim  = size;
                RHS    = new double [size];
                new_V  = new double [size];
                mat    = new plib.mat_cr_t(storage_N, size);
                m_proc = null;
            }
Exemplo n.º 5
0
 protected matrix_solver_direct_t(UInt32 SIZE, netlist_base_t anetlist, string name, eSortType sort, solver_parameters_t params_, UInt32 size)
     : base(null, null, eSortType.NOSORT, params_)
 {
     throw new emu_unimplemented();
 }
Exemplo n.º 6
0
 matrix_solver_SOR_mat_t(devices.nld_solver main_solver, string name, matrix_solver_t_net_list_t nets, solver_parameters_t params_, size_t size)
     : base(main_solver, name, nets, params_, size)
 {
     m_omega = new state_var <FT>(this, "m_omega", ops.cast(params_.m_gs_sor.op()));
 }