- Timestamp:
- Aug 18, 2008, 5:43:46 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/abstract_2d_finite_volumes/domain.py
r5631 r5666 1194 1194 """ 1195 1195 1196 # Compute fluxes across each element edge1196 # Compute fluxes across each element edge 1197 1197 self.compute_fluxes() 1198 1198 1199 # Update timestep to fit yieldstep and finaltime1199 # Update timestep to fit yieldstep and finaltime 1200 1200 self.update_timestep(yieldstep, finaltime) 1201 1201 1202 # Update conserved quantities1202 # Update conserved quantities 1203 1203 self.update_conserved_quantities() 1204 1204 1205 # update ghosts1205 # Update ghosts 1206 1206 self.update_ghosts() 1207 1207 1208 # Update vertex and edge values1208 # Update vertex and edge values 1209 1209 self.distribute_to_vertices_and_edges() 1210 1210 1211 # Update boundary values1211 # Update boundary values 1212 1212 self.update_boundary() 1213 1213 1214 # Update time1214 # Update time 1215 1215 self.time += self.timestep 1216 1216 … … 1224 1224 """ 1225 1225 1226 # Save initial initial conserved quantities values1226 # Save initial initial conserved quantities values 1227 1227 self.backup_conserved_quantities() 1228 1228 1229 1229 #-------------------------------------- 1230 # First euler step1230 # First euler step 1231 1231 #-------------------------------------- 1232 1232 1233 # Compute fluxes across each element edge1233 # Compute fluxes across each element edge 1234 1234 self.compute_fluxes() 1235 1235 1236 # Update timestep to fit yieldstep and finaltime1236 # Update timestep to fit yieldstep and finaltime 1237 1237 self.update_timestep(yieldstep, finaltime) 1238 1238 1239 # Update conserved quantities1239 # Update conserved quantities 1240 1240 self.update_conserved_quantities() 1241 1241 1242 # update ghosts1242 # Update ghosts 1243 1243 self.update_ghosts() 1244 1244 1245 # Update vertex and edge values1245 # Update vertex and edge values 1246 1246 self.distribute_to_vertices_and_edges() 1247 1247 1248 # Update boundary values1248 # Update boundary values 1249 1249 self.update_boundary() 1250 1250 1251 # Update time1251 # Update time 1252 1252 self.time += self.timestep 1253 1253 1254 1254 #------------------------------------ 1255 # Second Euler step1255 # Second Euler step 1256 1256 #------------------------------------ 1257 1257 1258 # Compute fluxes across each element edge1258 # Compute fluxes across each element edge 1259 1259 self.compute_fluxes() 1260 1260 1261 # Update conserved quantities1261 # Update conserved quantities 1262 1262 self.update_conserved_quantities() 1263 1263 1264 1264 #------------------------------------ 1265 # Combine initial and final values1266 # of conserved quantities and cleanup1265 # Combine initial and final values 1266 # of conserved quantities and cleanup 1267 1267 #------------------------------------ 1268 #combine steps 1268 1269 # Combine steps 1269 1270 self.saxpy_conserved_quantities(0.5, 0.5) 1270 1271 1271 # update ghosts1272 # Update ghosts 1272 1273 self.update_ghosts() 1273 1274 1274 # Update vertex and edge values1275 # Update vertex and edge values 1275 1276 self.distribute_to_vertices_and_edges() 1276 1277 1277 # Update boundary values1278 # Update boundary values 1278 1279 self.update_boundary() 1279 1280 … … 1287 1288 """ 1288 1289 1289 # Save initial initial conserved quantities values1290 # Save initial initial conserved quantities values 1290 1291 self.backup_conserved_quantities() 1291 1292 … … 1293 1294 1294 1295 #-------------------------------------- 1295 # First euler step1296 # First euler step 1296 1297 #-------------------------------------- 1297 1298 1298 # Compute fluxes across each element edge1299 # Compute fluxes across each element edge 1299 1300 self.compute_fluxes() 1300 1301 1301 # Update timestep to fit yieldstep and finaltime1302 # Update timestep to fit yieldstep and finaltime 1302 1303 self.update_timestep(yieldstep, finaltime) 1303 1304 1304 # Update conserved quantities1305 # Update conserved quantities 1305 1306 self.update_conserved_quantities() 1306 1307 1307 # update ghosts1308 # Update ghosts 1308 1309 self.update_ghosts() 1309 1310 1310 # Update vertex and edge values1311 # Update vertex and edge values 1311 1312 self.distribute_to_vertices_and_edges() 1312 1313 1313 # Update boundary values1314 # Update boundary values 1314 1315 self.update_boundary() 1315 1316 1316 # Update time1317 # Update time 1317 1318 self.time += self.timestep 1318 1319 1319 1320 #------------------------------------ 1320 # Second Euler step1321 # Second Euler step 1321 1322 #------------------------------------ 1322 1323 1323 # Compute fluxes across each element edge1324 # Compute fluxes across each element edge 1324 1325 self.compute_fluxes() 1325 1326 1326 # Update conserved quantities1327 # Update conserved quantities 1327 1328 self.update_conserved_quantities() 1328 1329 … … 1332 1333 #------------------------------------ 1333 1334 1334 # combine steps1335 # Combine steps 1335 1336 self.saxpy_conserved_quantities(0.25, 0.75) 1336 1337 1337 # update ghosts1338 # Update ghosts 1338 1339 self.update_ghosts() 1339 1340 1340 # Update vertex and edge values1341 # Update vertex and edge values 1341 1342 self.distribute_to_vertices_and_edges() 1342 1343 1343 # Update boundary values1344 # Update boundary values 1344 1345 self.update_boundary() 1345 1346 1346 # set substep time1347 # Set substep time 1347 1348 self.time = initial_time + self.timestep*0.5 1348 1349 1349 1350 #------------------------------------ 1350 # Third Euler step1351 # Third Euler step 1351 1352 #------------------------------------ 1352 1353 1353 # Compute fluxes across each element edge1354 # Compute fluxes across each element edge 1354 1355 self.compute_fluxes() 1355 1356 1356 # Update conserved quantities1357 # Update conserved quantities 1357 1358 self.update_conserved_quantities() 1358 1359 1359 1360 #------------------------------------ 1360 # Combine final and initial values1361 # and cleanup1361 # Combine final and initial values 1362 # and cleanup 1362 1363 #------------------------------------ 1363 #combine steps 1364 1365 # Combine steps 1364 1366 self.saxpy_conserved_quantities(2.0/3.0, 1.0/3.0) 1365 1367 1366 # update ghosts1368 # Update ghosts 1367 1369 self.update_ghosts() 1368 1370 1369 # Update vertex and edge values1371 # Update vertex and edge values 1370 1372 self.distribute_to_vertices_and_edges() 1371 1373 1372 # Update boundary values1374 # Update boundary values 1373 1375 self.update_boundary() 1374 1376 1375 # set new time1377 # Set new time 1376 1378 self.time = initial_time + self.timestep 1377 1379
Note: See TracChangeset
for help on using the changeset viewer.