def energy_norm(form, coefficient=None): """UFL form operator: Given a bilinear form *a* and a coefficient *f*, return the functional :math:`a(f,f)`.""" form = as_form(form) form = expand_derivatives(form) return compute_energy_norm(form, coefficient)
def energy_norm(form, coefficient=None): """UFL form operator: Given a bilinear form *a* and a coefficient *f*, return the functional :math:`a(f,f)`.""" form = as_form(form) form = expand_derivatives(form) return compute_energy_norm(form, coefficient)
def 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.""" form = as_form(form) form = expand_derivatives(form) return compute_form_action(form, coefficient)
def 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.""" form = as_form(form) form = expand_derivatives(form) return compute_form_action(form, coefficient)
def 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 """ form = as_form(form) form = expand_derivatives(form) return compute_form_rhs(form)
def 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 """ form = as_form(form) form = expand_derivatives(form) return compute_form_lhs(form)
def 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. 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). """ form = as_form(form) form = expand_derivatives(form) return compute_form_adjoint(form, reordered_arguments)
def 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 """ form = as_form(form) form = expand_derivatives(form) return compute_form_rhs(form)
def 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 """ form = as_form(form) form = expand_derivatives(form) return compute_form_lhs(form)
def 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). """ form = as_form(form) form = expand_derivatives(form) return compute_form_adjoint(form, reordered_arguments)
def functional(form): # TODO: Does this make sense for anything other than testing? "UFL form operator: Extract the functional part of form." form = as_form(form) form = expand_derivatives(form) return compute_form_functional(form)
def functional(form): # TODO: Does this make sense for anything other than testing? "UFL form operator: Extract the functional part of form." form = as_form(form) form = expand_derivatives(form) return compute_form_functional(form)