Ejemplo n.º 1
0
	    /// @brief Ordering relation used for maps etc.
	    ///
	    /// Sorting on index and then orientation, with positive orientations first.
	    /// @param other The other entity representation.
	    /// @return true if \b this element is less than the \b other.
	    bool operator<(const EntityRep& other) const
	    {
		int i1 = index();
		int i2 = other.index();
		if (i1 < i2) return true;
		if (orientation() && !other.orientation()) return true;
		return false;
	    }
Ejemplo n.º 2
0
	    /// @brief Random access to the variable through an EntityRep.
	    /// Note that this operator always returns a copy, not a
	    /// reference, since we may need to flip the sign.
	    const T operator[](const EntityRep<codim>& e) const
	    {
		return e.orientation() ?
		    EntityVariableBase<T>::get(e.index()) :
		    -EntityVariableBase<T>::get(e.index());
	    }