FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
maclaurin_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/scalar/driver_base.hpp>
10
11namespace FEAT
12{
13 namespace Cubature
14 {
15 namespace Scalar
16 {
26 public DriverBase
27 {
28 public:
30 static constexpr bool variadic = true;
32 static constexpr int min_points = 1;
34 static constexpr int max_points = 5;
35
37 static String name()
38 {
39 return "maclaurin";
40 }
41
51 template<
52 typename Weight_,
53 typename Coord_>
54 static void fill(Rule<Weight_, Coord_>& rule, int num_points)
55 {
56 // how many points do we have?
57 switch(num_points)
58 {
59 case 1:
60 rule.get_coord(0) = Coord_(0);
61
62 rule.get_weight(0) = Weight_(2);
63 break;
64
65 case 2:
66 rule.get_coord(0) = -Coord_(1) / Coord_(2);
67 rule.get_coord(1) = Coord_(1) / Coord_(2);
68
69 rule.get_weight(0) = Weight_(1);
70 rule.get_weight(1) = Weight_(1);
71 break;
72
73 case 3:
74 rule.get_coord(0) = -Coord_(2) / Coord_(3);
75 rule.get_coord(1) = Coord_(0);
76 rule.get_coord(2) = Coord_(2) / Coord_(3);
77
78 rule.get_weight(0) = Weight_(3) / Weight_(4);
79 rule.get_weight(1) = Weight_(1) / Weight_(2);
80 rule.get_weight(2) = Weight_(3) / Weight_(4);
81 break;
82
83 case 4:
84 rule.get_coord(0) = -Coord_(3) / Coord_(4);
85 rule.get_coord(1) = -Coord_(1) / Coord_(4);
86 rule.get_coord(2) = Coord_(1) / Coord_(4);
87 rule.get_coord(3) = Coord_(3) / Coord_(4);
88
89 rule.get_weight(0) = Weight_(13) / Weight_(24);
90 rule.get_weight(1) = Weight_(11) / Weight_(24);
91 rule.get_weight(2) = Weight_(11) / Weight_(24);
92 rule.get_weight(3) = Weight_(13) / Weight_(24);
93 break;
94
95 case 5:
96 rule.get_coord(0) = -Coord_(4) / Coord_(5);
97 rule.get_coord(1) = -Coord_(2) / Coord_(5);
98 rule.get_coord(2) = Coord_(0);
99 rule.get_coord(3) = Coord_(2) / Coord_(5);
100 rule.get_coord(4) = Coord_(4) / Coord_(5);
101
102 rule.get_weight(0) = Weight_(275) / Weight_(576);
103 rule.get_weight(1) = Weight_(100) / Weight_(576);
104 rule.get_weight(2) = Weight_(402) / Weight_(576);
105 rule.get_weight(3) = Weight_(100) / Weight_(576);
106 rule.get_weight(4) = Weight_(275) / Weight_(576);
107 break;
108 }
109 }
110 }; // class MaclaurinDriver<...>
111 } // namespace Scalar
112 } // namespace Cubature
113} // namespace FEAT
Scalar cubature driver base class.
Definition: driver_base.hpp:23
Maclaurin Rule driver class template.
static String name()
Returns the name of the cubature rule.
static constexpr int min_points
this rule has at least 1 points
static constexpr int max_points
this rule has at most 5 points
static constexpr bool variadic
this rule is variadic
static void fill(Rule< Weight_, Coord_ > &rule, int num_points)
Fills the cubature rule structure.
Scalar Cubature Rule class template.
Definition: rule.hpp:39
String class implementation.
Definition: string.hpp:47
FEAT namespace.
Definition: adjactor.hpp:12