mindelec.geometry.Geometry

class mindelec.geometry.Geometry(name, dim, coord_min, coord_max, dtype=np.float32, sampling_config=None)[source]

Definition of Geometry object.

Parameters
Supported Platforms:

Ascend

Examples

>>> from easydict import EasyDict as edict
>>> from mindelec.geometry import create_config_from_edict, Geometry
>>> geometry_config = edict({'domain' : edict({'random_sampling' : True, 'size' : 100}),
...                          'BC' : edict({'random_sampling' : True, 'size' : 100, 'sampler' : 'uniform',}),
...                          'random_merge' : True,})
>>> sampling_config = create_config_from_edict(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 mindelec.geometry import create_config_from_edict, 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 easydict import EasyDict as edict
>>> from mindelec.geometry import create_config_from_edict, Geometry
>>> geometry_config = edict({'domain': edict({'random_sampling': True, 'size': 100}),
...                          'BC': edict({'random_sampling': True, 'size': 100, 'sampler': 'uniform',}),
...                          'random_merge': True,})
>>> sampling_config = create_config_from_edict(geometry_config)
>>> geom = Geometry("geom", 1, 0.0, 1.0)
>>> geom.set_sampling_config(sampling_config)