[petsc-dev] finite element energy functions

Jed Brown jedbrown at mcs.anl.gov
Mon Dec 2 16:29:35 CST 2013


Geoffrey Irving <irving at naml.us> writes:

> For weak form PDEs which arise as the gradient of an integrated energy
> function, it would be great to have a routine to perform the
> appropriate integral.  It would be best to structure this as a generic
> "perform an integral" function, evaluating
>
>     E(f) = sum_i w_i f(u(x_i), grad u(x_i))

There is a SNES interface for quadratic functionals, SNESSetObjective(),
and it has been plumbed down to DMDASNESSetObjectiveLocal(), but there
is no DMSNESSetObjectiveLocal.  I would add that, and a
DMPlexComputeResidualFEM().

Actually, I would have made DMPlexSNESSetFunctionFEM() and now
DMPlexSNESSetObjectiveFEM(), which configures the SNES appropriately,
rather than calling SNES methods and passing in pointers to library
functions.  All the other DMs work this way.  Matt, why did you do it
differently with DMPlex?

> for a set of FE fields u (plus auxiliary fields) and some quadrature
> rule.  The quadrature rule might need to be passed in independently of
> the PetscFE objects, since the integral might tie together several
> different fields connected to several different PetscFE's, conceivably
> with distinct quadrature rules.  The integral is only valid as a
> discrete energy if all the quadrature rules match, but there might be
> other integral application where this doesn't hold.

How is any of this different from evaluating residuals?  Each element
computes a scalar now, all of which are summed together, but otherwise I
think it's the same mechanics.

> Relatedly, how does one ensure that a PetscFE object is Galerkin
> (matching primal and dual spaces) so that the energy to be discretely
> valid?  

How does one ensure that the weak form itself is symmetric and how do
you ensure that it is not indefinite (like a saddle; the Lagrangian is
not the energy)?  We can do consistency checks, like verifying that the
provided residual function is the gradient of the objective (energy).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20131202/87eecea8/attachment.sig>


More information about the petsc-dev mailing list