[petsc-users] question
Barry Smith
bsmith at petsc.dev
Thu Apr 7 10:10:20 CDT 2022
DMStag may also be useful for your needs (and far simpler to use than DMPLEX) depending on where your Lagrange multipliers live. Note that regardless you should not need to be copying entire large submatrices around into bigger matrices; you can build the entire system in-place in one big matrix. MatNest is also a possibility depending on exactly what you are doing.
If you explain what your Lagrange multipliers are (the constraints) we may be able to make more specific suggestions.
Barry
> On Apr 7, 2022, at 8:26 AM, Matthew Knepley <knepley at gmail.com> wrote:
>
> On Thu, Apr 7, 2022 at 8:16 AM 高亚贺 via petsc-users <petsc-users at mcs.anl.gov <mailto:petsc-users at mcs.anl.gov>> wrote:
>
> Dear Mr./Ms.,
>
>
>
> I have used ‘DMCreateMatrix’ to create a matrix K, and also the ‘DMCreateGlobalVector’ to create two vectors U (to be solved) and F (right-hand side), i.e. KU=F. Now, I want to add some complex constraints to this system through lagrangian multiplier method, and the constraint matrix is Q. The KU=F transforms to
>
> <1649328463919.png>
>
> How to create Kλ, and how to effectively copy values K and Q to Kλ? Does the newly created Kλ and Fλ still have an advantage of DMDA? Or do you have any other good suggestions for this kind of problem?
>
>
> DMDA can only really handle collocated discretizations, meaning all fields sit on the vertices. If you can discretize your problem this way, then just give it two fields and assemble K_\lambda as normal. If not, then you might look at DMPlex which supports a wider range of discretizations.
>
> Thanks,
>
> Matt
>
> Thank you very much!
>
>
>
> Best regards,
>
> A PETSc user
>
>
>
> --
> What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
> -- Norbert Wiener
>
> https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20220407/7ce7296c/attachment.html>
More information about the petsc-users
mailing list