Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor 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
Development
openfoam
Commits
592fb7c9
Commit
592fb7c9
authored
14 years ago
by
mattijs
Browse files
Options
Downloads
Patches
Plain Diff
BUG: treeDataPoint: work with empty subset.
parent
d60ca668
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/meshTools/indexedOctree/treeDataPoint.C
+8
-6
8 additions, 6 deletions
src/meshTools/indexedOctree/treeDataPoint.C
src/meshTools/indexedOctree/treeDataPoint.H
+3
-1
3 additions, 1 deletion
src/meshTools/indexedOctree/treeDataPoint.H
with
11 additions
and
7 deletions
src/meshTools/indexedOctree/treeDataPoint.C
+
8
−
6
View file @
592fb7c9
...
@@ -37,7 +37,8 @@ defineTypeNameAndDebug(Foam::treeDataPoint, 0);
...
@@ -37,7 +37,8 @@ defineTypeNameAndDebug(Foam::treeDataPoint, 0);
Foam
::
treeDataPoint
::
treeDataPoint
(
const
pointField
&
points
)
Foam
::
treeDataPoint
::
treeDataPoint
(
const
pointField
&
points
)
:
:
points_
(
points
)
points_
(
points
),
useSubset_
(
false
)
{}
{}
...
@@ -48,7 +49,8 @@ Foam::treeDataPoint::treeDataPoint
...
@@ -48,7 +49,8 @@ Foam::treeDataPoint::treeDataPoint
)
)
:
:
points_
(
points
),
points_
(
points
),
pointLabels_
(
pointLabels
)
pointLabels_
(
pointLabels
),
useSubset_
(
true
)
{}
{}
...
@@ -56,7 +58,7 @@ Foam::treeDataPoint::treeDataPoint
...
@@ -56,7 +58,7 @@ Foam::treeDataPoint::treeDataPoint
Foam
::
pointField
Foam
::
treeDataPoint
::
shapePoints
()
const
Foam
::
pointField
Foam
::
treeDataPoint
::
shapePoints
()
const
{
{
if
(
pointLabels_
.
size
()
)
if
(
useSubset_
)
{
{
return
pointField
(
points_
,
pointLabels_
);
return
pointField
(
points_
,
pointLabels_
);
}
}
...
@@ -86,7 +88,7 @@ bool Foam::treeDataPoint::overlaps
...
@@ -86,7 +88,7 @@ bool Foam::treeDataPoint::overlaps
const
treeBoundBox
&
cubeBb
const
treeBoundBox
&
cubeBb
)
const
)
const
{
{
label
pointI
=
(
pointLabels_
.
size
()
?
pointLabels_
[
index
]
:
index
);
label
pointI
=
(
useSubset_
?
pointLabels_
[
index
]
:
index
);
return
cubeBb
.
contains
(
points_
[
pointI
]);
return
cubeBb
.
contains
(
points_
[
pointI
]);
}
}
...
@@ -106,7 +108,7 @@ void Foam::treeDataPoint::findNearest
...
@@ -106,7 +108,7 @@ void Foam::treeDataPoint::findNearest
forAll
(
indices
,
i
)
forAll
(
indices
,
i
)
{
{
const
label
index
=
indices
[
i
];
const
label
index
=
indices
[
i
];
label
pointI
=
(
pointLabels_
.
size
()
?
pointLabels_
[
index
]
:
index
);
label
pointI
=
(
useSubset_
?
pointLabels_
[
index
]
:
index
);
const
point
&
pt
=
points_
[
pointI
];
const
point
&
pt
=
points_
[
pointI
];
...
@@ -141,7 +143,7 @@ void Foam::treeDataPoint::findNearest
...
@@ -141,7 +143,7 @@ void Foam::treeDataPoint::findNearest
forAll
(
indices
,
i
)
forAll
(
indices
,
i
)
{
{
const
label
index
=
indices
[
i
];
const
label
index
=
indices
[
i
];
label
pointI
=
(
pointLabels_
.
size
()
?
pointLabels_
[
index
]
:
index
);
label
pointI
=
(
useSubset_
?
pointLabels_
[
index
]
:
index
);
const
point
&
shapePt
=
points_
[
pointI
];
const
point
&
shapePt
=
points_
[
pointI
];
...
...
This diff is collapsed.
Click to expand it.
src/meshTools/indexedOctree/treeDataPoint.H
+
3
−
1
View file @
592fb7c9
...
@@ -65,6 +65,8 @@ class treeDataPoint
...
@@ -65,6 +65,8 @@ class treeDataPoint
//- Subset of points to work on (or empty)
//- Subset of points to work on (or empty)
const
labelList
pointLabels_
;
const
labelList
pointLabels_
;
const
bool
useSubset_
;
public:
public:
// Declare name of the class and its debug switch
// Declare name of the class and its debug switch
...
@@ -88,7 +90,7 @@ public:
...
@@ -88,7 +90,7 @@ public:
{
{
return
return
(
(
pointLabels_
.
size
()
useSubset_
?
pointLabels_
.
size
()
?
pointLabels_
.
size
()
:
points_
.
size
()
:
points_
.
size
()
);
);
...
...
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