Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dumux
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
Container Registry
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dumux-repositories
dumux
Commits
f316f7d3
Commit
f316f7d3
authored
6 years ago
by
Timo Koch
Browse files
Options
Downloads
Patches
Plain Diff
[geometry] Add optimization option for collision detection for structured cube grids
parent
8774681f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1074
[geometry] Add optimization option for collision detection for structured cube grids
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dumux/common/geometry/intersectingentities.hh
+16
-8
16 additions, 8 deletions
dumux/common/geometry/intersectingentities.hh
with
16 additions
and
8 deletions
dumux/common/geometry/intersectingentities.hh
+
16
−
8
View file @
f316f7d3
...
...
@@ -40,11 +40,12 @@ namespace Dumux {
template
<
class
EntitySet
,
class
ctype
,
int
dimworld
>
inline
std
::
vector
<
std
::
size_t
>
intersectingEntities
(
const
Dune
::
FieldVector
<
ctype
,
dimworld
>&
point
,
const
BoundingBoxTree
<
EntitySet
>&
tree
)
const
BoundingBoxTree
<
EntitySet
>&
tree
,
bool
isCartesianGrid
=
false
)
{
// Call the recursive find function to find candidates
std
::
vector
<
std
::
size_t
>
entities
;
intersectingEntities
(
point
,
tree
,
tree
.
numBoundingBoxes
()
-
1
,
entities
);
intersectingEntities
(
point
,
tree
,
tree
.
numBoundingBoxes
()
-
1
,
entities
,
isCartesianGrid
);
return
entities
;
}
...
...
@@ -56,7 +57,8 @@ template<class EntitySet, class ctype, int dimworld>
void
intersectingEntities
(
const
Dune
::
FieldVector
<
ctype
,
dimworld
>&
point
,
const
BoundingBoxTree
<
EntitySet
>&
tree
,
std
::
size_t
node
,
std
::
vector
<
std
::
size_t
>&
entities
)
std
::
vector
<
std
::
size_t
>&
entities
,
bool
isCartesianGrid
=
false
)
{
// Get the bounding box for the current node
const
auto
&
bBox
=
tree
.
getBoundingBoxNode
(
node
);
...
...
@@ -69,17 +71,23 @@ void intersectingEntities(const Dune::FieldVector<ctype, dimworld>& point,
else
if
(
tree
.
isLeaf
(
bBox
,
node
))
{
const
std
::
size_t
entityIdx
=
bBox
.
child1
;
const
auto
geometry
=
tree
.
entitySet
().
entity
(
entityIdx
).
geometry
();
// if the primitive is positive it intersects the actual geometry, add the entity to the list
if
(
intersectsPointGeometry
(
point
,
geometry
))
// for structured cube grids skip the primitive test
if
(
isCartesianGrid
)
entities
.
push_back
(
entityIdx
);
else
{
const
auto
geometry
=
tree
.
entitySet
().
entity
(
entityIdx
).
geometry
();
// if the primitive is positive it intersects the actual geometry, add the entity to the list
if
(
intersectsPointGeometry
(
point
,
geometry
))
entities
.
push_back
(
entityIdx
);
}
}
// No leaf. Check both children nodes.
else
{
intersectingEntities
(
point
,
tree
,
bBox
.
child0
,
entities
);
intersectingEntities
(
point
,
tree
,
bBox
.
child1
,
entities
);
intersectingEntities
(
point
,
tree
,
bBox
.
child0
,
entities
,
isCartesianGrid
);
intersectingEntities
(
point
,
tree
,
bBox
.
child1
,
entities
,
isCartesianGrid
);
}
}
...
...
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