Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenFOAM-plus
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
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Development
OpenFOAM-plus
Commits
e643346c
Commit
e643346c
authored
8 years ago
by
mattijs
Browse files
Options
Downloads
Patches
Plain Diff
ENH: cloudSet: report the number of missing points
parent
5d054754
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sampling/sampledSet/cloud/cloudSet.C
+65
-7
65 additions, 7 deletions
src/sampling/sampledSet/cloud/cloudSet.C
with
65 additions
and
7 deletions
src/sampling/sampledSet/cloud/cloudSet.C
+
65
−
7
View file @
e643346c
...
...
@@ -30,6 +30,7 @@ License
#include
"polyMesh.H"
#include
"addToRunTimeSelectionTable.H"
#include
"word.H"
#include
"DynamicField.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
...
...
@@ -53,6 +54,7 @@ void Foam::cloudSet::calcSamples
{
const
meshSearch
&
queryMesh
=
searchEngine
();
labelList
foundProc
(
sampleCoords_
.
size
(),
-
1
);
forAll
(
sampleCoords_
,
sampleI
)
{
label
celli
=
queryMesh
.
findCell
(
sampleCoords_
[
sampleI
]);
...
...
@@ -64,17 +66,73 @@ void Foam::cloudSet::calcSamples
samplingFaces
.
append
(
-
1
);
samplingSegments
.
append
(
0
);
samplingCurveDist
.
append
(
1
.
0
*
sampleI
);
foundProc
[
sampleI
]
=
Pstream
::
myProcNo
();
}
}
// Check that all have been found
labelList
maxFoundProc
(
foundProc
);
Pstream
::
listCombineGather
(
maxFoundProc
,
maxEqOp
<
label
>
());
Pstream
::
listCombineScatter
(
maxFoundProc
);
labelList
minFoundProc
(
foundProc
.
size
(),
labelMax
);
forAll
(
foundProc
,
i
)
{
if
(
foundProc
[
i
]
!=
-
1
)
{
minFoundProc
[
i
]
=
foundProc
[
i
];
}
}
Pstream
::
listCombineGather
(
minFoundProc
,
minEqOp
<
label
>
());
Pstream
::
listCombineScatter
(
minFoundProc
);
DynamicField
<
point
>
missingPoints
(
sampleCoords_
.
size
());
forAll
(
sampleCoords_
,
sampleI
)
{
if
(
maxFoundProc
[
sampleI
]
==
-
1
)
{
// No processor has found the location.
missingPoints
.
append
(
sampleCoords_
[
sampleI
]);
}
else
if
(
minFoundProc
[
sampleI
]
!=
maxFoundProc
[
sampleI
])
{
WarningInFunction
<<
"For sample set "
<<
name
()
<<
" location "
<<
sampleCoords_
[
sampleI
]
<<
" seems to be on multiple domains: "
<<
minFoundProc
[
sampleI
]
<<
" and "
<<
maxFoundProc
[
sampleI
]
<<
nl
<<
"This might happen if the location is on"
<<
" a processor patch. Change the location slightly"
<<
" to prevent this."
<<
endl
;
}
}
label
nTotalCells
=
returnReduce
(
samplingPts
.
size
(),
sumOp
<
label
>
());
if
(
nTotalCells
<
sampleCoords_
.
size
())
if
(
missingPoints
.
size
()
>
0
)
{
WarningInFunction
<<
"For sample set "
<<
name
()
<<
" found only "
<<
nTotalCells
<<
" out of "
<<
sampleCoords_
.
size
()
<<
" input points."
<<
endl
;
if
(
missingPoints
.
size
()
<
100
||
debug
)
{
WarningInFunction
<<
"For sample set "
<<
name
()
<<
" did not found "
<<
missingPoints
.
size
()
<<
" points out of "
<<
sampleCoords_
.
size
()
<<
nl
<<
"Missing points:"
<<
missingPoints
<<
endl
;
}
else
{
WarningInFunction
<<
"For sample set "
<<
name
()
<<
" did not found "
<<
missingPoints
.
size
()
<<
" points out of "
<<
sampleCoords_
.
size
()
<<
nl
<<
"Print missing points by setting the debug flag"
<<
" for "
<<
cloudSet
::
typeName
<<
endl
;
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Prashant Sonakar
@Prashant
Mentioned in issue
#228 (closed)
·
8 years ago
Mentioned in issue
#228 (closed)
Mentioned in issue #228
Toggle commit list
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