[Getdp] Evaluate a scalar field at some points, print values on terminal and use them in PostOperation

gilles quemener quemener at lpccaen.in2p3.fr
Mon May 23 14:30:08 CEST 2016


Hi, 

Currently I am trying to evaluate a scalar field solution at some given points 
and to evaluate the min and max of this scalar field. Once this is done I would 
like to print these quantities on the terminal window as well as to use them for 
further PostOperation. 

Assume GetDP has solved my problem and is able to compute scalar fieldsu 
and utotm as described in the GetDP script below. 

How can I get the following quantities at Point {xp, yp, zp}: 
u1 = u(xp, yp, zp) 
u2 = utotm(xp, yp, zp) 
and: 
umin = min(u) over a region 
umax = max(u) over a region 
utotmmin = min(utotm) over a region 
utotmmax = max(utotm) over a region 

I have tried several syntaxes for the different quantities above, but none passed the parsing phase w/o error. 
Therefore if someone has clues or a solution, it would be very helpful ! 

//Post Processing 
//=============== 

PostProcessing{ 
{Name CubicCavity; NameOfFormulation CubicCavity; 
Quantity{ 
{Name u; Value {Local{[{u}]; In TotalDomain; Jacobian JVol;}}} 
{Name utotm; Value {Local{[{u}-scalpot[]]; In TotalDomain; Jacobian JVol;}}} 
} 
} 
} 

//Post Operation 
//============== 

PostOperation{ 
{Name Map_u; NameOfPostProcessing CubicCavity; 
Operation{ 
Print [ u, OnElementsOf GammaInner, File "uIIsur_3D.pos" ];// works ! 
Print [ utotm, OnElementsOf GammaInner, File "uIImuI_3D.pos" ];// works ! 

Print [ utotm, OnElementsOf GammaInner, Iso {0.65}, Sort Position, Format SimpleTable, File "out.txt" ];// works ! 

// Note: Be carefull, in order to visualize the .pos file below in Gmsh, it does not work w/ option "Iso-values" 
// even if it is a single iso-contour/iso-value, I have to use option "Continuous Map" (?!?!) 
Print [ utotm, OnElementsOf GammaInner, Iso {0.65}, Format Gmsh, File "toto.pos" ];// works ! 

// How to print the value of scalar field u or utotm at a specific point (e.g. (0,0,1.3)) on terminal ? 
Printf [ "U=%g", u(0, 0, 1.3) ]; 
Printf [ "Utotm=%g", utotm(0, 0, 1.3) ]; 

// How to get min and max values on some region and use them in other PostOperation ? 
umin = Min(u[]) OnElementsOf GammaInner; 
umax = Max(u[]) OnElementsOf GammaInner; 
N = 10; 
du = (umax - umin) / N; 
For i In (1, N) 
uval = umin + (i - 0.5) * du; 
Print[ utotm, OnElementsOf GammaInner, Iso { uval }, Sort Position, Format SimpleTable, File >> "out.txt" ]; 
EndFor 
} 
} 
} 

Thanks a lot for any help, 

Gilles 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/getdp/attachments/20160523/423d1c44/attachment.html>


More information about the getdp mailing list