Discretizations¶
QBX discretization¶
To compute a layer potential as an an end user, create a
meshmode.discretization.Discretization
with a InterpolatoryQuadratureSimplexGroupFactory
as a discretization for the density.
Then create pytential.qbx.QBXLayerPotentialSource
,
pytential.bind()
a layer potential operator to it,
and you can start computing.

class
pytential.qbx.
QBXLayerPotentialSource
(density_discr, fine_order, qbx_order=None, fmm_order=None, fmm_level_to_order=None, to_refined_connection=None, expansion_factory=None, target_association_tolerance=<class 'pytential.qbx._not_provided'>, debug=True, _refined_for_global_qbx=False, _expansions_in_tree_have_extent=True, _expansion_stick_out_factor=0.5, _well_sep_is_n_away=2, _max_leaf_refine_weight=None, _box_extent_norm=None, _from_sep_smaller_crit=None, _from_sep_smaller_min_nsources_cumul=None, _tree_kind='adaptive', _use_target_specific_qbx=None, geometry_data_inspector=None, cost_model=None, fmm_backend='sumpy', target_stick_out_factor=<class 'pytential.qbx._not_provided'>)[source]¶ A source discretization for a QBX layer potential.

qbx_order
¶

fmm_order
¶

__init__
(density_discr, fine_order, qbx_order=None, fmm_order=None, fmm_level_to_order=None, to_refined_connection=None, expansion_factory=None, target_association_tolerance=<class 'pytential.qbx._not_provided'>, debug=True, _refined_for_global_qbx=False, _expansions_in_tree_have_extent=True, _expansion_stick_out_factor=0.5, _well_sep_is_n_away=2, _max_leaf_refine_weight=None, _box_extent_norm=None, _from_sep_smaller_crit=None, _from_sep_smaller_min_nsources_cumul=None, _tree_kind='adaptive', _use_target_specific_qbx=None, geometry_data_inspector=None, cost_model=None, fmm_backend='sumpy', target_stick_out_factor=<class 'pytential.qbx._not_provided'>)[source]¶  Parameters
fine_order – The total degree to which the (upsampled) underlying quadrature is exact.
to_refined_connection – A connection used for resampling from density_discr the fine density discretization. It is assumed that the fine density discretization given by to_refined_connection.to_discr is not already upsampled. May be None.
fmm_order – False for direct calculation. May not be given if fmm_level_to_order is given.
fmm_level_to_order – A function that takes arguments of (kernel, kernel_args, tree, level) and returns the expansion order to be used on a given level of tree with kernel, where kernel is the
sumpy.kernel.Kernel
being evaluated, and kernel_args is a set of (key, value) tuples with evaluated kernel arguments. May not be given if fmm_order is given.
Experimental arguments without a promise of forward compatibility:
 Parameters
_use_target_specific_qbx – Whether to use targetspecific acceleration by default if possible. None means “use if possible”.
cost_model – Either None or instance of
CostModel
, used for gathering modeled costs (experimental)

with_refinement
(target_order=None, kernel_length_scale=None, maxiter=None, visualize=False, refiner=None, _expansion_disturbance_tolerance=None, _force_stage2_uniform_refinement_rounds=None, _scaled_max_curvature_threshold=None)[source]¶  Parameters
refiner – If the mesh underlying
density_discr
is itself the result of refinement, then itsmeshmode.refinement.Refiner
instance may need to be reused for continued refinement. This argument provides the opportunity to pass in an existing refiner that should be used for continued refinement. Returns
a tuple
(lpot_src, cnx)
, wherelpot_src
is aQBXLayerPotentialSource
andcnx
is ameshmode.discretization.connection.DiscretizationConnection
from the originally given to the refined geometry.

copy
(density_discr=None, fine_order=None, qbx_order=None, fmm_order=<class 'pytential.qbx._not_provided'>, fmm_level_to_order=<class 'pytential.qbx._not_provided'>, to_refined_connection=None, target_association_tolerance=<class 'pytential.qbx._not_provided'>, _expansions_in_tree_have_extent=<class 'pytential.qbx._not_provided'>, _expansion_stick_out_factor=<class 'pytential.qbx._not_provided'>, _max_leaf_refine_weight=None, _box_extent_norm=None, _from_sep_smaller_crit=None, _tree_kind=None, _use_target_specific_qbx=<class 'pytential.qbx._not_provided'>, geometry_data_inspector=None, cost_model=<class 'pytential.qbx._not_provided'>, fmm_backend=None, debug=<class 'pytential.qbx._not_provided'>, _refined_for_global_qbx=<class 'pytential.qbx._not_provided'>, target_stick_out_factor=<class 'pytential.qbx._not_provided'>)[source]¶

stage2_density_discr
¶

quad_stage2_density_discr
¶
See QBX internals for some information on the inner workings of this.
 Parameters
fine_order – The total degree to which the (upsampled) underlying quadrature is exact.
to_refined_connection – A connection used for resampling from density_discr the fine density discretization. It is assumed that the fine density discretization given by to_refined_connection.to_discr is not already upsampled. May be None.
fmm_order – False for direct calculation. May not be given if fmm_level_to_order is given.
fmm_level_to_order – A function that takes arguments of (kernel, kernel_args, tree, level) and returns the expansion order to be used on a given level of tree with kernel, where kernel is the
sumpy.kernel.Kernel
being evaluated, and kernel_args is a set of (key, value) tuples with evaluated kernel arguments. May not be given if fmm_order is given.
Experimental arguments without a promise of forward compatibility:
 Parameters
_use_target_specific_qbx – Whether to use targetspecific acceleration by default if possible. None means “use if possible”.
cost_model – Either None or instance of
CostModel
, used for gathering modeled costs (experimental)

Unregularized discretization¶

class
pytential.unregularized.
UnregularizedLayerPotentialSource
(density_discr, fmm_order=False, fmm_level_to_order=None, expansion_factory=None, debug=True)[source]¶ A source discretization for a layer potential discretized with a Nyström method that uses panelbased quadrature and does not modify the kernel.

fmm_level_to_order
¶
 Parameters
fmm_order – False for direct calculation.

Sources¶

class
pytential.source.
PotentialSource
[source]¶ 

op_group_features
(expr)¶ Return a characteristic tuple by which operators that can be executed together can be grouped.
expr is a subclass of
pytential.symbolic.primitives.IntG
.


class
pytential.source.
PointPotentialSource
(cl_context, nodes)[source]¶ 
nodes
[source]¶ An
pyopencl.array.Array
of shape[ambient_dim, nnodes]
.

nnodes
¶


class
pytential.source.
LayerPotentialSourceBase
(density_discr)[source]¶ A discretization of a layer potential using panelbased geometry, with support for refinement and upsampling.
Discretizations

density_discr
¶

stage2_density_discr
¶

quad_stage2_density_discr
¶

resampler
¶
Discretization data

cl_context
¶

ambient_dim
¶

dim
¶

real_dtype
¶

complex_dtype
¶
Execution

Targets¶
Target discretizations are a simpler version of the full
pytential.discretization.Discretization
interface.
They do not provide any evaluation of integrals, norms, or
layer potentials, but are instead only geared towards being
used as evaluation targets.

class
pytential.target.
TargetBase
[source]¶ 
ambient_dim
¶

nodes
()¶ Shape:
[ambient_dim, nnodes]

nnodes
¶


class
pytential.target.
PointsTarget
(nodes, normals=None)[source]¶ The point of this class is to act as a container for some target points while presenting enough of the
meshmode.discretization.Discretization
interface to not necessitate a lot of special cases in that code path.