Skip to content

Commit 5feac99

Browse files
Add tests for particle deletion using a Point Density Function instead of random selection
1 parent e9d02f5 commit 5feac99

File tree

6 files changed

+692
-0
lines changed

6 files changed

+692
-0
lines changed

tests/particle_KDE_deletion.prm

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
# Adapted from the drop-supg.prm benchmark
2+
3+
set Dimension = 2
4+
set Use years instead of seconds = false
5+
set End time = 0.18
6+
set Nonlinear solver scheme = single Advection, no Stokes
7+
set Resume computation = false
8+
set Maximum time step = 0.03
9+
10+
11+
subsection Prescribed Stokes solution
12+
set Model name = function
13+
14+
subsection Velocity function
15+
set Variable names = x,y
16+
set Function constants = velSlow=-0.1
17+
set Function expression = 0; velSlow
18+
end
19+
end
20+
21+
subsection Geometry model
22+
set Model name = box
23+
24+
subsection Box
25+
set X extent = 0.5
26+
set Y extent = 5
27+
set Y repetitions = 10
28+
set Box origin X coordinate = 0
29+
set Box origin Y coordinate = 0
30+
end
31+
end
32+
33+
subsection Initial temperature model
34+
set Model name = function
35+
36+
subsection Function
37+
set Variable names = x,y
38+
set Function constants =
39+
set Function expression = 1
40+
end
41+
end
42+
43+
subsection Initial composition model
44+
set Model name = function
45+
46+
subsection Function
47+
set Variable names = x,y
48+
set Function expression = 1
49+
end
50+
end
51+
52+
subsection Boundary temperature model
53+
set List of model names = box
54+
set Fixed temperature boundary indicators = top, bottom, left, right
55+
56+
subsection Box
57+
set Bottom temperature = 0
58+
set Left temperature = 0
59+
set Right temperature = 0
60+
set Top temperature = 0
61+
end
62+
end
63+
64+
subsection Boundary composition model
65+
set List of model names = box
66+
set Fixed composition boundary indicators = top, bottom, left, right
67+
68+
subsection Box
69+
set Bottom composition = 0
70+
set Left composition = 0
71+
set Right composition = 0
72+
set Top composition = 0
73+
end
74+
end
75+
76+
subsection Gravity model
77+
set Model name = vertical
78+
79+
subsection Vertical
80+
set Magnitude = 0.0
81+
end
82+
end
83+
84+
subsection Material model
85+
set Model name = simple
86+
87+
subsection Simple model
88+
set Reference density = 1
89+
set Reference specific heat = 1
90+
set Reference temperature = 0
91+
set Thermal conductivity = 1e-5
92+
set Thermal expansion coefficient = 0
93+
set Viscosity = 0
94+
end
95+
end
96+
97+
subsection Compositional fields
98+
set Number of fields = 1
99+
set Compositional field methods = field
100+
end
101+
102+
subsection Mesh refinement
103+
set Initial adaptive refinement = 2
104+
set Initial global refinement = 1
105+
set Time steps between mesh refinement = 0
106+
107+
set Strategy = minimum refinement function
108+
109+
subsection Minimum refinement function
110+
set Coordinate system = cartesian
111+
set Variable names = x,y
112+
set Function expression = if ( y<=4, 2, 4)
113+
end
114+
115+
end
116+
117+
subsection Particles
118+
set Particle generator name = reference cell
119+
set Maximum particles per cell = 32
120+
set Load balancing strategy = remove and add particles
121+
set Deletion algorithm = point density function
122+
subsection Generator
123+
subsection Reference cell
124+
set Number of particles per cell per direction = 4
125+
end
126+
end
127+
end
128+
129+
130+
subsection Postprocess
131+
set List of postprocessors = velocity statistics, temperature statistics, heat flux statistics, visualization, particles, particle distribution score
132+
133+
subsection Visualization
134+
set Time between graphical output = .001
135+
set List of output variables = artificial viscosity
136+
end
137+
138+
subsection Particles
139+
set Time between data output = 0.001
140+
set Data output format = vtu
141+
end
142+
143+
subsection Particle distribution score
144+
set Granularity = 2
145+
end
146+
147+
end
148+
149+
subsection Solver parameters
150+
set Temperature solver tolerance = 1e-10
151+
end
Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
-----------------------------------------------------------------------------
2+
-- This is ASPECT --
3+
-- The Advanced Solver for Planetary Evolution, Convection, and Tectonics. --
4+
-----------------------------------------------------------------------------
5+
-- . version 3.1.0-pre (particle_KDE_deletion, 89a0fdd74)
6+
-- . using deal.II 9.6.1
7+
-- . with 32 bit indices
8+
-- . with vectorization level 1 (SSE2, 2 doubles, 128 bits)
9+
-- . using Trilinos 14.4.0
10+
-- . using p4est 2.3.6
11+
-- . using Geodynamic World Builder 1.0.0
12+
-- . running in OPTIMIZED mode
13+
-- . running with 1 MPI process
14+
-----------------------------------------------------------------------------
15+
16+
-----------------------------------------------------------------------------
17+
-- For information on how to cite ASPECT, see:
18+
-- https://aspect.geodynamics.org/citing.html?ver=3.1.0-pre&cbfheatflux=1&mf=1&particles=1&sha=89a0fdd74&src=code
19+
-----------------------------------------------------------------------------
20+
Number of active cells: 40 (on 2 levels)
21+
Number of degrees of freedom: 883 (410+63+205+205)
22+
23+
*** Timestep 0: t=0 seconds, dt=0 seconds
24+
Solving temperature system... 0 iterations.
25+
Solving C_1 system ... 0 iterations.
26+
27+
Number of active cells: 160 (on 3 levels)
28+
Number of degrees of freedom: 3,121 (1,458+205+729+729)
29+
30+
*** Timestep 0: t=0 seconds, dt=0 seconds
31+
Solving temperature system... 0 iterations.
32+
Solving C_1 system ... 0 iterations.
33+
34+
Number of active cells: 256 (on 4 levels)
35+
Number of degrees of freedom: 4,877 (2,282+313+1,141+1,141)
36+
37+
*** Timestep 0: t=0 seconds, dt=0 seconds
38+
Solving temperature system... 0 iterations.
39+
Advecting particles... done.
40+
Solving C_1 system ... 0 iterations.
41+
42+
Postprocessing:
43+
RMS, max velocity: 0.1 m/s, 0.1 m/s
44+
Temperature min/avg/max: 0 K, 0.9191 K, 1.125 K
45+
Heat fluxes through boundary parts: 0.001421 W, 0.001421 W, 0.02279 W, -0.02368 W
46+
Writing graphical output: output/solution/solution-00000
47+
Writing particle output: output/particles/particles-00000
48+
Particle distribution score min/avg/max: 0/0/0
49+
50+
*** Timestep 1: t=0.03 seconds, dt=0.03 seconds
51+
Solving temperature system... 7 iterations.
52+
Advecting particles... done.
53+
Solving C_1 system ... 10 iterations.
54+
55+
Postprocessing:
56+
RMS, max velocity: 0.1 m/s, 0.1 m/s
57+
Temperature min/avg/max: 0 K, 0.9187 K, 1.126 K
58+
Heat fluxes through boundary parts: 0.004462 W, 0.004462 W, 0.02756 W, -0.006674 W
59+
Writing graphical output: output/solution/solution-00001
60+
Writing particle output: output/particles/particles-00001
61+
Particle distribution score min/avg/max: 0/0/0
62+
63+
*** Timestep 2: t=0.06 seconds, dt=0.03 seconds
64+
Solving temperature system... 6 iterations.
65+
Advecting particles... done.
66+
Solving C_1 system ... 10 iterations.
67+
68+
Postprocessing:
69+
RMS, max velocity: 0.1 m/s, 0.1 m/s
70+
Temperature min/avg/max: 0 K, 0.9184 K, 1.127 K
71+
Heat fluxes through boundary parts: 0.004388 W, 0.004388 W, 0.02864 W, -0.005477 W
72+
Writing graphical output: output/solution/solution-00002
73+
Writing particle output: output/particles/particles-00002
74+
Particle distribution score min/avg/max: 0/0/0
75+
76+
*** Timestep 3: t=0.09 seconds, dt=0.03 seconds
77+
Solving temperature system... 6 iterations.
78+
Advecting particles... done.
79+
Solving C_1 system ... 9 iterations.
80+
81+
Postprocessing:
82+
RMS, max velocity: 0.1 m/s, 0.1 m/s
83+
Temperature min/avg/max: 0 K, 0.918 K, 1.128 K
84+
Heat fluxes through boundary parts: 0.004316 W, 0.004316 W, 0.02969 W, -0.00443 W
85+
Writing graphical output: output/solution/solution-00003
86+
Writing particle output: output/particles/particles-00003
87+
Particle distribution score min/avg/max: 0/0.00173611/0.037037
88+
89+
*** Timestep 4: t=0.12 seconds, dt=0.03 seconds
90+
Solving temperature system... 6 iterations.
91+
Advecting particles... done.
92+
Solving C_1 system ... 9 iterations.
93+
94+
Postprocessing:
95+
RMS, max velocity: 0.1 m/s, 0.1 m/s
96+
Temperature min/avg/max: 0 K, 0.9175 K, 1.13 K
97+
Heat fluxes through boundary parts: 0.004247 W, 0.004247 W, 0.03069 W, -0.003485 W
98+
Writing graphical output: output/solution/solution-00004
99+
Writing particle output: output/particles/particles-00004
100+
Particle distribution score min/avg/max: 0/0.00173611/0.037037
101+
102+
*** Timestep 5: t=0.15 seconds, dt=0.03 seconds
103+
Solving temperature system... 6 iterations.
104+
Advecting particles... done.
105+
Solving C_1 system ... 9 iterations.
106+
107+
Postprocessing:
108+
RMS, max velocity: 0.1 m/s, 0.1 m/s
109+
Temperature min/avg/max: 0 K, 0.9171 K, 1.132 K
110+
Heat fluxes through boundary parts: 0.004181 W, 0.004181 W, 0.03164 W, -0.002761 W
111+
Writing graphical output: output/solution/solution-00005
112+
Writing particle output: output/particles/particles-00005
113+
Particle distribution score min/avg/max: 0/0.00173611/0.037037
114+
115+
*** Timestep 6: t=0.18 seconds, dt=0.03 seconds
116+
Solving temperature system... 6 iterations.
117+
Advecting particles... done.
118+
Solving C_1 system ... 8 iterations.
119+
120+
Postprocessing:
121+
RMS, max velocity: 0.1 m/s, 0.1 m/s
122+
Temperature min/avg/max: 0 K, 0.9166 K, 1.145 K
123+
Heat fluxes through boundary parts: 0.004117 W, 0.004117 W, 0.03255 W, -0.002135 W
124+
Writing graphical output: output/solution/solution-00006
125+
Writing particle output: output/particles/particles-00006
126+
Particle distribution score min/avg/max: 0/0.00136574/0.037037
127+
128+
Termination requested by criterion: end time
129+
130+
131+
+----------------------------------------------+------------+------------+
132+
| Total wallclock time elapsed since start | 0.444s | |
133+
| | | |
134+
| Section | no. calls | wall time | % of total |
135+
+----------------------------------+-----------+------------+------------+
136+
| Assemble composition system | 9 | 0.0729s | 16% |
137+
| Assemble temperature system | 9 | 0.0629s | 14% |
138+
| Build composition preconditioner | 9 | 0.00577s | 1.3% |
139+
| Build temperature preconditioner | 9 | 0.00489s | 1.1% |
140+
| Initialization | 1 | 0.127s | 29% |
141+
| Interpolate Stokes solution | 9 | 0.0116s | 2.6% |
142+
| Particles: Advect | 14 | 0.00532s | 1.2% |
143+
| Particles: Copy | 9 | 0.000647s | 0.15% |
144+
| Particles: Generate | 3 | 0.000425s | 0% |
145+
| Particles: Initialization | 1 | 2.54e-05s | 0% |
146+
| Particles: Initialize properties | 3 | 0.000226s | 0% |
147+
| Particles: Sort | 14 | 0.00203s | 0.46% |
148+
| Postprocessing | 7 | 0.0941s | 21% |
149+
| Refine mesh structure, part 1 | 2 | 0.00325s | 0.73% |
150+
| Refine mesh structure, part 2 | 2 | 0.00205s | 0.46% |
151+
| Setup dof systems | 3 | 0.0136s | 3.1% |
152+
| Setup initial conditions | 3 | 0.0103s | 2.3% |
153+
| Setup matrices | 4 | 0.00691s | 1.6% |
154+
| Solve composition system | 9 | 0.00309s | 0.7% |
155+
| Solve temperature system | 9 | 0.00256s | 0.58% |
156+
+----------------------------------+-----------+------------+------------+
157+
158+
-- Total wallclock time elapsed including restarts: 0s
159+
-----------------------------------------------------------------------------
160+
-- For information on how to cite ASPECT, see:
161+
-- https://aspect.geodynamics.org/citing.html?ver=3.1.0-pre&cbfheatflux=1&mf=1&particles=1&sha=89a0fdd74&src=code
162+
-----------------------------------------------------------------------------
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# 1: Time step number
2+
# 2: Time (seconds)
3+
# 3: Time step size (seconds)
4+
# 4: Number of mesh cells
5+
# 5: Number of Stokes degrees of freedom
6+
# 6: Number of temperature degrees of freedom
7+
# 7: Number of degrees of freedom for all compositions
8+
# 8: Iterations for temperature solver
9+
# 9: Iterations for composition solver 1
10+
# 10: RMS velocity (m/s)
11+
# 11: Max. velocity (m/s)
12+
# 12: Minimal temperature (K)
13+
# 13: Average temperature (K)
14+
# 14: Maximal temperature (K)
15+
# 15: Outward heat flux through boundary with indicator 0 ("left") (W)
16+
# 16: Outward heat flux through boundary with indicator 1 ("right") (W)
17+
# 17: Outward heat flux through boundary with indicator 2 ("bottom") (W)
18+
# 18: Outward heat flux through boundary with indicator 3 ("top") (W)
19+
# 19: Visualization file name
20+
# 20: Number of advected particles
21+
# 21: Particle file name
22+
# 22: Minimal particle distribution score:
23+
# 23: Average particle distribution score:
24+
# 24: Maximal particle distribution score:
25+
0 0.000000000000e+00 0.000000000000e+00 256 2595 1141 1141 0 0 1.00000000e-01 1.00000000e-01 0.00000000e+00 9.19097222e-01 1.12500000e+00 1.42150000e-03 1.42150000e-03 2.27923333e-02 -2.36768333e-02 output/solution/solution-00000 4096 output/particles/particles-00000 0.0000 0.0000 0.0000
26+
1 3.000000000000e-02 3.000000000000e-02 256 2595 1141 1141 7 10 1.00000000e-01 1.00000000e-01 0.00000000e+00 9.18734356e-01 1.12572330e+00 4.46198391e-03 4.46198391e-03 2.75576324e-02 -6.67363935e-03 output/solution/solution-00001 4096 output/particles/particles-00001 0.0000 0.0000 0.0000
27+
2 6.000000000000e-02 3.000000000000e-02 256 2595 1141 1141 6 10 1.00000000e-01 1.00000000e-01 0.00000000e+00 9.18354102e-01 1.12668357e+00 4.38828347e-03 4.38828347e-03 2.86418272e-02 -5.47722400e-03 output/solution/solution-00002 4096 output/particles/particles-00002 0.0000 0.0000 0.0000
28+
3 9.000000000000e-02 3.000000000000e-02 256 2595 1141 1141 6 9 1.00000000e-01 1.00000000e-01 0.00000000e+00 9.17952147e-01 1.12799617e+00 4.31631667e-03 4.31631667e-03 2.96865527e-02 -4.42953318e-03 output/solution/solution-00003 4096 output/particles/particles-00003 0.0000 0.0017 0.0370
29+
4 1.200000000000e-01 3.000000000000e-02 256 2595 1141 1141 6 9 1.00000000e-01 1.00000000e-01 0.00000000e+00 9.17528195e-01 1.12969534e+00 4.24714727e-03 4.24714727e-03 3.06876552e-02 -3.48482045e-03 output/solution/solution-00004 4096 output/particles/particles-00004 0.0000 0.0017 0.0370
30+
5 1.500000000000e-01 3.000000000000e-02 256 2595 1141 1141 6 9 1.00000000e-01 1.00000000e-01 0.00000000e+00 9.17084254e-01 1.13175984e+00 4.18053319e-03 4.18053319e-03 3.16431938e-02 -2.76051527e-03 output/solution/solution-00005 4096 output/particles/particles-00005 0.0000 0.0017 0.0370
31+
6 1.800000000000e-01 3.000000000000e-02 256 2595 1141 1141 6 8 1.00000000e-01 1.00000000e-01 0.00000000e+00 9.16622132e-01 1.14542667e+00 4.11684386e-03 4.11684386e-03 3.25527670e-02 -2.13533305e-03 output/solution/solution-00006 4080 output/particles/particles-00006 0.0000 0.0014 0.0370

0 commit comments

Comments
 (0)