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
5cb40de3
Commit
5cb40de3
authored
13 years ago
by
Emilie Marchandise
Browse files
Options
Downloads
Patches
Plain Diff
gmshLevelset OK for python binding
parent
661e73cb
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Geo/MElementCut.cpp
+0
-2
0 additions, 2 deletions
Geo/MElementCut.cpp
Geo/gmshLevelset.h
+10
-7
10 additions, 7 deletions
Geo/gmshLevelset.h
Parser/Gmsh.y
+4
-4
4 additions, 4 deletions
Parser/Gmsh.y
with
14 additions
and
13 deletions
Geo/MElementCut.cpp
+
0
−
2
View file @
5cb40de3
...
...
@@ -1338,9 +1338,7 @@ GModel *buildCutMesh(GModel *gm, gLevelset *ls,
}
for
(
DI_Point
::
Container
::
iterator
it
=
cp
.
begin
();
it
!=
cp
.
end
();
it
++
)
delete
*
it
;
printf
(
"coucou delet dim =%d
\n
"
,
gmEntities
[
i
]
->
dim
());
for
(
unsigned
int
k
=
0
;
k
<
lines
.
size
();
k
++
)
delete
lines
[
k
];
printf
(
"coucou delet
\n
"
);
for
(
unsigned
int
k
=
0
;
k
<
triangles
.
size
();
k
++
)
delete
triangles
[
k
];
for
(
unsigned
int
k
=
0
;
k
<
quads
.
size
();
k
++
)
delete
quads
[
k
];
for
(
unsigned
int
k
=
0
;
k
<
tetras
.
size
();
k
++
)
delete
tetras
[
k
];
...
...
This diff is collapsed.
Click to expand it.
Geo/gmshLevelset.h
+
10
−
7
View file @
5cb40de3
...
...
@@ -271,13 +271,16 @@ class gLevelsetTools : public gLevelset
{
protected:
std
::
vector
<
gLevelset
*>
children
;
bool
_delChildren
;
//flag to delete only if called from gmsh Parser
public:
gLevelsetTools
()
{}
gLevelsetTools
(
std
::
vector
<
gLevelset
*>
&
p
)
{
children
=
p
;}
gLevelsetTools
(
const
std
::
vector
<
gLevelset
*>
&
p
,
bool
delC
=
false
)
{
children
=
p
;
_delChildren
=
delC
;}
gLevelsetTools
(
const
gLevelsetTools
&
);
~
gLevelsetTools
()
{
for
(
int
i
=
0
;
i
<
(
int
)
children
.
size
();
i
++
)
delete
children
[
i
];
virtual
~
gLevelsetTools
()
{
if
(
_delChildren
){
for
(
int
i
=
0
;
i
<
(
int
)
children
.
size
();
i
++
)
delete
children
[
i
];
}
}
double
operator
()
(
const
double
x
,
const
double
y
,
const
double
z
)
const
{
double
d
=
(
*
children
[
0
])(
x
,
y
,
z
);
...
...
@@ -328,7 +331,7 @@ public:
class
gLevelsetCut
:
public
gLevelsetTools
{
public:
gLevelsetCut
(
std
::
vector
<
gLevelset
*>
p
)
:
gLevelsetTools
(
p
)
{
}
gLevelsetCut
(
std
::
vector
<
gLevelset
*>
p
,
bool
delC
=
false
)
:
gLevelsetTools
(
p
,
delC
)
{
}
double
choose
(
double
d1
,
double
d2
)
const
{
return
(
d1
>
-
d2
)
?
d1
:
-
d2
;
// greater of d1 and -d2
}
...
...
@@ -341,7 +344,7 @@ public:
class
gLevelsetUnion
:
public
gLevelsetTools
{
public:
gLevelsetUnion
(
std
::
vector
<
gLevelset
*>
p
)
:
gLevelsetTools
(
p
)
{
}
gLevelsetUnion
(
std
::
vector
<
gLevelset
*>
p
,
bool
delC
=
false
)
:
gLevelsetTools
(
p
,
delC
)
{
}
gLevelsetUnion
(
const
gLevelsetUnion
&
lv
)
:
gLevelsetTools
(
lv
){}
virtual
gLevelset
*
clone
()
const
{
return
new
gLevelsetUnion
(
*
this
);}
...
...
@@ -355,7 +358,7 @@ public:
class
gLevelsetIntersection
:
public
gLevelsetTools
{
public:
gLevelsetIntersection
(
std
::
vector
<
gLevelset
*>
p
)
:
gLevelsetTools
(
p
)
{
}
gLevelsetIntersection
(
std
::
vector
<
gLevelset
*>
p
,
bool
delC
=
false
)
:
gLevelsetTools
(
p
,
delC
)
{
}
gLevelsetIntersection
(
const
gLevelsetIntersection
&
lv
)
:
gLevelsetTools
(
lv
)
{
}
virtual
gLevelset
*
clone
()
const
{
return
new
gLevelsetIntersection
(
*
this
);
}
...
...
This diff is collapsed.
Click to expand it.
Parser/Gmsh.y
+
4
−
4
View file @
5cb40de3
...
...
@@ -1987,7 +1987,7 @@ LevelSet :
if(!pl) yymsg(0, "Levelset Union %d : unknown levelset %d", t, (int)d);
else vl.push_back(pl->ls);
}
gLevelset *ls = new gLevelsetUnion(vl);
gLevelset *ls = new gLevelsetUnion(vl
, True
);
LevelSet *l = Create_LevelSet(t, ls);
Tree_Add(GModel::current()->getGEOInternals()->LevelSets, &l);
}
...
...
@@ -2005,7 +2005,7 @@ LevelSet :
if(!pl) yymsg(0, "Levelset Intersection %d : unknown levelset %d", t, (int)d);
else vl.push_back(pl->ls);
}
gLevelset *ls = new gLevelsetIntersection(vl);
gLevelset *ls = new gLevelsetIntersection(vl
, True
);
LevelSet *l = Create_LevelSet(t, ls);
Tree_Add(GModel::current()->getGEOInternals()->LevelSets, &l);
}
...
...
@@ -2023,7 +2023,7 @@ LevelSet :
if(!pl) yymsg(0, "Levelset Cut %d : unknown levelset %d", t, (int)d);
else vl.push_back(pl->ls);
}
gLevelset *ls = new gLevelsetCut(vl);
gLevelset *ls = new gLevelsetCut(vl
, True
);
LevelSet *l = Create_LevelSet(t, ls);
Tree_Add(GModel::current()->getGEOInternals()->LevelSets, &l);
}
...
...
@@ -2041,7 +2041,7 @@ LevelSet :
if(!pl) yymsg(0, "Levelset Crack %d : unknown levelset %d", t, (int)d);
else vl.push_back(pl->ls);
}
gLevelset *ls = new gLevelsetCrack(vl);
gLevelset *ls = new gLevelsetCrack(vl
, True
);
LevelSet *l = Create_LevelSet(t, ls);
Tree_Add(GModel::current()->getGEOInternals()->LevelSets, &l);
}
...
...
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