From 9c5277e802f670bcb05face954b3a8c3a0958178 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 2 May 2018 18:27:14 -0600 Subject: [PATCH] Take two fields out of FiniteElement::operator==() again. --- include/deal.II/fe/fe.h | 17 ++++++++++++++--- source/fe/fe.cc | 6 +----- 2 files changed, 15 insertions(+), 8 deletions(-) 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)); } -- 2.39.5