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
dd1ed40a
Commit
dd1ed40a
authored
12 years ago
by
Matti Pellika
Browse files
Options
Downloads
Patches
Plain Diff
Next try
parent
53f37bce
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Geo/Chain.cpp
+6
-0
6 additions, 0 deletions
Geo/Chain.cpp
Geo/Chain.h
+5
-13
5 additions, 13 deletions
Geo/Chain.h
Geo/Homology.cpp
+6
-12
6 additions, 12 deletions
Geo/Homology.cpp
Plugin/HomologyPostProcessing.cpp
+2
-4
2 additions, 4 deletions
Plugin/HomologyPostProcessing.cpp
with
19 additions
and
29 deletions
Geo/Chain.cpp
+
6
−
0
View file @
dd1ed40a
...
...
@@ -27,6 +27,12 @@ void updateFltkTree()
#endif
}
std
::
string
convertInt
(
int
number
){
std
::
stringstream
stream
;
stream
<<
number
;
return
stream
.
str
();
}
std
::
map
<
GEntity
*
,
std
::
set
<
MVertex
*
,
MVertexLessThanNum
>
,
GEntityLessThan
>
ElemChain
::
_vertexCache
;
...
...
This diff is collapsed.
Click to expand it.
Geo/Chain.h
+
5
−
13
View file @
dd1ed40a
...
...
@@ -21,14 +21,7 @@
#if defined(HAVE_KBIPACK)
void
updateFltkTree
();
template
<
class
TTypeA
,
class
TTypeB
>
bool
convert
(
const
TTypeA
&
input
,
TTypeB
&
output
){
std
::
stringstream
stream
;
stream
<<
input
;
stream
>>
output
;
return
stream
.
good
();
}
std
::
string
convertInt
(
int
number
);
// Class whose derivative classes are to have partial or total order
template
<
class
Type
>
...
...
@@ -508,17 +501,16 @@ void Chain<C>::addToModel(GModel* m, bool post,
#if defined(HAVE_POST)
if
(
post
&&
CTX
::
instance
()
->
batch
==
0
)
{
// create PView for instant visualization
/*std::string pnum = "";
convert(physicalNum, pnum);
std
::
string
pnum
=
convertInt
(
physicalNum
);
std
::
string
postname
=
pnum
+
": "
+
_name
;
PView
*
view
=
new
PView
(
postname
,
"ElementData"
,
m
,
data
,
0
,
1
);
// the user should be interested about the orientations
int size = 30;
/*
int size = 30;
PViewOptions* opt = view->getOptions();
if(opt->tangents == 0) opt->tangents = size;
if(opt->normals == 0) opt->normals = size;
view->setOptions(opt);
updateFltkTree();
*/
view->setOptions(opt);
*/
updateFltkTree
();
}
#endif
}
...
...
This diff is collapsed.
Click to expand it.
Geo/Homology.cpp
+
6
−
12
View file @
dd1ed40a
...
...
@@ -208,12 +208,10 @@ void Homology::findHomologyBasis(std::vector<int> dim)
_deleteChains
(
dim
);
for
(
int
j
=
0
;
j
<
4
;
j
++
){
_betti
[
j
]
=
0
;
std
::
string
dimension
=
""
;
convert
(
j
,
dimension
);
std
::
string
dimension
=
convertInt
(
j
);
for
(
int
i
=
1
;
i
<=
chainComplex
.
getBasisSize
(
j
,
3
);
i
++
){
std
::
string
generator
=
""
;
convert
(
i
,
generator
);
std
::
string
generator
=
convertInt
(
i
);
std
::
string
name
=
"H_"
+
dimension
+
domain
+
generator
;
std
::
map
<
Cell
*
,
int
,
Less_Cell
>
chain
;
...
...
@@ -291,13 +289,11 @@ void Homology::findCohomologyBasis(std::vector<int> dim)
_deleteCochains
(
dim
);
for
(
int
i
=
0
;
i
<
4
;
i
++
)
_betti
[
i
]
=
0
;
for
(
int
j
=
3
;
j
>
-
1
;
j
--
){
std
::
string
dimension
=
""
;
convert
(
j
,
dimension
);
std
::
string
dimension
=
convertInt
(
j
);
for
(
int
i
=
1
;
i
<=
chainComplex
.
getBasisSize
(
j
,
3
);
i
++
){
std
::
string
generator
=
""
;
convert
(
i
,
generator
);
std
::
string
generator
=
convertInt
(
i
);
std
::
string
name
=
"H^"
+
dimension
+
domain
+
generator
;
std
::
map
<
Cell
*
,
int
,
Less_Cell
>
chain
;
...
...
@@ -538,8 +534,7 @@ std::string Homology::_getDomainString(const std::vector<int>& domain,
if
(
domain
.
empty
())
domainString
+=
"0"
;
else
{
for
(
unsigned
int
i
=
0
;
i
<
domain
.
size
();
i
++
){
std
::
string
temp
=
""
;
convert
(
domain
.
at
(
i
),
temp
);
std
::
string
temp
=
convertInt
(
domain
.
at
(
i
));
domainString
+=
temp
;
if
(
domain
.
size
()
-
1
>
i
){
domainString
+=
", "
;
...
...
@@ -551,8 +546,7 @@ std::string Homology::_getDomainString(const std::vector<int>& domain,
if
(
!
subdomain
.
empty
()){
domainString
+=
", {"
;
for
(
unsigned
int
i
=
0
;
i
<
subdomain
.
size
();
i
++
){
std
::
string
temp
=
""
;
convert
(
subdomain
.
at
(
i
),
temp
);
std
::
string
temp
=
convertInt
(
subdomain
.
at
(
i
));
domainString
+=
temp
;
if
(
subdomain
.
size
()
-
1
>
i
){
domainString
+=
", "
;
...
...
This diff is collapsed.
Click to expand it.
Plugin/HomologyPostProcessing.cpp
+
2
−
4
View file @
dd1ed40a
...
...
@@ -288,11 +288,9 @@ PView *GMSH_HomologyPostProcessingPlugin::execute(PView *v)
ElemChain
::
clearVertexCache
();
}
std
::
string
dims
=
""
;
std
::
string
nums
=
""
;
for
(
unsigned
int
i
=
0
;
i
<
newBasis
.
size
();
i
++
)
{
convert
(
newBasis
.
at
(
i
).
getDim
()
,
dims
);
convert
(
i
+
1
,
nums
);
std
::
string
dims
=
convert
Int
(
newBasis
.
at
(
i
).
getDim
());
std
::
string
nums
=
convert
Int
(
i
+
1
);
newBasis
.
at
(
i
).
setName
(
"C"
+
dims
+
" "
+
cname
+
nums
);
newBasis
.
at
(
i
).
addToModel
(
m
);
}
...
...
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