SphereRegion¶
- class SphereRegion(value, center, radius)¶
Class for representing a spherical region of metallic or dielectric material.
- Parameters:
value (float | PhysicalQuantity compatible with Volt) – The value that should be assigned to the sphere. Either the voltage or the dielectric constant of the region.
center (PhysicalQuantity of type length) – Vector to the center of the sphere.
radius (PhysicalQuantity of type length) – Radius of the sphere.
- center()¶
- Returns:
The vector to the center of the sphere.
- Return type:
PhysicalQuantity of type length
- nlprint(stream=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, header=True)¶
Print a string containing an ASCII description of the SpatialRegion.
- Parameters:
stream (Stream based object) – The io to write to.
header (bool) – Option to emphasize the description as a header or not.
- radius()¶
- Returns:
The radius of the sphere.
- Return type:
PhysicalQuantity of type length
- uniqueString()¶
Return a unique string representing the state of the object.
- value()¶
Function for asking for the value of the box region.
- Returns:
The value of the box region.
- Return type:
float | PhysicalQuantity compatible with Volt
Usage Examples¶
Define a dielectric region with dielectric constant \(4 \varepsilon_0\):
dielectric_region = SphereRegion(
value=4.0,
radius=2.0*Angstrom,
center=[1.0, 2.0 ,3.0]*Angstrom
)
Define two metallic regions where the second metallic region is constructed by cloning the first:
metallic_region1 = SphereRegion(
value=1.0*Volt,
radius=2.0*Angstrom,
center=[1.0, 2.0 ,3.0]*Angstrom
)
metallic_region2 = metallic_region1(
value=-1*Volt,
radius=3.3*Angstrom,
)
Notes¶
The following spatial regions are available: