1
1
const MAX_ATTEMPTS_TO_FIT_PARTICLE = 2000
2
2
3
3
"""
4
- Generate a non-overlapping Vector of N random particles of radius r that fit
4
+ Generate a non-overlapping Vector of N random particles of radius r that fit
5
5
inside the shape passed in
6
6
"""
7
7
function random_particles {T} (volfrac:: Number , a:: T , shape:: Shape ;
@@ -16,7 +16,7 @@ function random_particles{T}(volfrac::Number, a::T, shape::Shape;
16
16
end
17
17
18
18
"""
19
- Generate a non-overlapping Vector of N random particles of radius r that fit
19
+ Generate a non-overlapping Vector of N random particles of radius r that fit
20
20
inside the shape passed in
21
21
"""
22
22
function random_particles {T} (N:: Int , a:: T , shape:: Shape = Rectangle (0.1 , a, N);
@@ -29,7 +29,7 @@ function random_particles{T}(N::Int, a::T, shape::Shape = Rectangle(0.1, a, N);
29
29
end
30
30
31
31
"""
32
- Place N non-overlapping random particles that fit inside the shape passed in.
32
+ Place N non-overlapping random particles that fit inside the shape passed in.
33
33
Modifies the particles Vector.
34
34
"""
35
35
function random_particles! {T} (particles:: Vector{Particle{T}} , shape:: Shape ;
@@ -44,15 +44,15 @@ function random_particles!{T}(particles::Vector{Particle{T}}, shape::Shape;
44
44
bounds = bounding_box (shape)
45
45
topright = bounds. topright
46
46
bottomleft = bounds. bottomleft
47
-
47
+
48
48
@printf (""" \n
49
49
Generating %d randomly positioned particles
50
50
Mean radius: %0.5g
51
51
Total particle volume: %0.5g
52
- Inside %s of volume: %0.5g
53
- Particle volume fraction: %0.5g
52
+ Inside %s of volume: %0.5g
53
+ Particle volume fraction: %0.5g
54
54
Bounding box volume: %0.5g
55
- """ , N, mean_radius (particles), volume (particles), name (shape),
55
+ """ , N, mean_radius (particles), volume (particles), name (shape),
56
56
volume (shape), volume (particles)/ volume (shape), volume (bounds)
57
57
)
58
58
0 commit comments