Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
71fd1058
Commit
71fd1058
authored
Dec 08, 2010
by
mattijs
Browse files
BUG: patchProbes : split off nearInfo
parent
65a1c946
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C
View file @
71fd1058
...
...
@@ -35,6 +35,7 @@ License
#include "polyMesh.H"
#include "polyPatch.H"
#include "Time.H"
#include "mapDistribute.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
@@ -64,34 +65,6 @@ namespace Foam
const
NamedEnum
<
directMappedPatchBase
::
offsetMode
,
3
>
directMappedPatchBase
::
offsetModeNames_
;
//- Private class for finding nearest
// - point+local index
// - sqr(distance)
// - processor
typedef
Tuple2
<
pointIndexHit
,
Tuple2
<
scalar
,
label
>
>
nearInfo
;
class
nearestEqOp
{
public:
void
operator
()(
nearInfo
&
x
,
const
nearInfo
&
y
)
const
{
if
(
y
.
first
().
hit
())
{
if
(
!
x
.
first
().
hit
())
{
x
=
y
;
}
else
if
(
y
.
second
().
first
()
<
x
.
second
().
first
())
{
x
=
y
;
}
}
}
};
}
...
...
src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.H
View file @
71fd1058
...
...
@@ -70,8 +70,6 @@ SourceFiles
#include "pointField.H"
#include "Tuple2.H"
#include "pointIndexHit.H"
#include "mapDistribute.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
@@ -80,6 +78,7 @@ namespace Foam
class
polyPatch
;
class
polyMesh
;
class
mapDistribute
;
/*---------------------------------------------------------------------------*\
Class directMappedPatchBase Declaration
...
...
@@ -106,6 +105,34 @@ public:
NORMAL
// use face normal + distance
};
//- Helper class for finding nearest
// - point+local index
// - sqr(distance)
// - processor
typedef
Tuple2
<
pointIndexHit
,
Tuple2
<
scalar
,
label
>
>
nearInfo
;
class
nearestEqOp
{
public:
void
operator
()(
nearInfo
&
x
,
const
nearInfo
&
y
)
const
{
if
(
y
.
first
().
hit
())
{
if
(
!
x
.
first
().
hit
())
{
x
=
y
;
}
else
if
(
y
.
second
().
first
()
<
x
.
second
().
first
())
{
x
=
y
;
}
}
}
};
private:
// Private data
...
...
src/sampling/probes/patchProbes.C
View file @
71fd1058
...
...
@@ -25,10 +25,10 @@ License
#include "patchProbes.H"
#include "volFields.H"
#include "dictionary.H"
#include "Time.H"
#include "IOmanip.H"
#include "directMappedPatchBase.C"
// For 'nearInfo' helper class only
#include "directMappedPatchBase.H"
#include "meshSearch.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
...
...
@@ -41,11 +41,10 @@ namespace Foam
void
Foam
::
patchProbes
::
findElements
(
const
fvMesh
&
mesh
)
{
elementList_
.
clear
();
elementList_
.
setSize
(
size
());
// All the info for nearest. Construct to miss
List
<
nearInfo
>
nearest
(
this
->
size
());
List
<
directMappedPatchBase
::
nearInfo
>
nearest
(
this
->
size
());
// Octree based search engine
meshSearch
meshSearchEngine
(
mesh
,
false
);
...
...
@@ -75,7 +74,7 @@ void Foam::patchProbes::findElements(const fvMesh& mesh)
// Find nearest.
Pstream
::
listCombineGather
(
nearest
,
nearestEqOp
());
Pstream
::
listCombineGather
(
nearest
,
directMappedPatchBase
::
nearestEqOp
());
Pstream
::
listCombineScatter
(
nearest
);
if
(
debug
)
...
...
@@ -118,7 +117,6 @@ void Foam::patchProbes::findElements(const fvMesh& mesh)
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam
::
patchProbes
::
patchProbes
...
...
src/sampling/probes/patchProbes.H
View file @
71fd1058
...
...
@@ -37,11 +37,6 @@ SourceFiles
#ifndef patchProbes_H
#define patchProbes_H
#include "HashPtrTable.H"
#include "OFstream.H"
#include "polyMesh.H"
#include "pointField.H"
#include "volFieldsFwd.H"
#include "probes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment