Overture
Version 25
Main Page
Namespaces
Classes
Files
File List
File Members
Overture.v25.d
include
StretchMapping.h
Go to the documentation of this file.
1
//
2
// Stretching
3
//
4
#ifndef STRETCH_H
5
#define STRETCH_H "Stretch.h"
6
7
#include "
Mapping.h
"
8
#include "
mathutil.h
"
9
10
class
StretchMapping
:
public
Mapping
{
11
//-------------------------------------------------------------
12
// Define stretching routines
13
//------------------------------------------------------------
14
15
16
public
:
17
18
enum
StretchingType
19
{
20
inverseHyperbolicTangent
=0,
21
hyperbolicTangent
,
22
exponential
,
23
exponentialBlend
,
24
exponentialToLinear
,
25
noStretching
,
26
linearSpacing
,
// from Philip Blakely -- not really linear
27
numberOfStretchingTypes
28
};
29
30
StretchMapping
(
const
StretchingType
&
stretchingType
=
noStretching
);
31
StretchMapping
(
const
int
numberOfLayers
,
const
int
numberOfIntervals
=0 );
32
33
// Copy constructor is deep by default
34
StretchMapping
(
const
StretchMapping
&,
const
CopyType
copyType=
DEEP
);
35
36
~StretchMapping
();
37
38
// assignment with = is a deep copy
39
StretchMapping
&
operator =
(
const
StretchMapping
& X );
40
41
int
setStretchingType
(
const
StretchingType
&
stretchingType
);
42
43
int
setNumberOfLayers
(
const
int
numberOfLayers
);
44
45
int
setNumberOfIntervals
(
const
int
numberOfIntervals
);
46
47
int
setLayerParameters
(
const
int
index,
const
real
a,
const
real
b,
const
real
c );
48
49
int
setIntervalParameters
(
const
int
index,
const
real
d,
const
real
e,
const
real
f );
50
51
int
setIsNormalized
(
const
bool
& trueOrFalse=
TRUE
);
52
53
int
setEndPoints
(
const
real
rmin,
const
real
rmax );
54
55
int
setScaleParameters
(
const
real
origin
,
const
real
scale
);
56
57
int
setNumberOfSplinePoints
(
const
int
numberOfSplinePoints
);
58
59
int
setIsPeriodic
(
const
int
trueOrFalse );
60
virtual
void
setIsPeriodic
(
const
int
axis,
const
periodicType
isPeriodic
);
61
62
int
setHyperbolicTangentParameters
(
const
real
&
a0
,
63
const
real
&
ar
,
64
const
real
&
a1
,
65
const
real
&
b1
,
66
const
real
&
c1
);
67
68
int
setExponentialParameters
(
const
real
&
a0
,
69
const
real
&
ar
,
70
const
real
&
a1
,
71
const
real
&
b1
,
72
const
real
&
c1
);
73
74
int
setExponentialToLinearParameters
(
const
real
& a,
75
const
real
& b,
76
const
real
& c );
77
78
int
setLinearSpacingParameters
(
const
real
&
a0
,
const
real
&
a1
);
79
80
int
initialize
( );
81
82
virtual
int
get
(
const
GenericDataBase
& dir,
const
aString
& name);
// get from a database file
83
virtual
int
put
(
GenericDataBase
& dir,
const
aString
& name)
const
;
// put to a database file
84
85
Mapping
*
make
(
const
aString
&
mappingClassName
);
86
87
aString
getClassName
()
const
{
return
StretchMapping::className
; }
88
89
void
display
(
const
aString
& label =
blankString
)
const
;
90
91
void
map
(
const
realArray
&
r
,
realArray
& x,
realArray
& xr =
Overture::nullRealDistributedArray
(),
92
MappingParameters
& params =
Overture::nullMappingParameters
() );
93
94
void
inverseMap
(
const
realArray
& x,
realArray
& r,
realArray
& rx =
Overture::nullRealDistributedArray
(),
95
MappingParameters
& params =
Overture::nullMappingParameters
() );
96
97
void
basicInverse
(
const
realArray
& x,
realArray
& r,
realArray
& rx =
Overture::nullRealDistributedArray
(),
98
MappingParameters
& params =
Overture::nullMappingParameters
() );
99
100
void
mapS
(
const
RealArray
& r,
RealArray
& x,
RealArray
&xr =
Overture::nullRealArray
(),
101
MappingParameters
& params =
Overture::nullMappingParameters
());
102
103
void
inverseMapS
(
const
RealArray
& x,
RealArray
& r,
RealArray
& rx =
Overture::nullRealArray
(),
104
MappingParameters
& params =
Overture::nullMappingParameters
() );
105
106
void
basicInverseS
(
const
RealArray
& x,
107
RealArray
& r,
108
RealArray
& rx =
Overture::nullRealArray
(),
109
MappingParameters
& params =
Overture::nullMappingParameters
());
110
111
int
update
(
MappingInformation
& mapInfo );
112
113
protected
:
114
115
aString
className
;
116
IntegerArray
iw
;
117
int
numberOfLayers
;
118
int
numberOfIntervals
;
119
int
numberOfSplinePoints
;
120
int
unInitialized
;
121
RealArray
rw
;
122
int
iopt
,
ierr
;
123
real
ra
,
rb
,
r0
,
r1
;
124
RealArray
abc
;
125
RealArray
def
;
126
127
StretchingType
stretchingType
;
128
bool
normalized
;
129
real
origin
,
scale
;
130
real
a0
,
ar
,
a1
,
b1
,
c1
;
131
real
a0Normalized
,
arNormalized
,
a1Normalized
;
132
133
void
setup
();
134
135
private
:
136
137
//
138
// Virtual member functions used only through class ReferenceCounting:
139
//
140
virtual
ReferenceCounting
&
operator=
(
const
ReferenceCounting
& x)
141
{
return
operator=
( (
StretchMapping
& )x); }
142
virtual
void
reference(
const
ReferenceCounting
& x)
143
{ reference((
StretchMapping
&)x); }
// *** Conversion to this class for the virtual = ****
144
virtual
ReferenceCounting
* virtualConstructor(
const
CopyType
ct =
DEEP
)
const
145
{ return ::new
StretchMapping
(*
this
, ct); }
146
};
147
148
149
150
#endif // STRETCH_H
Generated on Fri Jan 4 2013 10:17:59 for Overture by
1.8.3