[petsc-users] DMPlex with spring elements

Abhyankar, Shrirang G. abhyshr at mcs.anl.gov
Fri Sep 26 10:24:53 CDT 2014


DMNetwork does not have the functionality to constraint a dof. The user
has to do it by specifying the constraint equation. As Jed suggested, you
could simply not set any values in the rows/columns (except the diagonal)
corresponding to the constrained dof in the Jacobian evaluation to keep
the matrix symmetric.

Shri

From:  Matthew Knepley <knepley at gmail.com>
Date:  Thu, 25 Sep 2014 17:17:52 -0500
To:  Miguel Angel Salazar de Troya <salazardetroya at gmail.com>
Cc:  Jed Brown <jed at jedbrown.org>, Shri <abhyshr at mcs.anl.gov>,
"petsc-users at mcs.anl.gov" <petsc-users at mcs.anl.gov>
Subject:  Re: [petsc-users] DMPlex with spring elements


>On Thu, Sep 25, 2014 at 5:15 PM, Miguel Angel Salazar de Troya
><salazardetroya at gmail.com> wrote:
>
>> If you need a symmetric Jacobian, you can use the BC facility in
>> PetscSection, which eliminates the
>> variables completely. This is how the FEM examples, like ex12, work.
>Would that be with PetscSectionSetConstraintDof ? For that I will need
>the PetscSection, DofSection, within DMNetwork, how can I obtain it? I
>could cast it to DM_Network from the dm, networkdm,  declared in the main
>program, maybe something like this:
>DM_Network     *network = (DM_Network*) networkdm->data;Then I would loop
>over the vertices and call PetscSectionSetConstraintDof if it's a
>boundary node (by checking the corresponding component)
>
>
>
>
>I admit to not completely understanding DMNetwork. However, it eventually
>builds a PetscSection for data layout, which
>you could get from DMGetDefaultSection(). The right thing to do is find
>where it builds the Section, and put in your BC
>there, but that sounds like it would entail coding.
>
>  Thanks,
>
>     Matt
> 
>
>Thanks for your responses.Miguel
>
>
>On Thu, Sep 25, 2014 at 2:42 PM, Jed Brown <jed at jedbrown.org> wrote:
>
>Matthew Knepley <knepley at gmail.com> writes:
>
>> On Thu, Sep 25, 2014 at 1:46 PM, Abhyankar, Shrirang G.
>><abhyshr at mcs.anl.gov
>>> wrote:
>>
>>> You are right. The Jacobian for the power grid application is indeed
>>> non-symmetric. Is that a problem for your application?
>>>
>>
>> If you need a symmetric Jacobian, you can use the BC facility in
>> PetscSection, which eliminates the
>> variables completely. This is how the FEM examples, like ex12, work.
>
>You can also use MatZeroRowsColumns() or do the equivalent
>transformation during assembly (my preference).
>
>
>
>
>
>
>-- 
>Miguel Angel Salazar de Troya
>Graduate Research Assistant
>Department of Mechanical Science and Engineering
>University of Illinois at Urbana-Champaign
>(217) 550-2360 <tel:%28217%29%20550-2360>
>salaza11 at illinois.edu
>
>
>
>
>
>
>
>
>
>
>-- 
>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



More information about the petsc-users mailing list