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
	    /// @todo Doc me!
	    /// @param
            Intersection(const GridType& grid, EntityRep<0> cell, int subindex, bool update_now = true)
		: pgrid_(&grid),
		  index_(cell.index()),
		  subindex_(subindex),
		  faces_of_cell_(grid.cell_to_face_[cell]),
		  global_geom_(cpgrid::Entity<1, GridType>(grid, faces_of_cell_[subindex_]).geometry()),
// 		  in_inside_geom_(global_geom_.center()
// 				  - cpgrid::Entity<0, GridType>(grid, index_).geometry().center(),
// 				  global_geom_.volume()),
		  nbcell_(cell.index()), // Init to self, which is invalid.
		  is_on_boundary_(false)
            {
                assert(index_ >= 0);
		if (update_now) {
		    update();
		}
            }
Ejemplo n.º 3
0
PartitionType PartitionTypeIndicator::getPartitionType(const EntityRep<3>& point_entity) const
{
    return getPointPartitionType(point_entity.index());
}
Ejemplo n.º 4
0
PartitionType PartitionTypeIndicator::getPartitionType(const EntityRep<1>& face_entity) const
{
    return getFacePartitionType(face_entity.index());
}
Ejemplo n.º 5
0
PartitionType PartitionTypeIndicator::getPartitionType(const EntityRep<0>& cell_entity) const
{
    if(cell_indicator_.size())
        return PartitionType(cell_indicator_[cell_entity.index()]);
    return InteriorEntity;
}
Ejemplo n.º 6
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());
	    }