Discretization Collection

class grudge.DiscretizationCollection(array_context: arraycontext.context.ArrayContext, mesh: meshmode.mesh.Mesh, order=None, discr_tag_to_group_factory=None, mpi_communicator=None, quad_tag_to_group_factory=None)[source]

A collection of discretizations, defined on the same underlying Mesh, corresponding to various mesh entities (volume, interior facets, boundaries) and associated element groups.

__init__(array_context: arraycontext.context.ArrayContext, mesh: meshmode.mesh.Mesh, order=None, discr_tag_to_group_factory=None, mpi_communicator=None, quad_tag_to_group_factory=None)[source]
Parameters

discr_tag_to_group_factory – A mapping from discretization tags (typically one of: grudge.dof_desc.DISCR_TAG_BASE, grudge.dof_desc.DISCR_TAG_MODAL, or grudge.dof_desc.DISCR_TAG_QUAD) to a ElementGroupFactory indicating with which type of discretization the operations are to be carried out, or None to indicate that operations with this discretization tag should be carried out with the standard volume discretization.

dim

Return the topological dimension.

ambient_dim

Return the dimension of the ambient space.

mesh

Return the meshmode.mesh.Mesh over which the discretization collection is built.

real_dtype

Return the data type used for real-valued arithmetic.

complex_dtype

Return the data type used for complex-valued arithmetic.

discr_from_dd(dd)[source]

Provides a meshmode.discretization.Discretization object from dd.

Parameters

dd – a DOFDesc, or a value convertible to one.

connection_from_dds(from_dd, to_dd)[source]

Provides a mapping (connection) from one discretization to another, e.g. from the volume to the boundary, or from the base to the an overintegrated quadrature discretization, or from a nodal representation to a modal representation.

Parameters
  • from_dd – a DOFDesc, or a value convertible to one.

  • to_dd – a DOFDesc, or a value convertible to one.

empty(array_context: arraycontext.context.ArrayContext, dtype=None)[source]

Return an empty DOFArray defined at the volume nodes: grudge.dof_desc.DD_VOLUME.

Parameters
  • array_context – an ArrayContext.

  • dtype – type special value ‘c’ will result in a vector of dtype complex_dtype. If None (the default), a real vector will be returned.

zeros(array_context: arraycontext.context.ArrayContext, dtype=None)[source]

Return a zero-initialized DOFArray defined at the volume nodes, grudge.dof_desc.DD_VOLUME.

Parameters
  • array_context – an ArrayContext.

  • dtype – type special value ‘c’ will result in a vector of dtype complex_dtype. If None (the default), a real vector will be returned.

nodes(dd=None)[source]

Return the nodes of a discretization specified by dd.

Parameters

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

Returns

an object array of frozen DOFArrays

normal(dd)[source]

Get the unit normal to the specified surface discretization, dd.

Parameters

dd – a DOFDesc as the surface discretization.

Returns

an object array of frozen DOFArrays.

Internal functionality

_base_to_geoderiv_connection(dd: grudge.dof_desc.DOFDesc)[source]

The “geometry derivatives” discretization for a given dd is typically identical to the one returned by discr_from_dd(), however for affinely-mapped simplicial elements, it will use a \(P^0\) discretization having a single DOF per element. As a result, DOFArrays on this are broadcast-compatible with the discretizations returned by discr_from_dd().

This is an internal function, not intended for use outside grudge.