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
dumux-repositories
dumux
Commits
29bcf92a
Commit
29bcf92a
authored
Dec 18, 2019
by
Kilian Weishaupt
Committed by
Kilian Weishaupt
Mar 20, 2020
Browse files
[boundarytypes] Use std::any_of instead of for loops
parent
2e8c4152
Changes
1
Hide whitespace changes
Inline
Side-by-side
dumux/common/boundarytypes.hh
View file @
29bcf92a
...
...
@@ -255,10 +255,10 @@ public:
*/
bool
hasDirichlet
()
const
{
for
(
int
i
=
0
;
i
<
numEq
;
++
i
)
if
(
boundaryInfo_
[
i
].
isDirichlet
)
return
true
;
return
false
;
return
std
::
any_of
(
boundaryInfo_
.
begin
(),
boundaryInfo_
.
end
(),
[](
const
BoundaryInfo
&
b
){
return
b
.
isDirichlet
;
}
)
;
}
/*!
...
...
@@ -288,10 +288,10 @@ public:
*/
bool
hasNeumann
()
const
{
for
(
int
i
=
0
;
i
<
numEq
;
++
i
)
if
(
boundaryInfo_
[
i
].
isNeumann
)
return
true
;
return
false
;
return
std
::
any_of
(
boundaryInfo_
.
begin
(),
boundaryInfo_
.
end
(),
[](
const
BoundaryInfo
&
b
){
return
b
.
isNeumann
;
}
)
;
}
/*!
...
...
@@ -309,10 +309,10 @@ public:
*/
bool
hasOutflow
()
const
{
for
(
int
i
=
0
;
i
<
numEq
;
++
i
)
if
(
boundaryInfo_
[
i
].
isOutflow
)
return
true
;
return
false
;
return
std
::
any_of
(
boundaryInfo_
.
begin
(),
boundaryInfo_
.
end
(),
[](
const
BoundaryInfo
&
b
){
return
b
.
isOutflow
;
}
)
;
}
/*!
...
...
@@ -330,10 +330,10 @@ public:
*/
bool
hasCouplingDirichlet
()
const
{
for
(
int
i
=
0
;
i
<
numEq
;
++
i
)
if
(
boundaryInfo_
[
i
].
isCouplingDirichlet
)
return
true
;
return
false
;
return
std
::
any_of
(
boundaryInfo_
.
begin
(),
boundaryInfo_
.
end
(),
[](
const
BoundaryInfo
&
b
){
return
b
.
isCouplingDirichlet
;
}
)
;
}
/*!
...
...
@@ -351,10 +351,10 @@ public:
*/
bool
hasCouplingNeumann
()
const
{
for
(
int
i
=
0
;
i
<
numEq
;
++
i
)
if
(
boundaryInfo_
[
i
].
isCouplingNeumann
)
return
true
;
return
false
;
return
std
::
any_of
(
boundaryInfo_
.
begin
(),
boundaryInfo_
.
end
(),
[](
const
BoundaryInfo
&
b
){
return
b
.
isCouplingNeumann
;
}
)
;
}
/*!
...
...
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