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
27f441c0
Commit
27f441c0
authored
18 years ago
by
Jean-François Remacle
Browse files
Options
Downloads
Patches
Plain Diff
*** empty log message ***
parent
ced5d60d
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
Mesh/Makefile
+2
-2
2 additions, 2 deletions
Mesh/Makefile
Mesh/meshGRegionDelaunayInsertion.cpp
+122
-0
122 additions, 0 deletions
Mesh/meshGRegionDelaunayInsertion.cpp
Mesh/meshGRegionDelaunayInsertion.h
+49
-0
49 additions, 0 deletions
Mesh/meshGRegionDelaunayInsertion.h
with
173 additions
and
2 deletions
Mesh/Makefile
+
2
−
2
View file @
27f441c0
# $Id: Makefile,v 1.13
1
2006-09-11 1
5:23:54
remacle Exp $
# $Id: Makefile,v 1.13
2
2006-09-11 1
8:16:19
remacle Exp $
#
# Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
#
...
...
@@ -66,7 +66,7 @@ SRC = 1D_Mesh.cpp \
meshGEdge.cpp
\
meshGFace.cpp
\
meshGFaceTransfinite.cpp
\
meshG
Face
DelaunayIns
t
ertion.cpp
\
meshG
Region
DelaunayInsertion.cpp
\
meshGRegion.cpp
\
Nurbs.cpp
\
Interpolation.cpp
\
...
...
This diff is collapsed.
Click to expand it.
Mesh/meshGRegionDelaunayInsertion.cpp
0 → 100644
+
122
−
0
View file @
27f441c0
#include
"meshGRegionDelaunayInsertion.h"
#include
<set>
#include
<algorithm>
int
faces
[
4
][
3
]
=
{{
0
,
1
,
2
},{
0
,
2
,
3
},{
0
,
1
,
3
},{
1
,
2
,
3
}};
struct
faceXtet
{
MVertex
*
v
[
3
];
MTet4
*
t1
;
int
i1
;
faceXtet
(
MTet4
*
_t
,
int
iFac
)
:
t1
(
_t
),
i1
(
iFac
)
{
v
[
0
]
=
t1
->
tet
()
->
getVertex
(
faces
[
iFac
][
0
]
);
v
[
1
]
=
t1
->
tet
()
->
getVertex
(
faces
[
iFac
][
1
]
);
v
[
2
]
=
t1
->
tet
()
->
getVertex
(
faces
[
iFac
][
2
]
);
std
::
sort
(
&
v
[
0
],
&
v
[
2
]
);
}
inline
bool
operator
<
(
const
faceXtet
&
other
)
const
{
if
(
v
[
0
]
<
other
.
v
[
0
])
return
true
;
if
(
v
[
0
]
>
other
.
v
[
0
])
return
false
;
if
(
v
[
1
]
<
other
.
v
[
1
])
return
true
;
if
(
v
[
1
]
>
other
.
v
[
1
])
return
false
;
if
(
v
[
2
]
<
other
.
v
[
2
])
return
true
;
return
false
;
}
};
void
connectTets
(
std
::
list
<
MTet4
*>
&
tets
)
{
std
::
set
<
faceXtet
>
conn
;
{
std
::
list
<
MTet4
*>::
iterator
it
=
tets
.
begin
();
while
(
it
!=
tets
.
end
())
{
for
(
int
i
=
0
;
i
<
4
;
i
++
)
{
faceXtet
fxt
(
*
it
,
i
);
std
::
set
<
faceXtet
>::
iterator
found
=
conn
.
find
(
fxt
);
if
(
found
==
conn
.
end
())
conn
.
insert
(
fxt
);
else
{
found
->
t1
->
setNeigh
(
found
->
i1
,
*
it
);
(
*
it
)
->
setNeigh
(
i
,
found
->
t1
);
}
}
++
it
;
}
}
}
void
recurFindCavity
(
std
::
list
<
faceXtet
>
&
shell
,
std
::
list
<
MTet4
*>
&
cavity
,
MVertex
*
v
,
MTet4
*
t
)
{
for
(
int
i
=
0
;
i
<
4
;
i
++
)
{
MTet4
*
neigh
=
t
->
getNeigh
(
i
)
;
if
(
neigh
&&
neigh
->
inCircumSphere
(
v
)
)
{
neigh
->
remove
();
cavity
.
push_back
(
neigh
);
recurFindCavity
(
shell
,
cavity
,
v
,
neigh
);
}
else
if
(
neigh
)
{
shell
.
push_back
(
faceXtet
(
neigh
,
i
)
);
}
}
}
void
insertVertex
(
std
::
set
<
MTet4
*>
allTets
,
MVertex
*
v
,
MTet4
*
t
)
{
std
::
list
<
faceXtet
>
shell
;
std
::
list
<
MTet4
*>
cavity
;
std
::
list
<
MTet4
*>
new_cavity
;
t
->
remove
();
cavity
.
push_back
(
t
);
recurFindCavity
(
shell
,
cavity
,
v
,
t
);
std
::
list
<
faceXtet
>::
iterator
it
=
shell
.
begin
();
double
newVolume
=
0
;
double
oldVolume
=
0
;
std
::
list
<
MTet4
*>::
iterator
ittet
=
cavity
.
begin
();
std
::
list
<
MTet4
*>::
iterator
ittete
=
cavity
.
end
();
while
(
ittet
!=
ittete
)
{
oldVolume
+=
(
*
ittet
)
->
getVolume
();
cavity
.
push_back
(
*
ittet
);
++
ittet
;
}
while
(
it
!=
shell
.
end
())
{
MTetrahedron
*
t
=
new
MTetrahedron
(
it
->
v
[
0
],
it
->
v
[
1
],
it
->
v
[
2
],
v
);
MTet4
*
t4
=
new
MTet4
(
t
);
new_cavity
.
push_back
(
t4
);
new_cavity
.
push_back
(
it
->
t1
);
newVolume
+=
t4
->
getVolume
();
++
it
;
}
if
(
fabs
(
oldVolume
-
newVolume
)
<
1.e-10
*
oldVolume
)
{
connectTets
(
new_cavity
);
}
else
{
connectTets
(
cavity
);
}
}
This diff is collapsed.
Click to expand it.
Mesh/meshGRegionDelaunayInsertion.h
0 → 100644
+
49
−
0
View file @
27f441c0
#ifndef _DELAUNAYINSERTION_H_
#define _DELAUNAYINSERTION_H_
#include
"MElement.h"
#include
<list>
class
MTet4
{
bool
deleted
;
double
size
;
MTetrahedron
*
base
;
MTet4
*
neigh
[
4
];
public
:
MTet4
(
MTetrahedron
*
t
)
:
deleted
(
false
),
base
(
t
)
{
neigh
[
0
]
=
neigh
[
1
]
=
neigh
[
2
]
=
neigh
[
3
]
=
0
;
}
inline
MTetrahedron
*
tet
()
const
{
return
base
;}
inline
void
setNeigh
(
int
iN
,
MTet4
*
n
)
{
neigh
[
iN
]
=
n
;}
inline
MTet4
*
getNeigh
(
int
iN
)
const
{
return
neigh
[
iN
];}
double
inCircumSphere
(
const
double
*
p
)
const
;
inline
double
inCircumSphere
(
double
x
,
double
y
,
double
z
)
const
{
const
double
p
[
3
]
=
{
x
,
y
,
z
};
return
inCircumSphere
(
p
);
}
inline
double
inCircumSphere
(
const
MVertex
*
v
)
const
{
return
inCircumSphere
(
v
->
x
(),
v
->
y
(),
v
->
z
()
);
}
double
getVolume
()
const
{
return
base
->
getVolume
()
;
};
inline
bool
operator
<
(
const
MTet4
&
other
)
const
{
return
size
<
other
.
size
;}
inline
void
remove
()
{
deleted
=
true
;
for
(
int
i
=
0
;
i
<
4
;
i
++
)
if
(
neigh
[
i
])
neigh
[
i
]
->
remove
(
this
);
}
inline
void
remove
(
MTet4
*
t
)
{
for
(
int
i
=
0
;
i
<
4
;
i
++
)
if
(
neigh
[
i
]
==
t
)
neigh
[
i
]
=
0
;
}
};
void
connectTets
(
std
::
list
<
MTet4
*>
&
);
bool
insertVertex
(
MVertex
*
v
,
MTet4
*
t
);
#endif
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