diff --git a/doc/conf.py b/doc/conf.py index 560efec5951aa5de9a4b732e304a121c0c0c8baa..6bb9487380141270dcbfcf88c7e5036935be7e91 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -319,12 +319,12 @@ texinfo_documents = [ # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = { - 'http://docs.python.org/': None, - 'http://docs.scipy.org/doc/numpy/': None, - 'http://documen.tician.de/pyopencl/': None, - 'http://documen.tician.de/modepy/': None, - 'http://documen.tician.de/pymbolic/': None, - 'http://documen.tician.de/meshmode/': None, + 'https://docs.python.org/': None, + 'https://docs.scipy.org/doc/numpy/': None, + 'https://documen.tician.de/pyopencl/': None, + 'https://documen.tician.de/modepy/': None, + 'https://documen.tician.de/pymbolic/': None, + 'https://documen.tician.de/meshmode/': None, #'http://documen.tician.de/loopy/': None, } autoclass_content = "both" diff --git a/grudge/execution.py b/grudge/execution.py index 5423eb0a7c297f671addef9e284c535ff70cb8f8..a95b15e75e43917688f2c3766651e3018ff9d526 100644 --- a/grudge/execution.py +++ b/grudge/execution.py @@ -123,7 +123,7 @@ class ExecutionMapper(mappers.Evaluator, result = discr.empty(queue=self.queue, dtype=field.dtype, allocator=self.bound_op.allocator) - for igrp, grp in enumerate(discr.groups): + for grp in discr.groups: knl()(self.queue, operand=grp.view(field), result=grp.view(result)) diff --git a/grudge/symbolic/operators.py b/grudge/symbolic/operators.py index 5678d4fb92cc04ea71e554a0928b078683e296c6..2722e161baa49e5761c116ca2b8f4910be201f8e 100644 --- a/grudge/symbolic/operators.py +++ b/grudge/symbolic/operators.py @@ -43,6 +43,8 @@ Basic Operators Reductions ^^^^^^^^^^ +.. autoclass:: ElementwiseSumOperator +.. autoclass:: ElementwiseMinOperator .. autoclass:: ElementwiseMaxOperator .. autoclass:: NodalReductionOperator @@ -178,14 +180,26 @@ class ElementwiseReductionOperator(Operator): class ElementwiseSumOperator(ElementwiseReductionOperator): + """Returns a vector of DOFs with all entries on each element set + to the sum of DOFs on that element. + """ + mapper_method = intern("map_elementwise_sum") class ElementwiseMinOperator(ElementwiseReductionOperator): + """Returns a vector of DOFs with all entries on each element set + to the minimum of DOFs on that element. + """ + mapper_method = intern("map_elementwise_min") class ElementwiseMaxOperator(ElementwiseReductionOperator): + """Returns a vector of DOFs with all entries on each element set + to the maximum of DOFs on that element. + """ + mapper_method = intern("map_elementwise_max") # }}} @@ -702,7 +716,12 @@ def norm(p, arg, dd=None): raise ValueError("unsupported value of p") -def h_max(ambient_dim, dim=None, dd=None): +def h_max_from_volume(ambient_dim, dim=None, dd=None): + """Defines a characteristic length based on the volume of the elements. + This length may not be representative if the elements have very high + aspect ratios. + """ + import grudge.symbolic.primitives as prim if dd is None: dd = prim.DD_VOLUME diff --git a/test/test_grudge.py b/test/test_grudge.py index 3d92db155c6fad6081f6d8ef6edfd38d44dfedea..53bd4975176e7f4a263fecfa2985997f26be90f4 100644 --- a/test/test_grudge.py +++ b/test/test_grudge.py @@ -334,7 +334,7 @@ def test_convergence_advec(ctx_factory, mesh_name, mesh_pars, op_type, flux_type else: final_time = 0.2 - h_max = bind(discr, sym.h_max(discr.ambient_dim))(queue) + h_max = bind(discr, sym.h_max_from_volume(discr.ambient_dim))(queue) dt = dt_factor * h_max/order**2 nsteps = (final_time // dt) + 1 dt = final_time/nsteps + 1e-15