<div dir="ltr">Thanks. Once I have marked the nodes that are fixed nodes using the component data structure, how can I process it later? I mean, at what point does the solver know that those degrees of freedom are actually fixed and how I can tell it that they are fixed?<div><br></div><div>Miguel</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 25, 2014 at 10:27 AM, Abhyankar, Shrirang G. <span dir="ltr"><<a href="mailto:abhyshr@mcs.anl.gov" target="_blank">abhyshr@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
<br>
>Thanks. I think the term "Component" was confusing me, I thought it was<br>
>related to the components of a field. I think this would be useful to me<br>
>if I wanted to assign coordinates to the vertices, wouldn't it?<br>
<br>
</span>Yes. You can put whatever data you want in the component data structure.<br>
<span class=""><br>
><br>
>Also, I was wondering how to set up dirichlet boundary conditions,<br>
>basically fixing certain nodes position.<br>
><br>
<br>
><br>
><br>
</span>You can add a component at each node with a field marking whether the node<br>
is a boundary node.<br>
<span class=""><br>
>Could I do it as the function SetInitialValues does it in the pflow<br>
>example?<br>
><br>
<br>
</span>No. You need to put in the component data structure before calling<br>
DMNetworkAddComponent()<br>
<span class=""><br>
<br>
>These values are used to eliminate the zeroth-order energy modes of the<br>
>stiffness matrix?<br>
><br>
<br>
<br>
><br>
>Last question, in my case I have two degrees of freedom per node, when I<br>
>grab the offset with DMNetworkVariableOffset, that's for the first degree<br>
>of freedom in that node and the second degree of freedom would just be<br>
>offset+1?<br>
><br>
<br>
</span>Yes.<br>
<br>
Shri<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
>Miguel<br>
><br>
><br>
>On Wed, Sep 24, 2014 at 9:52 PM, Abhyankar, Shrirang G.<br>
><<a href="mailto:abhyshr@mcs.anl.gov">abhyshr@mcs.anl.gov</a>> wrote:<br>
><br>
>If you have equations only at the nodes, with a part of it contributed by<br>
>the edges (springs), then you can use DMNetwork. If you are planning to<br>
>have equations for the beads in the future, or other higher layers, then<br>
>DMPlex has better functionality<br>
> to manage that.<br>
><br>
>Shri<br>
><br>
><br>
>From: Miguel Angel Salazar de Troya <<a href="mailto:salazardetroya@gmail.com">salazardetroya@gmail.com</a>><br>
>Date: Wed, 24 Sep 2014 17:38:11 -0500<br>
>To: Shri <<a href="mailto:abhyshr@mcs.anl.gov">abhyshr@mcs.anl.gov</a>><br>
>Cc: "<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>" <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>><br>
>Subject: Re: [petsc-users] DMPlex with spring elements<br>
><br>
><br>
><br>
><br>
><br>
>Thanks for your response. I'm attaching a pdf with a description of the<br>
>model. The description of the PetscSection is necessary for the<br>
>DMNetwork? It looks like DMNetwork does not use a PetscSection.<br>
><br>
><br>
><br>
><br>
><br>
><br>
>Miguel<br>
><br>
><br>
>On Wed, Sep 24, 2014 at 1:43 PM, Abhyankar, Shrirang G.<br>
><<a href="mailto:abhyshr@mcs.anl.gov">abhyshr@mcs.anl.gov</a>> wrote:<br>
><br>
><br>
>>Thanks for your response. My discretization is based on spring elements.<br>
>>For the linear one dimensional case in which each spring has a<br>
>>coefficient k, their jacobian would be this two by two matrix.<br>
>>[ k -k ]<br>
>>[ -k k ]<br>
>><br>
>>and the internal force<br>
>><br>
>>[ k ( Ui - Uj) ]<br>
>>[ k ( Uj - Ui) ]<br>
>><br>
>>where Ui and Uj are the node displacements (just one displacement per<br>
>>node because it's one dimensional)<br>
>><br>
>>For the two dimensional case, assuming small deformations, we have a<br>
>>four-by-four matrix. Each node has two degrees of freedom. We obtain it<br>
>>by performing the outer product of the vector (t , -t) where "t" is the<br>
>>vector that connects both nodes in a spring. This is for the case of<br>
>>small deformations. I would need to assemble each spring contribution to<br>
>>the jacobian and the residual like they were finite elements. The springs<br>
>>share nodes, that's how they are connected. This example is just the<br>
>>linear case, I will have to implement a nonlinear case in a similar<br>
>>fashion.<br>
>><br>
>>Seeing the DMNetwork example, I think it's what I need, although I don't<br>
>>know much of power electric grids and it's hard for me to understand<br>
>>what's going on. Do you have a good reference to be able to follow the<br>
>>code?<br>
><br>
>><br>
>Please see the attached document which has more description of DMNetwork<br>
>and the equations for the power grid example. I don't have anything that<br>
>describes how the power grid example is implemented.<br>
><br>
>>For example, why are they adding components to the edges?<br>
>><br>
>>475: DMNetworkAddComponent<br>
>><<a href="http://www.mcs.anl.gov/petsc/petsc-as/petsc-current/docs/manualpages/DM/" target="_blank">http://www.mcs.anl.gov/petsc/petsc-as/petsc-current/docs/manualpages/DM/</a><br>
>>D<br>
>>MNetworkAddComponent.html#DMNetworkAddComponent>(networkdm,i,componentkey<br>
>>[<br>
>>0],&pfdata.branch[i-eStart]);Miguel<br>
><br>
>Each edge or node can have several components (limited to 10) attached to<br>
>it. The term components, taken from the circuit terminology, refers to the<br>
>elements of a network. For example, a component could be a resistor,<br>
>inductor, spring, or even edge/vertex weights (for graph problems). For<br>
>code implementation, component is a data structure that holds the data<br>
>needed for the residual, Jacobian, or any other function evaluation. In<br>
>the case of power grid, there are 4 components: branches or transmission<br>
>lines connecting nodes, buses or nodes, generators that are incident at a<br>
>subset of the nodes, and loads that are also incident at a subset of the<br>
>nodes. Each of the these components are defined by their data structures<br>
>given in pf.h.<br>
><br>
>DMNetwork is a wrapper class of DMPlex specifically for network<br>
>applications that can be solely described using nodes, edges, and their<br>
>associated components. If you have a PDE, or need FEM, or need other<br>
>advanced features then DMPlex would be suitable. Please send us a write-up<br>
>of your equations so that we can assist you better.<br>
><br>
>Shri<br>
><br>
><br>
>><br>
>><br>
>>On Tue, Sep 23, 2014 at 11:13 PM, Abhyankar, Shrirang G.<br>
>><<a href="mailto:abhyshr@mcs.anl.gov">abhyshr@mcs.anl.gov</a>> wrote:<br>
>><br>
>>You may also want to take a look at the DMNetwork framework that can be<br>
>>used for general unstructured networks that don't use PDEs. Its<br>
>>description is given in the manual and an example is in<br>
>>src/snes/examples/tutorials/network/pflow.<br>
>><br>
>>Shri<br>
>><br>
>>From: Matthew Knepley <<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>><br>
>>Date: Tue, 23 Sep 2014 22:40:52 -0400<br>
>>To: Miguel Angel Salazar de Troya <<a href="mailto:salazardetroya@gmail.com">salazardetroya@gmail.com</a>><br>
>>Cc: "<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>" <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>><br>
>>Subject: Re: [petsc-users] DMPlex with spring elements<br>
>><br>
>><br>
>>>On Tue, Sep 23, 2014 at 4:01 PM, Miguel Angel Salazar de Troya<br>
>>><<a href="mailto:salazardetroya@gmail.com">salazardetroya@gmail.com</a>> wrote:<br>
>>><br>
>>>Hi all<br>
>>>I was wondering if it could be possible to build a model similar to the<br>
>>>example snes/ex12.c, but with spring elements (for elasticity) instead<br>
>>>of<br>
>>>simplicial elements. Spring elements in a grid, therefore each element<br>
>>>would have two nodes and each node two components. There would be more<br>
>>>differences, because instead of calling the functions f0,f1,g0,g1,g2 and<br>
>>>g3 to build the residual and the jacobian, I would call a routine that<br>
>>>would build the residual vector and the jacobian matrix directly. I<br>
>>>would<br>
>>>not have shape functions whatsoever. My problem is discrete, I don't<br>
>>>have<br>
>>>a PDE and my equations are algebraic. What is the best way in petsc to<br>
>>>solve this problem? Is there any example that I can follow? Thanks in<br>
>>>advance<br>
>>><br>
>>><br>
>>><br>
>>><br>
>>>Yes, ex12 is fairly specific to FEM. However, I think the right tools<br>
>>>for<br>
>>>what you want are<br>
>>>DMPlex and PetscSection. Here is how I would proceed:<br>
>>><br>
>>> 1) Make a DMPlex that encodes a simple network that you wish to<br>
>>>simulate<br>
>>><br>
>>> 2) Make a PetscSection that gets the data layout right. Its hard from<br>
>>>the above<br>
>>> for me to understand where you degrees of freedom actually are.<br>
>>>This is usually<br>
>>> the hard part.<br>
>>><br>
>>> 3) Calculate the residual, so you can check an exact solution. Here<br>
>>>you<br>
>>>use the<br>
>>> PetscSectionGetDof/Offset() for each mesh piece that you are<br>
>>>interested in. Again,<br>
>>> its hard to be more specific when I do not understand your<br>
>>>discretization.<br>
>>><br>
>>> Thanks,<br>
>>><br>
>>> Matt<br>
>>><br>
>>><br>
>>>Miguel<br>
>>><br>
>>><br>
>>><br>
>>>--<br>
>>>Miguel Angel Salazar de Troya<br>
>>>Graduate Research Assistant<br>
>>>Department of Mechanical Science and Engineering<br>
>>>University of Illinois at Urbana-Champaign<br>
>><br>
>><br>
>>>(217) 550-2360 <tel:%28217%29%20550-2360><br>
>>><a href="mailto:salaza11@illinois.edu">salaza11@illinois.edu</a><br>
>>><br>
>>><br>
>>><br>
>>><br>
>>><br>
>>><br>
>>><br>
>>><br>
>>><br>
>>>--<br>
>>>What most experimenters take for granted before they begin their<br>
>>>experiments is infinitely more interesting than any results to which<br>
>>>their experiments lead.<br>
>>>-- Norbert Wiener<br>
>><br>
>><br>
>><br>
>><br>
>><br>
>><br>
>><br>
>><br>
>><br>
>>--<br>
>>Miguel Angel Salazar de Troya<br>
>>Graduate Research Assistant<br>
>>Department of Mechanical Science and Engineering<br>
>>University of Illinois at Urbana-Champaign<br>
>>(217) 550-2360<br>
>><a href="mailto:salaza11@illinois.edu">salaza11@illinois.edu</a><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
>--<br>
>Miguel Angel Salazar de Troya<br>
>Graduate Research Assistant<br>
>Department of Mechanical Science and Engineering<br>
>University of Illinois at Urbana-Champaign<br>
>(217) 550-2360<br>
><a href="mailto:salaza11@illinois.edu">salaza11@illinois.edu</a><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
>--<br>
>Miguel Angel Salazar de Troya<br>
>Graduate Research Assistant<br>
>Department of Mechanical Science and Engineering<br>
>University of Illinois at Urbana-Champaign<br>
>(217) 550-2360<br>
><a href="mailto:salaza11@illinois.edu">salaza11@illinois.edu</a><br>
<br>
</div></div></blockquote></div><br><br clear="all"><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>(217) 550-2360<br>
<a href="mailto:salaza11@illinois.edu" target="_blank">salaza11@illinois.edu</a></font></span><div><br></div></div>
</div>