qimpy.transport.geometry.PatchSet

class PatchSet(*, material, svg_file, svg_unit=1.0, grid_spacing, contacts, grid_size_max=0, process_grid, checkpoint_in=(None, ''))

Bases: Geometry

PatchSet specification.

Parameters:
  • material (Material) –

  • svg_file (str) –

  • svg_unit (float) –

  • grid_spacing (float) –

  • contacts (dict[str, dict]) –

  • grid_size_max (int) –

  • process_grid (ProcessGrid) –

  • checkpoint_in (CheckpointPath) –

__init__(*, material, svg_file, svg_unit=1.0, grid_spacing, contacts, grid_size_max=0, process_grid, checkpoint_in=(None, ''))

Initialize PatchSet parameters.

Parameters:
  • svg_file (str) – :yaml:`Path to an SVG file containing the input geometry.

  • svg_unit (float) – [Input file] Real length corresponding to one unit of distance in SVG.

  • grid_spacing (float) – [Input file] Maximum spacing between grid points anywhere in the geometry. This is used to select the number of grid points in each domain.

  • grid_size_max (int) – [Input file] Maximum grid points per dimension after quad subdvision. If 0, will be determined automatically from number of processes. Note that this only affects parallelization and performance by changing how data is divided into patches, and does not affect the accuracy of format of the output.

  • material (Material) –

  • contacts (dict[str, dict]) –

  • process_grid (ProcessGrid) –

  • checkpoint_in (CheckpointPath) –

Methods

__init__

Initialize PatchSet parameters.

add_child

Construct child object self.`attr_name` of type cls.

add_child_one_of

Invoke add_child on one of several child options in args.

apply_boundaries

Apply all boundary conditions to rho at time t and produce ghost-padded version.

rho_dot

Compute f(rho_eval), ingredient of time step

save_checkpoint

Save self and all children in hierarchy to cp_path.

update_stash

Stash results for current step for a future save_checkpoint call.

Attributes

rho_list

grid_spacing

Grid spacing used for discretization

contact_names

Names of contacts used in SVG specification and plots

quad_set

Original geometry specification from SVG

sub_quad_set

Division into smaller quads for tuning parallelization

patches

Advection for each quad patch local to this process

patch_division

Division of patches over comm

stash

Saved results for collating into fewer checkpoints

comm

Communicator for real-space split over patches

material

Corresponding material

dt_max

Maximum stable time step

child_names

Names of attributes with child objects.

apply_boundaries(rho_list, t)

Apply all boundary conditions to rho at time t and produce ghost-padded version. The list contains the data for each patch.

Parameters:
  • rho_list (list[Tensor]) –

  • t (float) –

Return type:

list[Tensor]

rho_dot(rho_list_eval, t)

Compute f(rho_eval), ingredient of time step

Parameters:
  • rho_list_eval (list[Tensor]) –

  • t (float) –

Return type:

list[Tensor]

update_stash(i_step, t)

Stash results for current step for a future save_checkpoint call.

Parameters:
  • i_step (int) –

  • t (float) –

Return type:

None

contact_names: list[str]

Names of contacts used in SVG specification and plots

grid_spacing: float

Grid spacing used for discretization

patch_division: TaskDivision

Division of patches over comm

patches: list[Advect]

Advection for each quad patch local to this process

quad_set: QuadSet

Original geometry specification from SVG

stash: ResultStash

Saved results for collating into fewer checkpoints

sub_quad_set: SubQuadSet

Division into smaller quads for tuning parallelization