[petsc-users] different periodicity per dof in DMDA?

Matteo Semplice matteo.semplice at uninsubria.it
Mon May 2 11:22:55 CDT 2022

```Thanks!

On 02/05/2022 18:07, Matthew Knepley wrote:
> On Mon, May 2, 2022 at 11:25 AM Matteo Semplice
> <matteo.semplice at uninsubria.it> wrote:
>
>     Hi.
>
>     I am facing a PDE with 2 dofs per node in which one dof has periodic
>     b.c. in the x direction and the other one periodic b.c. in the y
>     direction. Is there a (possibly quick-and-dirty) solution to
>     represent
>     this in a DM (not necessarily a DMDA)?
>
>
> I am trying to understand what this means.

It comes from a toy model for more complicated quantum field theory
model that's hard for me to understand.

> Usually we think of periodicity as arising from the domain, not the field.
>
> I think it would be easiest to:
>
>   a) Use two different DMDA for the fields that "match up" where needed
>
This is kind of what I was thinking at. So I would create two DMDA, then
a DMComposite with the two and finally create Vecs and Matrices from the
DMComposite?

If so, then how do I assemble matrices for linear systems? If I extract
submatrices, I could use MatSetValuesStencil on diagonal blocks, but how
about the off-diagonal ones? These latter would have rows/cols indexed
by different DMDAs.

Matteo

> or
>
>   b) Use a DMStag since it sounds like these should live on horizontal
> and vertical edges
>
>   Thanks,
>
>      Matt
>
>     I understand the request it's strange, but I should add that we are
>     experimenting numerically with this toy model, so in fact the b.c.
>     may
>     change in the future... just to stress once more that I am not
>     after a
>     perfect solution, but anything that would at least allow parallel
>     runs
>     with few processors would do for now.
>
>
>          Matteo
>
>
>
> --
> What most experimenters take for granted before they begin their
> experiments is infinitely more interesting than any results to which
> -- Norbert Wiener
>
> https://www.cse.buffalo.edu/~knepley/

--
Prof. Matteo Semplice
Università degli Studi dell’Insubria
Dipartimento di Scienza e Alta Tecnologia – DiSAT
Professore Associato
Via Valleggio, 11 – 22100 Como (CO) – Italia
tel.: +39 031 2386316
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20220502/a8b9b082/attachment.html>
```