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
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 all boundary conditions to rho at time t and produce ghost-padded version.
Compute f(rho_eval), ingredient of time step
save_checkpoint
Save self and all children in hierarchy to cp_path.
Stash results for current step for a future save_checkpoint call.
Attributes
rho_list
Grid spacing used for discretization
Names of contacts used in SVG specification and plots
Original geometry specification from SVG
Division into smaller quads for tuning parallelization
Advection for each quad patch local to this process
Division of patches over comm
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
- stash: ResultStash
Saved results for collating into fewer checkpoints
- sub_quad_set: SubQuadSet
Division into smaller quads for tuning parallelization