<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Apr 20, 2014 at 4:17 PM, Miguel Angel Salazar de Troya <span dir="ltr"><<a href="mailto:salazardetroya@gmail.com" target="_blank">salazardetroya@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><p dir="ltr">I understand. So if we had a linear elastic material, the weak form would be something like </p>
<p dir="ltr">phi_{i,j} C_{ijkl} u_{k,l}</p><p dir="ltr">where the term C_{ijkl} u_{k,l} would correspond to the term f_1(U, gradient_U) in equation (1) in your paper I mentioned above, and g_3 would be C_{ijkl}. Therefore the indices {i,j} would be equivalent to the indices "ic, id" you mentioned before and "jc" and "jd" would be {k,l}? </p>
<p>For <span style="font-family:arial,sans-serif;font-size:13px">g3[ic, id, jc, jd]</span>, transforming the four dimensional array to linear memory would be like this:</p><p>g3[((<span style="font-family:arial,sans-serif;font-size:13px">ic</span>*Ncomp+<span style="font-family:arial,sans-serif;font-size:13px">id</span>)*dim+<span style="font-family:arial,sans-serif;font-size:13px">jc</span>)*dim+<span style="font-family:arial,sans-serif;font-size:13px">jd</span>] = 1.0;<br>
</p><p>where Ncomp and dim are equal to the problem's spatial dimension.</p><p>However, in the code, there are only two loops, to exploit the symmetry of the fourth order identity tensor:</p><p></p><div style="font-family:arial,sans-serif;font-size:13px">
for (compI = 0; compI < Ncomp; ++compI) {</div><div style="font-family:arial,sans-serif;font-size:13px"> for (d = 0; d < dim; ++d) {</div><div style="font-family:arial,sans-serif;font-size:13px"> g3[((compI*Ncomp+compI)*dim+d)*dim+d] = 1.0;</div>
<div style="font-family:arial,sans-serif;font-size:13px"> }</div><div style="font-family:arial,sans-serif;font-size:13px"> }</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">
Therefore the tensor entries that are set to one are:</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">g3[0,0,0,0]</div><div style="font-family:arial,sans-serif;font-size:13px">
g3[1,1,0,0]</div><div style="font-family:arial,sans-serif;font-size:13px">g3[0,0,1,1]</div><div style="font-family:arial,sans-serif;font-size:13px">g3[1,1,1,1]</div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px">This would be equivalent to the fourth order tensor \delta_{ij} \delta_{kl}, but I think the one we need is \delta_{ik} \delta_{jl}, because it is the derivative of a matrix with respect itself (or the derivative of a gradient with respect to itself). This is assuming the indices of g3 correspond to what I said. </div>
</div></blockquote><div><br></div><div>I made an error explaining g3, which is indexed</div><div><br></div><div> g3[ic, jc, id, jd]</div><div><br></div><div>I thought this might be better since, it is composed of dim x dim blocks. I am not opposed to changing</div>
<div>this if there is evidence that another thing is better.</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr">
<p></p><p>Thanks in advance.</p><p>Miguel</p><p><br></p>
<div class="gmail_quote">On Apr 19, 2014 6:19 PM, "Matthew Knepley" <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, Apr 19, 2014 at 5:25 PM, Miguel Angel Salazar de Troya <span dir="ltr"><<a href="mailto:salazardetroya@gmail.com" target="_blank">salazardetroya@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Thanks for your response. Now I understand a bit better your implementation, but I am still confused. Is the g3 function equivalent to the f_{1,1} function in the matrix in equation (3) in this paper: <a href="http://arxiv.org/pdf/1309.1204v2.pdf" target="_blank">http://arxiv.org/pdf/1309.1204v2.pdf</a> ? If so, why would it have terms that depend on the trial fields? I think this is what is confusing me.</div>
</blockquote><div><br></div><div>Yes, it is. It has no terms that depend on the trial fields. It is just indexed by the number of components in that field. It is</div><div>a continuum thing, which has nothing to do with the discretization. That is why it acts pointwise.</div>
<div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="gmail_extra">
<div class="gmail_quote">On Sat, Apr 19, 2014 at 11:35 AM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">
<div>On Fri, Apr 18, 2014 at 1:23 PM, Miguel Angel Salazar de Troya <span dir="ltr"><<a href="mailto:salazardetroya@gmail.com" target="_blank">salazardetroya@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hello everybody.<div><br></div><div>First, I am taking this example from the petsc-dev version, I am not sure if I should have posted this in another mail-list, if so, my apologies. </div>
<div><br></div><div>
In this example, for the elasticity case, function g3 is built as:</div><div><br></div><div><div>void g3_elas(const PetscScalar u[], const PetscScalar gradU[], const PetscScalar a[], const PetscScalar gradA[], const PetscReal x[], PetscScalar g3[])</div>
<div>{</div><div> const PetscInt dim = spatialDim;</div><div> const PetscInt Ncomp = spatialDim;</div><div> PetscInt compI, d;</div><div><br></div><div> for (compI = 0; compI < Ncomp; ++compI) {</div><div>
for (d = 0; d < dim; ++d) {</div>
<div> g3[((compI*Ncomp+compI)*dim+d)*dim+d] = 1.0;</div><div> }</div><div> }</div><div>}</div><div><br></div><div>Therefore, a fourth-order tensor is represented as a vector. I was checking the indices for different iterator values, and they do not seem to match the vectorization that I have in mind. For a two dimensional case, the indices for which the value is set as 1 are:</div>
<div><br></div><div>compI = 0 , d = 0 -----> index = 0</div><div>compI = 0 , d = 1 -----> index = 3<br></div><div>compI = 1 , d = 0 -----> index = 12<br></div><div>
compI = 1 , d = 1 -----> index = 15<br></div><div><br></div><div>The values for the first and last seem correct to me, but they other two are confusing me. I see that this elasticity tensor (which is the derivative of the gradient by itself in this case) would be a four by four identity matrix in its matrix representation, so the indices in between would be 5 and 10 instead of 3 and 12, if we put one column on top of each other. </div>
</div></div></blockquote><div><br></div></div><div>I have read this a few times, but I cannot understand that you are asking. The simplest thing I can</div><div>respond is that we are indexing a row-major array, using the indices:</div>
<div><br></div><div> g3[ic, id, jc, jd]</div><div><br></div><div>where ic indexes the components of the trial field, id indexes the derivative components,</div><div>jc indexes the basis field components, and jd its derivative components.</div>
<div><br></div><div> Matt</div><div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">
<div><div>I guess my question is then, how did you vectorize the fourth order tensor? </div>
<div><br></div><div>Thanks in advance</div><span><font color="#888888"><div>Miguel</div><div><br></div>-- <br><div dir="ltr">
<font face="verdana, sans-serif"><b>Miguel Angel Salazar de Troya</b></font><span><font color="#888888"><br><font face="arial,helvetica,sans-serif">Graduate Research Assistant<br>Department of Mechanical Science and Engineering<br>
</font>University of Illinois at Urbana-Champaign<br><a href="tel:%28217%29%20550-2360" value="+12175502360" target="_blank">(217) 550-2360</a><br>
<a href="mailto:salaza11@illinois.edu" target="_blank">salaza11@illinois.edu</a></font></span><div><br></div></div>
</font></span></div></div>
</blockquote></div></div><span><font color="#888888"><br><br clear="all"><span><font color="#888888"><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
</font></span></font></span></div></div><span><font color="#888888">
</font></span></blockquote></div><span><font color="#888888"><br><br clear="all"><span class=""><font color="#888888"><div><br></div>-- <br><div dir="ltr"><font face="verdana, sans-serif"><b>Miguel Angel Salazar de Troya</b></font><span><font color="#888888"><br>
<font face="arial,helvetica,sans-serif">Graduate Research Assistant<br>
Department of Mechanical Science and Engineering<br></font>University of Illinois at Urbana-Champaign<br><a href="tel:%28217%29%20550-2360" value="+12175502360" target="_blank">(217) 550-2360</a><br>
<a href="mailto:salaza11@illinois.edu" target="_blank">salaza11@illinois.edu</a></font></span><div><br></div></div>
</font></span></font></span></div><span class=""><font color="#888888">
</font></span></blockquote></div><span class=""><font color="#888888"><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
</font></span></div></div>
</blockquote></div>
</div>
</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>