Exemplo n.º 1
0
 lbool context::check(model_ref & m) {
     flet<bool> searching(m_searching, true);
     lbool r;
     r = get_solver().check();
     if (r != l_false)
         get_solver().get_model(m);
     return r;
 }
Exemplo n.º 2
0
 void context::push() {
     get_solver().push();
     if (!m_user_ref_count) {
         m_ast_lim.push_back(m_ast_trail.size());
         m_replay_stack.push_back(0);
     }
 }
Exemplo n.º 3
0
 void context::pop(unsigned num_scopes) {
     for (unsigned i = 0; i < num_scopes; ++i) {
         if (!m_user_ref_count) {
             unsigned sz = m_ast_lim.back();
             m_ast_lim.pop_back();
             dealloc(m_replay_stack.back());
             m_replay_stack.pop_back();
             while (m_ast_trail.size() > sz) {
                 m_ast_trail.pop_back();
             }
         }
     }
     get_solver().pop(num_scopes);
 }
Exemplo n.º 4
0
 lbool context::optimize() {
     if (m_pareto) {
         return execute_pareto();
     }
     if (m_box_index != UINT_MAX) {
         return execute_box();
     }
     clear_state();
     init_solver(); 
     import_scoped_state(); 
     normalize();
     internalize();
     update_solver();
     solver& s = get_solver();
     for (unsigned i = 0; i < m_hard_constraints.size(); ++i) {
         TRACE("opt", tout << "Hard constraint: " << mk_ismt2_pp(m_hard_constraints[i].get(), m) << std::endl;);
         s.assert_expr(m_hard_constraints[i].get());
     }
Exemplo n.º 5
0
void AppStateCart2::ReportAfterStep()const
{
    const dTensorBC4& aux = get_aux();
    const dTensorBC4& q = get_q();
    const double t = get_time();

    assert(dogParams.get_mcapa()<1); // without capacity function
    void WriteConservation(const dTensorBC4& q, double t);
    WriteConservation(q, t);

    double OutputMagneticFluxes(
        int n_B1,
        int n_B2,
        const dTensorBC4& q,
        double t);
    const double bottom_to_rght_flux = OutputMagneticFluxes(_B1, _B2, q, t);

    void Output_center_E3(const dTensorBC4& q, double t, int _E3);
    Output_center_E3(q, t, _E3);
    void Output_center_gas_states(
      const dTensorBC4& q, double t, const char* outputfile,
      int species_offset, bool fiveMoment);
    const char* get_outputdir();
    string outputfile_i = string(get_outputdir())+"/xpoint_gas_i.dat";
    string outputfile_e = string(get_outputdir())+"/xpoint_gas_e.dat";
    Output_center_gas_states(q, t, outputfile_i.c_str(), _rho_i-1,false);
    Output_center_gas_states(q, t, outputfile_e.c_str(), _rho_e-1,true);
    void Output_center_cell_state(const dTensorBC4& q, double t);
    Output_center_cell_state(q, t);

    // output the rate of production of entropy at the center
    //
    const int maux = aux.getsize(3);
    if(maux>0)
    {
      assert_eq(maux,2);
      void output_component_at_center(
        const dTensorBC4& q, double t, const char* outputfile,
        int idx);
      outputfile_i = string(get_outputdir())+"/xpoint_ent_prod_i.dat";
      outputfile_e = string(get_outputdir())+"/xpoint_ent_prod_e.dat";
      output_component_at_center(aux, t, outputfile_i.c_str(),1);
      output_component_at_center(aux, t, outputfile_e.c_str(),2);
    }

    void output_local_divergence_error( int method_order, double dx, double dy,
        int n_B1, int n_B2, const dTensorBC4& q, double t);
    const double dx = dogParamsCart2.get_dx();
    const double dy = dogParamsCart2.get_dy();
    output_local_divergence_error(
      dogParams.get_space_order(), dx, dy, _B1, _B2, q, t);

    static bool unit_flux_triggered = bottom_to_rght_flux >=1;
    if(!unit_flux_triggered && bottom_to_rght_flux >= 1.)
    {
      unit_flux_triggered = true;
      dprintf("writing restart file q8000.dat at time %f;"
        "\n\tbottom_to_rght_flux = %f", t, bottom_to_rght_flux);
      get_solver().write_restart(8000);
    }
}
Exemplo n.º 6
0
 void context::assert_cnstr(expr * a) {
     get_solver().assert_expr(a);
 }