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
8ad016dd
Commit
8ad016dd
authored
16 years ago
by
mattijs
Browse files
Options
Downloads
Patches
Plain Diff
small normal tolerance. Fixed indexing error
parent
34038022
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/searchableSurface/searchableSurfaceWithGaps.C
+41
-10
41 additions, 10 deletions
src/meshTools/searchableSurface/searchableSurfaceWithGaps.C
src/meshTools/searchableSurface/searchableSurfaceWithGaps.H
+7
-1
7 additions, 1 deletion
src/meshTools/searchableSurface/searchableSurfaceWithGaps.H
with
48 additions
and
11 deletions
src/meshTools/searchableSurface/searchableSurfaceWithGaps.C
+
41
−
10
View file @
8ad016dd
...
...
@@ -26,7 +26,6 @@ License
#include
"searchableSurfaceWithGaps.H"
#include
"addToRunTimeSelectionTable.H"
#include
"SortableList.H"
#include
"Time.H"
#include
"ListOps.H"
...
...
@@ -82,7 +81,7 @@ Foam::Pair<Foam::vector> Foam::searchableSurfaceWithGaps::offsetVecs
// Do second offset vector perp to original edge and first offset vector
offsets
[
1
]
=
n
^
offsets
[
0
];
offsets
[
1
]
*=
gap_
/
mag
(
offsets
[
1
])
;
offsets
[
1
]
*=
gap_
;
}
return
offsets
;
...
...
@@ -207,6 +206,10 @@ void Foam::searchableSurfaceWithGaps::findLine
List
<
pointIndexHit
>&
info
)
const
{
// Test with unperturbed vectors
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
surface
().
findLine
(
start
,
end
,
info
);
// Count number of misses. Determine map
...
...
@@ -215,6 +218,10 @@ void Foam::searchableSurfaceWithGaps::findLine
if
(
returnReduce
(
nMiss
,
sumOp
<
label
>
())
>
0
)
{
//Pout<< "** retesting with offset0 " << nMiss << " misses out of "
// << start.size() << endl;
// extract segments according to map
pointField
compactStart
(
start
,
compactMap
);
pointField
compactEnd
(
end
,
compactMap
);
...
...
@@ -228,20 +235,36 @@ void Foam::searchableSurfaceWithGaps::findLine
offset1
);
// Test with offset0 perturbed vectors
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// test in pairs: only if both perturbations hit something
// do we accept the hit.
const
vectorField
smallVec
(
SMALL
*
(
compactEnd
-
compactStart
));
List
<
pointIndexHit
>
plusInfo
;
surface
().
findLine
(
compactStart
+
offset0
,
compactEnd
+
offset0
,
plusInfo
);
surface
().
findLine
(
compactStart
+
offset0
-
smallVec
,
compactEnd
+
offset0
+
smallVec
,
plusInfo
);
List
<
pointIndexHit
>
minInfo
;
surface
().
findLine
(
compactStart
-
offset0
,
compactEnd
-
offset0
,
minInfo
);
surface
().
findLine
(
compactStart
-
offset0
-
smallVec
,
compactEnd
-
offset0
+
smallVec
,
minInfo
);
// Extract any hits
forAll
(
plusInfo
,
i
)
{
if
(
plusInfo
[
i
].
hit
()
&&
minInfo
[
i
].
hit
())
{
info
[
compactMap
[
i
]]
=
plusInfo
[
i
].
hitPoint
()
-
offset0
[
i
];
info
[
compactMap
[
i
]]
=
plusInfo
[
i
];
info
[
compactMap
[
i
]].
rawPoint
()
-=
offset0
[
i
];
}
}
...
...
@@ -250,6 +273,12 @@ void Foam::searchableSurfaceWithGaps::findLine
if
(
returnReduce
(
nMiss
,
sumOp
<
label
>
())
>
0
)
{
//Pout<< "** retesting with offset1 " << nMiss << " misses out of "
// << start.size() << endl;
// Test with offset1 perturbed vectors
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Extract (inplace possible because of order)
forAll
(
plusMissMap
,
i
)
{
...
...
@@ -266,17 +295,18 @@ void Foam::searchableSurfaceWithGaps::findLine
offset0
.
setSize
(
plusMissMap
.
size
());
offset1
.
setSize
(
plusMissMap
.
size
());
const
vectorField
smallVec
(
SMALL
*
(
compactEnd
-
compactStart
));
surface
().
findLine
(
compactStart
+
offset1
,
compactEnd
+
offset1
,
compactStart
+
offset1
-
smallVec
,
compactEnd
+
offset1
+
smallVec
,
plusInfo
);
surface
().
findLine
(
compactStart
-
offset1
,
compactEnd
-
offset1
,
compactStart
-
offset1
-
smallVec
,
compactEnd
-
offset1
+
smallVec
,
minInfo
);
...
...
@@ -285,7 +315,8 @@ void Foam::searchableSurfaceWithGaps::findLine
{
if
(
plusInfo
[
i
].
hit
()
&&
minInfo
[
i
].
hit
())
{
info
[
compactMap
[
i
]]
=
plusInfo
[
i
].
hitPoint
()
-
offset1
[
i
];
info
[
compactMap
[
i
]]
=
plusInfo
[
i
];
info
[
compactMap
[
i
]].
rawPoint
()
-=
offset1
[
i
];
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/meshTools/searchableSurface/searchableSurfaceWithGaps.H
+
7
−
1
View file @
8ad016dd
...
...
@@ -27,7 +27,13 @@ Class
Description
searchableSurface using multiple slightly shifted underlying surfaces
to make sure pierces don't go through gaps.
to make sure pierces don't go through gaps:
- shift test vector with two small vectors (of size gap_) perpendicular
to the original.
Test with + and - this vector. Only if both register a hit is it seen
as one.
- extend the test vector slightly (with SMALL) to account for numerical
inaccuracies.
SourceFiles
searchableSurfaceWithGaps.C
...
...
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