[petsc-dev] finite element energy functions

Geoffrey Irving irving at naml.us
Mon Dec 2 16:43:10 CST 2013


On Mon, Dec 2, 2013 at 2:29 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
> 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.

Yep, that's the difference.  I never said it was difficult. :)

>> Relatedly, how does one ensure that a PetscFE object is Galerkin
>> (matching primal and dual spaces) so that the energy is 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).

I'm not sure what you mean by the weak form being symmetric, unless
you mean that the primal and dual spaces are the same, which is just a
restatement of my question (and therefore I'm not sure in the context
of petsc).  The actual functional in the weak form PDE isn't symmetric
except in special cases such as Poisson,  but presumably that's not
what you mean.  Indefiniteness is somewhat inevitable (except near
well behaved extreme solutions), and where it occurs depends on
physics.  And yes, consistency checks are great, not least as a check
that the residual is computing something reasonable.

Geoffrey



More information about the petsc-dev mailing list