mindflow.geometry.Interval
- class mindflow.geometry.Interval(name, coord_min, coord_max, dtype=np.float32, sampling_config=None)[source]
Definition of Interval object.
- Parameters
name (str) – name of the interval.
dtype (numpy.dtype) – Data type of sampled point data type. Default:
numpy.float32
.sampling_config (SamplingConfig) – sampling configuration. Default:
None
.
- Raises
ValueError – If coord_min or coord_max is neither int nor float .
- Supported Platforms:
Ascend
GPU
Examples
>>> from mindflow.geometry import generate_sampling_config, Interval >>> line_config = dict({'domain': dict({'random_sampling': True, 'size': 100, 'sampler': 'uniform'}), ... 'BC': dict({'random_sampling': True, 'size': 10, 'sampler': 'uniform',}),}) >>> line = Interval("line", -1.0, 1.0, sampling_config=generate_sampling_config(line_config)) >>> domain = line.sampling(geom_type="domain") >>> bc = line.sampling(geom_type="BC") >>> print(bc.shape) (10, 1)