-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtest_irf.cxx
51 lines (40 loc) · 1010 Bytes
/
test_irf.cxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <heat.hxx>
#include <bmi.hxx>
#include <bmi_heat.hxx>
int
main (void)
{
BmiHeat model;
std::string name;
fprintf (stdout, "Initializing... ");
model.Initialize ("");
fprintf (stdout, "Done\n");
name = model.GetComponentName();
std::cout << name << std::endl;
{
const int n_steps = 10;
double now;
double then;
fprintf (stdout, "Running...\n");
for (int i = 0; i < n_steps; i++) {
fprintf(stderr, "Updating\n"); fflush(stderr);
model.Update();
fprintf(stderr, "Updated\n"); fflush(stderr);
now = model.GetCurrentTime();
fprintf (stdout, "Time: %f\n", now);
}
then = model.GetEndTime();
model.UpdateUntil(then);
now = model.GetCurrentTime();
fprintf (stdout, "Time: %f\n", now);
fprintf (stdout, "Done\n");
}
fprintf (stdout, "Finalizing... ");
model.Finalize ();
fprintf (stdout, "Done\n");
return EXIT_SUCCESS;
}