Overture
Version 25
Main Page
Namespaces
Classes
Files
File List
File Members
Overture.v25.d
include
ErrorEstimator.h
Go to the documentation of this file.
1
#ifndef ERROR_ESTIMATOR_H
2
#define ERROR_ESTIMATOR_H
3
4
#include "
Overture.h
"
5
#include "
PlotStuffParameters.h
"
6
7
class
GL_GraphicsInterface
;
// would a GenericGI do?
8
// class PlotStuffParameters;
9
class
GenericGraphicsInterface
;
10
class
InterpolateRefinements
;
11
12
class
ErrorEstimator
13
{
14
public
:
15
16
enum
17
{
18
defaultNumberOfSmooths
=-99999
19
};
20
21
enum
ErrorFunctionEnum
22
{
23
twoSolidCircles
,
24
diagonal
,
25
cross
,
26
plus
,
27
hollowCircle
28
};
29
enum
FunctionEnum
30
{
31
topHat
32
};
33
34
ErrorEstimator
(
InterpolateRefinements
&
interpolateRefinements
);
35
~ErrorEstimator
();
36
37
38
// build an error with a predefined shape (for testing):
39
int
computeErrorFunction
(
realGridCollectionFunction
& error,
ErrorFunctionEnum
type );
40
int
computeFunction
(
realGridCollectionFunction
& u,
FunctionEnum
type,
real
t=0. );
41
42
// base error on undivided differences:
43
int
computeErrorFunction
(
realCompositeGridFunction
& u,
realCompositeGridFunction
& error );
44
int
computeErrorFunction
(
realGridCollectionFunction
& u,
realGridCollectionFunction
& error );
45
46
int
computeAndSmoothErrorFunction
(
realCompositeGridFunction
& u,
realCompositeGridFunction
& error,
47
int
numberOfSmooths =
defaultNumberOfSmooths
);
48
// smooth the error function and interpolate across overlapping grid boundaries:
49
int
smoothErrorFunction
(
realCompositeGridFunction
& error,
50
int
numberOfSmooths =
defaultNumberOfSmooths
,
51
CompositeGridOperators
*op =
NULL
);
52
53
int
displayParameters
(FILE *file = stdout )
const
;
54
55
int
plotErrorPoints
(
realGridCollectionFunction
& error,
real
errorThreshhold,
56
GL_GraphicsInterface
& ps,
PlotStuffParameters
& psp );
// would a GenericGI do?
57
58
59
int
setDefaultNumberOfSmooths
(
int
numberOfSmooths );
60
int
setMaximumNumberOfRefinementLevels
(
int
maxLevels );
61
62
// set scale factors for each component. Use these when scaling the errors.
63
int
setScaleFactor
(
RealArray
&
scaleFactor
);
64
65
int
setTopHatParameters
(
real
topHatCentre
[3],
real
topHatVelocity
[3],
real
topHatRadius
,
66
real
topHatRadiusX_=0. ,
real
topHatRadiusY_=0.,
real
topHatRadiusZ_=0.);
67
68
int
setWeights
(
real
weightFirstDifference
,
real
weightSecondDifference
);
69
70
int
get
(
const
GenericDataBase
& dir,
const
aString
& name);
71
72
int
put
(
GenericDataBase
& dir,
const
aString
& name)
const
;
73
74
int
update
(
GenericGraphicsInterface
& gi );
75
76
int
debug
;
77
78
protected
:
79
80
int
interpolateAndApplyBoundaryConditions
(
realCompositeGridFunction
& error,
CompositeGridOperators
& op );
81
int
smooth
(
realGridCollectionFunction
& error );
82
void
openDebugFile
();
83
84
real
weightFirstDifference
,
weightSecondDifference
;
85
86
real
topHatCentre
[3],
topHatVelocity
[3];
87
real
topHatRadius
,
topHatRadiusX
,
topHatRadiusY
,
topHatRadiusZ
;
88
89
RealArray
scaleFactor
;
90
91
InterpolateRefinements
*
interpolateRefinements
;
92
93
int
defaultNumberOfSmoothingSteps
;
94
int
maximumNumberOfRefinementLevels
;
// no need to compute errors on the finest level
95
96
int
myid
;
97
FILE *
debugFile
;
98
99
};
100
101
102
#endif
Generated on Fri Jan 4 2013 10:17:51 for Overture by
1.8.3