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
262b1281
Commit
262b1281
authored
12 years ago
by
Matti Pellika
Browse files
Options
Downloads
Patches
Plain Diff
Simplify
parent
4fa51484
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Geo/CellComplex.cpp
+10
-29
10 additions, 29 deletions
Geo/CellComplex.cpp
Geo/Homology.cpp
+9
-0
9 additions, 0 deletions
Geo/Homology.cpp
with
19 additions
and
29 deletions
Geo/CellComplex.cpp
+
10
−
29
View file @
262b1281
...
...
@@ -85,7 +85,6 @@ bool CellComplex::_insertCells(std::vector<MElement*>& elements,
if
(
type
==
TYPE_PYR
||
type
==
TYPE_PRI
||
type
==
TYPE_POLYG
||
type
==
TYPE_POLYH
)
{
Msg
::
Error
(
"Mesh element type %d not implemented in homology solver"
,
type
);
return
false
;
}
if
(
type
==
TYPE_QUA
||
type
==
TYPE_HEX
)
_simplicial
=
false
;
...
...
@@ -226,26 +225,10 @@ bool CellComplex::_immunizeCells(std::vector<MElement*>& elements)
CellComplex
::~
CellComplex
()
{
for
(
int
i
=
0
;
i
<
4
;
i
++
){
if
(
_saveorig
)
{
for
(
citer
cit
=
_ocells
[
i
].
begin
();
cit
!=
_ocells
[
i
].
end
();
cit
++
){
Cell
*
cell
=
*
cit
;
delete
cell
;
_deleteCount
++
;
}
for
(
citer
cit
=
_cells
[
i
].
begin
();
cit
!=
_cells
[
i
].
end
();
cit
++
){
Cell
*
cell
=
*
cit
;
if
(
cell
->
isCombined
())
{
delete
cell
;
_deleteCount
++
;
}
}
}
else
{
for
(
citer
cit
=
_cells
[
i
].
begin
();
cit
!=
_cells
[
i
].
end
();
cit
++
){
Cell
*
cell
=
*
cit
;
delete
cell
;
_deleteCount
++
;
}
for
(
citer
cit
=
_cells
[
i
].
begin
();
cit
!=
_cells
[
i
].
end
();
cit
++
){
Cell
*
cell
=
*
cit
;
delete
cell
;
_deleteCount
++
;
}
}
...
...
@@ -295,10 +278,7 @@ void CellComplex::removeCell(Cell* cell, bool other, bool del)
else
_numRelativeCells
[
dim
]
-=
1
;
}
if
(
!
erased
)
Msg
::
Debug
(
"Tried to remove a cell from the cell complex
\n
"
);
if
(
!
_saveorig
&&
(
!
del
||
!
cell
->
isCombined
()))
_removedcells
.
push_back
(
cell
);
else
if
(
!
del
&&
cell
->
isCombined
())
_removedcells
.
push_back
(
cell
);
else
if
(
!
del
)
_removedcells
.
push_back
(
cell
);
}
void
CellComplex
::
enqueueCells
(
std
::
map
<
Cell
*
,
short
int
,
Less_Cell
>&
cells
,
...
...
@@ -582,6 +562,7 @@ int CellComplex::coreduceComplex(int combine, bool omit, int heuristic)
cit
++
;
}
}
for
(
int
j
=
1
;
j
<=
getDim
();
j
++
)
count
+=
coreduction
(
j
,
-
1
,
empty
);
...
...
@@ -751,8 +732,8 @@ int CellComplex::combine(int dim)
CombinedCell
*
newCell
=
new
CombinedCell
(
c1
,
c2
,
(
or1
!=
or2
));
_createCount
++
;
removeCell
(
c1
,
true
,
true
);
removeCell
(
c2
,
true
,
true
);
removeCell
(
c1
,
true
,
c1
->
isCombined
()
);
removeCell
(
c2
,
true
,
c2
->
isCombined
()
);
insertCell
(
newCell
);
cit
=
firstCell
(
dim
);
...
...
@@ -835,8 +816,8 @@ int CellComplex::cocombine(int dim)
CombinedCell
*
newCell
=
new
CombinedCell
(
c1
,
c2
,
(
or1
!=
or2
),
true
);
_createCount
++
;
removeCell
(
c1
,
true
,
true
);
removeCell
(
c2
,
true
,
true
);
removeCell
(
c1
,
true
,
c1
->
isCombined
()
);
removeCell
(
c2
,
true
,
c2
->
isCombined
()
);
insertCell
(
newCell
);
cit
=
firstCell
(
dim
);
...
...
This diff is collapsed.
Click to expand it.
Geo/Homology.cpp
+
9
−
0
View file @
262b1281
...
...
@@ -169,6 +169,7 @@ Homology::~Homology()
void
Homology
::
findHomologyBasis
(
std
::
vector
<
int
>
dim
)
{
double
t0
=
Cpu
();
std
::
string
domain
=
_getDomainString
(
_domain
,
_subdomain
);
Msg
::
Info
(
""
);
Msg
::
Info
(
"To compute domain (%s) homology spaces"
,
domain
.
c_str
());
...
...
@@ -237,6 +238,9 @@ void Homology::findHomologyBasis(std::vector<int> dim)
Msg
::
Info
(
"H_2 = %d"
,
_betti
[
2
]);
Msg
::
Info
(
"H_3 = %d"
,
_betti
[
3
]);
double
t3
=
Cpu
();
Msg
::
Info
(
"Done computing (%s) homology spaces (%g s)"
,
domain
.
c_str
(),
t3
-
t0
);
Msg
::
StatusBar
(
false
,
"H_0: %d, H_1: %d, H_2: %d, H_3: %d"
,
_betti
[
0
],
_betti
[
1
],
_betti
[
2
],
_betti
[
3
]);
...
...
@@ -248,6 +252,7 @@ void Homology::findHomologyBasis(std::vector<int> dim)
void
Homology
::
findCohomologyBasis
(
std
::
vector
<
int
>
dim
)
{
double
t0
=
Cpu
();
std
::
string
domain
=
_getDomainString
(
_domain
,
_subdomain
);
Msg
::
Info
(
""
);
Msg
::
Info
(
"To compute domain (%s) cohomology spaces"
,
domain
.
c_str
());
...
...
@@ -321,6 +326,9 @@ void Homology::findCohomologyBasis(std::vector<int> dim)
Msg
::
Info
(
"H^2 = %d"
,
_betti
[
2
]);
Msg
::
Info
(
"H^3 = %d"
,
_betti
[
3
]);
double
t3
=
Cpu
();
Msg
::
Info
(
"Done computing (%s) cohomology spaces (%g s)"
,
domain
.
c_str
(),
t3
-
t0
);
Msg
::
StatusBar
(
false
,
"H^0: %d, H^1: %d, H^2: %d, H^3: %d"
,
_betti
[
0
],
_betti
[
1
],
_betti
[
2
],
_betti
[
3
]);
...
...
@@ -427,6 +435,7 @@ void Homology::findCompatibleBasisPair(int master, std::vector<int> dim)
void
Homology
::
_addToModel
(
int
dim
,
bool
co
,
bool
post
,
int
physicalNumRequest
)
const
{
if
(
dim
<
0
||
dim
>
3
)
return
;
int
pgnum
=
-
1
;
std
::
vector
<
int
>
physicals
;
if
(
!
co
)
{
...
...
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