mindflow.geometry.FixedPoint

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

Definition of fixed point object.

Parameters
  • name (str) – name of the fixed point.

  • coord (Union[int, float, tuple, list, numpy.ndarray]) – coordinate of the fixed point. if the parameter type is tuple or list, the element support tuple[int, int], tuple[float, float], list[int, int], list[float, float].

  • dtype (numpy.dtype) – Data type of sampled point data type. Default: numpy.float32.

  • sampling_config (SamplingConfig) – sampling configuration. Default: None.

Supported Platforms:

Ascend GPU

Examples

>>> from mindflow.geometry import generate_sampling_config, FixedPoint
>>> hypercube_random = dict({
...      'domain': dict({
...          'random_sampling': True,
...          'size': 1,
...          'sampler': 'uniform'
...         })
...  })
>>> sampling_config = generate_sampling_config(hypercube_random)
>>> point = FixedPoint("FixedPoint", [-1, 2, 1], sampling_config=sampling_config)
>>> domain = point.sampling(geom_type="domain")
>>> print(domain.shape)
(1, 3)
sampling(geom_type='domain')[source]

sampling points

Parameters

geom_type (str) – geometry type, which supports 'domain' and 'BC'. Default: 'domain'.

Returns

Numpy.ndarray, 2D numpy array with or without boundary normal vectors.

Raises
  • ValueError – If config is None.

  • KeyError – If geom_type is 'domain' but config.domain is None.

  • KeyError – If geom_type is 'BC' but config.bc is None.

  • ValueError – If geom_type is neither 'BC' nor 'domain'.