discretize.tests.setup_mesh#

discretize.tests.setup_mesh(mesh_type, nC, nDim)[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_typestr

Defines the mesh type. Must be one of {‘uniformTensorMesh’, ‘randomTensorMesh’, ‘uniformCylindricalMesh’, ‘randomCylindricalMesh’, ‘uniformTree’, ‘randomTree’, ‘uniformCurv’, ‘rotateCurv’, ‘sphereCurv’}

nCint

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.

nDimint

The dimension of the mesh. Must be 1, 2 or 3.

Returns:
discretize.base.BaseMesh

A discretize mesh of class specified by the input argument mesh_type