Memosa-FVM  0.2
testOneDConduction.cpp File Reference
#include <string>
#include <iostream>
#include <fstream>
#include "PC.h"
#include "OneDConduction.h"
Include dependency graph for testOneDConduction.cpp:

Go to the source code of this file.

Macros

#define NCELLS   20
 

Typedefs

typedef PC< 3, 1 > PCType
 

Functions

int main (int argc, char *argv[])
 

Macro Definition Documentation

#define NCELLS   20

Definition at line 16 of file testOneDConduction.cpp.

Referenced by main().

Typedef Documentation

typedef PC<3,1> PCType

Definition at line 14 of file testOneDConduction.cpp.

Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 17 of file testOneDConduction.cpp.

References Array< T >::_data, OneDConduction< T >::getSolution(), NCELLS, OneDConduction< T >::solve(), and stdDev().

18 {
19 
20  PCType kConst;
21  kConst = 1.,0.1;
22 
23  OneDConduction<PCType> model(NCELLS,kConst);
24 
25  model.solve();
26 
27  Array<PCType>& Tc = *model.getSolution();
28 
29  ofstream mean_file, sd_file;
30  mean_file.open("/tmp/mean-uqtk.dat");
31  sd_file.open("/tmp/sd-uqtk.dat");
32 
33  double dx=1.0/NCELLS;
34  double x = dx/2.0;
35  for(int c=0; c<NCELLS; c++)
36  {
37  mean_file << x << " " << Tc[c]._data[0] << endl;
38  sd_file << x << " " << stdDev(Tc[c]) << endl;
39  x += dx;
40  }
41 
42  mean_file.close();
43  sd_file.close();
44 
45  return 0;
46 }
Definition: PC.h:61
#define NCELLS
double stdDev(const PC< ORDER, DIM > &a)
Definition: PC.h:363
Definition: Array.h:14
T * _data
Definition: Array.h:500