Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
ca4b8c34
Commit
ca4b8c34
authored
Nov 08, 2011
by
mattijs
Browse files
ENH: polyMesh,meshSearch: default value on findCell, pointInCell
parent
b7155f78
Changes
22
Hide whitespace changes
Inline
Side-by-side
applications/utilities/mesh/advanced/selectCells/selectCells.C
View file @
ca4b8c34
...
...
@@ -381,7 +381,7 @@ int main(int argc, char *argv[])
(
void
)
edgeCalc
.
minLen
(
Info
);
// Search engine on mesh. Face decomposition since faces might be warped.
meshSearch
queryMesh
(
mesh
,
polyMesh
::
FACEDIAGTETS
);
meshSearch
queryMesh
(
mesh
);
// Check all 'outside' points
forAll
(
outsidePts
,
outsideI
)
...
...
applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C
View file @
ca4b8c34
...
...
@@ -2194,7 +2194,7 @@ int main(int argc, char *argv[])
label
regionI
=
-
1
;
label
cellI
=
mesh
.
findCell
(
insidePoint
,
polyMesh
::
FACEDIAGTETS
);
label
cellI
=
mesh
.
findCell
(
insidePoint
);
Info
<<
nl
<<
"Found point "
<<
insidePoint
<<
" in cell "
<<
cellI
<<
endl
;
...
...
applications/utilities/parallelProcessing/decomposePar/decomposePar.C
View file @
ca4b8c34
...
...
@@ -528,11 +528,7 @@ int main(int argc, char *argv[])
<<
"Cell number should be between 0 and "
<<
mesh
.
nCells
()
-
1
<<
nl
<<
"On this mesh the particle should be in cell "
<<
mesh
.
findCell
(
iter
().
position
(),
polyMesh
::
FACEDIAGTETS
)
<<
mesh
.
findCell
(
iter
().
position
())
<<
exit
(
FatalError
);
}
...
...
src/OpenFOAM/meshes/polyMesh/polyMesh.H
View file @
ca4b8c34
...
...
@@ -558,14 +558,14 @@ public:
(
const
point
&
,
label
cellI
,
const
cellRepresentation
const
cellRepresentation
=
FACEDIAGTETS
)
const
;
//- Find cell enclosing this location (-1 if not in mesh)
label
findCell
(
const
point
&
,
const
cellRepresentation
const
cellRepresentation
=
FACEDIAGTETS
)
const
;
};
...
...
src/engine/ignition/ignitionSite.C
View file @
ca4b8c34
...
...
@@ -36,7 +36,7 @@ void Foam::ignitionSite::findIgnitionCells(const fvMesh& mesh)
const
volVectorField
&
centres
=
mesh
.
C
();
const
scalarField
&
vols
=
mesh
.
V
();
label
ignCell
=
mesh
.
findCell
(
location_
,
polyMesh
::
FACEDIAGTETS
);
label
ignCell
=
mesh
.
findCell
(
location_
);
if
(
ignCell
==
-
1
)
{
return
;
...
...
src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSource.C
View file @
ca4b8c34
...
...
@@ -104,11 +104,7 @@ void Foam::basicSource::setCellSet()
forAll
(
points_
,
i
)
{
label
cellI
=
mesh_
.
findCell
(
points_
[
i
],
polyMesh
::
FACEDIAGTETS
);
label
cellI
=
mesh_
.
findCell
(
points_
[
i
]);
if
(
cellI
>=
0
)
{
selectedCells
.
insert
(
cellI
);
...
...
src/finiteVolume/cfdTools/general/findRefCell/findRefCell.C
View file @
ca4b8c34
...
...
@@ -76,10 +76,16 @@ void Foam::setRefCell
else
if
(
dict
.
found
(
refPointName
))
{
point
refPointi
(
dict
.
lookup
(
refPointName
));
// Note: find reference cell using facePlanes to avoid constructing
// face decomposition structure. Most likely the reference
// cell is an undistorted one so this should not be a
// problem.
refCelli
=
field
.
mesh
().
findCell
(
refPointi
,
polyMesh
::
FACE
DIAGTET
S
polyMesh
::
FACE
PLANE
S
);
label
hasRef
=
(
refCelli
>=
0
?
1
:
0
);
label
sumHasRef
=
returnReduce
<
label
>
(
hasRef
,
sumOp
<
label
>
());
...
...
src/lagrangian/dieselSpray/spray/findInjectorCell.H
View file @
ca4b8c34
...
...
@@ -6,12 +6,7 @@ if (injectorCell >= 0)
const
vector
&
C
=
mesh_
.
C
()[
injectorCell
];
injectionPosition
+=
1.0e-9
*
(
C
-
injectionPosition
);
foundCell
=
mesh_
.
pointInCell
(
injectionPosition
,
injectorCell
,
polyMesh
::
FACEDIAGTETS
);
foundCell
=
mesh_
.
pointInCell
(
injectionPosition
,
injectorCell
);
}
reduce
(
foundCell
,
orOp
<
bool
>
());
...
...
@@ -37,12 +32,7 @@ if (!foundCell)
const
vector
&
C
=
mesh_
.
C
()[
injectorCell
];
injectionPosition
+=
1.0e-6
*
(
C
-
injectionPosition
);
foundCell
=
mesh_
.
pointInCell
(
injectionPosition
,
injectorCell
,
polyMesh
::
FACEDIAGTETS
);
foundCell
=
mesh_
.
pointInCell
(
injectionPosition
,
injectorCell
);
}
reduce
(
foundCell
,
orOp
<
bool
>
());
...
...
@@ -60,12 +50,7 @@ if (!foundCell)
const
vector
&
C
=
mesh_
.
C
()[
injectorCell
];
injectionPosition
+=
1.0e-9
*
(
C
-
injectionPosition
);
foundCell
=
mesh_
.
pointInCell
(
injectionPosition
,
injectorCell
,
polyMesh
::
FACEDIAGTETS
);
foundCell
=
mesh_
.
pointInCell
(
injectionPosition
,
injectorCell
);
}
reduce
(
foundCell
,
orOp
<
bool
>
());
...
...
src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C
View file @
ca4b8c34
...
...
@@ -205,15 +205,7 @@ bool Foam::InjectionModel<CloudType>::findCellAtPosition
{
position
+=
SMALL
*
(
cellCentres
[
cellI
]
-
position
);
if
(
this
->
owner
().
mesh
().
pointInCell
(
position
,
cellI
,
polyMesh
::
FACEDIAGTETS
)
)
if
(
this
->
owner
().
mesh
().
pointInCell
(
position
,
cellI
))
{
procI
=
Pstream
::
myProcNo
();
}
...
...
src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/refinementParameters/refinementParameters.C
View file @
ca4b8c34
...
...
@@ -86,7 +86,7 @@ Foam::labelList Foam::refinementParameters::findCells(const polyMesh& mesh)
{
const
point
&
keepPoint
=
keepPoints_
[
i
];
label
localCellI
=
mesh
.
findCell
(
keepPoint
,
polyMesh
::
FACEDIAGTETS
);
label
localCellI
=
mesh
.
findCell
(
keepPoint
);
label
globalCellI
=
-
1
;
...
...
src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinement.C
View file @
ca4b8c34
...
...
@@ -1825,7 +1825,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::splitMeshRegions
label
regionI
=
-
1
;
label
cellI
=
mesh_
.
findCell
(
keepPoint
,
polyMesh
::
FACEDIAGTETS
);
label
cellI
=
mesh_
.
findCell
(
keepPoint
);
if
(
cellI
!=
-
1
)
{
...
...
src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C
View file @
ca4b8c34
...
...
@@ -1248,7 +1248,7 @@ void Foam::meshRefinement::findCellZoneInsideWalk
// Find the region containing the insidePoint
label
keepRegionI
=
-
1
;
label
cellI
=
mesh_
.
findCell
(
insidePoint
,
polyMesh
::
FACEDIAGTETS
);
label
cellI
=
mesh_
.
findCell
(
insidePoint
);
if
(
cellI
!=
-
1
)
{
...
...
@@ -1418,7 +1418,7 @@ void Foam::meshRefinement::findCellZoneTopo
// Find the region containing the keepPoint
label
keepRegionI
=
-
1
;
label
cellI
=
mesh_
.
findCell
(
keepPoint
,
polyMesh
::
FACEDIAGTETS
);
label
cellI
=
mesh_
.
findCell
(
keepPoint
);
if
(
cellI
!=
-
1
)
{
...
...
@@ -1959,7 +1959,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::splitMesh
// Find the region containing the keepPoint
label
keepRegionI
=
-
1
;
label
cellI
=
mesh_
.
findCell
(
keepPoint
,
polyMesh
::
FACEDIAGTETS
);
label
cellI
=
mesh_
.
findCell
(
keepPoint
);
if
(
cellI
!=
-
1
)
{
...
...
src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.C
View file @
ca4b8c34
...
...
@@ -174,7 +174,7 @@ void Foam::mappedPatchBase::findSamples
}
// Octree based search engine
meshSearch
meshSearchEngine
(
mesh
,
polyMesh
::
FACEDIAGTETS
);
meshSearch
meshSearchEngine
(
mesh
);
forAll
(
samples
,
sampleI
)
{
...
...
@@ -291,7 +291,7 @@ void Foam::mappedPatchBase::findSamples
}
// Octree based search engine
meshSearch
meshSearchEngine
(
mesh
,
polyMesh
::
FACEDIAGTETS
);
meshSearch
meshSearchEngine
(
mesh
);
forAll
(
samples
,
sampleI
)
{
...
...
src/meshTools/octree/octreeDataCell.C
View file @
ca4b8c34
...
...
@@ -116,12 +116,7 @@ bool Foam::octreeDataCell::contains
const
point
&
sample
)
const
{
return
mesh_
.
pointInCell
(
sample
,
cellLabels_
[
index
],
polyMesh
::
FACEDIAGTETS
);
return
mesh_
.
pointInCell
(
sample
,
cellLabels_
[
index
]);
}
...
...
src/meshTools/sets/cellSources/regionToCell/regionToCell.C
View file @
ca4b8c34
...
...
@@ -60,7 +60,7 @@ Foam::topoSetSource::addToUsageTable Foam::regionToCell::usage_
void
Foam
::
regionToCell
::
combine
(
topoSet
&
set
,
const
bool
add
)
const
{
label
cellI
=
mesh_
.
findCell
(
insidePoint_
,
polyMesh
::
FACEDIAGTETS
);
label
cellI
=
mesh_
.
findCell
(
insidePoint_
);
// Load the subset of cells
boolList
blockedFace
(
mesh_
.
nFaces
(),
false
);
...
...
src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C
View file @
ca4b8c34
...
...
@@ -166,7 +166,7 @@ void Foam::surfaceToCell::combine(topoSet& set, const bool add) const
// Construct search engine on mesh
meshSearch
queryMesh
(
mesh_
,
polyMesh
::
FACEDIAGTETS
);
meshSearch
queryMesh
(
mesh_
);
// Check all 'outside' points
...
...
src/meshTools/surfaceSets/surfaceSets.C
View file @
ca4b8c34
...
...
@@ -235,7 +235,7 @@ void Foam::surfaceSets::getSurfaceSets
)
{
// Construct search engine on mesh
meshSearch
queryMesh
(
mesh
,
polyMesh
::
FACEDIAGTETS
);
meshSearch
queryMesh
(
mesh
);
// Cut faces with surface and classify cells
cellClassification
cellType
...
...
src/postProcessing/functionObjects/field/streamLine/streamLine.C
View file @
ca4b8c34
...
...
@@ -363,7 +363,7 @@ void Foam::streamLine::read(const dictionary& dict)
const
fvMesh
&
mesh
=
dynamic_cast
<
const
fvMesh
&>
(
obr_
);
meshSearchPtr_
.
reset
(
new
meshSearch
(
mesh
,
polyMesh
::
FACEDIAGTETS
));
meshSearchPtr_
.
reset
(
new
meshSearch
(
mesh
));
const
dictionary
&
coeffsDict
=
dict
.
subDict
(
seedSet_
+
"Coeffs"
);
sampledSetPtr_
=
sampledSet
::
New
...
...
src/sampling/meshToMeshInterpolation/meshToMesh/calculateMeshToMeshAddressing.C
View file @
ca4b8c34
...
...
@@ -267,7 +267,7 @@ void Foam::meshToMesh::cellAddresses
cellAddressing_
[
toI
]
=
-
1
;
// Check point is actually in the nearest cell
if
(
fromMesh
.
pointInCell
(
p
,
curCell
,
polyMesh
::
FACEDIAGTETS
))
if
(
fromMesh
.
pointInCell
(
p
,
curCell
))
{
cellAddressing_
[
toI
]
=
curCell
;
}
...
...
@@ -292,15 +292,7 @@ void Foam::meshToMesh::cellAddresses
{
// search through all the neighbours.
// If point is in neighbour reset current cell
if
(
fromMesh
.
pointInCell
(
p
,
neighbours
[
nI
],
polyMesh
::
FACEDIAGTETS
)
)
if
(
fromMesh
.
pointInCell
(
p
,
neighbours
[
nI
]))
{
cellAddressing_
[
toI
]
=
neighbours
[
nI
];
found
=
true
;
...
...
@@ -324,15 +316,7 @@ void Foam::meshToMesh::cellAddresses
{
// search through all the neighbours.
// If point is in neighbour reset current cell
if
(
fromMesh
.
pointInCell
(
p
,
nn
[
nI
],
polyMesh
::
FACEDIAGTETS
)
)
if
(
fromMesh
.
pointInCell
(
p
,
nn
[
nI
]))
{
cellAddressing_
[
toI
]
=
nn
[
nI
];
found
=
true
;
...
...
src/sampling/probes/probes.C
View file @
ca4b8c34
...
...
@@ -45,7 +45,7 @@ void Foam::probes::findElements(const fvMesh& mesh)
{
const
vector
&
location
=
operator
[](
probeI
);
elementList_
[
probeI
]
=
mesh
.
findCell
(
location
,
polyMesh
::
FACEDIAGTETS
);
elementList_
[
probeI
]
=
mesh
.
findCell
(
location
);
if
(
debug
&&
elementList_
[
probeI
]
!=
-
1
)
{
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
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