Line data Source code
1 : /*
2 : * Copyright (c) 2013-2015: G-CSC, Goethe University Frankfurt
3 : * Author: Arne Nägel
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 : #include "line_smoothers.h"
34 : namespace ug{
35 : template<int dim>
36 : bool ComparePosDimYDir(const std::pair<MathVector<dim>, size_t> &p1,
37 : const std::pair<MathVector<dim>, size_t> &p2)
38 : {return false;}
39 :
40 : template<>
41 0 : bool ComparePosDimYDir<1>(const std::pair<MathVector<1>, size_t> &p1,
42 : const std::pair<MathVector<1>, size_t> &p2)
43 : {
44 0 : return (p1.first[0]<p2.first[0]);
45 : };
46 :
47 : // Order for 2D
48 : template<>
49 0 : bool ComparePosDimYDir<2>(const std::pair<MathVector<2>, size_t> &p1,
50 : const std::pair<MathVector<2>, size_t> &p2)
51 : {
52 0 : if (p1.first[0]==p2.first[0]) {
53 0 : return (p1.first[1] < p2.first[1]);
54 : }
55 : else {
56 0 : return (p1.first[0] < p2.first[0]);
57 : }
58 : };
59 :
60 : // Order for 3D
61 : template<>
62 0 : bool ComparePosDimYDir<3>(const std::pair<MathVector<3>, size_t> &p1,
63 : const std::pair<MathVector<3>, size_t> &p2)
64 : {
65 0 : if (p1.first[2]==p2.first[2]){
66 0 : if (p1.first[0]==p2.first[0]) {
67 0 : return (p1.first[1] < p2.first[1]);
68 : }
69 : else {
70 0 : return (p1.first[0] < p2.first[0]);
71 : }
72 : }
73 : else{
74 0 : return (p1.first[2] < p2.first[2]);
75 : }
76 : };
77 :
78 :
79 :
80 :
81 : template<int dim>
82 : bool ComparePosDimZDir(const std::pair<MathVector<dim>, size_t> &p1,
83 : const std::pair<MathVector<dim>, size_t> &p2)
84 : {return false;}
85 :
86 : // Order for 1D
87 : template<>
88 0 : bool ComparePosDimZDir<1>(const std::pair<MathVector<1>, size_t> &p1,
89 : const std::pair<MathVector<1>, size_t> &p2)
90 : {
91 0 : return (p1.first[0]<p2.first[0]);
92 : };
93 :
94 : // Order for 2D
95 : template<>
96 0 : bool ComparePosDimZDir<2>(const std::pair<MathVector<2>, size_t> &p1,
97 : const std::pair<MathVector<2>, size_t> &p2)
98 : {
99 0 : if (p1.first[0]==p2.first[0]) {
100 0 : return (p1.first[1] < p2.first[1]);
101 : }
102 : else {
103 0 : return (p1.first[0] < p2.first[0]);
104 : }
105 : };
106 :
107 : // Order for 3D
108 : template<>
109 0 : bool ComparePosDimZDir<3>(const std::pair<MathVector<3>, size_t> &p1,
110 : const std::pair<MathVector<3>, size_t> &p2)
111 : {
112 0 : if (p1.first[1]==p2.first[1]){
113 0 : if (p1.first[0]==p2.first[0]) {
114 0 : return (p1.first[2] < p2.first[2]);
115 : }
116 : else {
117 0 : return (p1.first[0] < p2.first[0]);
118 : }
119 : }
120 : else{
121 0 : return (p1.first[1] < p2.first[1]);
122 : }
123 : };
124 :
125 : } // namespace ug
|