Degree of freedom (DOF) descriptions¶

Volume tags¶

grudge.dof_desc.VolumeTag¶

alias of Hashable

class grudge.dof_desc.VTAG_ALL[source]¶

grudge-specific boundary tags¶

Domain tags¶

A domain tag identifies a geometric part (or whole) of the domain described by a grudge.DiscretizationCollection. This can be a volume or a boundary.

grudge.dof_desc.DTAG_SCALAR¶

alias of ScalarDomainTag()

grudge.dof_desc.DTAG_VOLUME_ALL¶

alias of VolumeDomainTag(tag=<class ‘grudge.dof_desc.VTAG_ALL’>)

class grudge.dof_desc.VolumeDomainTag(tag: Hashable)[source]¶

A domain tag referring to a volume identified by the volume tag tag.

tag¶
__init__(tag: Hashable) None¶
class grudge.dof_desc.BoundaryDomainTag(tag: ~typing.Hashable, volume_tag: ~typing.Hashable = <class 'grudge.dof_desc.VTAG_ALL'>)[source]¶

A domain tag referring to a boundary identified by the boundary tag tag.

tag¶
volume_tag[source]¶
__init__(tag: ~typing.Hashable, volume_tag: ~typing.Hashable = <class 'grudge.dof_desc.VTAG_ALL'>) None¶

Discretization tags¶

A discretization tag serves as a symbolic identifier of the manner in which meaning is assigned to degrees of freedom.

class grudge.dof_desc.DISCR_TAG_BASE[source]¶

A discretization tag indicating the use of a nodal and unisolvent discretization. This tag is used to distinguish the base discretization from quadrature (e.g. overintegration) or modal (DISCR_TAG_MODAL) discretizations.

class grudge.dof_desc.DISCR_TAG_QUAD[source]¶

A discretization tag indicating the use of a quadrature discretization grid, which typically affords higher quadrature accuracy (e.g. for nonlinear terms) at the expense of unisolvency. This tag is used to distinguish the quadrature discretization (e.g. overintegration) from modal (DISCR_TAG_MODAL) or base (DISCR_TAG_BASE) discretizations.

For working with multiple quadrature grids, it is recommended to create appropriate subclasses of DISCR_TAG_QUAD and define appropriate DOFDesc objects corresponding to each subclass. For example:

class CustomQuadTag(DISCR_TAG_QUAD):
    "A custom quadrature discretization tag."

dd = DOFDesc(DTAG_VOLUME_ALL, CustomQuadTag)
class grudge.dof_desc.DISCR_TAG_MODAL[source]¶

A discretization tag indicating the use of unisolvent modal degrees of freedom. This tag is used to distinguish the modal discretization from the base (nodal) discretization (e.g. DISCR_TAG_BASE) or discretizations on quadrature grids (DISCR_TAG_QUAD).

DOF Descriptor¶

class grudge.dof_desc.DOFDesc(domain_tag: Any, discretization_tag: Type[Type[_DiscretizationTag]] | None = None)[source]¶

Describes the meaning of degrees of freedom.

domain_tag¶
discretization_tag¶
__init__(domain_tag: Any, discretization_tag: Type[Type[_DiscretizationTag]] | None = None)[source]¶
is_scalar() bool[source]¶
is_discretized() bool[source]¶
is_volume() bool[source]¶
is_boundary_or_partition_interface() bool[source]¶
is_trace() bool[source]¶
uses_quadrature() bool[source]¶
with_domain_tag(dtag) DOFDesc[source]¶
with_discr_tag(discr_tag) DOFDesc[source]¶
trace(btag: Hashable) DOFDesc[source]¶

Return a DOFDesc for the restriction of the volume descriptor self to the boundary named by btag.

An error is raised if this method is called on a non-volume instance of DOFDesc.

untrace() DOFDesc[source]¶

Return a DOFDesc for the volume associated with the boundary descriptor self.

An error is raised if this method is called on a non-boundary instance of DOFDesc.

with_boundary_tag(btag: Hashable) DOFDesc[source]¶

Return a DOFDesc representing a boundary named by btag on the same volume as self.

An error is raised if this method is called on a non-boundary instance of DOFDesc.

__eq__(other)¶

Return self==value.

__ne__(value, /)¶

Return self!=value.

__hash__()¶

Return hash(self).

as_identifier() str[source]¶

Returns a descriptive string for this DOFDesc that is usable in Python identifiers.

grudge.dof_desc.as_dofdesc(domain: Any, discretization_tag: Type[_DiscretizationTag] | None = None, *, _contextual_volume_tag: Hashable | None = None) DOFDesc[source]¶
Parameters:

Shortcuts¶

grudge.dof_desc.DD_SCALAR¶
grudge.dof_desc.DD_VOLUME_ALL¶
grudge.dof_desc.DD_VOLUME_ALL_MODAL¶

Internal things that are visble due to type annotations¶

class grudge.dof_desc._DiscretizationTag[source]¶
class grudge.dof_desc.ConvertibleToDOFDesc[source]¶

Anything that is convertible to a DOFDesc via as_dofdesc().