From: Daniel Arndt Date: Mon, 4 Sep 2017 23:24:05 +0000 (+0200) Subject: Implement operator^ for FiniteElement X-Git-Tag: v9.0.0-rc1~1079^2~5 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79157eee6d76a0d5c655470f38006c120eb0c01c;p=dealii.git Implement operator^ for FiniteElement --- diff --git a/include/deal.II/fe/fe.h b/include/deal.II/fe/fe.h index 1639b565b3..ce23e2b73c 100644 --- a/include/deal.II/fe/fe.h +++ b/include/deal.II/fe/fe.h @@ -758,7 +758,18 @@ public: * Virtual destructor. Makes sure that pointers to this class are deleted * properly. */ - virtual ~FiniteElement (); + virtual ~FiniteElement () = default; + + /** + * Creates information for creating a FESystem with this class as + * base element and with multiplicity @p multiplicity. In particular, + * the return type of this function can be used in the constructor + * for a FESystem object. + * This function calls clone() and hence creates a copy of the + * current object. + */ + std::pair >, unsigned int> + operator^ (unsigned int multiplicity) const; /** * A sort of virtual copy constructor, this function returns a copy of @@ -772,8 +783,8 @@ public: * type. They do so through this function. */ virtual - std::unique_ptr> - clone() const = 0; + std::unique_ptr > + clone() const = 0; /** * Return a string that uniquely identifies a finite element. The general diff --git a/source/fe/fe.cc b/source/fe/fe.cc index 901cdabf45..5b09abb34e 100644 --- a/source/fe/fe.cc +++ b/source/fe/fe.cc @@ -152,9 +152,12 @@ FiniteElement (const FiniteElementData &fe_data, template -FiniteElement::~FiniteElement () -{} - +std::pair >, unsigned int> +FiniteElement::operator^ (unsigned int multiplicity) const +{ + return std::make_pair>, + unsigned int> (std::move(this->clone()), std::move(multiplicity)); +}