Skip to content
Snippets Groups Projects
Commit 42fa46a3 authored by Jean-François Remacle's avatar Jean-François Remacle
Browse files

*** empty log message ***

parent b6ffe592
No related branches found
No related tags found
No related merge requests found
// $Id: meshGFaceTransfinite.cpp,v 1.1 2006-09-05 21:37:59 remacle Exp $
// $Id: meshGFaceTransfinite.cpp,v 1.2 2006-09-06 10:25:24 remacle Exp $
//
// Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
//
......@@ -176,22 +176,47 @@ int MeshTransfiniteSurface( GFace *gf)
}
}
for (int IT = 0;IT< 5;IT++)
// elliptic smoother
for (int IT = 0;IT< 15;IT++)
{
for(int i = 1; i<L; i++)
{
for(int j = 1; j < H; j++)
{
MVertex *v1 = tab[std::make_pair(i,j)];
MVertex *v2 = tab[std::make_pair(i+1,j)];
MVertex *v3 = tab[std::make_pair(i-1,j)];
MVertex *v4 = tab[std::make_pair(i,j+1)];
MVertex *v5 = tab[std::make_pair(i,j-1)];
MVertex *v11 = tab[std::make_pair(i-1,j-1)];
MVertex *v12 = tab[std::make_pair(i-1,j)];
MVertex *v13 = tab[std::make_pair(i-1,j+1)];
MVertex *v21 = tab[std::make_pair(i,j-1)];
MVertex *v22 = tab[std::make_pair(i,j)];
MVertex *v23 = tab[std::make_pair(i,j+1)];
MVertex *v31 = tab[std::make_pair(i+1,j-1)];
MVertex *v32 = tab[std::make_pair(i+1,j)];
MVertex *v33 = tab[std::make_pair(i+1,j+1)];
v1->x() = 0.25 * (v2->x() +v3->x() +v4->x() +v5->x());
v1->y() = 0.25 * (v2->y() +v3->y() +v4->y() +v5->y());
v1->z() = 0.25 * (v2->z() +v3->z() +v4->z() +v5->z());
double alpha = 0.25 * (DSQR(v23->x() - v21->x()) +
DSQR(v23->y() - v21->y()));
double gamma = 0.25 * (DSQR(v32->x() - v12->x()) +
DSQR(v32->y() - v12->y()));
double beta = 0.0625 * ((v32->x() - v12->x()) *
(v23->x() - v21->x()) +
(v32->y() - v12->y()) *
(v23->y() - v21->y()));
v22->x() = 0.5 * (alpha * (v32->x() + v12->x()) +
gamma * (v23->x() + v21->x()) -
2. * beta * (v33->x() - v13->x() -
v31->x() + v11->x()))
/ (alpha + gamma);
v22->y() = 0.5 * (alpha * (v32->y() + v12->y()) +
gamma * (v23->y() + v21->y()) -
2. * beta * (v33->y() - v13->y() -
v31->y() + v11->y()))
/ (alpha + gamma);
v22->z() = 0.5 * (alpha * (v32->z() + v12->z()) +
gamma * (v23->z() + v21->z()) -
2. * beta * (v33->z() - v13->z() -
v31->z() + v11->z()))
/ (alpha + gamma);
}
}
}
......
Point(1) = {0,0,0,0.1};
Point(2) = {1,0,0,0.1};
Point(3) = {2,0,0,0.1};
Point(4) = {3,0,0,0.1};
Point(5) = {4,0,0,0.1};
Point(6) = {1,1,0,0.1};
Point(7) = {4,1,0,0.1};
Point(8) = {5,0,0,0.1};
Point(9) = {-1,0,0,0.1};
Point(10) = {6,0,0,0.1};
Point(11) = {6,4,0,0.1};
Point(12) = {0,4,0,0.1};
Point(13) = {-1,4,0,0.1};
Point(14) = {1,4,0,0.1};
Point(15) = {2,4,0,0.1};
Point(16) = {3,4,0,0.1};
Point(17) = {4,4,0,0.1};
Point(18) = {5,4,0,0.1};
Point(19) = {2,3,0,0.1};
Point(20) = {1,3,0,0.1};
Point(21) = {8.25,1.8,0,0.1};
Point(22) = {5,3,0,0.1};
Circle(1) = {3,2,6};
Circle(2) = {6,2,1};
Circle(3) = {8,5,7};
Circle(4) = {7,5,4};
Point(23) = {4,3,0,0.1};
Circle(5) = {18,17,23};
Circle(6) = {23,17,16};
Circle(7) = {15,14,20};
Circle(8) = {20,14,12};
Line(9) = {1,9};
Line(10) = {9,13};
Line(11) = {13,12};
Line(12) = {15,16};
Line(13) = {18,11};
Line(14) = {11,10};
Line(15) = {10,8};
Line(16) = {4,3};
Line Loop(17) = {14,15,3,4,16,1,2,9,10,11,-8,-7,12,-6,-5,13};
Plane Surface(18) = {17};
Transfinite Line {14,10} = 50 Using Bump 0.3;
Transfinite Line {11,8,7,12,6,5,13,15,3,4,16,1,2,9} = 30 Using Progression 1;
Transfinite Surface {18} = {9,13,11,10};
Recombine Surface {18};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment