Commit da684169 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

use std::optional instead of Dune::Std::optional

parent de0b3746
#pragma once
#include <optional>
#include <type_traits>
#include <dune/common/typetraits.hh>
#include <dune/common/std/optional.hh>
#include <dune/geometry/type.hh>
namespace AMDiS
......@@ -157,7 +157,7 @@ namespace AMDiS
Geometry const* geometry_;
// The localGeometry may be constructed only if needed
mutable Dune::Std::optional<LocalGeometry> localGeometry_;
mutable std::optional<LocalGeometry> localGeometry_;
};
} // end namespace AMDiS
......@@ -134,10 +134,10 @@ namespace AMDiS
GridFunction gridFct_;
/// localFunction associated with gridFunction. Mus be updated whenever gridFunction changes.
Dune::Std::optional<LocalFunction> localFct_;
std::optional<LocalFunction> localFct_;
/// Assign each element type a quadrature rule
Dune::Std::optional<QuadFactory> quadFactory_;
std::optional<QuadFactory> quadFactory_;
/// the derivative order of this operator (in {0, 1, 2})
int termOrder_ = 0;
......
#pragma once
#include <optional>
#include <string>
#include <dune/common/parametertree.hh>
#include <dune/common/std/optional.hh>
namespace AMDiS
{
......@@ -23,7 +22,7 @@ namespace AMDiS
* May throw an exception if the value can not be parsed into type T
**/
template <class T>
static Dune::Std::optional<T> get(std::string const& key)
static std::optional<T> get(std::string const& key)
{
if (pt().hasKey(key))
return pt().get<T>(key);
......
#pragma once
#include <limits>
#include <optional>
#include <string>
#include <utility>
#include <dune/common/std/optional.hh>
#include <dune/grid/common/grid.hh>
#include <amdis/common/ConceptsBase.hpp>
......
#pragma once
#include <map>
#include <optional>
#include <utility>
#include <vector>
#include <dune/common/concept.hh>
#include <dune/common/std/optional.hh>
#include <dune/functions/functionspacebases/concepts.hh>
#include <dune/functions/functionspacebases/subspacebasis.hh>
......@@ -122,7 +122,7 @@ namespace AMDiS
std::vector<bool> periodicNodes_;
std::map<std::size_t, std::size_t> associations_;
Dune::Std::optional<bool> hasConnectedIntersections_;
std::optional<bool> hasConnectedIntersections_;
};
namespace Impl {
......
......@@ -2,10 +2,9 @@
#if HAVE_MPI
#include <functional>
#include <optional>
#include <utility>
#include <dune/common/std/optional.hh>
#include <amdis/common/Concepts.hpp>
namespace AMDiS { namespace Mpi
......@@ -56,7 +55,7 @@ namespace AMDiS { namespace Mpi
{}
/// Operator called as test function in the \ref Request class.
Dune::Std::optional<MPI_Status> operator()()
std::optional<MPI_Status> operator()()
{
if (progress_ == STARTED) {
int flag = 0;
......
......@@ -3,11 +3,11 @@
#if HAVE_MPI
#include <cassert>
#include <functional>
#include <optional>
#include <type_traits>
#include <mpi.h>
#include <dune/common/std/optional.hh>
#include <amdis/common/Concepts.hpp>
namespace AMDiS { namespace Mpi
......@@ -34,7 +34,7 @@ namespace AMDiS { namespace Mpi
// Returns an MPI_Status object if the operation identified by the request is complete.
// If the request is an active persistent request, it is marked as inactive. Any other type of
// request is deallocated and the request handle is set to MPI_REQUEST_NULL .
Dune::Std::optional<MPI_Status> test()
std::optional<MPI_Status> test()
{
if (advanced_)
return test_();
......@@ -46,7 +46,7 @@ namespace AMDiS { namespace Mpi
}
// Access the information associated with a request, without freeing the request.
Dune::Std::optional<MPI_Status> status() const
std::optional<MPI_Status> status() const
{
assert( !advanced_ );
......@@ -66,7 +66,7 @@ namespace AMDiS { namespace Mpi
MPI_Status wait()
{
if (advanced_) {
Dune::Std::optional<MPI_Status> status;
std::optional<MPI_Status> status;
while( !(status = test()) ) ;
return status.value();
} else {
......@@ -115,7 +115,7 @@ namespace AMDiS { namespace Mpi
MPI_Status status_; // the MPI_Status after the request object is destroyed
bool status_initialized_ = false;
std::function<Dune::Std::optional<MPI_Status>(void)> test_;
std::function<std::optional<MPI_Status>(void)> test_;
bool advanced_ = false;
};
......
#pragma once
#include <optional>
#include <tuple>
#include <type_traits>
#include <dune/common/std/optional.hh>
#include <amdis/common/Index.hpp>
namespace AMDiS { namespace Mpi
......@@ -19,14 +18,14 @@ namespace AMDiS { namespace Mpi
: reqs_{reqs...}
{}
Dune::Std::optional<Data const*> test()
std::optional<Data const*> test()
{
auto op = std::get<0>(reqs_).test();
return test(op, index_t<1>{});
}
template <class Optional, std::size_t i = 0>
Dune::Std::optional<Data const*> test(Optional op, index_t<i> = {})
std::optional<Data const*> test(Optional op, index_t<i> = {})
{
if (!op)
return {};
......@@ -36,7 +35,7 @@ namespace AMDiS { namespace Mpi
}
template <class Optional>
Dune::Std::optional<Data const*> test(Optional&& result, index_t<N>)
std::optional<Data const*> test(Optional&& result, index_t<N>)
{
return std::forward<Optional>(result);
}
......
#pragma once
#include <memory>
#include <optional>
#include <vector>
#include <dune/common/tuplevector.hh>
#include <dune/common/version.hh>
#include <dune/common/std/optional.hh>
#include <dune/functions/functionspacebases/interpolate.hh>
#include <amdis/common/Concepts.hpp>
......
#pragma once
#include <optional>
#include <type_traits>
#include <dune/common/std/optional.hh>
#include <dune/functions/common/signature.hh>
#include <dune/functions/gridfunctions/gridviewentityset.hh>
......@@ -67,7 +67,7 @@ namespace AMDiS
private:
Function fct_;
Dune::Std::optional<Geometry> geometry_;
std::optional<Geometry> geometry_;
};
......
#pragma once
#include <optional>
#include <vector>
#include <dune/common/std/optional.hh>
#include <dune/functions/common/defaultderivativetraits.hh>
#include <dune/functions/functionspacebases/defaultnodetorangemap.hh>
#include <dune/functions/functionspacebases/flatvectorview.hh>
......
......@@ -236,7 +236,7 @@ protected:
Type type_;
LocalView localView_;
SubTree const* subTree_;
Dune::Std::optional<Geometry> geometry_;
std::optional<Geometry> geometry_;
std::vector<ValueType> localCoefficients_;
bool bound_ = false;
};
......
#pragma once
#include <memory>
#include <optional>
#include <string>
#include <dune/common/std/optional.hh>
#include <dune/istl/owneroverlapcopy.hh>
#include <dune/istl/solvercategory.hh>
#include <dune/istl/paamg/pinfo.hh>
......
#pragma once
#include <optional>
#include <petsc.h>
#include <dune/common/parallel/indexset.hh>
#include <dune/common/parallel/localindex.hh>
#include <dune/common/parallel/plocalindex.hh>
#include <dune/common/parallel/remoteindices.hh>
#include <dune/common/std/optional.hh>
#include <dune/common/typeutilities.hh>
#include <amdis/functions/GlobalIdSet.hpp>
......
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