33 #ifndef PERIODIC_IDENTIFIER_H_
34 #define PERIODIC_IDENTIFIER_H_
78 template<
class TElem>
bool match_impl(TElem*, TElem*)
const;
105 template <
class TElem,
class Container = std::vector<TElem*> >
118 UG_ASSERT(e,
"add_slave: slave not valid");
154 template <
class TElem>
bool is_periodic(TElem* e)
const;
155 template <
class TElem>
bool is_slave(TElem*)
const;
156 template <
class TElem>
bool is_master(TElem*)
const;
157 template <
class TElem> TElem*
master(TElem* e)
const;
167 bool replacesParent =
false);
171 bool replacesParent =
false);
175 bool replacesParent =
false);
178 Vertex* replacedBy = NULL);
181 Edge* replacedBy = NULL);
184 Face* replacedBy = NULL);
240 template <
class TElem>
244 template <
class TElem>
249 template <
class TElem>
253 template <
class TElem>
264 template <
class TElem>
268 template <
class TElem,
class TParent>
272 template <
class TElem>
276 template <
class TElem>
279 template <
class TElem,
class TIterator>
286 template <
class TElem>
296 template <
class TElem,
class TAttachment>
316 return m_aa.access(g, a);
346 template <
class TDomain>
358 template <
class TDomain>
359 void IdentifySubsets(TDomain& dom,
const char* sName1,
const char* sName2);
Base-class for edges.
Definition: grid_base_objects.h:397
Faces are 2-dimensional objects.
Definition: grid_base_objects.h:510
the generic attachment-accessor for access to grids attachment pipes.
Definition: grid.h:182
Manages the elements of a grid and their interconnection.
Definition: grid.h:132
PeriodicBoundaryManager * periodic_boundary_manager()
returns a pointer to the associated periodic boundary manager.
Definition: grid.cpp:209
a helper class that holds a collection of possibly unconnected geometric-objects.
Definition: grid_object_collection.h:96
The base class for all geometric objects, such as vertices, edges, faces, volumes,...
Definition: grid_base_objects.h:157
Definition: grid_observer.h:80
Interface to match periodic geometric elements.
Definition: periodic_boundary_manager.h:48
virtual bool match(Volume *, Volume *)
Definition: periodic_boundary_manager.h:54
virtual bool match(Vertex *, Vertex *)=0
virtual ~IIdentifier()
Definition: periodic_boundary_manager.h:50
virtual bool match(Face *, Face *)=0
virtual bool match(Edge *, Edge *)=0
Definition: subset_handler_interface.h:223
Definition: multi_grid.h:72
This class matches geometric elements which are parallel translated.
Definition: periodic_boundary_manager.h:64
virtual ~ParallelShiftIdentifier()
Definition: periodic_boundary_manager.h:70
TPosAA & m_aaPos
Definition: periodic_boundary_manager.h:77
ParallelShiftIdentifier(TPosAA &aa)
Definition: periodic_boundary_manager.h:72
TPosAA::ValueType AttachmentType
Definition: periodic_boundary_manager.h:71
AttachmentType m_shift_opposite
Definition: periodic_boundary_manager.h:76
AttachmentType m_shift
Definition: periodic_boundary_manager.h:75
virtual bool match(Face *f1, Face *f2)
Definition: periodic_boundary_manager.h:68
void set_shift(AttachmentType &shift)
Definition: periodic_boundary_manager.h:73
virtual bool match(Vertex *v1, Vertex *v2)
Definition: periodic_boundary_manager.h:66
virtual bool match(Edge *e1, Edge *e2)
Definition: periodic_boundary_manager.h:67
bool match_impl(TElem *, TElem *) const
Definition: periodic_boundary_manager_impl.hpp:53
Accesses attachements with consideration to periodic boundaries.
Definition: periodic_boundary_manager.h:298
PeriodicAttachmentAccessor(PeriodicBoundaryManager &pbm)
Definition: periodic_boundary_manager.h:311
bool access(Grid &g, TAttachment &a)
Definition: periodic_boundary_manager.h:313
RefType operator[](TElem *e)
Definition: periodic_boundary_manager.h:319
attachment_value_traits< ValueType >::reference RefType
Definition: periodic_boundary_manager.h:301
ConstRefType operator[](TElem *e) const
Definition: periodic_boundary_manager.h:325
PeriodicAttachmentAccessor()
Definition: periodic_boundary_manager.h:304
attachment_value_traits< ValueType >::const_reference ConstRefType
Definition: periodic_boundary_manager.h:302
PeriodicAttachmentAccessor(Grid &g, TAttachment &a)
Definition: periodic_boundary_manager.h:306
PeriodicBoundaryManager * m_pbm
Definition: periodic_boundary_manager.h:333
TAttachment::ValueType ValueType
Definition: periodic_boundary_manager.h:300
Grid::AttachmentAccessor< TElem, TAttachment > m_aa
Definition: periodic_boundary_manager.h:332
Definition: periodic_boundary_manager.h:107
TElem * m_master
Definition: periodic_boundary_manager.h:123
std::set< master_slave_pair > unique_pairs
Definition: periodic_boundary_manager.h:113
Group(TElem *m=NULL)
Definition: periodic_boundary_manager.h:115
Container m_slaves
Definition: periodic_boundary_manager.h:126
Container & get_slaves()
Definition: periodic_boundary_manager.h:122
Container SlaveContainer
Definition: periodic_boundary_manager.h:109
Container::iterator SlaveIterator
Definition: periodic_boundary_manager.h:110
std::pair< TElem *, TElem * > master_slave_pair
Definition: periodic_boundary_manager.h:112
void add_slave(TElem *e)
Definition: periodic_boundary_manager.h:117
Definition: periodic_boundary_manager.h:99
void set_grid(Grid *g)
Definition: periodic_boundary_manager.cpp:46
const Grid::AttachmentAccessor< TElem, Attachment< Group< TElem > * > > & get_group_accessor() const
virtual void face_to_be_erased(Grid *grid, Face *f, Face *replacedBy=NULL)
Notified whenever an element of the given type is erased from the given grid.
Definition: periodic_boundary_manager.cpp:245
void handle_creation_cast_wrapper(TElem *e, GridObject *parent, bool replacesParent)
casts parent pointer to exact type before calling handle_creation
Definition: periodic_boundary_manager_impl.hpp:344
void identify(TElem *e1, TElem *e2, IIdentifier &i)
Definition: periodic_boundary_manager_impl.hpp:78
Grid::AttachmentAccessor< Edge, Attachment< PeriodicStatus > > m_aaPeriodicStatusEDG
Definition: periodic_boundary_manager.h:227
bool is_master(TElem *) const
Definition: periodic_boundary_manager_impl.hpp:504
void check_elements_periodicity(TIterator begin, TIterator end, typename Group< TElem >::unique_pairs &s, ISubsetHandler *sh)
Definition: periodic_boundary_manager_impl.hpp:533
void remove_group(Group< TElem > *g)
Definition: periodic_boundary_manager_impl.hpp:450
virtual void face_created(Grid *grid, Face *f, GridObject *pParent=NULL, bool replacesParent=false)
Notified whenever a new element of the given type is created in the given grid.
Definition: periodic_boundary_manager.cpp:230
virtual void grid_to_be_destroyed(Grid *grid)
grid observation methods
Definition: periodic_boundary_manager.cpp:199
Grid::AttachmentAccessor< TElem, Attachment< Group< TElem > * > > & get_group_accessor()
PeriodicBoundaryManager(const PeriodicBoundaryManager &)
Definition: periodic_boundary_manager.h:205
bool is_periodic(TElem *e) const
Definition: periodic_boundary_manager_impl.hpp:127
void make_master(Group< TElem > *g, TElem *e)
Definition: periodic_boundary_manager_impl.hpp:417
Grid::AttachmentAccessor< Vertex, Attachment< Group< Vertex > * > > m_aaGroupVRT
store subset handler of domain to lookup element subset ids
Definition: periodic_boundary_manager.h:221
void validity_check()
Definition: periodic_boundary_manager.cpp:391
Group< TElem >::SlaveContainer * slaves(TElem *e) const
Definition: periodic_boundary_manager_impl.hpp:146
Grid::AttachmentAccessor< TElem, Attachment< PeriodicStatus > > & get_periodic_status_accessor()
void handle_creation(TElem *e, TParent *pParent)
handles creation of element type
Definition: periodic_boundary_manager_impl.hpp:208
Grid::AttachmentAccessor< Face, Attachment< PeriodicStatus > > m_aaPeriodicStatusFCE
Definition: periodic_boundary_manager.h:228
void merge_groups(Group< TElem > *g0, Group< TElem > *g1)
Definition: periodic_boundary_manager_impl.hpp:468
void set_group(Group< TElem > *g, TElem *e)
Definition: periodic_boundary_manager_impl.hpp:516
virtual void edge_created(Grid *grid, Edge *e, GridObject *pParent=NULL, bool replacesParent=false)
Notified whenever a new element of the given type is created in the given grid.
Definition: periodic_boundary_manager.cpp:225
Group< TElem > * group(TElem *e) const
Definition: periodic_boundary_manager_impl.hpp:509
Grid * get_grid() const
Definition: periodic_boundary_manager.cpp:96
TElem * master(TElem *e) const
Definition: periodic_boundary_manager_impl.hpp:136
Grid::AttachmentAccessor< Vertex, Attachment< PeriodicStatus > > m_aaPeriodicStatusVRT
attachment accessors for PeriodicStatus
Definition: periodic_boundary_manager.h:226
const Grid::AttachmentAccessor< TElem, Attachment< PeriodicStatus > > & get_periodic_status_accessor() const
bool check_periodicity(const GridObjectCollection &goc1, const GridObjectCollection &goc2, ISubsetHandler *sh=NULL)
checks that all elements of given gocs are periodic (called after identification)
Definition: periodic_boundary_manager.cpp:257
virtual void edge_to_be_erased(Grid *grid, Edge *e, Edge *replacedBy=NULL)
Notified whenever an element of the given type is erased from the given grid.
Definition: periodic_boundary_manager.cpp:240
MultiGrid * m_pGrid
grid instance we operate on
Definition: periodic_boundary_manager.h:208
bool is_slave(TElem *) const
Definition: periodic_boundary_manager_impl.hpp:498
virtual void vertex_to_be_erased(Grid *grid, Vertex *vrt, Vertex *replacedBy=NULL)
Notified whenever an element of the given type is erased from the given grid.
Definition: periodic_boundary_manager.cpp:235
PeriodicStatus
Definition: periodic_boundary_manager.h:129
@ P_SLAVE
Definition: periodic_boundary_manager.h:130
@ P_NOT_PERIODIC
Definition: periodic_boundary_manager.h:130
@ P_MASTER
Definition: periodic_boundary_manager.h:130
@ P_SLAVE_MASTER_UNKNOWN
Definition: periodic_boundary_manager.h:130
bool remove_slave(TElem *slave)
Definition: periodic_boundary_manager_impl.hpp:426
virtual void vertex_created(Grid *grid, Vertex *vrt, GridObject *pParent=NULL, bool replacesParent=false)
Notified whenever a new element of the given type is created in the given grid.
Definition: periodic_boundary_manager.cpp:220
Grid::AttachmentAccessor< Face, Attachment< Group< Face > * > > m_aaGroupFCE
Definition: periodic_boundary_manager.h:223
void print_identification() const
Definition: periodic_boundary_manager_impl.hpp:154
PeriodicBoundaryManager()
Definition: periodic_boundary_manager.cpp:37
void make_slave(Group< TElem > *g, TElem *e)
make element e slave of group g
Definition: periodic_boundary_manager_impl.hpp:396
void handle_deletion(TElem *e, TElem *replacedBy)
handles deletion of element type
Definition: periodic_boundary_manager_impl.hpp:375
Grid::AttachmentAccessor< Edge, Attachment< Group< Edge > * > > m_aaGroupEDG
Definition: periodic_boundary_manager.h:222
~PeriodicBoundaryManager()
Definition: periodic_boundary_manager.cpp:40
void replace_parent(TElem *e, TElem *pParent)
replaces all group occurrances of pParent by the specified elem
Definition: periodic_boundary_manager_impl.hpp:187
Base-class for all vertex-types.
Definition: grid_base_objects.h:231
Volumes are 3-dimensional objects.
Definition: grid_base_objects.h:754
#define UG_ASSERT(expr, msg)
Definition: assert.h:70
#define UG_THROW(msg)
Definition: error.h:57
void VecScale(vector_t &vOut, const vector_t &v, typename vector_t::value_type s)
scales a MathVector<N>
Definition: math_vector_functions_common_impl.hpp:252
void IdentifySubsets(TDomain &dom, int sInd1, int sInd2)
identifies subset 1 with subset 2. If the grid of given domain has no periodic boundary manager attac...
Definition: periodic_boundary_manager_impl.hpp:604
TValue & reference
Definition: attachment_pipe.h:112
const TValue & const_reference
Definition: attachment_pipe.h:113