Commit d5cac81c authored by Praetorius, Simon's avatar Praetorius, Simon

Merge branch 'issue/make_datatransferoperation_enum_class' into 'develop'

make DataTransferOperation an enum class

See merge request spraetor/dune-amdis!99
parents 696efd40 9b7cc263
Pipeline #1830 passed with stage
in 41 minutes and 4 seconds
...@@ -11,10 +11,10 @@ namespace AMDiS ...@@ -11,10 +11,10 @@ namespace AMDiS
* @{ * @{
**/ **/
typedef enum { enum class DataTransferOperation {
NO_OPERATION = 0, NO_OPERATION = 0,
INTERPOLATE = 1 INTERPOLATE = 1
} DataTransferOperation; };
/// \brief Interface for Containers allowing data transfer between grid changes. /// \brief Interface for Containers allowing data transfer between grid changes.
...@@ -66,10 +66,10 @@ namespace AMDiS ...@@ -66,10 +66,10 @@ namespace AMDiS
{ {
switch (op) switch (op)
{ {
case NO_OPERATION: case DataTransferOperation::NO_OPERATION:
return std::make_unique<NoDataTransfer<Container>>(); return std::make_unique<NoDataTransfer<Container>>();
case INTERPOLATE: case DataTransferOperation::INTERPOLATE:
return std::make_unique< DataTransfer<Container, Basis> >(basis); return std::make_unique<DataTransfer<Container, Basis>>(basis);
default: default:
error_exit("Invalid data transfer\n"); error_exit("Invalid data transfer\n");
return nullptr; // avoid warnings return nullptr; // avoid warnings
......
...@@ -45,7 +45,7 @@ void ProblemInstat<Traits>::createUhOld() ...@@ -45,7 +45,7 @@ void ProblemInstat<Traits>::createUhOld()
if (oldSolution_) if (oldSolution_)
warning("oldSolution already created\n"); warning("oldSolution already created\n");
else // create oldSolution else // create oldSolution
oldSolution_.reset(new SystemVector(*problemStat_->globalBasis(), INTERPOLATE)); oldSolution_.reset(new SystemVector(*problemStat_->globalBasis(), DataTransferOperation::INTERPOLATE));
} }
......
...@@ -173,8 +173,8 @@ template <class Traits> ...@@ -173,8 +173,8 @@ template <class Traits>
void ProblemStat<Traits>::createMatricesAndVectors() void ProblemStat<Traits>::createMatricesAndVectors()
{ {
systemMatrix_ = std::make_shared<SystemMatrix>(*globalBasis_, *globalBasis_); systemMatrix_ = std::make_shared<SystemMatrix>(*globalBasis_, *globalBasis_);
solution_ = std::make_shared<SystemVector>(*globalBasis_, INTERPOLATE); solution_ = std::make_shared<SystemVector>(*globalBasis_, DataTransferOperation::INTERPOLATE);
rhs_ = std::make_shared<SystemVector>(*globalBasis_, NO_OPERATION); rhs_ = std::make_shared<SystemVector>(*globalBasis_, DataTransferOperation::NO_OPERATION);
auto localView = globalBasis_->localView(); auto localView = globalBasis_->localView();
for_each_node(localView.tree(), [&,this](auto const& node, auto treePath) for_each_node(localView.tree(), [&,this](auto const& node, auto treePath)
......
...@@ -57,7 +57,7 @@ namespace AMDiS ...@@ -57,7 +57,7 @@ namespace AMDiS
public: public:
/// Constructor. Constructs new BaseVector. /// Constructor. Constructs new BaseVector.
DOFVectorBase(GlobalBasis const& basis, DataTransferOperation op = NO_OPERATION) DOFVectorBase(GlobalBasis const& basis, DataTransferOperation op = DataTransferOperation::NO_OPERATION)
: basis_(&basis) : basis_(&basis)
, dataTransfer_(DataTransferFactory::create(op, basis)) , dataTransfer_(DataTransferFactory::create(op, basis))
{ {
......
...@@ -91,7 +91,7 @@ namespace AMDiS ...@@ -91,7 +91,7 @@ namespace AMDiS
using Super = DOFVectorBase<BasisType, EigenVector<ValueType>>; using Super = DOFVectorBase<BasisType, EigenVector<ValueType>>;
public: public:
DOFVector(BasisType const& basis, DataTransferOperation op = NO_OPERATION) DOFVector(BasisType const& basis, DataTransferOperation op = DataTransferOperation::NO_OPERATION)
: Super(basis, op) : Super(basis, op)
{} {}
...@@ -102,7 +102,7 @@ namespace AMDiS ...@@ -102,7 +102,7 @@ namespace AMDiS
/// Constructor a dofvector from given basis and name /// Constructor a dofvector from given basis and name
template <class ValueType = double, class Basis> template <class ValueType = double, class Basis>
DOFVector<Basis, ValueType> DOFVector<Basis, ValueType>
makeDOFVector(Basis const& basis, DataTransferOperation op = NO_OPERATION) makeDOFVector(Basis const& basis, DataTransferOperation op = DataTransferOperation::NO_OPERATION)
{ {
return {basis, op}; return {basis, op};
} }
......
...@@ -100,7 +100,7 @@ namespace AMDiS ...@@ -100,7 +100,7 @@ namespace AMDiS
using Super = DOFVectorBase<BasisType, IstlVector<ValueType>>; using Super = DOFVectorBase<BasisType, IstlVector<ValueType>>;
public: public:
DOFVector(BasisType const& basis, DataTransferOperation op = NO_OPERATION) DOFVector(BasisType const& basis, DataTransferOperation op = DataTransferOperation::NO_OPERATION)
: Super(basis, op) : Super(basis, op)
{} {}
...@@ -111,7 +111,7 @@ namespace AMDiS ...@@ -111,7 +111,7 @@ namespace AMDiS
/// Constructor a dofvector from given basis and name /// Constructor a dofvector from given basis and name
template <class ValueType = double, class Basis> template <class ValueType = double, class Basis>
DOFVector<Basis, ValueType> DOFVector<Basis, ValueType>
makeDOFVector(Basis const& basis, DataTransferOperation op = NO_OPERATION) makeDOFVector(Basis const& basis, DataTransferOperation op = DataTransferOperation::NO_OPERATION)
{ {
return {basis, op}; return {basis, op};
} }
......
...@@ -91,7 +91,7 @@ namespace AMDiS ...@@ -91,7 +91,7 @@ namespace AMDiS
using Super = DOFVectorBase<BasisType, MtlVector<ValueType>>; using Super = DOFVectorBase<BasisType, MtlVector<ValueType>>;
public: public:
DOFVector(BasisType const& basis, DataTransferOperation op = NO_OPERATION) DOFVector(BasisType const& basis, DataTransferOperation op = DataTransferOperation::NO_OPERATION)
: Super(basis, op) : Super(basis, op)
{} {}
...@@ -102,7 +102,7 @@ namespace AMDiS ...@@ -102,7 +102,7 @@ namespace AMDiS
/// Constructor a dofvector from given basis and name /// Constructor a dofvector from given basis and name
template <class ValueType = double, class Basis> template <class ValueType = double, class Basis>
DOFVector<Basis, ValueType> DOFVector<Basis, ValueType>
makeDOFVector(Basis const& basis, DataTransferOperation op = NO_OPERATION) makeDOFVector(Basis const& basis, DataTransferOperation op = DataTransferOperation::NO_OPERATION)
{ {
return {basis, op}; return {basis, op};
} }
......
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