discretize.tests.setup_mesh#
- discretize.tests.setup_mesh(mesh_type, nC, nDim, random_seed=None)[source]#
Generate arbitrary mesh for testing.
For the mesh type, number of cells along each axis and dimension specified, setup_mesh will construct a random mesh that can be used for testing. By design, the domain width is 1 along each axis direction.
- Parameters:
- mesh_type
str
Defines the mesh type. Must be one of {‘uniformTensorMesh’, ‘randomTensorMesh’, ‘uniformCylindricalMesh’, ‘randomCylindricalMesh’, ‘uniformTree’, ‘randomTree’, ‘uniformCurv’, ‘rotateCurv’, ‘sphereCurv’}
- nC
int
Number of cells along each axis. If mesh_type is ‘Tree’, then nC defines the number of base mesh cells and must be a power of 2.
- nDim
int
The dimension of the mesh. Must be 1, 2 or 3.
- random_seed
numpy.random.Generator
,int
,optional
If
random
is in mesh_type, this is the random number generator to use for creating that random mesh. If an integer or None it is used to seed a new numpy.random.default_rng.
- mesh_type
- Returns:
discretize.base.BaseMesh
A discretize mesh of class specified by the input argument mesh_type