[petsc-users] DMPlexProjectFunction and Boundary Conditions

Dharmendar Reddy dharmareddy84 at gmail.com
Wed Apr 3 07:04:21 CDT 2013


Hello,
        I see that in DMPlexComputeResidualFEM boundary conditions are
applied using DMPlexProjectFunctionLocal. I was wondering why is there a
loop over all local vertex Ids and a call to
evaluation function on line 241 below. If i am not wrong, i can see that
VecSetValuesSection is only to the points indicated as boundary points in
DMPlexCreatSection.  Should one call lines 235:242 only if v is constrained
node ? Also, should the user provide functions for all components of all
fields, is there a way to update add value of only the field that is
constrained ?

234:   for (v = vStart; v < vEnd; ++v) {235:     PetscInt
<http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/Sys/PetscInt.html#PetscInt>
dof, off;
237:     PetscSectionGetDof
<http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/IS/PetscSectionGetDof.html#PetscSectionGetDof>(cSection,
v, &dof);238:     PetscSectionGetOffset
<http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/IS/PetscSectionGetOffset.html#PetscSectionGetOffset>(cSection,
v, &off);239:     if (dof > dim) SETERRQ2
<http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/Sys/SETERRQ2.html#SETERRQ2>(PetscObjectComm
<http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/Sys/PetscObjectComm.html#PetscObjectComm>((PetscObject
<http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/Sys/PetscObject.html#PetscObject>)dm),
PETSC_ERR_ARG_WRONG, "Cannot have more coordinates %d then dimensions
%d", dof, dim);240:     for (d = 0; d < dof; ++d) coords[d] =
PetscRealPart(cArray[off+d]);241:     for (c = 0; c < numComp; ++c)
values[c] = (*funcs[c])(coords);242:     VecSetValuesSection
<http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/Vec/VecSetValuesSection.html#VecSetValuesSection>(localX,
section, v, values, mode);243:   }


-- 
-----------------------------------------------------
Dharmendar Reddy Palle
Graduate Student
Microelectronics Research center,
University of Texas at Austin,
10100 Burnet Road, Bldg. 160
MER 2.608F, TX 78758-4445
e-mail: dharmareddy84 at gmail.com
Phone: +1-512-350-9082
United States of America.
Homepage: https://webspace.utexas.edu/~dpr342
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130403/a7fd1f7a/attachment.html>


More information about the petsc-users mailing list