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

Go to the source code of this file.

Macros

#define NCELLS   10
 

Typedefs

typedef PC< 3, 1 > PCType
 

Functions

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

Macro Definition Documentation

#define NCELLS   10

Definition at line 16 of file testOneDConduction_double.cpp.

Referenced by main().

Typedef Documentation

typedef PC<3,1> PCType

Definition at line 14 of file testOneDConduction_double.cpp.

Function Documentation

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

Definition at line 17 of file testOneDConduction_double.cpp.

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

18 {
19 
20  double dkConst = 1.;
21  PCType pCkConst(dkConst);
22  pCkConst._data[1] = 0.1;
23 
24  //OneDConduction<double> dp(NCELLS,dkConst);
25  OneDConduction<PCType> pCp(NCELLS,pCkConst);
26 
27  //dp.solve();
28  pCp.solve();
29 
30  //Array<double>& dt = dp.getSolution();
31  Array<PCType>& pCt = pCp.getSolution();
32 
33  //cout << "double solution" << endl;
34  //for(int i=0; i<NCELLS; i++)
35  // cout << i << " " << dt[i] << endl;
36  ofstream mean_file, variance_file;
37  mean_file.open("/tmp/mean-mc.dat");
38  variance_file.open("/tmp/variance-mc.dat");
39 
40  double dx=1.0/NCELLS;
41  double x = dx/2.0;
42  for(int c=0; c<NCELLS; c++)
43  {
44  double Tmean = pCt[i]._data[0] << " "
45  double T = gsl_stats_variance_m(Tc[c],1,NTRIES,Tmean);
46  mean_file << x << " " << Tmean << endl;
47  variance_file << xc[c] << " " << stdDev(pCt[i]) << endl;
48  }
49 
50  return 0;
51 }
Definition: PC.h:61
double stdDev(const PC< ORDER, DIM > &a)
Definition: PC.h:363
Definition: Array.h:14
T * _data
Definition: Array.h:500
#define NCELLS
#define NTRIES