Overture
Version 25
Main Page
Namespaces
Classes
Files
File List
File Members
Overture.v25.d
include
ReparameterizationTransform.h
Go to the documentation of this file.
1
#ifndef REPARAMETERIZATION_TRANSFORM
2
#define REPARAMETERIZATION_TRANSFORM
3
4
#include "
ComposeMapping.h
"
5
6
class
OrthographicTransform
;
7
8
class
ReparameterizationTransform
:
public
ComposeMapping
9
{
10
//----------------------------------------------------------------
11
// Reparameterize a Mapping in various ways
12
// ----------------------------------------
13
//
14
//----------------------------------------------------------------
15
public
:
16
17
enum
ReparameterizationTypes
18
{
19
defaultReparameterization
,
20
orthographic
,
21
restriction
,
22
equidistribution
,
23
reorientDomainCoordinates
24
};
25
26
27
public
:
28
29
ReparameterizationTransform
( );
30
//
31
// Constructor, supply a Mapping to reparameterize
32
// It will replace multiple reparams with just one reparam if map is actually of this class
33
ReparameterizationTransform
(
Mapping
&
map
,
const
ReparameterizationTypes
type=
defaultReparameterization
);
34
ReparameterizationTransform
(
MappingRC
& mapRC,
const
ReparameterizationTypes
type=
defaultReparameterization
);
35
36
// Copy constructor is deep by default
37
ReparameterizationTransform
(
const
ReparameterizationTransform
&,
const
CopyType
copyType=
DEEP
);
38
39
// Copy like constructor that makes a deep copy of all but the transformed grid which is replaced
40
ReparameterizationTransform
(
const
ReparameterizationTransform
&,
MappingRC
&
map
);
41
42
~ReparameterizationTransform
();
43
44
ReparameterizationTransform
&
operator =
(
const
ReparameterizationTransform
& X );
45
46
// set equidistribution parameterization parameters
47
int
setEquidistributionParameters
(
const
real
&
arcLengthWeight
=1.,
48
const
real
&
curvatureWeight
=0.,
49
const
int
& numberOfSmooths = 3 );
50
51
void
map
(
const
realArray
&
r
,
realArray
& x,
realArray
& xr =
Overture::nullRealDistributedArray
(),
52
MappingParameters
& params =
Overture::nullMappingParameters
() );
53
54
void
inverseMap
(
const
realArray
& x,
realArray
& r,
realArray
& rx =
Overture::nullRealDistributedArray
(),
55
MappingParameters
& params =
Overture::nullMappingParameters
() );
56
57
void
basicInverse
(
const
realArray
& x,
realArray
& r,
realArray
& rx=
Overture::nullRealDistributedArray
(),
58
MappingParameters
& params=
Overture::nullMappingParameters
());
59
60
void
mapS
(
const
RealArray
& r,
RealArray
& x,
RealArray
&xr =
Overture::nullRealArray
(),
61
MappingParameters
& params =
Overture::nullMappingParameters
());
62
63
void
inverseMapS
(
const
RealArray
& x,
RealArray
& r,
RealArray
& rx =
Overture::nullRealArray
(),
64
MappingParameters
& params =
Overture::nullMappingParameters
() );
65
66
void
basicInverseS
(
const
RealArray
& x,
67
RealArray
& r,
68
RealArray
& rx =
Overture::nullRealArray
(),
69
MappingParameters
& params =
Overture::nullMappingParameters
());
70
71
72
virtual
int
get
(
const
GenericDataBase
& dir,
const
aString
& name);
// get from a database file
73
virtual
int
put
(
GenericDataBase
& dir,
const
aString
& name)
const
;
// put to a database file
74
75
Mapping
*
make
(
const
aString
&
mappingClassName
);
76
77
aString
getClassName
()
const
{
return
ReparameterizationTransform::className
; }
78
79
Mapping
*
getReparameterizeMapping
()
const
{
return
reparameterize
;}
80
81
int
update
(
MappingInformation
& mapInfo ) ;
82
83
// scale the current bounds for a restriction mapping
84
int
scaleBounds
(
const
real
ra=0.,
85
const
real
rb=1.,
86
const
real
sa=0.,
87
const
real
sb=1.,
88
const
real
ta=0.,
89
const
real
tb=1. );
90
// set absolute bounds for a restriction mapping
91
int
setBounds
(
const
real
ra=0.,
92
const
real
rb=1.,
93
const
real
sa=0.,
94
const
real
sb=1.,
95
const
real
ta=0.,
96
const
real
tb=1. );
97
98
int
getBounds
(
real
& ra,
real
& rb,
real
& sa,
real
& sb,
real
& ta,
real
& tb )
const
;
99
100
int
getBoundsForMultipleReparameterizations
(
real
& ra,
real
& rb,
real
& sa,
real
& sb,
real
& ta,
real
& tb )
const
;
101
102
int
getBoundsForMultipleReparameterizations
(
real
mrBounds[6] )
const
;
103
int
setBoundsForMultipleReparameterizations
(
real
mrBounds[6] );
104
105
virtual
RealArray
getBoundingBox
(
const
int
& side=-1,
const
int
& axis=-1 )
const
;
106
virtual
int
getBoundingBox
(
const
IntegerArray
& indexRange,
const
IntegerArray
&
gridIndexRange
,
107
RealArray
& xBounds,
bool
local=
false
)
const
;
108
virtual
int
getBoundingBox
(
const
RealArray
& rBounds,
RealArray
& xBounds )
const
;
109
110
enum
111
{
112
maximumNumberOfRecursionLevels
=10
113
};
114
115
116
117
protected
:
118
void
constructor
(
Mapping
&
map
,
const
ReparameterizationTypes
type);
119
void
constructorForMultipleReparams
(
ReparameterizationTransform
&
map
);
120
void
setMappingProperties
(
Mapping
*mapPointer);
121
122
int
initializeEquidistribution
(
const
bool
& useOriginalMapping =
TRUE
);
123
124
protected
:
125
aString
className
;
126
Mapping
*
reparameterize
;
// points to either orthographic or restriction or Reorient
127
public
:
128
// needed so we can invert in a different coordinate system:
129
// (make public so we can delete in initStaticMappingVariables)
130
static
MappingParameters
*
localParams
[
maximumNumberOfRecursionLevels
];
131
protected
:
132
static
int
localParamsAreBeingUsed
[
maximumNumberOfRecursionLevels
];
133
int
coordinateType
;
134
ReparameterizationTypes
reparameterizationType
;
135
real
arcLengthWeight
,
curvatureWeight
;
136
int
numberOfEquidistributionSmooths
;
137
bool
equidistributionInitialized
;
138
real
mr
[6];
// for multiple compositions of restriction mappings -- keep scaling to original
139
140
private
:
141
142
//
143
// Virtual member functions used only through class ReferenceCounting:
144
//
145
virtual
ReferenceCounting
&
operator=
(
const
ReferenceCounting
& x)
146
{
return
operator=
((
ReparameterizationTransform
&)x); }
147
virtual
void
reference(
const
ReferenceCounting
& x)
148
{ reference((
ReparameterizationTransform
&)x); }
149
virtual
ReferenceCounting
* virtualConstructor(
const
CopyType
ct =
DEEP
)
const
150
{ return ::new
ReparameterizationTransform
(*
this
, ct); }
151
};
152
153
154
#endif
Generated on Fri Jan 4 2013 10:17:58 for Overture by
1.8.3