Matthew Knepley <[email protected]> writes: >> DMPlexSNESSetFunctionFEM(), similar to DMDASNESSetFunctionLocal in >> src/snes/examples/tutorials/ex5.c and ex19.c. >> > > What exactly is the difference?
You have this badly-namespaced, nebulous function called DMPlexComputeResidualFEM that the user has to pass to DMSNESSetFunctionLocal and that has to contain a PetscFEM as its first element. That is grotesque, and binding it from Fortran is needlessly messy. Meanwhile, the other function would have an interface something like DMPlexSNESSetFunctionFEM(DM,PetscFEM); Note that I would like to get rid of the ugly public struct PetscFEM, and replace it with a functional interface. In that case, if you unified the fs and gs, you could have DMPlexSNESSetFunctionFEM(DM,PetscErrorCode (*f)(...),void *ctx); DMPlexSNESSetJacobianFEM(DM,PetscErrorCode (*g)(...),void *ctx); If we want to implicitly sum over multiple functions, the above can be replaced by arrays of functions, each of which adds some group of terms. If you do that, there could be a slot for functions computing intermediate terms (material models), and so on. Eventually, there will probably need to be another object to manage the dispatch, because we need the same thing for finite volume and non-Plex things, but I would try to keep that object private.
pgp_RTsFBctdm.pgp
Description: PGP signature
