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
3dd3bd2a
Commit
3dd3bd2a
authored
15 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
levelset from postview !
parent
0e7846b7
No related branches found
No related tags found
No related merge requests found
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Geo/gmshLevelset.h
+30
-1
30 additions, 1 deletion
Geo/gmshLevelset.h
Parser/Gmsh.tab.cpp
+271
-257
271 additions, 257 deletions
Parser/Gmsh.tab.cpp
Parser/Gmsh.y
+14
-0
14 additions, 0 deletions
Parser/Gmsh.y
benchmarks/levelset/carreTri.geo
+4
-1
4 additions, 1 deletion
benchmarks/levelset/carreTri.geo
with
319 additions
and
259 deletions
Geo/gmshLevelset.h
+
30
−
1
View file @
3dd3bd2a
...
...
@@ -14,6 +14,8 @@
#include
"DILevelset.h"
#include
"mathEvaluator.h"
#include
"PView.h"
#include
"OctreePost.h"
class
gLevelsetMathEval
:
public
gLevelsetPrimitive
{
...
...
@@ -36,7 +38,34 @@ public:
values
[
1
]
=
y
;
values
[
2
]
=
z
;
if
(
_expr
->
eval
(
values
,
res
))
return
res
[
0
];
return
0.
;
return
1.
;
}
int
type
()
const
{
return
UNKNOWN
;
}
};
class
gLevelsetPostView
:
public
gLevelsetPrimitive
{
int
_viewIndex
;
OctreePost
*
_octree
;
public:
gLevelsetPostView
(
int
index
,
int
&
tag
)
:
_viewIndex
(
index
),
gLevelsetPrimitive
(
tag
)
{
if
(
_viewIndex
>=
0
&&
_viewIndex
<
PView
::
list
.
size
()){
PView
*
view
=
PView
::
list
[
_viewIndex
];
_octree
=
new
OctreePost
(
view
);
}
else
{
Msg
::
Error
(
"Unknown View[%d] in PostView levelset"
,
_viewIndex
);
_octree
=
0
;
}
}
~
gLevelsetPostView
(){
if
(
_octree
)
delete
_octree
;
}
virtual
double
operator
()
(
const
double
&
x
,
const
double
&
y
,
const
double
&
z
)
const
{
if
(
!
_octree
)
return
1.
;
double
val
=
1.
;
_octree
->
searchScalar
(
x
,
y
,
z
,
&
val
,
0
);
return
val
;
}
int
type
()
const
{
return
UNKNOWN
;
}
};
...
...
This diff is collapsed.
Click to expand it.
Parser/Gmsh.tab.cpp
+
271
−
257
View file @
3dd3bd2a
This diff is collapsed.
Click to expand it.
Parser/Gmsh.y
+
14
−
0
View file @
3dd3bd2a
...
...
@@ -1880,6 +1880,20 @@ LevelSet :
Tree_Add(GModel::current()->getGEOInternals()->LevelSets, &l);
}
}
else if(!strcmp($2, "PostView")){
int t = (int)$4;
if(FindLevelSet(t)){
yymsg(0, "Levelset %d already exists", t);
}
else {
if(List_Nbr($7) > 0){
double d; List_Read($7, 0, &d);
gLevelset *ls = new gLevelsetPostView((int)d, t);
LevelSet *l = Create_LevelSet(ls->getTag(), ls);
Tree_Add(GModel::current()->getGEOInternals()->LevelSets, &l);
}
}
}
else
yymsg(0, "Wrong levelset definition (%d)", $4);
Free($2);
...
...
This diff is collapsed.
Click to expand it.
benchmarks/levelset/carreTri.geo
+
4
−
1
View file @
3dd3bd2a
...
...
@@ -27,13 +27,16 @@ Physical Line(400) = {4};
Mesh
2
;
Merge
"level.med"
;
Levelset
Plane
(
1
)
=
{
0
,
-
1
,
0
,
0.22
};
Levelset
Plane
(
2
)
=
{
-
1
,
0
,
0
,
0.5
};
Levelset
Sphere
(
3
)
=
{{
0
,
0
,
0
},
0.75
};
Levelset
Ellipsoid
(
4
)
=
{
{
0
,
0
,
0
},
{
1
,
0
,
0
},
0.55
,
0.55
,
0.75
};
Levelset
Intersection
(
10
)
=
{
1
,
3
};
Levelset
PostView
(
11
)
=
0
;
Levelset
CutMesh
{
1
0
};
Levelset
CutMesh
{
1
1
};
Physical
Surface
(
1000
)
=
{
6
};
Physical
Surface
(
2000
)
=
{
7
};
...
...
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