FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
silvester_driver.hpp
1// FEAT3: Finite Element Analysis Toolbox, Version 3
2// Copyright (C) 2010 by Stefan Turek & the FEAT group
3// FEAT3 is released under the GNU General Public License version 3,
4// see the file 'copyright.txt' in the top level directory for details.
5
6#pragma once
7
8// includes, FEAT
9#include <kernel/cubature/symmetric_simplex_driver.hpp>
10#include <kernel/util/meta_math.hpp>
11
12namespace FEAT
13{
14 namespace Cubature
15 {
30 template<typename Shape_>
31 class SilvesterOpenDriver DOXY({});
32
33 // Simplex<2> specialization
34 template<>
35 class SilvesterOpenDriver<Shape::Simplex<2> > :
36 public SymmetricSimplexDriver<Shape::Simplex<2> >
37 {
38 public:
40 static constexpr bool variadic = true;
41 static constexpr int min_points = 2;
42 static constexpr int max_points = 8;
43
45 static String name()
46 {
47 return "silvester-open";
48 }
49
50 static int count(int points)
51 {
52 return ((points+1)*(points+2)) / 2;
53 }
54
61 template<
62 typename Weight_,
63 typename Coord_,
64 typename Point_>
65 static void fill(Rule<Shape::Simplex<2>, Weight_, Coord_, Point_>& rule, int num_points)
66 {
67 int off(0);
68 switch(num_points)
69 {
70 case 2:
71 // 200
72 off += fill_sym2(rule, off, Weight_( 7) / Weight_(24), Coord_(3) / Coord_(5), Coord_(1) / Coord_(5));
73 // 011
74 off += fill_sym2(rule, off, Weight_(-3) / Weight_(24), Coord_(1) / Coord_(5), Coord_(2) / Coord_(5));
75 break;
76
77 case 3:
78 // 111
79 off += fill_sym1(rule, off, Weight_(-12) / Weight_(60), Coord_(2) / Coord_(6));
80 // 300
81 off += fill_sym2(rule, off, Weight_( 8) / Weight_(60), Coord_(4) / Coord_(6), Coord_(1) / Coord_(6));
82 // 310
83 off += fill_sym3(rule, off, Weight_( 3) / Weight_(60), Coord_(3) / Coord_(6), Coord_(2) / Coord_(6), Coord_(1) / Coord_(6));
84 break;
85
86 case 4:
87 // 400
88 off += fill_sym2(rule, off, Weight_( 307) / Weight_(1440), Coord_(5) / Coord_(7), Coord_(1) / Coord_(7));
89 // 211
90 off += fill_sym2(rule, off, Weight_( -64) / Weight_(1440), Coord_(3) / Coord_(7), Coord_(2) / Coord_(7));
91 // 022
92 off += fill_sym2(rule, off, Weight_( 629) / Weight_(1440), Coord_(1) / Coord_(7), Coord_(3) / Coord_(7));
93 // 310
94 off += fill_sym3(rule, off, Weight_(-316) / Weight_(1440), Coord_(1) / Coord_(7), Coord_(2) / Coord_(7), Coord_(4) / Coord_(7));
95 break;
96
97 case 5:
98 // 500
99 off += fill_sym2(rule, off, Weight_( 71) / Weight_(730), Coord_(6) / Coord_(8), Coord_(1) / Coord_(8));
100 // 311
101 off += fill_sym2(rule, off, Weight_(-167) / Weight_(730), Coord_(4) / Coord_(8), Coord_(2) / Coord_(8));
102 // 122
103 off += fill_sym2(rule, off, Weight_( 113) / Weight_(730), Coord_(2) / Coord_(8), Coord_(3) / Coord_(8));
104 // 410
105 off += fill_sym3(rule, off, Weight_( -13) / Weight_(730), Coord_(5) / Coord_(8), Coord_(2) / Coord_(8), Coord_(1) / Coord_(8));
106 // 320
107 off += fill_sym3(rule, off, Weight_( 57) / Weight_(730), Coord_(4) / Coord_(8), Coord_(3) / Coord_(8), Coord_(1) / Coord_(8));
108 break;
109
110 case 6:
111 // 222
112 off += fill_sym1(rule, off, Weight_( 3509) / Weight_(4480), Coord_(3) / Coord_(9));
113 // 600
114 off += fill_sym2(rule, off, Weight_( 767) / Weight_(4480), Coord_(7) / Coord_(9), Coord_(1) / Coord_(9));
115 // 411
116 off += fill_sym2(rule, off, Weight_( 387) / Weight_(4480), Coord_(4) / Coord_(9), Coord_(2) / Coord_(9));
117 // 033
118 off += fill_sym2(rule, off, Weight_(-3035) / Weight_(4480), Coord_(1) / Coord_(9), Coord_(4) / Coord_(9));
119 // 510
120 off += fill_sym3(rule, off, Weight_(-1257) / Weight_(4480), Coord_(6) / Coord_(9), Coord_(2) / Coord_(9), Coord_(1) / Coord_(9));
121 // 420
122 off += fill_sym3(rule, off, Weight_( 2901) / Weight_(4480), Coord_(5) / Coord_(9), Coord_(3) / Coord_(9), Coord_(1) / Coord_(9));
123 // 321
124 off += fill_sym3(rule, off, Weight_( -915) / Weight_(4480), Coord_(4) / Coord_(9), Coord_(3) / Coord_(9), Coord_(2) / Coord_(9));
125 break;
126
127 case 7:
128 // 700
129 off += fill_sym2(rule, off, Weight_( 898) / Weight_(9072), Coord_(8) / Coord_(10), Coord_(1) / Coord_(10));
130 // 511
131 off += fill_sym2(rule, off, Weight_(-2522) / Weight_(9072), Coord_(6) / Coord_(10), Coord_(2) / Coord_(10));
132 // 133
133 off += fill_sym2(rule, off, Weight_(-5726) / Weight_(9072), Coord_(2) / Coord_(10), Coord_(4) / Coord_(10));
134 // 322
135 off += fill_sym2(rule, off, Weight_( 1444) / Weight_(9072), Coord_(4) / Coord_(10), Coord_(3) / Coord_(10));
136 // 610
137 off += fill_sym3(rule, off, Weight_( -662) / Weight_(9072), Coord_(7) / Coord_(10), Coord_(2) / Coord_(10), Coord_(1) / Coord_(10));
138 // 520
139 off += fill_sym3(rule, off, Weight_( 1573) / Weight_(9072), Coord_(6) / Coord_(10), Coord_(3) / Coord_(10), Coord_(1) / Coord_(10));
140 // 430
141 off += fill_sym3(rule, off, Weight_( -191) / Weight_(9072), Coord_(5) / Coord_(10), Coord_(4) / Coord_(10), Coord_(1) / Coord_(10));
142 // 421
143 off += fill_sym3(rule, off, Weight_( 2989) / Weight_(9072), Coord_(5) / Coord_(10), Coord_(3) / Coord_(10), Coord_(2) / Coord_(10));
144 break;
145
146 case 8:
147 // 800
148 off += fill_sym2(rule, off, Weight_( 1051445) / Weight_(7257600), Coord_(9) / Coord_(11), Coord_(1) / Coord_(11));
149 // 611
150 off += fill_sym2(rule, off, Weight_( 1818134) / Weight_(7257600), Coord_(7) / Coord_(11), Coord_(2) / Coord_(11));
151 // 422
152 off += fill_sym2(rule, off, Weight_(10685542) / Weight_(7257600), Coord_(5) / Coord_(11), Coord_(3) / Coord_(11));
153 // 233
154 off += fill_sym2(rule, off, Weight_(-6437608) / Weight_(7257600), Coord_(3) / Coord_(11), Coord_(4) / Coord_(11));
155 // 044
156 off += fill_sym2(rule, off, Weight_(12368047) / Weight_(7257600), Coord_(1) / Coord_(11), Coord_(5) / Coord_(11));
157 // 710
158 off += fill_sym3(rule, off, Weight_(-2366706) / Weight_(7257600), Coord_(8) / Coord_(11), Coord_(2) / Coord_(11), Coord_(1) / Coord_(11));
159 // 620
160 off += fill_sym3(rule, off, Weight_( 6493915) / Weight_(7257600), Coord_(7) / Coord_(11), Coord_(3) / Coord_(11), Coord_(1) / Coord_(11));
161 // 530
162 off += fill_sym3(rule, off, Weight_(-9986439) / Weight_(7257600), Coord_(6) / Coord_(11), Coord_(4) / Coord_(11), Coord_(1) / Coord_(11));
163 // Note: The article referenced in the documentation of this class template claims that the following
164 // weight should be positive rather than negative. However, in this case, the sum of the weights does
165 // not match. The negative weight has been chosen in accordance to the implementation provided in
166 // http://people.sc.fsu.edu/~jburkardt/f_src/nco_triangle/nco_triangle.html
167 // 521
168 off += fill_sym3(rule, off, Weight_(-3757007) / Weight_(7257600), Coord_(6) / Coord_(11), Coord_(3) / Coord_(11), Coord_(2) / Coord_(11));
169 // 431
170 off += fill_sym3(rule, off, Weight_( 478257) / Weight_(7257600), Coord_(5) / Coord_(11), Coord_(4) / Coord_(11), Coord_(2) / Coord_(11));
171 break;
172 }
173 }
174 }; // class SilvesterOpenDriver<Simplex<...>,...>
175
176 } // namespace Cubature
177} // namespace FEAT
Cubature Rule class template.
Definition: rule.hpp:38
static void fill(Rule< Shape::Simplex< 2 >, Weight_, Coord_, Point_ > &rule, int num_points)
Fills the cubature rule structure.
static String name()
Returns the name of the cubature rule.
Silvester "open" driver class template.
Symmetric Simplex Driver helper class.
String class implementation.
Definition: string.hpp:47
FEAT namespace.
Definition: adjactor.hpp:12
Simplex shape tag struct template.
Definition: shape.hpp:44