Skip to content
Snippets Groups Projects
Commit b9c5081f authored by Timo Koch's avatar Timo Koch
Browse files

Merge branch 'feature/remove-general-outflow-bc' into 'master'

Remove general outflow bc type

Closes #972

See merge request !2552
parents 9d20466a f7b061d2
No related branches found
No related tags found
1 merge request!2552Remove general outflow bc type
......@@ -117,6 +117,7 @@ public:
/*!
* \brief Set all boundary conditions to Neumann.
*/
[[deprecated("Will be removed after release 3.4")]]
void setAllOutflow()
{
for (int eqIdx = 0; eqIdx < numEq; ++eqIdx)
......@@ -181,6 +182,7 @@ public:
* \param eqIdx The index of the equation on which the outflow
* condition applies.
*/
[[deprecated("Will be removed after release 3.4")]]
void setOutflow(int eqIdx)
{
resetEq(eqIdx);
......@@ -308,6 +310,7 @@ public:
*
* \param eqIdx The index of the equation
*/
[[deprecated("Will be removed after release 3.4")]]
bool isOutflow(unsigned eqIdx) const
{ return boundaryInfo_[eqIdx].isOutflow; }
......@@ -315,6 +318,7 @@ public:
* \brief Returns true if some equation is used to specify an
* outflow condition.
*/
[[deprecated("Will be removed after release 3.4")]]
bool hasOutflow() const
{
return std::any_of(boundaryInfo_.begin(),
......
......@@ -26,6 +26,7 @@
#include <cassert>
#include <vector>
#include <dune/common/deprecated.hh>
namespace Dumux {
......@@ -72,7 +73,9 @@ public:
hasDirichlet_ = hasDirichlet_ || vertexBCTypes_[scvIdxLocal].hasDirichlet();
hasNeumann_ = hasNeumann_ || vertexBCTypes_[scvIdxLocal].hasNeumann();
DUNE_NO_DEPRECATED_BEGIN
hasOutflow_ = hasOutflow_ || vertexBCTypes_[scvIdxLocal].hasOutflow();
DUNE_NO_DEPRECATED_END
}
}
}
......@@ -95,6 +98,7 @@ public:
* \brief Returns whether the element potentially features an
* outflow boundary segment.
*/
[[deprecated("Will be removed after release 3.4")]]
bool hasOutflow() const
{ return hasOutflow_; }
......
......@@ -54,6 +54,7 @@ public:
boundaryInfo_[eqIdx].isSymmetry = false;
boundaryInfo_[eqIdx].isBeaversJoseph = false;
boundaryInfo_[eqIdx].isOutflow = false;
}
/*!
......@@ -123,11 +124,39 @@ public:
return false;
}
/*!
* \brief Set an outflow boundary condition
*/
void setOutflow(const int eqIdx)
{
resetEq(eqIdx);
boundaryInfo_[eqIdx].isOutflow = true;
}
/*!
* \brief Returns true if an outflow boundary condition was set
* \param eqIdx The index of the equation
*/
bool isOutflow(const int eqIdx) const
{ return boundaryInfo_[eqIdx].isOutflow; }
/*!
* \brief Returns true if some equation has an outflow boundary condition
*/
bool hasOutflow() const
{
for (int i = 0; i < numEq; ++i)
if (boundaryInfo_[i].isOutflow)
return true;
return false;
}
protected:
//! use bitfields to minimize the size
struct NavierStokesBoundaryInfo
{
bool isSymmetry : 1;
bool isOutflow : 1;
bool isBeaversJoseph : 1;
};
......
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*****************************************************************************
* See the file COPYING for full copying permissions. *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
/*!
* \file
* \ingroup Sequential
* \brief Class to specify the type of a boundary.
*/
#ifndef DUMUX_SEQUENTIAL_BOUNDARY_TYPES_HH
#define DUMUX_SEQUENTIAL_BOUNDARY_TYPES_HH
#include <algorithm>
#include <array>
#include <dumux/common/boundarytypes.hh>
namespace Dumux {
/*!
* \ingroup Sequential
* \brief Class to specify the type of a boundary.
*/
template <int numEq>
class SequentialBoundaryTypes : public BoundaryTypes<numEq>
{
public:
SequentialBoundaryTypes()
: BoundaryTypes<numEq>()
{ reset(); }
/*!
* \brief Reset the boundary types for one equation.
*/
void resetEq(int eqIdx)
{
BoundaryTypes<numEq>::resetEq(eqIdx);
seqBoundaryInfo_[eqIdx].isOutflow = false;
}
/*!
* \brief Reset the boundary types for all equations.
*
* After this method no equations will be disabled and neither
* Neumann nor Dirichlet conditions will be evaluated. This
* corresponds to a Neumann zero boundary.
*/
void reset()
{
for (int eqIdx=0; eqIdx < numEq; ++eqIdx)
resetEq(eqIdx);
}
/*!
* \brief Set all boundary conditions to Neumann.
*/
void setAllOutflow()
{
for (int eqIdx = 0; eqIdx < numEq; ++eqIdx)
setOutflow(eqIdx);
}
/*!
* \brief Set a Neumann boundary condition for a single a single
* equation.
*
* \param eqIdx The index of the equation on which the outflow
* condition applies.
*/
void setOutflow(int eqIdx)
{
resetEq(eqIdx);
this->boundaryInfo_[eqIdx].visited = true;
seqBoundaryInfo_[eqIdx].isOutflow = true;
}
/*!
* \brief Returns true if an equation is used to specify an
* outflow condition.
*
* \param eqIdx The index of the equation
*/
bool isOutflow(unsigned eqIdx) const
{ return seqBoundaryInfo_[eqIdx].isOutflow; }
/*!
* \brief Returns true if some equation is used to specify an
* outflow condition.
*/
bool hasOutflow() const
{
return std::any_of(seqBoundaryInfo_.begin(),
seqBoundaryInfo_.end(),
[](const BoundaryInfo& b){ return b.isOutflow; }
);
}
protected:
//! use bitfields to minimize the size
struct BoundaryInfo {
bool isOutflow : 1;
};
std::array<BoundaryInfo, numEq> seqBoundaryInfo_;
};
} // end namespace Dumux
#endif
......@@ -24,6 +24,7 @@
#include <dumux/common/properties/grid.hh>
#include <dumux/common/defaultmappertraits.hh>
#include <dumux/discretization/method.hh>
#include <dumux/porousmediumflow/sequential/boundarytypes.hh>
#include <dumux/porousmediumflow/sequential/gridadaptproperties.hh>
#include <dumux/porousmediumflow/sequential/gridadaptinitializationindicatordefault.hh>
......@@ -237,7 +238,7 @@ struct SequentialBoundaryTypes<TypeTag, TTag::SequentialModel>
{ private:
enum { numEq = getPropValue<TypeTag, Properties::NumEq>() };
public:
using type = Dumux::BoundaryTypes<numEq>;
using type = Dumux::SequentialBoundaryTypes<numEq>;
};
//! do not specific any model-specific default parameters here
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment