Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-tectonic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
podlesny
dune-tectonic
Commits
4ef15a45
Commit
4ef15a45
authored
10 years ago
by
Elias Pipping
Browse files
Options
Downloads
Patches
Plain Diff
[Cleanup] Extend simplex manager capabilities
parent
90c8424a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/sand-wedge-data/mygrid.cc
+26
-17
26 additions, 17 deletions
src/sand-wedge-data/mygrid.cc
src/sand-wedge-data/mygrid.hh
+2
-1
2 additions, 1 deletion
src/sand-wedge-data/mygrid.hh
with
28 additions
and
18 deletions
src/sand-wedge-data/mygrid.cc
+
26
−
17
View file @
4ef15a45
...
...
@@ -9,24 +9,33 @@
SimplexManager
::
SimplexManager
(
unsigned
int
shift
)
:
shift_
(
shift
)
{}
#endif
void
SimplexManager
::
addFromVertices
(
unsigned
int
U
,
unsigned
int
V
,
unsigned
int
W
)
{
// back-to-front, front-to-back, front-to-back
void
SimplexManager
::
addFromVerticesFBB
(
unsigned
int
U
,
unsigned
int
V
,
unsigned
int
W
)
{
#if MY_DIM == 3
unsigned
int
const
U2
=
U
+
shift_
;
unsigned
int
const
V2
=
V
+
shift_
;
unsigned
int
const
W2
=
W
+
shift_
;
// back-to-front, back-to-front, back-to-front
simplices_
.
push_back
({
U
,
V
,
W
,
U2
});
simplices_
.
push_back
({
V
,
V2
,
W2
,
U2
});
simplices_
.
push_back
({
W
,
W2
,
U2
,
V
});
#else
simplices_
.
push_back
({
U
,
V
,
W
});
#endif
}
// back-to-front, back-to-front, front-to-back
void
SimplexManager
::
addFromVerticesFFB
(
unsigned
int
U
,
unsigned
int
V
,
unsigned
int
W
)
{
#if MY_DIM == 3
unsigned
int
const
U2
=
U
+
shift_
;
unsigned
int
const
V2
=
V
+
shift_
;
unsigned
int
const
W2
=
W
+
shift_
;
// back-to-front, front-to-back, back-to-front would be
/*
simplices_
.
push_back
({
U
,
V
,
W
,
U2
});
simplices_
.
push_back
({
V
,
V2
,
W
,
U2
});
simplices_.push_back({ V2, W2, U2, W });
*/
simplices_
.
push_back
({
V2
,
W
,
U2
,
W2
});
#else
simplices_
.
push_back
({
U
,
V
,
W
});
#endif
...
...
@@ -108,16 +117,16 @@ template <class Grid> GridConstructor<Grid>::GridConstructor() {
#else
SimplexManager
sm
;
#endif
sm
.
addFromVertices
(
1
,
5
,
0
);
sm
.
addFromVertices
(
1
,
6
,
5
);
sm
.
addFromVertices
(
2
,
6
,
1
);
sm
.
addFromVertices
(
7
,
6
,
2
);
sm
.
addFromVertices
(
7
,
2
,
3
);
sm
.
addFromVertices
(
7
,
3
,
8
);
sm
.
addFromVertices
(
7
,
8
,
10
);
sm
.
addFromVertices
(
7
,
10
,
9
);
sm
.
addFromVertices
(
7
,
9
,
6
);
sm
.
addFromVertices
(
8
,
3
,
4
);
sm
.
addFromVertices
FBB
(
1
,
5
,
0
);
sm
.
addFromVertices
FBB
(
1
,
6
,
5
);
sm
.
addFromVertices
FBB
(
2
,
6
,
1
);
sm
.
addFromVertices
FBB
(
7
,
6
,
2
);
sm
.
addFromVertices
FBB
(
7
,
2
,
3
);
sm
.
addFromVertices
FBB
(
7
,
3
,
8
);
sm
.
addFromVertices
FBB
(
7
,
8
,
10
);
sm
.
addFromVertices
FBB
(
7
,
10
,
9
);
sm
.
addFromVertices
FBB
(
7
,
9
,
6
);
sm
.
addFromVertices
FBB
(
8
,
3
,
4
);
auto
const
&
simplices
=
sm
.
getSimplices
();
// sanity-check choices of simplices
...
...
This diff is collapsed.
Click to expand it.
src/sand-wedge-data/mygrid.hh
+
2
−
1
View file @
4ef15a45
...
...
@@ -49,7 +49,8 @@ class SimplexManager {
SimplexManager
(
unsigned
int
shift
);
#endif
void
addFromVertices
(
unsigned
int
U
,
unsigned
int
V
,
unsigned
int
W
);
void
addFromVerticesFBB
(
unsigned
int
U
,
unsigned
int
V
,
unsigned
int
W
);
void
addFromVerticesFFB
(
unsigned
int
U
,
unsigned
int
V
,
unsigned
int
W
);
SimplexList
const
&
getSimplices
();
...
...
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