Skip to content

Commit 8630173

Browse files
committed
move constants into module consts.
1 parent 5953332 commit 8630173

File tree

2 files changed

+47
-14
lines changed

2 files changed

+47
-14
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#***********************************************************************
2+
# Copyright 2006 John A. Trangenstein
3+
#
4+
# This software is made available for research and instructional use
5+
# only.
6+
# You may copy and use this software without charge for these
7+
# non-commercial purposes, provided that the copyright notice and
8+
# associated text is reproduced on all copies.
9+
# For all other uses (including distribution of modified versions),
10+
# please contact the author at
11+
# John A. Trangenstein
12+
# Department of Mathematics
13+
# Duke University
14+
# Durham, NC 27708-0320
15+
# USA
16+
# or
17+
18+
#
19+
# This software is made available "as is" without any assurance that it
20+
# is completely correct, or that it will work for your purposes.
21+
# Use the software at your own risk.
22+
#***********************************************************************
23+
24+
module consts
25+
26+
const roundoff = 1.0-14
27+
const small = 1.0-20
28+
const huge = 1.0e300
29+
const undefind = 1.0e300
30+
const lnrndoff = 14.0e0
31+
const lnsmall = 20.0e0
32+
33+
# problem-specific parameters:
34+
const jump = 0.0
35+
const x_left = -0.2
36+
const x_right = 1.0
37+
const statelft = 2.0
38+
const statergt = 0.0
39+
const velocity = 1.0
40+
41+
export roundoff, huge, jump, x_left, x_right, statelft, statergt, velocity
42+
43+
end
44+

examples/scalar_law/PROGRAM1/linaddmain.jl

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,9 @@
2323

2424
using OffsetArrays
2525

26-
const roundoff = 1.0-14
27-
const small = 1.0-20
28-
const huge = 1.0e300
29-
const undefind = 1.0e300
30-
const lnrndoff = 14.0e0
31-
const lnsmall = 20.0e0
32-
33-
# problem-specific parameters:
34-
const jump = 0.0
35-
const x_left = -0.2
36-
const x_right = 1.0
37-
const statelft = 2.0
38-
const statergt = 0.0
39-
const velocity = 1.0
26+
include("consts.jl")
27+
28+
using consts
4029

4130
include("riemprob.jl")
4231
include("linearad.jl")

0 commit comments

Comments
 (0)