| ssa3d {SPSL} | R Documentation |
Site cluster on Square Anisotropic 3D lattice with (1,d)-neighborhood
Description
ssa3d() function provides sites labeling of the anisotropic cluster on 3D square lattice with Moore (1,d)-neighborhood.
Usage
ssa3d(x=33, p0=runif(6, max=0.4),
p1=colMeans(matrix(p0[c(
1,3, 2,3, 1,4, 2,4,
1,5, 2,5, 1,6, 2,6,
3,5, 4,5, 3,6, 4,6)], nrow=2))/2,
p2=colMeans(matrix(p0[c(
1,3,5, 2,3,5, 1,4,5, 2,4,5,
1,3,6, 2,3,6, 1,4,6, 2,4,6)], nrow=3))/3,
set=(x^3+1)/2, all=TRUE,
shape=c(1,1))
Arguments
x |
a linear dimension of 3D square percolation lattice. |
p0 |
a vector of relative fractions |
p1 |
averaged double combinations of |
p2 |
averaged triple combinations of |
set |
a vector of linear indexes of a starting sites subset. |
all |
logical; if |
shape |
a vector with two shape parameters of beta-distributed random variables, weighting the percolation lattice sites. |
Details
The percolation is simulated on 3D square lattice with uniformly weighted sites acc and the vectors p0, p1, and p2, distributed over the lattice directions, and their combinations.
The anisotropic cluster is formed from the accessible sites connected with the initial subset set, and depends on the direction in 3D square lattice.
To form the cluster the condition acc[set+eN[n]]<pN[n] is iteratively tested for sites of the Moore (1,d)-neighborhood eN for the current cluster perimeter set, where eN is equal to e0, e1, or e2 vector; pN is equal to p0, p1, or p2 vector; n is equal to direction in 3D square lattice.
Moore (1,d)-neighborhood on 3D square lattice consists of sites, at least one coordinate of which is different from the current site by one: e=c(e0,e1,e2), where
e0=c(-1, 1, -x, x, -x^2, x^2);
e1=colSums(matrix(e0[c(1,3, 2,3, 1,4, 2,4, 1,5, 2,5, 1,6, 2,6, 3,5, 4,5, 3,6, 4,6)], nrow=2));
e2=colMeans(matrix(p0[c(1,3,5, 2,3,5, 1,4,5, 2,4,5, 1,3,6, 2,3,6, 1,4,6, 2,4,6)], nrow=3)).
Minkowski distance between sites a and b depends on the exponent d:
rho.mink <- function(a, b, d=1)
if (is.infinite(d)) return(apply(abs(b-a), 2, max))
else return(apply(abs(b-a)^d, 2, sum)^(1/d)).
Minkowski distance for sites from e1 and e2 subsets with the exponent d=1 is equal to rhoMe1=2 and rhoMe2=3.
Forming cluster ends with the exhaustion of accessible sites in Moore (1,d)-neighborhood of the current cluster perimeter.
Value
acc |
an accessibility matrix for 3D square percolation lattice: |
Author(s)
Pavel V. Moskalev
References
[1] Moskalev, P.V. Percolation modeling of porous structures. Moscow: URSS, 2018. 240 pp; in Russian.
[2] Moskalev, P.V. (2013) The structure of site percolation models on three-dimensional square lattices. Computer Research and Modeling, Vol.5, No.4, pp.607–622; in Russian.
See Also
fssa3d, ssa2d, ssa20, ssa30, ssi2d, ssi3d
Examples
# Example No.1. Axonometric projection of 3D cluster
require(lattice)
set.seed(20120521)
x <- y <- z <- seq(33)
cls <- which(ssa3d(p0=.09*c(1,6,1,3,2,1))>1, arr.ind=TRUE)
cloud(cls[,3] ~ cls[,1]*cls[,2],
xlim=range(x), ylim=range(y), zlim=range(z),
col=rgb(1,0,0,0.4), xlab="x", ylab="y", zlab="z", main.cex=1,
main="Anisotropic (1,1)-cluster")
# Example No.2. Z=17 slice of 3D cluster
set.seed(20120521)
x <- y <- z <- seq(33)
cls <- ssa3d(p0=.09*c(1,6,1,3,2,1))
image(x, y, cls[,,17], zlim=c(0,2), cex.main=1,
main="Z=17 slice of an anisotropic (1,1)-cluster")
abline(h=17, lty=2); abline(v=17, lty=2)