<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Feb 3, 2014 at 5:29 PM, Dharmendar Reddy <span dir="ltr"><<a href="mailto:dharmareddy84@gmail.com" target="_blank">dharmareddy84@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
I am trying to understand the layout of the values array<br>
argument of the DMPLexVecSetClosure.<br>
<br>
Consider a triangular element with two fields at each node, say n, p<br>
vertices : v1,v2,v3<br>
If the value of fields in the local vector : n1,p1, n2, p2, n3, p3<br>
<br>
If the equation set is: F(n,p) = 0 and G(n,p) = 0<br>
<br>
if the values of F and G evaluated at v1,v2, v3 are F1,F2,F3 and<br>
G1,G2G3 respectively.<br>
<br>
Then the elemVec that goes into DMPLexVecSetClosure is:<br>
<br>
elemVec = { F1,F2,F3,G1G2,G3} is that correct ?<br>
<br>
Now, i am looking for some functionality which will let me access the<br>
following mapping information, (local dof id)?<br>
<br>
what is the Local Dof Id , i.e, the position in elemVec given the<br>
field id, component id and basis id (or node id for the case of P1<br>
Lagrange ?)<br>
<br>
<br>
The usage will be like this:<br></blockquote><div><br></div><div>If, as in this case, the fields have the same element, its just normal</div><div>array ordering:</div><div><br></div><div> (f, b, c) = (f*numBasis + b)*numComponents + c</div>
<div><br></div><div>In general, all field values are stacked together, and ordered by</div><div>basis vec and then component.</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
do fid=1,numField<br>
numBasis = getNumBasis(fid)<br>
numComponent = getNumComponent(fid)<br>
do bid=1,numBasis<br>
do cid =1,numCompoent<br>
localId = getLocalDofId( fid, bid, cid)<br>
elemResVec(localId) = residual value<br>
end do<br>
end do<br>
enddo<br>
<br>
call DMPlexVecSetClosure(dm,section,localResVec,cellId,elemResVec,ADD_VALUES,ierr)<br>
<br>
Thanks<br>
<span class="HOEnZb"><font color="#888888">Reddy<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener
</div></div>