From 88aa902895dc1d3640cf29b2cc1be7b9cbedfa42 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner <inform@tiker.net> Date: Fri, 26 Jun 2020 11:38:09 -0500 Subject: [PATCH] Address comments from Matt's review --- meshmode/discretization/__init__.py | 8 ++++---- meshmode/discretization/connection/chained.py | 2 +- meshmode/discretization/connection/face.py | 6 ++---- meshmode/dof_array.py | 7 ++++++- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/meshmode/discretization/__init__.py b/meshmode/discretization/__init__.py index 46f7d2b0..f1dd8915 100644 --- a/meshmode/discretization/__init__.py +++ b/meshmode/discretization/__init__.py @@ -197,11 +197,9 @@ class Discretization(object): .. automethod:: nodes() - .. method:: num_reference_derivative(queue, ref_axes, vec) + .. automethod:: num_reference_derivative - .. method:: quad_weights - - A :class:`~meshmode.dof_array.DOFArray` with quadrature weights. + .. automethod:: quad_weights """ def __init__(self, actx: ArrayContext, mesh, group_factory, @@ -318,6 +316,8 @@ class Discretization(object): @memoize_method def quad_weights(self): + """:returns: A :class:`~meshmode.dof_array.DOFArray` with quadrature weights. + """ actx = self._setup_actx @memoize_in(actx, (Discretization, "quad_weights_prg")) diff --git a/meshmode/discretization/connection/chained.py b/meshmode/discretization/connection/chained.py index 9990e865..1be269bb 100644 --- a/meshmode/discretization/connection/chained.py +++ b/meshmode/discretization/connection/chained.py @@ -187,7 +187,7 @@ def flatten_chained_connection(actx, connection): If a large number of connections is chained, the number of groups and batches can become very large. - :arg queue: An instance of :class:`pyopencl.CommandQueue`. + :arg actx: An instance of :class:`meshmode.array_contex.ArrayContext`. :arg connection: An instance of :class:`~meshmode.discretization.connection.DiscretizationConnection`. :return: An instance of diff --git a/meshmode/discretization/connection/face.py b/meshmode/discretization/connection/face.py index 6bba284a..bac1ccc9 100644 --- a/meshmode/discretization/connection/face.py +++ b/meshmode/discretization/connection/face.py @@ -86,11 +86,9 @@ def _build_boundary_connection(actx, vol_discr, bdry_discr, connection_data, InterpolationBatch( from_group_index=igrp, from_element_indices=actx.freeze(actx.from_numpy( - data.group_source_element_indices)) - .with_queue(None), + data.group_source_element_indices)), to_element_indices=actx.freeze(actx.from_numpy( - data.group_target_element_indices)) - .with_queue(None), + data.group_target_element_indices)), result_unit_nodes=result_unit_nodes, to_element_face=face_id )) diff --git a/meshmode/dof_array.py b/meshmode/dof_array.py index d04dedc4..3136484c 100644 --- a/meshmode/dof_array.py +++ b/meshmode/dof_array.py @@ -51,10 +51,15 @@ class DOFArray(np.ndarray): :class:`~meshmode.discretization.Discretization`, with one entry in the :class:`DOFArray` for each :class:`~meshmode.discretization.ElementGroupBase`. + The arrays contained within a :class:`DOFArray` + are expected to be logically two-dimensional, with shape + ``(nelements, nunit_dofs)``, using + :class:`~meshmode.discretization.ElementGroupBase.nelements` + and :class:`~meshmode.discretization.ElementGroupBase.nunit_dofs`. It is derived from :class:`numpy.ndarray` with dtype object ("an object array"). The entries in this array are further arrays managed by :attr:`array_context`. - The main purpose of this class is to better describe the data structure, + One main purpose of this class is to describe the data structure, i.e. when a :class:`DOFArray` occurs inside of further numpy object array, the level representing the array of element groups can be recognized (by people and programs). -- GitLab