Sample Data¤
pdequinox.sample_data
¤
poisson_1d_dirichlet
¤
poisson_1d_dirichlet(
num_points: int = 64,
num_samples: int = 1000,
*,
domain_extent: float = 5.0,
key: PRNGKeyArray
)
Produces pairs of force fields and displacement fields for a 1D Poisson equation with Dirichlet boundary conditions.
The force fields are created by sampling random discontinuities in the domain. The displacement fields are the solutions to the Poisson equation using a three-point finite difference stencil (second order accurate).
Arguments:
num_points
: int. The number of interior degrees of freedom.num_samples
: int. The number of samples to generate.domain_extent
: float. The extent of the domain. (keyword-only argument)key
: PRNGKeyArray. The random key. (keyword-only argument)
Returns:
force_fields
: Array[num_samples, 1, num_points]. The force fields.displacement_fields
: Array[num_samples, 1, num_points]. The displacement fields.
Source code in pdequinox/_sample_data.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
|