mindflow.geometry.Pentagon
- class mindflow.geometry.Pentagon(name, vertices, boundary_type='uniform', dtype=np.float32, sampling_config=None)[source]
Definition of pentagon object.
- Parameters
name (str) – name of the pentagon.
vertices (numpy.ndarray) – vertices of the pentagon in an anti-clockwise order.
boundary_type (str) –
this can be
'uniform'
or'unweighted'
. Default:'uniform'
.'uniform'
, the expected number of samples in each boundary is proportional to the area (length) of the boundary.'unweighted'
, the expected number of samples in each boundary is the same.
dtype (numpy.dtype) – data type of sampled point data type. Default:
np.float32
.sampling_config (SamplingConfig) – sampling configuration. Default:
none
.
- Supported Platforms:
Ascend
GPU
Examples
>>> from mindflow.geometry import generate_sampling_config, Pentagon >>> pentagon_mesh = dict({'domain': dict({'random_sampling': True, 'size': 300}), ... 'BC': dict({'random_sampling': True, 'size': 300, 'with_normal': False,}),}) >>> vertices = np.array([[0., .1], [.5, .1], [.9, .2], [.7, .6], [.2, .5]]) >>> pentagon = Pentagon("pentagon", vertices, ... sampling_config=generate_sampling_config(pentagon_mesh)) >>> domain = pentagon.sampling(geom_type="domain") >>> bc = pentagon.sampling(geom_type="bc") >>> print(domain.shape) (300, 2)