Loading...
Searching...
No Matches
leafprebasismixin.hh
Go to the documentation of this file.
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LEAFPREBASISMIXIN_HH
#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LEAFPREBASISMIXIN_HH
#include <cassert>
#include <cstddef>
#include <type_traits>
#include <dune/functions/functionspacebases/containerdescriptors.hh>
namespace Dune::Functions {
template<class Derived>
class LeafPreBasisMixin
{
public:
using size_type = std::size_t;
static constexpr size_type maxMultiIndexSize = 1;
static constexpr size_type minMultiIndexSize = 1;
static constexpr size_type multiIndexBufferSize = 1;
template<class SizePrefix,
decltype(std::declval<SizePrefix>().size(), bool{}) = true>
size_type size(const SizePrefix& prefix) const
{
assert(prefix.size() == 0 || prefix.size() == 1);
return (prefix.size() == 0) ? derived().dimension() : 0;
}
size_type size() const
{
return derived().dimension();
}
auto containerDescriptor() const
{
return ContainerDescriptors::FlatVector{size()};
}
private:
const Derived& derived() const
{
return static_cast<const Derived&>(*this);
}
};
} // end namespace Dune::Functions
#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LEAFPREBASISMIXIN_HH
containerdescriptors.hh
Lightweight representation of (hierarchical) size and block structure extracted from a basis to descr...
Dune::Functions
Definition monomialset.hh:19
Dune::Functions::ContainerDescriptors::FlatVector
UniformVector< Value > FlatVector
Alias for a uniform vector storing value placeholders.
Definition containerdescriptors.hh:184
Dune::Functions::LeafPreBasisMixin
A generic MixIn class for PreBasis.
Definition leafprebasismixin.hh:36
Dune::Functions::LeafPreBasisMixin::size
size_type size(const SizePrefix &prefix) const
Return number of possible values for next position in multi index.
Definition leafprebasismixin.hh:53
Dune::Functions::LeafPreBasisMixin< BSplinePreBasis< GV > >::minMultiIndexSize
static constexpr size_type minMultiIndexSize
Definition leafprebasismixin.hh:45
Dune::Functions::LeafPreBasisMixin::containerDescriptor
auto containerDescriptor() const
Return a flat container-descriptor.
Definition leafprebasismixin.hh:66
Dune::Functions::LeafPreBasisMixin< BSplinePreBasis< GV > >::maxMultiIndexSize
static constexpr size_type maxMultiIndexSize
Definition leafprebasismixin.hh:42
Dune::Functions::LeafPreBasisMixin::size
size_type size() const
Get the total dimension of the space spanned by this basis.
Definition leafprebasismixin.hh:60
Dune::Functions::LeafPreBasisMixin< BSplinePreBasis< GV > >::size_type
std::size_t size_type
Definition leafprebasismixin.hh:39
Dune::Functions::LeafPreBasisMixin< BSplinePreBasis< GV > >::multiIndexBufferSize
static constexpr size_type multiIndexBufferSize
Definition leafprebasismixin.hh:48