# ufl_legacy package

## Subpackages

- ufl_legacy.algorithms package
  - Submodules
  - ufl_legacy.algorithms.ad module
    - `expand_derivatives()`
  - ufl_legacy.algorithms.analysis module
    - `extract_arguments()`
    - `extract_arguments_and_coefficients()`
    - `extract_coefficients()`
    - `extract_constants()`
    - `extract_elements()`
    - `extract_sub_elements()`
    - `extract_type()`
    - `extract_unique_elements()`
    - `has_exact_type()`
    - `has_type()`
    - `sort_elements()`
    - `unique_tuple()`
  - ufl_legacy.algorithms.apply_algebra_lowering module
    - `LowerCompoundAlgebra`
      - `LowerCompoundAlgebra.altenative_dot()`
      - `LowerCompoundAlgebra.alternative_inner()`
      - `LowerCompoundAlgebra.cofactor()`
      - `LowerCompoundAlgebra.cross()`
      - `LowerCompoundAlgebra.curl()`
      - `LowerCompoundAlgebra.determinant()`
      - `LowerCompoundAlgebra.deviatoric()`
      - `LowerCompoundAlgebra.div()`
      - `LowerCompoundAlgebra.dot()`
      - `LowerCompoundAlgebra.expr()`
      - `LowerCompoundAlgebra.inner()`
      - `LowerCompoundAlgebra.inverse()`
      - `LowerCompoundAlgebra.nabla_div()`
      - `LowerCompoundAlgebra.nabla_grad()`
      - `LowerCompoundAlgebra.outer()`
      - `LowerCompoundAlgebra.skew()`
      - `LowerCompoundAlgebra.sym()`
      - `LowerCompoundAlgebra.trace()`
      - `LowerCompoundAlgebra.transposed()`
    - `apply_algebra_lowering()`
  - ufl_legacy.algorithms.apply_derivatives module
    - `CoordinateDerivativeRuleDispatcher`
      - `CoordinateDerivativeRuleDispatcher.coefficient_derivative()`
      - `CoordinateDerivativeRuleDispatcher.coordinate_derivative()`
      - `CoordinateDerivativeRuleDispatcher.derivative()`
      - `CoordinateDerivativeRuleDispatcher.expr()`
      - `CoordinateDerivativeRuleDispatcher.grad()`
      - `CoordinateDerivativeRuleDispatcher.reference_grad()`
      - `CoordinateDerivativeRuleDispatcher.terminal()`
    - `CoordinateDerivativeRuleset`
      - `CoordinateDerivativeRuleset.argument()`
      - `CoordinateDerivativeRuleset.coefficient()`
      - `CoordinateDerivativeRuleset.geometric_quantity()`
      - `CoordinateDerivativeRuleset.grad()`
      - `CoordinateDerivativeRuleset.jacobian()`
      - `CoordinateDerivativeRuleset.reference_grad()`
      - `CoordinateDerivativeRuleset.reference_value()`
      - `CoordinateDerivativeRuleset.spatial_coordinate()`
    - `DerivativeRuleDispatcher`
      - `DerivativeRuleDispatcher.coefficient_derivative()`
      - `DerivativeRuleDispatcher.coordinate_derivative()`
      - `DerivativeRuleDispatcher.derivative()`
      - `DerivativeRuleDispatcher.expr()`
      - `DerivativeRuleDispatcher.grad()`
      - `DerivativeRuleDispatcher.indexed()`
      - `DerivativeRuleDispatcher.reference_grad()`
      - `DerivativeRuleDispatcher.terminal()`
      - `DerivativeRuleDispatcher.variable_derivative()`
    - `GateauxDerivativeRuleset`
      - `GateauxDerivativeRuleset.argument()`
      - `GateauxDerivativeRuleset.cell_avg()`
      - `GateauxDerivativeRuleset.coefficient()`
      - `GateauxDerivativeRuleset.coordinate_derivative()`
      - `GateauxDerivativeRuleset.facet_avg()`
      - `GateauxDerivativeRuleset.geometric_quantity()`
      - `GateauxDerivativeRuleset.grad()`
      - `GateauxDerivativeRuleset.reference_grad()`
      - `GateauxDerivativeRuleset.reference_value()`
    - `GenericDerivativeRuleset`
      - `GenericDerivativeRuleset.abs()`
      - `GenericDerivativeRuleset.acos()`
      - `GenericDerivativeRuleset.asin()`
      - `GenericDerivativeRuleset.atan()`
      - `GenericDerivativeRuleset.atan_2()`
      - `GenericDerivativeRuleset.bessel_i()`
      - `GenericDerivativeRuleset.bessel_j()`
      - `GenericDerivativeRuleset.bessel_k()`
      - `GenericDerivativeRuleset.bessel_y()`
      - `GenericDerivativeRuleset.binary_condition()`
      - `GenericDerivativeRuleset.cell_avg()`
      - `GenericDerivativeRuleset.component_tensor()`
      - `GenericDerivativeRuleset.conditional()`
      - `GenericDerivativeRuleset.conj()`
      - `GenericDerivativeRuleset.constant()`
      - `GenericDerivativeRuleset.constant_value()`
      - `GenericDerivativeRuleset.cos()`
      - `GenericDerivativeRuleset.cosh()`
      - `GenericDerivativeRuleset.derivative()`
      - `GenericDerivativeRuleset.division()`
      - `GenericDerivativeRuleset.erf()`
      - `GenericDerivativeRuleset.exp()`
      - `GenericDerivativeRuleset.expr()`
      - `GenericDerivativeRuleset.facet_avg()`
      - `GenericDerivativeRuleset.fixme()`
      - `GenericDerivativeRuleset.form_argument()`
      - `GenericDerivativeRuleset.geometric_quantity()`
      - `GenericDerivativeRuleset.grad()`
      - `GenericDerivativeRuleset.imag()`
      - `GenericDerivativeRuleset.independent_operator()`
      - `GenericDerivativeRuleset.independent_terminal()`
      - `GenericDerivativeRuleset.index_sum()`
      - `GenericDerivativeRuleset.indexed()`
      - `GenericDerivativeRuleset.label()`
      - `GenericDerivativeRuleset.list_tensor()`
      - `GenericDerivativeRuleset.ln()`
      - `GenericDerivativeRuleset.math_function()`
      - `GenericDerivativeRuleset.max_value()`
      - `GenericDerivativeRuleset.min_value()`
      - `GenericDerivativeRuleset.multi_index()`
      - `GenericDerivativeRuleset.non_differentiable_terminal()`
      - `GenericDerivativeRuleset.not_condition()`
      - `GenericDerivativeRuleset.override()`
      - `GenericDerivativeRuleset.power()`
      - `GenericDerivativeRuleset.product()`
      - `GenericDerivativeRuleset.real()`
      - `GenericDerivativeRuleset.restricted()`
      - `GenericDerivativeRuleset.sin()`
      - `GenericDerivativeRuleset.sinh()`
      - `GenericDerivativeRuleset.sqrt()`
      - `GenericDerivativeRuleset.sum()`
      - `GenericDerivativeRuleset.tan()`
      - `GenericDerivativeRuleset.tanh()`
      - `GenericDerivativeRuleset.unexpected()`
      - `GenericDerivativeRuleset.variable()`
    - `GradRuleset`
      - `GradRuleset.argument()`
      - `GradRuleset.cell_avg()`
      - `GradRuleset.cell_coordinate()`
      - `GradRuleset.coefficient()`
      - `GradRuleset.facet_avg()`
      - `GradRuleset.geometric_quantity()`
      - `GradRuleset.grad()`
      - `GradRuleset.jacobian_inverse()`
      - `GradRuleset.reference_grad()`
      - `GradRuleset.reference_value()`
      - `GradRuleset.spatial_coordinate()`
    - `ReferenceGradRuleset`
      - `ReferenceGradRuleset.argument()`
      - `ReferenceGradRuleset.cell_avg()`
      - `ReferenceGradRuleset.cell_coordinate()`
      - `ReferenceGradRuleset.coefficient()`
      - `ReferenceGradRuleset.facet_avg()`
      - `ReferenceGradRuleset.geometric_quantity()`
      - `ReferenceGradRuleset.grad()`
      - `ReferenceGradRuleset.reference_grad()`
      - `ReferenceGradRuleset.reference_value()`
      - `ReferenceGradRuleset.spatial_coordinate()`
    - `VariableRuleset`
      - `VariableRuleset.argument()`
      - `VariableRuleset.cell_avg()`
      - `VariableRuleset.coefficient()`
      - `VariableRuleset.facet_avg()`
      - `VariableRuleset.geometric_quantity()`
      - `VariableRuleset.grad()`
      - `VariableRuleset.reference_grad()`
      - `VariableRuleset.reference_value()`
      - `VariableRuleset.variable()`
    - `apply_coordinate_derivatives()`
    - `apply_derivatives()`
    - `grad_to_reference_grad()`
  - ufl_legacy.algorithms.apply_function_pullbacks module
    - `FunctionPullbackApplier`
      - `FunctionPullbackApplier.expr()`
      - `FunctionPullbackApplier.form_argument()`
      - `FunctionPullbackApplier.terminal()`
    - `apply_function_pullbacks()`
    - `apply_known_single_pullback()`
    - `apply_single_function_pullbacks()`
    - `create_nested_lists()`
    - `reshape_to_nested_list()`
    - `sub_elements_with_mappings()`
  - ufl_legacy.algorithms.apply_geometry_lowering module
    - `GeometryLoweringApplier`
      - `GeometryLoweringApplier.cell_coordinate()`
      - `GeometryLoweringApplier.cell_diameter()`
      - `GeometryLoweringApplier.cell_normal()`
      - `GeometryLoweringApplier.cell_volume()`
      - `GeometryLoweringApplier.circumradius()`
      - `GeometryLoweringApplier.expr()`
      - `GeometryLoweringApplier.facet_area()`
      - `GeometryLoweringApplier.facet_cell_coordinate()`
      - `GeometryLoweringApplier.facet_jacobian()`
      - `GeometryLoweringApplier.facet_jacobian_determinant()`
      - `GeometryLoweringApplier.facet_jacobian_inverse()`
      - `GeometryLoweringApplier.facet_normal()`
      - `GeometryLoweringApplier.jacobian()`
      - `GeometryLoweringApplier.jacobian_determinant()`
      - `GeometryLoweringApplier.jacobian_inverse()`
      - `GeometryLoweringApplier.max_cell_edge_length()`
      - `GeometryLoweringApplier.max_facet_edge_length()`
      - `GeometryLoweringApplier.min_cell_edge_length()`
      - `GeometryLoweringApplier.min_facet_edge_length()`
      - `GeometryLoweringApplier.spatial_coordinate()`
      - `GeometryLoweringApplier.terminal()`
    - `apply_geometry_lowering()`
  - ufl_legacy.algorithms.apply_integral_scaling module
    - `apply_integral_scaling()`
    - `compute_integrand_scaling_factor()`
  - ufl_legacy.algorithms.apply_restrictions module
    - `DefaultRestrictionApplier`
      - `DefaultRestrictionApplier.derivative()`
      - `DefaultRestrictionApplier.facet_area()`
      - `DefaultRestrictionApplier.facet_jacobian()`
      - `DefaultRestrictionApplier.facet_jacobian_determinant()`
      - `DefaultRestrictionApplier.facet_jacobian_inverse()`
      - `DefaultRestrictionApplier.facet_origin()`
      - `DefaultRestrictionApplier.max_facet_edge_length()`
      - `DefaultRestrictionApplier.min_facet_edge_length()`
      - `DefaultRestrictionApplier.operator()`
      - `DefaultRestrictionApplier.restricted()`
      - `DefaultRestrictionApplier.spatial_coordinate()`
      - `DefaultRestrictionApplier.terminal()`
    - `RestrictionPropagator`
      - `RestrictionPropagator.argument()`
      - `RestrictionPropagator.coefficient()`
      - `RestrictionPropagator.constant()`
      - `RestrictionPropagator.constant_value()`
      - `RestrictionPropagator.facet_coordinate()`
      - `RestrictionPropagator.facet_normal()`
      - `RestrictionPropagator.geometric_cell_quantity()`
      - `RestrictionPropagator.geometric_facet_quantity()`
      - `RestrictionPropagator.grad()`
      - `RestrictionPropagator.label()`
      - `RestrictionPropagator.multi_index()`
      - `RestrictionPropagator.operator()`
      - `RestrictionPropagator.quadrature_weight()`
      - `RestrictionPropagator.reference_cell_volume()`
      - `RestrictionPropagator.reference_facet_volume()`
      - `RestrictionPropagator.reference_value()`
      - `RestrictionPropagator.restricted()`
      - `RestrictionPropagator.terminal()`
      - `RestrictionPropagator.variable()`
    - `apply_default_restrictions()`
    - `apply_restrictions()`
  - ufl_legacy.algorithms.balancing module
    - `BalanceModifiers`
      - `BalanceModifiers.cell_avg()`
      - `BalanceModifiers.expr()`
      - `BalanceModifiers.facet_avg()`
      - `BalanceModifiers.grad()`
      - `BalanceModifiers.negative_restricted()`
      - `BalanceModifiers.positive_restricted()`
      - `BalanceModifiers.reference_grad()`
      - `BalanceModifiers.reference_value()`
      - `BalanceModifiers.terminal()`
    - `balance_modified_terminal()`
    - `balance_modifiers()`
  - ufl_legacy.algorithms.change_to_reference module
    - `NEWChangeToReferenceGrad`
      - `NEWChangeToReferenceGrad.cell_avg()`
      - `NEWChangeToReferenceGrad.coefficient_derivative()`
      - `NEWChangeToReferenceGrad.expr()`
      - `NEWChangeToReferenceGrad.facet_avg()`
      - `NEWChangeToReferenceGrad.form_argument()`
      - `NEWChangeToReferenceGrad.geometric_quantity()`
      - `NEWChangeToReferenceGrad.grad()`
      - `NEWChangeToReferenceGrad.reference_grad()`
      - `NEWChangeToReferenceGrad.restricted()`
      - `NEWChangeToReferenceGrad.terminal()`
    - `OLDChangeToReferenceGrad`
      - `OLDChangeToReferenceGrad.coefficient_derivative()`
      - `OLDChangeToReferenceGrad.expr()`
      - `OLDChangeToReferenceGrad.grad()`
      - `OLDChangeToReferenceGrad.reference_grad()`
      - `OLDChangeToReferenceGrad.terminal()`
    - `change_integrand_geometry_representation()`
    - `change_to_reference_grad()`
  - ufl_legacy.algorithms.check_arities module
    - `ArityChecker`
      - `ArityChecker.argument()`
      - `ArityChecker.cell_avg()`
      - `ArityChecker.component_tensor()`
      - `ArityChecker.conditional()`
      - `ArityChecker.conj()`
      - `ArityChecker.division()`
      - `ArityChecker.dot()`
      - `ArityChecker.expr()`
      - `ArityChecker.facet_avg()`
      - `ArityChecker.grad()`
      - `ArityChecker.index_sum()`
      - `ArityChecker.indexed()`
      - `ArityChecker.inner()`
      - `ArityChecker.linear_indexed_type()`
      - `ArityChecker.linear_operator()`
      - `ArityChecker.list_tensor()`
      - `ArityChecker.negative_restricted()`
      - `ArityChecker.nonlinear_operator()`
      - `ArityChecker.outer()`
      - `ArityChecker.positive_restricted()`
      - `ArityChecker.product()`
      - `ArityChecker.reference_grad()`
      - `ArityChecker.reference_value()`
      - `ArityChecker.sum()`
      - `ArityChecker.terminal()`
      - `ArityChecker.variable()`
    - `ArityMismatch`
    - `check_form_arity()`
    - `check_integrand_arity()`
  - ufl_legacy.algorithms.check_restrictions module
    - `RestrictionChecker`
      - `RestrictionChecker.expr()`
      - `RestrictionChecker.facet_normal()`
      - `RestrictionChecker.form_argument()`
      - `RestrictionChecker.restricted()`
    - `check_restrictions()`
  - ufl_legacy.algorithms.checks module
    - `validate_form()`
  - ufl_legacy.algorithms.comparison_checker module
    - `CheckComparisons`
      - `CheckComparisons.abs()`
      - `CheckComparisons.compare()`
      - `CheckComparisons.expr()`
      - `CheckComparisons.ge()`
      - `CheckComparisons.gt()`
      - `CheckComparisons.imag()`
      - `CheckComparisons.indexed()`
      - `CheckComparisons.le()`
      - `CheckComparisons.lt()`
      - `CheckComparisons.max_value()`
      - `CheckComparisons.min_value()`
      - `CheckComparisons.power()`
      - `CheckComparisons.real()`
      - `CheckComparisons.sign()`
      - `CheckComparisons.sqrt()`
      - `CheckComparisons.terminal()`
    - `ComplexComparisonError`
    - `do_comparison_check()`
  - ufl_legacy.algorithms.compute_form_data module
    - `attach_estimated_degrees()`
    - `compute_form_data()`
  - ufl_legacy.algorithms.coordinate_derivative_helpers module
    - `CoordinateDerivativeIsOutermostChecker`
      - `CoordinateDerivativeIsOutermostChecker.coordinate_derivative()`
      - `CoordinateDerivativeIsOutermostChecker.expr()`
      - `CoordinateDerivativeIsOutermostChecker.multi_index()`
      - `CoordinateDerivativeIsOutermostChecker.terminal()`
    - `attach_coordinate_derivatives()`
    - `strip_coordinate_derivatives()`
  - ufl_legacy.algorithms.domain_analysis module
    - `ExprTupleKey`
      - `ExprTupleKey.x`
    - `IntegralData`
      - `IntegralData.domain`
      - `IntegralData.enabled_coefficients`
      - `IntegralData.integral_coefficients`
      - `IntegralData.integral_type`
      - `IntegralData.integrals`
      - `IntegralData.metadata`
      - `IntegralData.subdomain_id`
    - `accumulate_integrands_with_same_metadata()`
    - `build_integral_data()`
    - `dicts_lt()`
    - `group_form_integrals()`
    - `group_integrals_by_domain_and_type()`
    - `integral_subdomain_ids()`
    - `rearrange_integrals_by_single_subdomains()`
    - `reconstruct_form_from_integral_data()`
  - ufl_legacy.algorithms.elementtransformations module
    - `increase_order()`
    - `tear()`
  - ufl_legacy.algorithms.estimate_degrees module
    - `IrreducibleInt`
    - `SumDegreeEstimator`
      - `SumDegreeEstimator.abs()`
      - `SumDegreeEstimator.argument()`
      - `SumDegreeEstimator.atan_2()`
      - `SumDegreeEstimator.bessel_function()`
      - `SumDegreeEstimator.cell_avg()`
      - `SumDegreeEstimator.cell_coordinate()`
      - `SumDegreeEstimator.coefficient()`
      - `SumDegreeEstimator.cofactor()`
      - `SumDegreeEstimator.component_tensor()`
      - `SumDegreeEstimator.compound_derivative()`
      - `SumDegreeEstimator.compound_tensor_operator()`
      - `SumDegreeEstimator.condition()`
      - `SumDegreeEstimator.conditional()`
      - `SumDegreeEstimator.conj()`
      - `SumDegreeEstimator.constant()`
      - `SumDegreeEstimator.constant_value()`
      - `SumDegreeEstimator.coordinate_derivative()`
      - `SumDegreeEstimator.cross()`
      - `SumDegreeEstimator.curl()`
      - `SumDegreeEstimator.derivative()`
      - `SumDegreeEstimator.determinant()`
      - `SumDegreeEstimator.deviatoric()`
      - `SumDegreeEstimator.div()`
      - `SumDegreeEstimator.division()`
      - `SumDegreeEstimator.dot()`
      - `SumDegreeEstimator.expr()`
      - `SumDegreeEstimator.expr_list()`
      - `SumDegreeEstimator.expr_mapping()`
      - `SumDegreeEstimator.facet_avg()`
      - `SumDegreeEstimator.geometric_quantity()`
      - `SumDegreeEstimator.grad()`
      - `SumDegreeEstimator.imag()`
      - `SumDegreeEstimator.index_sum()`
      - `SumDegreeEstimator.indexed()`
      - `SumDegreeEstimator.inner()`
      - `SumDegreeEstimator.inverse()`
      - `SumDegreeEstimator.label()`
      - `SumDegreeEstimator.list_tensor()`
      - `SumDegreeEstimator.math_function()`
      - `SumDegreeEstimator.max_value()`
      - `SumDegreeEstimator.min_value()`
      - `SumDegreeEstimator.multi_index()`
      - `SumDegreeEstimator.nabla_div()`
      - `SumDegreeEstimator.nabla_grad()`
      - `SumDegreeEstimator.negative_restricted()`
      - `SumDegreeEstimator.outer()`
      - `SumDegreeEstimator.positive_restricted()`
      - `SumDegreeEstimator.power()`
      - `SumDegreeEstimator.product()`
      - `SumDegreeEstimator.real()`
      - `SumDegreeEstimator.reference_curl()`
      - `SumDegreeEstimator.reference_div()`
      - `SumDegreeEstimator.reference_grad()`
      - `SumDegreeEstimator.reference_value()`
      - `SumDegreeEstimator.skew()`
      - `SumDegreeEstimator.spatial_coordinate()`
      - `SumDegreeEstimator.sum()`
      - `SumDegreeEstimator.sym()`
      - `SumDegreeEstimator.trace()`
      - `SumDegreeEstimator.transposed()`
      - `SumDegreeEstimator.variable()`
      - `SumDegreeEstimator.variable_derivative()`
    - `estimate_total_polynomial_degree()`
  - ufl_legacy.algorithms.expand_compounds module
    - `expand_compounds()`
  - ufl_legacy.algorithms.expand_indices module
    - `IndexExpander`
      - `IndexExpander.component()`
      - `IndexExpander.component_tensor()`
      - `IndexExpander.conditional()`
      - `IndexExpander.division()`
      - `IndexExpander.form_argument()`
      - `IndexExpander.grad()`
      - `IndexExpander.index_sum()`
      - `IndexExpander.indexed()`
      - `IndexExpander.list_tensor()`
      - `IndexExpander.multi_index()`
      - `IndexExpander.scalar_value()`
      - `IndexExpander.terminal()`
      - `IndexExpander.zero()`
    - `expand_indices()`
    - `purge_list_tensors()`
  - ufl_legacy.algorithms.formdata module
    - `ExprData`
    - `FormData`
  - ufl_legacy.algorithms.formfiles module
    - `FileData`
    - `execute_ufl_code()`
    - `interpret_ufl_namespace()`
    - `load_forms()`
    - `load_ufl_file()`
    - `read_lines_decoded()`
    - `read_ufl_file()`
  - ufl_legacy.algorithms.formsplitter module
    - `FormSplitter`
      - `FormSplitter.argument()`
      - `FormSplitter.expr()`
      - `FormSplitter.multi_index()`
      - `FormSplitter.split()`
    - `extract_blocks()`
  - ufl_legacy.algorithms.formtransformations module
    - `PartExtracter`
      - `PartExtracter.argument()`
      - `PartExtracter.cell_avg()`
      - `PartExtracter.component_tensor()`
      - `PartExtracter.conj()`
      - `PartExtracter.division()`
      - `PartExtracter.dot()`
      - `PartExtracter.expr()`
      - `PartExtracter.facet_avg()`
      - `PartExtracter.grad()`
      - `PartExtracter.imag()`
      - `PartExtracter.index_sum()`
      - `PartExtracter.indexed()`
      - `PartExtracter.inner()`
      - `PartExtracter.linear_indexed_type()`
      - `PartExtracter.linear_operator()`
      - `PartExtracter.list_tensor()`
      - `PartExtracter.negative_restricted()`
      - `PartExtracter.outer()`
      - `PartExtracter.positive_restricted()`
      - `PartExtracter.product()`
      - `PartExtracter.real()`
      - `PartExtracter.sum()`
      - `PartExtracter.terminal()`
      - `PartExtracter.variable()`
    - `compute_energy_norm()`
    - `compute_form_action()`
    - `compute_form_adjoint()`
    - `compute_form_arities()`
    - `compute_form_functional()`
    - `compute_form_lhs()`
    - `compute_form_rhs()`
    - `compute_form_with_arity()`
    - `zero_expr()`
  - ufl_legacy.algorithms.map_integrands module
    - `map_integrand_dags()`
    - `map_integrands()`
  - ufl_legacy.algorithms.multifunction module
  - ufl_legacy.algorithms.preprocess_expression module
  - ufl_legacy.algorithms.remove_complex_nodes module
    - `ComplexNodeRemoval`
      - `ComplexNodeRemoval.conj()`
      - `ComplexNodeRemoval.expr()`
      - `ComplexNodeRemoval.imag()`
      - `ComplexNodeRemoval.real()`
      - `ComplexNodeRemoval.terminal()`
    - `remove_complex_nodes()`
  - ufl_legacy.algorithms.renumbering module
    - `IndexRenumberingTransformer`
      - `IndexRenumberingTransformer.index()`
      - `IndexRenumberingTransformer.multi_index()`
      - `IndexRenumberingTransformer.zero()`
    - `VariableRenumberingTransformer`
      - `VariableRenumberingTransformer.variable()`
    - `renumber_indices()`
  - ufl_legacy.algorithms.replace module
    - `Replacer`
      - `Replacer.coefficient_derivative()`
      - `Replacer.expr()`
    - `replace()`
  - ufl_legacy.algorithms.signature module
    - `compute_expression_hashdata()`
    - `compute_expression_signature()`
    - `compute_form_signature()`
    - `compute_multiindex_hashdata()`
    - `compute_terminal_hashdata()`
  - ufl_legacy.algorithms.strip_terminal_data module
    - `TerminalStripper`
      - `TerminalStripper.argument()`
      - `TerminalStripper.coefficient()`
      - `TerminalStripper.constant()`
      - `TerminalStripper.expr()`
    - `replace_terminal_data()`
    - `strip_domain()`
    - `strip_function_space()`
    - `strip_terminal_data()`
  - ufl_legacy.algorithms.transformer module
    - `CopyTransformer`
      - `CopyTransformer.expr()`
      - `CopyTransformer.terminal()`
      - `CopyTransformer.variable()`
    - `ReuseTransformer`
      - `ReuseTransformer.expr()`
      - `ReuseTransformer.terminal()`
      - `ReuseTransformer.variable()`
    - `Transformer`
      - `Transformer.always_reconstruct()`
      - `Transformer.expr()`
      - `Transformer.print_visit_stack()`
      - `Transformer.reconstruct_variable()`
      - `Transformer.reuse()`
      - `Transformer.reuse_if_possible()`
      - `Transformer.reuse_if_untouched()`
      - `Transformer.reuse_variable()`
      - `Transformer.terminal()`
      - `Transformer.undefined()`
      - `Transformer.visit()`
    - `VariableStripper`
      - `VariableStripper.variable()`
    - `apply_transformer()`
    - `is_post_handler()`
    - `strip_variables()`
    - `ufl2ufl()`
    - `ufl2uflcopy()`
  - ufl_legacy.algorithms.traversal module
    - `iter_expressions()`
  - Module contents
    - `FormSplitter`
      - `FormSplitter.argument()`
      - `FormSplitter.expr()`
      - `FormSplitter.multi_index()`
      - `FormSplitter.split()`
    - `MultiFunction`
      - `MultiFunction.expr()`
      - `MultiFunction.reuse_if_untouched()`
      - `MultiFunction.undefined()`
    - `ReuseTransformer`
      - `ReuseTransformer.expr()`
      - `ReuseTransformer.terminal()`
      - `ReuseTransformer.variable()`
    - `Transformer`
      - `Transformer.always_reconstruct()`
      - `Transformer.expr()`
      - `Transformer.print_visit_stack()`
      - `Transformer.reconstruct_variable()`
      - `Transformer.reuse()`
      - `Transformer.reuse_if_possible()`
      - `Transformer.reuse_if_untouched()`
      - `Transformer.reuse_variable()`
      - `Transformer.terminal()`
      - `Transformer.undefined()`
      - `Transformer.visit()`
    - `apply_transformer()`
    - `change_to_reference_grad()`
    - `compute_energy_norm()`
    - `compute_form_action()`
    - `compute_form_adjoint()`
    - `compute_form_data()`
    - `compute_form_functional()`
    - `compute_form_lhs()`
    - `compute_form_rhs()`
    - `compute_form_signature()`
    - `estimate_total_polynomial_degree()`
    - `expand_compounds()`
    - `expand_derivatives()`
    - `expand_indices()`
    - `extract_arguments()`
    - `extract_coefficients()`
    - `extract_elements()`
    - `extract_sub_elements()`
    - `extract_type()`
    - `extract_unique_elements()`
    - `load_ufl_file()`
    - `post_traversal()`
    - `purge_list_tensors()`
    - `replace()`
    - `replace_terminal_data()`
    - `sort_elements()`
    - `strip_terminal_data()`
    - `strip_variables()`
    - `tree_format()`
    - `validate_form()`
- ufl_legacy.core package
  - Submodules
  - ufl_legacy.core.compute_expr_hash module
    - `compute_expr_hash()`
  - ufl_legacy.core.expr module
    - `Expr`
      - `Expr.T`
      - `Expr.dx()`
      - `Expr.evaluate()`
      - `Expr.geometric_dimension()`
      - `Expr.ufl_disable_profiling()`
      - `Expr.ufl_domain()`
      - `Expr.ufl_domains()`
      - `Expr.ufl_enable_profiling()`
    - `ufl_err_str()`
  - ufl_legacy.core.multiindex module
    - `FixedIndex`
    - `Index`
      - `Index.count()`
    - `IndexBase`
    - `MultiIndex`
      - `MultiIndex.evaluate()`
      - `MultiIndex.indices()`
      - `MultiIndex.is_cellwise_constant()`
      - `MultiIndex.ufl_domains()`
      - `MultiIndex.ufl_free_indices`
      - `MultiIndex.ufl_index_dimensions`
      - `MultiIndex.ufl_shape`
    - `as_multi_index()`
    - `indices()`
  - ufl_legacy.core.operator module
    - `Operator`
      - `Operator.ufl_operands`
  - ufl_legacy.core.terminal module
    - `FormArgument`
    - `Terminal`
      - `Terminal.evaluate()`
      - `Terminal.ufl_domains()`
      - `Terminal.ufl_free_indices`
      - `Terminal.ufl_index_dimensions`
      - `Terminal.ufl_operands`
  - ufl_legacy.core.ufl_id module
    - `attach_ufl_id()`
  - ufl_legacy.core.ufl_type module
    - `attach_implementations_of_indexing_interface()`
    - `attach_operators_from_hash_data()`
    - `check_abstract_trait_consistency()`
    - `check_has_slots()`
    - `check_implements_required_methods()`
    - `check_implements_required_properties()`
    - `check_is_terminal_consistency()`
    - `check_type_traits_consistency()`
    - `determine_num_ops()`
    - `get_base_attr()`
    - `set_trait()`
    - `ufl_type()`
    - `update_global_expr_attributes()`
  - Module contents
- ufl_legacy.corealg package
  - Submodules
  - ufl_legacy.corealg.map_dag module
    - `map_expr_dag()`
    - `map_expr_dags()`
  - ufl_legacy.corealg.multifunction module
    - `MultiFunction`
      - `MultiFunction.expr()`
      - `MultiFunction.reuse_if_untouched()`
      - `MultiFunction.undefined()`
    - `get_num_args()`
    - `memoized_handler()`
  - ufl_legacy.corealg.traversal module
    - `cutoff_post_traversal()`
    - `cutoff_unique_post_traversal()`
    - `post_traversal()`
    - `pre_traversal()`
    - `traverse_terminals()`
    - `traverse_unique_terminals()`
    - `unique_post_traversal()`
    - `unique_pre_traversal()`
  - Module contents
- ufl_legacy.finiteelement package
  - Submodules
  - ufl_legacy.finiteelement.brokenelement module
    - `BrokenElement`
      - `BrokenElement.mapping()`
      - `BrokenElement.reconstruct()`
      - `BrokenElement.shortstr()`
  - ufl_legacy.finiteelement.elementlist module
    - `canonical_element_description()`
    - `feec_element()`
    - `feec_element_l2()`
    - `register_alias()`
    - `register_element()`
    - `register_element2()`
    - `show_elements()`
  - ufl_legacy.finiteelement.enrichedelement module
    - `EnrichedElement`
      - `EnrichedElement.is_cellwise_constant()`
      - `EnrichedElement.shortstr()`
    - `EnrichedElementBase`
      - `EnrichedElementBase.mapping()`
      - `EnrichedElementBase.reconstruct()`
      - `EnrichedElementBase.sobolev_space()`
    - `NodalEnrichedElement`
      - `NodalEnrichedElement.is_cellwise_constant()`
      - `NodalEnrichedElement.shortstr()`
  - ufl_legacy.finiteelement.facetelement module
    - `FacetElement()`
  - ufl_legacy.finiteelement.finiteelement module
    - `FiniteElement`
      - `FiniteElement.mapping()`
      - `FiniteElement.reconstruct()`
      - `FiniteElement.shortstr()`
      - `FiniteElement.sobolev_space()`
      - `FiniteElement.variant()`
  - ufl_legacy.finiteelement.finiteelementbase module
    - `FiniteElementBase`
      - `FiniteElementBase.cell()`
      - `FiniteElementBase.degree()`
      - `FiniteElementBase.extract_component()`
      - `FiniteElementBase.extract_reference_component()`
      - `FiniteElementBase.extract_subelement_component()`
      - `FiniteElementBase.extract_subelement_reference_component()`
      - `FiniteElementBase.family()`
      - `FiniteElementBase.is_cellwise_constant()`
      - `FiniteElementBase.mapping()`
      - `FiniteElementBase.num_sub_elements()`
      - `FiniteElementBase.quadrature_scheme()`
      - `FiniteElementBase.reference_value_shape()`
      - `FiniteElementBase.reference_value_size()`
      - `FiniteElementBase.sub_elements()`
      - `FiniteElementBase.symmetry()`
      - `FiniteElementBase.value_shape()`
      - `FiniteElementBase.value_size()`
      - `FiniteElementBase.variant()`
  - ufl_legacy.finiteelement.hdivcurl module
    - `HCurlElement`
      - `HCurlElement.mapping()`
      - `HCurlElement.reconstruct()`
      - `HCurlElement.shortstr()`
      - `HCurlElement.sobolev_space()`
    - `HDivElement`
      - `HDivElement.mapping()`
      - `HDivElement.reconstruct()`
      - `HDivElement.shortstr()`
      - `HDivElement.sobolev_space()`
    - `WithMapping`
      - `WithMapping.mapping()`
      - `WithMapping.reconstruct()`
      - `WithMapping.reference_value_shape()`
      - `WithMapping.shortstr()`
      - `WithMapping.value_shape()`
  - ufl_legacy.finiteelement.interiorelement module
    - `InteriorElement()`
  - ufl_legacy.finiteelement.mixedelement module
    - `MixedElement`
      - `MixedElement.degree()`
      - `MixedElement.extract_component()`
      - `MixedElement.extract_reference_component()`
      - `MixedElement.extract_subelement_component()`
      - `MixedElement.extract_subelement_reference_component()`
      - `MixedElement.is_cellwise_constant()`
      - `MixedElement.mapping()`
      - `MixedElement.num_sub_elements()`
      - `MixedElement.reconstruct()`
      - `MixedElement.reconstruct_from_elements()`
      - `MixedElement.shortstr()`
      - `MixedElement.sub_elements()`
      - `MixedElement.symmetry()`
    - `TensorElement`
      - `TensorElement.extract_subelement_component()`
      - `TensorElement.flattened_sub_element_mapping()`
      - `TensorElement.mapping()`
      - `TensorElement.reconstruct()`
      - `TensorElement.shortstr()`
      - `TensorElement.symmetry()`
      - `TensorElement.variant()`
    - `VectorElement`
      - `VectorElement.mapping()`
      - `VectorElement.reconstruct()`
      - `VectorElement.shortstr()`
      - `VectorElement.variant()`
  - ufl_legacy.finiteelement.restrictedelement module
    - `RestrictedElement`
      - `RestrictedElement.is_cellwise_constant()`
      - `RestrictedElement.mapping()`
      - `RestrictedElement.num_restricted_sub_elements()`
      - `RestrictedElement.num_sub_elements()`
      - `RestrictedElement.reconstruct()`
      - `RestrictedElement.restricted_sub_elements()`
      - `RestrictedElement.restriction_domain()`
      - `RestrictedElement.shortstr()`
      - `RestrictedElement.sub_element()`
      - `RestrictedElement.sub_elements()`
      - `RestrictedElement.symmetry()`
  - ufl_legacy.finiteelement.tensorproductelement module
    - `TensorProductElement`
      - `TensorProductElement.mapping()`
      - `TensorProductElement.num_sub_elements()`
      - `TensorProductElement.reconstruct()`
      - `TensorProductElement.shortstr()`
      - `TensorProductElement.sobolev_space()`
      - `TensorProductElement.sub_elements()`
  - Module contents
- ufl_legacy.formatting package
  - Submodules
  - ufl_legacy.formatting.graph module
    - `Graph`
      - `Graph.E()`
      - `Graph.Ein()`
      - `Graph.Eout()`
      - `Graph.V()`
      - `Graph.Vin()`
      - `Graph.Vout()`
    - `HeapItem`
    - `StringDependencyDefiner`
      - `StringDependencyDefiner.argument()`
      - `StringDependencyDefiner.coefficient()`
      - `StringDependencyDefiner.expr()`
      - `StringDependencyDefiner.facet_normal()`
      - `StringDependencyDefiner.geometric_quantity()`
      - `StringDependencyDefiner.spatial_derivative()`
    - `build_graph()`
    - `depth_first_ordering()`
    - `extract_incoming_edges()`
    - `extract_incoming_vertex_connections()`
    - `extract_outgoing_edges()`
    - `extract_outgoing_vertex_connections()`
    - `len_items()`
    - `lists()`
    - `partition()`
    - `string_set_criteria()`
  - ufl_legacy.formatting.printing module
    - `form_info()`
    - `integral_info()`
    - `tree_format()`
  - ufl_legacy.formatting.ufl2dot module
    - `CompactLabeller`
      - `CompactLabeller.cell_avg()`
      - `CompactLabeller.component_tensor()`
      - `CompactLabeller.conj()`
      - `CompactLabeller.curl()`
      - `CompactLabeller.determinant()`
      - `CompactLabeller.dev()`
      - `CompactLabeller.diff()`
      - `CompactLabeller.div()`
      - `CompactLabeller.division()`
      - `CompactLabeller.dot()`
      - `CompactLabeller.facet_avg()`
      - `CompactLabeller.form_argument()`
      - `CompactLabeller.geometric_quantity()`
      - `CompactLabeller.grad()`
      - `CompactLabeller.identity()`
      - `CompactLabeller.imag()`
      - `CompactLabeller.index_sum()`
      - `CompactLabeller.indexed()`
      - `CompactLabeller.inner()`
      - `CompactLabeller.math_function()`
      - `CompactLabeller.multi_index()`
      - `CompactLabeller.nabla_div()`
      - `CompactLabeller.nabla_grad()`
      - `CompactLabeller.negative_restricted()`
      - `CompactLabeller.outer()`
      - `CompactLabeller.positive_restricted()`
      - `CompactLabeller.power()`
      - `CompactLabeller.product()`
      - `CompactLabeller.real()`
      - `CompactLabeller.scalar_value()`
      - `CompactLabeller.skew()`
      - `CompactLabeller.sum()`
      - `CompactLabeller.trace()`
      - `CompactLabeller.transposed()`
      - `CompactLabeller.zero()`
    - `FancyLabeller`
    - `ReprLabeller`
      - `ReprLabeller.operator()`
      - `ReprLabeller.terminal()`
    - `build_entities()`
    - `format_entities()`
    - `ufl2dot()`
  - ufl_legacy.formatting.ufl2unicode module
    - `Expression2UnicodeHandler`
      - `Expression2UnicodeHandler.abs()`
      - `Expression2UnicodeHandler.and_condition()`
      - `Expression2UnicodeHandler.argument()`
      - `Expression2UnicodeHandler.atan2()`
      - `Expression2UnicodeHandler.bessel_K()`
      - `Expression2UnicodeHandler.bessel_i()`
      - `Expression2UnicodeHandler.bessel_j()`
      - `Expression2UnicodeHandler.bessel_y()`
      - `Expression2UnicodeHandler.cell_avg()`
      - `Expression2UnicodeHandler.coefficient()`
      - `Expression2UnicodeHandler.coefficient_derivative()`
      - `Expression2UnicodeHandler.cofactor()`
      - `Expression2UnicodeHandler.component_tensor()`
      - `Expression2UnicodeHandler.conditional()`
      - `Expression2UnicodeHandler.conj()`
      - `Expression2UnicodeHandler.constant()`
      - `Expression2UnicodeHandler.cross()`
      - `Expression2UnicodeHandler.curl()`
      - `Expression2UnicodeHandler.determinant()`
      - `Expression2UnicodeHandler.deviatoric()`
      - `Expression2UnicodeHandler.div()`
      - `Expression2UnicodeHandler.division()`
      - `Expression2UnicodeHandler.dot()`
      - `Expression2UnicodeHandler.eq()`
      - `Expression2UnicodeHandler.exp()`
      - `Expression2UnicodeHandler.expr()`
      - `Expression2UnicodeHandler.expr_list()`
      - `Expression2UnicodeHandler.expr_mapping()`
      - `Expression2UnicodeHandler.facet_avg()`
      - `Expression2UnicodeHandler.facet_normal()`
      - `Expression2UnicodeHandler.ge()`
      - `Expression2UnicodeHandler.grad()`
      - `Expression2UnicodeHandler.gt()`
      - `Expression2UnicodeHandler.identity()`
      - `Expression2UnicodeHandler.imag()`
      - `Expression2UnicodeHandler.index_sum()`
      - `Expression2UnicodeHandler.indexed()`
      - `Expression2UnicodeHandler.inner()`
      - `Expression2UnicodeHandler.inverse()`
      - `Expression2UnicodeHandler.label()`
      - `Expression2UnicodeHandler.le()`
      - `Expression2UnicodeHandler.list_tensor()`
      - `Expression2UnicodeHandler.lt()`
      - `Expression2UnicodeHandler.math_function()`
      - `Expression2UnicodeHandler.max_value()`
      - `Expression2UnicodeHandler.min_value()`
      - `Expression2UnicodeHandler.multi_index()`
      - `Expression2UnicodeHandler.nabla_div()`
      - `Expression2UnicodeHandler.nabla_grad()`
      - `Expression2UnicodeHandler.ne()`
      - `Expression2UnicodeHandler.negative_restricted()`
      - `Expression2UnicodeHandler.not_condition()`
      - `Expression2UnicodeHandler.or_condition()`
      - `Expression2UnicodeHandler.outer()`
      - `Expression2UnicodeHandler.permutation_symbol()`
      - `Expression2UnicodeHandler.positive_restricted()`
      - `Expression2UnicodeHandler.power()`
      - `Expression2UnicodeHandler.product()`
      - `Expression2UnicodeHandler.real()`
      - `Expression2UnicodeHandler.scalar_value()`
      - `Expression2UnicodeHandler.skew()`
      - `Expression2UnicodeHandler.spatial_coordinate()`
      - `Expression2UnicodeHandler.sqrt()`
      - `Expression2UnicodeHandler.sum()`
      - `Expression2UnicodeHandler.sym()`
      - `Expression2UnicodeHandler.trace()`
      - `Expression2UnicodeHandler.transposed()`
      - `Expression2UnicodeHandler.variable()`
      - `Expression2UnicodeHandler.variable_derivative()`
      - `Expression2UnicodeHandler.zero()`
    - `PrecedenceRules`
      - `PrecedenceRules.add()`
      - `PrecedenceRules.and_condition()`
      - `PrecedenceRules.bessel_function()`
      - `PrecedenceRules.call()`
      - `PrecedenceRules.cell_avg()`
      - `PrecedenceRules.cofactor()`
      - `PrecedenceRules.component_tensor()`
      - `PrecedenceRules.conditional()`
      - `PrecedenceRules.cross()`
      - `PrecedenceRules.derivative()`
      - `PrecedenceRules.deviatoric()`
      - `PrecedenceRules.division()`
      - `PrecedenceRules.dot()`
      - `PrecedenceRules.eq()`
      - `PrecedenceRules.facet_avg()`
      - `PrecedenceRules.ge()`
      - `PrecedenceRules.gt()`
      - `PrecedenceRules.highest()`
      - `PrecedenceRules.index_sum()`
      - `PrecedenceRules.indexed()`
      - `PrecedenceRules.inner()`
      - `PrecedenceRules.le()`
      - `PrecedenceRules.list_tensor()`
      - `PrecedenceRules.lowest()`
      - `PrecedenceRules.lt()`
      - `PrecedenceRules.math_function()`
      - `PrecedenceRules.mathop()`
      - `PrecedenceRules.max_value()`
      - `PrecedenceRules.min_value()`
      - `PrecedenceRules.ne()`
      - `PrecedenceRules.not_condition()`
      - `PrecedenceRules.operator()`
      - `PrecedenceRules.or_condition()`
      - `PrecedenceRules.outer()`
      - `PrecedenceRules.power()`
      - `PrecedenceRules.product()`
      - `PrecedenceRules.restricted()`
      - `PrecedenceRules.skew()`
      - `PrecedenceRules.sym()`
      - `PrecedenceRules.terminal()`
      - `PrecedenceRules.trace()`
    - `UC`
      - `UC.Gamma`
      - `UC.Omega`
      - `UC.bold_math_A`
      - `UC.bold_math_a`
      - `UC.circled_times`
      - `UC.combining_overline`
      - `UC.combining_right_arrow_above`
      - `UC.cross_product`
      - `UC.division_slash`
      - `UC.dot`
      - `UC.element_of`
      - `UC.epsilon`
      - `UC.for_all`
      - `UC.gamma`
      - `UC.ge`
      - `UC.gt`
      - `UC.integral`
      - `UC.integral_contour`
      - `UC.integral_double`
      - `UC.integral_surface`
      - `UC.integral_triple`
      - `UC.integral_volume`
      - `UC.le`
      - `UC.left_angled_bracket`
      - `UC.left_double_angled_bracket`
      - `UC.left_white_square_bracket`
      - `UC.logical_and`
      - `UC.logical_not`
      - `UC.logical_or`
      - `UC.lt`
      - `UC.nabla`
      - `UC.nary_product`
      - `UC.ne`
      - `UC.not_element_of`
      - `UC.omega`
      - `UC.partial`
      - `UC.right_angled_bracket`
      - `UC.right_double_angled_bracket`
      - `UC.right_white_squared_bracket`
      - `UC.sqrt`
      - `UC.subscript_digits`
      - `UC.subscript_equals`
      - `UC.subscript_left_paren`
      - `UC.subscript_minus`
      - `UC.subscript_plus`
      - `UC.subscript_right_paren`
      - `UC.sum`
      - `UC.superscript_digits`
      - `UC.superscript_equals`
      - `UC.superscript_left_paren`
      - `UC.superscript_minus`
      - `UC.superscript_plus`
      - `UC.superscript_right_paren`
      - `UC.thin_space`
      - `UC.transpose`
    - `binop()`
    - `bolden_letter()`
    - `bolden_string()`
    - `expression2unicode()`
    - `form2unicode()`
    - `format_index()`
    - `get_integral_symbol()`
    - `is_int()`
    - `mathop()`
    - `measure_font()`
    - `opfont()`
    - `overline_string()`
    - `par()`
    - `prec()`
    - `precedence()`
    - `subscript_digit()`
    - `subscript_number()`
    - `superscript_digit()`
    - `superscript_number()`
    - `ufl2unicode()`
  - Module contents
- ufl_legacy.utils package
  - Submodules
  - ufl_legacy.utils.counted module
    - `ExampleCounted`
      - `ExampleCounted.count()`
    - `counted_init()`
  - ufl_legacy.utils.derivativetuples module
    - `compute_derivative_tuples()`
    - `derivative_counts_to_listing()`
    - `derivative_listing_to_counts()`
  - ufl_legacy.utils.dicts module
    - `EmptyDictType`
      - `EmptyDictType.update()`
    - `dict_sum()`
    - `mergedicts()`
    - `mergedicts2()`
    - `slice_dict()`
    - `some_key()`
    - `split_dict()`
    - `subdict()`
  - ufl_legacy.utils.formatting module
    - `camel2underscore()`
    - `dstr()`
    - `estr()`
    - `istr()`
    - `lstr()`
    - `sstr()`
    - `tstr()`
  - ufl_legacy.utils.indexflattening module
    - `flatten_multiindex()`
    - `shape_to_strides()`
    - `unflatten_index()`
  - ufl_legacy.utils.sequences module
    - `and_tuples()`
    - `iter_tree()`
    - `max_degree()`
    - `or_tuples()`
    - `product()`
    - `recursive_chain()`
    - `unzip()`
    - `xor()`
  - ufl_legacy.utils.sorting module
    - `canonicalize_metadata()`
    - `sorted_by_count()`
    - `sorted_by_key()`
    - `sorted_by_ufl_id()`
    - `topological_sorting()`
  - ufl_legacy.utils.stacks module
    - `Stack`
      - `Stack.peek()`
      - `Stack.push()`
    - `StackDict`
      - `StackDict.pop()`
      - `StackDict.push()`
  - ufl_legacy.utils.ufltypedicts module
    - `UFLTypeDefaultDict`
    - `UFLTypeDict`
  - Module contents

## Submodules

## ufl_legacy.algebra module

Basic algebra operations.

class ufl_legacy.algebra.Abs(a)

  Bases: `Operator`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.algebra.Conj(a)

  Bases: `Operator`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.algebra.Division(a, b)

  Bases: `Operator`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

  property ufl_free_indices
  property ufl_index_dimensions
  ufl_shape = ()

class ufl_legacy.algebra.Imag(a)

  Bases: `Operator`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.algebra.Power(a, b)

  Bases: `Operator`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

  property ufl_free_indices
  property ufl_index_dimensions
  ufl_shape = ()

class ufl_legacy.algebra.Product(a, b)

  Bases: `Operator`

  The product of two or more UFL objects.

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

  ufl_free_indices
  ufl_index_dimensions
  ufl_shape = ()

class ufl_legacy.algebra.Real(a)

  Bases: `Operator`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.algebra.Sum(a, b)

  Bases: `Operator`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

## ufl_legacy.argument module

This module defines the class Argument and a number of related classes (functions), including TestFunction and TrialFunction.

