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
c4c6d08c
Commit
c4c6d08c
authored
11 years ago
by
Matti Pellika
Browse files
Options
Downloads
Patches
Plain Diff
Need for info
parent
bef6f586
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
Geo/CellComplex.cpp
+11
-0
11 additions, 0 deletions
Geo/CellComplex.cpp
Geo/CellComplex.h
+2
-5
2 additions, 5 deletions
Geo/CellComplex.h
Geo/ChainComplex.cpp
+2
-2
2 additions, 2 deletions
Geo/ChainComplex.cpp
Geo/Homology.cpp
+15
-4
15 additions, 4 deletions
Geo/Homology.cpp
with
30 additions
and
11 deletions
Geo/CellComplex.cpp
+
11
−
0
View file @
c4c6d08c
...
...
@@ -421,6 +421,17 @@ int CellComplex::coreduction(int dim, int omit,
return
count
;
}
int
CellComplex
::
getSize
(
int
dim
,
bool
orig
)
{
if
(
dim
==
-
1
)
{
unsigned
int
size
=
0
;
if
(
!
orig
)
for
(
int
i
=
0
;
i
<
4
;
i
++
)
size
+=
_cells
[
i
].
size
();
else
for
(
int
i
=
0
;
i
<
4
;
i
++
)
size
+=
_ocells
[
i
].
size
();
return
size
;
}
if
(
!
orig
)
return
_cells
[
dim
].
size
();
else
return
_ocells
[
dim
].
size
();
}
int
CellComplex
::
getDomain
(
Cell
*
cell
,
std
::
string
&
str
)
{
int
domain
=
0
;
...
...
This diff is collapsed.
Click to expand it.
Geo/CellComplex.h
+
2
−
5
View file @
c4c6d08c
...
...
@@ -101,12 +101,9 @@ class CellComplex
bool
simplicial
()
const
{
return
_simplicial
;
}
bool
relative
()
const
{
return
_relative
;
}
// get the number of certain dimensional cells
int
getSize
(
int
dim
,
bool
orig
=
false
){
if
(
!
orig
)
return
_cells
[
dim
].
size
();
else
return
_ocells
[
dim
].
size
();
}
// if dim = -1 return the number of all cells
int
getSize
(
int
dim
,
bool
orig
=
false
);
// get domain of a cell
// cell in domain relative to subdomain -> domain = 0
...
...
This diff is collapsed.
Click to expand it.
Geo/ChainComplex.cpp
+
2
−
2
View file @
c4c6d08c
...
...
@@ -661,7 +661,7 @@ void ChainComplex::smoothenChain(std::map<Cell*, int, Less_Cell>& cells)
}
eraseNullCells
(
cells
);
int
size
=
cells
.
size
();
Msg
::
Info
(
"Simplified a %d-chain from %d cells to %d cells"
,
Msg
::
Debug
(
"Simplified a %d-chain from %d cells to %d cells"
,
dim
,
start
,
size
);
}
...
...
This diff is collapsed.
Click to expand it.
Geo/Homology.cpp
+
15
−
4
View file @
c4c6d08c
...
...
@@ -181,9 +181,11 @@ void Homology::findHomologyBasis(std::vector<int> dim)
if
(
_cellComplex
==
NULL
)
_createCellComplex
();
if
(
_cellComplex
->
isReduced
())
_cellComplex
->
restoreComplex
();
Msg
::
StatusBar
(
true
,
"Reducing cell complex..."
);
double
t1
=
Cpu
();
double
size1
=
_cellComplex
->
getSize
(
-
1
);
_cellComplex
->
reduceComplex
(
_combine
,
_omit
);
if
(
_combine
>
1
&&
!
_smoothen
)
{
...
...
@@ -195,7 +197,9 @@ void Homology::findHomologyBasis(std::vector<int> dim)
}
double
t2
=
Cpu
();
Msg
::
StatusBar
(
true
,
"Done reducing cell complex (%g s)"
,
t2
-
t1
);
double
size2
=
_cellComplex
->
getSize
(
-
1
);
Msg
::
StatusBar
(
true
,
"Done reducing cell complex (%g s, %g \%)"
,
t2
-
t1
,
(
1.
-
size2
/
size1
)
*
100.
);
Msg
::
Info
(
"%d volumes, %d faces, %d edges, and %d vertices"
,
_cellComplex
->
getSize
(
3
),
_cellComplex
->
getSize
(
2
),
_cellComplex
->
getSize
(
1
),
_cellComplex
->
getSize
(
0
));
...
...
@@ -268,6 +272,7 @@ void Homology::findCohomologyBasis(std::vector<int> dim)
Msg
::
StatusBar
(
true
,
"Reducing cell complex..."
);
double
t1
=
Cpu
();
double
size1
=
_cellComplex
->
getSize
(
-
1
);
_cellComplex
->
coreduceComplex
(
_combine
,
_omit
,
_heuristic
);
...
...
@@ -281,8 +286,10 @@ void Homology::findCohomologyBasis(std::vector<int> dim)
}
double
t2
=
Cpu
();
double
size2
=
_cellComplex
->
getSize
(
-
1
);
Msg
::
StatusBar
(
true
,
"Done reducing cell complex (%g s)"
,
t2
-
t1
);
Msg
::
StatusBar
(
true
,
"Done reducing cell complex (%g s, %g \%)"
,
t2
-
t1
,
(
1.
-
size2
/
size1
)
*
100.
);
Msg
::
Info
(
"%d volumes, %d faces, %d edges, and %d vertices"
,
_cellComplex
->
getSize
(
3
),
_cellComplex
->
getSize
(
2
),
_cellComplex
->
getSize
(
1
),
_cellComplex
->
getSize
(
0
));
...
...
@@ -521,11 +528,15 @@ void Homology::findBettiNumbers()
Msg
::
StatusBar
(
true
,
"Reducing cell complex..."
);
double
t1
=
Cpu
();
double
size1
=
_cellComplex
->
getSize
(
-
1
);
_cellComplex
->
bettiReduceComplex
();
double
t2
=
Cpu
();
Msg
::
StatusBar
(
true
,
"Done reducing cell complex (%g s)"
,
t2
-
t1
);
double
size2
=
_cellComplex
->
getSize
(
-
1
);
Msg
::
StatusBar
(
true
,
"Done reducing cell complex (%g s, %g \%)"
,
t2
-
t1
,
(
1.
-
size2
/
size1
)
*
100.
);
Msg
::
Info
(
"%d volumes, %d faces, %d edges, and %d vertices"
,
_cellComplex
->
getSize
(
3
),
_cellComplex
->
getSize
(
2
),
_cellComplex
->
getSize
(
1
),
_cellComplex
->
getSize
(
0
));
...
...
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