33 #ifndef __H__LIB_GRID__ATTACHMENT_UTIL__
34 #define __H__LIB_GRID__ATTACHMENT_UTIL__
54 template <
class TAttachment>
64 bool edges =
true,
bool faces =
true,
bool vols =
true)
66 access(g, a, vrts, edges, faces, vols);
69 bool access(
Grid& g, TAttachment& a,
bool vrts =
true,
bool edges =
true,
70 bool faces =
true,
bool vols =
true)
111 default:
UG_THROW(
"Unknown element type!");
126 default:
UG_THROW(
"Unknown element type!");
148 template <
class TElem,
class TAttachment>
155 "Can't compare unattached attachments!");
171 template <
class TAttachmentAccessor,
class TIter,
class TVal>
173 TIter elemsBegin, TIter elemsEnd,
193 template<
class TElem,
class TSrcAttachment,
class TDestAttachment>
195 TSrcAttachment& srcAttachment,
196 TDestAttachment& destAttachment);
210 template <
class TElem,
class TAttachment>
212 Grid& destGrid, TAttachment& aDest);
220 template <
class TElemIter,
class TAttachment>
222 TAttachment& aSrc, TAttachment& aDest);
230 template <
class TIterator,
class TAAInt>
232 TAAInt& aaInt,
int baseIndex = 0);
241 template <
class TIterator,
class TAttAcc>
243 const typename TAttAcc::ValueType& val,
void invalidate()
Definition: attachment_pipe.h:556
bool valid() const
Definition: attachment_pipe.h:553
Instances can be used as compare operators, e.g., for std::sort.
Definition: attachment_util.h:150
CompareByAttachment(Grid &g, TAttachment &aGID)
Definition: attachment_util.h:152
Grid::AttachmentAccessor< TElem, TAttachment > m_aaGID
Definition: attachment_util.h:165
bool operator()(TElem *e1, TElem *e2)
Definition: attachment_util.h:159
Base-class for edges.
Definition: grid_base_objects.h:397
Faces are 2-dimensional objects.
Definition: grid_base_objects.h:510
bool access(Grid &grid, TAttachment &a)
Definition: grid.h:189
Manages the elements of a grid and their interconnection.
Definition: grid.h:132
bool has_attachment(IAttachment &attachment)
Definition: grid.h:796
The base class for all geometric objects, such as vertices, edges, faces, volumes,...
Definition: grid_base_objects.h:157
virtual int base_object_id() const =0
Accesses attachements in different element types at the same time.
Definition: attachment_util.h:56
bool is_valid_face_accessor() const
Definition: attachment_util.h:97
Grid::AttachmentAccessor< Edge, TAttachment > & edge_accessor()
Definition: attachment_util.h:131
ConstRefType operator[](Vertex *e) const
Definition: attachment_util.h:115
bool access(Grid &g, TAttachment &a, bool vrts=true, bool edges=true, bool faces=true, bool vols=true)
Definition: attachment_util.h:69
RefType operator[](Volume *e)
Definition: attachment_util.h:103
Grid::AttachmentAccessor< Face, TAttachment > m_aaFace
Definition: attachment_util.h:138
Grid::AttachmentAccessor< Volume, TAttachment > m_aaVol
Definition: attachment_util.h:139
RefType operator[](Edge *e)
Definition: attachment_util.h:101
ConstRefType operator[](GridObject *e) const
Definition: attachment_util.h:119
attachment_value_traits< ValueType >::const_reference ConstRefType
Definition: attachment_util.h:60
void invalidate()
Definition: attachment_util.h:87
Grid::AttachmentAccessor< Face, TAttachment > & face_accessor()
Definition: attachment_util.h:132
ConstRefType operator[](Volume *e) const
Definition: attachment_util.h:118
RefType operator[](Face *e)
Definition: attachment_util.h:102
bool is_valid_vertex_accessor() const
Definition: attachment_util.h:95
ConstRefType operator[](Edge *e) const
Definition: attachment_util.h:116
MultiElementAttachmentAccessor()
Definition: attachment_util.h:62
bool is_valid_volume_accessor() const
Definition: attachment_util.h:98
Grid::AttachmentAccessor< Volume, TAttachment > & volume_accessor()
Definition: attachment_util.h:133
ConstRefType operator[](Face *e) const
Definition: attachment_util.h:117
TAttachment::ValueType ValueType
Definition: attachment_util.h:58
MultiElementAttachmentAccessor(Grid &g, TAttachment &a, bool vrts=true, bool edges=true, bool faces=true, bool vols=true)
Definition: attachment_util.h:63
attachment_value_traits< ValueType >::reference RefType
Definition: attachment_util.h:59
Grid::AttachmentAccessor< Edge, TAttachment > m_aaEdge
Definition: attachment_util.h:137
RefType operator[](GridObject *e)
Definition: attachment_util.h:104
Grid::AttachmentAccessor< Vertex, TAttachment > & vertex_accessor()
Definition: attachment_util.h:130
Grid::AttachmentAccessor< Vertex, TAttachment > m_aaVrt
Definition: attachment_util.h:136
RefType operator[](Vertex *e)
Definition: attachment_util.h:100
bool is_valid_edge_accessor() const
Definition: attachment_util.h:96
Base-class for all vertex-types.
Definition: grid_base_objects.h:231
Volumes are 3-dimensional objects.
Definition: grid_base_objects.h:754
bool ConvertMathVectorAttachmentValues(Grid &grid, TSrcAttachment &srcAttachment, TDestAttachment &destAttachment)
Fills the dest-attachment with values from the source-attachment.
Definition: attachment_util_impl.hpp:58
TIterator FindElementByValue(TIterator begin, TIterator end, const typename TAttAcc::ValueType &val, TAttAcc &aa)
returns the iterator whose element has the specified attachment value.
Definition: attachment_util_impl.hpp:187
bool CopyAttachments(Grid &srcGrid, TAttachment &aSrc, Grid &destGrid, TAttachment &aDest)
copies attachments from one grid to the other
Definition: attachment_util_impl.hpp:115
void AssignIndices(TIterator begin, TIterator end, TAAInt &aaInt, int baseIndex=0)
assigns indices to the elements between begin and end.
Definition: attachment_util_impl.hpp:178
void SetAttachmentValues(TAttachmentAccessor &aaVal, TIter elemsBegin, TIter elemsEnd, const TVal &val)
sets attachment-values for elements between elemsBegin and elemsEnd.
Definition: attachment_util_impl.hpp:44
#define UG_ASSERT(expr, msg)
Definition: assert.h:70
#define UG_THROW(msg)
Definition: error.h:57
@ VOLUME
Definition: grid_base_objects.h:63
@ VERTEX
Definition: grid_base_objects.h:60
@ EDGE
Definition: grid_base_objects.h:61
@ FACE
Definition: grid_base_objects.h:62
TValue & reference
Definition: attachment_pipe.h:112
const TValue & const_reference
Definition: attachment_pipe.h:113