fUnit 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,49 @@
1
+ ! $Id: FluxFunctionsTS.ftk 112 2006-04-05 11:23:45Z kleb $
2
+
3
+ real :: leftState, rightState, interfaceFlux
4
+
5
+ beginSetup
6
+ leftState = 0
7
+ rightState = 1
8
+ endSetup
9
+
10
+ beginTest FluxZero
11
+ real :: state
12
+ state = 0
13
+ IsEqualWithin( Flux(state), 0, 0.00001 )
14
+ endTest
15
+
16
+ beginTest FluxOne
17
+ real :: state = 1
18
+ IsEqualWithin( Flux(state), 0.5, 0.00001 )
19
+ endTest
20
+
21
+ beginTest RoeAvgZero
22
+ IsRealEqual( RoeAvg(0.0,0.0), 0 )
23
+ IsFalse( RoeAvg(0.0,0.0).ne.1 )
24
+ endTest
25
+
26
+ beginTest RoeAvgKnown
27
+ IsRealEqual( RoeAvg(leftState,rightState), 0.5 )
28
+ IsTrue( RoeAvg(leftState,rightState).lt.0 )
29
+ endTest
30
+
31
+ beginTest CentralFluxKnown
32
+ call CentralFlux( leftState, rightState, interfaceFlux )
33
+ IsEqualWithin( interfaceFlux, 0.5, 0.001 )
34
+ IsEqualWithin( interfaceFlux, 0.5, 0.00000001 )
35
+ IsEqual( interfaceFlux, 0.5 )
36
+ endTest
37
+
38
+ beginTest RoeFluxExpansionShock
39
+ leftState = -1
40
+ call RoeFlux( leftState, rightState, interfaceFlux )
41
+ IsEqual( interfaceFlux, 0 )
42
+ endTest
43
+
44
+ beginTest RoeFluxZero
45
+ rightState = 0
46
+ call RoeFlux( leftState, rightState, interfaceFlux )
47
+ IsRealEqual( interfaceFlux, 0 )
48
+ IsEqual( interfaceFlux, 0 )
49
+ endTest
@@ -0,0 +1,554 @@
1
+ %!PS-Adobe-3.0
2
+ %%BoundingBox: 24 24 588 768
3
+ %%Title: Enscript Output
4
+ %%For: Bil Kleb
5
+ %%Creator: GNU enscript 1.6.1
6
+ %%CreationDate: Wed Nov 7 08:20:18 2001
7
+ %%Orientation: Landscape
8
+ %%Pages: (atend)
9
+ %%DocumentMedia: Letter 612 792 0 () ()
10
+ %%DocumentNeededResources: (atend)
11
+ %%EndComments
12
+ %%BeginProlog
13
+ %%BeginResource: procset Enscript-Prolog 1.6 1
14
+ %
15
+ % Procedures.
16
+ %
17
+
18
+ /_S { % save current state
19
+ /_s save def
20
+ } def
21
+ /_R { % restore from saved state
22
+ _s restore
23
+ } def
24
+
25
+ /S { % showpage protecting gstate
26
+ gsave
27
+ showpage
28
+ grestore
29
+ } bind def
30
+
31
+ /MF { % fontname newfontname -> - make a new encoded font
32
+ /newfontname exch def
33
+ /fontname exch def
34
+
35
+ /fontdict fontname findfont def
36
+ /newfont fontdict maxlength dict def
37
+
38
+ fontdict {
39
+ exch
40
+ dup /FID eq {
41
+ % skip FID pair
42
+ pop pop
43
+ } {
44
+ % copy to the new font dictionary
45
+ exch newfont 3 1 roll put
46
+ } ifelse
47
+ } forall
48
+
49
+ newfont /FontName newfontname put
50
+
51
+ % insert only valid encoding vectors
52
+ encoding_vector length 256 eq {
53
+ newfont /Encoding encoding_vector put
54
+ } if
55
+
56
+ newfontname newfont definefont pop
57
+ } def
58
+
59
+ /SF { % fontname width height -> - set a new font
60
+ /height exch def
61
+ /width exch def
62
+
63
+ findfont
64
+ [width 0 0 height 0 0] makefont setfont
65
+ } def
66
+
67
+ /SUF { % fontname width height -> - set a new user font
68
+ /height exch def
69
+ /width exch def
70
+
71
+ /F-gs-user-font MF
72
+ /F-gs-user-font width height SF
73
+ } def
74
+
75
+ /M {moveto} bind def
76
+ /s {show} bind def
77
+
78
+ /Box { % x y w h -> - define box path
79
+ /d_h exch def /d_w exch def /d_y exch def /d_x exch def
80
+ d_x d_y moveto
81
+ d_w 0 rlineto
82
+ 0 d_h rlineto
83
+ d_w neg 0 rlineto
84
+ closepath
85
+ } def
86
+
87
+ /bgs { % x y height blskip gray str -> - show string with bg color
88
+ /str exch def
89
+ /gray exch def
90
+ /blskip exch def
91
+ /height exch def
92
+ /y exch def
93
+ /x exch def
94
+
95
+ gsave
96
+ x y blskip sub str stringwidth pop height Box
97
+ gray setgray
98
+ fill
99
+ grestore
100
+ x y M str s
101
+ } def
102
+
103
+ % Highlight bars.
104
+ /highlight_bars { % nlines lineheight output_y_margin gray -> -
105
+ gsave
106
+ setgray
107
+ /ymarg exch def
108
+ /lineheight exch def
109
+ /nlines exch def
110
+
111
+ % This 2 is just a magic number to sync highlight lines to text.
112
+ 0 d_header_y ymarg sub 2 sub translate
113
+
114
+ /cw d_output_w cols div def
115
+ /nrows d_output_h ymarg 2 mul sub lineheight div cvi def
116
+
117
+ % for each column
118
+ 0 1 cols 1 sub {
119
+ cw mul /xp exch def
120
+
121
+ % for each rows
122
+ 0 1 nrows 1 sub {
123
+ /rn exch def
124
+ rn lineheight mul neg /yp exch def
125
+ rn nlines idiv 2 mod 0 eq {
126
+ % Draw highlight bar. 4 is just a magic indentation.
127
+ xp 4 add yp cw 8 sub lineheight neg Box fill
128
+ } if
129
+ } for
130
+ } for
131
+
132
+ grestore
133
+ } def
134
+
135
+ % Line highlight bar.
136
+ /line_highlight { % x y width height gray -> -
137
+ gsave
138
+ /gray exch def
139
+ Box gray setgray fill
140
+ grestore
141
+ } def
142
+
143
+ % Column separator lines.
144
+ /column_lines {
145
+ gsave
146
+ .1 setlinewidth
147
+ 0 d_footer_h translate
148
+ /cw d_output_w cols div def
149
+ 1 1 cols 1 sub {
150
+ cw mul 0 moveto
151
+ 0 d_output_h rlineto stroke
152
+ } for
153
+ grestore
154
+ } def
155
+
156
+ % Column borders.
157
+ /column_borders {
158
+ gsave
159
+ .1 setlinewidth
160
+ 0 d_footer_h moveto
161
+ 0 d_output_h rlineto
162
+ d_output_w 0 rlineto
163
+ 0 d_output_h neg rlineto
164
+ closepath stroke
165
+ grestore
166
+ } def
167
+
168
+ % Do the actual underlay drawing
169
+ /draw_underlay {
170
+ ul_style 0 eq {
171
+ ul_str true charpath stroke
172
+ } {
173
+ ul_str show
174
+ } ifelse
175
+ } def
176
+
177
+ % Underlay
178
+ /underlay { % - -> -
179
+ gsave
180
+ 0 d_page_h translate
181
+ d_page_h neg d_page_w atan rotate
182
+
183
+ ul_gray setgray
184
+ ul_font setfont
185
+ /dw d_page_h dup mul d_page_w dup mul add sqrt def
186
+ ul_str stringwidth pop dw exch sub 2 div ul_h_ptsize -2 div moveto
187
+ draw_underlay
188
+ grestore
189
+ } def
190
+
191
+ /user_underlay { % - -> -
192
+ gsave
193
+ ul_x ul_y translate
194
+ ul_angle rotate
195
+ ul_gray setgray
196
+ ul_font setfont
197
+ 0 0 ul_h_ptsize 2 div sub moveto
198
+ draw_underlay
199
+ grestore
200
+ } def
201
+
202
+ % Page prefeed
203
+ /page_prefeed { % bool -> -
204
+ statusdict /prefeed known {
205
+ statusdict exch /prefeed exch put
206
+ } {
207
+ pop
208
+ } ifelse
209
+ } def
210
+
211
+ % Wrapped line markers
212
+ /wrapped_line_mark { % x y charwith charheight type -> -
213
+ /type exch def
214
+ /h exch def
215
+ /w exch def
216
+ /y exch def
217
+ /x exch def
218
+
219
+ type 2 eq {
220
+ % Black boxes (like TeX does)
221
+ gsave
222
+ 0 setlinewidth
223
+ x w 4 div add y M
224
+ 0 h rlineto w 2 div 0 rlineto 0 h neg rlineto
225
+ closepath fill
226
+ grestore
227
+ } {
228
+ type 3 eq {
229
+ % Small arrows
230
+ gsave
231
+ .2 setlinewidth
232
+ x w 2 div add y h 2 div add M
233
+ w 4 div 0 rlineto
234
+ x w 4 div add y lineto stroke
235
+
236
+ x w 4 div add w 8 div add y h 4 div add M
237
+ x w 4 div add y lineto
238
+ w 4 div h 8 div rlineto stroke
239
+ grestore
240
+ } {
241
+ % do nothing
242
+ } ifelse
243
+ } ifelse
244
+ } def
245
+
246
+ % EPSF import.
247
+
248
+ /BeginEPSF {
249
+ /b4_Inc_state save def % Save state for cleanup
250
+ /dict_count countdictstack def % Count objects on dict stack
251
+ /op_count count 1 sub def % Count objects on operand stack
252
+ userdict begin
253
+ /showpage { } def
254
+ 0 setgray 0 setlinecap
255
+ 1 setlinewidth 0 setlinejoin
256
+ 10 setmiterlimit [ ] 0 setdash newpath
257
+ /languagelevel where {
258
+ pop languagelevel
259
+ 1 ne {
260
+ false setstrokeadjust false setoverprint
261
+ } if
262
+ } if
263
+ } bind def
264
+
265
+ /EndEPSF {
266
+ count op_count sub { pos } repeat % Clean up stacks
267
+ countdictstack dict_count sub { end } repeat
268
+ b4_Inc_state restore
269
+ } bind def
270
+
271
+ % Check PostScript language level.
272
+ /languagelevel where {
273
+ pop /gs_languagelevel languagelevel def
274
+ } {
275
+ /gs_languagelevel 1 def
276
+ } ifelse
277
+ %%EndResource
278
+ %%BeginResource: procset Enscript-Encoding-88591 1.6 1
279
+ /encoding_vector [
280
+ /.notdef /.notdef /.notdef /.notdef
281
+ /.notdef /.notdef /.notdef /.notdef
282
+ /.notdef /.notdef /.notdef /.notdef
283
+ /.notdef /.notdef /.notdef /.notdef
284
+ /.notdef /.notdef /.notdef /.notdef
285
+ /.notdef /.notdef /.notdef /.notdef
286
+ /.notdef /.notdef /.notdef /.notdef
287
+ /.notdef /.notdef /.notdef /.notdef
288
+ /space /exclam /quotedbl /numbersign
289
+ /dollar /percent /ampersand /quoteright
290
+ /parenleft /parenright /asterisk /plus
291
+ /comma /hyphen /period /slash
292
+ /zero /one /two /three
293
+ /four /five /six /seven
294
+ /eight /nine /colon /semicolon
295
+ /less /equal /greater /question
296
+ /at /A /B /C
297
+ /D /E /F /G
298
+ /H /I /J /K
299
+ /L /M /N /O
300
+ /P /Q /R /S
301
+ /T /U /V /W
302
+ /X /Y /Z /bracketleft
303
+ /backslash /bracketright /asciicircum /underscore
304
+ /quoteleft /a /b /c
305
+ /d /e /f /g
306
+ /h /i /j /k
307
+ /l /m /n /o
308
+ /p /q /r /s
309
+ /t /u /v /w
310
+ /x /y /z /braceleft
311
+ /bar /braceright /tilde /.notdef
312
+ /.notdef /.notdef /.notdef /.notdef
313
+ /.notdef /.notdef /.notdef /.notdef
314
+ /.notdef /.notdef /.notdef /.notdef
315
+ /.notdef /.notdef /.notdef /.notdef
316
+ /.notdef /.notdef /.notdef /.notdef
317
+ /.notdef /.notdef /.notdef /.notdef
318
+ /.notdef /.notdef /.notdef /.notdef
319
+ /.notdef /.notdef /.notdef /.notdef
320
+ /space /exclamdown /cent /sterling
321
+ /currency /yen /brokenbar /section
322
+ /dieresis /copyright /ordfeminine /guillemotleft
323
+ /logicalnot /hyphen /registered /macron
324
+ /degree /plusminus /twosuperior /threesuperior
325
+ /acute /mu /paragraph /bullet
326
+ /cedilla /onesuperior /ordmasculine /guillemotright
327
+ /onequarter /onehalf /threequarters /questiondown
328
+ /Agrave /Aacute /Acircumflex /Atilde
329
+ /Adieresis /Aring /AE /Ccedilla
330
+ /Egrave /Eacute /Ecircumflex /Edieresis
331
+ /Igrave /Iacute /Icircumflex /Idieresis
332
+ /Eth /Ntilde /Ograve /Oacute
333
+ /Ocircumflex /Otilde /Odieresis /multiply
334
+ /Oslash /Ugrave /Uacute /Ucircumflex
335
+ /Udieresis /Yacute /Thorn /germandbls
336
+ /agrave /aacute /acircumflex /atilde
337
+ /adieresis /aring /ae /ccedilla
338
+ /egrave /eacute /ecircumflex /edieresis
339
+ /igrave /iacute /icircumflex /idieresis
340
+ /eth /ntilde /ograve /oacute
341
+ /ocircumflex /otilde /odieresis /divide
342
+ /oslash /ugrave /uacute /ucircumflex
343
+ /udieresis /yacute /thorn /ydieresis
344
+ ] def
345
+ %%EndResource
346
+ %%EndProlog
347
+ %%BeginSetup
348
+ %%IncludeResource: font Times-Roman
349
+ %%IncludeResource: font Courier-Bold
350
+ /HFpt_w 10 def
351
+ /HFpt_h 10 def
352
+ /Courier-Bold /HF-gs-font MF
353
+ /HF /HF-gs-font findfont [HFpt_w 0 0 HFpt_h 0 0] makefont def
354
+ /Times-Roman /F-gs-font MF
355
+ /F-gs-font 14 14 SF
356
+ /#copies 1 def
357
+ % Pagedevice definitions:
358
+ gs_languagelevel 1 gt {
359
+ <<
360
+ /PageSize [612 792]
361
+ >> setpagedevice
362
+ } if
363
+ %%BeginResource: procset Enscript-Header-enscript 1.6 1
364
+ %%IncludeResource: font Times-Bold
365
+
366
+ % Fonts.
367
+ /Times-Bold /HeaderFont-Bold MF
368
+ /HeaderDateF /HeaderFont-Bold findfont 12 scalefont def
369
+
370
+ /Times-Roman /HeaderFont-Times MF
371
+ /HeaderHDRF /HeaderFont-Times findfont 14 scalefont def
372
+
373
+ /HeaderPageNumF /Helvetica-Bold findfont 28.8 scalefont def
374
+
375
+ /do_header { % print enscript header
376
+ gsave
377
+ d_header_x d_header_y translate
378
+
379
+ % light bar
380
+ 0 0 d_header_w d_header_h 2 div Box
381
+ .95 setgray fill
382
+
383
+ % dark gray boxes
384
+ /dbw d_header_h 2 mul def % dark box width
385
+ /dbc .7 def % dark box color
386
+
387
+ % left dark box.
388
+ 0 0 dbw d_header_h Box
389
+ dbc setgray fill
390
+
391
+ 0 setgray
392
+ HeaderDateF setfont
393
+ moddatestr dup stringwidth pop dbw exch sub 2 div
394
+ d_header_h 2 div 2 add moveto show
395
+ modtimestr dup stringwidth pop dbw exch sub 2 div
396
+ d_header_h 5 div moveto show
397
+
398
+ % right dark box
399
+ d_header_w dbw sub 0 dbw d_header_h Box
400
+ dbc setgray fill
401
+
402
+ HeaderPageNumF setfont
403
+ 1 setgray
404
+ pagenumstr dup
405
+ stringwidth pop dbw exch sub 2 div d_header_w dbw sub add
406
+ d_header_h .2 mul moveto show
407
+
408
+ % filename
409
+ 0 setgray
410
+ HeaderHDRF setfont
411
+ d_header_w fname stringwidth pop sub 2 div d_header_h 8 div moveto
412
+ fname show
413
+
414
+ % user supplied header string.
415
+ user_header_p {
416
+ /h d_header_h 8 div 5 mul def
417
+
418
+ % Implement strict enscript compatibility.
419
+ user_header_center_str () eq user_header_right_str () eq and {
420
+ d_header_w user_header_left_str stringwidth pop sub 2 div
421
+ h moveto user_header_left_str show
422
+ } {
423
+ dbw 5 add h moveto user_header_left_str show
424
+
425
+ d_header_w user_header_center_str stringwidth pop sub 2 div
426
+ h moveto user_header_center_str show
427
+
428
+ d_header_w dbw sub 5 sub user_header_right_str stringwidth pop
429
+ sub h moveto user_header_right_str show
430
+ } ifelse
431
+ } if
432
+
433
+ grestore
434
+ } def
435
+ %%EndResource
436
+ /d_page_w 744 def
437
+ /d_page_h 564 def
438
+ /d_header_x 0 def
439
+ /d_header_y 528 def
440
+ /d_header_w 744 def
441
+ /d_header_h 36 def
442
+ /d_footer_x 0 def
443
+ /d_footer_y 0 def
444
+ /d_footer_w 744 def
445
+ /d_footer_h 0 def
446
+ /d_output_w 744 def
447
+ /d_output_h 528 def
448
+ /cols 2 def
449
+ %%EndSetup
450
+ %%Page: (1) 1
451
+ %%BeginPageSetup
452
+ _S
453
+ 90 rotate
454
+ 24 -588 translate
455
+ /pagenum 1 def
456
+ /fname (FluxFunctionsTS.ftk) def
457
+ /fdir () def
458
+ /ftail (FluxFunctionsTS.ftk) def
459
+ % User defined strings:
460
+ /pagenumstr (1) def
461
+ /moddatestr (11/07/01) def
462
+ /modtimestr (08:09:21) def
463
+ /user_header_p false def
464
+ %%EndPageSetup
465
+ column_lines
466
+ do_header
467
+ 5 511 M
468
+ (! $Id: FluxFunctionsTS.ftk,v 1.1 2001/10/25 15:45:02 cvs4bk E) s
469
+ 5 481 M
470
+ ( real :: leftState, rightState, interfaceFlux) s
471
+ 5 451 M
472
+ (beginSetup) s
473
+ 5 436 M
474
+ ( leftState = 0) s
475
+ 5 421 M
476
+ ( rightState = 1) s
477
+ 5 406 M
478
+ (endSetup) s
479
+ 5 376 M
480
+ (beginTest FluxZero) s
481
+ 5 361 M
482
+ ( real :: state) s
483
+ 5 346 M
484
+ ( state = 0) s
485
+ 5 331 M
486
+ ( IsEqualWithin\( Flux\(state\), 0, 0.00001 \)) s
487
+ 5 316 M
488
+ (endTest) s
489
+ 5 301 M
490
+ ( ) s
491
+ 5 286 M
492
+ (beginTest FluxOne) s
493
+ 5 271 M
494
+ ( real :: state = 1) s
495
+ 5 256 M
496
+ ( IsEqualWithin\( Flux\(state\), 0.5, 0.00001 \)) s
497
+ 5 241 M
498
+ (endTest) s
499
+ 5 211 M
500
+ (beginTest RoeAvgZero) s
501
+ 5 196 M
502
+ ( IsRealEqual\( RoeAvg\(0.0,0.0\), 0 \)) s
503
+ 5 181 M
504
+ ( IsFalse\( RoeAvg\(0.0,0.0\).ne.1 \)) s
505
+ 5 166 M
506
+ (endTest) s
507
+ 5 136 M
508
+ (beginTest RoeAvgKnown) s
509
+ 5 121 M
510
+ ( IsRealEqual\( RoeAvg\(leftState,rightState\), 0.5 \)) s
511
+ 5 106 M
512
+ ( IsTrue\( RoeAvg\(leftState,rightState\).lt.0 \)) s
513
+ 5 91 M
514
+ (endTest) s
515
+ 5 61 M
516
+ (beginTest CentralFluxKnown) s
517
+ 5 46 M
518
+ ( call CentralFlux\( leftState, rightState, interfaceFlux \)) s
519
+ 5 31 M
520
+ ( IsEqualWithin\( interfaceFlux, 0.5, 0.001 \)) s
521
+ 5 16 M
522
+ ( IsEqualWithin\( interfaceFlux, 0.5, 0.00000001 \)) s
523
+ 377 511 M
524
+ ( IsEqual\( interfaceFlux, 0.5 \)) s
525
+ 377 496 M
526
+ (endTest) s
527
+ 377 466 M
528
+ (beginTest RoeFluxExpansionShock) s
529
+ 377 451 M
530
+ ( leftState = -1) s
531
+ 377 436 M
532
+ ( call RoeFlux\( leftState, rightState, interfaceFlux \)) s
533
+ 377 421 M
534
+ ( IsEqual\( interfaceFlux, 0 \)) s
535
+ 377 406 M
536
+ (endTest) s
537
+ 377 376 M
538
+ (beginTest RoeFluxZero) s
539
+ 377 361 M
540
+ ( rightState = 0) s
541
+ 377 346 M
542
+ ( call RoeFlux\( leftState, rightState, interfaceFlux \)) s
543
+ 377 331 M
544
+ ( IsRealEqual\( interfaceFlux, 0 \)) s
545
+ 377 316 M
546
+ ( IsEqual\( interfaceFlux, 0 \)) s
547
+ 377 301 M
548
+ (endTest) s
549
+ _R
550
+ S
551
+ %%Trailer
552
+ %%Pages: 1
553
+ %%DocumentNeededResources: font Times-Roman Courier-Bold Times-Bold
554
+ %%EOF
@@ -0,0 +1,19 @@
1
+ ! $Id: GasModel.f90 112 2006-04-05 11:23:45Z kleb $
2
+ module GasModel
3
+
4
+ ! use Gammas !! not handled yet
5
+
6
+ implicit none
7
+
8
+ real, parameter :: Gamma = 1.4
9
+
10
+ contains
11
+
12
+ subroutine PerfectP (Density, Energy, Pressure)
13
+ real, intent(in) :: Density
14
+ real, intent(in) :: Energy
15
+ real, intent(out) :: Pressure
16
+ Pressure = Density * Energy * ( Gamma - 1.0 )
17
+ end subroutine PerfectP
18
+
19
+ end module GasModel