FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
symmetric_simplex_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/driver_base.hpp>
10#include <kernel/util/meta_math.hpp>
11
12namespace FEAT
13{
14 namespace Cubature
15 {
25 template<typename Shape_>
26 class SymmetricSimplexDriver DOXY({});
27
28 // Simplex specialization
29 template<>
30 class SymmetricSimplexDriver<Shape::Simplex<2> > :
31 public DriverBase<Shape::Simplex<2> >
32 {
33 protected:
35 template<
36 typename Weight_,
37 typename Coord_,
38 typename Point_>
39 static int fill_sym1(
40 Rule<Shape::Simplex<2>, Weight_, Coord_, Point_>& rule,
41 int off,
42 Weight_ w,
43 Coord_ x0)
44 {
45 rule.get_weight(off) = w;
46 rule.get_coord(off, 0) = x0; // 000
47 rule.get_coord(off, 1) = x0;
48 return 1;
49 }
50
52 template<
53 typename Weight_,
54 typename Coord_,
55 typename Point_>
56 static int fill_sym2(
57 Rule<Shape::Simplex<2>, Weight_, Coord_, Point_>& rule,
58 int off,
59 Weight_ w,
60 Coord_ x0,
61 Coord_ x1)
62 {
63 rule.get_weight(off) = w;
64 rule.get_coord(off, 0) = x0; // 011
65 rule.get_coord(off, 1) = x1;
66 rule.get_weight(++off) = w;
67 rule.get_coord(off, 0) = x1; // 101
68 rule.get_coord(off, 1) = x0;
69 rule.get_weight(++off) = w;
70 rule.get_coord(off, 0) = x1; // 110
71 rule.get_coord(off, 1) = x1;
72 return 3;
73 }
74
76 template<
77 typename Weight_,
78 typename Coord_,
79 typename Point_>
80 static int fill_sym3(
81 Rule<Shape::Simplex<2>, Weight_, Coord_, Point_>& rule,
82 int off,
83 Weight_ w,
84 Coord_ x0,
85 Coord_ x1,
86 Coord_ x2)
87 {
88 rule.get_weight(off) = w;
89 rule.get_coord(off, 0) = x0; // 012
90 rule.get_coord(off, 1) = x1;
91 rule.get_weight(++off) = w;
92 rule.get_coord(off, 0) = x1; // 120
93 rule.get_coord(off, 1) = x2;
94 rule.get_weight(++off) = w;
95 rule.get_coord(off, 0) = x2; // 201
96 rule.get_coord(off, 1) = x0;
97 rule.get_weight(++off) = w;
98 rule.get_coord(off, 0) = x1; // 102
99 rule.get_coord(off, 1) = x0;
100 rule.get_weight(++off) = w;
101 rule.get_coord(off, 0) = x2; // 210
102 rule.get_coord(off, 1) = x1;
103 rule.get_weight(++off) = w;
104 rule.get_coord(off, 0) = x0; // 021
105 rule.get_coord(off, 1) = x2;
106 return 6;
107 }
108 }; // class SymmetricSimplexDriver<Simplex<...>,...>
109
110 } // namespace Cubature
111} // namespace FEAT
Cubature Rule class template.
Definition: rule.hpp:38
static int fill_sym3(Rule< Shape::Simplex< 2 >, Weight_, Coord_, Point_ > &rule, int off, Weight_ w, Coord_ x0, Coord_ x1, Coord_ x2)
Adds the six permutations of the barycentric point (x0,x1,x2) to the rule.
static int fill_sym1(Rule< Shape::Simplex< 2 >, Weight_, Coord_, Point_ > &rule, int off, Weight_ w, Coord_ x0)
Adds the one permutation of the barycentric point (x0,x0,x0) to the rule.
static int fill_sym2(Rule< Shape::Simplex< 2 >, Weight_, Coord_, Point_ > &rule, int off, Weight_ w, Coord_ x0, Coord_ x1)
Adds the three permutations of the barycentric point (x0,x1,x1) to the rule.
Symmetric Simplex Driver helper class.
FEAT namespace.
Definition: adjactor.hpp:12
Simplex shape tag struct template.
Definition: shape.hpp:44