Symbolic Operator Representation

Based on pymbolic.

Basic Objects

DOF description

class grudge.symbolic.primitives.DTAG_SCALAR[source]
class grudge.symbolic.primitives.DTAG_VOLUME_ALL[source]
class grudge.symbolic.primitives.DTAG_BOUNDARY(tag)[source]
class grudge.symbolic.primitives.QTAG_NONE[source]
class grudge.symbolic.primitives.DOFDesc(domain_tag, quadrature_tag=None)[source]

Describes the meaning of degrees of freedom.

domain_tag
quadrature_tag
is_scalar()[source]
is_discretized()[source]
is_volume()[source]
is_boundary_or_partition_interface()[source]
is_trace()[source]
uses_quadrature()[source]
with_qtag(qtag)[source]
with_dtag(dtag)[source]
__eq__(other)[source]

Return self==value.

__ne__(other)[source]

Return self!=value.

__hash__()[source]

Return hash(self).

Parameters
  • domain_tag – One of the following: DTAG_SCALAR (or the string "scalar"), DTAG_VOLUME_ALL (or the string "vol") for the default volume discretization, FACE_RESTR_ALL (or the string "all_faces"), or FACE_RESTR_INTERIOR (or the string "int_faces"), or one of BTAG_ALL, BTAG_NONE, BTAG_REALLY_ALL, BTAG_PARTITION, or None to indicate that the geometry is not yet known.

  • quadrature_tagNone to indicate that the quadrature grid is not known, or QTAG_NONE to indicate the use of the basic discretization grid, or a string to indicate the use of the thus-tagged quadratue grid.

grudge.symbolic.primitives.as_dofdesc(dd)[source]
grudge.symbolic.primitives.DD_SCALAR
grudge.symbolic.primitives.DD_VOLUME

Symbols

class grudge.symbolic.primitives.Variable(name, dd=None)[source]

A user-supplied input variable with a known DOFDesc.

class grudge.symbolic.primitives.ScalarVariable(name)[source]
class grudge.symbolic.primitives.FunctionSymbol(name)[source]

A symbol to be used as the function argument of Call.

grudge.symbolic.primitives.make_sym_array(name, shape, dd=None)[source]
grudge.symbolic.primitives.make_sym_mv(name, dim, var_factory=None)[source]
grudge.symbolic.primitives.fabs(arg)
grudge.symbolic.primitives.sqrt(arg)
grudge.symbolic.primitives.exp(arg)
grudge.symbolic.primitives.sin(arg)
grudge.symbolic.primitives.cos(arg)
grudge.symbolic.primitives.besesl_j(n, arg)
grudge.symbolic.primitives.besesl_y(n, arg)

Helpers

class grudge.symbolic.primitives.OperatorBinding(op, field)[source]
class grudge.symbolic.primitives.PrioritizedSubexpression(child, priority=0)[source]

When the optemplate-to-code transformation is performed, prioritized subexpressions work like common subexpression in that they are assigned their own separate identifier/register location. In addition to this behavior, prioritized subexpressions are evaluated with a settable priority, allowing the user to expedite or delay the evaluation of the subexpression.

Parameters

scope – Defaults to cse_scope.EVALUATION if given as None.

class grudge.symbolic.primitives.Ones(*args, **kwargs)[source]

Geometry data

class grudge.symbolic.primitives.NodeCoordinateComponent(axis, dd=None)[source]
grudge.symbolic.primitives.nodes(ambient_dim, dd=None)[source]
grudge.symbolic.primitives.mv_nodes(ambient_dim, dd=None)[source]
grudge.symbolic.primitives.forward_metric_derivative(xyz_axis, rst_axis, dd=None)[source]

Pointwise metric derivatives representing

