Crazy domain and mesh#
In
- crazy(bounds=None, c=0, periodic=False)[source]#
- Parameters:
- boundslist, tuple, None, default=None
The bounds of the domain along each axis. When it is
None, the code will automatically analyze the manifold and set theboundsto be where is the dimensions of the space.For example, the unit cube is of
bounds = ([0, 1], [0, 1], [0, 1]).- cfloat, default=0.
The deformation factor.
cmust be in . Whenc = 0, the domain is orthogonal, and whenc > 0, the space in the domain is distorted.- periodicbool, default=False
It indicates whether the domain is periodic. When it is
True, the domain is fully periodic along all axes. And when it isFalse, the domain is not periodic at all.
Note
You may ask that in such a regularly shaped domain why would one use a deformation factor
Boundary units#
The crazy domain has only one region and its
Therefore, for a 2-dimensional domain, the complete set of boundary units is
>>> boundary_units_set = {0: [1, 1, 1, 1]}
And for a 3-dimensional one, it is
>>> boundary_units_set = {0: [1, 1, 1, 1, 1, 1]}
For example, {0: [1, 0, 0, 1]} represents the {0: [1, 0, 0, 1, 1, 1]} represents them plus
The mapping transforming the domain#
We use bounds = ([a, b], [e, f], [g, h]). And let
Examples#
Below codes generate a crazy domain in
>>> ph.config.set_embedding_space_dim(3)
>>> manifold = ph.manifold(3)
>>> mesh = ph.mesh(manifold)
>>> msepy, obj = ph.fem.apply('msepy', locals())
>>> manifold = obj['manifold']
>>> mesh = obj['mesh']
>>> msepy.config(manifold)('crazy', c=0.15, periodic=False, bounds=[[-1, 1], [0, 2], [0, 2]])
>>> msepy.config(mesh)([5, 5, 5])
>>> mesh.visualize(saveto=None_or_custom_path_3)
<Figure size ...
Fig. 4 The crazy mesh in
And, if we want to generate a crazy mesh in domain
>>> ph.config.set_embedding_space_dim(2)
>>> manifold = ph.manifold(2)
>>> mesh = ph.mesh(manifold)
>>> msepy, obj = ph.fem.apply('msepy', locals())
>>> manifold = obj['manifold']
>>> mesh = obj['mesh']
>>> msepy.config(manifold)('crazy', c=0.3, periodic=False, bounds=[[-1, 1], [0, 2]])
>>> msepy.config(mesh)([7, 7])
>>> mesh.visualize(saveto=None_or_custom_path_2)
<Figure size ...
Fig. 5 The crazy mesh in
β©οΈ Back to msepy domains and meshes.