Skip to content
Snippets Groups Projects
Commit 7aa82740 authored by Nicolas Marsic's avatar Nicolas Marsic
Browse files

cavity geo

parent 09b7241f
Branches
Tags
No related merge requests found
Include "cavity2d_data.geo";
Solver.AutoMesh = -1;
For n In {0:N_DOM-1}
// New subdomain
Delete Model;
// Allow subdomains with different lengths when N_DOM=2
If(N_DOM == 2 && n == 0)
Xstart = 0;
Xstep = LX*t2Dom;
ElseIf(N_DOM == 2 && n == 1)
Xstart = LX*t2Dom;
Xstep = LX*(1-t2Dom);
Else
Xstart = LX/N_DOM * n;
Xstep = LX/N_DOM;
EndIf
Point(1) = {Xstart, 0, 0, LC};
l[] = Extrude{0, LY, 0}{Point{1}; };
s[] = Extrude{Xstep, 0, 0}{ Line{l[1]};};
Physical Line(1*N_DOM + n+1) = l[1]; // Left interface
Physical Line(1*N_DOM + n+2) = s[0]; // Right interface
Physical Line(2*N_DOM + n+2) = s[{2,3}]; // Walls
Physical Surface(n+1) = s[1]; // Domain
// Mesh
Transfinite Surface{s[1]};
Characteristic Length{PointsOf{Surface{s[1]};}} = LC;
If(QUAD)
Recombine Surface{s[1]};
EndIf
If(StrCmp(OnelabAction, "check"))
Mesh 2;
CreateDir Str(DIR);
Save StrCat(MSH_NAME, Sprintf("%g.msh", n));
EndIf
EndFor
// 2D cavity with 25 propagating modes with defautl settings //
DefineConstant[
ANALYSIS = {0, Name "Input/00Type of analysis", ReadOnly 1,
Choices {0="Helmholtz", 1="Maxwell"}},
WAVENUMBER = {314.17, Name "Input/0Wavenumber"},
LAMBDA = {2*Pi/WAVENUMBER, Name "Input/1Wavelength", ReadOnly 1},
N_LAMBDA = {20, Name "Input/2Points per wavelength"},
LX = {0.5, Name "Input/3X dimension"},
LY = {0.25, Name "Input/3Y dimension"},
LZ = {0.25, Name "Input/3Z dimension"},
N_DOM = {2, Name "Input/4Number of subdomains"},
t2Dom = 0.5,
QUAD = {0, Name "Input/5Quad mesh?", Choices{0, 1}},
DIR = "out/",
MSH_BASE_NAME = "mesh_"
];
SAVE_SOLUTION = 1;
MSH_NAME = StrCat(DIR, MSH_BASE_NAME);
LC = LAMBDA/N_LAMBDA;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment