Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-foamgrid
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
extensions
dune-foamgrid
Commits
d10be865
Commit
d10be865
authored
8 years ago
by
Timo Koch
Browse files
Options
Downloads
Patches
Plain Diff
[growth][test] Test adding two elements at once
parent
2059f0c9
No related branches found
No related tags found
1 merge request
!14
Bugfix/double vertex insertion
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/foamgrid/test/growth-test-1d.cc
+27
-11
27 additions, 11 deletions
dune/foamgrid/test/growth-test-1d.cc
with
27 additions
and
11 deletions
dune/foamgrid/test/growth-test-1d.cc
+
27
−
11
View file @
d10be865
...
...
@@ -12,7 +12,7 @@
#include
<dune/grid/test/checkindexset.hh>
template
<
class
Grid
>
void
checkGridElementGrowth
(
Grid
&
grid
)
void
checkGridElementGrowth
(
Grid
&
grid
,
int
numElements
)
{
using
namespace
Dune
;
enum
{
dimworld
=
Grid
::
dimensionworld
};
...
...
@@ -24,18 +24,33 @@ void checkGridElementGrowth(Grid& grid)
if
(
geo
.
center
()[
1
]
>=
0.0
&&
geo
.
center
()[
0
]
<
-
1.0
)
{
Dune
::
FieldVector
<
double
,
dimworld
>
growPoint
=
geo
.
center
();
growPoint
+=
Dune
::
FieldVector
<
double
,
dimworld
>
(
2.0
);
double
interval
=
2.0
/
numElements
;
unsigned
int
oldVIdx
=
0
;
for
(
int
i
=
0
;
i
<
numElements
;
++
i
)
{
growPoint
+=
Dune
::
FieldVector
<
double
,
dimworld
>
(
interval
);
// insert a new vertex
auto
v
Idx
=
grid
.
insertVertex
(
growPoint
);
// insert a new vertex
auto
newV
Idx
=
grid
.
insertVertex
(
growPoint
);
// find the second index
Dune
::
LeafMultipleCodimMultipleGeomTypeMapper
<
Grid
,
Dune
::
MCMGVertexLayout
>
mapper
(
grid
);
if
(
i
==
0
)
{
// find the second index
Dune
::
LeafMultipleCodimMultipleGeomTypeMapper
<
Grid
,
Dune
::
MCMGVertexLayout
>
mapper
(
grid
);
// insert the new element
grid
.
insertElement
(
Dune
::
GeometryType
(
1
),
{
vIdx
,
mapper
.
index
(
element
.
template
subEntity
<
dim
>(
0
))}
);
// insert the new element
grid
.
insertElement
(
Dune
::
GeometryType
(
1
),
{
mapper
.
index
(
element
.
template
subEntity
<
dim
>(
0
)),
newVIdx
}
);
}
else
{
grid
.
insertElement
(
Dune
::
GeometryType
(
1
),
{
oldVIdx
,
newVIdx
}
);
}
oldVIdx
=
newVIdx
;
}
}
}
...
...
@@ -73,7 +88,8 @@ void checkGridElementGrowth(Grid& grid)
{
if
(
intersection
.
boundary
())
{
std
::
cout
<<
"Boundary Intersection no"
<<
isCounter
<<
" has segment index: "
<<
intersection
.
boundarySegmentIndex
()
<<
std
::
endl
;
std
::
cout
<<
"--Boundary Intersection no"
<<
isCounter
<<
" has segment index: "
<<
intersection
.
boundarySegmentIndex
()
<<
" --> at position: "
<<
intersection
.
geometry
().
center
()
<<
std
::
endl
;
++
isCounter
;
}
}
...
...
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