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
97ecdfdc
Commit
97ecdfdc
authored
13 years ago
by
Matti Pellika
Browse files
Options
Downloads
Patches
Plain Diff
Small cleanup.
parent
355a6c2a
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/Cell.h
+8
-6
8 additions, 6 deletions
Geo/Cell.h
Geo/CellComplex.cpp
+5
-2
5 additions, 2 deletions
Geo/CellComplex.cpp
Geo/Chain.h
+3
-3
3 additions, 3 deletions
Geo/Chain.h
with
16 additions
and
11 deletions
Geo/Cell.h
+
8
−
6
View file @
97ecdfdc
...
@@ -134,7 +134,8 @@ class Cell {
...
@@ -134,7 +134,8 @@ class Cell {
return
size
;
}
return
size
;
}
// get the (orig: original) cell boundary
// get the (orig: original) cell boundary
void
getBoundary
(
std
::
map
<
Cell
*
,
short
int
,
Less_Cell
>&
boundary
,
bool
orig
=
false
){
void
getBoundary
(
std
::
map
<
Cell
*
,
short
int
,
Less_Cell
>&
boundary
,
bool
orig
=
false
){
boundary
.
clear
();
boundary
.
clear
();
for
(
biter
it
=
firstBoundary
();
it
!=
lastBoundary
();
it
++
){
for
(
biter
it
=
firstBoundary
();
it
!=
lastBoundary
();
it
++
){
Cell
*
cell
=
it
->
first
;
Cell
*
cell
=
it
->
first
;
...
@@ -142,7 +143,8 @@ class Cell {
...
@@ -142,7 +143,8 @@ class Cell {
if
(
orig
&&
it
->
second
.
geto
()
!=
0
)
boundary
[
cell
]
=
it
->
second
.
geto
();
if
(
orig
&&
it
->
second
.
geto
()
!=
0
)
boundary
[
cell
]
=
it
->
second
.
geto
();
}
}
}
}
void
getCoboundary
(
std
::
map
<
Cell
*
,
short
int
,
Less_Cell
>&
coboundary
,
bool
orig
=
false
){
void
getCoboundary
(
std
::
map
<
Cell
*
,
short
int
,
Less_Cell
>&
coboundary
,
bool
orig
=
false
){
coboundary
.
clear
();
coboundary
.
clear
();
for
(
biter
it
=
firstCoboundary
();
it
!=
lastCoboundary
();
it
++
){
for
(
biter
it
=
firstCoboundary
();
it
!=
lastCoboundary
();
it
++
){
Cell
*
cell
=
it
->
first
;
Cell
*
cell
=
it
->
first
;
...
@@ -182,13 +184,13 @@ class Cell {
...
@@ -182,13 +184,13 @@ class Cell {
// tools for combined cells
// tools for combined cells
bool
isCombined
()
const
{
return
_combined
;
}
bool
isCombined
()
const
{
return
_combined
;
}
virtual
void
getCells
(
std
::
map
<
Cell
*
,
int
,
Less_Cell
>&
cells
)
{
typedef
std
::
map
<
Cell
*
,
int
,
Less_Cell
>::
iterator
citer
;
virtual
void
getCells
(
std
::
map
<
Cell
*
,
int
,
Less_Cell
>&
cells
)
{
cells
.
clear
();
cells
.
clear
();
cells
[
this
]
=
1
;
cells
[
this
]
=
1
;
return
;
}
}
virtual
int
getNumCells
()
const
{
return
1
;}
virtual
int
getNumCells
()
const
{
return
1
;
}
typedef
std
::
map
<
Cell
*
,
int
,
Less_Cell
>::
iterator
citer
;
bool
operator
==
(
const
Cell
&
c2
)
const
{
bool
operator
==
(
const
Cell
&
c2
)
const
{
return
(
this
->
getNum
()
==
c2
.
getNum
());
return
(
this
->
getNum
()
==
c2
.
getNum
());
...
...
This diff is collapsed.
Click to expand it.
Geo/CellComplex.cpp
+
5
−
2
View file @
97ecdfdc
...
@@ -203,8 +203,8 @@ int CellComplex::reduction(int dim, bool omit,
...
@@ -203,8 +203,8 @@ int CellComplex::reduction(int dim, bool omit,
citer
cit
=
firstCell
(
dim
-
1
);
citer
cit
=
firstCell
(
dim
-
1
);
while
(
cit
!=
lastCell
(
dim
-
1
)){
while
(
cit
!=
lastCell
(
dim
-
1
)){
Cell
*
cell
=
*
cit
;
Cell
*
cell
=
*
cit
;
if
(
cell
->
getCoboundarySize
()
==
1
if
(
cell
->
getCoboundarySize
()
==
1
&&
&&
inSameDomain
(
cell
,
cell
->
firstCoboundary
()
->
first
)){
inSameDomain
(
cell
,
cell
->
firstCoboundary
()
->
first
)){
cit
++
;
cit
++
;
if
(
dim
==
getDim
()
&&
omit
){
if
(
dim
==
getDim
()
&&
omit
){
omittedCells
.
push_back
(
cell
->
firstCoboundary
()
->
first
);
omittedCells
.
push_back
(
cell
->
firstCoboundary
()
->
first
);
...
@@ -576,6 +576,9 @@ bool CellComplex::restoreComplex()
...
@@ -576,6 +576,9 @@ bool CellComplex::restoreComplex()
_deleteCount
++
;
_deleteCount
++
;
}
}
_newcells
.
clear
();
_newcells
.
clear
();
Msg
::
Info
(
"Restored Cell Complex:"
);
Msg
::
Info
(
" %d volumes, %d faces, %d edges and %d vertices"
,
getSize
(
3
),
getSize
(
2
),
getSize
(
1
),
getSize
(
0
));
return
true
;
return
true
;
}
}
else
{
else
{
...
...
This diff is collapsed.
Click to expand it.
Geo/Chain.h
+
3
−
3
View file @
97ecdfdc
...
@@ -278,13 +278,13 @@ void Chain<C>::addMeshElement(MElement* e, C coeff)
...
@@ -278,13 +278,13 @@ void Chain<C>::addMeshElement(MElement* e, C coeff)
template
<
class
C
>
template
<
class
C
>
void
Chain
<
C
>::
addElemChain
(
const
ElemChain
&
c
,
C
coeff
)
void
Chain
<
C
>::
addElemChain
(
const
ElemChain
&
c
,
C
coeff
)
{
{
if
(
coeff
==
0
)
return
;
if
(
_dim
!=
-
1
&&
_dim
!=
c
.
getDim
())
{
if
(
_dim
!=
-
1
&&
_dim
!=
c
.
getDim
())
{
Msg
::
Error
(
"Cannot add
%d-
elementrary chain to %d-chain"
,
Msg
::
Error
(
"Cannot add elementrary
d%-
chain to %d-chain"
,
c
.
getDim
(),
_dim
);
c
.
getDim
(),
_dim
);
return
;
return
;
}
}
if
(
_dim
==
-
1
)
_dim
=
c
.
getDim
();
if
(
_dim
==
-
1
)
_dim
=
c
.
getDim
();
if
(
coeff
==
0
)
return
;
std
::
pair
<
ecit
,
bool
>
ii
=
_elemChains
.
insert
(
std
::
make_pair
(
c
,
coeff
)
);
std
::
pair
<
ecit
,
bool
>
ii
=
_elemChains
.
insert
(
std
::
make_pair
(
c
,
coeff
)
);
if
(
!
ii
.
second
)
{
if
(
!
ii
.
second
)
{
ii
.
first
->
second
+=
coeff
*
c
.
compareOrientation
(
ii
.
first
->
first
);
ii
.
first
->
second
+=
coeff
*
c
.
compareOrientation
(
ii
.
first
->
first
);
...
@@ -310,7 +310,7 @@ Chain<C>& Chain<C>::operator*=(const C& coeff)
...
@@ -310,7 +310,7 @@ Chain<C>& Chain<C>::operator*=(const C& coeff)
for
(
ecit
it
=
_elemChains
.
begin
();
it
!=
_elemChains
.
end
();
it
++
)
for
(
ecit
it
=
_elemChains
.
begin
();
it
!=
_elemChains
.
end
();
it
++
)
it
->
second
*=
coeff
;
it
->
second
*=
coeff
;
return
*
this
;
return
*
this
;
}
}
template
<
class
C
>
template
<
class
C
>
void
Chain
<
C
>::
addToModel
(
GModel
*
m
,
bool
post
)
const
void
Chain
<
C
>::
addToModel
(
GModel
*
m
,
bool
post
)
const
...
...
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