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
71df9c7f
"README.md" did not exist on "c242c1762a178c5e78304d98e059a97c0d139d54"
Commit
71df9c7f
authored
6 years ago
by
mattijs
Browse files
Options
Downloads
Patches
Plain Diff
ENH: findRefCell: initialise to -1 if not needed. Fixes
#988
.
parent
544d6f7d
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/finiteVolume/cfdTools/general/findRefCell/findRefCell.C
+10
-17
10 additions, 17 deletions
src/finiteVolume/cfdTools/general/findRefCell/findRefCell.C
with
10 additions
and
17 deletions
src/finiteVolume/cfdTools/general/findRefCell/findRefCell.C
+
10
−
17
View file @
71df9c7f
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation |
Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
License
License
This file is part of OpenFOAM.
This file is part of OpenFOAM.
...
@@ -111,6 +111,10 @@ bool Foam::setRefCell
...
@@ -111,6 +111,10 @@ bool Foam::setRefCell
return
true
;
return
true
;
}
}
else
{
refCelli
=
-
1
;
}
return
false
;
return
false
;
}
}
...
@@ -141,25 +145,14 @@ Foam::scalar Foam::getRefCellValue
...
@@ -141,25 +145,14 @@ Foam::scalar Foam::getRefCellValue
FatalErrorInFunction
FatalErrorInFunction
<<
"Illegal reference cellID "
<<
refCelli
<<
"Illegal reference cellID "
<<
refCelli
<<
". Mesh has "
<<
field
.
mesh
().
nCells
()
<<
". cells."
<<
". Mesh has "
<<
field
.
mesh
().
nCells
()
<<
". cells."
<<
exit
(
FatalIOError
);
<<
exit
(
FatalError
);
}
// Catch duplicates
label
hasRef
=
(
refCelli
>=
0
&&
refCelli
<
field
.
mesh
().
nCells
()
?
1
:
0
);
if
(
1
!=
returnReduce
<
label
>
(
hasRef
,
sumOp
<
label
>
()))
{
FatalErrorInFunction
<<
"Invalid reference cellID "
<<
refCelli
<<
". Mesh has "
<<
field
.
mesh
().
nCells
()
<<
". cells."
<<
exit
(
FatalIOError
);
}
}
scalar
refCellValue
=
(
hasRef
?
field
[
refCelli
]
:
0
.
0
);
#else
scalar
refCellValue
=
(
refCelli
>=
0
?
field
[
refCelli
]
:
0
.
0
);
#endif
#endif
scalar
refCellValue
=
(
refCelli
>=
0
?
field
[
refCelli
]
:
0
.
0
);
// Currently distributing the value to all processors. This is generally
// not needed since only the processor holding the reference cell needs
// it. Tdb.
return
returnReduce
(
refCellValue
,
sumOp
<
scalar
>
());
return
returnReduce
(
refCellValue
,
sumOp
<
scalar
>
());
}
}
...
...
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