mindelec.geometry.create_config_from_edict
- mindelec.geometry.create_config_from_edict(edict_config)[source]
Convert from dict to SamplingConfig.
- Parameters
edict_config (dict) –
dictionary containing configuration info. The keys are “domain”, “BC”, “IC” or “time”. For each key, the value is still a dictionary, containing the following keys.
size: number of sampling points, value type: Union[int, tuple[int], list[int]]).
random_sampling: Specifies whether randomly sampling points, value type: bool.
sampler: method for random sampling, value type: str.
random_merge: Specifies whether randomly merge coordinates of different dimensions, value type: bool.
with_normal: Specifies whether generating the normal vectors of the boundary, value type: bool.
- Returns
geometry_base.SamplingConfig, sampling configuration.
- Raises
ValueError – If part_config_dict can not be generated from input dict.
- Supported Platforms:
Ascend
Examples
>>> from easydict import EasyDict as edict >>> from mindelec.geometry import create_config_from_edict >>> rect_config = edict({ ... 'domain': edict({ ... 'random_sampling': True, ... 'size': 200, ... }), ... 'BC': edict({ ... 'random_sampling': True, ... 'size': 50, ... 'with_normal': True, ... }) ... }) >>> sampling_config = create_config_from_edict(rect_config)