[Getdp] PostOperation

Christophe Geuzaine cag32 at case.edu
Fri Oct 28 02:07:24 CEST 2005


Christian Geikowsky R. wrote:
> Estimated Cristophe:
> 
>  
> 
> Thank you for your example, I will try to explain my problem.
> 
> Initially you have defined the regions Omega, Omega1 and Omega2. 
> According to these regions I have obtained the solution *.res.
> 
> My problem is than after having the resolution file (*.res), I have 
> created a new region (OmegaX) to obtain the value of the integral.
> 
> (Take long time generating the resolution file again with the new regions).
> 
> I attach the archives that you sent me of example with the modifications 
> to carry out the early, however, results are all zero.
> 
> How can I carry out this calculation without having to running a new 
> iteration?
> 

You can't in GetDP: your region has to be in the support of the basis 
functions.

What you could do is output the (non-integrated) value on the large 
region, then import it in Gmsh to interpolate and integrate it on the 
smaller region (using Plugin(Evaluate) and Plugin(Integrate), respectively).


>  
> 
> Greetings
> 
>  
> 
> Christian Geikowsky R.
> 
> ------------------------------------------------------------------------
> 
> Correo Yahoo!
> Comprueba qué es nuevo, aquí 
> <http://us.rd.yahoo.com/mail/es/whatsnew/*http://es.whatsnew.mail.yahoo.com/>
> http://correo.yahoo.es
> 
> 
> ------------------------------------------------------------------------
> 
> s=1;
> Point(1) = {0,0,0,s/10};
> Point(2) = {s,0,0,s/10};
> Point(3) = {2*s,0,0,s/10};
> Point(4) = {0,s,0,s/10};
> Point(5) = {s,s,0,s/10};
> Point(6) = {2*s,s,0,s/10};
> Line(1) = {1,2};
> Line(2) = {2,3};
> Line(3) = {3,6};
> Line(4) = {6,5};
> Line(5) = {5,4};
> Line(6) = {4,1};
> Line(7) = {2,5};
> Line Loop(8) = {1,7,5,6};
> Plane Surface(9) = {8};
> Line Loop(10) = {2,3,4,-7};
> Plane Surface(11) = {10};
> 
> Physical Surface(1) = 9; 
> Physical Surface(2) = 11;
> Physical Line(10) = 6; // left
> Physical Line(11) = 3; // right
> 
> 
> /*********************************/
> /*  Región de muestreo -  OmegaX */
> /*********************************/
> 
> Point(21) = {s/4  ,s/4  ,0,s/10};
> Point(22) = {s*3/4,s/4  ,0,s/10};
> Point(23) = {s/4  ,s*3/4,0,s/10};
> Point(24) = {s*3/4,s*3/4,0,s/10};
> 
> Line(25) = {21,22};
> Line(26) = {22,24};
> Line(27) = {24,23};
> Line(28) = {23,21};
> 
> Line Loop(30) = {25,26,27,28};
> Plane Surface(31) = {30};
> 
> Physical Surface(32) = 31;
> 
> 
> ------------------------------------------------------------------------
> 
> Group {
>   // Domain [0,2]x[0,1]
>   Omega = Region[ {1,2} ];
>   // Left half of Omega
>   Omega1 = Region[ {1} ];
>   // Right half of Omega
>   Omega2 = Region[ {2} ];
>   // Left and right boundaries
>   Gamma1 = Region[ {10} ];
>   Gamma2 = Region[ {11} ];
> 
> /**********************/
> /* Región de muestreo */
> /**********************/
> 
>   OmegaX = Region[ {32} ];
> 
> }
> 
> Jacobian {
>   { Name Vol ; Case { { Region All ; Jacobian Vol ; } } }
> }
> 
> Integration {
>   { Name Int ; Case { { Type Gauss ; 
>     Case { { GeoElement Triangle ; NumberOfPoints 3 ; } } } } }
> }
> 
> Constraint {
>   { Name Dirichlet ;
>     Case {
>       { Region Gamma1 ; Value -1. ; }
>       { Region Gamma2 ; Value 1. ; }
>     }
>   }
> }
> 
> FunctionSpace {
>   { Name H1 ; Type Form0 ; 
>     BasisFunction {
>       { Name sn ; NameOfCoef vn ; Function BF_Node ;
>         Support Omega ; Entity NodesOf[ All ] ; }
>     }
>     Constraint {
>       { NameOfCoef vn; EntityType NodesOf ; NameOfConstraint Dirichlet; }
>     }
>   }
> }
> 
> Formulation {
>   { Name Laplace ; Type FemEquation ;
>     Quantity { 
>       { Name v ; Type Local ; NameOfSpace H1 ; }
>     }
>     Equation {
>       Galerkin { [ Dof{d v} , {d v} ] ; In Omega ; Jacobian Vol ; Integration Int ; }
>     }
>   }
> }
> 
> Resolution {
>   { Name Laplace ;
>     System {
>       { Name A ; NameOfFormulation Laplace ; }
>     }
>     Operation { 
>       Generate[A] ; Solve[A] ; SaveSolution[A] ;
>     }
>   }
> }
> 
> PostProcessing {
>   { Name Laplace ; NameOfFormulation Laplace  ;
>     Quantity {
>       { Name v ; Value { Term { [ {v} ] ; In Omega ; Jacobian Vol; } } }
>       // defines the integral of v in a generic way, over the whole domain Omega
>       { Name intv ; Value { Integral { [ {v} ] ; In Omega ; Jacobian Vol; Integration Int; } } }
>     }
>   }
> }
> 
> PostOperation{
>   { Name v ; NameOfPostProcessing Laplace; 
>     Operation {
>       Print[ v , OnElementsOf Omega , File "v.pos" ] ;
>       // Integral of v over Omega (should be 0)
>       Print[ intv[Omega] , OnGlobal , File "cero.txt"] ;
>       // Integral of v over Omega1 (should be -0.5)
>       Print[ intv[Omega1] , OnGlobal , File "menos.txt" ] ; 
>       // Integral of v over Omega2 (should be 0.5)
>       Print[ intv[Omega2] , OnGlobal , File "mas.txt"] ;
> 
> /*****************************/
> /* Integral of v over OmegaX */
> /*****************************/
> 
>       Print[ intv[OmegaX] , OnGlobal , 		File "XX1.txt"] ;
>       Print[ intv[OmegaX] , OnRegion OmegaX , 	File "XX2.txt"] ;
>       Print[ intv[Omega]  , OnRegion OmegaX , 	File "XX3.txt"] ;
>       
>     }
>   }
> }
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> getdp mailing list
> getdp at geuz.org
> http://www.geuz.org/mailman/listinfo/getdp


-- 
Christophe Geuzaine
Assistant Professor, Case University, Mathematics
http://www.case.edu/artsci/math/geuzaine