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
251f1a18
Commit
251f1a18
authored
15 years ago
by
Matti Pellika
Browse files
Options
Downloads
Patches
Plain Diff
Simplify.
parent
6c971614
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Geo/Cell.cpp
+19
-30
19 additions, 30 deletions
Geo/Cell.cpp
Geo/Cell.h
+4
-4
4 additions, 4 deletions
Geo/Cell.h
Geo/CellComplex.cpp
+4
-12
4 additions, 12 deletions
Geo/CellComplex.cpp
with
27 additions
and
46 deletions
Geo/Cell.cpp
+
19
−
30
View file @
251f1a18
...
...
@@ -299,56 +299,45 @@ CombinedCell::CombinedCell(Cell* c1, Cell* c2, bool orMatch, bool co) : Cell()
}
// boundary cells
std
::
map
<
Cell
*
,
int
,
Less_Cell
>
c1Boundary
;
c1
->
getBoundary
(
c1Boundary
);
std
::
map
<
Cell
*
,
int
,
Less_Cell
>
c2Boundary
;
c2
->
getBoundary
(
c2Boundary
);
for
(
biter
it
=
c1Boundary
.
begin
();
it
!=
c1Boundary
.
end
();
it
++
){
for
(
biter
it
=
c1
->
firstBoundary
();
it
!=
c1
->
lastBoundary
();
it
++
){
Cell
*
cell
=
(
*
it
).
first
;
int
ori
=
(
*
it
).
second
;
cell
->
removeCoboundaryCell
(
c1
);
cell
->
removeCoboundaryCell
(
c1
,
false
);
this
->
addBoundaryCell
(
ori
,
cell
,
false
,
true
);
}
for
(
biter
it
=
c2Boundary
.
begin
();
it
!=
c2Boundary
.
end
();
it
++
){
for
(
biter
it
=
c2
->
first
Boundary
();
it
!=
c2
->
last
Boundary
();
it
++
){
Cell
*
cell
=
(
*
it
).
first
;
if
(
!
orMatch
)
(
*
it
).
second
=
-
1
*
(
*
it
).
second
;
int
ori
=
(
*
it
).
second
;
cell
->
removeCoboundaryCell
(
c2
);
if
(
co
){
biter
it2
=
c1Boundary
.
find
(
cell
);
if
(
it2
==
c1Boundary
.
end
()){
cell
->
removeCoboundaryCell
(
c2
,
false
);
if
(
co
&&
!
c1
->
hasBoundary
(
cell
)){
this
->
addBoundaryCell
(
ori
,
cell
,
false
,
true
);
}
else
if
(
!
co
)
this
->
addBoundaryCell
(
ori
,
cell
,
false
,
true
);
}
else
this
->
addBoundaryCell
(
ori
,
cell
,
false
,
true
);
}
c1
->
clearBoundary
(
);
c2
->
clearBoundary
();
// coboundary cells
std
::
map
<
Cell
*
,
int
,
Less_Cell
>
c1Coboundary
;
c1
->
getCoboundary
(
c1Coboundary
);
std
::
map
<
Cell
*
,
int
,
Less_Cell
>
c2Coboundary
;
c2
->
getCoboundary
(
c2Coboundary
);
for
(
biter
it
=
c1Coboundary
.
begin
();
it
!=
c1Coboundary
.
end
();
it
++
){
for
(
biter
it
=
c1
->
firstCoboundary
();
it
!=
c1
->
lastCoboundary
();
it
++
){
Cell
*
cell
=
(
*
it
).
first
;
int
ori
=
(
*
it
).
second
;
cell
->
removeBoundaryCell
(
c1
);
cell
->
removeBoundaryCell
(
c1
,
false
);
this
->
addCoboundaryCell
(
ori
,
cell
,
false
,
true
);
}
for
(
biter
it
=
c2Coboundary
.
begin
();
it
!=
c2Coboundary
.
end
();
it
++
){
for
(
biter
it
=
c2
->
first
Coboundary
();
it
!=
c2
->
last
Coboundary
();
it
++
){
Cell
*
cell
=
(
*
it
).
first
;
if
(
!
orMatch
)
(
*
it
).
second
=
-
1
*
(
*
it
).
second
;
int
ori
=
(
*
it
).
second
;
cell
->
removeBoundaryCell
(
c2
);
if
(
!
co
){
biter
it2
=
c1Coboundary
.
find
(
cell
);
if
(
it2
==
c1Coboundary
.
end
()){
cell
->
removeBoundaryCell
(
c2
,
false
);
if
(
!
co
&&
!
c1
->
hasCoboundary
(
cell
)){
this
->
addCoboundaryCell
(
ori
,
cell
,
false
,
true
);
}
else
if
(
co
)
this
->
addCoboundaryCell
(
ori
,
cell
,
false
,
true
);
}
else
this
->
addCoboundaryCell
(
ori
,
cell
,
false
,
true
);
}
c1
->
clearCoboundary
();
c2
->
clearCoboundary
();
}
...
...
This diff is collapsed.
Click to expand it.
Geo/Cell.h
+
4
−
4
View file @
251f1a18
...
...
@@ -145,13 +145,13 @@ class Cell
// add (co)boundary cell
void
addBoundaryCell
(
int
orientation
,
Cell
*
cell
,
bool
orig
=
false
,
bool
other
=
true
);
bool
orig
,
bool
other
);
void
addCoboundaryCell
(
int
orientation
,
Cell
*
cell
,
bool
orig
=
false
,
bool
other
=
true
);
bool
orig
,
bool
other
);
// remove (co)boundary cell
void
removeBoundaryCell
(
Cell
*
cell
,
bool
other
=
true
);
void
removeCoboundaryCell
(
Cell
*
cell
,
bool
other
=
true
);
void
removeBoundaryCell
(
Cell
*
cell
,
bool
other
);
void
removeCoboundaryCell
(
Cell
*
cell
,
bool
other
);
// true if has given cell on (original) (co)boundary
bool
hasBoundary
(
Cell
*
cell
,
bool
orig
=
false
);
...
...
This diff is collapsed.
Click to expand it.
Geo/CellComplex.cpp
+
4
−
12
View file @
251f1a18
...
...
@@ -398,11 +398,7 @@ int CellComplex::cocombine(int dim)
Cell
*
c2
=
(
*
it
).
first
;
if
(
!
(
*
c1
==
*
c2
)
&&
abs
(
or1
)
==
abs
(
or2
)
&&
inSameDomain
(
s
,
c1
)
&&
inSameDomain
(
s
,
c2
)
&&
c1
->
getNumSortedVertices
()
<
getSize
(
dim
)
// heuristics for mammoth cell birth control
&&
c2
->
getNumSortedVertices
()
<
getSize
(
dim
)){
&&
inSameDomain
(
s
,
c1
)
&&
inSameDomain
(
s
,
c2
)){
removeCell
(
s
);
c1
->
getCoboundary
(
cbd_c
);
...
...
@@ -460,11 +456,7 @@ int CellComplex::combine(int dim)
Cell
*
c2
=
(
*
it
).
first
;
if
(
!
(
*
c1
==
*
c2
)
&&
abs
(
or1
)
==
abs
(
or2
)
&&
inSameDomain
(
s
,
c1
)
&&
inSameDomain
(
s
,
c2
)
&&
c1
->
getNumSortedVertices
()
<
getSize
(
dim
)
// heuristics for mammoth cell birth control
&&
c2
->
getNumSortedVertices
()
<
getSize
(
dim
)){
&&
inSameDomain
(
s
,
c1
)
&&
inSameDomain
(
s
,
c2
)){
removeCell
(
s
);
c1
->
getBoundary
(
bd_c
);
...
...
@@ -506,7 +498,7 @@ bool CellComplex::coherent()
citer
cit
=
_cells
[
bdCell
->
getDim
()].
find
(
bdCell
);
if
(
cit
==
lastCell
(
bdCell
->
getDim
())){
printf
(
"Warning! Boundary cell not in cell complex! Boundary removed.
\n
"
);
cell
->
removeBoundaryCell
(
bdCell
);
cell
->
removeBoundaryCell
(
bdCell
,
false
);
coherent
=
false
;
}
if
(
!
bdCell
->
hasCoboundary
(
cell
)){
...
...
@@ -525,7 +517,7 @@ bool CellComplex::coherent()
citer
cit
=
_cells
[
cbdCell
->
getDim
()].
find
(
cbdCell
);
if
(
cit
==
lastCell
(
cbdCell
->
getDim
())){
printf
(
"Warning! Coboundary cell not in cell complex! Coboundary removed.
\n
"
);
cell
->
removeCoboundaryCell
(
cbdCell
);
cell
->
removeCoboundaryCell
(
cbdCell
,
false
);
coherent
=
false
;
}
if
(
!
cbdCell
->
hasBoundary
(
cell
)){
...
...
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