class ufl_legacy.argument.Argument(function_space, number, part=None)

  Bases: `FormArgument`

  UFL value: Representation of an argument to a form.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  number()

    Return the Argument number.

  part()
  ufl_domain()

    Deprecated, please use .ufl_function_space().ufl_domain() instead.

  ufl_domains()

    Deprecated, please use .ufl_function_space().ufl_domains() instead.

  ufl_element()

    Deprecated, please use .ufl_function_space().ufl_element() instead.

  ufl_function_space()

    Get the function space of this Argument.

  property ufl_shape

    Return the associated UFL shape.

ufl_legacy.argument.Arguments(function_space, number)

  UFL value: Create an Argument in a mixed space, and return a tuple with the function components corresponding to the subelements.

ufl_legacy.argument.TestFunction(function_space, part=None)

  UFL value: Create a test function argument to a form.

ufl_legacy.argument.TestFunctions(function_space)

  UFL value: Create a TestFunction in a mixed space, and return a tuple with the function components corresponding to the subelements.

ufl_legacy.argument.TrialFunction(function_space, part=None)

  UFL value: Create a trial function argument to a form.

ufl_legacy.argument.TrialFunctions(function_space)

  UFL value: Create a TrialFunction in a mixed space, and return a tuple with the function components corresponding to the subelements.

## ufl_legacy.assertions module

This module provides assertion functions used by the UFL implementation.

ufl_legacy.assertions.expecting_expr(v)

ufl_legacy.assertions.expecting_instance(v, c)

ufl_legacy.assertions.expecting_python_scalar(v)

ufl_legacy.assertions.expecting_terminal(v)

ufl_legacy.assertions.expecting_true_ufl_scalar(v)

ufl_legacy.assertions.ufl_assert(condition, *message)

  Assert that condition is true and otherwise issue an error with given message.

## ufl_legacy.averaging module

Averaging operations.

class ufl_legacy.averaging.CellAvg(f)

  Bases: `Operator`

  evaluate(x, mapping, component, index_values)

    Performs an approximate symbolic evaluation, since we dont have a cell.

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.averaging.FacetAvg(f)

  Bases: `Operator`

  evaluate(x, mapping, component, index_values)

    Performs an approximate symbolic evaluation, since we dont have a cell.

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

## ufl_legacy.cell module

Types for representing a cell.

class ufl_legacy.cell.AbstractCell(topological_dimension, geometric_dimension)

  Bases: `object`

  Representation of an abstract finite element cell with only the dimensions known.

  geometric_dimension()

    Return the dimension of the space this cell is embedded in.

  has_simplex_facets()

    Return True if all the facets of this cell are simplex cells.

  is_simplex()

    Return True if this is a simplex cell.

  topological_dimension()

    Return the dimension of the topology of this cell.

class ufl_legacy.cell.Cell(cellname, geometric_dimension=None)

  Bases: `AbstractCell`

  Representation of a named finite element cell with known structure.

  cellname()

    Return the cellname of the cell.

  facet_types()

    A tuple of ufl_legacy.Cell representing the facets of self.

  has_simplex_facets()

    Return True if all the facets of this cell are simplex cells.

  is_simplex()

    Return True if this is a simplex cell.

  num_edges()

    The number of cell edges.

  num_facets()

    The number of cell facets.

  num_vertices()

    The number of cell vertices.

  reconstruct(geometric_dimension=None)

class ufl_legacy.cell.TensorProductCell(*cells, **kwargs)

  Bases: `AbstractCell`

  cellname()

    Return the cellname of the cell.

  has_simplex_facets()

    Return True if all the facets of this cell are simplex cells.

  is_simplex()

    Return True if this is a simplex cell.

  num_edges()

    The number of cell edges.

  num_facets()

    The number of cell facets.

  num_vertices()

    The number of cell vertices.

  reconstruct(geometric_dimension=None)
  sub_cells()

    Return list of cell factors.

ufl_legacy.cell.as_cell(cell)

  Convert any valid object to a Cell or return cell if it is already a Cell.

  Allows an already valid cell, a known cellname string, or a tuple of cells for a product cell.

ufl_legacy.cell.hypercube(topological_dimension, geometric_dimension=None)

  Return a hypercube cell of given dimension.

ufl_legacy.cell.simplex(topological_dimension, geometric_dimension=None)

  Return a simplex cell of given dimension.

## ufl_legacy.checks module

Utility functions for checking properties of expressions.

ufl_legacy.checks.is_cellwise_constant(expr)

  Return whether expression is constant over a single cell.

ufl_legacy.checks.is_globally_constant(expr)

  Check if an expression is globally constant, which includes spatially independent constant coefficients that are not known before assembly time.

ufl_legacy.checks.is_python_scalar(expression)

  Return True iff expression is of a Python scalar type.

ufl_legacy.checks.is_scalar_constant_expression(expr)

  Check if an expression is a globally constant scalar expression.

ufl_legacy.checks.is_true_ufl_scalar(expression)

  Return True iff expression is scalar-valued, with no free indices.

ufl_legacy.checks.is_ufl_scalar(expression)

  Return True iff expression is scalar-valued, but possibly containing free indices.

## ufl_legacy.classes module

This file is useful for external code like tests and form compilers, since it enables the syntax “from ufl_legacy.classes import CellFacetooBar” for getting implementation details not exposed through the default ufl_legacy namespace. It also contains functionality used by algorithms for dealing with groups of classes, and for mapping types to different handler functions.

class ufl_legacy.classes.Abs(a)

  Bases: `Operator`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.classes.AbstractCell(topological_dimension, geometric_dimension)

  Bases: `object`

  Representation of an abstract finite element cell with only the dimensions known.

  geometric_dimension()

    Return the dimension of the space this cell is embedded in.

  has_simplex_facets()

    Return True if all the facets of this cell are simplex cells.

  is_simplex()

    Return True if this is a simplex cell.

  topological_dimension()

    Return the dimension of the topology of this cell.

class ufl_legacy.classes.AbstractDomain(topological_dimension, geometric_dimension)

  Bases: `object`

  Symbolic representation of a geometric domain with only a geometric and topological dimension.

  geometric_dimension()

    Return the dimension of the space this domain is embedded in.

  topological_dimension()

    Return the dimension of the topology of this domain.

class ufl_legacy.classes.AbstractFunctionSpace

  Bases: `object`

  ufl_sub_spaces()

class ufl_legacy.classes.Acos(argument)

  Bases: `MathFunction`

class ufl_legacy.classes.AndCondition(left, right)

  Bases: `BinaryCondition`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

class ufl_legacy.classes.Argument(function_space, number, part=None)

  Bases: `FormArgument`

  UFL value: Representation of an argument to a form.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  number()

    Return the Argument number.

  part()
  ufl_domain()

    Deprecated, please use .ufl_function_space().ufl_domain() instead.

  ufl_domains()

    Deprecated, please use .ufl_function_space().ufl_domains() instead.

  ufl_element()

    Deprecated, please use .ufl_function_space().ufl_element() instead.

  ufl_function_space()

    Get the function space of this Argument.

  property ufl_shape

    Return the associated UFL shape.

class ufl_legacy.classes.Asin(argument)

  Bases: `MathFunction`

class ufl_legacy.classes.Atan(argument)

  Bases: `MathFunction`

class ufl_legacy.classes.Atan2(arg1, arg2)

  Bases: `Operator`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

  ufl_free_indices = ()
  ufl_index_dimensions = ()
  ufl_shape = ()

class ufl_legacy.classes.BesselFunction(name, classname, nu, argument)

  Bases: `Operator`

  Base class for all bessel functions

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

  ufl_free_indices = ()
  ufl_index_dimensions = ()
  ufl_shape = ()

class ufl_legacy.classes.BesselI(nu, argument)

  Bases: `BesselFunction`

class ufl_legacy.classes.BesselJ(nu, argument)

  Bases: `BesselFunction`

class ufl_legacy.classes.BesselK(nu, argument)

  Bases: `BesselFunction`

class ufl_legacy.classes.BesselY(nu, argument)

  Bases: `BesselFunction`

class ufl_legacy.classes.BinaryCondition(name, left, right)

  Bases: `Condition`

class ufl_legacy.classes.BrokenElement(element)

  Bases: `FiniteElementBase`

  The discontinuous version of an existing Finite Element space.

  mapping()

    Not implemented.

  reconstruct(**kwargs)
  shortstr()

    Format as string for pretty printing.

class ufl_legacy.classes.Cell(cellname, geometric_dimension=None)

  Bases: `AbstractCell`

  Representation of a named finite element cell with known structure.

  cellname()

    Return the cellname of the cell.

  facet_types()

    A tuple of ufl_legacy.Cell representing the facets of self.

  has_simplex_facets()

    Return True if all the facets of this cell are simplex cells.

  is_simplex()

    Return True if this is a simplex cell.

  num_edges()

    The number of cell edges.

  num_facets()

    The number of cell facets.

  num_vertices()

    The number of cell vertices.

  reconstruct(geometric_dimension=None)

