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
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
Larry Price
gmsh
Commits
4b35d709
Commit
4b35d709
authored
13 years ago
by
Emilie Sauvage
Browse files
Options
Downloads
Patches
Plain Diff
Minor fixes for surface remeshing based on curvature
parent
56a48ea1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Geo/Curvature.cpp
+59
-3
59 additions, 3 deletions
Geo/Curvature.cpp
Geo/Curvature.h
+2
-0
2 additions, 0 deletions
Geo/Curvature.h
Geo/GFaceCompound.cpp
+21
-8
21 additions, 8 deletions
Geo/GFaceCompound.cpp
with
82 additions
and
11 deletions
Geo/Curvature.cpp
+
59
−
3
View file @
4b35d709
...
...
@@ -137,7 +137,7 @@ void Curvature::initializeMap()
// face is a pointer to one surface of the group "FinalEntityList"
GFace
*
face
=
_ptFinalEntityList
[
i
];
std
::
cout
<<
"Face "
<<
i
<<
" has "
<<
face
->
getNumMeshElements
()
<<
" elements"
<<
std
::
endl
;
//
std::cout << "Face " << i << " has " << face->getNumMeshElements() << " elements" << std::endl;
// Loop over the element all the element of the "myTag"-surface
for
(
int
iElem
=
0
;
iElem
<
face
->
getNumMeshElements
();
iElem
++
)
...
...
@@ -488,7 +488,7 @@ void Curvature::computeRusinkiewiczNormals()
void
Curvature
::
computePointareas
()
{
std
::
cout
<<
"Computing point areas... "
<<
std
::
endl
;
//
std::cout << "Computing point areas... " << std::endl;
// std::cout << "The mesh has " << _VertexToInt.size() << " nodes" << std::endl;
SVector3
e
[
3
];
...
...
@@ -565,12 +565,13 @@ void Curvature::computePointareas()
}
//End of loop over iElem
std
::
cout
<<
"Done computing pointareas"
<<
std
::
endl
;
// std::cout << "_pointareas.size = " << _pointareas.size() << std::endl;
// std::cout << "_cornerareas.size = " << _cornerareas.size() << std::endl;
}
//End of loop over _ptFinalEntityList
//std::cout << "Done computing pointareas" << std::endl;
}
//End of the method "computePointareas"
...
...
@@ -918,6 +919,61 @@ void Curvature::computeCurvature_Rusinkiewicz()
}
//========================================================================================================
void
Curvature
::
elementNodalAbsoluteValues
(
MTriangle
*
triangle
,
double
&
c0
,
double
&
c1
,
double
&
c2
)
{
MVertex
*
A
=
triangle
->
getVertex
(
0
);
MVertex
*
B
=
triangle
->
getVertex
(
1
);
MVertex
*
C
=
triangle
->
getVertex
(
2
);
int
V0
=
0
;
int
V1
=
0
;
int
V2
=
0
;
std
::
map
<
int
,
int
>::
iterator
vertexIterator
;
vertexIterator
=
_VertexToInt
.
find
(
A
->
getNum
()
);
if
(
vertexIterator
!=
_VertexToInt
.
end
()
)
{
V0
=
(
*
vertexIterator
).
second
;
}
else
{
std
::
cout
<<
"Didn't find vertex with number "
<<
A
->
getNum
()
<<
" in _VertextToInt !"
<<
std
::
endl
;
}
vertexIterator
=
_VertexToInt
.
find
(
B
->
getNum
()
);
if
(
vertexIterator
!=
_VertexToInt
.
end
()
)
{
V1
=
(
*
vertexIterator
).
second
;
}
else
{
std
::
cout
<<
"Didn't find vertex with number "
<<
B
->
getNum
()
<<
" in _VertextToInt !"
<<
std
::
endl
;
}
vertexIterator
=
_VertexToInt
.
find
(
C
->
getNum
()
);
if
(
vertexIterator
!=
_VertexToInt
.
end
()
)
{
V2
=
(
*
vertexIterator
).
second
;
}
else
{
std
::
cout
<<
"Didn't find vertex with number "
<<
C
->
getNum
()
<<
" in _VertextToInt !"
<<
std
::
endl
;
}
// const int V0 = _VertexToInt[A->getNum()];
// const int V1 = _VertexToInt[B->getNum()];
// const int V2 = _VertexToInt[C->getNum()];
c0
=
std
::
abs
(
_VertexCurve
[
V0
]);
//Mean curvature in vertex 0
c1
=
std
::
abs
(
_VertexCurve
[
V1
]);
//Mean curvature in vertex 1
c2
=
std
::
abs
(
_VertexCurve
[
V2
]);
//Mean curvature in vertex 2
}
//========================================================================================================
void
Curvature
::
writeToPosFile
(
const
std
::
string
&
filename
)
...
...
This diff is collapsed.
Click to expand it.
Geo/Curvature.h
+
2
−
0
View file @
4b35d709
...
...
@@ -189,6 +189,8 @@ public:
void
elementNodalValues
(
MTriangle
*
triangle
,
double
&
c0
,
double
&
c1
,
double
&
c2
);
void
elementNodalAbsoluteValues
(
MTriangle
*
triangle
,
double
&
c0
,
double
&
c1
,
double
&
c2
);
void
writeToPosFile
(
const
std
::
string
&
filename
);
void
writeToVtkFile
(
const
std
::
string
&
filename
);
...
...
This diff is collapsed.
Click to expand it.
Geo/GFaceCompound.cpp
+
21
−
8
View file @
4b35d709
...
...
@@ -1373,7 +1373,7 @@ double GFaceCompound::curvatureMax(const SPoint2 ¶m) const
if
(
!
Curvature
::
valueAlreadyComputed
()
)
{
std::cout << "Need to compute curvature" << std::endl;
std
::
cout
<<
"Need to compute
discrete
curvature"
<<
std
::
endl
;
std
::
cout
<<
"Getting instance of curvature"
<<
std
::
endl
;
curvature
.
setGModel
(
model
()
);
...
...
@@ -1381,7 +1381,7 @@ double GFaceCompound::curvatureMax(const SPoint2 ¶m) const
curvature
.
writeToPosFile
(
"curvature.pos"
);
curvature
.
writeToVtkFile
(
"curvature.vtk"
);
std::cout << " ... finished" << std::endl;
std
::
cout
<<
" ...
computing curvature
finished"
<<
std
::
endl
;
}
...
...
@@ -1414,15 +1414,29 @@ double GFaceCompound::curvatureMax(const SPoint2 ¶m) const
}
else
if
(
lt
->
gf
->
geomType
()
==
GEntity
::
DiscreteSurface
)
{
//
std::cout << "I'm in DiscreteSurface" << std::endl;
//
std::cout << "I'm in DiscreteSurface" << std::endl;
double
c0
;
double
c1
;
double
c2
;
curvature.elementNodalValues(lt->tri,c0, c1, c2);
//curvature.elementNodalValues(lt->tri,c0, c1, c2);
curvature
.
elementNodalAbsoluteValues
(
lt
->
tri
,
c0
,
c1
,
c2
);
double
cv
=
(
1
-
U
-
V
)
*
c0
+
U
*
c1
+
V
*
c2
;
//std::cin.get();
//std::cout << "(" << c0 << "," << c1 << "," << c2 << ")" << std::endl;
//std::cout << "The curvature of the triangle " << lt->tri->getNum() << " is " << cv << std::endl;
// std::cout << "(" << c0 << "," << c1 << "," << c2 << ")" << std::endl;
// MVertex* V0 = lt->tri->getVertex(0);
// MVertex* V1 = lt->tri->getVertex(1);
// MVertex* V2 = lt->tri->getVertex(2);
// std::cout << "=====================================================" << std::endl;
// std::cout << "Parametric coordinates: " << param.x() << "," << param.y() << std::endl;
// std::cout << "The coordinates of the triangle are:" << std::endl;
// std::cout << "\t[" << V0->x() << "," << V0->y() << "," << V0->z() << "]" << std::endl;
// std::cout << "\t[" << V1->x() << "," << V1->y() << "," << V1->z() << "]" << std::endl;
// std::cout << "\t[" << V2->x() << "," << V2->y() << "," << V2->z() << "]" << std::endl;
// std::cout << "The curvature of the triangle " << lt->tri->getNum() << " is " << cv << std::endl;
// std::cout << std::endl;
// std::cin.get();
// return 1.0;
return
cv
;
// double curv= 0.;
...
...
@@ -1430,7 +1444,6 @@ double GFaceCompound::curvatureMax(const SPoint2 ¶m) const
// return curv;
}
std::cin.get();
return
0.
;
}
...
...
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