mindflow.geometry.Rectangle

View Source On Gitee
class mindflow.geometry.Rectangle(name, coord_min, coord_max, dtype=np.float32, sampling_config=None)[source]

Definition of Rectangle object.

Parameters
Supported Platforms:

Ascend GPU

Examples

>>> from mindflow.geometry import generate_sampling_config, Rectangle
>>> rectangle_mesh = dict({'domain': dict({'random_sampling': False, 'size': [50, 25]}),
...                        'BC': dict({'random_sampling': False, 'size': 300, 'with_normal': True,}),})
>>> rectangle = Rectangle("rectangle", (-3.0, 1), (1, 2),
...                       sampling_config=generate_sampling_config(rectangle_mesh))
>>> domain = rectangle.sampling(geom_type="domain")
>>> bc, bc_normal = rectangle.sampling(geom_type="BC")
>>> print(domain.shape)
(1250, 2)