\[\frac{\partial x_{\mathrm{xyz\_axis}} }{\partial r_{\mathrm{rst\_axis}} }\]
grudge.symbolic.primitives.inverse_metric_derivative(rst_axis, xyz_axis, ambient_dim, dim=None, dd=None)[source]
grudge.symbolic.primitives.forward_metric_derivative_mat(ambient_dim, dim=None, dd=None)[source]
grudge.symbolic.primitives.inverse_metric_derivative_mat(ambient_dim, dim=None, dd=None)[source]
grudge.symbolic.primitives.pseudoscalar(ambient_dim, dim=None, dd=None)[source]
grudge.symbolic.primitives.area_element(ambient_dim, dim=None, dd=None)[source]
grudge.symbolic.primitives.mv_normal(dd, ambient_dim, dim=None)[source]

Exterior unit normal as a MultiVector.

grudge.symbolic.primitives.normal(dd, ambient_dim, dim=None)[source]

Operators

Building blocks and mappers for operator expression trees.

Basic Operators

class grudge.symbolic.operators.Operator(dd_in, dd_out)[source]
dd_in

an instance of DOFDesc describing the input discretization.

dd_out

an instance of DOFDesc describing the output discretization.

class grudge.symbolic.operators.ElementwiseLinearOperator(dd_in, dd_out)[source]
class grudge.symbolic.operators.ProjectionOperator(dd_in, dd_out)[source]
grudge.symbolic.operators.project

Reductions

class grudge.symbolic.operators.ElementwiseSumOperator(dd)[source]

Returns a vector of DOFs with all entries on each element set to the sum of DOFs on that element.

class grudge.symbolic.operators.ElementwiseMinOperator(dd)[source]

Returns a vector of DOFs with all entries on each element set to the minimum of DOFs on that element.

class grudge.symbolic.operators.ElementwiseMaxOperator(dd)[source]

Returns a vector of DOFs with all entries on each element set to the maximum of DOFs on that element.

class grudge.symbolic.operators.NodalReductionOperator(dd_in, dd_out=None)[source]
class grudge.symbolic.operators.NodalSum(dd_in, dd_out=None)[source]
class grudge.symbolic.operators.NodalMax(dd_in, dd_out=None)[source]
class grudge.symbolic.operators.NodalMin(dd_in, dd_out=None)[source]

Differentiation

class grudge.symbolic.operators.StrongFormDiffOperatorBase(xyz_axis, dd_in=None, dd_out=None)[source]
class grudge.symbolic.operators.WeakFormDiffOperatorBase(xyz_axis, dd_in=None, dd_out=None)[source]
class grudge.symbolic.operators.StiffnessOperator(xyz_axis, dd_in=None, dd_out=None)[source]
class grudge.symbolic.operators.DiffOperator(xyz_axis, dd_in=None, dd_out=None)[source]
class grudge.symbolic.operators.StiffnessTOperator(xyz_axis, dd_in=None, dd_out=None)[source]
class grudge.symbolic.operators.MInvSTOperator(xyz_axis, dd_in=None, dd_out=None)[source]
class grudge.symbolic.operators.RefDiffOperator(rst_axis, dd_in=None, dd_out=None)[source]
class grudge.symbolic.operators.RefStiffnessTOperator(rst_axis, dd_in=None, dd_out=None)[source]
grudge.symbolic.operators.nabla(dim)[source]
grudge.symbolic.operators.minv_stiffness_t(dim)[source]
grudge.symbolic.operators.stiffness(dim)[source]
grudge.symbolic.operators.stiffness_t(dim, dd_in=None, dd_out=None)[source]

Mass Operators

class grudge.symbolic.operators.MassOperatorBase(dd_in=None, dd_out=None)[source]

dd_in and dd_out may be surface or volume discretizations.

class grudge.symbolic.operators.MassOperator(dd_in=None, dd_out=None)[source]
class grudge.symbolic.operators.InverseMassOperator(dd_in=None, dd_out=None)[source]
class grudge.symbolic.operators.FaceMassOperator(dd_in=None, dd_out=None)[source]
class grudge.symbolic.operators.RefMassOperator(dd_in, dd_out)[source]
class grudge.symbolic.operators.RefInverseMassOperator(dd_in, dd_out)[source]
class grudge.symbolic.operators.RefFaceMassOperator(dd_in, dd_out)[source]