Random field on a structured grid with periodic boundaries #253
Replies: 1 comment 1 reply
-
Random fields on a donut, what a brilliant idea :-) If these changes introduce many if-branches or computational overhead to the already existing methods, maybe this would be a good first use case of creating a new |
Beta Was this translation helpful? Give feedback.
-
Does gstools have support for random field generation on a structured grid with periodic boundaries? This is very useful for e.g reducing finite size effects in simulations.
Consider for example a scalar field in 2D in a NxN grid, such that the field values are, in the limit of large N, continuous across the left-right and top-bottom edges of the grid.
This should amount to a redefinition of the isotropic spatial covariance function C(x1,x2) = C(|x1-x2|) between the random field variables at grid points x1, x2., via C(x1,x2)=C(|x1-x2|_periodic) with |x1-x2|_periodic the distance between these points using periodic boundaries.
Equivalently, at the level of the field's Fourier decomposition, one would just need to sum Fourier modes \vec{k} whose components are integer multiples of 2pi/N.
I suspect this would be either a minor change to
summate
andsummate_incompr
ingstools/field/summator.pyx
, or to the part of the code that samples from the spectral density distribution of the covariance model, to impose that the sampled wave-vectors k have components integer multiples of 2pi/N.A more complex use case is spatiotemporal field in 3 space + 1 time dimensions, with periodic boundary conditions in space, but not time. For this all that is needed is the ability to specify which wavevector components should have periodic boundaries (e.g by including an optional boolean array parameter
periodic_bc
with length given by the model dimension and default value[False,....,False]
.I am happy to think more about how to make this work if not already implemented.
Beta Was this translation helpful? Give feedback.
All reactions