GfsOutputPovrayDF3

From Gerris

Jump to: navigation, search

GfsOutputPovrayDF3 writes a POV-Ray df3 file containing values of a given variable.

The syntax in parameter files is:

[ GfsOutputScalar ]
Example of usage

One can use GfsEventScript to produce a POV-Ray source file, which renders the generated df3 file. POV-Ray (preferably 3.7) is necessary to render the generated df3 file. The following is an example adapted from "Boussinesq flow generated by a heated cylinder".

3 7 GfsSimulation GfsBox GfsGEdge {} {
 
Time { end = 2 dtmax = 1e-2 }
 
RefineSolid 8
 
Solid ({
double r = 0.03;
return x*x + (y+0.4)*(y+0.4) + z*z - r*r;
})
 
GModule df3
 
VariableTracer T
 
SourceDiffusion T 0.0001
 
Source V T
 
SurfaceBc T Dirichlet 1
 
AdaptVorticity { istep = 1 } { maxlevel = (y > 1.5 ? 0 : 8) cmax = 1e-2 }
 
AdaptGradient { istep = 1 } { maxlevel = 8 cmax = 5e-2 } T
 
OutputTime { istep = 10 } stderr
 
GfsOutputPovrayDF3 { istep = 30 } b2-%011.4f.df3 {
v = T min = -0.01 max = 0.8
}
 
EventScript { istep = 30 } {
echo "Rendering $GfsTime";
DF3_FILE=`printf "b2-%011.4f.df3" $GfsTime`
POV_FILE=`printf "b2-%011.4f.pov" $GfsTime`
echo \
'#include "colors.inc"
camera {location <0, 0, -400> look_at 0}
light_source {<0, 1000, 0> White shadowless}
 
// this comes from the box parameter to GfsOutputPovrayDF3
#local bb_density_min = <-0.3,-0.5,-0.3>;
#local bb_density_max = <0.3,0.5,0.3>;
 
// this is the bounding box of domain as described by GfsBox
#local bb_min = <-0.5,-0.5,-0.5>;
#local bb_max = <0.5,2.5,0.5>;
 
#declare generated_density = density {
density_file df3 "'$DF3_FILE'"
translate <-0.5, -0.5, -0.5>
scale <bb_density_max.x - bb_density_min.x,
bb_density_max.y - bb_density_min.y,
bb_density_max.z - bb_density_min.z>
}
 
box {
<-100, -300, -100>, <100, 300, 100>
pigment {rgbt 1}
hollow
interior {
media {
emission <0.6, 0.6, 0.6, 0.6>*0.2
intervals 20
samples 1, 200
method 3
density {
generated_density
interpolate 2
scale 100
}
}
}
}
 
' > $POV_FILE
povray +W800 +H600 $POV_FILE
}
}
GfsBox { bottom = BoundaryOutflow }
GfsBox { }
GfsBox { top = BoundaryOutflow }
1 1 right
1 2 top
1 1 front
2 2 right
2 3 top
2 2 front
3 3 right
3 3 front
Views
Navigation
communication