mindflow.geometry.Geometry

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

Definition of Geometry object.

Parameters
Supported Platforms:

Ascend GPU

Examples

>>> from mindflow.geometry import generate_sampling_config, Geometry
>>> geometry_config = dict({'domain' : dict({'random_sampling' : True, 'size' : 100}),
...                          'BC' : dict({'random_sampling' : True, 'size' : 100, 'sampler' : 'uniform',}),
...                          'random_merge' : True,})
>>> sampling_config = generate_sampling_config(geometry_config)
>>> geom = Geometry("geom", 1, 0.0, 1.0, sampling_config=sampling_config)
>>> geom.set_name("geom_name")
set_name(name)[source]

Set geometry instance name.

Parameters

name (str) – name of geometry instance.

Raises

TypeError – If name is not string.

Examples

>>> from mindflow.geometry import generate_sampling_config, Geometry
>>> geom = Geometry("geom", 1, 0.0, 1.0)
>>> geom.set_name("geom_name")
set_sampling_config(sampling_config: SamplingConfig)[source]

Set sampling info.

Parameters

sampling_config (SamplingConfig) – sampling configuration.

Raises

TypeError – If sampling_config is not instance of SamplingConfig.

Examples

>>> from sciai.geometry import generate_sampling_config, Geometry
>>> geometry_config = dict({'domain': dict({'random_sampling': True, 'size': 100}),
...                          'BC': dict({'random_sampling': True, 'size': 100, 'sampler': 'uniform',}),
...                          'random_merge': True,})
>>> sampling_config = generate_sampling_config(geometry_config)
>>> geom = Geometry("geom", 1, 0.0, 1.0)
>>> geom.set_sampling_config(sampling_config)