Memosa-FVM
0.2
Main Page
Namespaces
Classes
Files
File List
File Members
testOneDConduction.cpp
Go to the documentation of this file.
1
// This file os part of FVM
2
// Copyright (c) 2012 FVM Authors
3
// See LICENSE file for terms.
4
5
#include <string>
6
#include <iostream>
7
#include <fstream>
8
9
using namespace
std;
10
11
#include "
PC.h
"
12
#include "
OneDConduction.h
"
13
14
typedef
PC<3,1>
PCType
;
15
16
#define NCELLS 20
17
int
main
(
int
argc,
char
*argv[])
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
}
OneDConduction.h
PC
Definition:
PC.h:61
main
int main(int argc, char *argv[])
Definition:
testOneDConduction.cpp:17
PC.h
PCType
PC< 3, 1 > PCType
Definition:
testOneDConduction.cpp:14
NCELLS
#define NCELLS
Definition:
testOneDConduction.cpp:16
OneDConduction::getSolution
boost::shared_ptr< Array< T > > getSolution()
Definition:
OneDConduction.h:85
OneDConduction::solve
void solve()
Definition:
OneDConduction.h:37
stdDev
double stdDev(const PC< ORDER, DIM > &a)
Definition:
PC.h:363
Array
Definition:
Array.h:14
OneDConduction
Definition:
OneDConduction.h:26
Array::_data
T * _data
Definition:
Array.h:500
src
modules
fvmbase
testOneDConduction.cpp
Generated on Tue Oct 28 2014 17:45:16 for Memosa-FVM by
1.8.6