mindflow.geometry.Geometry
- class mindflow.geometry.Geometry(name, dim, coord_min, coord_max, dtype=np.float32, sampling_config=None)[source]
Definition of Geometry object.
- Parameters
name (str) – name of the geometry.
dim (int) – number of dimensions.
coord_min (Union[int, float, list[int, float], tuple[int, float], numpy.ndarray]) – minimal coordinate of the geometry.
coord_max (Union[int, float, list[int, float], tuple[int, float], numpy.ndarray]) – maximal coordinate of the geometry.
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, 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.
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)