/[ascend]/trunk/ascxx/idatest.cpp
ViewVC logotype

Contents of /trunk/ascxx/idatest.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2327 - (show annotations) (download) (as text)
Wed Dec 22 07:17:24 2010 UTC (13 years, 8 months ago) by jpye
File MIME type: text/x-c++src
File size: 741 byte(s)
Merging in refactor of the C++ code, which is moved out of 'pygtk' and into 'ascxx'.
Adding support for IPOPT 3.9.1, the current latest version.
Support in dtar for parallel builds (possibly needs some testing still).
1 #include "simulation.h"
2 #include "library.h"
3 #include "solver.h"
4 #include "solverreporter.h"
5 #include "integrator.h"
6 #include "solverparameters.h"
7 #include "integratorreporter.h"
8
9 #include <iostream>
10 using namespace std;
11
12 int main(void){
13
14 Library L;
15 L.load("johnpye/idadenx.a4c");
16
17 Type T = L.findType("idadenx");
18 Simulation M = T.getSimulation("sim");
19
20 // M.setSolver(Solver("QRSlv"));
21
22 M.build();
23
24 Integrator I(M);
25
26 I.setEngine("IDA");
27 SolverParameters P = I.getParameters();
28 P.getParameter("safeeval").setBoolValue(false);
29 P.getParameter("linsolver").setStrValue("DENSE");
30 I.setParameters(P);
31
32 IntegratorReporterConsole R(&I);
33 I.setReporter(&R);
34
35 I.setLogTimesteps(UnitsM("s"), 0.4, 4e10, 11);
36
37 I.analyse();
38 I.solve();
39 }

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