Commit 0fa4de45 authored by Timo Koch's avatar Timo Koch
Browse files

Merge branch 'fix/coupling-dirichlet-cc' into 'master'

[boundarytypes][md] Consider couplingDirichlet for hasOnlyDirichlet to fix Dirichlet-Dirichlet cc coupling

Closes #768

See merge request !1826
parents ddf0bb19 ff1afa09
...@@ -234,7 +234,9 @@ public: ...@@ -234,7 +234,9 @@ public:
* \param eqIdx The index of the equation * \param eqIdx The index of the equation
*/ */
bool isDirichlet(unsigned eqIdx) const bool isDirichlet(unsigned eqIdx) const
{ return boundaryInfo_[eqIdx].isDirichlet; } { return boundaryInfo_[eqIdx].isDirichlet ||
boundaryInfo_[eqIdx].isCouplingDirichlet;
}
/*! /*!
* \brief Returns true if all equations are used to specify a * \brief Returns true if all equations are used to specify a
...@@ -244,7 +246,8 @@ public: ...@@ -244,7 +246,8 @@ public:
{ {
return std::all_of(boundaryInfo_.begin(), return std::all_of(boundaryInfo_.begin(),
boundaryInfo_.end(), boundaryInfo_.end(),
[](const BoundaryInfo& b){ return b.isDirichlet; } [](const BoundaryInfo& b){ return b.isDirichlet ||
b.isCouplingDirichlet; }
); );
} }
...@@ -254,10 +257,11 @@ public: ...@@ -254,10 +257,11 @@ 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; b.isCouplingDirichlet; }
);
} }
/*! /*!
...@@ -267,7 +271,10 @@ public: ...@@ -267,7 +271,10 @@ public:
* \param eqIdx The index of the equation * \param eqIdx The index of the equation
*/ */
bool isNeumann(unsigned eqIdx) const bool isNeumann(unsigned eqIdx) const
{ return boundaryInfo_[eqIdx].isNeumann; } {
return boundaryInfo_[eqIdx].isNeumann ||
boundaryInfo_[eqIdx].isCouplingNeumann;
}
/*! /*!
* \brief Returns true if all equations are used to specify a * \brief Returns true if all equations are used to specify a
...@@ -277,7 +284,8 @@ public: ...@@ -277,7 +284,8 @@ public:
{ {
return std::all_of(boundaryInfo_.begin(), return std::all_of(boundaryInfo_.begin(),
boundaryInfo_.end(), boundaryInfo_.end(),
[](const BoundaryInfo& b){ return b.isNeumann; } [](const BoundaryInfo& b){ return b.isNeumann ||
b.isCouplingNeumann; }
); );
} }
...@@ -287,10 +295,11 @@ public: ...@@ -287,10 +295,11 @@ 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; b.isCouplingNeumann; }
);
} }
/*! /*!
...@@ -308,10 +317,10 @@ public: ...@@ -308,10 +317,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; );
} }
/*! /*!
...@@ -329,10 +338,10 @@ public: ...@@ -329,10 +338,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; );
} }
/*! /*!
...@@ -350,10 +359,10 @@ public: ...@@ -350,10 +359,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; );
} }
/*! /*!
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment