[Gmsh] about mesh refinement by scripting

Giuseppe Zagari gzagari at unical.it
Thu May 13 13:00:39 CEST 2010


Hi,

I need to visualize the stress results of my fem calculation
for a 4 node high-order element and I am using

$ElementNodeData
....

for plotting the stress field and other.

But, in this way I can depict only a linear function
between two adjacent nodes instead  I would like to visualize the exact
solution in term of stress that is quadratic. How can I do that?


Best Regards,
  Giuseppe


2010/5/12 Giuseppe Zagari <gzagari at unical.it>

>
> Hi David,
> thank you for the reply.
>
> Something like this:
>
> i#include <stdlib.h>
> #include <stdio.h>
> #include <sys/types.h>
> #include <signal.h>
> #include "MySolver.h"
>
>  int main(int argc, char* argv[])
> {
>    int i, pid;
>
>   system("gmsh -pid -listen test.geo > /tmp/gmsh.pid &");
>   //system("gmsh -pid -listen -2 test.geo > /tmp/gmsh.pid &");
>
>   for(i = 0; i < 5; i++)
>   {
>         system("  ???  "); // put here the command for refine
>         MySolver ms("test");
>         ms.analyze();
>   }
>
>   kill(pid, 9);
> }
>
> I hope I understod right.
>
> Best Regards,
> GZ
>
>
> 2010/5/12 David Colignon <David.Colignon at ulg.ac.be>
>
>
>> On 12/05/10 09:56, Giuseppe Zagari wrote:
>>
>>  Hi,
>>>
>>> I am using gmsh gui for checking
>>> convergence of my finite elements following this procedure:
>>> open gmsh, open filename, go to mesh module, clicking 2D and refine
>>> many times as I want and run the analysis.
>>>
>>
>>
>> Hi Giuseppe,
>>
>> I suppose you mean that after refining, you save the mesh, perform your FE
>> calculations, go back to the Gmsh GUI, click on refine, save, etc. ?
>>
>>
>>
>>> But now I would like to use it in a script like this:
>>>
>>> gmsh -2 filename.geo
>>> analyze filename // it use both .geo and .msh files
>>> gmsh -refine filename.msh
>>> analyze filename.msh
>>> gmsh -refine filename.msh
>>> analyze filename.msh
>>> ....
>>>
>>> but, used in this way, gmsh change the node numbering.
>>>
>>
>>
>> yes, if you save the mesh, quit Gmsh, relaunch Gmsh,reload the mesh,
>> refine, save, quit,  etc. like in your script above, the node numbering will
>> probably change.
>>
>> One solution could be to launch Gmsh in "server" mode (launch Gmsh on the
>> command line with "gmsh -listen") and interact with it through "sockets",
>> like explained here (point 3):
>>
>> http://www.geuz.org/gmsh/doc/texinfo/gmsh.html#Solver-module-questions
>>
>> or launch your FE code from within Gmsh :
>>
>> http://www.geuz.org/gmsh/doc/texinfo/gmsh.html#Solver
>>
>> http://www.geuz.org/gmsh/doc/texinfo/gmsh.html#Solver-module
>>
>> Regards,
>>
>> Dave
>>
>> --
>> David Colignon, Ph.D.
>> Collaborateur Logistique du F.R.S.-FNRS
>> CÉCI - Consortium des Équipements de Calcul Intensif
>> ACE - Applied & Computational Electromagnetics
>> Sart-Tilman B28
>> Université de Liège
>> 4000 Liège - BELGIQUE
>> Tél: +32 (0)4 366 37 32
>> Fax: +32 (0)4 366 29 10
>> WWW:    http://hpc.montefiore.ulg.ac.be/
>> Agenda:
>> http://www.google.com/calendar/embed?src=david.colignon%40gmail.com
>>
>>
>>
>>
>>> Please suggest me in wich way I can obtaine the same
>>> behavoiur of the gmsh-gui.
>>>
>>>
>>> Best Regards and Many Thanks for gmsh
>>>
>>> Giuseppe
>>>
>>>
>>> --
>>> Ing. Giuseppe Zagari, Ph. D.
>>> Dip. Modellistica per l'Ing. - UNICAL
>>> Via P. Bucci, Cubo 39/b 87036
>>> Arcavacata di Rende CS ITALY
>>>
>>>
>>>
>>> _______________________________________________
>>> gmsh mailing list
>>> gmsh at geuz.org
>>> http://www.geuz.org/mailman/listinfo/gmsh
>>>
>>
>>
>
>
> --
> Ing. Giuseppe Zagari, Ph. D.
> Dip. Modellistica per l'Ing. - UNICAL
> Via P. Bucci, Cubo 39/b 87036
> Arcavacata di Rende CS ITALY
>
>


-- 
Ing. Giuseppe Zagari, Ph. D.
Dip. Modellistica per l'Ing. - UNICAL
Via P. Bucci, Cubo 39/b 87036
Arcavacata di Rende CS ITALY
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20100513/0d4b2a66/attachment.html>