From: Wolfgang Bangerth Date: Thu, 3 May 2018 00:27:14 +0000 (-0600) Subject: Take two fields out of FiniteElement::operator==() again. X-Git-Tag: v9.0.0-rc1~30^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F6367%2Fhead;p=dealii.git Take two fields out of FiniteElement::operator==() again. --- diff --git a/include/deal.II/fe/fe.h b/include/deal.II/fe/fe.h index c519de1b0e..dfb2b06922 100644 --- a/include/deal.II/fe/fe.h +++ b/include/deal.II/fe/fe.h @@ -1342,14 +1342,25 @@ public: * current object and of the given object, * - the name returned by get_name(), * - as all of the fields in FiniteElementData, - * - constraint matrices, - * - restriction matrices, - * - prolongation matrices of this object and the argument. + * - constraint matrices. * * This covers most cases where elements can differ, but there are * cases of derived elements that are different and for which the * current function still returns @p true. For these cases, derived * classes should overload this function. + * + * @note This operator specifically does not check the following + * member variables of the current class: + * - restriction matrices, + * - prolongation matrices of this object and the argument. + * This is because these member variables may be initialized only + * on demand by derived classes, rather than being available immediately. + * Consequently, comparing these members would not only be costly because + * these are generall big arrays, but also because their computation may + * be expensive. On the other hand, derived classes for which these + * arrays may differ for two objects even though the above list compares + * as equal, will probably want to implement their own operator==() + * anyway. */ virtual bool operator == (const FiniteElement &fe) const; diff --git a/source/fe/fe.cc b/source/fe/fe.cc index 6c658766ca..6110359bc7 100644 --- a/source/fe/fe.cc +++ b/source/fe/fe.cc @@ -947,11 +947,7 @@ FiniteElement::operator == (const FiniteElement &f) (static_cast&>(*this) == static_cast&>(f)) && - (interface_constraints == f.interface_constraints) - && - (restriction == f.restriction) - && - (prolongation == f.prolongation)); + (interface_constraints == f.interface_constraints)); }