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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
83a495e4
Commit
83a495e4
authored
13 years ago
by
Emilie Marchandise
Browse files
Options
Downloads
Patches
Plain Diff
No commit message
No commit message
parent
b76bf509
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Geo/gmshLevelset.cpp
+2
-43
2 additions, 43 deletions
Geo/gmshLevelset.cpp
with
2 additions
and
43 deletions
Geo/gmshLevelset.cpp
+
2
−
43
View file @
83a495e4
...
@@ -134,7 +134,8 @@ void computeLevelset(GModel *gm, cartesianBox<double> &box)
...
@@ -134,7 +134,8 @@ void computeLevelset(GModel *gm, cartesianBox<double> &box)
SPoint3
p1
(
v1
->
x
(),
v1
->
y
(),
v1
->
z
());
SPoint3
p1
(
v1
->
x
(),
v1
->
y
(),
v1
->
z
());
SPoint3
p2
(
v2
->
x
(),
v2
->
y
(),
v2
->
z
());
SPoint3
p2
(
v2
->
x
(),
v2
->
y
(),
v2
->
z
());
SPoint3
p3
(
v3
->
x
(),
v3
->
y
(),
v3
->
z
());
SPoint3
p3
(
v3
->
x
(),
v3
->
y
(),
v3
->
z
());
signedDistancesPointsTriangle
(
localdist
,
dummy
,
nodes
,
p1
,
p2
,
p3
);
//sign plus if in the direction of the normal
signedDistancesPointsTriangle
(
localdist
,
dummy
,
nodes
,
p2
,
p1
,
p3
);
}
}
if
(
dist
.
empty
())
if
(
dist
.
empty
())
dist
=
localdist
;
dist
=
localdist
;
...
@@ -750,12 +751,9 @@ gLevelsetDistGeom::gLevelsetDistGeom(std::string geomBox, std::string name, int
...
@@ -750,12 +751,9 @@ gLevelsetDistGeom::gLevelsetDistGeom(std::string geomBox, std::string name, int
Msg
::
Info
(
"Computing levelset on the cartesian grid"
);
Msg
::
Info
(
"Computing levelset on the cartesian grid"
);
computeLevelset
(
gm
,
*
_box
);
computeLevelset
(
gm
,
*
_box
);
double
dist
=
_box
->
getValueContainingPoint
(
0
,
0
,
0
);
Msg
::
Info
(
"Renumbering mesh vertices across levels"
);
Msg
::
Info
(
"Renumbering mesh vertices across levels"
);
_box
->
renumberNodes
();
_box
->
renumberNodes
();
double
dist2
=
_box
->
getValueContainingPoint
(
0
,
0
,
0
);
printf
(
"dist =%g dist2=%g
\n
"
,
dist
,
dist2
);
_box
->
writeMSH
(
"yeah.msh"
,
false
);
_box
->
writeMSH
(
"yeah.msh"
,
false
);
delete
gm
;
delete
gm
;
...
@@ -766,45 +764,6 @@ gLevelsetDistGeom::gLevelsetDistGeom(std::string geomBox, std::string name, int
...
@@ -766,45 +764,6 @@ gLevelsetDistGeom::gLevelsetDistGeom(std::string geomBox, std::string name, int
double
gLevelsetDistGeom
::
operator
()
(
const
double
x
,
const
double
y
,
const
double
z
)
const
{
double
gLevelsetDistGeom
::
operator
()
(
const
double
x
,
const
double
y
,
const
double
z
)
const
{
double
dist
=
_box
->
getValueContainingPoint
(
x
,
y
,
z
);
double
dist
=
_box
->
getValueContainingPoint
(
x
,
y
,
z
);
//double ana = sqrt((y*y)+(z*z))-0.5;
//printf("xyz = %g %g %g dist = %g (%g)\n",x, y, z, -dist, ana );
//exit(1);
// std::vector<SPoint3> nodes;
// nodes.push_back(SPoint3(x,y,z));
// for (GModel::fiter fit = _model->firstFace(); fit != _model->lastFace(); fit++){
// if((*fit)->geomType() == GEntity::DiscreteSurface){
// for(unsigned int k = 0; k < (*fit)->getNumMeshElements(); k++){
// std::vector<double> iDistances;
// std::vector<SPoint3> iClosePts;
// std::vector<double> iDistancesE;
// MElement *e = (*fit)->getMeshElement(k);
// if(e->getType() == TYPE_TRI){
// MVertex *v1 = e->getVertex(0);
// MVertex *v2 = e->getVertex(1);
// MVertex *v3 = e->getVertex(2);
// SPoint3 p1(v1->x(), v1->y(), v1->z());
// SPoint3 p2(v2->x(), v2->y(), v2->z());
// SPoint3 p3(v3->x(),v3->y(),v3->z());
// signedDistancesPointsTriangle(iDistances, iClosePts, nodes, p1, p2, p3);
// }
// if (fabs(iDistances[0]) < fabs(dist)) dist = iDistances[0];
// }
// }
// else{
// printf(" CAD surface \n");
// //look in utils_api_demos maincartesian
// // for (GModel::fiter fit = _model->firstFace(); fit != _model->lastFace(); fit++){
// // for (int i = 0; i < (*fit)->stl_triangles.size(); i += 3){
// }
// }
// double ana = sqrt((y*y)+(z*z))-0.5;
// printf("xyz = %g %g %g dist = %g (%g)\n",x, y, z, -dist, ana );
//exit(1);
return
dist
;
return
dist
;
}
}
...
...
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