-
Notifications
You must be signed in to change notification settings - Fork 0
/
testhf.c
64 lines (53 loc) · 1.19 KB
/
testhf.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include "utils.h"
#include "navier-stokes/centered.h"
scalar f[];
#include "fractions.h"
#include "curvature.h"
#include "tension-hybridV4.h"
scalar kappa[],sigma[];
vector hf[];
vector tang[];
scalar nthf[];
scalar ntsd[];
vector nrm[];
vector tang_d[];
void get_tangent(vector n, vector t)
{
foreach(){
t.x[] = n.y[] != nodata ? -n.y[] : nodata;
t.y[] = n.y[] != nodata ? n.x[] : nodata;
}
}
int main(){
init_grid (64);
L0 = 8;
Y0 = -L0/8.;
X0 = -L0/2.;
fraction(f,(y-((double)L0)/((double)N)/2. + 0.0*sin(2*pi*x/8)));
//fraction(f,sq(0.5)-(sq(x) + sq(y)));
heights(f,hf);
/* foreach(){ */
/* hf.x[] = hf.x[] == nodata ? 0. : hf.x[]; */
/* hf.y[] = hf.y[] == nodata ? 0. : hf.y[]; */
/* fprintf(ferr,"%g %g %g %g\n",x,y,hf.x[],hf.y[]); */
/* } */
foreach(){
coord nrmf = height_normal(point,f,hf);
foreach_dimension()
nrm.x[] = nrmf.x;
}
get_tangent(nrm,tang);
vof2distCC(f);
foreach(){
foreach_dimension()
tang_d.y[] = (d[1] - d[-1])/2./Delta;
}
foreach(){
if(tang.x[] != nodata && tang.y[] != nodata){
nthf[] = norm(tang);
ntsd[] = norm(tang_d);
}
}
hf.x.nodump = true;
dump("toto");
}