Skip to content
Snippets Groups Projects
Commit 64732b33 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

submarine + falcon

parent 6b062627
No related branches found
No related tags found
No related merge requests found
//Mesh.Algorithm3D=4; //1-Delaunay, 4-Frontal, 5-Frontal Delaunay 6-Frontal hex, 7-MMG3D, 9-RTree Mesh.Algorithm3D=4; //1-Delaunay, 4-Frontal, 5-Frontal Delaunay 6-Frontal hex, 7-MMG3D, 9-RTree
lc = 0.3; lc = 0.3;
Mesh.CharacteristicLengthMin = lc; Mesh.CharacteristicLengthMin = lc;
......
lc = 0.3;
Mesh.RemeshParametrization=7;
Mesh.RemeshAlgorithm=1;
Mesh.Algorithm=6;
Mesh.CharacteristicLengthFromPoints = 0;
Mesh.CharacteristicLengthMin = lc;
Mesh.CharacteristicLengthMax = lc;
Mesh.LcIntegrationPrecision = 1.e-5;
Mesh.MinimumCirclePoints = 50;
Mesh.CharacteristicLengthExtendFromBoundary = 0;
Mesh.CharacteristicLengthFromCurvature = 0;
Mesh.CharacteristicLengthFromPoints = 0;
Merge "InitialMeshFalcon.msh";
CreateTopology;
// Make all lines compound:
ll[] = Line "*";
For j In {0 : #ll[]-1}
Compound Line(1000+j) = ll[j];
Physical Line(1000+j) = (1000+j);
EndFor
// Make all surfaces compound and physical:
ss[] = Surface "*";
For i In {0 : #ss[]-1}
Compound Surface(i+100) = ss[i];
Physical Surface(i+1) = { i+100 };
EndFor
Mesh 2;
Save "SurfaceMeshUniform.stl";
Delete All;
Merge "SurfaceMeshUniform.stl";
CreateTopology;
z0 = 0.272342;
zmax = 11;
xmin = -20;
xmax = 3;
ymin = -3.0;
ymax = 6.0;
Point(20001) = {xmin, ymin, z0};
Point(20002) = {xmax, ymin, z0};
Point(20003) = {xmax, ymax, z0};
Point(20004) = {xmin, ymax, z0};
Point(20005) = {xmin, ymin, zmax};
Point(20006) = {xmax, ymin, zmax};
Point(20007) = {xmax, ymax, zmax};
Point(20008) = {xmin, ymax, zmax};
Line(10) = {20001, 20002};
Line(11) = {20002, 20003};
Line(12) = {20003, 20004};
Line(13) = {20004, 20001};
Line(14) = {20005, 20006};
Line(15) = {20006, 20007};
Line(16) = {20007, 20008};
Line(17) = {20008, 20005};
Line(18) = {20001, 20005};
Line(19) = {20002, 20006};
Line(20) = {20003, 20007};
Line(21) = {20004, 20008};
Line Loop(22) = {10,19,-14,-18};
Line Loop(23) = {11,20,-15,-19};
Line Loop(24) = {12,21,-16,-20};
Line Loop(25) = {13,18,-17,-21};
Line Loop(26) = {14,15,16,17};
Line Loop(27) = {1,10,11,12,13};
Plane Surface(2) = {22};
Plane Surface(3) = {23};
Plane Surface(4) = {24};
Plane Surface(5) = {25};
Plane Surface(6) = {26};
Plane Surface(7) = {27};
Surface Loop(8) = {1,2,3,4,5,6,7};
Volume(1) = {8};
Physical Surface(1) = {1};
Physical Surface(2) = {5, 4, 3, 2, 6};
Physical Surface(3) = {7};
Physical Volume(4) = {1};
Mesh 3;
Save "falcon.msh";
Merge "falcon.msh";
Plugin(SimplePartition).NumSlices = 16;
Plugin(SimplePartition).Run;
Mesh.Binary=1;
Mesh.MshFilePartitioned = 2; // hack to save a physical for each partition
Save "part.msh";
//Merge "part.msh_new";
Merge "part.msh";
N_DOM=16;
vol[] = {}; idx_vol[] = {};
sur_scat[] = {}; idx_sur_scat[] = {};
sur_inf[] = {}; idx_sur_inf[] = {};
sur_sym[] = {}; idx_sur_sym[] = {};
sigma_left[] = {}; idx_sigma_left[] = {};
sigma_right[] = {}; idx_sigma_right[] = {};
For i In {1:N_DOM}
idx_vol[] += #vol[]; vol[] += Physical Volume{4000 + i};
idx_sur_scat[] += #sur_scat[]; sur_scat[] += Physical Surface{1000 + i};
idx_sur_inf[] += #sur_inf[]; sur_inf[] += Physical Surface{2000 + i};
idx_sur_sym[] += #sur_sym[]; sur_sym[] += Physical Surface{3000 + i};
idx_sigma_left[] += #sigma_left[]; sigma_left[] += Physical Surface{4000 + 1000 * (i-2)};
idx_sigma_right[] += #sigma_right[]; sigma_right[] += Physical Surface{4000 + 1000 * (i-1)};
EndFor
idx_vol[] += #vol[];
idx_sur_scat[] += #sur_scat[];
idx_sur_inf[] += #sur_inf[];
idx_sur_sym[] += #sur_sym[];
idx_sigma_left[] += #sigma_left[];
idx_sigma_right[] += #sigma_right[];
Mesh.Binary = 1;
Geometry.OrientedPhysicals = 0; // partitions have negative tags!!
For i In {1:N_DOM}
idom = i-1;
Delete Physicals;
Physical Volume(4000+i) = vol[{idx_vol[i-1]:idx_vol[i]-1}];
Physical Surface(1000+i) = sur_scat[{idx_sur_scat[i-1]:idx_sur_scat[i]-1:1}];
Physical Surface(2000+i) = sur_inf[{idx_sur_inf[i-1]:idx_sur_inf[i]-1:1}];
Physical Surface(3000+i) = sur_sym[{idx_sur_sym[i-1]:idx_sur_sym[i]-1:1}];
Physical Surface(-(4000 + 1000 * (i-2))) = sigma_left[{idx_sigma_left[i-1]:idx_sigma_left[i]-1:1}];
Physical Surface(4000 + 1000 * (i-1)) = sigma_right[{idx_sigma_right[i-1]:idx_sigma_right[i]-1:1}];
Save Sprintf("falcon_mshcut%g.msh", idom);
EndFor
Merge "submarine_simple.msh";
Plugin(SimplePartition).NumSlices = 16;
Plugin(SimplePartition).Run;
Mesh.Binary=1;
Mesh.MshFilePartitioned = 2; // hack to save a physical for each partition
Save "part.msh";
//Merge "part.msh_new";
Merge "part.msh";
N_DOM=16;
vol[] = {}; idx_vol[] = {};
sur_scat[] = {}; idx_sur_scat[] = {};
sur_inf[] = {}; idx_sur_inf[] = {};
sur_sym[] = {}; idx_sur_sym[] = {};
sigma_left[] = {}; idx_sigma_left[] = {};
sigma_right[] = {}; idx_sigma_right[] = {};
For i In {1:N_DOM}
idx_vol[] += #vol[]; vol[] += Physical Volume{4000 + i};
idx_sur_scat[] += #sur_scat[]; sur_scat[] += Physical Surface{1000 + i};
idx_sur_inf[] += #sur_inf[]; sur_inf[] += Physical Surface{2000 + i};
idx_sur_sym[] += #sur_sym[]; sur_sym[] += Physical Surface{3000 + i};
idx_sigma_left[] += #sigma_left[]; sigma_left[] += Physical Surface{4000 + 1000 * (i-2)};
idx_sigma_right[] += #sigma_right[]; sigma_right[] += Physical Surface{4000 + 1000 * (i-1)};
EndFor
idx_vol[] += #vol[];
idx_sur_scat[] += #sur_scat[];
idx_sur_inf[] += #sur_inf[];
idx_sur_sym[] += #sur_sym[];
idx_sigma_left[] += #sigma_left[];
idx_sigma_right[] += #sigma_right[];
Mesh.Binary = 1;
Geometry.OrientedPhysicals = 0; // partitions have negative tags!!
For i In {1:N_DOM}
idom = i-1;
Delete Physicals;
Physical Volume(4000+i) = vol[{idx_vol[i-1]:idx_vol[i]-1}];
Physical Surface(1000+i) = sur_scat[{idx_sur_scat[i-1]:idx_sur_scat[i]-1:1}];
Physical Surface(2000+i) = sur_inf[{idx_sur_inf[i-1]:idx_sur_inf[i]-1:1}];
Physical Surface(3000+i) = sur_sym[{idx_sur_sym[i-1]:idx_sur_sym[i]-1:1}];
Physical Surface(-(4000 + 1000 * (i-2))) = sigma_left[{idx_sigma_left[i-1]:idx_sigma_left[i]-1:1}];
Physical Surface(4000 + 1000 * (i-1)) = sigma_right[{idx_sigma_right[i-1]:idx_sigma_right[i]-1:1}];
Save Sprintf("submarine_mshcut%g.msh", idom);
EndFor
This diff is collapsed.
lc = 200;
Mesh.CharacteristicLengthMin = lc;
Mesh.CharacteristicLengthMax = lc;
Merge "submarine.stp";
Physical Surface(1) = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
Physical Surface(2) = {12};
Physical Surface(3) = {11};
Physical Volume(4) = {1};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment