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:
...
@@ -255,10 +255,10 @@ public:
*/
*/
bool
hasDirichlet
()
const
bool
hasDirichlet
()
const
{
{
for
(
int
i
=
0
;
i
<
numEq
;
++
i
)
return
std
::
any_of
(
boundaryInfo_
.
begin
(),
if
(
boundaryInfo_
[
i
].
isDirichlet
)
boundaryInfo_
.
end
(),
return
true
;
[](
const
BoundaryInfo
&
b
){
return
b
.
isDirichlet
;
}
return
false
;
)
;
}
}
/*!
/*!
...
@@ -288,10 +288,10 @@ public:
...
@@ -288,10 +288,10 @@ public:
*/
*/
bool
hasNeumann
()
const
bool
hasNeumann
()
const
{
{
for
(
int
i
=
0
;
i
<
numEq
;
++
i
)
return
std
::
any_of
(
boundaryInfo_
.
begin
(),
if
(
boundaryInfo_
[
i
].
isNeumann
)
boundaryInfo_
.
end
(),
return
true
;
[](
const
BoundaryInfo
&
b
){
return
b
.
isNeumann
;
}
return
false
;
)
;
}
}
/*!
/*!
...
@@ -309,10 +309,10 @@ public:
...
@@ -309,10 +309,10 @@ public:
*/
*/
bool
hasOutflow
()
const
bool
hasOutflow
()
const
{
{
for
(
int
i
=
0
;
i
<
numEq
;
++
i
)
return
std
::
any_of
(
boundaryInfo_
.
begin
(),
if
(
boundaryInfo_
[
i
].
isOutflow
)
boundaryInfo_
.
end
(),
return
true
;
[](
const
BoundaryInfo
&
b
){
return
b
.
isOutflow
;
}
return
false
;
)
;
}
}
/*!
/*!
...
@@ -330,10 +330,10 @@ public:
...
@@ -330,10 +330,10 @@ public:
*/
*/
bool
hasCouplingDirichlet
()
const
bool
hasCouplingDirichlet
()
const
{
{
for
(
int
i
=
0
;
i
<
numEq
;
++
i
)
return
std
::
any_of
(
boundaryInfo_
.
begin
(),
if
(
boundaryInfo_
[
i
].
isCouplingDirichlet
)
boundaryInfo_
.
end
(),
return
true
;
[](
const
BoundaryInfo
&
b
){
return
b
.
isCouplingDirichlet
;
}
return
false
;
)
;
}
}
/*!
/*!
...
@@ -351,10 +351,10 @@ public:
...
@@ -351,10 +351,10 @@ public:
*/
*/
bool
hasCouplingNeumann
()
const
bool
hasCouplingNeumann
()
const
{
{
for
(
int
i
=
0
;
i
<
numEq
;
++
i
)
return
std
::
any_of
(
boundaryInfo_
.
begin
(),
if
(
boundaryInfo_
[
i
].
isCouplingNeumann
)
boundaryInfo_
.
end
(),
return
true
;
[](
const
BoundaryInfo
&
b
){
return
b
.
isCouplingNeumann
;
}
return
false
;
)
;
}
}
/*!
/*!
...
...
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