[petsc-users] DMPlexMatSetClosure for non connected points in DM

Ashish Patel ashish.patel at onscale.com
Tue Oct 6 16:28:27 CDT 2020


Its inherent, physical problem for this particular case is a rigid body
(whose dof is represented using a reference point) attached to a deformable
body along an interface (hence many faces). The sparsity pattern for a
deformable body follows the traditional FEM sparsity pattern. So I need to
supplement that sparsity pattern to account for the constraint off diagonal
terms. I am doing it currently after DMCreateMatrix via call to
MatSetValues but that's of course not ideal. I also tried doing it by first
calling  DMSetMatrixPreallocateOnly but that caused problems later on as
probably the number of new values exceeded the preallocated limit for that
row. If you have some additional pointers that would be really helpful.

Thanks
Ashish

On Tue, Oct 6, 2020 at 1:59 PM Matthew Knepley <knepley at gmail.com> wrote:

> On Tue, Oct 6, 2020 at 4:08 PM Ashish Patel <ashish.patel at onscale.com>
> wrote:
>
>> Hi Matt,
>>
>> Yes I do create the section myself. There are many faces which are
>> constrained by a single reference point. So even if I create an extra dof
>> at one of the faces I would have to get access to rows/columns of other
>> distant faces which does not exist in the adjacency relationship.
>>
>
> Okay, so these dogs do not obey the FEM sparsity pattern. Is it inherent
> to the method, or do you just do this for convenience? It might
> be easier to constrain one face at a time, but I would need to understand
> more. If you cannot do that, you would also have to override
> the sparsity pattern. I can easily give you a hook to do this if you want.
>
>   Thanks,
>
>     Matt
>
>
>> Thanks
>> Ashish
>>
>> On Tue, Oct 6, 2020 at 12:47 PM Matthew Knepley <knepley at gmail.com>
>> wrote:
>>
>>> On Fri, Oct 2, 2020 at 7:16 PM Ashish Patel <ashish.patel at onscale.com>
>>> wrote:
>>>
>>>> Dear PETSc users,
>>>>
>>>> I am trying to assemble a matrix for a finite element problem where the
>>>> degree of freedom (dof) on a surface is constrained via a reference node
>>>> which also exists in the DM but is not connected  with any other point in
>>>> the mesh. To apply the constraint I want to be able to set matrix values in
>>>> the rows belonging to dofs of reference nodes and columns belonging to dofs
>>>> of surface nodes and vice versa. But since the two points are not connected
>>>> topologically I cannot just use DMPlexMatSetClosure to do that. I am
>>>> currently trying to use DMPlexAddConeSize on all the constrained surface
>>>> points followed by a call to DMPlexInsertCone wherein I add the reference
>>>> node to the cone of surface point before setting up the PetscSection. Is
>>>> this the right approach?
>>>>
>>>
>>> No. You are changing the topology, which is not what you want I think. I
>>> think you just want to associate extra dof with the face. You can
>>> do this by just altering the PetscSection you use. Do you create the
>>> Section yourself now?
>>>
>>>   Thanks,
>>>
>>>     Matt
>>>
>>>
>>>> I am currently getting following message
>>>>
>>>> New nonzero at (8952,28311) caused a malloc
>>>> Use MatSetOption(A, MAT_NEW_NONZERO_ALLOCATION_ERR, PETSC_FALSE) to
>>>> turn off this check
>>>>
>>>> I could set the suggested option to get rid of the error but was
>>>> wondering if I am missing something.
>>>>
>>>> Thanks
>>>> Ashish
>>>>
>>>
>>>
>>> --
>>> 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/>
>>>
>>
>
> --
> 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/20201006/d67fd2c0/attachment.html>


More information about the petsc-users mailing list