Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
gmsh
gmsh
Commits
28e46135
Commit
28e46135
authored
15 years ago
by
Jean-François Remacle
Browse files
Options
Downloads
Patches
Plain Diff
*** empty log message ***
parent
09cc49fc
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Geo/GFaceCompound.cpp
+34
-35
34 additions, 35 deletions
Geo/GFaceCompound.cpp
with
34 additions
and
35 deletions
Geo/GFaceCompound.cpp
+
34
−
35
View file @
28e46135
...
@@ -96,20 +96,6 @@ static void computeCGKernelPolygon(std::map<MVertex*,SPoint3> &coordinates, std:
...
@@ -96,20 +96,6 @@ static void computeCGKernelPolygon(std::map<MVertex*,SPoint3> &coordinates, std:
ucg
=
0.0
;
ucg
=
0.0
;
vcg
=
0.0
;
vcg
=
0.0
;
//Place at CG polygon
//--------------------
// int nbVert = cavV.size();
// printf("nbVert =%d \n", nbVert);
// for (std::set<MVertex*>::const_iterator it = cavV.begin() ; it != cavV.end() ; ++it){
// SPoint3 vsp = coordinates[*it];
// ucg+=vsp[0];
// vcg+=vsp[1];
// }
// ucg/=nbVert;
// vcg/=nbVert;
// printf("ucg=%g vcg=%g \n", ucg, vcg);
//Place at CG KERNEL polygon
//Place at CG KERNEL polygon
//--------------------------
//--------------------------
...
@@ -166,7 +152,7 @@ static void computeCGKernelPolygon(std::map<MVertex*,SPoint3> &coordinates, std:
...
@@ -166,7 +152,7 @@ static void computeCGKernelPolygon(std::map<MVertex*,SPoint3> &coordinates, std:
// mat(2,0) =0.;mat(2,1)=1. ;
// mat(2,0) =0.;mat(2,1)=1. ;
// mat(3,0) =0.;mat(3,1)=0. ;
// mat(3,0) =0.;mat(3,1)=0. ;
double
eps
=-
5.e-
6
;
double
eps
=-
5.e-
7
;
int
N
=
nbPts
;
int
N
=
nbPts
;
std
::
set
<
int
>
setP
;
std
::
set
<
int
>
setP
;
...
@@ -247,8 +233,17 @@ static void computeCGKernelPolygon(std::map<MVertex*,SPoint3> &coordinates, std:
...
@@ -247,8 +233,17 @@ static void computeCGKernelPolygon(std::map<MVertex*,SPoint3> &coordinates, std:
vcg
/=
nbFinal
;
vcg
/=
nbFinal
;
}
}
else
{
else
{
Msg
::
Error
(
"No Kernel for polygon. Try reparametrization with new initial mesh."
);
Msg
::
Info
(
"----> No Kernel for polygon: place point at CG polygon."
);
Msg
::
Exit
(
0
);
//Place at CG polygon
//--------------------
for
(
std
::
vector
<
MVertex
*>::
iterator
it
=
cavV
.
begin
()
;
it
!=
cavV
.
end
()
;
++
it
){
SPoint3
vsp
=
coordinates
[
*
it
];
ucg
+=
vsp
[
0
];
vcg
+=
vsp
[
1
];
}
ucg
/=
nbPts
;
vcg
/=
nbPts
;
}
}
}
}
...
@@ -286,10 +281,14 @@ static void myPolygon(std::vector<MElement*> &vTri, std::vector<MVertex*> &vPoly
...
@@ -286,10 +281,14 @@ static void myPolygon(std::vector<MElement*> &vTri, std::vector<MVertex*> &vPoly
ite
=
ePoly
.
begin
()
;
ite
=
ePoly
.
begin
()
;
while
(
ite
!=
ePoly
.
end
()){
while
(
ite
!=
ePoly
.
end
()){
MVertex
*
vB
=
ite
->
getVertex
(
0
);
MVertex
*
vB
=
ite
->
getVertex
(
0
);
MVertex
*
vE
=
ite
->
getVertex
(
1
);
if
(
vB
==
vPoly
.
back
()){
if
(
vB
==
vPoly
.
back
()){
MVertex
*
vE
=
ite
->
getVertex
(
1
);
if
(
vE
!=
vINIT
)
vPoly
.
push_back
(
vE
);
if
(
vE
!=
vINIT
)
vPoly
.
push_back
(
vE
);
ePoly
.
erase
(
ite
);
ePoly
.
erase
(
ite
);
}
else
if
(
vE
==
vPoly
.
back
()){
if
(
vB
!=
vINIT
)
vPoly
.
push_back
(
vB
);
ePoly
.
erase
(
ite
);
}
}
else
ite
++
;
else
ite
++
;
}
}
...
@@ -400,9 +399,20 @@ void GFaceCompound::one2OneMap() const{
...
@@ -400,9 +399,20 @@ void GFaceCompound::one2OneMap() const{
bool
badCavity
=
checkCavity
(
vTri
);
bool
badCavity
=
checkCavity
(
vTri
);
if
(
badCavity
){
if
(
badCavity
){
Msg
::
Info
(
"Wrong cavity around vertex
(
%d onwhat=%d)."
,
v
->
getNum
(),
v
->
onWhat
()
->
dim
());
Msg
::
Info
(
"Wrong cavity around vertex %d
(
onwhat=%d)."
,
v
->
getNum
(),
v
->
onWhat
()
->
dim
());
Msg
::
Info
(
"--> Place vertex at center of gravity of %d-Polygon kernel."
,
vTri
.
size
());
Msg
::
Info
(
"--> Place vertex at center of gravity of %d-Polygon kernel."
,
vTri
.
size
());
double
u_cg
,
v_cg
;
myPolygon
(
vTri
,
cavV
);
computeCGKernelPolygon
(
coordinates
,
cavV
,
u_cg
,
v_cg
);
SPoint3
p_cg
(
u_cg
,
v_cg
,
0
);
coordinates
[
v
]
=
p_cg
;
// printf("Kernel CG: ucg=%g vcg=%g \n", u_cg, v_cg);
// bool testbadCavity = checkCavity(vTri);
// if (testbadCavity == true ) printf("**** New cavity is KO\n");
// else printf("-- New cavity is OK\n");
// for (int i=0; i< vTri.size(); i++){
// for (int i=0; i< vTri.size(); i++){
// MTriangle *t = (MTriangle*) vTri[i];
// MTriangle *t = (MTriangle*) vTri[i];
// SPoint3 v1 = coordinates[t->getVertex(0)];
// SPoint3 v1 = coordinates[t->getVertex(0)];
...
@@ -426,17 +436,6 @@ void GFaceCompound::one2OneMap() const{
...
@@ -426,17 +436,6 @@ void GFaceCompound::one2OneMap() const{
// printf("//Area=%g \n", a_new);
// printf("//Area=%g \n", a_new);
// }
// }
double
u_cg
,
v_cg
;
myPolygon
(
vTri
,
cavV
);
computeCGKernelPolygon
(
coordinates
,
cavV
,
u_cg
,
v_cg
);
SPoint3
p_cg
(
u_cg
,
v_cg
,
0
);
coordinates
[
v
]
=
p_cg
;
//printf("Kernel CG: ucg=%g vcg=%g \n", u_cg, v_cg);
//bool testbadCavity = checkCavity(vTri);
//if (testbadCavity == true ) printf("**** New cavity is KO\n");
//else printf("-- New cavity is OK\n");
}
}
}
}
...
@@ -759,9 +758,9 @@ void GFaceCompound::parametrize(iterationStep step) const
...
@@ -759,9 +758,9 @@ void GFaceCompound::parametrize(iterationStep step) const
Msg
::
Info
(
"Parametrizing Surface %d coordinate (ITER %d)"
,
tag
(),
step
);
Msg
::
Info
(
"Parametrizing Surface %d coordinate (ITER %d)"
,
tag
(),
step
);
#ifdef HAVE_GMM
#ifdef HAVE_GMM
//
gmshLinearSystemGmm<double> lsys;
gmshLinearSystemGmm
<
double
>
lsys
;
gmshLinearSystemCSRGmm
<
double
>
lsys
;
//
gmshLinearSystemCSRGmm<double> lsys;
lsys
.
setPrec
(
1.e-1
0
);
lsys
.
setPrec
(
1.e-1
5
);
if
(
Msg
::
GetVerbosity
()
==
99
)
lsys
.
setNoisy
(
2
);
if
(
Msg
::
GetVerbosity
()
==
99
)
lsys
.
setNoisy
(
2
);
#else
#else
gmshLinearSystemFull
<
double
>
lsys
;
gmshLinearSystemFull
<
double
>
lsys
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment