volumential.wranglers.fmmlib_backend#
The pyfmmlib-based fpnd expansion wrangler.
Same fpnd strategy as volumential.wranglers.sumpy_backend, but the
far field runs through boxtree.pyfmmlib_integration. Restricted to
the Laplace and Helmholtz kernels that pyfmmlib supports.
- class volumential.wranglers.fmmlib_backend.FPNDFMMLibTreeIndependentDataForWrangler(cl_context, multipole_expansion_factory, local_expansion_factory, target_kernels, exclude_self=True, *args, **kwargs)[source]#
Bases:
TreeIndependentDataForWranglerInterface,FMMLibTreeIndependentDataForWranglerObjects of this type serve as a place to keep the code needed for ExpansionWrangler if it is using fmmlib to perform multipole expansion and manipulations.
The interface is augmented with unnecessary arguments acting as placeholders, such that it can be a drop-in replacement of sumpy backend.
- get_wrangler(queue, tree, dtype, fmm_level_to_order, source_extra_kwargs=None, kernel_extra_kwargs=None, *args, **kwargs) FPNDFMMLibExpansionWrangler[source]#
Build a queue-bound
FPNDFMMLibExpansionWranglerfor tree.
- class volumential.wranglers.fmmlib_backend.FPNDFMMLibExpansionWrangler(tree_indep, queue, tree, near_field_table, dtype, fmm_level_to_order, quad_order, potential_kind=1, source_extra_kwargs=None, kernel_extra_kwargs=None, self_extra_kwargs=None, list1_extra_kwargs=None, *args, **kwargs)[source]#
Bases:
ExpansionWranglerInterface,NearFieldPayloadCacheMixin,FMMLibBatchedStagesMixin,FMMLibExpansionWranglerThis expansion wrangler uses “fpnd” strategy. That is, Far field is computed via Particle approximation and Near field is computed Directly. The FMM is performed using FMMLib backend.
- source_extra_kwargs#
Keyword arguments to be passed to interactions that involve the source field.
- kernel_extra_kwargs#
Keyword arguments to be passed to interactions that involve expansions, but not the source field.
Much of this class is borrowed from pytential.qbx.fmmlib.
- reorder_sources(source_array: Any) Any[source]#
Return source_array, given in user order, in tree source order.
- reorder_targets(target_array: Any) Any[source]#
Return target_array permuted by the tree’s target ordering.
- reorder_potentials(potentials: Any) Any[source]#
Return potentials, given in tree order, in user target order.
- finalize_potentials(potentials: Any) Any[source]#
Apply pyfmmlib’s global scaling to the reordered potentials.
- form_multipoles(level_start_source_box_nrs: Any, source_boxes: Any, src_weights: Any) Any[source]#
P2M, through the batched pyfmmlib entry point where it is available.
- coarsen_multipoles(level_start_source_parent_box_nrs: Any, source_parent_boxes: Any, mpoles: Any) Any[source]#
M2M: accumulate child multipole expansions into their parents.
- eval_direct_single_out_kernel(out_pot: Any, out_kernel, target_boxes: Any, neighbor_source_boxes_starts: Any, neighbor_source_boxes_lists: Any, mode_coefs: Any) tuple[Any, object][source]#
Near-field (list 1) contribution to out_pot for one target kernel.
The interaction is read out of the precomputed tables instead of being evaluated point by point. Returns
(out_pot, event).
- eval_direct(target_boxes: Any, neighbor_source_boxes_starts: Any, neighbor_source_boxes_lists: Any, mode_coefs: Any) Any[source]#
Near-field stage: one table-based pass per target kernel.
- multipole_to_local(level_start_target_box_nrs: Any, target_boxes: Any, src_box_starts: Any, src_box_lists: Any, mpole_exps: Any) Any[source]#
M2L: translate list-2 multipole expansions into local expansions.
- eval_multipoles(target_boxes_by_source_level: Any, source_boxes_by_level: Any, mpole_exps: Any) Any[source]#
M2P: evaluate list-3 multipole expansions at the targets.
- form_locals(level_start_target_or_target_parent_box_nrs: Any, target_or_target_parent_boxes: Any, starts: Any, lists: Any, src_weights: Any) Any[source]#
P2L: form local expansions from the list-4 sources.
- refine_locals(level_start_target_or_target_parent_box_nrs: Any, target_or_target_parent_boxes: Any, local_exps: Any) Any[source]#
L2L: push each parent’s local expansion down to its children.
- eval_locals(level_start_target_box_nrs: Any, target_boxes: Any, local_exps: Any) Any[source]#
L2P, through the batched GEMM path when the level layout allows it.