# Discretization Collection#

grudge.discretization.DiscretizationTag#
class grudge.DiscretizationCollection(array_context: ArrayContext, volume_discrs: , order: = None, discr_tag_to_group_factory: = None, mpi_communicator: = 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.

Note

Do not call the constructor directly. Use make_discretization_collection() instead.

dim#

Return the topological dimension.

ambient_dim#

Return the dimension of the ambient space.

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: Any) [source]#

Provides a meshmode.discretization.Discretization object from dd.

connection_from_dds(from_dd: Any, to_dd: Any) [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:
empty(array_context: ArrayContext, dtype=None, *, dd: = None) [source]#

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

Parameters:
zeros(array_context: ArrayContext, dtype=None, *, dd: = None) [source]#

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

Parameters:
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: 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.

grudge.make_discretization_collection(array_context: ArrayContext, volumes: , order: = None, discr_tag_to_group_factory: = None) [source]#
Parameters:

discr_tag_to_group_factory – A mapping from discretization tags (typically one of: DISCR_TAG_BASE, DISCR_TAG_MODAL, or 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.

Note

If passing a Discretization in volumes, it must be nodal and unisolvent, consistent with DISCR_TAG_BASE.

Note

To use the resulting DiscretizationCollection in a distributed-memory manner, the array_context passed in must be one of the distributed-memory array contexts from grudge.array_context. Unlike the (now-deprecated, for direct use) constructor of DiscretizationCollection, this function no longer accepts a separate MPI communicator.

Note

If the resulting DiscretizationCollection is distributed across multiple ranks, then this is an MPI-collective operation, i.e. all ranks in the communicator must enter this function at the same time.