Browse code

Перенёс тесты на метод Курганова-Тадмора в отдельный файл

Dmitrii Kashin authored on 19/05/2015 01:18:29
Showing 3 changed files
... ...
@@ -26,6 +26,7 @@
26 26
 	       (:file "solver2d-kurganov-tadmor" :depends-on ("grid2d-conservative"))
27 27
 	       (:file "march" :depends-on ("grid2d-conservative" "output-functions"))
28 28
 	       (:file "test2d-conservative" :depends-on ("field2d-conservative" "boundary-conditions" "march"))
29
+	       (:file "test2d-kurganov-tadmor" :depends-on ("field2d-conservative" "boundary-conditions" "march"))
29 30
 	       (:file "output-functions")
30 31
 	       
31 32
 	       
... ...
@@ -110,77 +110,4 @@
110 110
       )))
111 111
 
112 112
 
113
-(defun test-kt-constant (&key (cells-nx 2) (cells-ny 1) (cu 1) (output-dir #P"~/prog/clfpv/test-KT-constant/"))
114
-  "Тест на постоянном поле"
115
-  (ensure-directories-exist output-dir)
116
-  (let ((*DEFAULT-PATHNAME-DEFAULTS* output-dir))
117
-    (let ((grid (make-instance 'grid2d-cv
118
-			       :cells-amount-x cells-nx
119
-			       :cells-amount-y cells-ny
120
-			       :left-boundary-condition 'zeroe
121
-			       :right-boundary-condition 'zeroe
122
-			       :bottom-boundary-condition 'zeroe
123
-			       :top-boundary-condition 'zeroe)))
124
-
125
-      (when (>= *debug-level* 10)
126
-	(format t "1: ~%")
127
-	(print-grid grid :print-out-border t)
128
-	(format t "----~%~%"))
129
-
130
-      (init-grid grid
131
-		 :left-border-coord 0.0d0
132
-		 :right-border-coord 1.0d0
133
-		 :top-border-line (constant-function 1.0d0)
134
-		 :bottom-border-line (constant-function 0.0d0)
135
-		 :thickening-coef-x 1
136
-		 :thickening-coef-y 1)
137
-
138
-      (when (>= *debug-level* 10)
139
-	(format t "2: ~%")
140
-	(print-grid grid :print-out-border t)
141
-	(format t "----~%~%"))
142
-
143
-      (set-constant-field-2d grid
144
-			     (make-instance 'conservative-variables
145
-					    :phi 0.999999d0
146
-					    :P 100000.0d0
147
-					    :ug 25.0d0
148
-					    :ul 25.0d0))
149
-
150
-      (when (>= *debug-level* 10)
151
-	(format t "3: ~%")
152
-	(print-grid grid :print-out-border t)
153
-	(format t "----~%~%"))
154
-
155
-      (update-boundary-cells grid)
156
-
157
-      (when (>= *debug-level* 10)
158
-	(format t "4.1: ~%")
159
-	(print-grid grid :print-out-border t)
160
-	(format t "----~%~%"))
161
-      
162
-      ;;(update-gradients grid)
163
-
164
-      (when (>= *debug-level* 10)
165
-	(format t "4.2: ~%")
166
-	(print-grid grid :print-out-border t)
167
-	(format t "----~%~%"))
168
-
169
-
170
-      (when (>= *debug-level* 3)
171
-	(format t "start-grid: ~%")
172
-	(print-grid grid :print-out-border t)
173
-	(format t "----~%~%"))
174
-      
175
-      (let ((newgrid (march grid
176
-			    :finish-step 10
177
-			    :cu cu
178
-			    )))
179 113
 
180
-	(when (>= *debug-level* 3)
181
-	  (format t "final-grid: ~%")
182
-	  (print-grid newgrid :print-out-border t)
183
-	  (format t "----~%~%"))
184
-	
185
-	newgrid
186
-	))))
187 114
new file mode 100644
... ...
@@ -0,0 +1,77 @@
0
+(in-package :clf)
1
+
2
+(defun test-kt-constant (&key (cells-nx 2) (cells-ny 1) (cu 1) (output-dir #P"~/prog/clfpv/test-KT-constant/"))
3
+  "Тест на постоянном поле"
4
+  (ensure-directories-exist output-dir)
5
+  (let ((*DEFAULT-PATHNAME-DEFAULTS* output-dir))
6
+    (let ((grid (make-instance 'grid2d-cv
7
+			       :cells-amount-x cells-nx
8
+			       :cells-amount-y cells-ny
9
+			       :left-boundary-condition 'zeroe
10
+			       :right-boundary-condition 'zeroe
11
+			       :bottom-boundary-condition 'zeroe
12
+			       :top-boundary-condition 'zeroe)))
13
+
14
+      (when (>= *debug-level* 10)
15
+	(format t "1: ~%")
16
+	(print-grid grid :print-out-border t)
17
+	(format t "----~%~%"))
18
+
19
+      (init-grid grid
20
+		 :left-border-coord 0.0d0
21
+		 :right-border-coord 1.0d0
22
+		 :top-border-line (constant-function 1.0d0)
23
+		 :bottom-border-line (constant-function 0.0d0)
24
+		 :thickening-coef-x 1
25
+		 :thickening-coef-y 1)
26
+
27
+      (when (>= *debug-level* 10)
28
+	(format t "2: ~%")
29
+	(print-grid grid :print-out-border t)
30
+	(format t "----~%~%"))
31
+
32
+      (set-constant-field-2d grid
33
+			     (make-instance 'conservative-variables
34
+					    :phi 0.999999d0
35
+					    :P 100000.0d0
36
+					    :ug 25.0d0
37
+					    :ul 25.0d0))
38
+
39
+      (when (>= *debug-level* 10)
40
+	(format t "3: ~%")
41
+	(print-grid grid :print-out-border t)
42
+	(format t "----~%~%"))
43
+
44
+      (update-boundary-cells grid)
45
+
46
+      (when (>= *debug-level* 10)
47
+	(format t "4.1: ~%")
48
+	(print-grid grid :print-out-border t)
49
+	(format t "----~%~%"))
50
+      
51
+      ;;(update-gradients grid)
52
+
53
+      (when (>= *debug-level* 10)
54
+	(format t "4.2: ~%")
55
+	(print-grid grid :print-out-border t)
56
+	(format t "----~%~%"))
57
+
58
+
59
+      (when (>= *debug-level* 3)
60
+	(format t "start-grid: ~%")
61
+	(print-grid grid :print-out-border t)
62
+	(format t "----~%~%"))
63
+      
64
+      (let ((newgrid (march grid
65
+			    :finish-step 10
66
+			    :cu cu
67
+			    )))
68
+
69
+	(when (>= *debug-level* 3)
70
+	  (format t "final-grid: ~%")
71
+	  (print-grid newgrid :print-out-border t)
72
+	  (format t "----~%~%"))
73
+	
74
+	newgrid
75
+	))))
76
+