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

- print extra info for faces and volumes
- added couple of examples
parent 7c27b024
No related branches found
No related tags found
No related merge requests found
Showing with 1970 additions and 2 deletions
// $Id: GFace.cpp,v 1.35 2007-08-03 00:44:28 geuzaine Exp $ // $Id: GFace.cpp,v 1.36 2007-09-19 19:03:01 geuzaine Exp $
// //
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
// //
...@@ -133,6 +133,28 @@ void GFace::deleteMeshPartitions() ...@@ -133,6 +133,28 @@ void GFace::deleteMeshPartitions()
quadrangles[i]->setPartition(0); quadrangles[i]->setPartition(0);
} }
std::string GFace::getAdditionalInfoString()
{
if(l_edges.empty()) return std::string("");
char tmp[256];
if(l_edges.size() > 10){
sprintf(tmp, "{%d, ..., %d}", (*l_edges.begin())->tag(), (*l_edges.end())->tag());
return std::string(tmp);
}
std::string str("");
std::list<GEdge*>::const_iterator it = l_edges.begin();
str += "{";
for(; it != l_edges.end(); it++){
if(it != l_edges.begin()) str += ",";
sprintf(tmp, "%d", (*it)->tag());
str += tmp;
}
str += "}";
return str;
}
void GFace::computeMeanPlane() void GFace::computeMeanPlane()
{ {
std::vector<SPoint3> pts; std::vector<SPoint3> pts;
......
...@@ -144,6 +144,9 @@ class GFace : public GEntity ...@@ -144,6 +144,9 @@ class GFace : public GEntity
// Delete the mesh partitions defined on this face. // Delete the mesh partitions defined on this face.
void deleteMeshPartitions(); void deleteMeshPartitions();
// Returns a type-specific additional information string
virtual std::string getAdditionalInfoString();
// Recompute the mean plane of the surface from a list of points // Recompute the mean plane of the surface from a list of points
void computeMeanPlane(const std::vector<MVertex*> &points); void computeMeanPlane(const std::vector<MVertex*> &points);
void computeMeanPlane(const std::vector<SPoint3> &points); void computeMeanPlane(const std::vector<SPoint3> &points);
......
// $Id: GRegion.cpp,v 1.17 2007-09-04 13:47:01 remacle Exp $ // $Id: GRegion.cpp,v 1.18 2007-09-19 19:03:01 geuzaine Exp $
// //
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
// //
...@@ -117,6 +117,28 @@ void GRegion::deleteMeshPartitions() ...@@ -117,6 +117,28 @@ void GRegion::deleteMeshPartitions()
pyramids[i]->setPartition(0); pyramids[i]->setPartition(0);
} }
std::string GRegion::getAdditionalInfoString()
{
if(l_faces.empty()) return std::string("");
char tmp[256];
if(l_faces.size() > 10){
sprintf(tmp, "{%d, ..., %d}", (*l_faces.begin())->tag(), (*l_faces.end())->tag());
return std::string(tmp);
}
std::string str("");
std::list<GFace*>::const_iterator it = l_faces.begin();
str += "{";
for(; it != l_faces.end(); it++){
if(it != l_faces.begin()) str += ",";
sprintf(tmp, "%d", (*it)->tag());
str += tmp;
}
str += "}";
return str;
}
std::list<GEdge*> GRegion::edges() const std::list<GEdge*> GRegion::edges() const
{ {
std::list<GEdge*> e; std::list<GEdge*> e;
......
...@@ -52,6 +52,9 @@ class GRegion : public GEntity { ...@@ -52,6 +52,9 @@ class GRegion : public GEntity {
// Delete the mesh partitions defined on this region. // Delete the mesh partitions defined on this region.
void deleteMeshPartitions(); void deleteMeshPartitions();
// Returns a type-specific additional information string
virtual std::string getAdditionalInfoString();
// Resets the mesh attributes to default values // Resets the mesh attributes to default values
virtual void resetMeshAttributes(); virtual void resetMeshAttributes();
......
This diff is collapsed.
theta = Pi/16;
Point(1) = {0,0,0,0.1};
Point(2) = {1,0,0,0.1};
Point(3) = {0,1,0,0.1};
Circle(1) = {2,1,3};
Rotate {{0,1,0}, {0,0,0}, theta} { Duplicata { Line{1}; } }
Rotate {{0,1,0}, {0,0,0}, -theta} { Duplicata { Line{1}; } }
Circle(4) = {5,1,2};
Circle(5) = {2,1,4};
// good parametrization
Line Loop(6) = {-1,-4,3};
Ruled Surface(7) = {6};
// bad parametrization
Line Loop(8) = {1,-2,-5};
Ruled Surface(9) = {8};
// Obdelnikovy vzorek, ctvercove kontakty
// jednoduchy model
m=0.1;
delka=150;
sirka=20;
sirkak=2;
rohx1=1;
rohy1=1;
rohx2=delka-sirkak-1;
rohy2=1;
rohx3=delka-sirkak-1;
rohy3=sirka-sirkak-1;
rohx4=1;
rohy4=sirka-sirkak-1;
// Vzorek
Point(1)= {0,0,0,m};
Point(2)= {delka,0,0,m};
Point(3)= {delka,sirka,0,m};
Point(4)= {0,sirka,0,m};
Line(1)= {1,2};
Line(2)= {2,3};
Line(3)= {3,4};
Line(4)= {4,1};
Line Loop(1)={1,2,3,4};
//////////////////////////////////
// Kontakt 1
Point(5)= {rohx1,rohy1,0,m};
Point(6)= {rohx1+sirkak,rohy1,0,m};
Point(7)= {rohx1+sirkak,rohy1+sirkak,0,m};
Point(8)= {rohx1,rohy1+sirkak,0,m};
Line(5)= {5,6};
Line(6)= {6,7};
Line(7)= {7,8};
Line(8)= {8,5};
Line Loop(2)={5,6,7,8};
Plane Surface(2)={2};
////////////////////////////////////
//// Kontakt 2
Point(9)= {rohx2,rohy2,0,m};
Point(10)= {rohx2+sirkak,rohy2,0,m};
Point(11)= {rohx2+sirkak,rohy2+sirkak,0,m};
Point(12)= {rohx2,rohy2+sirkak,0,m};
Line(9)= {9,10};
Line(10)= {10,11};
Line(11)= {11,12};
Line(12)= {12,9};
Line Loop(3)={9,10,11,12};
Plane Surface(3)={3};
////////////////////////////////////
// Kontakt 3
Point(13)= {rohx3,rohy3,0,m};
Point(14)= {rohx3+sirkak,rohy3,0,m};
Point(15)= {rohx3+sirkak,rohy3+sirkak,0,m};
Point(16)= {rohx3,rohy3+sirkak,0,m};
Line(13)= {13,14};
Line(14)= {14,15};
Line(15)= {15,16};
Line(16)= {16,13};
Line Loop(4)={13,14,15,16};
Plane Surface(4)={4};
////////////////////////////////////
//// Kontakt 4
Point(17)= {rohx4,rohy4,0,m};
Point(18)= {rohx4+sirkak,rohy4,0,m};
Point(19)= {rohx4+sirkak,rohy4+sirkak,0,m};
Point(20)= {rohx4,rohy4+sirkak,0,m};
Line(17)= {17,18};
Line(18)= {18,19};
Line(19)= {19,20};
Line(20)= {20,17};
Line Loop(5)={17,18,19,20};
Plane Surface(5)={5};
Plane Surface(1)={1,2,3,4,5};
Coherence;
Physical Surface (1001) = {2};
Physical Surface (1002) = {3};
Physical Surface (1003) = {4};
Physical Surface (1004) = {5};
Physical Surface (1000) = {1};
Point (1) = {0, 0, 0, 50};
Point (2) = {1250, 0, 0, 50};
Point (3) = {1250, 2000, 0, 50};
Point (4) = {0, 2000, 0, 50};
Point (5) = {0, 0, 500, 100};
Point (6) = {1250, 0, 500, 100};
Point (7) = {1250, 2000, 500, 100};
Point (8) = {0, 2000, 500, 100};
Point (9) = {500, 505, 0, 5};
Point (10) = {570, 505, 0, 5};
Point (11) = {570, 520, 0, 5};
Point (12) = {500, 520, 0, 5};
Point (13) = {500, 535, 0, 5};
Point (14) = {570, 535, 0, 5};
Point (15) = {570, 555, 0, 5};
Point (16) = {500, 555, 0, 5};
Point (17) = {500, 575, 0, 15};
Point (18) = {570, 575, 0, 15};
Point (19) = {570, 710, 0, 15};
Point (20) = {500, 710, 0, 15};
Point (21) = {500, 505, 5, 5};
Point (22) = {570, 505, 5, 5};
Point (26) = {570, 520, 5, 5};
Point (30) = {500, 520, 5, 5};
Point (31) = {500, 535, 5, 5};
Point (32) = {570, 535, 5, 5};
Point (36) = {570, 555, 5, 5};
Point (40) = {500, 555, 5, 5};
Point (41) = {500, 575, 15, 15};
Point (42) = {570, 575, 15, 15};
Point (46) = {570, 710, 15, 15};
Point (50) = {500, 710, 15, 15};
Line (1) = {1, 2};
Line (2) = {2, 3};
Line (3) = {3, 4};
Line (4) = {4, 1};
Line (5) = {5, 6};
Line (6) = {6, 7};
Line (7) = {7, 8};
Line (8) = {8, 5};
Line (9) = {1, 5};
Line (10) = {2, 6};
Line (11) = {3, 7};
Line (12) = {4, 8};
Line (13) = {9, 10};
Line (14) = {10, 11};
Line (15) = {11, 12};
Line (16) = {12, 9};
Line (17) = {13, 14};
Line (18) = {14, 15};
Line (19) = {15, 16};
Line (20) = {16, 13};
Line (21) = {17, 18};
Line (22) = {18, 19};
Line (23) = {19, 20};
Line (24) = {20, 17};
Line (26) = {21, 22};
Line (27) = {22, 26};
Line (28) = {26, 30};
Line (29) = {30, 21};
Line (31) = {9, 21};
Line (32) = {10, 22};
Line (36) = {11, 26};
Line (40) = {12, 30};
Line (48) = {31, 32};
Line (49) = {32, 36};
Line (50) = {36, 40};
Line (51) = {40, 31};
Line (53) = {13, 31};
Line (54) = {14, 32};
Line (58) = {15, 36};
Line (62) = {16, 40};
Line (70) = {41, 42};
Line (71) = {42, 46};
Line (72) = {46, 50};
Line (73) = {50, 41};
Line (75) = {17, 41};
Line (76) = {18, 42};
Line (80) = {19, 46};
Line (84) = {20, 50};
Line Loop (2) = {1, 2, 3, 4, -16, -15, -14, -13, -20, -19, -18, -17, -24, -23, -22, -21};
Plane Surface (2) = {2};
Line Loop (4) = {1, 10, -5, -9};
Plane Surface (4) = {4};
Line Loop (6) = {2, 11, -6, -10};
Plane Surface (6) = {6};
Line Loop (8) = {3, 12, -7, -11};
Plane Surface (8) = {8};
Line Loop (10) = {4, 9, -8, -12};
Plane Surface (10) = {10};
Line Loop (12) = {5, 6, 7, 8};
Plane Surface (12) = {12};
Line Loop (33) = {13, 32, -26, -31};
Ruled Surface (33) = {33};
Line Loop (37) = {14, 36, -27, -32};
Ruled Surface (37) = {37};
Line Loop (41) = {15, 40, -28, -36};
Ruled Surface (41) = {41};
Line Loop (45) = {16, 31, -29, -40};
Ruled Surface (45) = {45};
Line Loop (46) = {26, 27, 28, 29};
Plane Surface (46) = {46};
Line Loop (55) = {17, 54, -48, -53};
Ruled Surface (55) = {55};
Line Loop (59) = {18, 58, -49, -54};
Ruled Surface (59) = {59};
Line Loop (63) = {19, 62, -50, -58};
Ruled Surface (63) = {63};
Line Loop (67) = {20, 53, -51, -62};
Ruled Surface (67) = {67};
Line Loop (68) = {48, 49, 50, 51};
Plane Surface (68) = {68};
Line Loop (77) = {21, 76, -70, -75};
Ruled Surface (77) = {77};
Line Loop (81) = {22, 80, -71, -76};
Ruled Surface (81) = {81};
Line Loop (85) = {23, 84, -72, -80};
Ruled Surface (85) = {85};
Line Loop (89) = {24, 75, -73, -84};
Ruled Surface (89) = {89};
Line Loop (90) = {70, 71, 72, 73};
Plane Surface (90) = {90};
Surface Loop (2) = {4, 2, 6, 8, 10, 12, 46, 33, 37, 41, 45, 68, 55, 59, 63, 67, 90, 77, 81, 85, 89};
Volume (2) = {2};
bat2 = 1;
Physical Surface (bat2) = {4};
Physical Surface (2) = {6};
Physical Surface (3) = {8};
Physical Surface (4) = {10};
Physical Surface (5) = {12};
Physical Surface (6) = {2, 33, 37, 41, 45, 46, 55, 59, 63, 67, 68, 77, 81, 85, 89, 90};
bat2 = 1;
Physical Volume (bat2) = {2};
lc = 0.02;
r = 0.1;
d = 2*r;
h = 2*d;
assym = 0.1*d;
depth = 0.5;
l1 = 2*d;
l2 = 20*d;
n = 1;
nl1 = n*8;
nl2 = n*88;
nc = n*8;
nz = 16;
//nz = 1;
Point(1) = {0,0,0,lc};
Point(2) = {0,r,0,lc};
Point(3) = {r,0,0,lc};
Point(4) = {-r,0,0,lc};
Point(5) = {-l1,0,0,lc};
Point(6) = {l2,0,0,lc};
Point(7) = {-l1,h,0,lc};
Point(8) = {l2,h,0,lc};
Point(9) = {2*r,0.0,0,lc};
Point(10) = {-2*r,0.0,0,lc};
Point(11) = {0.0,0.2,0,lc};
Point(12) = {0.0,h,0,lc};
Point(13) = {r*Sin(Pi/4),r*Sin(Pi/4),0,lc};
Point(14) = {-r*Sin(Pi/4),r*Sin(Pi/4),0,lc};
Point(15) = {2*r*Sin(Pi/4),2*r*Sin(Pi/4),0,lc};
Point(16) = {-2*r*Sin(Pi/4),2*r*Sin(Pi/4),0,lc};
Point(17) = {l2,2*r*Sin(Pi/4),0,lc};
Point(18) = {-l1,2*r*Sin(Pi/4),0,lc};
Point(19) = {2*r*Sin(Pi/4),h,0,lc};
Point(20) = {-2*r*Sin(Pi/4),h,0,lc};
Circle(1) = {15,1,11};
Circle(2) = {13,1,2};
Circle(3) = {2,1,14};
Circle(4) = {11,1,16};
Circle(5) = {16,1,10};
Circle(6) = {14,1,4};
Circle(7) = {13,1,3};
Circle(8) = {15,1,9};
Line(9) = {9,3};
Line(10) = {15,13};
Line(11) = {11,2};
Line(12) = {16,14};
Line(13) = {10,4};
Line(14) = {12,11};
Line(15) = {19,15};
Line(16) = {12,19};
Line(17) = {19,8};
Line(18) = {8,17};
Line(19) = {17,15};
Line(20) = {6,9};
Line(21) = {6,17};
Line(22) = {16,20};
Line(23) = {20,12};
Line(24) = {10,5};
Line(25) = {5,18};
Line(26) = {18,16};
Line(27) = {7,18};
Line(28) = {20,7};
Line Loop(29) = {17,18,19,-15};
Plane Surface(30) = {29};
Line Loop(31) = {21,19,8,-20};
Plane Surface(32) = {31};
Line Loop(33) = {10,7,-9,-8};
Plane Surface(34) = {33};
Line Loop(35) = {1,11,-2,-10};
Plane Surface(36) = {35};
Line Loop(37) = {16,15,1,-14};
Plane Surface(38) = {37};
Line Loop(39) = {4,22,23,14};
Plane Surface(40) = {39};
Line Loop(41) = {11,3,-12,-4};
Plane Surface(42) = {41};
Line Loop(43) = {6,-13,-5,12};
Plane Surface(44) = {43};
Line Loop(45) = {26,5,24,25};
Plane Surface(46) = {45};
Line Loop(47) = {28,27,26,22};
Plane Surface(48) = {47};
Symmetry { 0.0,1.0,0.0,0.0 } {
Duplicata { Surface{32}; }
}
Symmetry { 0.0,1.0,0.0,0.0 } {
Duplicata { Surface{34}; }
}
Symmetry { 0.0,1.0,0.0,0.0 } {
Duplicata { Surface{36}; }
}
Symmetry { 0.0,1.0,0.0,0.0 } {
Duplicata { Surface{42}; }
}
Symmetry { 0.0,1.0,0.0,0.0 } {
Duplicata { Surface{44}; }
}
Symmetry { 0.0,1.0,0.0,0.0 } {
Duplicata { Surface{46}; }
}
Symmetry { 0.0,1.0,0.0,0.0 } {
Duplicata { Surface{48}; }
}
Symmetry { 0.0,1.0,0.0,0.0 } {
Duplicata { Surface{40}; }
}
Symmetry { 0.0,1.0,0.0,0.0 } {
Duplicata { Surface{38}; }
}
Symmetry { 0.0,1.0,0.0,0.0 } {
Duplicata { Surface{30}; }
}
Translate {0.0,assym,0.0} {
Point{7};
}
Translate {0.0,assym,0.0} {
Point{20};
}
Translate {0.0,assym,0.0} {
Point{12};
}
Translate {0.0,assym,0.0} {
Point{19};
}
Translate {0.0,assym,0.0} {
Point{8};
}
Transfinite Line {28,26,24,70,75} = nl1+1 Using Progression 1.0;
Transfinite Line {17} = nl2+1 Using Progression 1.0/0.99;
Transfinite Line {19} = nl2+1 Using Progression 0.99;
Transfinite Line {20} = nl2+1 Using Progression 0.99;
Transfinite Line {51} = nl2+1 Using Progression 0.99;
Transfinite Line {88} = nl2+1 Using Progression 1.0/0.99;
Transfinite Line {18,21,8,15,14,22,27,25,5,6,7,4,3,13,12,11,10,2,9,1,16,23} = nc+1 Using Progression 1.0;
Transfinite Line {50,89,52,86,55,54,59,57,85,83,58,62,64,82,63,78,68,73,76,66} = nc+1 Using Progression 1.0;
Transfinite Line {15,14,18,27} = nc+1 Using Progression 1.0;
Transfinite Line {76,78,86,89} = nc+1 Using Progression 1.0;
Transfinite Surface {30} = {17,8,19,15};
Transfinite Surface {32} = {17,15,9,6};
Transfinite Surface {34} = {15,13,3,9};
Transfinite Surface {36} = {13,15,11,2};
Transfinite Surface {38} = {11,15,19,12};
Transfinite Surface {40} = {11,12,20,16};
Transfinite Surface {42} = {2,11,16,14};
Transfinite Surface {44} = {4,14,16,10};
Transfinite Surface {46} = {10,16,18,5};
Transfinite Surface {48} = {18,16,20,7};
Transfinite Surface {49} = {6,22,26,9};
Transfinite Surface {53} = {3,9,26,28};
Transfinite Surface {56} = {28,26,31,35};
Transfinite Surface {60} = {42,35,31,46};
Transfinite Surface {65} = {10,4,42,46};
Transfinite Surface {69} = {5,10,46,47};
Transfinite Surface {74} = {47,46,48,49};
Transfinite Surface {79} = {46,31,60,48};
Transfinite Surface {84} = {31,26,62,60};
Transfinite Surface {87} = {22,64,62,26};
allsurf[] = {30,32,34,36,38,40,42,44,46,48,
49,53,56,60,65,69,74,79,84,87};
Recombine Surface{allsurf[]};
Extrude {0,0,depth} {
Surface{allsurf[]}; Layers{nz}; Recombine;
}
// Walls
Physical Surface(600) = {98,186,216,296,516,494,480,450,146,344,370,388,406,252,234,172};
// Inlet
Physical Surface(601) = {300,286,440,454};
// Outlet
Physical Surface(602) = {102,120,318,520};
//Physical Volume(603) = {9000};
lc = 0.01;
Point(1) = {0, 0, 0, lc};
Point(2) = {.1, 0, 0, lc} ;
Point(3) = {.1, .3, 0, lc} ;
Point(4) = {0, .3, 0, lc} ;
Line(1) = {1,2} ;
Line(2) = {3,2} ;
Line(3) = {3,4} ;
Line(4) = {4,1} ;
Line Loop(5) = {4,1,-2,3} ;
Plane Surface(6) = {5} ;
Extrude { Surface{6}; Layers{5, 0.01}; Recombine; }
Point(100) = {0, 0, 0.15, lc} ;
Point(101) = {.1, 0, 0.15, lc} ;
Line(100) = {8, 100};
Line(101) = {12, 101};
Line(102) = {100, 101};
Line Loop(100) = {9,101,-102,-100};
Plane Surface(100) = 100;
mm = 1e-3 ;
a = 20e-6 ; // grand rayon de l'élipse (en µT)
b = 10e-6 ; // petit rayon de l'élipse (en µT)
Phase = 0 ; // déphasage (je pense que je ne m'en servirai pas)
r_tete = 90*mm ;
ep_peau = 2*mm;
ep_os = 2*mm ;
r_g = 70 *mm;
d_g = 15*mm ; //déplacement du centre du cerveau par rapport au centre de la tête
centre_x_oeil = 73.1 *mm ;
centre_y_oeil = 30.1 *mm ;// centre_y_oeil * sin(23) ;
cote_casque = 390*mm ;
bord_casque = 6*mm ;
diam_spire = 310*mm ;
Largeur_ind = 35*mm ;
Hauteur_ind = 40*mm ;
s = 5;
lc_ind12 = (Largeur_ind/5)*s/3 ;
//Geometry.OldNewReg = 1;
//Geometry.AutoCoherence = 1;
//Mesh.CharacteristicLengthFactor = 1. ;
pIdev_int1 = newp; Point(pIdev_int1) = {cote_casque/2+bord_casque,diam_spire/2,0.,lc_ind12};
pIdev_int2 = newp; Point(pIdev_int2) = {cote_casque/2+bord_casque,diam_spire/2+Largeur_ind,0.,lc_ind12};
pIdev_ext1 = newp; Point(pIdev_ext1) = {cote_casque/2+bord_casque+Hauteur_ind,diam_spire/2,0.,lc_ind12};
pIdev_ext2 = newp; Point(pIdev_ext2) = {cote_casque/2+bord_casque+Hauteur_ind,diam_spire/2+Largeur_ind,0.,lc_ind12};
lIdev_int1 = newl ; Line (lIdev_int1) = {pIdev_int2, pIdev_int1};
lIdev_cotint1 = newl ; Line (lIdev_cotint1) = {pIdev_int1, pIdev_ext1};
lIdev_ext1 = newl ; Line (lIdev_ext1) = {pIdev_ext1, pIdev_ext2};
lIdev_cotext1 = newl ; Line (lIdev_cotext1) = {pIdev_ext2, pIdev_int2};
llIdev1 = newreg ; Line Loop (llIdev1) = {lIdev_int1,lIdev_cotint1,lIdev_ext1,lIdev_cotext1};
psIdev1 = newreg ; Plane Surface(psIdev1) = {llIdev1};
TRANS = 1;
ns = 4 ;
If(TRANS)
Transfinite Line {lIdev_int1,lIdev_cotint1,lIdev_ext1, lIdev_cotext1} = ns ;
Transfinite Surface {psIdev1} = {pIdev_int2,pIdev_int1,pIdev_ext1,pIdev_ext2};
EndIf
Recombine Surface{newreg-1} ;
vol[]=Extrude Surface { newreg-1, {1,0,0} , {0,0,0} , Pi/4 }
{ Layers { 2, 1 } ; Recombine; };;
vIdev1[0] = vol[1];
File added
File added
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment