commit 48b16722c28c7ac9c9be58bb82f03d4fb94e804a
parent 76c46ba160aa80b209aa7e20e302b170c87ef454
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Wed, 18 Jul 2018 16:00:56 -0400
Fill missing values in porosity VTK grid, set default padding in regular packing to 0.0
Diffstat:
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/src/io.jl b/src/io.jl
@@ -798,6 +798,15 @@ function writeGridVTK(grid::Any,
for ix=1:size(grid.xh, 1)
for iy=1:size(grid.xh, 2)
@inbounds porosity[ix, iy, 1] = grid.porosity[ix, iy]
+ if ix == size(grid.xh, 1)
+ @inbounds porosity[ix+1, iy, 1] = grid.porosity[ix, iy]
+ end
+ if iy == size(grid.xh, 2)
+ @inbounds porosity[ix, iy+1, 1] = grid.porosity[ix, iy]
+ end
+ if ix == size(grid.xh, 1) && iy == size(grid.xh, 2)
+ @inbounds porosity[ix+1, iy+1, 1] = grid.porosity[ix, iy]
+ end
end
end
WriteVTK.vtk_point_data(vtkfile, porosity, "Porosity [-]")
diff --git a/src/packing.jl b/src/packing.jl
@@ -23,7 +23,7 @@ by the `n` vector.
(default) and `"triangular"` (see
[Wikipedia](https://en.wikipedia.org/wiki/Circle_packing#Uniform_packings)).
* `padding_factor::Real`: percentage-wise padding around each grain to allow for
- random perturbations to grain position.
+ random perturbations to grain position (default = 0.0).
* `origo::Vector{Real}`: spatial offset for the packing (default `[0.0, 0.0]`).
* `size_distribution::String`: grain-size distribution to sample. Valid values
are "powerlaw" and "uniform".
@@ -36,7 +36,7 @@ function regularPacking!(simulation::Simulation,
r_min::Real,
r_max::Real;
tiling::String="square",
- padding_factor::Real=.1,
+ padding_factor::Real=0.0,
origo::Vector{Float64}=[0.0, 0.0],
size_distribution::String="powerlaw",
size_distribution_parameter::Real=-1.8,