/[ascend]/trunk/base/generic/integrator/idaanalyse.c
ViewVC logotype

Diff of /trunk/base/generic/integrator/idaanalyse.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1336 by jpye, Tue Mar 6 14:40:02 2007 UTC revision 1337 by jpye, Sat Mar 10 12:33:15 2007 UTC
# Line 1  Line 1 
1  #include "idaanalyse.h"  #include "idaanalyse.h"
2    
3  #include <utilities/ascPanic.h>  #include <utilities/ascPanic.h>
4    #include <utilities/error.h>
5    
6  #ifdef ASC_IDA_NEW_ANALYSE  #ifdef ASC_IDA_NEW_ANALYSE
7  # include <linear/linsolqr.h>  # include <linear/linsolqr.h>
# Line 10  Line 11 
11  # include <system/block.h>  # include <system/block.h>
12  # include <system/diffvars_impl.h>  # include <system/diffvars_impl.h>
13  # include <system/jacobian.h>  # include <system/jacobian.h>
14    # include <system/cond_config.h>
15  # include <solver/slvDOF.h>  # include <solver/slvDOF.h>
16  #endif  #endif
17    
# Line 465  int integrator_ida_analyse(IntegratorSys Line 467  int integrator_ida_analyse(IntegratorSys
467    
468      asc_assert(sys->engine==INTEG_IDA);      asc_assert(sys->engine==INTEG_IDA);
469    
470        CONSOLE_DEBUG("System contains a total of %d bnds and %d reals"
471            ,slv_get_num_solvers_bnds(sys->system)
472            ,slv_get_num_solvers_rels(sys->system)
473        );
474    
475        /* set the active flags on  variables depending on the state of WHENs */
476        CONSOLE_DEBUG("Currently %d rels active",slv_count_solvers_rels(sys->system, &integrator_ida_rel));
477    
478        reanalyze_solver_lists(sys->system);
479    
480        CONSOLE_DEBUG("After analysing WHENs, there are %d rels active"
481            ,slv_count_solvers_rels(sys->system, &integrator_ida_rel)
482        );
483    
484    
485  #ifdef ANALYSE_DEBUG  #ifdef ANALYSE_DEBUG
486      CONSOLE_DEBUG("Starting IDA analysis");      CONSOLE_DEBUG("Starting IDA analysis");
487  #endif  #endif
488    
489        /* set the flags on differential and derivative and algebraic vars */
490      res = integrator_ida_check_vars(sys);      res = integrator_ida_check_vars(sys);
491      if(res){      if(res){
492          ERROR_REPORTER_HERE(ASC_PROG_ERR,"Problem with vars");          ERROR_REPORTER_HERE(ASC_PROG_ERR,"Problem with vars");
# Line 504  int integrator_ida_analyse(IntegratorSys Line 522  int integrator_ida_analyse(IntegratorSys
522          return 1;          return 1;
523      }      }
524    
525        CONSOLE_DEBUG("After ida_create_lists, there are %d rels active"
526            ,slv_count_solvers_rels(sys->system, &integrator_ida_rel)
527        );
528    
529  #ifdef ANALYSE_DEBUG  #ifdef ANALYSE_DEBUG
530      CONSOLE_DEBUG("Checking lists");      CONSOLE_DEBUG("Checking lists");
531    
# Line 519  int integrator_ida_analyse(IntegratorSys Line 541  int integrator_ida_analyse(IntegratorSys
541          return 360;          return 360;
542      }      }
543    
544    
545        CONSOLE_DEBUG("After ida_check_diffindex, there are %d rels active"
546            ,slv_count_solvers_rels(sys->system, &integrator_ida_rel)
547        );
548    
549      /* the following causes TestIDA.testincidence3 to fail:      /* the following causes TestIDA.testincidence3 to fail:
550      if(sys->n_y != slv_get_num_solvers_rels(sys->system)){      if(sys->n_y != slv_get_num_solvers_rels(sys->system)){
551          ERROR_REPORTER_HERE(ASC_USER_ERROR,"Problem is not square");          ERROR_REPORTER_HERE(ASC_USER_ERROR,"Problem is not square");
# Line 564  int integrator_ida_analyse(IntegratorSys Line 591  int integrator_ida_analyse(IntegratorSys
591          return 100 + res;          return 100 + res;
592      }      }
593    
594        CONSOLE_DEBUG("After ida_check_index, there are %d rels active"
595            ,slv_count_solvers_rels(sys->system, &integrator_ida_rel)
596        );
597    
598    
599      /* get the the dervative chains from the system */      /* get the the dervative chains from the system */
600      diffvars = system_get_diffvars(sys->system);      diffvars = system_get_diffvars(sys->system);
601    
# Line 598  int integrator_ida_analyse(IntegratorSys Line 630  int integrator_ida_analyse(IntegratorSys
630  #endif  #endif
631      }      }
632    
633        CONSOLE_DEBUG("rels matchbits:  0x%x",integrator_ida_rel.matchbits);
634        CONSOLE_DEBUG("rels matchvalue: 0x%x",integrator_ida_rel.matchvalue);
635    
636        CONSOLE_DEBUG("At the end of ida_analyse, there are %d rels active"
637            ,slv_count_solvers_rels(sys->system, &integrator_ida_rel)
638        );
639    
640      return 0;      return 0;
641  }  }
642    

Legend:
Removed from v.1336  
changed lines
  Added in v.1337

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22