23 |
# that it defines boundary conditions on pieces of objects. |
# that it defines boundary conditions on pieces of objects. |
24 |
|
|
25 |
require 'check.ph'; |
require 'check.ph'; |
26 |
|
CleanUp('laplacian-lens.bb'); |
27 |
|
|
28 |
# The Povray scene |
# The Povray scene |
29 |
WriteFile('test.pov',<< 'EOF'); |
WriteFile("laplacian-lens.pov",<< 'EOF'); |
30 |
|
|
31 |
/* We define two spheres to be able to apply different boundary |
/* We define two spheres to be able to apply different boundary |
32 |
conditions on each */ |
conditions on each */ |
53 |
vector a = (-2,-2,-2); |
vector a = (-2,-2,-2); |
54 |
vector b = (3,2,2); |
vector b = (3,2,2); |
55 |
|
|
56 |
scene S = pov("test.pov"); |
scene S = pov("laplacian-lens.pov"); |
57 |
mesh M = structured(n,a,b); |
mesh M = structured(n,a,b); |
58 |
domain O = domain(S,outside(<1,0,0>) or outside(<0,1,0>)); |
domain O = domain(S,outside(<1,0,0>) or outside(<0,1,0>)); |
59 |
|
|
66 |
u = 0 on M; |
u = 0 on M; |
67 |
}; |
}; |
68 |
|
|
69 |
save(medit,"test",u,M); |
save(medit,"laplacian-lens",u,M); |
70 |
|
|
71 |
// Also saves mesh, just for debugging purposes |
// Also saves mesh, just for debugging purposes |
72 |
save(medit,"test",M); |
save(medit,"laplacian-lens",M); |
73 |
EOF |
EOF |
74 |
|
|
75 |
# Compares the resulting output with a reference |
# Compares the resulting output with a reference |
76 |
VectorCheck('test.bb','laplacian-lens-ref.bb',1e-6); |
VectorCheck('laplacian-lens.bb','laplacian-lens-ref.bb',1e-6); |
77 |
|
|
78 |
Report(); |
Report(); |