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
6a7a0b6b
Commit
6a7a0b6b
authored
Dec 14, 2010
by
mattijs
Browse files
STYLE: FaceCellWave : return number of iterations
parent
e9b8f0a3
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/algorithms/MeshWave/FaceCellWave.C
View file @
6a7a0b6b
...
...
@@ -40,8 +40,7 @@ const Foam::scalar
Foam
::
FaceCellWave
<
Type
,
TrackingData
>::
geomTol_
=
1e-6
;
template
<
class
Type
,
class
TrackingData
>
const
Foam
::
scalar
Foam
::
FaceCellWave
<
Type
,
TrackingData
>::
propagationTol_
=
0
.
01
;
Foam
::
scalar
Foam
::
FaceCellWave
<
Type
,
TrackingData
>::
propagationTol_
=
0
.
01
;
template
<
class
Type
,
class
TrackingData
>
Foam
::
label
Foam
::
FaceCellWave
<
Type
,
TrackingData
>::
dummyTrackData_
=
12345
;
...
...
@@ -516,8 +515,8 @@ void Foam::FaceCellWave<Type, TrackingData>::handleProcPatches()
refCast
<
const
processorPolyPatch
>
(
patch
);
// Allocate buffers
labelList
receiveFaces
(
patch
.
size
())
;
List
<
Type
>
receiveFacesInfo
(
patch
.
size
())
;
labelList
receiveFaces
;
List
<
Type
>
receiveFacesInfo
;
{
UIPstream
fromNeighbour
(
procPatch
.
neighbProcNo
(),
pBufs
);
...
...
@@ -675,8 +674,7 @@ Foam::FaceCellWave<Type, TrackingData>::FaceCellWave
hasCyclicPatches_
(
hasCyclicPatch
()),
nEvals_
(
0
),
nUnvisitedCells_
(
mesh_
.
nCells
()),
nUnvisitedFaces_
(
mesh_
.
nFaces
()),
iter_
(
0
)
nUnvisitedFaces_
(
mesh_
.
nFaces
())
{}
...
...
@@ -707,16 +705,15 @@ Foam::FaceCellWave<Type, TrackingData>::FaceCellWave
hasCyclicPatches_
(
hasCyclicPatch
()),
nEvals_
(
0
),
nUnvisitedCells_
(
mesh_
.
nCells
()),
nUnvisitedFaces_
(
mesh_
.
nFaces
()),
iter_
(
0
)
nUnvisitedFaces_
(
mesh_
.
nFaces
())
{
// Copy initial changed faces data
setFaceInfo
(
changedFaces
,
changedFacesInfo
);
// Iterate until nothing changes
iterate
(
maxIter
);
label
iter
=
iterate
(
maxIter
);
if
((
maxIter
>
0
)
&&
(
iter
_
>=
maxIter
))
if
((
maxIter
>
0
)
&&
(
iter
>=
maxIter
))
{
FatalErrorIn
(
...
...
@@ -796,7 +793,7 @@ Foam::label Foam::FaceCellWave<Type, TrackingData>::faceToCell()
);
}
// Neighbour.
Hack for check if face has neighbour.
// Neighbour.
if
(
faceI
<
nInternalFaces
)
{
cellI
=
neighbour
[
faceI
];
...
...
@@ -927,11 +924,13 @@ Foam::label Foam::FaceCellWave<Type, TrackingData>::iterate(const label maxIter)
handleProcPatches
();
}
while
(
iter_
<
maxIter
)
label
iter
=
0
;
while
(
iter
<
maxIter
)
{
if
(
debug
)
{
Pout
<<
" Iteration "
<<
iter
_
<<
endl
;
Pout
<<
" Iteration "
<<
iter
<<
endl
;
}
nEvals_
=
0
;
...
...
@@ -963,10 +962,11 @@ Foam::label Foam::FaceCellWave<Type, TrackingData>::iterate(const label maxIter)
break
;
}
++
iter
_
;
++
iter
;
}
return
nUnvisitedCells_
;
return
iter
;
}
// ************************************************************************* //
src/OpenFOAM/algorithms/MeshWave/FaceCellWave.H
View file @
6a7a0b6b
...
...
@@ -114,9 +114,6 @@ class FaceCellWave
label
nUnvisitedCells_
;
label
nUnvisitedFaces_
;
//- Iteration counter
label
iter_
;
// Private Member Functions
...
...
@@ -232,7 +229,7 @@ class FaceCellWave
// Private static data
static
const
scalar
geomTol_
;
static
const
scalar
propagationTol_
;
static
scalar
propagationTol_
;
//- Used as default trackdata value to satisfy default template
// argument.
...
...
@@ -340,8 +337,8 @@ public:
// counted double)
label
cellToFace
();
//- Iterate until no changes or maxIter reached. Returns
number of
//
unset cells (see getUnsetCells)
//- Iterate until no changes or maxIter reached.
Returns
actual
//
number of iterations.
label
iterate
(
const
label
maxIter
);
};
...
...
src/OpenFOAM/algorithms/MeshWave/MeshWave.H
View file @
6a7a0b6b
...
...
@@ -134,8 +134,8 @@ public:
return
calc_
.
data
();
}
//- Iterate until no changes or maxIter reached. Returns
number of
//
unset cells (see getUnsetCells)
//- Iterate until no changes or maxIter reached. Returns
actual
//
number of iterations.
label
iterate
(
const
label
maxIter
)
{
return
calc_
.
iterate
(
maxIter
);
...
...
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