sparseSpatialSampling.geometry.cylinder_geometry module

Implements a class for using cylinders, cones and conical objects (3D) as geometry object.

class sparseSpatialSampling.geometry.cylinder_geometry.CylinderGeometry3D(name, keep_inside, position, radius, refine=False, min_refinement_level=None)[source]

Bases: GeometryObject

Implement a class for using cylinders with a constant radius, cones, and conical objects (3D) as geometry objects representing the numerical domain or geometries inside the domain.

Note

The length and orientation of the cylinder is inferred from two circles representing the start and end points of the cylinder. The circles do not have to be aligned, allowing the creation of oblique cylinders along arbitrary directions, as long as both circles are defined in the same coordinate plane.

Parameters:
  • name (str) – Name of the geometry object.

  • keep_inside (bool) – If True, the points inside the object are kept; if False, they are masked out.

  • position (list[Union[list, tuple]]) – Coordinates of the circles center [(x1, y1, z1), (x2, y2, z2)] representing the start and end points of the cylinder

  • radius (Union[int, float, list, tuple]) –

    Radius/radii of the cylinder(s):

    • If only one radius is given, it is assumed to be constant along the extrusion axis of the cylinder.

    • For conical objects, two radii are required (one for each position).

    • For cones, the radius associated with the tip must be set to zero.

  • refine (bool) – If True, the mesh around the geometry object is refined after \(S^3\) generates the mesh.

  • min_refinement_level (int | None) – Minimum refinement level for resolving the geometry. If None and refine=True, the geometry will be resolved with the maximum refinement level present at its surface after \(S^3\) has generated the grid.

property center: torch.Tensor

Return the center coordinates based on the main width of the cylinder.

Returns:

center coordinates of the cylinder.

Return type:

pt.Tensor

check_cell(cell_nodes, refine_geometry=False)[source]

Check if a cell is valid or invalid based on the specified settings.

Parameters:
  • cell_nodes (pt.Tensor) – Vertices of the cell to be checked.

  • refine_geometry (bool) – If False, cells are masked out while generating the grid. If True, checks whether a cell is located in the vicinity of the geometry surface to refine it subsequently. This parameter is provided by \(S^3\).

Returns:

True if the cell is invalid, False if the cell is valid.

Return type:

bool

property main_width: float

Return the width of the main dimension of the cylinder.

Returns:

Main width of the cylinder.

Return type:

float

property type: str

Return the name of the geometry object.

Returns:

Name of the geometry object.

Return type:

str