Discretization

class grudge.discretization.DGDiscretizationWithBoundaries(array_context, mesh, order=None, quad_tag_to_group_factory=None, mpi_communicator=None)[source]
discr_from_dd(dd)[source]
connection_from_dds(from_dd, to_dd)[source]
dim
ambient_dim
mesh
empty(array_context: meshmode.array_context.ArrayContext, dtype=None)[source]
zeros(array_context: meshmode.array_context.ArrayContext, dtype=None)[source]

Discretization with Eager Evaluation

class grudge.eager.EagerDGDiscretization(array_context, mesh, order=None, quad_tag_to_group_factory=None, mpi_communicator=None)[source]

Inherits from DGDiscretizationWithBoundaries.

__init__(array_context, mesh, order=None, quad_tag_to_group_factory=None, mpi_communicator=None)
Parameters

quad_tag_to_group_factory – A mapping from quadrature tags (typically strings–but may be any hashable/comparable object) to a ElementGroupFactory indicating with which quadrature discretization the operations are to be carried out, or None to indicate that operations with this quadrature tag should be carried out with the standard volume discretization.

project(src, tgt, vec)[source]

Project from one discretization to another, e.g. from the volume to the boundary, or from the base to the an overintegrated quadrature discretization.

Parameters
  • src – a DOFDesc, or a value convertible to one

  • tgt – a DOFDesc, or a value convertible to one

  • vec – a DOFArray

nodes(dd=None)[source]

Return the nodes of a discretization.

Parameters

dd – a DOFDesc, or a value convertible to one. Defaults to the base volume discretization.

Returns

an object array of DOFArrays

grad(vec)[source]

Return the gradient of the volume function represented by vec.

Parameters

vec – a DOFArray

Returns

an object array of DOFArrays

d_dx(xyz_axis, vec)[source]

Return the derivative along axis xyz_axis of the volume function represented by vec.

Parameters
  • xyz_axis – an integer indicating the axis along which the derivative is taken

  • vec – a DOFArray

Returns

a DOFArrays

div(vecs)[source]

Return the divergence of the vector volume function represented by vecs.

Parameters

vec – an object array of a DOFArrays, where the last axis of the array must have length matching the volume dimension.

Returns

a DOFArray

weak_grad(*args)[source]

Return the “weak gradient” of the volume function represented by vec.

May be called with (vecs) or (dd, vecs).

Parameters
  • dd – a DOFDesc, or a value convertible to one. Defaults to the base volume discretization if not provided.

  • vec – a DOFArray

Returns

an object array of DOFArrays

weak_d_dx(*args)[source]

Return the derivative along axis xyz_axis of the volume function represented by vec.

May be called with (xyz_axis, vecs) or (dd, xyz_axis, vecs).

Parameters
  • xyz_axis – an integer indicating the axis along which the derivative is taken

  • vec – a DOFArray

Returns

a DOFArrays

weak_div(*args)[source]

Return the “weak divergence” of the vector volume function represented by vecs.

May be called with (vecs) or (dd, vecs).

Parameters
  • dd – a DOFDesc, or a value convertible to one. Defaults to the base volume discretization if not provided.

  • vec – a object array of a DOFArrays, where the last axis of the array must have length matching the volume dimension.

Returns

a DOFArray

normal(dd)[source]

Get unit normal to specified surface discretization, dd.

Parameters

dd – a DOFDesc as the surface discretization.

Returns

an object array of DOFArray.

inverse_mass(vec)[source]
face_mass(*args)[source]
norm(vec, p=2, dd=None)[source]
nodal_sum(dd, vec)[source]
nodal_min(dd, vec)[source]
nodal_max(dd, vec)[source]
grudge.eager.interior_trace_pair(discrwb, vec)[source]
grudge.eager.cross_rank_trace_pairs(discrwb, vec, tag=None)[source]