ug4
parallel_hanging_node_refiner_multi_grid.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2015: G-CSC, Goethe University Frankfurt
3  * Author: Sebastian Reiter
4  *
5  * This file is part of UG4.
6  *
7  * UG4 is free software: you can redistribute it and/or modify it under the
8  * terms of the GNU Lesser General Public License version 3 (as published by the
9  * Free Software Foundation) with the following additional attribution
10  * requirements (according to LGPL/GPL v3 §7):
11  *
12  * (1) The following notice must be displayed in the Appropriate Legal Notices
13  * of covered and combined works: "Based on UG4 (www.ug4.org/license)".
14  *
15  * (2) The following notice must be displayed at a prominent place in the
16  * terminal output of covered works: "Based on UG4 (www.ug4.org/license)".
17  *
18  * (3) The following bibliography is recommended for citation and must be
19  * preserved in all covered files:
20  * "Reiter, S., Vogel, A., Heppner, I., Rupp, M., and Wittum, G. A massively
21  * parallel geometric multigrid solver on hierarchically distributed grids.
22  * Computing and visualization in science 16, 4 (2013), 151-164"
23  * "Vogel, A., Reiter, S., Rupp, M., Nägel, A., and Wittum, G. UG4 -- a novel
24  * flexible software system for simulating pde based models on high performance
25  * computers. Computing and visualization in science 16, 4 (2013), 165-179"
26  *
27  * This program is distributed in the hope that it will be useful,
28  * but WITHOUT ANY WARRANTY; without even the implied warranty of
29  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30  * GNU Lesser General Public License for more details.
31  */
32 
33 #ifndef __H__UG__parallel_hanging_node_refiner_multi_grid__
34 #define __H__UG__parallel_hanging_node_refiner_multi_grid__
35 
36 
38 #include "../distributed_grid.h"
40 
41 namespace ug
42 {
43 
46 
52 {
53  public:
55  using BaseClass::mark;
58 
60 
62  DistributedGridManager& distGridMgr,
64 
66 
68 
73 
74  protected:
76  virtual bool refinement_is_allowed(Vertex* elem);
78  virtual bool refinement_is_allowed(Edge* elem);
80  virtual bool refinement_is_allowed(Face* elem);
82  virtual bool refinement_is_allowed(Volume* elem);
83 
84  virtual bool continue_collect_objects_for_refine(bool continueRequired);
85 
87 
89  virtual void assign_hnode_marks();
90 
92 
94  virtual void pre_refine();
95 
98  virtual void post_refine();
99 
101  virtual void pre_coarsen();
102 
104  virtual void post_coarsen();
105 
107 
108  template <class TElem, class TIntfcCom>
109  void copy_marks_to_vmasters(TIntfcCom& com);
113 
114  template <class TElem, class TIntfcCom>
115  void copy_marks_to_vslaves(TIntfcCom& com);
120  virtual bool contains_edges();
121 
123  virtual bool contains_faces();
124 
126  virtual bool contains_volumes();
127 
128  virtual void broadcast_marks_horizontally(bool vertices, bool edges, bool faces,
129  bool allowDeselection = false);
130 
131  virtual void broadcast_marks_vertically(bool vertices, bool edges,
132  bool faces, bool volumes,
133  bool allowDeselection = false);
134 
135  virtual void copy_marks_to_vmasters(bool vertices, bool edges,
136  bool faces, bool volumes);
137 
138  virtual void copy_marks_to_vslaves(bool vertices, bool edges,
139  bool faces, bool volumes);
140 
141  virtual bool one_proc_true(bool localProcTrue);
142 
143  private:
151 };
152 
154 
155 }// end of namespace
156 
158 // include implementation
159 
160 #endif
Performs communication between interfaces on different processes.
Definition: pcl_interface_communicator.h:68
Definition: pcl_process_communicator.h:70
manages the layouts and interfaces which are associated with a distributed grid.
Definition: distributed_grid.h:88
Base-class for edges.
Definition: grid_base_objects.h:397
Faces are 2-dimensional objects.
Definition: grid_base_objects.h:510
Specialization of ug::HangingNodeRefiner for ug::MultiGrid.
Definition: hanging_node_refiner_multi_grid.h:68
virtual void copy_marks_to_vmasters(bool vertices, bool edges, bool faces, bool volumes)
Definition: hanging_node_refiner_multi_grid.h:327
virtual void copy_marks_to_vslaves(bool vertices, bool edges, bool faces, bool volumes)
Definition: hanging_node_refiner_multi_grid.h:330
virtual bool mark(Vertex *v, RefinementMark refMark=RM_REFINE)
Marks an element for refinement. Default implementation is empty.
Definition: refiner_interface.h:103
SPRefinementProjector projector()
Definition: refiner_interface.h:78
Definition: multi_grid.h:72
Definition: parallel_hanging_node_refiner_multi_grid.h:52
virtual void post_refine()
Definition: parallel_hanging_node_refiner_multi_grid.cpp:433
ParallelHangingNodeRefiner_MultiGrid(SPRefinementProjector projector=SPNULL)
Definition: parallel_hanging_node_refiner_multi_grid.cpp:52
pcl::InterfaceCommunicator< FaceLayout > m_intfComFACE
Definition: parallel_hanging_node_refiner_multi_grid.h:149
MultiGrid * m_pMG
Definition: parallel_hanging_node_refiner_multi_grid.h:145
virtual void assign_hnode_marks()
distributes hnode marks
Definition: parallel_hanging_node_refiner_multi_grid.cpp:307
virtual void pre_coarsen()
Definition: parallel_hanging_node_refiner_multi_grid.cpp:450
virtual void copy_marks_to_vmasters(bool vertices, bool edges, bool faces, bool volumes)
Definition: hanging_node_refiner_multi_grid.h:327
virtual void broadcast_marks_vertically(bool vertices, bool edges, bool faces, bool volumes, bool allowDeselection=false)
Definition: parallel_hanging_node_refiner_multi_grid.cpp:645
pcl::ProcessCommunicator m_procCom
Definition: parallel_hanging_node_refiner_multi_grid.h:146
virtual void broadcast_marks_horizontally(bool vertices, bool edges, bool faces, bool allowDeselection=false)
Definition: parallel_hanging_node_refiner_multi_grid.cpp:618
virtual ~ParallelHangingNodeRefiner_MultiGrid()
Definition: parallel_hanging_node_refiner_multi_grid.cpp:73
void set_distributed_grid_manager(DistributedGridManager &distGridMgr)
Definition: parallel_hanging_node_refiner_multi_grid.cpp:80
pcl::InterfaceCommunicator< VertexLayout > m_intfComVRT
Definition: parallel_hanging_node_refiner_multi_grid.h:147
void set_involved_processes(pcl::ProcessCommunicator com)
Definition: parallel_hanging_node_refiner_multi_grid.cpp:484
virtual bool continue_collect_objects_for_refine(bool continueRequired)
Definition: parallel_hanging_node_refiner_multi_grid.cpp:87
virtual bool one_proc_true(bool localProcTrue)
Definition: parallel_hanging_node_refiner_multi_grid.cpp:675
DistributedGridManager * m_pDistGridMgr
Definition: parallel_hanging_node_refiner_multi_grid.h:144
HangingNodeRefiner_MultiGrid BaseClass
Definition: parallel_hanging_node_refiner_multi_grid.h:54
pcl::InterfaceCommunicator< VolumeLayout > m_intfComVOL
Definition: parallel_hanging_node_refiner_multi_grid.h:150
virtual void pre_refine()
creates required vertices in higher levels.
Definition: parallel_hanging_node_refiner_multi_grid.cpp:416
virtual bool contains_faces()
allows to check whether a distributed grid contains faces
Definition: parallel_hanging_node_refiner_multi_grid.cpp:690
virtual void copy_marks_to_vslaves(bool vertices, bool edges, bool faces, bool volumes)
Definition: hanging_node_refiner_multi_grid.h:330
virtual bool contains_volumes()
allows to check whether a distributed grid contains volumes
Definition: parallel_hanging_node_refiner_multi_grid.cpp:698
virtual bool contains_edges()
allows to check whether a distributed grid contains edges
Definition: parallel_hanging_node_refiner_multi_grid.cpp:682
virtual bool refinement_is_allowed(Vertex *elem)
a callback that allows to deny refinement of special vertices
Definition: parallel_hanging_node_refiner_multi_grid.cpp:384
pcl::InterfaceCommunicator< EdgeLayout > m_intfComEDGE
Definition: parallel_hanging_node_refiner_multi_grid.h:148
virtual void post_coarsen()
Definition: parallel_hanging_node_refiner_multi_grid.cpp:467
Base-class for all vertex-types.
Definition: grid_base_objects.h:231
Volumes are 3-dimensional objects.
Definition: grid_base_objects.h:754
const NullSmartPtr SPNULL
The equivalent to NULL for smart pointers.
Definition: smart_pointer.h:90
std::pair< counting_iterator< size_t >, counting_iterator< size_t > > vertices(ug::BidirectionalMatrix< T > const &M)
Definition: bidirectional_boost.h:60
the ug namespace