/[ascend]/trunk/pygtk/solverstatus.cpp
ViewVC logotype

Contents of /trunk/pygtk/solverstatus.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 532 - (show annotations) (download) (as text)
Mon Apr 24 02:23:08 2006 UTC (13 years, 7 months ago) by johnpye
File MIME type: text/x-c++src
File size: 2247 byte(s)
Removed 'interface' directory in trunk/pygtk/interface (moved everything up a level)
Made corresponding changes to SCons* and spec files.
1 #include "solverstatus.h"
2 #include "simulation.h"
3
4 extern "C"{
5 #include <compiler/instance_enum.h>
6 #include <solver/var.h>
7 #include <solver/discrete.h>
8 #include <solver/conditional.h>
9 #include <solver/bnd.h>
10 #include <solver/linsol.h>
11 #include <solver/linsolqr.h>
12 #include <solver/slv_client.h>
13 }
14
15 SolverStatus::SolverStatus(){
16 // do nothing else
17 }
18
19 SolverStatus::SolverStatus(const SolverStatus &old) : s(old.s){
20 // just that
21 }
22
23 void
24 SolverStatus::getSimulationStatus(Simulation &sim){
25 slv_get_status(sim.getSystem(), &s);
26 }
27
28 const bool
29 SolverStatus::isOK() const{
30 return s.ok;
31 }
32
33 const bool
34 SolverStatus::isOverDefined() const{
35 return s.over_defined!=0;
36 }
37
38 const bool
39 SolverStatus::isUnderDefined() const{
40 return s.under_defined!=0;
41 }
42
43 const bool
44 SolverStatus::isStructurallySingular() const{
45 return s.struct_singular!=0;
46 }
47
48 const bool
49 SolverStatus::isReadyToSolve() const{
50 return s.ready_to_solve!=0;
51 }
52
53 const bool
54 SolverStatus::isConverged() const{
55 return s.converged!=0;
56 }
57 const bool
58 SolverStatus::isDiverged() const{
59 return s.diverged!=0;
60 }
61
62 const bool
63 SolverStatus::isInconsistent() const{
64 return s.inconsistent!=0;
65 }
66
67 const bool
68 SolverStatus::hasResidualCalculationErrors() const{
69 return s.calc_ok!=0;
70 }
71
72 const bool
73 SolverStatus::hasExceededIterationLimit() const{
74 return s.iteration_limit_exceeded!=0;
75 }
76 const bool
77 SolverStatus::hasExceededTimeLimit() const{
78 return s.time_limit_exceeded!=0;
79 }
80
81 const bool
82 SolverStatus::isInterrupted() const{
83 return s.panic!=0;
84 }
85
86 const int
87 SolverStatus::getIterationNum() const{
88 return s.iteration;
89 }
90
91 // block stuff....
92
93 const int
94 SolverStatus::getNumBlocks() const{
95 return s.block.number_of;
96 }
97
98 const int
99 SolverStatus::getCurrentBlockNum() const{
100 return s.block.current_block;
101 }
102 const int
103 SolverStatus::getCurrentBlockSize() const{
104 return s.block.current_size;
105 }
106 const int
107 SolverStatus::getCurrentBlockIteration() const{
108 return s.block.iteration;
109 }
110
111 const int
112 SolverStatus::getNumConverged() const{
113 return s.block.previous_total_size;
114 }
115 const int
116 SolverStatus::getNumJacobianEvals() const{
117 return s.block.jacs;
118 }
119 const int
120 SolverStatus::getNumResidualEvals() const{
121 return s.block.funcs;
122 }
123
124 const double
125 SolverStatus::getBlockResidualRMS() const{
126 return s.block.residual;
127 }
128
129

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