Commit 92663391 authored by Carsten Gräser's avatar Carsten Gräser

Remove template parameters for size_type

This is now fixed to std::size_t
parent 38adaa40
......@@ -25,7 +25,7 @@ namespace Functions {
template<typename GV, typename R>
class BSplineLocalFiniteElement;
template<typename GV, class MI, class ST>
template<typename GV, class MI>
class BSplineNodeFactory;
......@@ -52,7 +52,7 @@ public:
*
* The patch object does all the work.
*/
BSplineLocalBasis(const BSplineNodeFactory<GV,FlatMultiIndex<std::size_t>,std::size_t>& nodeFactory,
BSplineLocalBasis(const BSplineNodeFactory<GV,FlatMultiIndex<std::size_t>>& nodeFactory,
const BSplineLocalFiniteElement<GV,R>& lFE)
: nodeFactory_(nodeFactory),
lFE_(lFE)
......@@ -144,7 +144,7 @@ public:
}
private:
const BSplineNodeFactory<GV,FlatMultiIndex<std::size_t>,std::size_t>& nodeFactory_;
const BSplineNodeFactory<GV,FlatMultiIndex<std::size_t>>& nodeFactory_;
const BSplineLocalFiniteElement<GV,R>& lFE_;
......@@ -362,7 +362,7 @@ public:
/** \brief Constructor with a given B-spline basis
*/
BSplineLocalFiniteElement(const BSplineNodeFactory<GV,FlatMultiIndex<std::size_t>,std::size_t>& nodeFactory)
BSplineLocalFiniteElement(const BSplineNodeFactory<GV,FlatMultiIndex<std::size_t>>& nodeFactory)
: nodeFactory_(nodeFactory),
localBasis_(nodeFactory,*this)
{}
......@@ -453,7 +453,7 @@ public:
return r;
}
const BSplineNodeFactory<GV,FlatMultiIndex<std::size_t>,std::size_t>& nodeFactory_;
const BSplineNodeFactory<GV,FlatMultiIndex<std::size_t>>& nodeFactory_;
BSplineLocalBasis<GV,R> localBasis_;
BSplineLocalCoefficients<dim> localCoefficients_;
......@@ -464,13 +464,13 @@ public:
};
template<typename GV, typename ST, typename TP>
template<typename GV, typename TP>
class BSplineNode;
template<typename GV, class MI, class TP, class ST>
template<typename GV, class MI, class TP>
class BSplineNodeIndexSet;
template<typename GV, class MI, class ST>
template<typename GV, class MI>
class BSplineNodeFactory
{
static const int dim = GV::dimension;
......@@ -534,13 +534,13 @@ public:
/** \brief The grid view that the FE space is defined on */
using GridView = GV;
using size_type = ST;
using size_type = std::size_t;
template<class TP>
using Node = BSplineNode<GV, size_type, TP>;
using Node = BSplineNode<GV, TP>;
template<class TP>
using IndexSet = BSplineNodeIndexSet<GV, MI, TP, ST>;
using IndexSet = BSplineNodeIndexSet<GV, MI, TP>;
/** \brief Type used for global numbering of the basis vectors */
using MultiIndex = MI;
......@@ -1179,22 +1179,22 @@ public:
template<typename GV, typename ST, typename TP>
template<typename GV, typename TP>
class BSplineNode :
public LeafBasisNode<ST, TP>
public LeafBasisNode<std::size_t, TP>
{
static const int dim = GV::dimension;
using Base = LeafBasisNode<ST,TP>;
using Base = LeafBasisNode<std::size_t,TP>;
public:
using size_type = ST;
using size_type = std::size_t;
using TreePath = TP;
using Element = typename GV::template Codim<0>::Entity;
using FiniteElement = BSplineLocalFiniteElement<GV,double>;
BSplineNode(const TreePath& treePath, const BSplineNodeFactory<GV, FlatMultiIndex<ST>, ST>* nodeFactory) :
BSplineNode(const TreePath& treePath, const BSplineNodeFactory<GV, FlatMultiIndex<std::size_t>>* nodeFactory) :
Base(treePath),
nodeFactory_(nodeFactory),
finiteElement_(*nodeFactory)
......@@ -1226,7 +1226,7 @@ public:
protected:
const BSplineNodeFactory<GV, FlatMultiIndex<ST>, ST>* nodeFactory_;
const BSplineNodeFactory<GV, FlatMultiIndex<std::size_t>>* nodeFactory_;
FiniteElement finiteElement_;
Element element_;
......@@ -1234,19 +1234,19 @@ protected:
template<typename GV, class MI, class TP, class ST>
template<typename GV, class MI, class TP>
class BSplineNodeIndexSet
{
enum {dim = GV::dimension};
public:
using size_type = ST;
using size_type = std::size_t;
/** \brief Type used for global numbering of the basis vectors */
using MultiIndex = MI;
using NodeFactory = BSplineNodeFactory<GV, MI, ST>;
using NodeFactory = BSplineNodeFactory<GV, MI>;
using Node = typename NodeFactory::template Node<TP>;
......@@ -1324,7 +1324,7 @@ protected:
* \tparam GV The GridView that the space is defined on
*/
template<typename GV>
using BSplineBasis = DefaultGlobalBasis<BSplineNodeFactory<GV, FlatMultiIndex<std::size_t>, std::size_t> >;
using BSplineBasis = DefaultGlobalBasis<BSplineNodeFactory<GV, FlatMultiIndex<std::size_t>> >;
} // namespace Functions
......
......@@ -40,8 +40,8 @@ Imp::PQkNodeFactoryBuilder<k> lagrange()
* \tparam GV The GridView that the space is defined on
* \tparam k The order of the basis
*/
template<typename GV, int k, class ST = std::size_t>
using LagrangeBasis = DefaultGlobalBasis<PQkNodeFactory<GV, k, FlatMultiIndex<ST>, ST> >;
template<typename GV, int k>
using LagrangeBasis = DefaultGlobalBasis<PQkNodeFactory<GV, k, FlatMultiIndex<std::size_t>> >;
......
......@@ -31,14 +31,14 @@ namespace Functions {
// set and can be used without a global basis.
// *****************************************************************************
template<typename GV, int k, typename ST, typename TP>
using LagrangeDGNode = PQkNode<GV, k, ST, TP>;
template<typename GV, int k, typename TP>
using LagrangeDGNode = PQkNode<GV, k, TP>;
template<typename GV, int k, class MI, class TP, class ST>
template<typename GV, int k, class MI, class TP>
class LagrangeDGNodeIndexSet;
template<typename GV, int k, class MI, class ST>
template<typename GV, int k, class MI>
class LagrangeDGNodeFactory
{
static const int dim = GV::dimension;
......@@ -47,7 +47,7 @@ public:
/** \brief The grid view that the FE space is defined on */
using GridView = GV;
using size_type = ST;
using size_type = std::size_t;
// Precompute the number of dofs per entity type
......@@ -61,10 +61,10 @@ public:
template<class TP>
using Node = LagrangeDGNode<GV, k, size_type, TP>;
using Node = LagrangeDGNode<GV, k, TP>;
template<class TP>
using IndexSet = LagrangeDGNodeIndexSet<GV, k, MI, TP, ST>;
using IndexSet = LagrangeDGNodeIndexSet<GV, k, MI, TP>;
/** \brief Type used for global numbering of the basis vectors */
using MultiIndex = MI;
......@@ -186,7 +186,7 @@ public:
template<typename GV, int k, class MI, class TP, class ST>
template<typename GV, int k, class MI, class TP>
class LagrangeDGNodeIndexSet
{
// Cannot be an enum -- otherwise the switch statement below produces compiler warnings
......@@ -194,12 +194,12 @@ class LagrangeDGNodeIndexSet
public:
using size_type = ST;
using size_type = std::size_t;
/** \brief Type used for global numbering of the basis vectors */
using MultiIndex = MI;
using NodeFactory = LagrangeDGNodeFactory<GV, k, MI, ST>;
using NodeFactory = LagrangeDGNodeFactory<GV, k, MI>;
using Node = typename NodeFactory::template Node<TP>;
......@@ -300,8 +300,8 @@ protected:
* \tparam GV The GridView that the space is defined on
* \tparam k The order of the basis
*/
template<typename GV, int k, class ST = std::size_t>
using LagrangeDGBasis = DefaultGlobalBasis<LagrangeDGNodeFactory<GV, k, FlatMultiIndex<ST>, ST> >;
template<typename GV, int k>
using LagrangeDGBasis = DefaultGlobalBasis<LagrangeDGNodeFactory<GV, k, FlatMultiIndex<std::size_t>> >;
......
......@@ -30,16 +30,16 @@ namespace Functions {
// set and can be used without a global basis.
// *****************************************************************************
template<typename GV, typename ST, typename TP>
template<typename GV, typename TP>
class PQ1Node;
template<typename GV, class MI, class TP, class ST>
template<typename GV, class MI, class TP>
class PQ1NodeIndexSet;
template<typename GV, class MI, class ST>
template<typename GV, class MI>
class PQ1NodeFactory;
template<typename GV, class MI, class ST>
template<typename GV, class MI>
class PQ1NodeFactory
{
static const int dim = GV::dimension;
......@@ -48,13 +48,13 @@ public:
/** \brief The grid view that the FE space is defined on */
using GridView = GV;
using size_type = ST;
using size_type = std::size_t;
template<class TP>
using Node = PQ1Node<GV, size_type, TP>;
using Node = PQ1Node<GV, TP>;
template<class TP>
using IndexSet = PQ1NodeIndexSet<GV, MI, TP, ST>;
using IndexSet = PQ1NodeIndexSet<GV, MI, TP>;
/** \brief Type used for global numbering of the basis vectors */
using MultiIndex = MI;
......@@ -90,7 +90,7 @@ public:
size_type size() const
{
return gridView_.size(dim);
return (size_type)(gridView_.size(dim));
}
//! Return number possible values for next position in multi index
......@@ -120,19 +120,19 @@ public:
template<typename GV, typename ST, typename TP>
template<typename GV, typename TP>
class PQ1Node :
public LeafBasisNode<ST, TP>
public LeafBasisNode<std::size_t, TP>
{
static const int dim = GV::dimension;
static const int maxSize = StaticPower<2,GV::dimension>::power;
using Base = LeafBasisNode<ST,TP>;
using Base = LeafBasisNode<std::size_t,TP>;
using FiniteElementCache = typename Dune::PQkLocalFiniteElementCache<typename GV::ctype, double, dim, 1>;
public:
using size_type = ST;
using size_type = std::size_t;
using TreePath = TP;
using Element = typename GV::template Codim<0>::Entity;
using FiniteElement = typename FiniteElementCache::FiniteElementType;
......@@ -175,19 +175,19 @@ protected:
template<typename GV, class MI, class TP, class ST>
template<typename GV, class MI, class TP>
class PQ1NodeIndexSet
{
enum {dim = GV::dimension};
public:
using size_type = ST;
using size_type = std::size_t;
/** \brief Type used for global numbering of the basis vectors */
using MultiIndex = MI;
using NodeFactory = PQ1NodeFactory<GV, MI, ST>;
using NodeFactory = PQ1NodeFactory<GV, MI>;
using Node = typename NodeFactory::template Node<TP>;
......@@ -216,7 +216,7 @@ public:
*/
size_type size() const
{
return node_->finiteElement().size();
return (size_type)(node_->finiteElement().size());
}
//! Maps from subtree index set [0..size-1] to a globally unique multi index in global basis
......@@ -226,7 +226,7 @@ public:
const auto& gridIndexSet = nodeFactory_->gridView().indexSet();
const auto& element = node_->element();
return {{ gridIndexSet.subIndex(element,localKey.subEntity(),dim) }};
return {{ (size_type)(gridIndexSet.subIndex(element,localKey.subEntity(),dim)) }};
}
protected:
......@@ -240,10 +240,9 @@ protected:
* \ingroup FunctionSpaceBasesImplementations
*
* \tparam GV The GridView that the space is defined on
* \tparam ST The type used for local indices; global indices are FlatMultiIndex<ST>
*/
template<typename GV, class ST = std::size_t>
using PQ1NodalBasis = DefaultGlobalBasis<PQ1NodeFactory<GV, FlatMultiIndex<ST>, ST> >;
template<typename GV>
using PQ1NodalBasis = DefaultGlobalBasis<PQ1NodeFactory<GV, FlatMultiIndex<std::size_t>> >;
} // end namespace Functions
} // end namespace Dune
......
......@@ -32,18 +32,18 @@ namespace Functions {
// set and can be used without a global basis.
// *****************************************************************************
template<typename GV, int k, typename ST, typename TP>
template<typename GV, int k, typename TP>
class PQkNode;
template<typename GV, int k, class MI, class TP, class ST>
template<typename GV, int k, class MI, class TP>
class PQkNodeIndexSet;
template<typename GV, int k, class MI, class ST>
template<typename GV, int k, class MI>
class PQkNodeFactory;
template<typename GV, int k, class MI, class ST>
template<typename GV, int k, class MI>
class PQkNodeFactory
{
static const int dim = GV::dimension;
......@@ -52,7 +52,7 @@ public:
/** \brief The grid view that the FE space is defined on */
using GridView = GV;
using size_type = ST;
using size_type = std::size_t;
// Precompute the number of dofs per entity type
......@@ -74,10 +74,10 @@ public:
k == 0 ? (dim == 3 ? 1 : 0) : (k-2)*(k-1)*(2*k-3)/6;
template<class TP>
using Node = PQkNode<GV, k, size_type, TP>;
using Node = PQkNode<GV, k, TP>;
template<class TP>
using IndexSet = PQkNodeIndexSet<GV, k, MI, TP, ST>;
using IndexSet = PQkNodeIndexSet<GV, k, MI, TP>;
/** \brief Type used for global numbering of the basis vectors */
using MultiIndex = MI;
......@@ -212,19 +212,19 @@ public:
template<typename GV, int k, typename ST, typename TP>
template<typename GV, int k, typename TP>
class PQkNode :
public LeafBasisNode<ST, TP>
public LeafBasisNode<std::size_t, TP>
{
static const int dim = GV::dimension;
static const int maxSize = StaticPower<(k+1),GV::dimension>::power;
using Base = LeafBasisNode<ST,TP>;
using Base = LeafBasisNode<std::size_t,TP>;
using FiniteElementCache = typename Dune::PQkLocalFiniteElementCache<typename GV::ctype, double, dim, k>;
public:
using size_type = ST;
using size_type = std::size_t;
using TreePath = TP;
using Element = typename GV::template Codim<0>::Entity;
using FiniteElement = typename FiniteElementCache::FiniteElementType;
......@@ -267,19 +267,19 @@ protected:
template<typename GV, int k, class MI, class TP, class ST>
template<typename GV, int k, class MI, class TP>
class PQkNodeIndexSet
{
enum {dim = GV::dimension};
public:
using size_type = ST;
using size_type = std::size_t;
/** \brief Type used for global numbering of the basis vectors */
using MultiIndex = MI;
using NodeFactory = PQkNodeFactory<GV, k, MI, ST>;
using NodeFactory = PQkNodeFactory<GV, k, MI>;
using Node = typename NodeFactory::template Node<TP>;
......@@ -419,9 +419,9 @@ struct PQkNodeFactoryBuilder
{
static const std::size_t requiredMultiIndexSize=1;
template<class MultiIndex, class GridView, class size_type=std::size_t>
template<class MultiIndex, class GridView>
auto build(const GridView& gridView)
-> PQkNodeFactory<GridView, k, MultiIndex, size_type>
-> PQkNodeFactory<GridView, k, MultiIndex>
{
return {gridView};
}
......@@ -458,8 +458,8 @@ Imp::PQkNodeFactoryBuilder<k> pq()
* \tparam GV The GridView that the space is defined on
* \tparam k The order of the basis
*/
template<typename GV, int k, class ST = std::size_t>
using PQkNodalBasis = DefaultGlobalBasis<PQkNodeFactory<GV, k, FlatMultiIndex<ST>, ST> >;
template<typename GV, int k>
using PQkNodalBasis = DefaultGlobalBasis<PQkNodeFactory<GV, k, FlatMultiIndex<std::size_t>> >;
......
......@@ -31,39 +31,39 @@ namespace Functions {
// set and can be used without a global basis.
// *****************************************************************************
template<typename GV, class ST, typename TP>
template<typename GV, typename TP>
class TaylorHoodVelocityTree;
template<typename GV, class ST, typename TP>
template<typename GV, typename TP>
class TaylorHoodBasisTree;
template<typename GV, class MI, class TP, class ST, bool HI>
template<typename GV, class MI, class TP, bool HI>
class TaylorHoodNodeIndexSet;
template<typename GV, class MI, class ST, bool HI=false>
template<typename GV, class MI, bool HI=false>
class TaylorHoodNodeFactory
{
static const bool useHybridIndices = HI;
static const int dim = GV::dimension;
template<class, class, class, class, bool>
template<class, class, class, bool>
friend class TaylorHoodNodeIndexSet;
public:
/** \brief The grid view that the FE space is defined on */
using GridView = GV;
using size_type = ST;
using size_type = std::size_t;
template<class TP>
using Node = TaylorHoodBasisTree<GV, ST, TP>;
using Node = TaylorHoodBasisTree<GV, TP>;
template<class TP>
using IndexSet = TaylorHoodNodeIndexSet<GV, MI, TP, ST, HI>;
using IndexSet = TaylorHoodNodeIndexSet<GV, MI, TP, HI>;
/** \brief Type used for global numbering of the basis vectors */
using MultiIndex = MI;
......@@ -73,8 +73,8 @@ public:
private:
using PQMultiIndex = std::array<size_type, 1>;
using PQ1Factory = PQkNodeFactory<GV,1,PQMultiIndex,ST>;
using PQ2Factory = PQkNodeFactory<GV,2,PQMultiIndex,ST>;
using PQ1Factory = PQkNodeFactory<GV,1,PQMultiIndex>;
using PQ2Factory = PQkNodeFactory<GV,2,PQMultiIndex>;
public:
......@@ -186,14 +186,14 @@ protected:
template<typename GV, class ST, typename TP>
template<typename GV, typename TP>
class TaylorHoodVelocityTree :
public PowerBasisNode<ST, TP ,PQkNode<GV,2, ST, decltype(TypeTree::push_back(TP(), 0)) >, GV::dimension>
public PowerBasisNode<std::size_t, TP ,PQkNode<GV,2, decltype(TypeTree::push_back(TP(), 0)) >, GV::dimension>
{
using ComponentTreePath = decltype(TypeTree::push_back(TP(), 0));
using PQ2Node = PQkNode<GV,2, ST, ComponentTreePath >;
using Base = PowerBasisNode<ST, TP ,PQ2Node, GV::dimension>;
using PQ2Node = PQkNode<GV,2, ComponentTreePath >;
using Base = PowerBasisNode<std::size_t, TP ,PQ2Node, GV::dimension>;
public:
TaylorHoodVelocityTree(const TP& tp) :
......@@ -204,20 +204,20 @@ public:
}
};
template<typename GV, class ST, typename TP>
template<typename GV, typename TP>
class TaylorHoodBasisTree :
public CompositeBasisNode<ST, TP,
TaylorHoodVelocityTree<GV, ST, decltype(TypeTree::push_back<0>(TP()))>,
PQkNode<GV,1,ST, decltype(TypeTree::push_back<1ul>(TP()))>
public CompositeBasisNode<std::size_t, TP,
TaylorHoodVelocityTree<GV, decltype(TypeTree::push_back<0>(TP()))>,
PQkNode<GV,1, decltype(TypeTree::push_back<1ul>(TP()))>
>
{
using VelocityTreePath = decltype(TypeTree::push_back<0ul>(TP()));
using PressureTreePath = decltype(TypeTree::push_back<1ul>(TP()));
using VelocityNode=TaylorHoodVelocityTree<GV, ST, VelocityTreePath>;
using PressureNode=PQkNode<GV,1,ST, PressureTreePath>;
using VelocityNode=TaylorHoodVelocityTree<GV, VelocityTreePath>;
using PressureNode=PQkNode<GV,1, PressureTreePath>;
using Base=CompositeBasisNode<ST, TP, VelocityNode, PressureNode>;
using Base=CompositeBasisNode<std::size_t, TP, VelocityNode, PressureNode>;
public:
TaylorHoodBasisTree(const TP& tp):
......@@ -231,7 +231,7 @@ public:
template<typename GV, class MI, class TP, class ST, bool HI>
template<typename GV, class MI, class TP, bool HI>
class TaylorHoodNodeIndexSet
{
static const bool useHybridIndices = HI;
......@@ -240,12 +240,12 @@ class TaylorHoodNodeIndexSet
public:
using size_type = ST;
using size_type = std::size_t;
/** \brief Type used for global numbering of the basis vectors */
using MultiIndex = MI;
using NodeFactory = TaylorHoodNodeFactory<GV, MI, ST, HI>;
using NodeFactory = TaylorHoodNodeFactory<GV, MI, HI>;
using Node = typename NodeFactory::template Node<TP>;
......@@ -349,8 +349,8 @@ private:
*
* \tparam GV The GridView that the space is defined on.
*/
template<typename GV, class ST = std::size_t>
using TaylorHoodBasis = DefaultGlobalBasis<TaylorHoodNodeFactory<GV, std::array<ST, 2>, ST> >;
template<typename GV>
using TaylorHoodBasis = DefaultGlobalBasis<TaylorHoodNodeFactory<GV, std::array<std::size_t, 2>> >;
......
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