forked from johannesgerer/jburkardt-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblend.html
283 lines (252 loc) · 8.33 KB
/
blend.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
<html>
<head>
<title>
BLEND - Transfinite Interpolation
</title>
</head>
<body bgcolor="#EEEEEE" link="#CC0000" alink="#FF3300" vlink="#000055">
<h1 align = "center">
BLEND <br> Transfinite Interpolation
</h1>
<hr>
<p>
<b>BLEND</b>
is a C++ library which
"blends" data.
</p>
<p>
This is a common way of creating a smooth set of data based on
a small set of known values. For instance, if we measure the
temperature every hour, we naturally assume that the temperature
at 2:15 can be approximated by "blending" 1/4 of the temperature
at 3:00 and 3/4 of the temperature at 2:00.
</p>
<p>
Now suppose that we take the temperature at evenly spaced points
on the floor of a room. We can again see how to use blending so
that, in each little square, we take a blend of the values at the
four corners to get the value at any point within the square.
Similar ideas can be used with a cube.
</p>
<p>
More complicated cases might arise where we know the temperature
everywhere along lines, or along planes that cut through a cube.
Even then, it is possible to blend the data in a smooth and
sensible way.
</p>
<p>
<b>BLEND</b> interpolates values based on a set of given data.
<b>BLEND</b> can handle input data that is 1, 2, or 3 dimensional.
In the general, 3D case, the data can depend on smoothly varying
space parameters (R,S,T) or on tabular indices (I,J,K). The data
may be given at the corners, edges, or faces of the unit cube.
In the (R,S,T) case, <b>BLEND</b> can supply an interpolated value at
any point in the cube. In the (I,J,K) case, <b>BLEND</b> will fill in
tabular values for all intermediate indices.
</p>
<p>
In the simplest case, where <b>BLEND</b> is only given data values at the
endpoints of a line segment, the 4 corners of a square, or the 8
corners of a cube, <b>BLEND</b> is equivalent to linear, bilinear
or trilinear finite element interpolation of the data. However,
in the more interesting cases where <b>BLEND</b> is given, say, a formula
for the data along the sides of the square, or the edges of the
cube, the interpolation is called "transfinite", since in theory
it samples the input data at more than a finite number of points.
</p>
<h3 align = "center">
Licensing:
</h3>
<p>
The computer code and data files made available on this web page
are distributed under
<a href = "../../txt/gnu_lgpl.txt">the GNU LGPL license.</a>
</p>
<h3 align = "center">
Languages:
</h3>
<p>
<b>BLEND</b> is available in
<a href = "../../c_src/blend/blend.html">a C version</a> and
<a href = "../../cpp_src/blend/blend.html">a C++ version</a> and
<a href = "../../f77_src/blend/blend.html">a FORTRAN77 version</a> and
<a href = "../../f_src/blend/blend.html">a FORTRAN90 version</a> and
<a href = "../../m_src/blend/blend.html">a MATLAB version</a>.
</p>
<h3 align = "center">
Related Data and Programs:
</h3>
<p>
<a href = "../../f_src/tiler_2d/tiler_2d.html">
TILER_2D</a>,
a FORTRAN90 program which
provides an interesting example of the use of transfinite interpolation
for 2D data.
</p>
<p>
<a href = "../../cpp_src/tiler_3d/tiler_3d.html">
TILER_3D</a>,
a C++ program which
provides an interesting example of the use of transfinite interpolation
for 3D data.
</p>
<h3 align = "center">
Reference:
</h3>
<p>
<ol>
<li>
William Gordon,<br>
Blending-Function Methods of Bivariate and Multivariate
Interpolation and Approximation,<br>
SIAM Journal on Numerical Analysis,<br>
Volume 8, Number 1, March 1971, pages 158-177.
</li>
<li>
William Gordon, Charles Hall,<br>
Transfinite Element Methods: Blending-Function Interpolation over
Arbitrary Curved Element Domains,<br>
Numerische Mathematik,<br>
Volume 21, Number 1, February 1973, pages 109-129.
</li>
<li>
William Gordon, Charles Hall,<br>
Construction of Curvilinear Coordinate Systems and Application to
Mesh Generation,<br>
International Journal of Numerical Methods in Engineering,<br>
Volume 7, 1973, pages 461-477.
</li>
<li>
Charles Hall, Thomas Porsching,<br>
Numerical Analysis of Partial Differential Equations,<br>
Prentice-Hall, 1990,<br>
ISBN: 013626557X,<br>
LC: QA374.H29.
</li>
<li>
Joe Thompson, Bharat Soni, Nigel Weatherill,<br>
Handbook of Grid Generation,<br>
CRC Press, 1999,<br>
ISBN: 0849326877.
</li>
</ol>
</p>
<h3 align = "center">
Source Code:
</h3>
<p>
<ul>
<li>
<a href = "blend.cpp">blend.cpp</a>, the source code;
</li>
<li>
<a href = "blend.hpp">blend.hpp</a>, the include file;
</li>
<li>
<a href = "blend.sh">blend.sh</a>,
commands to compile the source code;
</li>
</ul>
</p>
<h3 align = "center">
Examples and Tests:
</h3>
<p>
<ul>
<li>
<a href = "blend_prb.cpp">blend_prb.cpp</a>, the calling program;
</li>
<li>
<a href = "blend_prb.sh">blend_prb.sh</a>,
commands to compile, link and run the calling program;
</li>
<li>
<a href = "blend_prb_output.txt">blend_prb_output.txt</a>,
the output file.
</li>
</ul>
</p>
<h3 align = "center">
List of Routines:
</h3>
<p>
<ul>
<li>
<b>BLEND_0D1</b> extends scalar data at endpoints to a line.
</li>
<li>
<b>BLEND_1D1</b> extends scalar data along the boundary into a square.
</li>
<li>
<b>BLEND_2D1</b> extends scalar data along the surface into a cube.
</li>
<li>
<b>BLEND_I_0D1</b> extends indexed scalar data at endpoints along a line.
</li>
<li>
<b>BLEND_IJ_0D1</b> extends indexed scalar data at corners into a table.
</li>
<li>
<b>BLEND_IJ_1D1</b> extends indexed scalar data along edges into a table.
</li>
<li>
<b>BLEND_IJK_0D1</b> extends indexed scalar data along corners into a cubic table.
</li>
<li>
<b>BLEND_IJK_1D1</b> extends indexed scalar data along "edges" into a cubic table.
</li>
<li>
<b>BLEND_IJK_2D1</b> extends indexed scalar data along faces into a cubic table.
</li>
<li>
<b>BLEND_R_0DN</b> extends vector data at endpoints into a line.
</li>
<li>
<b>BLEND_RS_0DN</b> extends vector data at corners into a square.
</li>
<li>
<b>BLEND_RS_1DN</b> extends vector data along sides into a square.
</li>
<li>
<b>BLEND_RST_0DN</b> extends vector data at corners into a cube.
</li>
<li>
<b>BLEND_RST_1DN</b> extends vector data on edges into a cube.
</li>
<li>
<b>BLEND_RST_2DN</b> extends vector data on faces into a cube.
</li>
<li>
<b>I4_MAX</b> returns the maximum of two I4's.
</li>
<li>
<b>I4_MIN</b> returns the minimum of two I4's.
</li>
<li>
<b>R8BLOCK_PRINT</b> prints a double precision block (a 3D matrix).
</li>
<li>
<b>R8MAT_PRINT</b> prints an R8MAT, with an optional title.
</li>
<li>
<b>R8MAT_PRINT_SOME</b> prints some of an R8MAT.
</li>
<li>
<b>S_LEN_TRIM</b> returns the length of a string to the last nonblank.
</li>
<li>
<b>TIMESTAMP</b> prints the current YMDHMS date as a time stamp.
</li>
</ul>
</p>
<p>
You can go up one level to <a href = "../cpp_src.html">
the C++ source codes</a>.
</p>
<hr>
<i>
Last revised on 22 October 2008.
</i>
<!-- John Burkardt -->
</body>
</html>