class ufl_legacy.classes.CellAvg(f)

  Bases: `Operator`

  evaluate(x, mapping, component, index_values)

    Performs an approximate symbolic evaluation, since we dont have a cell.

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.classes.CellCoordinate(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The coordinate in a reference cell.

  In the context of expression integration, represents the reference cell coordinate of each quadrature point.

  In the context of expression evaluation in a point in a cell, represents that point in the reference coordinate system of the cell.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'X'
  property ufl_shape

    Built-in immutable sequence.

    If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

    If the argument is a tuple, the return value is the same object.

class ufl_legacy.classes.CellDiameter(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The diameter of the cell, i.e., maximal distance of two points in the cell.

  name = 'diameter'

class ufl_legacy.classes.CellEdgeVectors(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The vectors between physical cell vertices for each edge in cell.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'CEV'
  property ufl_shape

    Built-in immutable sequence.

    If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

    If the argument is a tuple, the return value is the same object.

class ufl_legacy.classes.CellFacetJacobian(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The Jacobian of the mapping from reference facet to reference cell coordinates.

  CFJ_ij = dX_i/dXf_j

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'CFJ'
  property ufl_shape

    Built-in immutable sequence.

    If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

    If the argument is a tuple, the return value is the same object.

class ufl_legacy.classes.CellFacetJacobianDeterminant(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The pseudo-determinant of the CellFacetJacobian.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'detCFJ'

class ufl_legacy.classes.CellFacetJacobianInverse(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The pseudo-inverse of the CellFacetJacobian.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'CFK'
  property ufl_shape

    Built-in immutable sequence.

    If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

    If the argument is a tuple, the return value is the same object.

class ufl_legacy.classes.CellFacetOrigin(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The reference cell coordinate corresponding to origin of a reference facet.

  name = 'X0f'
  property ufl_shape

    Built-in immutable sequence.

    If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

    If the argument is a tuple, the return value is the same object.

class ufl_legacy.classes.CellNormal(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The upwards pointing normal vector of the current manifold cell.

  name = 'cell_normal'
  property ufl_shape

    Return the number of coordinates defined (i.e. the geometric dimension of the domain).

class ufl_legacy.classes.CellOrientation(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The orientation (+1/-1) of the current cell.

  For non-manifold cells (tdim == gdim), this equals the sign of the Jacobian determinant, i.e. +1 if the physical cell is oriented the same way as the reference cell and -1 otherwise.

  For manifold cells of tdim==gdim-1 this is input data belonging to the mesh, used to distinguish between the sides of the manifold.

  name = 'cell_orientation'

class ufl_legacy.classes.CellOrigin(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The spatial coordinate corresponding to origin of a reference cell.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell (or over each facet for facet quantities).

  name = 'x0'
  property ufl_shape

    Built-in immutable sequence.

    If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

    If the argument is a tuple, the return value is the same object.

class ufl_legacy.classes.CellVertices(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: Physical cell vertices.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'CV'
  property ufl_shape

    Built-in immutable sequence.

    If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

    If the argument is a tuple, the return value is the same object.

class ufl_legacy.classes.CellVolume(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The volume of the cell.

  name = 'volume'

class ufl_legacy.classes.Circumradius(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The circumradius of the cell.

  name = 'circumradius'

class ufl_legacy.classes.Coefficient(function_space, count=None)

  Bases: `FormArgument`

  UFL form argument type: Representation of a form coefficient.

  count()
  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  ufl_domain()

    Shortcut to get the domain of the function space of this coefficient.

  ufl_domains()

    Return tuple of domains related to this terminal object.

  ufl_element()

    Shortcut to get the finite element of the function space of this coefficient.

  ufl_function_space()

    Get the function space of this coefficient.

  property ufl_shape

    Return the associated UFL shape.

class ufl_legacy.classes.CoefficientDerivative(integrand, coefficients, arguments, coefficient_derivatives)

  Bases: `Derivative`

  Derivative of the integrand of a form w.r.t. the degrees of freedom in a discrete Coefficient.

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.classes.Cofactor(A)

  Bases: `CompoundTensorOperator`

  ufl_free_indices = ()
  ufl_index_dimensions = ()
  property ufl_shape

class ufl_legacy.classes.ComplexValue(value)

  Bases: `ScalarValue`

  UFL literal type: Representation of a constant, complex scalar

  argument()
  modulus()

class ufl_legacy.classes.ComponentTensor(expression, indices)

  Bases: `Operator`

  UFL operator type: Maps the free indices of a scalar valued expression to tensor axes.

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

  indices()
  ufl_free_indices
  ufl_index_dimensions
  ufl_shape

class ufl_legacy.classes.CompoundDerivative(operands)

  Bases: `Derivative`

  Base class for all compound derivative types.

class ufl_legacy.classes.CompoundTensorOperator(operands)

  Bases: `Operator`

class ufl_legacy.classes.Condition(operands)

  Bases: `Operator`

  ufl_free_indices = ()
  ufl_index_dimensions = ()
  ufl_shape = ()

class ufl_legacy.classes.Conditional(condition, true_value, false_value)

  Bases: `Operator`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.classes.Conj(a)

  Bases: `Operator`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.classes.Constant(domain, shape=(), count=None)

  Bases: `Terminal`

  count()
  is_cellwise_constant()
  ufl_domain()

    Return the single unique domain this expression is defined on, or throw an error.

  ufl_domains()

    Return tuple of domains related to this terminal object.

  property ufl_shape

class ufl_legacy.classes.ConstantValue

  Bases: `Terminal`

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  ufl_domains()

    Return tuple of domains related to this terminal object.

class ufl_legacy.classes.CoordinateDerivative(integrand, coefficients, arguments, coefficient_derivatives)

  Bases: `CoefficientDerivative`

  Derivative of the integrand of a form w.r.t. the SpatialCoordinates.

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.classes.Cos(argument)

  Bases: `MathFunction`

class ufl_legacy.classes.Cosh(argument)

  Bases: `MathFunction`

class ufl_legacy.classes.Cross(a, b)

  Bases: `CompoundTensorOperator`

  ufl_free_indices
  ufl_index_dimensions
  ufl_shape = (3,)

class ufl_legacy.classes.Curl(f)

  Bases: `CompoundDerivative`

  property ufl_free_indices
  property ufl_index_dimensions
  ufl_shape

class ufl_legacy.classes.Derivative(operands)

  Bases: `Operator`

  Base class for all derivative types.

class ufl_legacy.classes.Determinant(A)

  Bases: `CompoundTensorOperator`

  ufl_free_indices = ()
  ufl_index_dimensions = ()
  ufl_shape = ()

class ufl_legacy.classes.Deviatoric(A)

  Bases: `CompoundTensorOperator`

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.classes.Div(f)

  Bases: `CompoundDerivative`

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.classes.Division(a, b)

  Bases: `Operator`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

  property ufl_free_indices
  property ufl_index_dimensions
  ufl_shape = ()

class ufl_legacy.classes.Dot(a, b)

  Bases: `CompoundTensorOperator`

  ufl_free_indices
  ufl_index_dimensions
  property ufl_shape

class ufl_legacy.classes.EQ(left, right)

  Bases: `BinaryCondition`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

class ufl_legacy.classes.EnrichedElement(*elements)

  Bases: `EnrichedElementBase`

  The vector sum of several finite element spaces:

  \[\textrm{EnrichedElement}(V, Q) = \{v + q | v \in V, q \in Q\}.\]

  Dual basis is a concatenation of subelements dual bases; primal basis is a concatenation of subelements primal bases; resulting element is not nodal even when subelements are. Structured basis may be exploited in form compilers.

  is_cellwise_constant()

    Return whether the basis functions of this element is spatially constant over each cell.

  shortstr()

    Format as string for pretty printing.

class ufl_legacy.classes.Equation(lhs, rhs)

  Bases: `object`

  This class is used to represent equations expressed by the “==” operator. Examples include a == L and F == 0 where a, L and F are Form objects.

class ufl_legacy.classes.Erf(argument)

  Bases: `MathFunction`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

class ufl_legacy.classes.Exp(argument)

  Bases: `MathFunction`

class ufl_legacy.classes.Expr

  Bases: `object`

  Base class for all UFL expression types.

  Instance properties

    Every `Expr` instance will have certain properties. The most important ones are `ufl_operands`, `ufl_shape`, `ufl_free_indices`, and `ufl_index_dimensions` properties. Expressions are immutable and hashable.

  Type traits

    The `Expr` API defines a number of type traits that each subclass needs to provide. Most of these are specified indirectly via the arguments to the `ufl_type` class decorator, allowing UFL to do some consistency checks and automate most of the traits for most types. Type traits are accessed via a class or instance object of the form `obj._ufl_traitname_`. See the source code for description of each type trait.

  Operators

    Some Python special functions are implemented in this class, some are implemented in subclasses, and some are attached to this class in the `ufl_type` class decorator.

  Defining subclasses

    To define a new expression class, inherit from either `Terminal` or `Operator`, and apply the `ufl_type` class decorator with suitable arguments. See the docstring of `ufl_type` for details on its arguments. Looking at existing classes similar to the one you wish to add is a good idea. Looking through the comments in the `Expr` class and `ufl_type` to understand all the properties that may need to be specified is also a good idea. Note that many algorithms in UFL and form compilers will need handlers implemented for each new type::.

        @ufl_type()
        class MyOperator(Operator):
            pass

  Type collections

    All `Expr` subclasses are collected by `ufl_type` in global variables available via `Expr`.

  Profiling

    Object creation statistics can be collected by doing

        Expr.ufl_enable_profiling()
        # ... run some code
        initstats, delstats = Expr.ufl_disable_profiling()

    Giving a list of creation and deletion counts for each typecode.

  property T

    Transpose a rank-2 tensor expression. For more general transpose operations of higher order tensor expressions, use indexing and Tensor.

  dx(*ii)

    Return the partial derivative with respect to spatial variable number ii.

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

  geometric_dimension()

    Return the geometric dimension this expression lives in.

  static ufl_disable_profiling()

    Turn off the object counting mechanism. Return object init and del counts.

  ufl_domain()

    Return the single unique domain this expression is defined on, or throw an error.

  ufl_domains()

    Return all domains this expression is defined on.

  static ufl_enable_profiling()

    Turn on the object counting mechanism and reset counts to zero.

class ufl_legacy.classes.ExprList(*operands)

  Bases: `Operator`

  List of Expr objects. For internal use, never to be created by end users.

  free_indices()
  index_dimensions()
  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.classes.ExprMapping(*operands)

  Bases: `Operator`

  Mapping of Expr objects. For internal use, never to be created by end users.

  free_indices()
  index_dimensions()
  ufl_domains()

    Return all domains this expression is defined on.

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.classes.FacetArea(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The area of the facet.

  name = 'facetarea'

class ufl_legacy.classes.FacetAvg(f)

  Bases: `Operator`

  evaluate(x, mapping, component, index_values)

    Performs an approximate symbolic evaluation, since we dont have a cell.

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.classes.FacetCoordinate(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The coordinate in a reference cell of a facet.

  In the context of expression integration over a facet, represents the reference facet coordinate of each quadrature point.

  In the context of expression evaluation in a point on a facet, represents that point in the reference coordinate system of the facet.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'Xf'
  property ufl_shape

    Built-in immutable sequence.

    If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

    If the argument is a tuple, the return value is the same object.

class ufl_legacy.classes.FacetEdgeVectors(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The vectors between physical cell vertices for each edge in current facet.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'FEV'
  property ufl_shape

    Built-in immutable sequence.

    If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

    If the argument is a tuple, the return value is the same object.

ufl_legacy.classes.FacetElement(element)

  Constructs the restriction of a finite element to the facets of the cell.

class ufl_legacy.classes.FacetJacobian(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The Jacobian of the mapping from reference facet to spatial coordinates.

  > FJ_ij = dx_i/dXf_j

  The FacetJacobian is the product of the Jacobian and CellFacetJacobian:

  > FJ = dx/dXf = dx/dX dX/dXf = J * CFJ

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'FJ'
  property ufl_shape

    Built-in immutable sequence.

    If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

    If the argument is a tuple, the return value is the same object.

class ufl_legacy.classes.FacetJacobianDeterminant(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The pseudo-determinant of the FacetJacobian.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'detFJ'

class ufl_legacy.classes.FacetJacobianInverse(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The pseudo-inverse of the FacetJacobian.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'FK'
  property ufl_shape

    Built-in immutable sequence.

    If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

    If the argument is a tuple, the return value is the same object.

class ufl_legacy.classes.FacetNormal(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The outwards pointing normal vector of the current facet.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'n'
  property ufl_shape

    Return the number of coordinates defined (i.e. the geometric dimension of the domain).

class ufl_legacy.classes.FacetOrientation(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The orientation (+1/-1) of the current facet relative to the reference cell.

  name = 'facet_orientation'

class ufl_legacy.classes.FacetOrigin(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The spatial coordinate corresponding to origin of a reference facet.

  name = 'x0f'
  property ufl_shape

    Built-in immutable sequence.

    If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

    If the argument is a tuple, the return value is the same object.

class ufl_legacy.classes.FiniteElement(family, cell=None, degree=None, form_degree=None, quad_scheme=None, variant=None)

  Bases: `FiniteElementBase`

  The basic finite element class for all simple finite elements.

  mapping()

    Not implemented.

  reconstruct(family=None, cell=None, degree=None, quad_scheme=None, variant=None)

    Construct a new FiniteElement object with some properties replaced with new values.

  shortstr()

    Format as string for pretty printing.

  sobolev_space()

    Return the underlying Sobolev space.

  variant()

    Return the variant used to initialise the element.

class ufl_legacy.classes.FiniteElementBase(family, cell, degree, quad_scheme, value_shape, reference_value_shape)

  Bases: `object`

  Base class for all finite elements.

  cell()

    Return cell of finite element.

  degree(component=None)

    Return polynomial degree of finite element.

  extract_component(i)

    Recursively extract component index relative to a (simple) element and that element for given value component index.

  extract_reference_component(i)

    Recursively extract reference component index relative to a (simple) element and that element for given reference value component index.

  extract_subelement_component(i)

    Extract direct subelement index and subelement relative component index for a given component index.

  extract_subelement_reference_component(i)

    Extract direct subelement index and subelement relative reference component index for a given reference component index.

  family()

    Return finite element family.

  is_cellwise_constant(component=None)

    Return whether the basis functions of this element is spatially constant over each cell.

  mapping()

    Not implemented.

  num_sub_elements()

    Return number of sub-elements.

  quadrature_scheme()

    Return quadrature scheme of finite element.

  reference_value_shape()

    Return the shape of the value space on the reference cell.

  reference_value_size()

    Return the integer product of the reference value shape.

  sub_elements()

    Return list of sub-elements.

  symmetry()

    Return the symmetry dict, which is a mapping \(c_0 \to c_1\) meaning that component \(c_0\) is represented by component \(c_1\). A component is a tuple of one or more ints.

  value_shape()

    Return the shape of the value space on the global domain.

  value_size()

    Return the integer product of the value shape.

  variant()

    Return the variant used to initialise the element.

class ufl_legacy.classes.FixedIndex(value)

  Bases: `IndexBase`

  UFL value: An index with a specific value assigned.

class ufl_legacy.classes.FloatValue(value)

  Bases: `RealValue`

  UFL literal type: Representation of a constant scalar floating point value.

class ufl_legacy.classes.Form(integrals)

  Bases: `object`

  Description of a weak form consisting of a sum of integrals over subdomains.

  arguments()

    Return all `Argument` objects found in form.

  coefficient_numbering()

    Return a contiguous numbering of coefficients in a mapping `{coefficient:number}`.

  coefficients()

    Return all `Coefficient` objects found in form.

  constant_numbering()

    Return a contiguous numbering of constants in a mapping `{constant:number}`.

  constants()
  domain_numbering()

    Return a contiguous numbering of domains in a mapping `{domain:number}`.

  empty()

    Returns whether the form has no integrals.

  equals(other)

    Evaluate `bool(lhs_form == rhs_form)`.

  geometric_dimension()

    Return the geometric dimension shared by all domains and functions in this form.

  integrals()

    Return a sequence of all integrals in form.

  integrals_by_domain(domain)

    Return a sequence of all integrals with a particular integration domain.

  integrals_by_type(integral_type)

    Return a sequence of all integrals with a particular domain type.

  max_subdomain_ids()

    Returns a mapping on the form `{domain:{integral_type:max_subdomain_id}}`.

  signature()

    Signature for use with jit cache (independent of incidental numbering of indices etc.)

  subdomain_data()

    Returns a mapping on the form `{domain:{integral_type: subdomain_data}}`.

  ufl_cell()

    Return the single cell this form is defined on, fails if multiple cells are found.

  ufl_domain()

    Return the single geometric integration domain occuring in the form.

    Fails if multiple domains are found.

    NB! This does not include domains of coefficients defined on other meshes, look at form data for that additional information.

  ufl_domains()

    Return the geometric integration domains occuring in the form.

    NB! This does not include domains of coefficients defined on other meshes.

    The return type is a tuple even if only a single domain exists.

class ufl_legacy.classes.FormArgument

  Bases: `Terminal`

  An abstract class for a form argument.

class ufl_legacy.classes.FunctionSpace(domain, element)

  Bases: `AbstractFunctionSpace`

  ufl_domain()

    Return ufl domain.

  ufl_domains()

    Return ufl domains.

  ufl_element()

    Return ufl element.

  ufl_sub_spaces()

    Return ufl sub spaces.

class ufl_legacy.classes.GE(left, right)

  Bases: `BinaryCondition`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

class ufl_legacy.classes.GT(left, right)

  Bases: `BinaryCondition`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

class ufl_legacy.classes.GeometricCellQuantity(domain)

  Bases: `GeometricQuantity`

class ufl_legacy.classes.GeometricFacetQuantity(domain)

  Bases: `GeometricQuantity`

class ufl_legacy.classes.GeometricQuantity(domain)

  Bases: `Terminal`

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell (or over each facet for facet quantities).

  ufl_domains()

    Return tuple of domains related to this terminal object.

  ufl_shape = ()

class ufl_legacy.classes.Grad(f)

  Bases: `CompoundDerivative`

  evaluate(x, mapping, component, index_values, derivatives=())

    Get child from mapping and return the component asked for.

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.classes.HCurlElement(element)

  Bases: `FiniteElementBase`

  A curl-conforming version of an outer product element, assuming this makes mathematical sense.

  mapping()

    Not implemented.

  reconstruct(**kwargs)
  shortstr()

    Format as string for pretty printing.

  sobolev_space()

    Return the underlying Sobolev space.

class ufl_legacy.classes.HDivElement(element)

  Bases: `FiniteElementBase`

  A div-conforming version of an outer product element, assuming this makes mathematical sense.

  mapping()

    Not implemented.

  reconstruct(**kwargs)
  shortstr()

    Format as string for pretty printing.

  sobolev_space()

    Return the underlying Sobolev space.

class ufl_legacy.classes.Identity(dim)

  Bases: `ConstantValue`

  UFL literal type: Representation of an identity matrix.

  evaluate(x, mapping, component, index_values)

    Evaluates the identity matrix on the given components.

  ufl_shape

class ufl_legacy.classes.Imag(a)

  Bases: `Operator`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.classes.Index(count=None)

  Bases: `IndexBase`

  UFL value: An index with no value assigned.

  Used to represent free indices in Einstein indexing notation.

  count()

class ufl_legacy.classes.IndexBase

  Bases: `object`

  Base class for all indices.

class ufl_legacy.classes.IndexSum(summand, index)

  Bases: `Operator`

  dimension()
  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

  index()
  ufl_free_indices
  ufl_index_dimensions
  property ufl_shape

class ufl_legacy.classes.Indexed(expression, multiindex)

  Bases: `Operator`

  evaluate(x, mapping, component, index_values, derivatives=())

    Evaluate expression at given coordinate with given values for terminals.

  ufl_free_indices
  ufl_index_dimensions
  ufl_shape = ()

class ufl_legacy.classes.Inner(a, b)

  Bases: `CompoundTensorOperator`

  ufl_free_indices
  ufl_index_dimensions
  ufl_shape = ()

class ufl_legacy.classes.IntValue(value)

  Bases: `RealValue`

  UFL literal type: Representation of a constant scalar integer value.

class ufl_legacy.classes.Integral(integrand, integral_type, domain, subdomain_id, metadata, subdomain_data)

  Bases: `object`

  An integral over a single domain.

  integral_type()

    Return the domain type of this integral.

  integrand()

    Return the integrand expression, which is an `Expr` instance.

  metadata()

    Return the compiler metadata this integral has been annotated with.

  reconstruct(integrand=None, integral_type=None, domain=None, subdomain_id=None, metadata=None, subdomain_data=None)

    Construct a new Integral object with some properties replaced with new values.

    ### Example:

    > <a = Integral instance> b = a.reconstruct(expand_compounds(a.integrand())) c = a.reconstruct(metadata={‘quadrature_degree’:2})

  subdomain_data()

    Return the domain data of this integral.

  subdomain_id()

    Return the subdomain id of this integral.

  ufl_domain()

    Return the integration domain of this integral.

ufl_legacy.classes.InteriorElement(element)

  Constructs the restriction of a finite element to the interior of the cell.

class ufl_legacy.classes.Inverse(A)

  Bases: `CompoundTensorOperator`

  ufl_free_indices = ()
  ufl_index_dimensions = ()
  property ufl_shape

class ufl_legacy.classes.Jacobian(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The Jacobian of the mapping from reference cell to spatial coordinates.

  \[J_{ij} = \frac{dx_i}{dX_j}\]
  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'J'
  property ufl_shape

    Return the number of coordinates defined (i.e. the geometric dimension of the domain).

class ufl_legacy.classes.JacobianDeterminant(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The determinant of the Jacobian.

  Represents the signed determinant of a square Jacobian or the pseudo-determinant of a non-square Jacobian.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'detJ'

class ufl_legacy.classes.JacobianInverse(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The inverse of the Jacobian.

  Represents the inverse of a square Jacobian or the pseudo-inverse of a non-square Jacobian.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'K'
  property ufl_shape

    Return the number of coordinates defined (i.e. the geometric dimension of the domain).

class ufl_legacy.classes.LE(left, right)

  Bases: `BinaryCondition`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

class ufl_legacy.classes.LT(left, right)

  Bases: `BinaryCondition`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

class ufl_legacy.classes.Label(count=None)

  Bases: `Terminal`

  count()
  is_cellwise_constant()
  ufl_domains()

    Return tuple of domains related to this terminal object.

  property ufl_free_indices

    Built-in immutable sequence.

    If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

    If the argument is a tuple, the return value is the same object.

  property ufl_index_dimensions

    Built-in immutable sequence.

    If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

    If the argument is a tuple, the return value is the same object.

  property ufl_shape

class ufl_legacy.classes.ListTensor(*expressions)

  Bases: `Operator`

  UFL operator type: Wraps a list of expressions into a tensor valued expression of one higher rank.

  evaluate(x, mapping, component, index_values, derivatives=())

    Evaluate expression at given coordinate with given values for terminals.

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.classes.Ln(argument)

  Bases: `MathFunction`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

class ufl_legacy.classes.MathFunction(name, argument)

  Bases: `Operator`

  Base class for all unary scalar math functions.

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

  ufl_free_indices = ()
  ufl_index_dimensions = ()
  ufl_shape = ()

class ufl_legacy.classes.MaxCellEdgeLength(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The maximum edge length of the cell.

  name = 'maxcelledgelength'

class ufl_legacy.classes.MaxFacetEdgeLength(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The maximum edge length of the facet.

  name = 'maxfacetedgelength'

class ufl_legacy.classes.MaxValue(left, right)

  Bases: `Operator`

  UFL operator: Take the maximum of two values.

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

  ufl_free_indices = ()
  ufl_index_dimensions = ()
  ufl_shape = ()

class ufl_legacy.classes.Measure(integral_type, domain=None, subdomain_id='everywhere', metadata=None, subdomain_data=None)

  Bases: `object`

  integral_type()

    Return the domain type.

    Valid domain types are “cell”, “exterior_facet”, “interior_facet”, etc.

  metadata()

    Return the integral metadata. This data is not interpreted by UFL. It is passed to the form compiler which can ignore it or use it to compile each integral of a form in a different way.

  reconstruct(integral_type=None, subdomain_id=None, domain=None, metadata=None, subdomain_data=None)

    Construct a new Measure object with some properties replaced with new values.

    ### Example:

    > <dm = Measure instance> b = dm.reconstruct(subdomain_id=2) c = dm.reconstruct(metadata={ “quadrature_degree”: 3 })

    Used by the call operator, so this is equivalent:

      b = dm(2) c = dm(0, { “quadrature_degree”: 3 })

  subdomain_data()

    Return the integral subdomain_data. This data is not interpreted by UFL. Its intension is to give a context in which the domain id is interpreted.

  subdomain_id()

    Return the domain id of this measure (integer).

  ufl_domain()

    Return the domain associated with this measure.

    This may be None or a Domain object.

class ufl_legacy.classes.MeasureProduct(*measures)

  Bases: `object`

  Represents a product of measures.

  This is a notational intermediate object to handle the notation

  > f*(dm1*dm2)

  This is work in progress and not functional. It needs support in other parts of ufl and the rest of the code generation chain.

  sub_measures()

    Return submeasures.

class ufl_legacy.classes.MeasureSum(*measures)

  Bases: `object`

  Represents a sum of measures.

  This is a notational intermediate object to translate the notation

  > f*(ds(1)+ds(3))

  into

  > f*ds(1) + f*ds(3)

class ufl_legacy.classes.Mesh(coordinate_element, ufl_id=None, cargo=None)

  Bases: `AbstractDomain`

  Symbolic representation of a mesh.

  is_piecewise_linear_simplex_domain()
  ufl_cargo()

    Return carried object that will not be used by UFL.

  ufl_cell()
  ufl_coordinate_element()
  ufl_id()

    Return the ufl_id of this object.

class ufl_legacy.classes.MeshView(mesh, topological_dimension, ufl_id=None)

  Bases: `AbstractDomain`

  Symbolic representation of a mesh.

  is_piecewise_linear_simplex_domain()
  ufl_cell()
  ufl_id()

    Return the ufl_id of this object.

  ufl_mesh()

class ufl_legacy.classes.MinCellEdgeLength(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The minimum edge length of the cell.

  name = 'mincelledgelength'

class ufl_legacy.classes.MinFacetEdgeLength(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The minimum edge length of the facet.

  name = 'minfacetedgelength'

class ufl_legacy.classes.MinValue(left, right)

  Bases: `Operator`

  UFL operator: Take the minimum of two values.

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

  ufl_free_indices = ()
  ufl_index_dimensions = ()
  ufl_shape = ()

class ufl_legacy.classes.MixedElement(*elements, **kwargs)

  Bases: `FiniteElementBase`

  A finite element composed of a nested hierarchy of mixed or simple elements.

  degree(component=None)

    Return polynomial degree of finite element.

  extract_component(i)

    Recursively extract component index relative to a (simple) element and that element for given value component index.

  extract_reference_component(i)

    Recursively extract reference_component index relative to a (simple) element and that element for given value reference_component index.

  extract_subelement_component(i)

    Extract direct subelement index and subelement relative component index for a given component index.

  extract_subelement_reference_component(i)

    Extract direct subelement index and subelement relative reference_component index for a given reference_component index.

  is_cellwise_constant(component=None)

    Return whether the basis functions of this element is spatially constant over each cell.

  mapping()

    Not implemented.

  num_sub_elements()

    Return number of sub elements.

  reconstruct(**kwargs)
  reconstruct_from_elements(*elements)

    Reconstruct a mixed element from new subelements.

  shortstr()

    Format as string for pretty printing.

  sub_elements()

    Return list of sub elements.

  symmetry()

    Return the symmetry dict, which is a mapping \(c_0 \to c_1\) meaning that component \(c_0\) is represented by component \(c_1\). A component is a tuple of one or more ints.

class ufl_legacy.classes.MixedFunctionSpace(*args)

  Bases: `AbstractFunctionSpace`

  num_sub_spaces()
  ufl_domain()

    Return ufl domain.

  ufl_domains()

    Return ufl domains.

  ufl_element()
  ufl_elements()

    Return ufl elements.

  ufl_sub_space(i)

    Return i-th ufl sub space.

  ufl_sub_spaces()

    Return ufl sub spaces.

class ufl_legacy.classes.MultiIndex(indices)

  Bases: `Terminal`

  Represents a sequence of indices, either fixed or free.

  evaluate(x, mapping, component, index_values)

    Evaluate index.

  indices()

    Return tuple of indices.

  is_cellwise_constant()

    Always True.

  ufl_domains()

    Return tuple of domains related to this terminal object.

  property ufl_free_indices

    This shall not be used.

  property ufl_index_dimensions

    This shall not be used.

  property ufl_shape

    This shall not be used.

class ufl_legacy.classes.NE(left, right)

  Bases: `BinaryCondition`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

class ufl_legacy.classes.NablaDiv(f)

  Bases: `CompoundDerivative`

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.classes.NablaGrad(f)

  Bases: `CompoundDerivative`

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.classes.NegativeRestricted(f)

  Bases: `Restricted`

class ufl_legacy.classes.NodalEnrichedElement(*elements)

  Bases: `EnrichedElementBase`

  The vector sum of several finite element spaces:

  \[\textrm{EnrichedElement}(V, Q) = \{v + q | v \in V, q \in Q\}.\]

  Primal basis is reorthogonalized to dual basis which is a concatenation of subelements dual bases; resulting element is nodal.

  is_cellwise_constant()

    Return whether the basis functions of this element is spatially constant over each cell.

  shortstr()

    Format as string for pretty printing.

class ufl_legacy.classes.NotCondition(condition)

  Bases: `Condition`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

class ufl_legacy.classes.Operator(operands=None)

  Bases: `Expr`

  Base class for all operators, i.e. non-terminal expression types.

  ufl_operands

class ufl_legacy.classes.OrCondition(left, right)

  Bases: `BinaryCondition`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

class ufl_legacy.classes.Outer(a, b)

  Bases: `CompoundTensorOperator`

  ufl_free_indices
  ufl_index_dimensions
  property ufl_shape

class ufl_legacy.classes.PermutationSymbol(dim)

  Bases: `ConstantValue`

  UFL literal type: Representation of a permutation symbol.

  This is also known as the Levi-Civita symbol, antisymmetric symbol, or alternating symbol.

  evaluate(x, mapping, component, index_values)

    Evaluates the permutation symbol.

  ufl_shape

class ufl_legacy.classes.PositiveRestricted(f)

  Bases: `Restricted`

class ufl_legacy.classes.Power(a, b)

  Bases: `Operator`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

  property ufl_free_indices
  property ufl_index_dimensions
  ufl_shape = ()

class ufl_legacy.classes.Product(a, b)

  Bases: `Operator`

  The product of two or more UFL objects.

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

  ufl_free_indices
  ufl_index_dimensions
  ufl_shape = ()

class ufl_legacy.classes.QuadratureWeight(domain)

  Bases: `GeometricQuantity`

  UFL geometry representation: The current quadrature weight.

  Only used inside a quadrature context.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'weight'

class ufl_legacy.classes.Real(a)

  Bases: `Operator`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.classes.RealValue(value)

  Bases: `ScalarValue`

  Abstract class used to differentiate real values from complex ones

  ufl_free_indices = ()
  ufl_index_dimensions = ()
  ufl_shape = ()

class ufl_legacy.classes.ReferenceCellEdgeVectors(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The vectors between reference cell vertices for each edge in cell.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'RCEV'
  property ufl_shape

    Built-in immutable sequence.

    If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

    If the argument is a tuple, the return value is the same object.

class ufl_legacy.classes.ReferenceCellVolume(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The volume of the reference cell.

  name = 'reference_cell_volume'

class ufl_legacy.classes.ReferenceCurl(f)

  Bases: `CompoundDerivative`

  property ufl_free_indices
  property ufl_index_dimensions
  ufl_shape

class ufl_legacy.classes.ReferenceDiv(f)

  Bases: `CompoundDerivative`

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.classes.ReferenceFacetEdgeVectors(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The vectors between reference cell vertices for each edge in current facet.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'RFEV'
  property ufl_shape

    Built-in immutable sequence.

    If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

    If the argument is a tuple, the return value is the same object.

class ufl_legacy.classes.ReferenceFacetVolume(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The volume of the reference cell of the current facet.

  name = 'reference_facet_volume'

class ufl_legacy.classes.ReferenceGrad(f)

  Bases: `CompoundDerivative`

  evaluate(x, mapping, component, index_values, derivatives=())

    Get child from mapping and return the component asked for.

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.classes.ReferenceNormal(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The outwards pointing normal vector of the current facet on the reference cell

  name = 'reference_normal'
  property ufl_shape

    Built-in immutable sequence.

    If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

    If the argument is a tuple, the return value is the same object.

class ufl_legacy.classes.ReferenceValue(f)

  Bases: `Operator`

  Representation of the reference cell value of a form argument.

  evaluate(x, mapping, component, index_values, derivatives=())

    Get child from mapping and return the component asked for.

  ufl_free_indices = ()
  ufl_index_dimensions = ()
  property ufl_shape

class ufl_legacy.classes.Restricted(f)

  Bases: `Operator`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

  side()
  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.classes.RestrictedElement(element, restriction_domain)

  Bases: `FiniteElementBase`

  Represents the restriction of a finite element to a type of cell entity.

  is_cellwise_constant()

    Return whether the basis functions of this element is spatially constant over each cell.

  mapping()

    Not implemented.

  num_restricted_sub_elements()

    Return number of restricted sub elements.

  num_sub_elements()

    Return number of sub elements.

  reconstruct(**kwargs)
  restricted_sub_elements()

    Return list of restricted sub elements.

  restriction_domain()

    Return the domain onto which the element is restricted.

  shortstr()

    Format as string for pretty printing.

  sub_element()

    Return the element which is restricted.

  sub_elements()

    Return list of sub elements.

  symmetry()

    Return the symmetry dict, which is a mapping \(c_0 \to c_1\) meaning that component \(c_0\) is represented by component \(c_1\). A component is a tuple of one or more ints.

class ufl_legacy.classes.ScalarValue(value)

  Bases: `ConstantValue`

  A constant scalar value.

  evaluate(x, mapping, component, index_values)

    Get self from mapping and return the component asked for.

  imag()
  real()
  ufl_free_indices = ()
  ufl_index_dimensions = ()
  ufl_shape = ()
  value()

class ufl_legacy.classes.Sin(argument)

  Bases: `MathFunction`

class ufl_legacy.classes.Sinh(argument)

  Bases: `MathFunction`

class ufl_legacy.classes.Skew(A)

  Bases: `CompoundTensorOperator`

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.classes.SpatialCoordinate(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The coordinate in a domain.

  In the context of expression integration, represents the domain coordinate of each quadrature point.

  In the context of expression evaluation in a point, represents the value of that point.

  count()
  evaluate(x, mapping, component, index_values)

    Return the value of the coordinate.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'x'
  property ufl_shape

    Return the number of coordinates defined (i.e. the geometric dimension of the domain).

class ufl_legacy.classes.Sqrt(argument)

  Bases: `MathFunction`

class ufl_legacy.classes.Sum(a, b)

  Bases: `Operator`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.classes.Sym(A)

  Bases: `CompoundTensorOperator`

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.classes.Tan(argument)

  Bases: `MathFunction`

class ufl_legacy.classes.Tanh(argument)

  Bases: `MathFunction`

class ufl_legacy.classes.TensorElement(family, cell=None, degree=None, shape=None, symmetry=None, quad_scheme=None, variant=None)

  Bases: `MixedElement`

  A special case of a mixed finite element where all elements are equal.

  extract_subelement_component(i)

    Extract direct subelement index and subelement relative component index for a given component index.

  flattened_sub_element_mapping()
  mapping()

    Not implemented.

  reconstruct(**kwargs)
  shortstr()

    Format as string for pretty printing.

  symmetry()

    Return the symmetry dict, which is a mapping \(c_0 \to c_1\) meaning that component \(c_0\) is represented by component \(c_1\). A component is a tuple of one or more ints.

  variant()

    Return the variant used to initialise the element.

class ufl_legacy.classes.TensorProductCell(*cells, **kwargs)

  Bases: `AbstractCell`

  cellname()

    Return the cellname of the cell.

  has_simplex_facets()

    Return True if all the facets of this cell are simplex cells.

  is_simplex()

    Return True if this is a simplex cell.

  num_edges()

    The number of cell edges.

  num_facets()

    The number of cell facets.

  num_vertices()

    The number of cell vertices.

  reconstruct(geometric_dimension=None)
  sub_cells()

    Return list of cell factors.

class ufl_legacy.classes.TensorProductElement(*elements, **kwargs)

  Bases: `FiniteElementBase`

  The tensor product of \(d\) element spaces:

  \[V = V_1 \otimes V_2 \otimes ... \otimes V_d\]

  Given bases \(\{\phi_{j_i}\}\) of the spaces \(V_i\) for \(i = 1, ...., d\), \(\{ \phi_{j_1} \otimes \phi_{j_2} \otimes \cdots \otimes \phi_{j_d} \}\) forms a basis for \(V\).

  mapping()

    Not implemented.

  num_sub_elements()

    Return number of subelements.

  reconstruct(**kwargs)
  shortstr()

    Short pretty-print.

  sobolev_space()

    Return the underlying Sobolev space of the TensorProductElement.

  sub_elements()

    Return subelements (factors).

class ufl_legacy.classes.TensorProductFunctionSpace(*function_spaces)

  Bases: `AbstractFunctionSpace`

  ufl_sub_spaces()

class ufl_legacy.classes.TensorProductMesh(meshes, ufl_id=None)

  Bases: `AbstractDomain`

  Symbolic representation of a mesh.

  is_piecewise_linear_simplex_domain()
  ufl_cell()
  ufl_coordinate_element()
  ufl_id()

    Return the ufl_id of this object.

  ufl_meshes()

class ufl_legacy.classes.Terminal

  Bases: `Expr`

  A terminal node in the UFL expression tree.

  evaluate(x, mapping, component, index_values, derivatives=())

    Get self from mapping and return the component asked for.

  ufl_domains()

    Return tuple of domains related to this terminal object.

  ufl_free_indices = ()
  ufl_index_dimensions = ()
  ufl_operands = ()

ufl_legacy.classes.TestFunction(function_space, part=None)

  UFL value: Create a test function argument to a form.

ufl_legacy.classes.TestFunctions(function_space)

  UFL value: Create a TestFunction in a mixed space, and return a tuple with the function components corresponding to the subelements.

class ufl_legacy.classes.Trace(A)

  Bases: `CompoundTensorOperator`

  property ufl_free_indices
  property ufl_index_dimensions
  ufl_shape = ()

class ufl_legacy.classes.Transposed(A)

  Bases: `CompoundTensorOperator`

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

ufl_legacy.classes.TrialFunction(function_space, part=None)

  UFL value: Create a trial function argument to a form.

ufl_legacy.classes.TrialFunctions(function_space)

  UFL value: Create a TrialFunction in a mixed space, and return a tuple with the function components corresponding to the subelements.

class ufl_legacy.classes.Variable(expression, label=None)

  Bases: `Operator`

  A Variable is a representative for another expression.

  It will be used by the end-user mainly for defining a quantity to differentiate w.r.t. using diff. Example:

      e = <...>
      e = variable(e)
      f = exp(e**2)
      df = diff(f, e)

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

  expression()
  label()
  ufl_domains()

    Return all domains this expression is defined on.

  ufl_free_indices = ()
  ufl_index_dimensions = ()
  property ufl_shape

class ufl_legacy.classes.VariableDerivative(f, v)

  Bases: `Derivative`

  ufl_free_indices
  ufl_index_dimensions
  ufl_shape

class ufl_legacy.classes.VectorElement(family, cell=None, degree=None, dim=None, form_degree=None, quad_scheme=None, variant=None)

  Bases: `MixedElement`

  A special case of a mixed finite element where all elements are equal.

  mapping()

    Not implemented.

  reconstruct(**kwargs)
  shortstr()

    Format as string for pretty printing.

  variant()

    Return the variant used to initialise the element.

class ufl_legacy.classes.WithMapping(wrapee, mapping)

  Bases: `FiniteElementBase`

  Specify an alternative mapping for the wrappee. For example, to use identity mapping instead of Piola map with an element E, write remapped = WithMapping(E, “identity”)

  mapping()

    Not implemented.

  reconstruct(**kwargs)
  reference_value_shape()

    Return the shape of the value space on the reference cell.

  shortstr()
  value_shape()

    Return the shape of the value space on the global domain.

class ufl_legacy.classes.Zero(shape=(), free_indices=(), index_dimensions=None)

  Bases: `ConstantValue`

  UFL literal type: Representation of a zero valued expression.

  evaluate(x, mapping, component, index_values)

    Get self from mapping and return the component asked for.

  ufl_free_indices
  ufl_index_dimensions
  ufl_shape

## ufl_legacy.coefficient module

This module defines the Coefficient class and a number of related classes, including Constant.

class ufl_legacy.coefficient.Coefficient(function_space, count=None)

  Bases: `FormArgument`

  UFL form argument type: Representation of a form coefficient.

  count()
  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  ufl_domain()

    Shortcut to get the domain of the function space of this coefficient.

  ufl_domains()

    Return tuple of domains related to this terminal object.

  ufl_element()

    Shortcut to get the finite element of the function space of this coefficient.

  ufl_function_space()

    Get the function space of this coefficient.

  property ufl_shape

    Return the associated UFL shape.

ufl_legacy.coefficient.Coefficients(function_space)

  UFL value: Create a Coefficient in a mixed space, and return a tuple with the function components corresponding to the subelements.

## ufl_legacy.compound_expressions module

Functions implementing compound expressions as equivalent representations using basic operators.

ufl_legacy.compound_expressions.adj_expr(A)

ufl_legacy.compound_expressions.adj_expr_2x2(A)

ufl_legacy.compound_expressions.adj_expr_3x3(A)

ufl_legacy.compound_expressions.adj_expr_4x4(A)

ufl_legacy.compound_expressions.codeterminant_expr_nxn(A, rows, cols)

ufl_legacy.compound_expressions.cofactor_expr(A)

ufl_legacy.compound_expressions.cofactor_expr_2x2(A)

ufl_legacy.compound_expressions.cofactor_expr_3x3(A)

ufl_legacy.compound_expressions.cofactor_expr_4x4(A)

ufl_legacy.compound_expressions.cross_expr(a, b)

ufl_legacy.compound_expressions.determinant_expr(A)

  Compute the (pseudo-)determinant of A.

ufl_legacy.compound_expressions.determinant_expr_2x2(B)

ufl_legacy.compound_expressions.determinant_expr_3x3(A)

ufl_legacy.compound_expressions.deviatoric_expr(A)

ufl_legacy.compound_expressions.deviatoric_expr_2x2(A)

ufl_legacy.compound_expressions.deviatoric_expr_3x3(A)

ufl_legacy.compound_expressions.generic_pseudo_determinant_expr(A)

  Compute the pseudo-determinant of A: sqrt(det(A.T*A)).

ufl_legacy.compound_expressions.generic_pseudo_inverse_expr(A)

  Compute the Penrose-Moore pseudo-inverse of A: (A.T*A)^-1 * A.T.

ufl_legacy.compound_expressions.inverse_expr(A)

  Compute the inverse of A.

ufl_legacy.compound_expressions.old_determinant_expr_3x3(A)

ufl_legacy.compound_expressions.pseudo_determinant_expr(A)

  Compute the pseudo-determinant of A.

ufl_legacy.compound_expressions.pseudo_inverse_expr(A)

  Compute the Penrose-Moore pseudo-inverse of A: (A.T*A)^-1 * A.T.

## ufl_legacy.conditional module

This module defines classes for conditional expressions.

class ufl_legacy.conditional.AndCondition(left, right)

  Bases: `BinaryCondition`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

class ufl_legacy.conditional.BinaryCondition(name, left, right)

  Bases: `Condition`

class ufl_legacy.conditional.Condition(operands)

  Bases: `Operator`

  ufl_free_indices = ()
  ufl_index_dimensions = ()
  ufl_shape = ()

class ufl_legacy.conditional.Conditional(condition, true_value, false_value)

  Bases: `Operator`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.conditional.EQ(left, right)

  Bases: `BinaryCondition`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

class ufl_legacy.conditional.GE(left, right)

  Bases: `BinaryCondition`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

class ufl_legacy.conditional.GT(left, right)

  Bases: `BinaryCondition`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

class ufl_legacy.conditional.LE(left, right)

  Bases: `BinaryCondition`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

class ufl_legacy.conditional.LT(left, right)

  Bases: `BinaryCondition`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

class ufl_legacy.conditional.MaxValue(left, right)

  Bases: `Operator`

  UFL operator: Take the maximum of two values.

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

  ufl_free_indices = ()
  ufl_index_dimensions = ()
  ufl_shape = ()

class ufl_legacy.conditional.MinValue(left, right)

  Bases: `Operator`

  UFL operator: Take the minimum of two values.

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

  ufl_free_indices = ()
  ufl_index_dimensions = ()
  ufl_shape = ()

class ufl_legacy.conditional.NE(left, right)

  Bases: `BinaryCondition`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

class ufl_legacy.conditional.NotCondition(condition)

  Bases: `Condition`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

class ufl_legacy.conditional.OrCondition(left, right)

  Bases: `BinaryCondition`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

## ufl_legacy.constant module

This module defines classes representing non-literal values which are constant with respect to a domain.

class ufl_legacy.constant.Constant(domain, shape=(), count=None)

  Bases: `Terminal`

  count()
  is_cellwise_constant()
  ufl_domain()

    Return the single unique domain this expression is defined on, or throw an error.

  ufl_domains()

    Return tuple of domains related to this terminal object.

  property ufl_shape

ufl_legacy.constant.TensorConstant(domain, count=None)

ufl_legacy.constant.VectorConstant(domain, count=None)

## ufl_legacy.constantvalue module

This module defines classes representing constant values.

class ufl_legacy.constantvalue.ComplexValue(value)

  Bases: `ScalarValue`

  UFL literal type: Representation of a constant, complex scalar

  argument()
  modulus()

class ufl_legacy.constantvalue.ConstantValue

  Bases: `Terminal`

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  ufl_domains()

    Return tuple of domains related to this terminal object.

class ufl_legacy.constantvalue.FloatValue(value)

  Bases: `RealValue`

  UFL literal type: Representation of a constant scalar floating point value.

class ufl_legacy.constantvalue.Identity(dim)

  Bases: `ConstantValue`

  UFL literal type: Representation of an identity matrix.

  evaluate(x, mapping, component, index_values)

    Evaluates the identity matrix on the given components.

  ufl_shape

class ufl_legacy.constantvalue.IntValue(value)

  Bases: `RealValue`

  UFL literal type: Representation of a constant scalar integer value.

class ufl_legacy.constantvalue.PermutationSymbol(dim)

  Bases: `ConstantValue`

  UFL literal type: Representation of a permutation symbol.

  This is also known as the Levi-Civita symbol, antisymmetric symbol, or alternating symbol.

  evaluate(x, mapping, component, index_values)

    Evaluates the permutation symbol.

  ufl_shape

class ufl_legacy.constantvalue.RealValue(value)

  Bases: `ScalarValue`

  Abstract class used to differentiate real values from complex ones

  ufl_free_indices = ()
  ufl_index_dimensions = ()
  ufl_shape = ()

class ufl_legacy.constantvalue.ScalarValue(value)

  Bases: `ConstantValue`

  A constant scalar value.

  evaluate(x, mapping, component, index_values)

    Get self from mapping and return the component asked for.

  imag()
  real()
  ufl_free_indices = ()
  ufl_index_dimensions = ()
  ufl_shape = ()
  value()

class ufl_legacy.constantvalue.Zero(shape=(), free_indices=(), index_dimensions=None)

  Bases: `ConstantValue`

  UFL literal type: Representation of a zero valued expression.

  evaluate(x, mapping, component, index_values)

    Get self from mapping and return the component asked for.

  ufl_free_indices
  ufl_index_dimensions
  ufl_shape

ufl_legacy.constantvalue.as_ufl(expression)

  Converts expression to an Expr if possible.

ufl_legacy.constantvalue.format_float(x)

  Format float value based on global UFL precision.

ufl_legacy.constantvalue.zero(*shape)

  UFL literal constant: Return a zero tensor with the given shape.

## ufl_legacy.differentiation module

Differential operators.

class ufl_legacy.differentiation.CoefficientDerivative(integrand, coefficients, arguments, coefficient_derivatives)

  Bases: `Derivative`

  Derivative of the integrand of a form w.r.t. the degrees of freedom in a discrete Coefficient.

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.differentiation.CompoundDerivative(operands)

  Bases: `Derivative`

  Base class for all compound derivative types.

class ufl_legacy.differentiation.CoordinateDerivative(integrand, coefficients, arguments, coefficient_derivatives)

  Bases: `CoefficientDerivative`

  Derivative of the integrand of a form w.r.t. the SpatialCoordinates.

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.differentiation.Curl(f)

  Bases: `CompoundDerivative`

  property ufl_free_indices
  property ufl_index_dimensions
  ufl_shape

class ufl_legacy.differentiation.Derivative(operands)

  Bases: `Operator`

  Base class for all derivative types.

class ufl_legacy.differentiation.Div(f)

  Bases: `CompoundDerivative`

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.differentiation.Grad(f)

  Bases: `CompoundDerivative`

  evaluate(x, mapping, component, index_values, derivatives=())

    Get child from mapping and return the component asked for.

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.differentiation.NablaDiv(f)

  Bases: `CompoundDerivative`

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.differentiation.NablaGrad(f)

  Bases: `CompoundDerivative`

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.differentiation.ReferenceCurl(f)

  Bases: `CompoundDerivative`

  property ufl_free_indices
  property ufl_index_dimensions
  ufl_shape

class ufl_legacy.differentiation.ReferenceDiv(f)

  Bases: `CompoundDerivative`

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.differentiation.ReferenceGrad(f)

  Bases: `CompoundDerivative`

  evaluate(x, mapping, component, index_values, derivatives=())

    Get child from mapping and return the component asked for.

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.differentiation.VariableDerivative(f, v)

  Bases: `Derivative`

  ufl_free_indices
  ufl_index_dimensions
  ufl_shape

## ufl_legacy.domain module

Types for representing a geometric domain.

class ufl_legacy.domain.AbstractDomain(topological_dimension, geometric_dimension)

  Bases: `object`

  Symbolic representation of a geometric domain with only a geometric and topological dimension.

  geometric_dimension()

    Return the dimension of the space this domain is embedded in.

  topological_dimension()

    Return the dimension of the topology of this domain.

class ufl_legacy.domain.Mesh(coordinate_element, ufl_id=None, cargo=None)

  Bases: `AbstractDomain`

  Symbolic representation of a mesh.

  is_piecewise_linear_simplex_domain()
  ufl_cargo()

    Return carried object that will not be used by UFL.

  ufl_cell()
  ufl_coordinate_element()
  ufl_id()

    Return the ufl_id of this object.

class ufl_legacy.domain.MeshView(mesh, topological_dimension, ufl_id=None)

  Bases: `AbstractDomain`

  Symbolic representation of a mesh.

  is_piecewise_linear_simplex_domain()
  ufl_cell()
  ufl_id()

    Return the ufl_id of this object.

  ufl_mesh()

class ufl_legacy.domain.TensorProductMesh(meshes, ufl_id=None)

  Bases: `AbstractDomain`

  Symbolic representation of a mesh.

  is_piecewise_linear_simplex_domain()
  ufl_cell()
  ufl_coordinate_element()
  ufl_id()

    Return the ufl_id of this object.

  ufl_meshes()

ufl_legacy.domain.affine_mesh(cell, ufl_id=None)

  Create a Mesh over a given cell type with an affine geometric parameterization.

ufl_legacy.domain.as_domain(domain)

  Convert any valid object to an AbstractDomain type.

ufl_legacy.domain.default_domain(cell)

  Create a singular default Mesh from a cell, always returning the same Mesh object for the same cell.

ufl_legacy.domain.extract_domains(expr)

  Return all domains expression is defined on.

ufl_legacy.domain.extract_unique_domain(expr)

  Return the single unique domain expression is defined on or throw an error.

ufl_legacy.domain.find_geometric_dimension(expr)

  Find the geometric dimension of an expression.

ufl_legacy.domain.join_domains(domains)

  Take a list of domains and return a tuple with only unique domain objects.

  Checks that domains with the same id are compatible.

ufl_legacy.domain.sort_domains(domains)

  Sort domains in a canonical ordering.

## ufl_legacy.equation module

The Equation class, used to express equations like a == L.

class ufl_legacy.equation.Equation(lhs, rhs)

  Bases: `object`

  This class is used to represent equations expressed by the “==” operator. Examples include a == L and F == 0 where a, L and F are Form objects.

## ufl_legacy.exprcontainers module

This module defines special types for representing mapping of expressions to expressions.

class ufl_legacy.exprcontainers.ExprList(*operands)

  Bases: `Operator`

  List of Expr objects. For internal use, never to be created by end users.

  free_indices()
  index_dimensions()
  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.exprcontainers.ExprMapping(*operands)

  Bases: `Operator`

  Mapping of Expr objects. For internal use, never to be created by end users.

  free_indices()
  index_dimensions()
  ufl_domains()

    Return all domains this expression is defined on.

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

## ufl_legacy.exprequals module

ufl_legacy.exprequals.expr_equals(self, other)

  Checks whether the two expressions are represented the exact same way. This does not check if the expressions are mathematically equal or equivalent! Used by sets and dicts.

ufl_legacy.exprequals.measure_collisions(equals_func)

ufl_legacy.exprequals.nonrecursive_expr_equals(self, other)

  Checks whether the two expressions are represented the exact same way. This does not check if the expressions are mathematically equal or equivalent! Used by sets and dicts.

ufl_legacy.exprequals.print_collisions()

ufl_legacy.exprequals.recursive_expr_equals(self, other)

  Checks whether the two expressions are represented the exact same way. This does not check if the expressions are mathematically equal or equivalent! Used by sets and dicts.

## ufl_legacy.exproperators module

This module attaches special functions to Expr. This way we avoid circular dependencies between e.g. Sum and its superclass Expr.

ufl_legacy.exproperators.analyse_key(ii, rank)

  Takes something the user might input as an index tuple inside [], which could include complete slices (:) and ellipsis (…), and returns tuples of actual UFL index objects.

  The return value is a tuple (indices, axis_indices), each being a tuple of IndexBase instances.

  The return value ‘indices’ corresponds to all input objects of these types: - Index - FixedIndex - int => Wrapped in FixedIndex

  The return value ‘axis_indices’ corresponds to all input objects of these types: - Complete slice (:) => Replaced by a single new index - Ellipsis (…) => Replaced by multiple new indices

## ufl_legacy.form module

The Form class.

class ufl_legacy.form.Form(integrals)

  Bases: `object`

  Description of a weak form consisting of a sum of integrals over subdomains.

  arguments()

    Return all `Argument` objects found in form.

  coefficient_numbering()

    Return a contiguous numbering of coefficients in a mapping `{coefficient:number}`.

  coefficients()

    Return all `Coefficient` objects found in form.

  constant_numbering()

    Return a contiguous numbering of constants in a mapping `{constant:number}`.

  constants()
  domain_numbering()

    Return a contiguous numbering of domains in a mapping `{domain:number}`.

  empty()

    Returns whether the form has no integrals.

  equals(other)

    Evaluate `bool(lhs_form == rhs_form)`.

  geometric_dimension()

    Return the geometric dimension shared by all domains and functions in this form.

  integrals()

    Return a sequence of all integrals in form.

  integrals_by_domain(domain)

    Return a sequence of all integrals with a particular integration domain.

  integrals_by_type(integral_type)

    Return a sequence of all integrals with a particular domain type.

  max_subdomain_ids()

    Returns a mapping on the form `{domain:{integral_type:max_subdomain_id}}`.

  signature()

    Signature for use with jit cache (independent of incidental numbering of indices etc.)

  subdomain_data()

    Returns a mapping on the form `{domain:{integral_type: subdomain_data}}`.

  ufl_cell()

    Return the single cell this form is defined on, fails if multiple cells are found.

  ufl_domain()

    Return the single geometric integration domain occuring in the form.

    Fails if multiple domains are found.

    NB! This does not include domains of coefficients defined on other meshes, look at form data for that additional information.

  ufl_domains()

    Return the geometric integration domains occuring in the form.

    NB! This does not include domains of coefficients defined on other meshes.

    The return type is a tuple even if only a single domain exists.

ufl_legacy.form.as_form(form)

  Convert to form if not a form, otherwise return form.

ufl_legacy.form.replace_integral_domains(form, common_domain)

  Given a form and a domain, assign a common integration domain to all integrals.

  Does not modify the input form (`Form` should always be immutable). This is to support ill formed forms with no domain specified, sometimes occurring in pydolfin, e.g. assemble(1*dx, mesh=mesh).

ufl_legacy.form.sub_forms_by_domain(form)

  Return a list of forms each with an integration domain

## ufl_legacy.formoperators module

Various high level ways to transform a complete Form into a new Form.

ufl_legacy.formoperators.action(form, coefficient=None)

  UFL form operator: Given a bilinear form, return a linear form with an additional coefficient, representing the action of the form on the coefficient. This can be used for matrix-free methods.

ufl_legacy.formoperators.adjoint(form, reordered_arguments=None)

  UFL form operator: Given a combined bilinear form, compute the adjoint form by changing the ordering (count) of the test and trial functions, and taking the complex conjugate of the result.

  By default, new `Argument` objects will be created with opposite ordering. However, if the adjoint form is to be added to other forms later, their arguments must match. In that case, the user must provide a tuple *reordered_arguments*=(u2,v2).

ufl_legacy.formoperators.derivative(form, coefficient, argument=None, coefficient_derivatives=None)

  UFL form operator: Compute the Gateaux derivative of form w.r.t. coefficient in direction of argument.

  If the argument is omitted, a new `Argument` is created in the same space as the coefficient, with argument number one higher than the highest one in the form.

  The resulting form has one additional `Argument` in the same finite element space as the coefficient.

  A tuple of `Coefficient` s may be provided in place of a single `Coefficient`, in which case the new `Argument` argument is based on a `MixedElement` created from this tuple.

  An indexed `Coefficient` from a mixed space may be provided, in which case the argument should be in the corresponding subspace of the coefficient space.

  If provided, coefficient_derivatives should be a mapping from `Coefficient` instances to their derivatives w.r.t. coefficient.

ufl_legacy.formoperators.energy_norm(form, coefficient=None)

  UFL form operator: Given a bilinear form a and a coefficient f, return the functional \(a(f,f)\).

ufl_legacy.formoperators.extract_blocks(form, i=None, j=None)

  UFL form operator: Given a linear or bilinear form on a mixed space, extract the block corresponding to the indices ix, iy.

  ### Example:

  > a = inner(grad(u), grad(v))*dx + div(u)*q*dx + div(v)*p*dx extract_blocks(a, 0, 0) -> inner(grad(u), grad(v))*dx extract_blocks(a) -> [inner(grad(u), grad(v))*dx, div(v)*p*dx, div(u)*q*dx, 0]

ufl_legacy.formoperators.functional(form)

  UFL form operator: Extract the functional part of form.

ufl_legacy.formoperators.lhs(form)

  UFL form operator: Given a combined bilinear and linear form, extract the left hand side (bilinear form part).

  ### Example:

  > a = u*v*dx + f*v*dx a = lhs(a) -> u*v*dx

ufl_legacy.formoperators.rhs(form)

  UFL form operator: Given a combined bilinear and linear form, extract the right hand side (negated linear form part).

  ### Example:

  > a = u*v*dx + f*v*dx L = rhs(a) -> -f*v*dx

ufl_legacy.formoperators.sensitivity_rhs(a, u, L, v)

  UFL form operator: Compute the right hand side for a sensitivity calculation system.

  The derivation behind this computation is as follows. Assume a, L to be bilinear and linear forms corresponding to the assembled linear system

  \[Ax = b.\]

  Where x is the vector of the discrete function corresponding to u. Let v be some scalar variable this equation depends on. Then we can write

  \[ \begin{align}\begin{aligned}0 = \frac{d}{dv}(Ax-b) = \frac{dA}{dv} x + A \frac{dx}{dv} - \frac{db}{dv},\\A \frac{dx}{dv} = \frac{db}{dv} - \frac{dA}{dv} x,\end{aligned}\end{align} \]

  and solve this system for \(\frac{dx}{dv}\), using the same bilinear form a and matrix A from the original system. Assume the forms are written

      v = variable(v_expression)
      L = IL(v)*dx
      a = Ia(v)*dx

  where `IL` and `Ia` are integrand expressions. Define a `Coefficient u` representing the solution to the equations. Then we can compute \(\frac{db}{dv}\) and \(\frac{dA}{dv}\) from the forms

      da = diff(a, v)
      dL = diff(L, v)

  and the action of `da` on `u` by

      dau = action(da, u)

  In total, we can build the right hand side of the system to compute \(\frac{du}{dv}\) with the single line

      dL = diff(L, v) - action(diff(a, v), u)

  or, using this function,

      dL = sensitivity_rhs(a, u, L, v)

ufl_legacy.formoperators.set_list_item(li, i, v)

ufl_legacy.formoperators.system(form)

  UFL form operator: Split a form into the left hand side and right hand side, see `lhs` and `rhs`.

ufl_legacy.formoperators.zero_lists(shape)

## ufl_legacy.functionspace module

Types for representing function spaces.

class ufl_legacy.functionspace.AbstractFunctionSpace

  Bases: `object`

  ufl_sub_spaces()

class ufl_legacy.functionspace.FunctionSpace(domain, element)

  Bases: `AbstractFunctionSpace`

  ufl_domain()

    Return ufl domain.

  ufl_domains()

    Return ufl domains.

  ufl_element()

    Return ufl element.

  ufl_sub_spaces()

    Return ufl sub spaces.

class ufl_legacy.functionspace.MixedFunctionSpace(*args)

  Bases: `AbstractFunctionSpace`

  num_sub_spaces()
  ufl_domain()

    Return ufl domain.

  ufl_domains()

    Return ufl domains.

  ufl_element()
  ufl_elements()

    Return ufl elements.

  ufl_sub_space(i)

    Return i-th ufl sub space.

  ufl_sub_spaces()

    Return ufl sub spaces.

class ufl_legacy.functionspace.TensorProductFunctionSpace(*function_spaces)

  Bases: `AbstractFunctionSpace`

  ufl_sub_spaces()

## ufl_legacy.geometry module

Types for representing symbolic expressions for geometric quantities.

class ufl_legacy.geometry.CellCoordinate(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The coordinate in a reference cell.

  In the context of expression integration, represents the reference cell coordinate of each quadrature point.

  In the context of expression evaluation in a point in a cell, represents that point in the reference coordinate system of the cell.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'X'
  property ufl_shape

    Built-in immutable sequence.

    If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

    If the argument is a tuple, the return value is the same object.

class ufl_legacy.geometry.CellDiameter(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The diameter of the cell, i.e., maximal distance of two points in the cell.

  name = 'diameter'

class ufl_legacy.geometry.CellEdgeVectors(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The vectors between physical cell vertices for each edge in cell.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'CEV'
  property ufl_shape

    Built-in immutable sequence.

    If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

    If the argument is a tuple, the return value is the same object.

class ufl_legacy.geometry.CellFacetJacobian(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The Jacobian of the mapping from reference facet to reference cell coordinates.

  CFJ_ij = dX_i/dXf_j

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'CFJ'
  property ufl_shape

    Built-in immutable sequence.

    If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

    If the argument is a tuple, the return value is the same object.

class ufl_legacy.geometry.CellFacetJacobianDeterminant(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The pseudo-determinant of the CellFacetJacobian.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'detCFJ'

class ufl_legacy.geometry.CellFacetJacobianInverse(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The pseudo-inverse of the CellFacetJacobian.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'CFK'
  property ufl_shape

    Built-in immutable sequence.

    If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

    If the argument is a tuple, the return value is the same object.

class ufl_legacy.geometry.CellFacetOrigin(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The reference cell coordinate corresponding to origin of a reference facet.

  name = 'X0f'
  property ufl_shape

    Built-in immutable sequence.

    If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

    If the argument is a tuple, the return value is the same object.

class ufl_legacy.geometry.CellNormal(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The upwards pointing normal vector of the current manifold cell.

  name = 'cell_normal'
  property ufl_shape

    Return the number of coordinates defined (i.e. the geometric dimension of the domain).

class ufl_legacy.geometry.CellOrientation(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The orientation (+1/-1) of the current cell.

  For non-manifold cells (tdim == gdim), this equals the sign of the Jacobian determinant, i.e. +1 if the physical cell is oriented the same way as the reference cell and -1 otherwise.

  For manifold cells of tdim==gdim-1 this is input data belonging to the mesh, used to distinguish between the sides of the manifold.

  name = 'cell_orientation'

class ufl_legacy.geometry.CellOrigin(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The spatial coordinate corresponding to origin of a reference cell.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell (or over each facet for facet quantities).

  name = 'x0'
  property ufl_shape

    Built-in immutable sequence.

    If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

    If the argument is a tuple, the return value is the same object.

class ufl_legacy.geometry.CellVertices(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: Physical cell vertices.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'CV'
  property ufl_shape

    Built-in immutable sequence.

    If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

    If the argument is a tuple, the return value is the same object.

class ufl_legacy.geometry.CellVolume(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The volume of the cell.

  name = 'volume'

class ufl_legacy.geometry.Circumradius(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The circumradius of the cell.

  name = 'circumradius'

class ufl_legacy.geometry.FacetArea(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The area of the facet.

  name = 'facetarea'

class ufl_legacy.geometry.FacetCoordinate(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The coordinate in a reference cell of a facet.

  In the context of expression integration over a facet, represents the reference facet coordinate of each quadrature point.

  In the context of expression evaluation in a point on a facet, represents that point in the reference coordinate system of the facet.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'Xf'
  property ufl_shape

    Built-in immutable sequence.

    If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

    If the argument is a tuple, the return value is the same object.

class ufl_legacy.geometry.FacetEdgeVectors(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The vectors between physical cell vertices for each edge in current facet.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'FEV'
  property ufl_shape

    Built-in immutable sequence.

    If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

    If the argument is a tuple, the return value is the same object.

class ufl_legacy.geometry.FacetJacobian(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The Jacobian of the mapping from reference facet to spatial coordinates.

  > FJ_ij = dx_i/dXf_j

  The FacetJacobian is the product of the Jacobian and CellFacetJacobian:

  > FJ = dx/dXf = dx/dX dX/dXf = J * CFJ

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'FJ'
  property ufl_shape

    Built-in immutable sequence.

    If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

    If the argument is a tuple, the return value is the same object.

class ufl_legacy.geometry.FacetJacobianDeterminant(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The pseudo-determinant of the FacetJacobian.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'detFJ'

class ufl_legacy.geometry.FacetJacobianInverse(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The pseudo-inverse of the FacetJacobian.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'FK'
  property ufl_shape

    Built-in immutable sequence.

    If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

    If the argument is a tuple, the return value is the same object.

class ufl_legacy.geometry.FacetNormal(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The outwards pointing normal vector of the current facet.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'n'
  property ufl_shape

    Return the number of coordinates defined (i.e. the geometric dimension of the domain).

class ufl_legacy.geometry.FacetOrientation(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The orientation (+1/-1) of the current facet relative to the reference cell.

  name = 'facet_orientation'

class ufl_legacy.geometry.FacetOrigin(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The spatial coordinate corresponding to origin of a reference facet.

  name = 'x0f'
  property ufl_shape

    Built-in immutable sequence.

    If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

    If the argument is a tuple, the return value is the same object.

class ufl_legacy.geometry.GeometricCellQuantity(domain)

  Bases: `GeometricQuantity`

class ufl_legacy.geometry.GeometricFacetQuantity(domain)

  Bases: `GeometricQuantity`

class ufl_legacy.geometry.GeometricQuantity(domain)

  Bases: `Terminal`

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell (or over each facet for facet quantities).

  ufl_domains()

    Return tuple of domains related to this terminal object.

  ufl_shape = ()

class ufl_legacy.geometry.Jacobian(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The Jacobian of the mapping from reference cell to spatial coordinates.

  \[J_{ij} = \frac{dx_i}{dX_j}\]
  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'J'
  property ufl_shape

    Return the number of coordinates defined (i.e. the geometric dimension of the domain).

class ufl_legacy.geometry.JacobianDeterminant(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The determinant of the Jacobian.

  Represents the signed determinant of a square Jacobian or the pseudo-determinant of a non-square Jacobian.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'detJ'

class ufl_legacy.geometry.JacobianInverse(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The inverse of the Jacobian.

  Represents the inverse of a square Jacobian or the pseudo-inverse of a non-square Jacobian.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'K'
  property ufl_shape

    Return the number of coordinates defined (i.e. the geometric dimension of the domain).

class ufl_legacy.geometry.MaxCellEdgeLength(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The maximum edge length of the cell.

  name = 'maxcelledgelength'

class ufl_legacy.geometry.MaxFacetEdgeLength(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The maximum edge length of the facet.

  name = 'maxfacetedgelength'

class ufl_legacy.geometry.MinCellEdgeLength(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The minimum edge length of the cell.

  name = 'mincelledgelength'

class ufl_legacy.geometry.MinFacetEdgeLength(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The minimum edge length of the facet.

  name = 'minfacetedgelength'

class ufl_legacy.geometry.QuadratureWeight(domain)

  Bases: `GeometricQuantity`

  UFL geometry representation: The current quadrature weight.

  Only used inside a quadrature context.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'weight'

class ufl_legacy.geometry.ReferenceCellEdgeVectors(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The vectors between reference cell vertices for each edge in cell.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'RCEV'
  property ufl_shape

    Built-in immutable sequence.

    If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

    If the argument is a tuple, the return value is the same object.

class ufl_legacy.geometry.ReferenceCellVolume(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The volume of the reference cell.

  name = 'reference_cell_volume'

class ufl_legacy.geometry.ReferenceFacetEdgeVectors(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The vectors between reference cell vertices for each edge in current facet.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'RFEV'
  property ufl_shape

    Built-in immutable sequence.

    If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

    If the argument is a tuple, the return value is the same object.

class ufl_legacy.geometry.ReferenceFacetVolume(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The volume of the reference cell of the current facet.

  name = 'reference_facet_volume'

class ufl_legacy.geometry.ReferenceNormal(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The outwards pointing normal vector of the current facet on the reference cell

  name = 'reference_normal'
  property ufl_shape

    Built-in immutable sequence.

    If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

    If the argument is a tuple, the return value is the same object.

class ufl_legacy.geometry.SpatialCoordinate(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The coordinate in a domain.

  In the context of expression integration, represents the domain coordinate of each quadrature point.

  In the context of expression evaluation in a point, represents the value of that point.

  count()
  evaluate(x, mapping, component, index_values)

    Return the value of the coordinate.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'x'
  property ufl_shape

    Return the number of coordinates defined (i.e. the geometric dimension of the domain).

## ufl_legacy.index_combination_utils module

Utilities for analysing and manipulating free index tuples

ufl_legacy.index_combination_utils.create_slice_indices(component, shape, fi)

ufl_legacy.index_combination_utils.merge_nonoverlapping_indices(a, b)

  Merge non-overlapping free indices into one representation.

  ### Example:

  > C[i,j,r,s] = outer(A[i,s], B[j,r]) A, B -> (i,j,r,s), (idim,jdim,rdim,sdim)

ufl_legacy.index_combination_utils.merge_overlapping_indices(afi, afid, bfi, bfid)

  Merge overlapping free indices into one free and one repeated representation.

  ### Example:

  > C[j,r] := A[i,j,k] * B[i,r,k] A, B -> (j,r), (jdim,rdim), (i,k), (idim,kdim)

ufl_legacy.index_combination_utils.merge_unique_indices(afi, afid, bfi, bfid)

  Merge two pairs of (index ids, index dimensions) sequences into one pair without duplicates.

  The id tuples afi, bfi are assumed already sorted by id. Given a list of (id, dim) tuples already sorted by id, return a unique list with duplicates removed. Also checks that the dimensions of duplicates are matching.

ufl_legacy.index_combination_utils.remove_indices(fi, fid, rfi)

  Remove indices.

ufl_legacy.index_combination_utils.unique_sorted_indices(indices)

  Given a list of (id, dim) tuples already sorted by id, return a unique list with duplicates removed. Also checks that the dimensions of duplicates are matching.

## ufl_legacy.indexed module

This module defines the Indexed class.

class ufl_legacy.indexed.Indexed(expression, multiindex)

  Bases: `Operator`

  evaluate(x, mapping, component, index_values, derivatives=())

    Evaluate expression at given coordinate with given values for terminals.

  ufl_free_indices
  ufl_index_dimensions
  ufl_shape = ()

## ufl_legacy.indexsum module

This module defines the IndexSum class.

class ufl_legacy.indexsum.IndexSum(summand, index)

  Bases: `Operator`

  dimension()
  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

  index()
  ufl_free_indices
  ufl_index_dimensions
  property ufl_shape

## ufl_legacy.integral module

The Integral class.

class ufl_legacy.integral.Integral(integrand, integral_type, domain, subdomain_id, metadata, subdomain_data)

  Bases: `object`

  An integral over a single domain.

  integral_type()

    Return the domain type of this integral.

  integrand()

    Return the integrand expression, which is an `Expr` instance.

  metadata()

    Return the compiler metadata this integral has been annotated with.

  reconstruct(integrand=None, integral_type=None, domain=None, subdomain_id=None, metadata=None, subdomain_data=None)

    Construct a new Integral object with some properties replaced with new values.

    ### Example:

    > <a = Integral instance> b = a.reconstruct(expand_compounds(a.integrand())) c = a.reconstruct(metadata={‘quadrature_degree’:2})

  subdomain_data()

    Return the domain data of this integral.

  subdomain_id()

    Return the subdomain id of this integral.

  ufl_domain()

    Return the integration domain of this integral.

## ufl_legacy.log module

This module provides functions used by the UFL implementation to output messages. These may be redirected by the user of UFL.

class ufl_legacy.log.Logger(name, exception_type=<class 'Exception'>)

  Bases: `object`

  add_indent(increment=1)

    Add to indentation level.

  add_logfile(filename=None, mode='a', level=10)

    Add a log file.

  begin(*message)

    Begin task: write message and increase indentation level.

  debug(*message)

    Write debug message.

  deprecate(*message)

    Write deprecation message.

  end()

    End task: write a newline and decrease indentation level.

  error(*message)

    Write error message and raise an exception.

  get_handler()

    Get handler for logging.

  get_logfile_handler(filename)

    Gets the handler to the file identified by the given file name.

  get_logger()

    Return message logger.

  info(*message)

    Write info message.

  info_blue(*message)

    Write info message in blue.

  info_green(*message)

    Write info message in green.

  info_red(*message)

    Write info message in red.

  log(level, *message)

    Write a log message on given log level.

  pop_level()

    Pop log level from the level stack, reverting to before the last push_level.

  push_level(level)

    Push a log level on the level stack.

  set_handler(handler)

    Replace handler for logging. To add additional handlers instead of replacing the existing one, use log.get_logger().addHandler(myhandler). See the logging module for more details.

  set_indent(level)

    Set indentation level.

  set_level(level)

    Set log level.

  set_prefix(prefix)

    Set prefix for log messages.

  warning(*message)

    Write warning message.

  warning_blue(*message)

    Write warning message in blue.

  warning_green(*message)

    Write warning message in green.

  warning_red(*message)

    Write warning message in red.

ufl_legacy.log.add_indent(increment=1)

  Add to indentation level.

ufl_legacy.log.add_logfile(filename=None, mode='a', level=10)

  Add a log file.

ufl_legacy.log.begin(*message)

  Begin task: write message and increase indentation level.

ufl_legacy.log.debug(*message)

  Write debug message.

ufl_legacy.log.deprecate(*message)

  Write deprecation message.

ufl_legacy.log.end()

  End task: write a newline and decrease indentation level.

ufl_legacy.log.error(*message)

  Write error message and raise an exception.

ufl_legacy.log.get_handler()

  Get handler for logging.

ufl_legacy.log.get_logger()

  Return message logger.

ufl_legacy.log.info(*message)

  Write info message.

ufl_legacy.log.info_blue(*message)

  Write info message in blue.

ufl_legacy.log.info_green(*message)

  Write info message in green.

ufl_legacy.log.info_red(*message)

  Write info message in red.

ufl_legacy.log.log(level, *message)

  Write a log message on given log level.

ufl_legacy.log.pop_level()

  Pop log level from the level stack, reverting to before the last push_level.

ufl_legacy.log.push_level(level)

  Push a log level on the level stack.

ufl_legacy.log.set_handler(handler)

  Replace handler for logging. To add additional handlers instead of replacing the existing one, use log.get_logger().addHandler(myhandler). See the logging module for more details.

ufl_legacy.log.set_indent(level)

  Set indentation level.

ufl_legacy.log.set_level(level)

  Set log level.

ufl_legacy.log.set_prefix(prefix)

  Set prefix for log messages.

ufl_legacy.log.warning(*message)

  Write warning message.

ufl_legacy.log.warning_blue(*message)

  Write warning message in blue.

ufl_legacy.log.warning_green(*message)

  Write warning message in green.

ufl_legacy.log.warning_red(*message)

  Write warning message in red.

## ufl_legacy.mathfunctions module

This module provides basic mathematical functions.

class ufl_legacy.mathfunctions.Acos(argument)

  Bases: `MathFunction`

class ufl_legacy.mathfunctions.Asin(argument)

  Bases: `MathFunction`

class ufl_legacy.mathfunctions.Atan(argument)

  Bases: `MathFunction`

class ufl_legacy.mathfunctions.Atan2(arg1, arg2)

  Bases: `Operator`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

  ufl_free_indices = ()
  ufl_index_dimensions = ()
  ufl_shape = ()

class ufl_legacy.mathfunctions.BesselFunction(name, classname, nu, argument)

  Bases: `Operator`

  Base class for all bessel functions

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

  ufl_free_indices = ()
  ufl_index_dimensions = ()
  ufl_shape = ()

class ufl_legacy.mathfunctions.BesselI(nu, argument)

  Bases: `BesselFunction`

class ufl_legacy.mathfunctions.BesselJ(nu, argument)

  Bases: `BesselFunction`

class ufl_legacy.mathfunctions.BesselK(nu, argument)

  Bases: `BesselFunction`

class ufl_legacy.mathfunctions.BesselY(nu, argument)

  Bases: `BesselFunction`

class ufl_legacy.mathfunctions.Cos(argument)

  Bases: `MathFunction`

class ufl_legacy.mathfunctions.Cosh(argument)

  Bases: `MathFunction`

class ufl_legacy.mathfunctions.Erf(argument)

  Bases: `MathFunction`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

class ufl_legacy.mathfunctions.Exp(argument)

  Bases: `MathFunction`

class ufl_legacy.mathfunctions.Ln(argument)

  Bases: `MathFunction`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

class ufl_legacy.mathfunctions.MathFunction(name, argument)

  Bases: `Operator`

  Base class for all unary scalar math functions.

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

  ufl_free_indices = ()
  ufl_index_dimensions = ()
  ufl_shape = ()

class ufl_legacy.mathfunctions.Sin(argument)

  Bases: `MathFunction`

class ufl_legacy.mathfunctions.Sinh(argument)

  Bases: `MathFunction`

class ufl_legacy.mathfunctions.Sqrt(argument)

  Bases: `MathFunction`

class ufl_legacy.mathfunctions.Tan(argument)

  Bases: `MathFunction`

class ufl_legacy.mathfunctions.Tanh(argument)

  Bases: `MathFunction`

## ufl_legacy.measure module

The Measure class.

class ufl_legacy.measure.Measure(integral_type, domain=None, subdomain_id='everywhere', metadata=None, subdomain_data=None)

  Bases: `object`

  integral_type()

    Return the domain type.

    Valid domain types are “cell”, “exterior_facet”, “interior_facet”, etc.

  metadata()

    Return the integral metadata. This data is not interpreted by UFL. It is passed to the form compiler which can ignore it or use it to compile each integral of a form in a different way.

  reconstruct(integral_type=None, subdomain_id=None, domain=None, metadata=None, subdomain_data=None)

    Construct a new Measure object with some properties replaced with new values.

    ### Example:

    > <dm = Measure instance> b = dm.reconstruct(subdomain_id=2) c = dm.reconstruct(metadata={ “quadrature_degree”: 3 })

    Used by the call operator, so this is equivalent:

      b = dm(2) c = dm(0, { “quadrature_degree”: 3 })

  subdomain_data()

    Return the integral subdomain_data. This data is not interpreted by UFL. Its intension is to give a context in which the domain id is interpreted.

  subdomain_id()

    Return the domain id of this measure (integer).

  ufl_domain()

    Return the domain associated with this measure.

    This may be None or a Domain object.

class ufl_legacy.measure.MeasureProduct(*measures)

  Bases: `object`

  Represents a product of measures.

  This is a notational intermediate object to handle the notation

  > f*(dm1*dm2)

  This is work in progress and not functional. It needs support in other parts of ufl and the rest of the code generation chain.

  sub_measures()

    Return submeasures.

class ufl_legacy.measure.MeasureSum(*measures)

  Bases: `object`

  Represents a sum of measures.

  This is a notational intermediate object to translate the notation

  > f*(ds(1)+ds(3))

  into

  > f*ds(1) + f*ds(3)

ufl_legacy.measure.as_integral_type(integral_type)

  Map short name to long name and require a valid one.

ufl_legacy.measure.integral_types()

  Return a tuple of all domain type strings.

ufl_legacy.measure.measure_names()

  Return a tuple of all measure name strings.

ufl_legacy.measure.register_integral_type(integral_type, measure_name)

## ufl_legacy.measureoperators module

## ufl_legacy.objects module

Utility objects for pretty syntax in user code.

## ufl_legacy.operators module

This module extends the form language with free function operators, which are either already available as member functions on UFL objects or defined as compound operators involving basic operations on the UFL objects.

ufl_legacy.operators.And(left, right)

  UFL operator: A boolean expression (left and right) for use with `conditional`.

ufl_legacy.operators.Dn(f)

  UFL operator: Take the directional derivative of f in the facet normal direction, Dn(f) := dot(grad(f), n).

ufl_legacy.operators.Dt(f)

  UFL operator: <Not implemented yet!> The partial derivative of f with respect to time.

ufl_legacy.operators.Dx(f, *i)

  UFL operator: Take the partial derivative of f with respect to spatial variable number i. Equivalent to `f.dx(*i)`.

ufl_legacy.operators.Max(x, y)

  UFL operator: Take the maximum of x and y.

ufl_legacy.operators.Min(x, y)

  UFL operator: Take the minimum of x and y.

ufl_legacy.operators.Not(condition)

  UFL operator: A boolean expression (not condition) for use with `conditional`.

ufl_legacy.operators.Or(left, right)

  UFL operator: A boolean expression (left or right) for use with `conditional`.

ufl_legacy.operators.acos(f)

  UFL operator: Take the inverse cosine of f.

ufl_legacy.operators.asin(f)

  UFL operator: Take the inverse sine of f.

ufl_legacy.operators.atan(f)

  UFL operator: Take the inverse tangent of f.

ufl_legacy.operators.atan_2(f1, f2)

  UFL operator: Take the inverse tangent with two the arguments f1 and f2.

ufl_legacy.operators.avg(v)

  UFL operator: Take the average of v across a facet.

ufl_legacy.operators.bessel_I(nu, f)

  UFL operator: regular modified cylindrical Bessel function.

ufl_legacy.operators.bessel_J(nu, f)

  UFL operator: cylindrical Bessel function of the first kind.

ufl_legacy.operators.bessel_K(nu, f)

  UFL operator: irregular modified cylindrical Bessel function.

ufl_legacy.operators.bessel_Y(nu, f)

  UFL operator: cylindrical Bessel function of the second kind.

ufl_legacy.operators.cell_avg(f)

  UFL operator: Take the average of v over a cell.

ufl_legacy.operators.cofac(A)

  UFL operator: Take the cofactor of A.

ufl_legacy.operators.conditional(condition, true_value, false_value)

  UFL operator: A conditional expression, taking the value of true_value when condition evaluates to `true` and false_value otherwise.

ufl_legacy.operators.conj(f)

  UFL operator: The complex conjugate of f

ufl_legacy.operators.conjugate(f)

  UFL operator: The complex conjugate of f

ufl_legacy.operators.contraction(a, a_axes, b, b_axes)

  UFL operator: Take the contraction of a and b over given axes.

ufl_legacy.operators.cos(f)

  UFL operator: Take the cosine of f.

ufl_legacy.operators.cosh(f)

  UFL operator: Take the hyperbolic cosine of f.

ufl_legacy.operators.cross(a, b)

  UFL operator: Take the cross product of a and b.

ufl_legacy.operators.curl(f)

  UFL operator: Take the curl of f.

ufl_legacy.operators.det(A)

  UFL operator: Take the determinant of A.

ufl_legacy.operators.dev(A)

  UFL operator: Take the deviatoric part of A.

ufl_legacy.operators.diag(A)

  UFL operator: Take the diagonal part of rank 2 tensor A or make a diagonal rank 2 tensor from a rank 1 tensor.

  Always returns a rank 2 tensor. See also `diag_vector`.

ufl_legacy.operators.diag_vector(A)

  UFL operator: Take the diagonal part of rank 2 tensor A and return as a vector.

  See also `diag`.

ufl_legacy.operators.diff(f, v)

  UFL operator: Take the derivative of f with respect to the variable v.

  If f is a form, `diff` is applied to each integrand.

ufl_legacy.operators.div(f)

  UFL operator: Take the divergence of f.

  This operator follows the div convention where

  > div(v) = v[i].dx(i)

  > div(T)[:] = T[:,i].dx(i)

  for vector expressions v, and arbitrary rank tensor expressions T.

  See also: `nabla_div()`

ufl_legacy.operators.dot(a, b)

  UFL operator: Take the dot product of a and b. This won’t take the complex conjugate of the second argument.

ufl_legacy.operators.elem_div(A, B)

  UFL operator: Take the elementwise division of tensors A and B with the same shape.

ufl_legacy.operators.elem_mult(A, B)

  UFL operator: Take the elementwise multiplication of tensors A and B with the same shape.

ufl_legacy.operators.elem_op(op, *args)

  UFL operator: Take the elementwise application of operator op on scalar values from one or more tensor arguments.

ufl_legacy.operators.elem_op_items(op_ind, indices, *args)

ufl_legacy.operators.elem_pow(A, B)

  UFL operator: Take the elementwise power of tensors A and B with the same shape.

ufl_legacy.operators.eq(left, right)

  UFL operator: A boolean expression (left == right) for use with `conditional`.

ufl_legacy.operators.erf(f)

  UFL operator: Take the error function of f.

ufl_legacy.operators.exp(f)

  UFL operator: Take the exponential of f.

ufl_legacy.operators.exterior_derivative(f)

  UFL operator: Take the exterior derivative of f.

  The exterior derivative uses the element family to determine whether `id`, `grad`, `curl` or `div` should be used.

  Note that this uses the `grad` and `div` operators, as opposed to `nabla_grad` and `nabla_div`.

ufl_legacy.operators.facet_avg(f)

  UFL operator: Take the average of v over a facet.

ufl_legacy.operators.ge(left, right)

  UFL operator: A boolean expression (left >= right) for use with `conditional`.

ufl_legacy.operators.grad(f)

  UFL operator: Take the gradient of f.

  This operator follows the grad convention where

  > grad(s)[i] = s.dx(i)

  > grad(v)[i,j] = v[i].dx(j)

  > grad(T)[:,i] = T[:].dx(i)

  for scalar expressions s, vector expressions v, and arbitrary rank tensor expressions T.

  See also: `nabla_grad()`

ufl_legacy.operators.gt(left, right)

  UFL operator: A boolean expression (left > right) for use with `conditional`.

ufl_legacy.operators.imag(f)

  UFL operator: The imaginary part of f

ufl_legacy.operators.inner(a, b)

  UFL operator: Take the inner product of a and b. The complex conjugate of the second argument is taken.

ufl_legacy.operators.inv(A)

  UFL operator: Take the inverse of A.

ufl_legacy.operators.jump(v, n=None)

  UFL operator: Take the jump of v across a facet.

ufl_legacy.operators.le(left, right)

  UFL operator: A boolean expression (left <= right) for use with `conditional`.

ufl_legacy.operators.ln(f)

  UFL operator: Take the natural logarithm of f.

ufl_legacy.operators.lt(left, right)

  UFL operator: A boolean expression (left < right) for use with `conditional`.

ufl_legacy.operators.max_value(x, y)

  UFL operator: Take the maximum of x and y.

ufl_legacy.operators.min_value(x, y)

  UFL operator: Take the minimum of x and y.

ufl_legacy.operators.nabla_div(f)

  UFL operator: Take the divergence of f.

  This operator follows the div convention where

  > nabla_div(v) = v[i].dx(i)

  > nabla_div(T)[:] = T[i,:].dx(i)

  for vector expressions v, and arbitrary rank tensor expressions T.

  See also: `div()`

ufl_legacy.operators.nabla_grad(f)

  UFL operator: Take the gradient of f.

  This operator follows the grad convention where

  > nabla_grad(s)[i] = s.dx(i)

  > nabla_grad(v)[i,j] = v[j].dx(i)

  > nabla_grad(T)[i,:] = T[:].dx(i)

  for scalar expressions s, vector expressions v, and arbitrary rank tensor expressions T.

  See also: `grad()`

ufl_legacy.operators.ne(left, right)

  UFL operator: A boolean expression (left != right) for use with `conditional`.

ufl_legacy.operators.outer(*operands)

  UFL operator: Take the outer product of two or more operands. The complex conjugate of the first argument is taken.

ufl_legacy.operators.perp(v)

  UFL operator: Take the perp of v, i.e. \((-v_1, +v_0)\).

ufl_legacy.operators.rank(f)

  UFL operator: The rank of f.

ufl_legacy.operators.real(f)

  UFL operator: The real part of f

ufl_legacy.operators.rot(f)

  UFL operator: Take the curl of f.

ufl_legacy.operators.shape(f)

  UFL operator: The shape of f.

ufl_legacy.operators.sign(x)

  UFL operator: Take the sign (+1 or -1) of x.

ufl_legacy.operators.sin(f)

  UFL operator: Take the sine of f.

ufl_legacy.operators.sinh(f)

  UFL operator: Take the hyperbolic sine of f.

ufl_legacy.operators.skew(A)

  UFL operator: Take the skew symmetric part of A.

ufl_legacy.operators.sqrt(f)

  UFL operator: Take the square root of f.

ufl_legacy.operators.sym(A)

  UFL operator: Take the symmetric part of A.

ufl_legacy.operators.tan(f)

  UFL operator: Take the tangent of f.

ufl_legacy.operators.tanh(f)

  UFL operator: Take the hyperbolic tangent of f.

ufl_legacy.operators.tr(A)

  UFL operator: Take the trace of A.

ufl_legacy.operators.transpose(A)

  UFL operator: Take the transposed of tensor A.

ufl_legacy.operators.variable(e)

  UFL operator: Define a variable representing the given expression, see also `diff()`.

## ufl_legacy.permutation module

This module provides utility functions for computing permutations and generating index lists.

ufl_legacy.permutation.build_component_numbering(shape, symmetry)

  Build a numbering of components within the given value shape, taking into consideration a symmetry mapping which leaves the mapping noncontiguous. Returns a dict { component -> numbering } and an ordered list of components [ numbering -> component ]. The dict contains all components while the list only contains the ones not mapped by the symmetry mapping.

ufl_legacy.permutation.compute_indices(shape)

  Compute all index combinations for given shape

ufl_legacy.permutation.compute_indices2(shape)

  Compute all index combinations for given shape

ufl_legacy.permutation.compute_order_tuples(k, n)

  Compute all tuples of n integers such that the sum is k

ufl_legacy.permutation.compute_permutation_pairs(j, k)

  Compute all permutations of j + k elements from (0, j + k) in rising order within (0, j) and (j, j + k) respectively.

ufl_legacy.permutation.compute_permutations(k, n, skip=None)

  Compute all permutations of k elements from (0, n) in rising order. Any elements that are contained in the list skip are not included.

ufl_legacy.permutation.compute_sign(permutation)

  Compute sign by sorting.

## ufl_legacy.precedence module

Precedence handling.

ufl_legacy.precedence.assign_precedences(precedence_list)

  Given a precedence list, assign ints to class._precedence.

ufl_legacy.precedence.build_precedence_list()

ufl_legacy.precedence.build_precedence_mapping(precedence_list)

  Given a precedence list, build a dict with class->int mappings. Utility function used by some external code.

ufl_legacy.precedence.parstr(child, parent, pre='(', post=')', format=<class 'str'>)

## ufl_legacy.protocols module

ufl_legacy.protocols.id_or_none(obj)

  Returns None if the object is None, obj.ufl_id() if available, or id(obj) if not.

  This allows external libraries to implement an alternative to id(obj) in the ufl_id() function, such that ufl can identify objects as the same without knowing about their types.

ufl_legacy.protocols.metadata_equal(a, b)

ufl_legacy.protocols.metadata_hashdata(md)

## ufl_legacy.referencevalue module

Representation of the reference value of a function.

class ufl_legacy.referencevalue.ReferenceValue(f)

  Bases: `Operator`

  Representation of the reference cell value of a form argument.

  evaluate(x, mapping, component, index_values, derivatives=())

    Get child from mapping and return the component asked for.

  ufl_free_indices = ()
  ufl_index_dimensions = ()
  property ufl_shape

## ufl_legacy.restriction module

Restriction operations.

class ufl_legacy.restriction.NegativeRestricted(f)

  Bases: `Restricted`

class ufl_legacy.restriction.PositiveRestricted(f)

  Bases: `Restricted`

class ufl_legacy.restriction.Restricted(f)

  Bases: `Operator`

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

  side()
  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

## ufl_legacy.sobolevspace module

This module defines a symbolic heirarchy of Sobolev spaces to enable symbolic reasoning about the spaces in which finite elements lie.

class ufl_legacy.sobolevspace.DirectionalSobolevSpace(orders)

  Bases: `SobolevSpace`

  Symbolic representation of a Sobolev space with varying smoothness in differerent spatial directions.

class ufl_legacy.sobolevspace.SobolevSpace(name, parents=None)

  Bases: `object`

  Symbolic representation of a Sobolev space. This implements a subset of the methods of a Python set so that finite elements and other Sobolev spaces can be tested for inclusion.

## ufl_legacy.sorting module

This module contains a sorting rule for expr objects that is more robust w.r.t. argument numbering than using repr.

ufl_legacy.sorting.cmp_expr(a, b)

  Replacement for cmp(a, b), removed in Python 3, for Expr objects.

ufl_legacy.sorting.sorted_expr(sequence)

  Return a canonically sorted list of Expr objects in sequence.

ufl_legacy.sorting.sorted_expr_sum(seq)

## ufl_legacy.split_functions module

Algorithm for splitting a Coefficient or Argument into subfunctions.

ufl_legacy.split_functions.split(v)

  UFL operator: If v is a Coefficient or Argument in a mixed space, returns a tuple with the function components corresponding to the subelements.

## ufl_legacy.tensoralgebra module

Compound tensor algebra operations.

class ufl_legacy.tensoralgebra.Cofactor(A)

  Bases: `CompoundTensorOperator`

  ufl_free_indices = ()
  ufl_index_dimensions = ()
  property ufl_shape

class ufl_legacy.tensoralgebra.CompoundTensorOperator(operands)

  Bases: `Operator`

class ufl_legacy.tensoralgebra.Cross(a, b)

  Bases: `CompoundTensorOperator`

  ufl_free_indices
  ufl_index_dimensions
  ufl_shape = (3,)

class ufl_legacy.tensoralgebra.Determinant(A)

  Bases: `CompoundTensorOperator`

  ufl_free_indices = ()
  ufl_index_dimensions = ()
  ufl_shape = ()

class ufl_legacy.tensoralgebra.Deviatoric(A)

  Bases: `CompoundTensorOperator`

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.tensoralgebra.Dot(a, b)

  Bases: `CompoundTensorOperator`

  ufl_free_indices
  ufl_index_dimensions
  property ufl_shape

class ufl_legacy.tensoralgebra.Inner(a, b)

  Bases: `CompoundTensorOperator`

  ufl_free_indices
  ufl_index_dimensions
  ufl_shape = ()

class ufl_legacy.tensoralgebra.Inverse(A)

  Bases: `CompoundTensorOperator`

  ufl_free_indices = ()
  ufl_index_dimensions = ()
  property ufl_shape

class ufl_legacy.tensoralgebra.Outer(a, b)

  Bases: `CompoundTensorOperator`

  ufl_free_indices
  ufl_index_dimensions
  property ufl_shape

class ufl_legacy.tensoralgebra.Skew(A)

  Bases: `CompoundTensorOperator`

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.tensoralgebra.Sym(A)

  Bases: `CompoundTensorOperator`

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

class ufl_legacy.tensoralgebra.Trace(A)

  Bases: `CompoundTensorOperator`

  property ufl_free_indices
  property ufl_index_dimensions
  ufl_shape = ()

class ufl_legacy.tensoralgebra.Transposed(A)

  Bases: `CompoundTensorOperator`

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

## ufl_legacy.tensors module

Classes used to group scalar expressions into expressions with rank > 0.

class ufl_legacy.tensors.ComponentTensor(expression, indices)

  Bases: `Operator`

  UFL operator type: Maps the free indices of a scalar valued expression to tensor axes.

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

  indices()
  ufl_free_indices
  ufl_index_dimensions
  ufl_shape

class ufl_legacy.tensors.ListTensor(*expressions)

  Bases: `Operator`

  UFL operator type: Wraps a list of expressions into a tensor valued expression of one higher rank.

  evaluate(x, mapping, component, index_values, derivatives=())

    Evaluate expression at given coordinate with given values for terminals.

  property ufl_free_indices
  property ufl_index_dimensions
  property ufl_shape

ufl_legacy.tensors.as_matrix(expressions, indices=None)

  UFL operator: As as_tensor(), but limited to rank 2 tensors.

ufl_legacy.tensors.as_scalar(expression)

  Given a scalar or tensor valued expression A, returns either of the tuples:

      (a,b) = (A, ())
      (a,b) = (A[indices], indices)

  such that a is always a scalar valued expression.

ufl_legacy.tensors.as_scalars(*expressions)

  Given multiple scalar or tensor valued expressions A, returns either of the tuples:

      (a,b) = (A, ())
      (a,b) = ([A[0][indices], ..., A[-1][indices]], indices)

  such that a is always a list of scalar valued expressions.

ufl_legacy.tensors.as_tensor(expressions, indices=None)

  UFL operator: Make a tensor valued expression.

  This works in two different ways, by using indices or lists.

  1) Returns \(A\) such that \(A\) [indices] = expressions. If indices are provided, expressions must be a scalar valued expression with all the provided indices among its free indices. This operator will then map each of these indices to a tensor axis, thereby making a tensor valued expression from a scalar valued expression with free indices.

  2) Returns \(A\) such that \(A[k,...]\) = expressions*[k]. If no indices are provided, *expressions must be a list or tuple of expressions. The expressions can also consist of recursively nested lists to build higher rank tensors.

ufl_legacy.tensors.as_vector(expressions, index=None)

  UFL operator: As `as_tensor()`, but limited to rank 1 tensors.

ufl_legacy.tensors.dyad(d, *iota)

  TODO: Develop this concept, can e.g. write A[i,j]*dyad(j,i) for the transpose.

ufl_legacy.tensors.from_numpy_to_lists(expressions)

ufl_legacy.tensors.numpy2nestedlists(arr)

ufl_legacy.tensors.relabel(A, indexmap)

  UFL operator: Relabel free indices of \(A\) with new indices, using the given mapping.

ufl_legacy.tensors.unit_indexed_tensor(shape, component)

ufl_legacy.tensors.unit_list(i, n)

ufl_legacy.tensors.unit_list2(i, j, n)

ufl_legacy.tensors.unit_matrices(d)

  UFL value: A tuple of constant unit matrices in all directions with dimension d.

ufl_legacy.tensors.unit_matrix(i, j, d)

  UFL value: A constant unit matrix in direction i,*j* with dimension d.

ufl_legacy.tensors.unit_vector(i, d)

  UFL value: A constant unit vector in direction i with dimension d.

ufl_legacy.tensors.unit_vectors(d)

  UFL value: A tuple of constant unit vectors in all directions with dimension d.

ufl_legacy.tensors.unwrap_list_tensor(lt)

## ufl_legacy.variable module

Defines the Variable and Label classes, used to label expressions as variables for differentiation.

class ufl_legacy.variable.Label(count=None)

  Bases: `Terminal`

  count()
  is_cellwise_constant()
  ufl_domains()

    Return tuple of domains related to this terminal object.

  property ufl_free_indices

    Built-in immutable sequence.

    If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

    If the argument is a tuple, the return value is the same object.

  property ufl_index_dimensions

    Built-in immutable sequence.

    If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

    If the argument is a tuple, the return value is the same object.

  property ufl_shape

class ufl_legacy.variable.Variable(expression, label=None)

  Bases: `Operator`

  A Variable is a representative for another expression.

  It will be used by the end-user mainly for defining a quantity to differentiate w.r.t. using diff. Example:

      e = <...>
      e = variable(e)
      f = exp(e**2)
      df = diff(f, e)

  evaluate(x, mapping, component, index_values)

    Evaluate expression at given coordinate with given values for terminals.

  expression()
  label()
  ufl_domains()

    Return all domains this expression is defined on.

  ufl_free_indices = ()
  ufl_index_dimensions = ()
  property ufl_shape

## Module contents

The Unified Form Language is an embedded domain specific language for definition of variational forms intended for finite element discretization. More precisely, it defines a fixed interface for choosing finite element spaces and defining expressions for weak forms in a notation close to the mathematical one.

This Python module contains the language as well as algorithms to work with it.

- To import the language, type:

      from ufl_legacy import *

- To import the underlying classes an UFL expression tree is built from, type

      from ufl_legacy.classes import *

- Various algorithms for working with UFL expression trees can be accessed by

      from ufl_legacy.algorithms import *

Classes and algorithms are considered implementation details and should not be used in form definitions.

For more details on the language, see

> http://www.fenicsproject.org

and

> http://arxiv.org/abs/1211.4047

The development version can be found in the repository at

> https://www.bitbucket.org/fenics-project/ufl

A very brief overview of the language contents follows:

- Cells:

      - AbstractCell
      - Cell
      - TensorProductCell
      - vertex
      - interval
      - triangle
      - tetrahedron
      - quadrilateral
      - hexahedron
      - prism
      - pyramid

- Domains:

      - AbstractDomain
      - Mesh
      - MeshView
      - TensorProductMesh

- Sobolev spaces:

      - L2
      - H1
      - H2
      - HDiv
      - HCurl

- Elements:

      - FiniteElement
      - MixedElement
      - VectorElement
      - TensorElement
      - EnrichedElement
      - NodalEnrichedElement
      - RestrictedElement
      - TensorProductElement
      - HDivElement
      - HCurlElement
      - BrokenElement
      - FacetElement
      - InteriorElement

- Function spaces:

      - FunctionSpace
      - MixedFunctionSpace

- Arguments:

      - Argument
      - TestFunction
      - TrialFunction
      - Arguments
      - TestFunctions
      - TrialFunctions

- Coefficients:

      - Coefficient
      - Constant
      - VectorConstant
      - TensorConstant

- Splitting form arguments in mixed spaces:

      - split

- Literal constants:

      - Identity
      - PermutationSymbol

- Geometric quantities:

      - SpatialCoordinate
      - FacetNormal
      - CellNormal
      - CellVolume
      - CellDiameter
      - Circumradius
      - MinCellEdgeLength
      - MaxCellEdgeLength
      - FacetArea
      - MinFacetEdgeLength
      - MaxFacetEdgeLength
      - Jacobian
      - JacobianDeterminant
      - JacobianInverse

- Indices:

      - Index
      - indices
      - i, j, k, l
      - p, q, r, s

- Scalar to tensor expression conversion:

      - as_tensor
      - as_vector
      - as_matrix

- Unit vectors and matrices:

      - unit_vector
      - unit_vectors
      - unit_matrix
      - unit_matrices

- Tensor algebra operators:

      - outer, inner, dot, cross, perp
      - det, inv, cofac
      - transpose, tr, diag, diag_vector
      - dev, skew, sym

- Elementwise tensor operators:

      - elem_mult
      - elem_div
      - elem_pow
      - elem_op

- Differential operators:

      - variable
      - diff,
      - grad, nabla_grad
      - div, nabla_div
      - curl, rot
      - Dx, Dn

- Nonlinear functions:

      - max_value, min_value
      - abs, sign
      - sqrt
      - exp, ln, erf
      - cos, sin, tan
      - acos, asin, atan, atan_2
      - cosh, sinh, tanh
      - bessel_J, bessel_Y, bessel_I, bessel_K

- Complex operations:

      - conj, real, imag
      conjugate is an alias for conj

- Discontinuous Galerkin operators:

      - v('+'), v('-')
      - jump
      - avg
      - cell_avg, facet_avg

- Conditional operators:

      - eq, ne, le, ge, lt, gt
      - <, >, <=, >=
      - And, Or, Not
      - conditional

- Integral measures:

      - dx, ds, dS, dP
      - dc, dC, dO, dI, dX
      - ds_b, ds_t, ds_tb, ds_v, dS_h, dS_v

- Form transformations:

      - rhs, lhs
      - system
      - functional
      - replace, replace_integral_domains
      - adjoint
      - action
      - energy_norm,
      - sensitivity_rhs
      - derivative

class ufl_legacy.AbstractCell(topological_dimension, geometric_dimension)

  Bases: `object`

  Representation of an abstract finite element cell with only the dimensions known.

  geometric_dimension()

    Return the dimension of the space this cell is embedded in.

  has_simplex_facets()

    Return True if all the facets of this cell are simplex cells.

  is_simplex()

    Return True if this is a simplex cell.

  topological_dimension()

    Return the dimension of the topology of this cell.

class ufl_legacy.AbstractDomain(topological_dimension, geometric_dimension)

  Bases: `object`

  Symbolic representation of a geometric domain with only a geometric and topological dimension.

  geometric_dimension()

    Return the dimension of the space this domain is embedded in.

  topological_dimension()

    Return the dimension of the topology of this domain.

ufl_legacy.And(left, right)

  UFL operator: A boolean expression (left and right) for use with `conditional`.

class ufl_legacy.Argument(function_space, number, part=None)

  Bases: `FormArgument`

  UFL value: Representation of an argument to a form.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  number()

    Return the Argument number.

  part()
  ufl_domain()

    Deprecated, please use .ufl_function_space().ufl_domain() instead.

  ufl_domains()

    Deprecated, please use .ufl_function_space().ufl_domains() instead.

  ufl_element()

    Deprecated, please use .ufl_function_space().ufl_element() instead.

  ufl_function_space()

    Get the function space of this Argument.

  property ufl_shape

    Return the associated UFL shape.

ufl_legacy.Arguments(function_space, number)

  UFL value: Create an Argument in a mixed space, and return a tuple with the function components corresponding to the subelements.

class ufl_legacy.BrokenElement(element)

  Bases: `FiniteElementBase`

  The discontinuous version of an existing Finite Element space.

  mapping()

    Not implemented.

  reconstruct(**kwargs)
  shortstr()

    Format as string for pretty printing.

class ufl_legacy.Cell(cellname, geometric_dimension=None)

  Bases: `AbstractCell`

  Representation of a named finite element cell with known structure.

  cellname()

    Return the cellname of the cell.

  facet_types()

    A tuple of ufl_legacy.Cell representing the facets of self.

  has_simplex_facets()

    Return True if all the facets of this cell are simplex cells.

  is_simplex()

    Return True if this is a simplex cell.

  num_edges()

    The number of cell edges.

  num_facets()

    The number of cell facets.

  num_vertices()

    The number of cell vertices.

  reconstruct(geometric_dimension=None)

class ufl_legacy.CellDiameter(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The diameter of the cell, i.e., maximal distance of two points in the cell.

  name = 'diameter'

class ufl_legacy.CellNormal(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The upwards pointing normal vector of the current manifold cell.

  name = 'cell_normal'
  property ufl_shape

    Return the number of coordinates defined (i.e. the geometric dimension of the domain).

class ufl_legacy.CellVolume(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The volume of the cell.

  name = 'volume'

class ufl_legacy.Circumradius(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The circumradius of the cell.

  name = 'circumradius'

class ufl_legacy.Coefficient(function_space, count=None)

  Bases: `FormArgument`

  UFL form argument type: Representation of a form coefficient.

  count()
  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  ufl_domain()

    Shortcut to get the domain of the function space of this coefficient.

  ufl_domains()

    Return tuple of domains related to this terminal object.

  ufl_element()

    Shortcut to get the finite element of the function space of this coefficient.

  ufl_function_space()

    Get the function space of this coefficient.

  property ufl_shape

    Return the associated UFL shape.

ufl_legacy.Coefficients(function_space)

  UFL value: Create a Coefficient in a mixed space, and return a tuple with the function components corresponding to the subelements.

class ufl_legacy.Constant(domain, shape=(), count=None)

  Bases: `Terminal`

  count()
  is_cellwise_constant()
  ufl_domain()

    Return the single unique domain this expression is defined on, or throw an error.

  ufl_domains()

    Return tuple of domains related to this terminal object.

  property ufl_shape

ufl_legacy.Dn(f)

  UFL operator: Take the directional derivative of f in the facet normal direction, Dn(f) := dot(grad(f), n).

ufl_legacy.Dx(f, *i)

  UFL operator: Take the partial derivative of f with respect to spatial variable number i. Equivalent to `f.dx(*i)`.

class ufl_legacy.EnrichedElement(*elements)

  Bases: `EnrichedElementBase`

  The vector sum of several finite element spaces:

  \[\textrm{EnrichedElement}(V, Q) = \{v + q | v \in V, q \in Q\}.\]

  Dual basis is a concatenation of subelements dual bases; primal basis is a concatenation of subelements primal bases; resulting element is not nodal even when subelements are. Structured basis may be exploited in form compilers.

  is_cellwise_constant()

    Return whether the basis functions of this element is spatially constant over each cell.

  shortstr()

    Format as string for pretty printing.

class ufl_legacy.FacetArea(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The area of the facet.

  name = 'facetarea'

ufl_legacy.FacetElement(element)

  Constructs the restriction of a finite element to the facets of the cell.

class ufl_legacy.FacetNormal(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The outwards pointing normal vector of the current facet.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'n'
  property ufl_shape

    Return the number of coordinates defined (i.e. the geometric dimension of the domain).

class ufl_legacy.FiniteElement(family, cell=None, degree=None, form_degree=None, quad_scheme=None, variant=None)

  Bases: `FiniteElementBase`

  The basic finite element class for all simple finite elements.

  mapping()

    Not implemented.

  reconstruct(family=None, cell=None, degree=None, quad_scheme=None, variant=None)

    Construct a new FiniteElement object with some properties replaced with new values.

  shortstr()

    Format as string for pretty printing.

  sobolev_space()

    Return the underlying Sobolev space.

  variant()

    Return the variant used to initialise the element.

class ufl_legacy.FiniteElementBase(family, cell, degree, quad_scheme, value_shape, reference_value_shape)

  Bases: `object`

  Base class for all finite elements.

  cell()

    Return cell of finite element.

  degree(component=None)

    Return polynomial degree of finite element.

  extract_component(i)

    Recursively extract component index relative to a (simple) element and that element for given value component index.

  extract_reference_component(i)

    Recursively extract reference component index relative to a (simple) element and that element for given reference value component index.

  extract_subelement_component(i)

    Extract direct subelement index and subelement relative component index for a given component index.

  extract_subelement_reference_component(i)

    Extract direct subelement index and subelement relative reference component index for a given reference component index.

  family()

    Return finite element family.

  is_cellwise_constant(component=None)

    Return whether the basis functions of this element is spatially constant over each cell.

  mapping()

    Not implemented.

  num_sub_elements()

    Return number of sub-elements.

  quadrature_scheme()

    Return quadrature scheme of finite element.

  reference_value_shape()

    Return the shape of the value space on the reference cell.

  reference_value_size()

    Return the integer product of the reference value shape.

  sub_elements()

    Return list of sub-elements.

  symmetry()

    Return the symmetry dict, which is a mapping \(c_0 \to c_1\) meaning that component \(c_0\) is represented by component \(c_1\). A component is a tuple of one or more ints.

  value_shape()

    Return the shape of the value space on the global domain.

  value_size()

    Return the integer product of the value shape.

  variant()

    Return the variant used to initialise the element.

class ufl_legacy.Form(integrals)

  Bases: `object`

  Description of a weak form consisting of a sum of integrals over subdomains.

  arguments()

    Return all `Argument` objects found in form.

  coefficient_numbering()

    Return a contiguous numbering of coefficients in a mapping `{coefficient:number}`.

  coefficients()

    Return all `Coefficient` objects found in form.

  constant_numbering()

    Return a contiguous numbering of constants in a mapping `{constant:number}`.

  constants()
  domain_numbering()

    Return a contiguous numbering of domains in a mapping `{domain:number}`.

  empty()

    Returns whether the form has no integrals.

  equals(other)

    Evaluate `bool(lhs_form == rhs_form)`.

  geometric_dimension()

    Return the geometric dimension shared by all domains and functions in this form.

  integrals()

    Return a sequence of all integrals in form.

  integrals_by_domain(domain)

    Return a sequence of all integrals with a particular integration domain.

  integrals_by_type(integral_type)

    Return a sequence of all integrals with a particular domain type.

  max_subdomain_ids()

    Returns a mapping on the form `{domain:{integral_type:max_subdomain_id}}`.

  signature()

    Signature for use with jit cache (independent of incidental numbering of indices etc.)

  subdomain_data()

    Returns a mapping on the form `{domain:{integral_type: subdomain_data}}`.

  ufl_cell()

    Return the single cell this form is defined on, fails if multiple cells are found.

  ufl_domain()

    Return the single geometric integration domain occuring in the form.

    Fails if multiple domains are found.

    NB! This does not include domains of coefficients defined on other meshes, look at form data for that additional information.

  ufl_domains()

    Return the geometric integration domains occuring in the form.

    NB! This does not include domains of coefficients defined on other meshes.

    The return type is a tuple even if only a single domain exists.

class ufl_legacy.FunctionSpace(domain, element)

  Bases: `AbstractFunctionSpace`

  ufl_domain()

    Return ufl domain.

  ufl_domains()

    Return ufl domains.

  ufl_element()

    Return ufl element.

  ufl_sub_spaces()

    Return ufl sub spaces.

class ufl_legacy.HCurlElement(element)

  Bases: `FiniteElementBase`

  A curl-conforming version of an outer product element, assuming this makes mathematical sense.

  mapping()

    Not implemented.

  reconstruct(**kwargs)
  shortstr()

    Format as string for pretty printing.

  sobolev_space()

    Return the underlying Sobolev space.

class ufl_legacy.HDivElement(element)

  Bases: `FiniteElementBase`

  A div-conforming version of an outer product element, assuming this makes mathematical sense.

  mapping()

    Not implemented.

  reconstruct(**kwargs)
  shortstr()

    Format as string for pretty printing.

  sobolev_space()

    Return the underlying Sobolev space.

class ufl_legacy.Identity(dim)

  Bases: `ConstantValue`

  UFL literal type: Representation of an identity matrix.

  evaluate(x, mapping, component, index_values)

    Evaluates the identity matrix on the given components.

  ufl_shape

class ufl_legacy.Index(count=None)

  Bases: `IndexBase`

  UFL value: An index with no value assigned.

  Used to represent free indices in Einstein indexing notation.

  count()

class ufl_legacy.Integral(integrand, integral_type, domain, subdomain_id, metadata, subdomain_data)

  Bases: `object`

  An integral over a single domain.

  integral_type()

    Return the domain type of this integral.

  integrand()

    Return the integrand expression, which is an `Expr` instance.

  metadata()

    Return the compiler metadata this integral has been annotated with.

  reconstruct(integrand=None, integral_type=None, domain=None, subdomain_id=None, metadata=None, subdomain_data=None)

    Construct a new Integral object with some properties replaced with new values.

    ### Example:

    > <a = Integral instance> b = a.reconstruct(expand_compounds(a.integrand())) c = a.reconstruct(metadata={‘quadrature_degree’:2})

  subdomain_data()

    Return the domain data of this integral.

  subdomain_id()

    Return the subdomain id of this integral.

  ufl_domain()

    Return the integration domain of this integral.

ufl_legacy.InteriorElement(element)

  Constructs the restriction of a finite element to the interior of the cell.

class ufl_legacy.Jacobian(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The Jacobian of the mapping from reference cell to spatial coordinates.

  \[J_{ij} = \frac{dx_i}{dX_j}\]
  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'J'
  property ufl_shape

    Return the number of coordinates defined (i.e. the geometric dimension of the domain).

class ufl_legacy.JacobianDeterminant(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The determinant of the Jacobian.

  Represents the signed determinant of a square Jacobian or the pseudo-determinant of a non-square Jacobian.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'detJ'

class ufl_legacy.JacobianInverse(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The inverse of the Jacobian.

  Represents the inverse of a square Jacobian or the pseudo-inverse of a non-square Jacobian.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'K'
  property ufl_shape

    Return the number of coordinates defined (i.e. the geometric dimension of the domain).

ufl_legacy.Max(x, y)

  UFL operator: Take the maximum of x and y.

class ufl_legacy.MaxCellEdgeLength(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The maximum edge length of the cell.

  name = 'maxcelledgelength'

class ufl_legacy.MaxFacetEdgeLength(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The maximum edge length of the facet.

  name = 'maxfacetedgelength'

class ufl_legacy.Measure(integral_type, domain=None, subdomain_id='everywhere', metadata=None, subdomain_data=None)

  Bases: `object`

  integral_type()

    Return the domain type.

    Valid domain types are “cell”, “exterior_facet”, “interior_facet”, etc.

  metadata()

    Return the integral metadata. This data is not interpreted by UFL. It is passed to the form compiler which can ignore it or use it to compile each integral of a form in a different way.

  reconstruct(integral_type=None, subdomain_id=None, domain=None, metadata=None, subdomain_data=None)

    Construct a new Measure object with some properties replaced with new values.

    ### Example:

    > <dm = Measure instance> b = dm.reconstruct(subdomain_id=2) c = dm.reconstruct(metadata={ “quadrature_degree”: 3 })

    Used by the call operator, so this is equivalent:

      b = dm(2) c = dm(0, { “quadrature_degree”: 3 })

  subdomain_data()

    Return the integral subdomain_data. This data is not interpreted by UFL. Its intension is to give a context in which the domain id is interpreted.

  subdomain_id()

    Return the domain id of this measure (integer).

  ufl_domain()

    Return the domain associated with this measure.

    This may be None or a Domain object.

class ufl_legacy.Mesh(coordinate_element, ufl_id=None, cargo=None)

  Bases: `AbstractDomain`

  Symbolic representation of a mesh.

  is_piecewise_linear_simplex_domain()
  ufl_cargo()

    Return carried object that will not be used by UFL.

  ufl_cell()
  ufl_coordinate_element()
  ufl_id()

    Return the ufl_id of this object.

class ufl_legacy.MeshView(mesh, topological_dimension, ufl_id=None)

  Bases: `AbstractDomain`

  Symbolic representation of a mesh.

  is_piecewise_linear_simplex_domain()
  ufl_cell()
  ufl_id()

    Return the ufl_id of this object.

  ufl_mesh()

ufl_legacy.Min(x, y)

  UFL operator: Take the minimum of x and y.

class ufl_legacy.MinCellEdgeLength(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The minimum edge length of the cell.

  name = 'mincelledgelength'

class ufl_legacy.MinFacetEdgeLength(domain)

  Bases: `GeometricFacetQuantity`

  UFL geometry representation: The minimum edge length of the facet.

  name = 'minfacetedgelength'

class ufl_legacy.MixedElement(*elements, **kwargs)

  Bases: `FiniteElementBase`

  A finite element composed of a nested hierarchy of mixed or simple elements.

  degree(component=None)

    Return polynomial degree of finite element.

  extract_component(i)

    Recursively extract component index relative to a (simple) element and that element for given value component index.

  extract_reference_component(i)

    Recursively extract reference_component index relative to a (simple) element and that element for given value reference_component index.

  extract_subelement_component(i)

    Extract direct subelement index and subelement relative component index for a given component index.

  extract_subelement_reference_component(i)

    Extract direct subelement index and subelement relative reference_component index for a given reference_component index.

  is_cellwise_constant(component=None)

    Return whether the basis functions of this element is spatially constant over each cell.

  mapping()

    Not implemented.

  num_sub_elements()

    Return number of sub elements.

  reconstruct(**kwargs)
  reconstruct_from_elements(*elements)

    Reconstruct a mixed element from new subelements.

  shortstr()

    Format as string for pretty printing.

  sub_elements()

    Return list of sub elements.

  symmetry()

    Return the symmetry dict, which is a mapping \(c_0 \to c_1\) meaning that component \(c_0\) is represented by component \(c_1\). A component is a tuple of one or more ints.

class ufl_legacy.MixedFunctionSpace(*args)

  Bases: `AbstractFunctionSpace`

  num_sub_spaces()
  ufl_domain()

    Return ufl domain.

  ufl_domains()

    Return ufl domains.

  ufl_element()
  ufl_elements()

    Return ufl elements.

  ufl_sub_space(i)

    Return i-th ufl sub space.

  ufl_sub_spaces()

    Return ufl sub spaces.

class ufl_legacy.NodalEnrichedElement(*elements)

  Bases: `EnrichedElementBase`

  The vector sum of several finite element spaces:

  \[\textrm{EnrichedElement}(V, Q) = \{v + q | v \in V, q \in Q\}.\]

  Primal basis is reorthogonalized to dual basis which is a concatenation of subelements dual bases; resulting element is nodal.

  is_cellwise_constant()

    Return whether the basis functions of this element is spatially constant over each cell.

  shortstr()

    Format as string for pretty printing.

ufl_legacy.Not(condition)

  UFL operator: A boolean expression (not condition) for use with `conditional`.

ufl_legacy.Or(left, right)

  UFL operator: A boolean expression (left or right) for use with `conditional`.

class ufl_legacy.PermutationSymbol(dim)

  Bases: `ConstantValue`

  UFL literal type: Representation of a permutation symbol.

  This is also known as the Levi-Civita symbol, antisymmetric symbol, or alternating symbol.

  evaluate(x, mapping, component, index_values)

    Evaluates the permutation symbol.

  ufl_shape

class ufl_legacy.RestrictedElement(element, restriction_domain)

  Bases: `FiniteElementBase`

  Represents the restriction of a finite element to a type of cell entity.

  is_cellwise_constant()

    Return whether the basis functions of this element is spatially constant over each cell.

  mapping()

    Not implemented.

  num_restricted_sub_elements()

    Return number of restricted sub elements.

  num_sub_elements()

    Return number of sub elements.

  reconstruct(**kwargs)
  restricted_sub_elements()

    Return list of restricted sub elements.

  restriction_domain()

    Return the domain onto which the element is restricted.

  shortstr()

    Format as string for pretty printing.

  sub_element()

    Return the element which is restricted.

  sub_elements()

    Return list of sub elements.

  symmetry()

    Return the symmetry dict, which is a mapping \(c_0 \to c_1\) meaning that component \(c_0\) is represented by component \(c_1\). A component is a tuple of one or more ints.

class ufl_legacy.SpatialCoordinate(domain)

  Bases: `GeometricCellQuantity`

  UFL geometry representation: The coordinate in a domain.

  In the context of expression integration, represents the domain coordinate of each quadrature point.

  In the context of expression evaluation in a point, represents the value of that point.

  count()
  evaluate(x, mapping, component, index_values)

    Return the value of the coordinate.

  is_cellwise_constant()

    Return whether this expression is spatially constant over each cell.

  name = 'x'
  property ufl_shape

    Return the number of coordinates defined (i.e. the geometric dimension of the domain).

ufl_legacy.TensorConstant(domain, count=None)

class ufl_legacy.TensorElement(family, cell=None, degree=None, shape=None, symmetry=None, quad_scheme=None, variant=None)

  Bases: `MixedElement`

  A special case of a mixed finite element where all elements are equal.

  extract_subelement_component(i)

    Extract direct subelement index and subelement relative component index for a given component index.

  flattened_sub_element_mapping()
  mapping()

    Not implemented.

  reconstruct(**kwargs)
  shortstr()

    Format as string for pretty printing.

  symmetry()

    Return the symmetry dict, which is a mapping \(c_0 \to c_1\) meaning that component \(c_0\) is represented by component \(c_1\). A component is a tuple of one or more ints.

  variant()

    Return the variant used to initialise the element.

class ufl_legacy.TensorProductCell(*cells, **kwargs)

  Bases: `AbstractCell`

  cellname()

    Return the cellname of the cell.

  has_simplex_facets()

    Return True if all the facets of this cell are simplex cells.

  is_simplex()

    Return True if this is a simplex cell.

  num_edges()

    The number of cell edges.

  num_facets()

    The number of cell facets.

  num_vertices()

    The number of cell vertices.

  reconstruct(geometric_dimension=None)
  sub_cells()

    Return list of cell factors.

class ufl_legacy.TensorProductElement(*elements, **kwargs)

  Bases: `FiniteElementBase`

  The tensor product of \(d\) element spaces:

  \[V = V_1 \otimes V_2 \otimes ... \otimes V_d\]

  Given bases \(\{\phi_{j_i}\}\) of the spaces \(V_i\) for \(i = 1, ...., d\), \(\{ \phi_{j_1} \otimes \phi_{j_2} \otimes \cdots \otimes \phi_{j_d} \}\) forms a basis for \(V\).

  mapping()

    Not implemented.

  num_sub_elements()

    Return number of subelements.

  reconstruct(**kwargs)
  shortstr()

    Short pretty-print.

  sobolev_space()

    Return the underlying Sobolev space of the TensorProductElement.

  sub_elements()

    Return subelements (factors).

class ufl_legacy.TensorProductMesh(meshes, ufl_id=None)

  Bases: `AbstractDomain`

  Symbolic representation of a mesh.

  is_piecewise_linear_simplex_domain()
  ufl_cell()
  ufl_coordinate_element()
  ufl_id()

    Return the ufl_id of this object.

  ufl_meshes()

ufl_legacy.TestFunction(function_space, part=None)

  UFL value: Create a test function argument to a form.

ufl_legacy.TestFunctions(function_space)

  UFL value: Create a TestFunction in a mixed space, and return a tuple with the function components corresponding to the subelements.

ufl_legacy.TrialFunction(function_space, part=None)

  UFL value: Create a trial function argument to a form.

ufl_legacy.TrialFunctions(function_space)

  UFL value: Create a TrialFunction in a mixed space, and return a tuple with the function components corresponding to the subelements.

exception ufl_legacy.UFLException

  Bases: `Exception`

  Base class for UFL exceptions.

ufl_legacy.VectorConstant(domain, count=None)

class ufl_legacy.VectorElement(family, cell=None, degree=None, dim=None, form_degree=None, quad_scheme=None, variant=None)

  Bases: `MixedElement`

  A special case of a mixed finite element where all elements are equal.

  mapping()

    Not implemented.

  reconstruct(**kwargs)
  shortstr()

    Format as string for pretty printing.

  variant()

    Return the variant used to initialise the element.

class ufl_legacy.WithMapping(wrapee, mapping)

  Bases: `FiniteElementBase`

  Specify an alternative mapping for the wrappee. For example, to use identity mapping instead of Piola map with an element E, write remapped = WithMapping(E, “identity”)

  mapping()

    Not implemented.

  reconstruct(**kwargs)
  reference_value_shape()

    Return the shape of the value space on the reference cell.

  shortstr()
  value_shape()

    Return the shape of the value space on the global domain.

ufl_legacy.acos(f)

  UFL operator: Take the inverse cosine of f.

ufl_legacy.action(form, coefficient=None)

  UFL form operator: Given a bilinear form, return a linear form with an additional coefficient, representing the action of the form on the coefficient. This can be used for matrix-free methods.

ufl_legacy.add_logfile(filename=None, mode='a', level=10)

  Add a log file.

ufl_legacy.adjoint(form, reordered_arguments=None)

  UFL form operator: Given a combined bilinear form, compute the adjoint form by changing the ordering (count) of the test and trial functions, and taking the complex conjugate of the result.

  By default, new `Argument` objects will be created with opposite ordering. However, if the adjoint form is to be added to other forms later, their arguments must match. In that case, the user must provide a tuple *reordered_arguments*=(u2,v2).

ufl_legacy.as_cell(cell)

  Convert any valid object to a Cell or return cell if it is already a Cell.

  Allows an already valid cell, a known cellname string, or a tuple of cells for a product cell.

ufl_legacy.as_domain(domain)

  Convert any valid object to an AbstractDomain type.

ufl_legacy.as_matrix(expressions, indices=None)

  UFL operator: As as_tensor(), but limited to rank 2 tensors.

ufl_legacy.as_tensor(expressions, indices=None)

  UFL operator: Make a tensor valued expression.

  This works in two different ways, by using indices or lists.

  1) Returns \(A\) such that \(A\) [indices] = expressions. If indices are provided, expressions must be a scalar valued expression with all the provided indices among its free indices. This operator will then map each of these indices to a tensor axis, thereby making a tensor valued expression from a scalar valued expression with free indices.

  2) Returns \(A\) such that \(A[k,...]\) = expressions*[k]. If no indices are provided, *expressions must be a list or tuple of expressions. The expressions can also consist of recursively nested lists to build higher rank tensors.

ufl_legacy.as_ufl(expression)

  Converts expression to an Expr if possible.

ufl_legacy.as_vector(expressions, index=None)

  UFL operator: As `as_tensor()`, but limited to rank 1 tensors.

ufl_legacy.asin(f)

  UFL operator: Take the inverse sine of f.

ufl_legacy.atan(f)

  UFL operator: Take the inverse tangent of f.

ufl_legacy.atan_2(f1, f2)

  UFL operator: Take the inverse tangent with two the arguments f1 and f2.

ufl_legacy.avg(v)

  UFL operator: Take the average of v across a facet.

ufl_legacy.bessel_I(nu, f)

  UFL operator: regular modified cylindrical Bessel function.

ufl_legacy.bessel_J(nu, f)

  UFL operator: cylindrical Bessel function of the first kind.

ufl_legacy.bessel_K(nu, f)

  UFL operator: irregular modified cylindrical Bessel function.

ufl_legacy.bessel_Y(nu, f)

  UFL operator: cylindrical Bessel function of the second kind.

ufl_legacy.cell_avg(f)

  UFL operator: Take the average of v over a cell.

ufl_legacy.cofac(A)

  UFL operator: Take the cofactor of A.

ufl_legacy.conditional(condition, true_value, false_value)

  UFL operator: A conditional expression, taking the value of true_value when condition evaluates to `true` and false_value otherwise.

ufl_legacy.conj(f)

  UFL operator: The complex conjugate of f

ufl_legacy.cos(f)

  UFL operator: Take the cosine of f.

ufl_legacy.cosh(f)

  UFL operator: Take the hyperbolic cosine of f.

ufl_legacy.cross(a, b)

  UFL operator: Take the cross product of a and b.

ufl_legacy.curl(f)

  UFL operator: Take the curl of f.

ufl_legacy.derivative(form, coefficient, argument=None, coefficient_derivatives=None)

  UFL form operator: Compute the Gateaux derivative of form w.r.t. coefficient in direction of argument.

  If the argument is omitted, a new `Argument` is created in the same space as the coefficient, with argument number one higher than the highest one in the form.

  The resulting form has one additional `Argument` in the same finite element space as the coefficient.

  A tuple of `Coefficient` s may be provided in place of a single `Coefficient`, in which case the new `Argument` argument is based on a `MixedElement` created from this tuple.

  An indexed `Coefficient` from a mixed space may be provided, in which case the argument should be in the corresponding subspace of the coefficient space.

  If provided, coefficient_derivatives should be a mapping from `Coefficient` instances to their derivatives w.r.t. coefficient.

ufl_legacy.det(A)

  UFL operator: Take the determinant of A.

ufl_legacy.dev(A)

  UFL operator: Take the deviatoric part of A.

ufl_legacy.diag(A)

  UFL operator: Take the diagonal part of rank 2 tensor A or make a diagonal rank 2 tensor from a rank 1 tensor.

  Always returns a rank 2 tensor. See also `diag_vector`.

ufl_legacy.diag_vector(A)

  UFL operator: Take the diagonal part of rank 2 tensor A and return as a vector.

  See also `diag`.

ufl_legacy.diff(f, v)

  UFL operator: Take the derivative of f with respect to the variable v.

  If f is a form, `diff` is applied to each integrand.

ufl_legacy.div(f)

  UFL operator: Take the divergence of f.

  This operator follows the div convention where

  > div(v) = v[i].dx(i)

  > div(T)[:] = T[:,i].dx(i)

  for vector expressions v, and arbitrary rank tensor expressions T.

  See also: `nabla_div()`

ufl_legacy.dot(a, b)

  UFL operator: Take the dot product of a and b. This won’t take the complex conjugate of the second argument.

ufl_legacy.elem_div(A, B)

  UFL operator: Take the elementwise division of tensors A and B with the same shape.

ufl_legacy.elem_mult(A, B)

  UFL operator: Take the elementwise multiplication of tensors A and B with the same shape.

ufl_legacy.elem_op(op, *args)

  UFL operator: Take the elementwise application of operator op on scalar values from one or more tensor arguments.

ufl_legacy.elem_pow(A, B)

  UFL operator: Take the elementwise power of tensors A and B with the same shape.

ufl_legacy.energy_norm(form, coefficient=None)

  UFL form operator: Given a bilinear form a and a coefficient f, return the functional \(a(f,f)\).

ufl_legacy.eq(left, right)

  UFL operator: A boolean expression (left == right) for use with `conditional`.

ufl_legacy.erf(f)

  UFL operator: Take the error function of f.

ufl_legacy.exp(f)

  UFL operator: Take the exponential of f.

ufl_legacy.exterior_derivative(f)

  UFL operator: Take the exterior derivative of f.

  The exterior derivative uses the element family to determine whether `id`, `grad`, `curl` or `div` should be used.

  Note that this uses the `grad` and `div` operators, as opposed to `nabla_grad` and `nabla_div`.

ufl_legacy.extract_blocks(form, i=None, j=None)

  UFL form operator: Given a linear or bilinear form on a mixed space, extract the block corresponding to the indices ix, iy.

  ### Example:

  > a = inner(grad(u), grad(v))*dx + div(u)*q*dx + div(v)*p*dx extract_blocks(a, 0, 0) -> inner(grad(u), grad(v))*dx extract_blocks(a) -> [inner(grad(u), grad(v))*dx, div(v)*p*dx, div(u)*q*dx, 0]

ufl_legacy.facet_avg(f)

  UFL operator: Take the average of v over a facet.

ufl_legacy.functional(form)

  UFL form operator: Extract the functional part of form.

ufl_legacy.ge(left, right)

  UFL operator: A boolean expression (left >= right) for use with `conditional`.

ufl_legacy.get_handler()

  Get handler for logging.

ufl_legacy.get_logger()

  Return message logger.

ufl_legacy.grad(f)

  UFL operator: Take the gradient of f.

  This operator follows the grad convention where

  > grad(s)[i] = s.dx(i)

  > grad(v)[i,j] = v[i].dx(j)

  > grad(T)[:,i] = T[:].dx(i)

  for scalar expressions s, vector expressions v, and arbitrary rank tensor expressions T.

  See also: `nabla_grad()`

ufl_legacy.gt(left, right)

  UFL operator: A boolean expression (left > right) for use with `conditional`.

ufl_legacy.imag(f)

  UFL operator: The imaginary part of f

ufl_legacy.indices(n)

  UFL value: Return a tuple of \(n\) new Index objects.

ufl_legacy.inner(a, b)

  UFL operator: Take the inner product of a and b. The complex conjugate of the second argument is taken.

ufl_legacy.integral_types()

  Return a tuple of all domain type strings.

ufl_legacy.inv(A)

  UFL operator: Take the inverse of A.

ufl_legacy.jump(v, n=None)

  UFL operator: Take the jump of v across a facet.

ufl_legacy.le(left, right)

  UFL operator: A boolean expression (left <= right) for use with `conditional`.

ufl_legacy.lhs(form)

  UFL form operator: Given a combined bilinear and linear form, extract the left hand side (bilinear form part).

  ### Example:

  > a = u*v*dx + f*v*dx a = lhs(a) -> u*v*dx

ufl_legacy.ln(f)

  UFL operator: Take the natural logarithm of f.

ufl_legacy.lt(left, right)

  UFL operator: A boolean expression (left < right) for use with `conditional`.

ufl_legacy.max_value(x, y)

  UFL operator: Take the maximum of x and y.

ufl_legacy.min_value(x, y)

  UFL operator: Take the minimum of x and y.

ufl_legacy.nabla_div(f)

  UFL operator: Take the divergence of f.

  This operator follows the div convention where

  > nabla_div(v) = v[i].dx(i)

  > nabla_div(T)[:] = T[i,:].dx(i)

  for vector expressions v, and arbitrary rank tensor expressions T.

  See also: `div()`

ufl_legacy.nabla_grad(f)

  UFL operator: Take the gradient of f.

  This operator follows the grad convention where

  > nabla_grad(s)[i] = s.dx(i)

  > nabla_grad(v)[i,j] = v[j].dx(i)

  > nabla_grad(T)[i,:] = T[:].dx(i)

  for scalar expressions s, vector expressions v, and arbitrary rank tensor expressions T.

  See also: `grad()`

ufl_legacy.ne(left, right)

  UFL operator: A boolean expression (left != right) for use with `conditional`.

ufl_legacy.outer(*operands)

  UFL operator: Take the outer product of two or more operands. The complex conjugate of the first argument is taken.

ufl_legacy.perp(v)

  UFL operator: Take the perp of v, i.e. \((-v_1, +v_0)\).

ufl_legacy.product(sequence)

  Return the product of all elements in a sequence.

ufl_legacy.rank(f)

  UFL operator: The rank of f.

ufl_legacy.real(f)

  UFL operator: The real part of f

ufl_legacy.register_element(family, short_name, value_rank, sobolev_space, mapping, degree_range, cellnames)

  Register new finite element family.

ufl_legacy.register_integral_type(integral_type, measure_name)

ufl_legacy.relabel(A, indexmap)

  UFL operator: Relabel free indices of \(A\) with new indices, using the given mapping.

ufl_legacy.replace(e, mapping)

  Replace subexpressions in expression.

  @param e:

    An Expr or Form.

  @param mapping:

    A dict with from:to replacements to perform.

ufl_legacy.replace_integral_domains(form, common_domain)

  Given a form and a domain, assign a common integration domain to all integrals.

  Does not modify the input form (`Form` should always be immutable). This is to support ill formed forms with no domain specified, sometimes occurring in pydolfin, e.g. assemble(1*dx, mesh=mesh).

ufl_legacy.rhs(form)

  UFL form operator: Given a combined bilinear and linear form, extract the right hand side (negated linear form part).

  ### Example:

  > a = u*v*dx + f*v*dx L = rhs(a) -> -f*v*dx

ufl_legacy.rot(f)

  UFL operator: Take the curl of f.

ufl_legacy.sensitivity_rhs(a, u, L, v)

  UFL form operator: Compute the right hand side for a sensitivity calculation system.

  The derivation behind this computation is as follows. Assume a, L to be bilinear and linear forms corresponding to the assembled linear system

  \[Ax = b.\]

  Where x is the vector of the discrete function corresponding to u. Let v be some scalar variable this equation depends on. Then we can write

  \[ \begin{align}\begin{aligned}0 = \frac{d}{dv}(Ax-b) = \frac{dA}{dv} x + A \frac{dx}{dv} - \frac{db}{dv},\\A \frac{dx}{dv} = \frac{db}{dv} - \frac{dA}{dv} x,\end{aligned}\end{align} \]

  and solve this system for \(\frac{dx}{dv}\), using the same bilinear form a and matrix A from the original system. Assume the forms are written

      v = variable(v_expression)
      L = IL(v)*dx
      a = Ia(v)*dx

  where `IL` and `Ia` are integrand expressions. Define a `Coefficient u` representing the solution to the equations. Then we can compute \(\frac{db}{dv}\) and \(\frac{dA}{dv}\) from the forms

      da = diff(a, v)
      dL = diff(L, v)

  and the action of `da` on `u` by

      dau = action(da, u)

  In total, we can build the right hand side of the system to compute \(\frac{du}{dv}\) with the single line

      dL = diff(L, v) - action(diff(a, v), u)

  or, using this function,

      dL = sensitivity_rhs(a, u, L, v)

ufl_legacy.set_handler(handler)

  Replace handler for logging. To add additional handlers instead of replacing the existing one, use log.get_logger().addHandler(myhandler). See the logging module for more details.

ufl_legacy.set_level(level)

  Set log level.

ufl_legacy.shape(f)

  UFL operator: The shape of f.

ufl_legacy.show_elements()

  Shows all registered elements.

ufl_legacy.sign(x)

  UFL operator: Take the sign (+1 or -1) of x.

ufl_legacy.sin(f)

  UFL operator: Take the sine of f.

ufl_legacy.sinh(f)

  UFL operator: Take the hyperbolic sine of f.

ufl_legacy.skew(A)

  UFL operator: Take the skew symmetric part of A.

ufl_legacy.split(v)

  UFL operator: If v is a Coefficient or Argument in a mixed space, returns a tuple with the function components corresponding to the subelements.

ufl_legacy.sqrt(f)

  UFL operator: Take the square root of f.

ufl_legacy.sym(A)

  UFL operator: Take the symmetric part of A.

ufl_legacy.system(form)

  UFL form operator: Split a form into the left hand side and right hand side, see `lhs` and `rhs`.

ufl_legacy.tan(f)

  UFL operator: Take the tangent of f.

ufl_legacy.tanh(f)

  UFL operator: Take the hyperbolic tangent of f.

ufl_legacy.tr(A)

  UFL operator: Take the trace of A.

ufl_legacy.transpose(A)

  UFL operator: Take the transposed of tensor A.

ufl_legacy.unit_matrices(d)

  UFL value: A tuple of constant unit matrices in all directions with dimension d.

ufl_legacy.unit_matrix(i, j, d)

  UFL value: A constant unit matrix in direction i,*j* with dimension d.

ufl_legacy.unit_vector(i, d)

  UFL value: A constant unit vector in direction i with dimension d.

ufl_legacy.unit_vectors(d)

  UFL value: A tuple of constant unit vectors in all directions with dimension d.

ufl_legacy.variable(e)

  UFL operator: Define a variable representing the given expression, see also `diff()`.

ufl_legacy.zero(*shape)

  UFL literal constant: Return a zero tensor with the given shape.