ug4
Loading...
Searching...
No Matches
balance_weights_ref_marks.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2014-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__balance_weights_ref_marks__
34#define __H__UG__balance_weights_ref_marks__
35
37#include "partitioner.h"
38
39namespace ug{
40
42{
43 public:
44 BalanceWeightsRefMarks(IRefiner* refiner) : m_refiner(refiner) {};
45
48 if(m == RM_REFINE || m == RM_ANISOTROPIC)
49 return get_weight(e);
50 return 0;
51 }
52
54 {
56 if(m == RM_REFINE || m == RM_ANISOTROPIC)
57 return 2. * get_weight(e);
58 return 0;
59 }
60
62 {
64 if(m == RM_REFINE)
65 return 4. * get_weight(e);
66 if(m == RM_ANISOTROPIC)
67 return 2. * get_weight(e);// ok - that isn't always true...
68 return 0;
69 }
70
72 {
74 if(m == RM_REFINE)
75 return 8. * get_weight(e); // ok - that isn't always true...
76 if(m == RM_ANISOTROPIC)
77 return 2. * get_weight(e); // yep - that isn't always true...
78 return 0;
79 }
80
81 virtual bool has_level_offsets() {return true;}
82
84
92 private:
93 template <class TElem>
95 {
97 return (m == RM_REFINE) || (m == RM_ANISOTROPIC);
98 }
99
101};
102
103}// end of namespace
104
105#endif
Definition balance_weights_ref_marks.h:42
virtual bool has_level_offsets()
Definition balance_weights_ref_marks.h:81
virtual number get_refined_weight(Volume *e)
todo: use a more sophisticated implementation
Definition balance_weights_ref_marks.h:71
virtual bool consider_in_level_above(Face *e)
Indicator in which level the specifed elements should be partitioned.
Definition balance_weights_ref_marks.h:88
IRefiner * m_refiner
Definition balance_weights_ref_marks.h:100
BalanceWeightsRefMarks(IRefiner *refiner)
Definition balance_weights_ref_marks.h:44
bool consider_in_level_above_impl(TElem *e)
Definition balance_weights_ref_marks.h:94
virtual bool consider_in_level_above(Edge *e)
Indicator in which level the specifed elements should be partitioned.
Definition balance_weights_ref_marks.h:87
virtual bool consider_in_level_above(Vertex *e)
Indicator in which level the specifed elements should be partitioned.
Definition balance_weights_ref_marks.h:86
virtual number get_refined_weight(Edge *e)
Definition balance_weights_ref_marks.h:53
virtual number get_refined_weight(Face *e)
todo: use a more sophisticated implementation
Definition balance_weights_ref_marks.h:61
virtual number get_refined_weight(Vertex *e)
Definition balance_weights_ref_marks.h:46
virtual bool consider_in_level_above(Volume *e)
Indicator in which level the specifed elements should be partitioned.
Definition balance_weights_ref_marks.h:89
Base-class for edges.
Definition grid_base_objects.h:397
Faces are 2-dimensional objects.
Definition grid_base_objects.h:510
Definition partitioner.h:49
virtual number get_weight(Vertex *)
Definition partitioner.h:55
The refiner interface allows to mark elements for refinement and to call refine.
Definition refiner_interface.h:67
virtual RefinementMark get_mark(Vertex *v) const
Returns the mark of a given element. Default returns RM_REFINE.
Definition refiner_interface.h:198
Base-class for all vertex-types.
Definition grid_base_objects.h:231
Volumes are 3-dimensional objects.
Definition grid_base_objects.h:754
RefinementMark
refinement-marks allow to specify how an element shall be processed during refinement.
Definition refiner_interface.h:48
@ RM_REFINE
DEPRECATED. Use RM_FULL instead.
Definition refiner_interface.h:55
@ RM_ANISOTROPIC
DEPRECATED. Use RM_CLOSURE instead.
Definition refiner_interface.h:52
double number
Definition types.h:124
the ug namespace