<div dir="ltr">I don't think that will work. Offsets refer to the graph storage.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 17, 2019 at 7:59 PM Josh L via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I have a DM that has 2 fields , and field #1 has 2 dofs and field #2 has 1 dof.</div><div>I only have dofs on vertex. </div><div><br></div><div>Can I use the following to assemble global stiffness matrix instead of using MatSetClosure(I am not integrating 2 field separately) </div><div><br></div><div>DMGetGlobalSection(dm,GlobalSection)</div><div>For cells</div><div> calculate element stiffness matrix eleMat</div><div> For vertex in cells </div><div> PetscSectionGetOffset(GlobalSection, vertex, offset)</div><div> loc=[offset_v1, offset_v1+1, offset_v1+2, offset_v2, offset_v2+1.......]</div><div> End </div><div> MatSetValues(GlobalMat, n,loc,n,loc, eleMat, ADD_VALUES)</div><div>End</div><div>AssemblyBegin and End. </div><div><br></div><div>Basically use the offset from global section to have the global dof number.</div><div><br></div><div>Thanks,</div><div>Josh</div><div><br></div><div><br></div></div>
</blockquote></div>