33 #ifndef __H__UG__LIB_DISC__LOCAL_SHAPE_FUNCTION_SET__LAGRANGE__LAGRANGE__
34 #define __H__UG__LIB_DISC__LOCAL_SHAPE_FUNCTION_SET__LAGRANGE__LAGRANGE__
36 #include "../common/lagrange1d.h"
37 #include "../local_finite_element_provider.h"
38 #include "../local_dof_set.h"
47 template <
typename TRefElem,
int TOrder>
51 template <
typename TRefElem>
67 public BaseLSFS<LagrangeLSFS<ReferenceVertex, TOrder>, 0>
71 static const size_t p = TOrder;
85 static const size_t order = TOrder;
91 static const size_t nsh = 1;
101 inline size_t num_sh()
const {
return nsh;}
128 public BaseLSFS<FlexLagrangeLSFS<ReferenceVertex>, 0>
145 inline size_t num_sh()
const {
return nsh;}
169 static const size_t nsh = 1;
181 template <
int TOrder>
184 public BaseLSFS<LagrangeLSFS<ReferenceEdge, TOrder>, 1>
188 static const size_t p = TOrder;
202 static const size_t order = TOrder;
208 static const size_t nsh =
p+1;
218 inline size_t num_sh()
const {
return nsh;}
230 return m_vPolynom[multi_index(i)[0]].value(x[0]);
236 g[0] = m_vDPolynom[multi_index(i)[0]].value(x[0]);
243 return m_vMultiIndex[i];
249 check_multi_index(ind);
250 for(
size_t i=0; i<nsh; ++i)
251 if(multi_index(i) == ind)
return i;
252 UG_THROW(
"Index not found in LagrangeLSFS");
265 check_multi_index(ind);
278 UG_ASSERT(ind[0] < (
int)nsh && ind[0] >= 0,
"Wrong MultiIndex");
295 public BaseLSFS<FlexLagrangeLSFS<ReferenceEdge>, 1>
309 void set_order(
size_t order);
315 inline size_t num_sh()
const {
return nsh;}
327 return m_vPolynom[multi_index(i)[0]].value(x[0]);
333 g[0] = m_vDPolynom[multi_index(i)[0]].value(x[0]);
340 return m_vMultiIndex[i];
346 check_multi_index(ind);
347 for(
size_t i=0; i<nsh; ++i)
348 if(multi_index(i) == ind)
return i;
349 UG_THROW(
"Index not found in LagrangeLSFS");
362 check_multi_index(ind);
375 UG_ASSERT(ind[0] < (
int)nsh && ind[0] >= 0,
"Wrong MultiIndex");
395 template <
int TOrder>
398 public BaseLSFS<LagrangeLSFS<ReferenceTriangle, TOrder>, 2>
402 static const size_t p = TOrder;
416 static const size_t order = TOrder;
432 inline size_t num_sh()
const {
return nsh;}
441 for(
int d = 0; d <
dim; ++d)
451 return shape(multi_index(i), x);
457 check_multi_index(ind);
461 const size_t i0 =
p - ind[0] - ind[1];
462 const number x0 = 1.0 - x[0] - x[1];
464 return m_vPolynom[ ind[0] ].value(x[0])
465 * m_vPolynom[ ind[1] ].value(x[1])
466 * m_vPolynom[ i0 ].value(x0);
473 grad(g, multi_index(i), x);
480 check_multi_index(ind);
484 const size_t i0 =
p - ind[0] - ind[1];
485 const number x0 = 1.0 - x[0] - x[1];
491 for(
int d = 0; d <
dim; ++d)
493 g[d] = m_vDPolynom[ind[d]].value(x[d])
494 * m_vPolynom[i0].value(x0);
495 g[d] += (-1) * m_vDPolynom[i0].value(x0)
496 * m_vPolynom[ind[d]].value(x[d]);
499 for(
int d2 = 0; d2 <
dim; ++d2)
502 if(d2 == d)
continue;
504 g[d] *= m_vPolynom[ind[d2]].value(x[d2]);
513 return m_vMultiIndex[i];
519 check_multi_index(ind);
520 for(
size_t i=0; i<nsh; ++i)
521 if(multi_index(i) == ind)
return i;
522 UG_THROW(
"Index not found in LagrangeLSFS");
528 check_multi_index(ind);
531 for(
int i = 0; i < ind[1]; ++i)
544 for(i1 = 0; i1 < (int)
p; ++i1)
546 const int diff = i0 - (
p+1-i1);
551 UG_ASSERT(i0 >= 0,
"i0 is negative ("<<i0<<
")");
552 UG_ASSERT(i1 >= 0,
"i1 is negative ("<<i1<<
")");
565 UG_ASSERT(ind[0] <= (
int)
p && ind[0]>=0,
"Wrong Multiindex.");
566 UG_ASSERT(ind[1] <= (
int)
p && ind[0]>=0,
"Wrong Multiindex.");
567 UG_ASSERT(ind[0] + ind[1] <= (
int)
p && ind[0]>=0,
"Wrong Multiindex.");
581 public BaseLSFS<FlexLagrangeLSFS<ReferenceTriangle>, 2>
595 void set_order(
size_t order);
601 inline size_t num_sh()
const {
return nsh;}
610 for(
int d = 0; d <
dim; ++d)
620 return shape(multi_index(i), x);
626 check_multi_index(ind);
630 const size_t i0 =
p - ind[0] - ind[1];
631 const number x0 = 1.0 - x[0] - x[1];
633 return m_vPolynom[ ind[0] ].value(x[0])
634 * m_vPolynom[ ind[1] ].value(x[1])
635 * m_vPolynom[ i0 ].value(x0);
642 grad(g, multi_index(i), x);
649 check_multi_index(ind);
653 const int i0 =
p - ind[0] - ind[1];
654 const number x0 = 1.0 - x[0] - x[1];
656 UG_ASSERT(i0 <= (
int)
p && i0 >= 0,
"Wrong Multiindex.");
660 for(
int d = 0; d <
dim; ++d)
662 g[d] = m_vDPolynom[ind[d]].value(x[d])
663 * m_vPolynom[i0].value(x0);
664 g[d] += (-1) * m_vDPolynom[i0].value(x0)
665 * m_vPolynom[ind[d]].value(x[d]);
668 for(
int d2 = 0; d2 <
dim; ++d2)
671 if(d2 == d)
continue;
673 g[d] *= m_vPolynom[ind[d2]].value(x[d2]);
682 return m_vMultiIndex[i];
688 check_multi_index(ind);
689 for(
size_t i=0; i<nsh; ++i)
690 if(multi_index(i) == ind)
return i;
691 UG_THROW(
"Index not found in LagrangeLSFS");
697 check_multi_index(ind);
700 for(
int i = 0; i < ind[1]; ++i)
713 for(i1 = 0; i1 < (int)
p; ++i1)
715 const int diff = i0 - (
p+1-i1);
720 UG_ASSERT(i0 >= 0,
"i0 is negative ("<<i0<<
")");
721 UG_ASSERT(i1 >= 0,
"i1 is negative ("<<i1<<
")");
734 UG_ASSERT(ind[0] <= (
int)
p && ind[0]>=0,
"Wrong Multiindex.");
735 UG_ASSERT(ind[1] <= (
int)
p && ind[0]>=0,
"Wrong Multiindex.");
736 UG_ASSERT(ind[0] + ind[1] <= (
int)
p && ind[0]>=0,
"Wrong Multiindex.");
756 template <
int TOrder>
759 public BaseLSFS<LagrangeLSFS<ReferenceQuadrilateral, TOrder>, 2>
763 static const size_t p = TOrder;
777 static const size_t order = TOrder;
783 static const size_t nsh = (
p+1)*(p+1);
793 inline size_t num_sh()
const {
return nsh;}
802 for(
int d = 0; d <
dim; ++d)
812 return shape(multi_index(i), x);
818 check_multi_index(ind);
821 return m_vPolynom[ ind[0] ].value(x[0])
822 * m_vPolynom[ ind[1] ].value(x[1]);
828 grad(g, multi_index(i), x);
835 check_multi_index(ind);
839 for(
int d = 0; d <
dim; ++d)
841 g[d] = m_vDPolynom[ind[d]].value(x[d]);
844 for(
int d2 = 0; d2 <
dim; ++d2)
847 if(d2 == d)
continue;
849 g[d] *= m_vPolynom[ind[d2]].value(x[d2]);
858 return m_vMultiIndex[i];
864 check_multi_index(ind);
865 for(
size_t i=0; i<nsh; ++i)
866 if(multi_index(i) == ind)
return i;
867 UG_THROW(
"Index not found in LagrangeLSFS");
873 check_multi_index(ind);
875 return ind[1] * (
p+1) + ind[0];
895 UG_ASSERT(ind[0] <= (
int)
p && ind[0] >= 0,
"Wrong Multiindex.");
896 UG_ASSERT(ind[1] <= (
int)
p && ind[1] >= 0,
"Wrong Multiindex.");
910 public BaseLSFS<FlexLagrangeLSFS<ReferenceQuadrilateral>, 2>
924 void set_order(
size_t order);
930 inline size_t num_sh()
const {
return nsh;}
939 for(
int d = 0; d <
dim; ++d)
949 return shape(multi_index(i), x);
955 check_multi_index(ind);
958 return m_vPolynom[ ind[0] ].value(x[0])
959 * m_vPolynom[ ind[1] ].value(x[1]);
965 grad(g, multi_index(i), x);
972 check_multi_index(ind);
976 for(
int d = 0; d <
dim; ++d)
978 g[d] = m_vDPolynom[ind[d]].value(x[d]);
981 for(
int d2 = 0; d2 <
dim; ++d2)
984 if(d2 == d)
continue;
986 g[d] *= m_vPolynom[ind[d2]].value(x[d2]);
995 return m_vMultiIndex[i];
1001 check_multi_index(ind);
1002 for(
size_t i=0; i<nsh; ++i)
1003 if(multi_index(i) == ind)
return i;
1004 UG_THROW(
"Index not found in LagrangeLSFS");
1010 check_multi_index(ind);
1012 return ind[1] * (
p+1) + ind[0];
1032 UG_ASSERT(ind[0] <= (
int)
p && ind[0] >= 0,
"Wrong Multiindex.");
1033 UG_ASSERT(ind[1] <= (
int)
p && ind[1] >= 0,
"Wrong Multiindex.");
1053 template <
int TOrder>
1056 public BaseLSFS<LagrangeLSFS<ReferenceTetrahedron, TOrder>, 3>
1060 static const size_t p = TOrder;
1074 static const size_t order = TOrder;
1099 for(
int d = 0; d <
dim; ++d)
1109 return shape(multi_index(i), x);
1115 check_multi_index(ind);
1119 const size_t i0 =
p - ind[0] - ind[1] - ind[2];
1120 const number x0 = 1.0 - x[0] - x[1] - x[2];
1122 return m_vPolynom[ ind[0] ].value(x[0])
1123 * m_vPolynom[ ind[1] ].value(x[1])
1124 * m_vPolynom[ ind[2] ].value(x[2])
1125 * m_vPolynom[ i0 ].value(x0);
1131 grad(g, multi_index(i), x);
1138 check_multi_index(ind);
1142 const size_t i0 =
p - ind[0] - ind[1] - ind[2];
1143 const number x0 = 1 - x[0] - x[1] - x[2];
1149 for(
int d = 0; d <
dim; ++d)
1151 g[d] = m_vDPolynom[ind[d]].value(x[d])
1152 * m_vPolynom[i0].value(x0);
1153 g[d] += (-1) * m_vDPolynom[i0].value(x0)
1154 * m_vPolynom[ind[d]].value(x[d]);
1157 for(
int d2 = 0; d2 <
dim; ++d2)
1160 if(d2 == d)
continue;
1162 g[d] *= m_vPolynom[ind[d2]].value(x[d2]);
1171 return m_vMultiIndex[i];
1177 check_multi_index(ind);
1178 for(
size_t i=0; i<nsh; ++i)
1179 if(multi_index(i) == ind)
return i;
1180 UG_THROW(
"Index not found in LagrangeLSFS");
1186 check_multi_index(ind);
1189 size_t res = ind[0];
1192 for(
int i = 0; i < ind[1]; ++i)
1193 res += (
p+1-ind[2]-i);
1196 for(
int i2 = 0; i2 < ind[2]; ++i2)
1208 int i0 = i, i1 = 0, i2 = 0;
1209 for(i2 = 0; i2 <= (int)
p; ++i2)
1214 const int diff = i0 - binom;
1217 for(i1 = 0; i1 <= (int)
p; ++i1)
1220 const int diff = i0 - (
p+1-i2-i1);
1233 UG_ASSERT(i0 >= 0,
"i0 is negative ("<<i0<<
")");
1234 UG_ASSERT(i1 >= 0,
"i1 is negative ("<<i1<<
")");
1235 UG_ASSERT(i2 >= 0,
"i1 is negative ("<<i2<<
")");
1237 UG_ASSERT(0,
"Should not reach this line.");
1250 UG_ASSERT(ind[0] <= (
int)
p && ind[0] >= 0,
"Wrong Multiindex.");
1251 UG_ASSERT(ind[1] <= (
int)
p && ind[1] >= 0,
"Wrong Multiindex.");
1252 UG_ASSERT(ind[2] <= (
int)
p && ind[2] >= 0,
"Wrong Multiindex.");
1253 UG_ASSERT(ind[0] + ind[1] + ind[2] <= (
int)
p,
"Wrong Multiindex.");
1267 public BaseLSFS<FlexLagrangeLSFS<ReferenceTetrahedron>, 3>
1281 void set_order(
size_t order);
1296 for(
int d = 0; d <
dim; ++d)
1306 return shape(multi_index(i), x);
1312 check_multi_index(ind);
1316 const size_t i0 =
p - ind[0] - ind[1] - ind[2];
1317 const number x0 = 1.0 - x[0] - x[1] - x[2];
1319 return m_vPolynom[ ind[0] ].value(x[0])
1320 * m_vPolynom[ ind[1] ].value(x[1])
1321 * m_vPolynom[ ind[2] ].value(x[2])
1322 * m_vPolynom[ i0 ].value(x0);
1328 grad(g, multi_index(i), x);
1335 check_multi_index(ind);
1339 const size_t i0 =
p - ind[0] - ind[1] - ind[2];
1340 const number x0 = 1 - x[0] - x[1] - x[2];
1346 for(
int d = 0; d <
dim; ++d)
1348 g[d] = m_vDPolynom[ind[d]].value(x[d])
1349 * m_vPolynom[i0].value(x0);
1350 g[d] += (-1) * m_vDPolynom[i0].value(x0)
1351 * m_vPolynom[ind[d]].value(x[d]);
1354 for(
int d2 = 0; d2 <
dim; ++d2)
1357 if(d2 == d)
continue;
1359 g[d] *= m_vPolynom[ind[d2]].value(x[d2]);
1368 return m_vMultiIndex[i];
1374 check_multi_index(ind);
1375 for(
size_t i=0; i<nsh; ++i)
1376 if(multi_index(i) == ind)
return i;
1377 UG_THROW(
"Index not found in LagrangeLSFS");
1383 check_multi_index(ind);
1386 size_t res = ind[0];
1389 for(
int i = 0; i < ind[1]; ++i)
1390 res += (
p+1-ind[2]-i);
1393 for(
int i2 = 0; i2 < ind[2]; ++i2)
1405 int i0 = i, i1 = 0, i2 = 0;
1406 for(i2 = 0; i2 <= (int)
p; ++i2)
1411 const int diff = i0 - binom;
1414 for(i1 = 0; i1 <= (int)
p; ++i1)
1417 const int diff = i0 - (
p+1-i2-i1);
1430 UG_ASSERT(i0 >= 0,
"i0 is negative ("<<i0<<
")");
1431 UG_ASSERT(i1 >= 0,
"i1 is negative ("<<i1<<
")");
1432 UG_ASSERT(i2 >= 0,
"i1 is negative ("<<i2<<
")");
1434 UG_ASSERT(0,
"Should not reach this line.");
1447 UG_ASSERT(ind[0] <= (
int)
p && ind[0] >= 0,
"Wrong Multiindex.");
1448 UG_ASSERT(ind[1] <= (
int)
p && ind[1] >= 0,
"Wrong Multiindex.");
1449 UG_ASSERT(ind[2] <= (
int)
p && ind[2] >= 0,
"Wrong Multiindex.");
1450 UG_ASSERT(ind[0] + ind[1] + ind[2] <= (
int)
p,
"Wrong Multiindex.");
1470 template <
int TOrder>
1473 public BaseLSFS<LagrangeLSFS<ReferencePrism, TOrder>, 3>
1477 static const size_t p = TOrder;
1494 static const size_t order = TOrder;
1500 static const size_t nsh = dofPerLayer*(
p+1);
1519 for(
int d = 0; d < 2; ++d)
1531 return shape(multi_index(i), x);
1537 check_multi_index(ind);
1541 const size_t i0 =
p - ind[0] - ind[1];
1542 const number x0 = 1.0 - x[0] - x[1];
1545 return m_vTruncPolynom[ ind[0] ].value(x[0])
1546 * m_vTruncPolynom[ ind[1] ].value(x[1])
1547 * m_vTruncPolynom[ i0 ].value( x0 )
1549 * m_vPolynom[ ind[2] ].value(x[2]);
1555 grad(g, multi_index(i), x);
1562 check_multi_index(ind);
1566 const size_t i0 =
p - ind[0] - ind[1];
1567 const number x0 = 1 - x[0] - x[1];
1573 for(
size_t d = 0; d < 2; ++d)
1575 g[d] = m_vDTruncPolynom[ind[d]].value(x[d])
1576 * m_vTruncPolynom[i0].value(x0);
1577 g[d] += (-1) * m_vDTruncPolynom[i0].value(x0)
1578 * m_vTruncPolynom[ind[d]].value(x[d]);
1581 for(
size_t d2 = 0; d2 < 2; ++d2)
1584 if(d2 == d)
continue;
1586 g[d] *= m_vTruncPolynom[ind[d2]].value(x[d2]);
1590 g[d] *= m_vPolynom[ind[2]].value(x[2]);
1594 g[2] = m_vDPolynom[ind[2]].value(x[2]);
1595 g[2] *= m_vTruncPolynom[ ind[0] ].value(x[0])
1596 * m_vTruncPolynom[ ind[1] ].value(x[1])
1597 * m_vTruncPolynom[ i0 ].value( x0 );
1604 return m_vMultiIndex[i];
1610 check_multi_index(ind);
1611 for(
size_t i=0; i<nsh; ++i)
1612 if(multi_index(i) == ind)
return i;
1613 UG_THROW(
"Index not found in LagrangeLSFS");
1619 check_multi_index(ind);
1621 size_t res = ind[0];
1622 for(
int i = 0; i < ind[1]; ++i)
1626 res += ind[2] * dofPerLayer;
1636 const size_t i2 = i / dofPerLayer;
1638 int i0 = i - i2*dofPerLayer, i1;
1639 for(i1 = 0; i1 < (int)
p; ++i1)
1641 const int diff = i0 - (
p+1-i1);
1659 UG_ASSERT(ind[0] <= (
int)
p && ind[0] >= 0,
"Wrong Multiindex.");
1660 UG_ASSERT(ind[1] <= (
int)
p && ind[1] >= 0,
"Wrong Multiindex.");
1661 UG_ASSERT(ind[0] + ind[1] <= (
int)
p,
"Wrong Multiindex.");
1662 UG_ASSERT(ind[2] <= (
int)
p && ind[2] >= 0,
"Wrong Multiindex.");
1678 public BaseLSFS<FlexLagrangeLSFS<ReferencePrism>, 3>
1692 void set_order(
size_t order);
1707 for(
int d = 0; d < 2; ++d)
1719 return shape(multi_index(i), x);
1725 check_multi_index(ind);
1729 const size_t i0 =
p - ind[0] - ind[1];
1730 const number x0 = 1.0 - x[0] - x[1];
1733 return m_vTruncPolynom[ ind[0] ].value(x[0])
1734 * m_vTruncPolynom[ ind[1] ].value(x[1])
1735 * m_vTruncPolynom[ i0 ].value( x0 )
1737 * m_vPolynom[ ind[2] ].value(x[2]);
1743 grad(g, multi_index(i), x);
1750 check_multi_index(ind);
1754 const size_t i0 =
p - ind[0] - ind[1];
1755 const number x0 = 1 - x[0] - x[1];
1761 for(
size_t d = 0; d < 2; ++d)
1763 g[d] = m_vDTruncPolynom[ind[d]].value(x[d])
1764 * m_vTruncPolynom[i0].value(x0);
1765 g[d] += (-1) * m_vDTruncPolynom[i0].value(x0)
1766 * m_vTruncPolynom[ind[d]].value(x[d]);
1769 for(
size_t d2 = 0; d2 < 2; ++d2)
1772 if(d2 == d)
continue;
1774 g[d] *= m_vTruncPolynom[ind[d2]].value(x[d2]);
1778 g[d] *= m_vPolynom[ind[2]].value(x[2]);
1782 g[2] = m_vDPolynom[ind[2]].value(x[2]);
1783 g[2] *= m_vTruncPolynom[ ind[0] ].value(x[0])
1784 * m_vTruncPolynom[ ind[1] ].value(x[1])
1785 * m_vTruncPolynom[ i0 ].value( x0 );
1792 return m_vMultiIndex[i];
1798 check_multi_index(ind);
1799 for(
size_t i=0; i<nsh; ++i)
1800 if(multi_index(i) == ind)
return i;
1801 UG_THROW(
"Index not found in LagrangeLSFS");
1807 check_multi_index(ind);
1809 size_t res = ind[0];
1810 for(
int i = 0; i < ind[1]; ++i)
1814 res += ind[2] * dofPerLayer;
1824 const size_t i2 = i / dofPerLayer;
1826 int i0 = i - i2*dofPerLayer, i1;
1827 for(i1 = 0; i1 < (int)
p; ++i1)
1829 const int diff = i0 - (
p+1-i1);
1847 UG_ASSERT(ind[0] <= (
int)
p && ind[0] >= 0,
"Wrong Multiindex.");
1848 UG_ASSERT(ind[1] <= (
int)
p && ind[1] >= 0,
"Wrong Multiindex.");
1849 UG_ASSERT(ind[0] + ind[1] <= (
int)
p,
"Wrong Multiindex.");
1850 UG_ASSERT(ind[2] <= (
int)
p && ind[2] >= 0,
"Wrong Multiindex.");
1877 struct NumberOfDoFsOfPyramid{
1878 enum{value = NumberOfDoFsOfPyramid<
p-1>::value + (
p+1)*(
p+1)};
1882 template <>
struct NumberOfDoFsOfPyramid<1>{
enum {value = 5};};
1883 template <>
struct NumberOfDoFsOfPyramid<0>{
enum {value = 0};};
1884 template <>
struct NumberOfDoFsOfPyramid<-1>{
enum {value = 0};};
1892 template <
int TOrder>
1895 public BaseLSFS<LagrangeLSFS<ReferencePyramid, TOrder>, 3>
1899 static const size_t p = TOrder;
1913 static const size_t order = TOrder;
1919 static const size_t nsh = NumberOfDoFsOfPyramid<p>::value;
1938 for(
int d = 0; d <
dim; ++d)
1948 if(
p != 1)
UG_THROW(
"Only 1. order Lagrange Pyramid implemented.");
1952 if (x[0] > x[1]) m = x[1];
1956 case 0 :
return((1.0-x[0])*(1.0-x[1]) + x[2]*(m-1.0));
1957 case 1 :
return(x[0]*(1.0-x[1]) - x[2]*m);
1958 case 2 :
return(x[0]*x[1] + x[2]*m);
1959 case 3 :
return((1.0-x[0])*x[1] - x[2]*m);
1960 case 4 :
return(x[2]);
1961 default:
UG_THROW(
"Wrong index "<< i<<
" in Pyramid");
1968 check_multi_index(ind);
1972 return shape(index(ind), x);
1979 if(
p != 1)
UG_THROW(
"Only 1. order Lagrange Pyramid implemented.");
1982 if (x[0] > x[1]) m = 1;
1988 g[1] = -(1.0-x[0]) + x[2];
2015 default:
UG_THROW(
"Wrong index "<< i<<
" in Pyramid");
2024 grad(g, index(ind), x);
2031 return m_vMultiIndex[i];
2037 check_multi_index(ind);
2038 for(
size_t i=0; i<nsh; ++i)
2039 if(multi_index(i) == ind)
return i;
2040 UG_THROW(
"Index not found in LagrangeLSFS");
2046 check_multi_index(ind);
2051 for(
int i2 = 0; i2 < ind[2]; ++i2)
2052 res += (
p+1-i2)*(
p+1-i2);
2055 res += ind[1] * (
p+1-ind[2]) + ind[0];
2069 for(i2 = 0; i2 < (int)
p; ++i2)
2071 const int diff = iTmp - (
p+1-i2)*(
p+1-i2);
2089 UG_ASSERT(ind[0] <= (
int)
p-ind[2] && ind[0] >= 0,
"Wrong Multiindex.");
2090 UG_ASSERT(ind[1] <= (
int)
p-ind[2] && ind[1] >= 0,
"Wrong Multiindex.");
2091 UG_ASSERT(ind[2] <= (
int)
p && ind[2] >= 0,
"Wrong Multiindex.");
2105 template <
int TOrder>
2108 public BaseLSFS<LagrangeLSFS<ReferenceHexahedron, TOrder>, 3>
2112 static const size_t p = TOrder;
2126 static const size_t order = TOrder;
2132 static const size_t nsh = (
p+1)*(p+1)*(
p+1);
2151 for(
int d = 0; d <
dim; ++d)
2161 return shape(multi_index(i), x);
2167 check_multi_index(ind);
2170 return m_vPolynom[ ind[0] ].value(x[0])
2171 * m_vPolynom[ ind[1] ].value(x[1])
2172 * m_vPolynom[ ind[2] ].value(x[2]);
2178 grad(g, multi_index(i), x);
2185 check_multi_index(ind);
2189 for(
int d = 0; d <
dim; ++d)
2191 g[d] = m_vDPolynom[ind[d]].value(x[d]);
2194 for(
int d2 = 0; d2 <
dim; ++d2)
2197 if(d2 == d)
continue;
2199 g[d] *= m_vPolynom[ind[d2]].value(x[d2]);
2208 return m_vMultiIndex[i];
2214 check_multi_index(ind);
2215 for(
size_t i=0; i<nsh; ++i)
2216 if(multi_index(i) == ind)
return i;
2217 UG_THROW(
"Index not found in LagrangeLSFS");
2223 check_multi_index(ind);
2225 return ind[2] * (
p+1)*(
p+1) + ind[1] * (
p+1) + ind[0];
2245 UG_ASSERT(ind[0] <= (
int)
p && ind[0] >= 0,
"Wrong Multiindex.");
2246 UG_ASSERT(ind[1] <= (
int)
p && ind[1] >= 0,
"Wrong Multiindex.");
2247 UG_ASSERT(ind[2] <= (
int)
p && ind[2] >= 0,
"Wrong Multiindex.");
2260 public BaseLSFS<FlexLagrangeLSFS<ReferenceHexahedron>, 3>
2274 void set_order(
size_t order);
2289 for(
int d = 0; d <
dim; ++d)
2299 return shape(multi_index(i), x);
2305 check_multi_index(ind);
2308 return m_vPolynom[ ind[0] ].value(x[0])
2309 * m_vPolynom[ ind[1] ].value(x[1])
2310 * m_vPolynom[ ind[2] ].value(x[2]);
2316 grad(g, multi_index(i), x);
2323 check_multi_index(ind);
2327 for(
int d = 0; d <
dim; ++d)
2329 g[d] = m_vDPolynom[ind[d]].value(x[d]);
2332 for(
int d2 = 0; d2 <
dim; ++d2)
2335 if(d2 == d)
continue;
2337 g[d] *= m_vPolynom[ind[d2]].value(x[d2]);
2346 return m_vMultiIndex[i];
2352 check_multi_index(ind);
2353 for(
size_t i=0; i<nsh; ++i)
2354 if(multi_index(i) == ind)
return i;
2355 UG_THROW(
"Index not found in LagrangeLSFS");
2361 check_multi_index(ind);
2363 return ind[2] * (
p+1)*(
p+1) + ind[1] * (
p+1) + ind[0];
2383 UG_ASSERT(ind[0] <= (
int)
p && ind[0] >= 0,
"Wrong Multiindex.");
2384 UG_ASSERT(ind[1] <= (
int)
p && ind[1] >= 0,
"Wrong Multiindex.");
2385 UG_ASSERT(ind[2] <= (
int)
p && ind[2] >= 0,
"Wrong Multiindex.");
2409 template <
int TOrder>
2412 public BaseLSFS<LagrangeLSFS<ReferenceOctahedron, TOrder>, 3>
2416 static const size_t p = TOrder;
2430 static const size_t order = TOrder;
2436 static const size_t nsh = 6;
2455 for(
int d = 0; d <
dim; ++d)
2465 if(
p != 1)
UG_THROW(
"Only 1. order Lagrange Octahedron implemented.");
2469 const number z_sgn = (x[2] < 0) ? -1.0 : 1.0;
2480 return((1.0-x[0])*(1.0-x[1]) + z_sgn*x[2]*(x[1]-1.0));
2482 return((1.0-x[0])*(1.0-x[1]) + z_sgn*x[2]*(x[0]-1.0));
2485 return(x[0]*(1.0-x[1]) - z_sgn*x[2]*x[1]);
2487 return(x[0]*(1.0-x[1]) - z_sgn*x[2]*x[0]);
2490 return(x[0]*x[1] + z_sgn*x[2]*x[1]);
2492 return(x[0]*x[1] + z_sgn*x[2]*x[0]);
2495 return((1.0-x[0])*x[1] - z_sgn*x[2]*x[1]);
2497 return((1.0-x[0])*x[1] - z_sgn*x[2]*x[0]);
2503 default:
UG_THROW(
"Wrong index "<< i<<
" in Octahedron.");
2510 check_multi_index(ind);
2513 return shape(index(ind), x);
2520 if(
p != 1)
UG_THROW(
"Only 1. order Lagrange Octahedron implemented.");
2524 const number z_sgn = (x[2] < 0) ? -1.0 : 1.0;
2547 g[1] = -(1.0-x[0]) + z_sgn*x[2];
2548 g[2] = -z_sgn*(1.0-x[1]);
2553 g[0] = -(1.0-x[1]) + z_sgn*x[2];
2555 g[2] = -z_sgn*(1.0-x[0]);
2562 g[1] = -x[0] - z_sgn*x[2];
2568 g[0] = (1.0-x[1]) - z_sgn*x[2];
2577 g[1] = x[0] + z_sgn*x[2];
2583 g[0] = x[1] + z_sgn*x[2];
2592 g[1] = 1.0-x[0] - z_sgn*x[2];
2598 g[0] = -x[1] - z_sgn*x[2];
2618 default:
UG_THROW(
"Wrong index "<< i<<
" in Octahedron.");
2626 grad(g, index(ind), x);
2633 return m_vMultiIndex[i];
2639 check_multi_index(ind);
2640 for(
size_t i=0; i<nsh; ++i)
2641 if(multi_index(i) == ind)
return i;
2642 UG_THROW(
"Index not found in LagrangeLSFS");
2654 UG_ASSERT(ind[0] <= (
int)
p-ind[2] && ind[0] >= 0,
"Wrong Multiindex.");
2655 UG_ASSERT(ind[1] <= (
int)
p-ind[2] && ind[1] >= 0,
"Wrong Multiindex.");
2656 UG_ASSERT(ind[2] <= (
int)
p && ind[2] >= 0,
"Wrong Multiindex.");
static interface for trial spaces
Definition: local_shape_function_set.h:176
number shape_type
Shape type.
Definition: local_shape_function_set.h:185
static number position(const size_t i, const size_t degree)
returns the position of the i'th interpolation point
Definition: lagrange1d.h:127
size_t mapped_index(const MathVector< dim, int > &ind) const
return the index for a multi_index
Definition: lagrange.h:360
const MathVector< dim, int > & multi_index(size_t i) const
return Multi index for index i
Definition: lagrange.h:337
size_t nsh
Number of shape functions.
Definition: lagrange.h:383
size_t p
order
Definition: lagrange.h:380
shape_type shape(size_t i, const MathVector< dim > &x) const
evaluates the shape function
Definition: lagrange.h:325
size_t num_sh() const
Definition: lagrange.h:315
void grad(grad_type &g, size_t i, const MathVector< dim > &x) const
evaluates the gradient of the shape function
Definition: lagrange.h:331
MathVector< dim, int > mapped_multi_index(size_t i) const
return Multi index for index i
Definition: lagrange.h:353
std::vector< Polynomial1D > m_vPolynom
Shape Polynomials.
Definition: lagrange.h:385
void check_index(size_t i) const
checks in debug mode that index is valid
Definition: lagrange.h:367
std::vector< Polynomial1D > m_vDPolynom
Derivative of Shape Polynomial.
Definition: lagrange.h:386
size_t index(const MathVector< dim, int > &ind) const
return the index for a multi_index
Definition: lagrange.h:344
void check_multi_index(const MathVector< dim, int > &ind) const
checks in debug mode that multi-index is valid
Definition: lagrange.h:373
std::vector< MathVector< dim, int > > m_vMultiIndex
Definition: lagrange.h:388
bool position(size_t i, MathVector< dim > &pos) const
local position of DoF i
Definition: lagrange.h:318
FlexLagrangeLSFS(size_t order)
Constructor.
Definition: lagrange.h:306
FlexLagrangeLSFS()
default Constructor
Definition: lagrange.h:303
bool continuous() const
returns if space constructs continuous functions
Definition: lagrange.h:312
size_t nsh
Number of shape functions.
Definition: lagrange.h:2393
void check_multi_index(const MathVector< dim, int > &ind) const
checks in debug mode that multi-index is valid
Definition: lagrange.h:2381
size_t num_sh() const
Definition: lagrange.h:2280
size_t mapped_index(const MathVector< dim, int > &ind) const
return the index for a multi_index
Definition: lagrange.h:2359
void grad(grad_type &g, const size_t i, const MathVector< dim > &x) const
evaluates the gradient of the shape function
Definition: lagrange.h:2314
void check_index(size_t i) const
checks in debug mode that index is valid
Definition: lagrange.h:2375
FlexLagrangeLSFS()
default Constructor
Definition: lagrange.h:2268
void grad(grad_type &g, const MathVector< dim, int > ind, const MathVector< dim > &x) const
evaluates the gradient
Definition: lagrange.h:2320
bool position(size_t i, MathVector< dim > &pos) const
local position of DoF i
Definition: lagrange.h:2283
number shape(const size_t i, const MathVector< dim > &x) const
evaluates the shape function
Definition: lagrange.h:2296
FlexLagrangeLSFS(size_t order)
Constructor.
Definition: lagrange.h:2271
number shape(const MathVector< dim, int > &ind, const MathVector< dim > &x) const
shape value for a Multi Index
Definition: lagrange.h:2303
std::vector< MathVector< dim, int > > m_vMultiIndex
Definition: lagrange.h:2398
bool continuous() const
returns if space constructs continuous functions
Definition: lagrange.h:2277
MathVector< dim, int > mapped_multi_index(size_t i) const
return the multi_index for an index
Definition: lagrange.h:2367
std::vector< Polynomial1D > m_vDPolynom
Derivative of Shape Polynomial.
Definition: lagrange.h:2396
const MathVector< dim, int > & multi_index(size_t i) const
return Multi index for index i
Definition: lagrange.h:2343
std::vector< Polynomial1D > m_vPolynom
Shape Polynomials.
Definition: lagrange.h:2395
size_t p
order
Definition: lagrange.h:2390
size_t index(const MathVector< dim, int > &ind) const
return the index for a multi_index
Definition: lagrange.h:2350
bool position(size_t i, MathVector< dim > &pos) const
local position of DoF i
Definition: lagrange.h:1701
number shape(const MathVector< dim, int > &ind, const MathVector< dim > &x) const
shape value for a Multi Index
Definition: lagrange.h:1723
size_t mapped_index(const MathVector< dim, int > &ind) const
return the index for a multi_index
Definition: lagrange.h:1805
std::vector< Polynomial1D > m_vDPolynom
Definition: lagrange.h:1864
std::vector< MathVector< dim, int > > m_vMultiIndex
Definition: lagrange.h:1868
size_t index(const MathVector< dim, int > &ind) const
return the index for a multi_index
Definition: lagrange.h:1796
std::vector< Polynomial1D > m_vPolynom
Definition: lagrange.h:1863
size_t num_sh() const
Definition: lagrange.h:1698
void check_index(size_t i) const
checks in debug mode that index is valid
Definition: lagrange.h:1839
void grad(grad_type &g, const size_t i, const MathVector< dim > &x) const
evaluates the gradient of the shape function
Definition: lagrange.h:1741
std::vector< Polynomial1D > m_vDTruncPolynom
Definition: lagrange.h:1866
size_t nsh
Number of shape functions.
Definition: lagrange.h:1858
FlexLagrangeLSFS(size_t order)
Constructor.
Definition: lagrange.h:1689
bool continuous() const
returns if space constructs continuous functions
Definition: lagrange.h:1695
void grad(grad_type &g, const MathVector< dim, int > ind, const MathVector< dim > &x) const
evaluates the gradient
Definition: lagrange.h:1747
size_t p
order
Definition: lagrange.h:1855
MathVector< dim, int > mapped_multi_index(size_t i) const
return the multi_index for an index
Definition: lagrange.h:1820
void check_multi_index(const MathVector< dim, int > &ind) const
checks in debug mode that multi-index is valid
Definition: lagrange.h:1845
FlexLagrangeLSFS()
default Constructor
Definition: lagrange.h:1686
number shape(const size_t i, const MathVector< dim > &x) const
evaluates the shape function
Definition: lagrange.h:1716
size_t dofPerLayer
number of dofs per layer
Definition: lagrange.h:1861
const MathVector< dim, int > & multi_index(size_t i) const
return Multi index for index i
Definition: lagrange.h:1789
std::vector< Polynomial1D > m_vTruncPolynom
Definition: lagrange.h:1865
size_t index(const MathVector< dim, int > &ind) const
return the index for a multi_index
Definition: lagrange.h:999
bool position(size_t i, MathVector< dim > &pos) const
local position of DoF i
Definition: lagrange.h:933
void check_multi_index(const MathVector< dim, int > &ind) const
checks in debug mode that multi-index is valid
Definition: lagrange.h:1030
void check_index(size_t i) const
checks in debug mode that index is valid
Definition: lagrange.h:1024
size_t nsh
Number of shape functions.
Definition: lagrange.h:1041
std::vector< MathVector< dim, int > > m_vMultiIndex
Definition: lagrange.h:1046
void grad(grad_type &g, const MathVector< dim, int > ind, const MathVector< dim > &x) const
evaluates the gradient
Definition: lagrange.h:969
FlexLagrangeLSFS(size_t order)
Constructor.
Definition: lagrange.h:921
number shape(const size_t i, const MathVector< dim > &x) const
evaluates the shape function
Definition: lagrange.h:946
std::vector< Polynomial1D > m_vDPolynom
Derivative of Shape Polynomial.
Definition: lagrange.h:1044
size_t mapped_index(const MathVector< dim, int > &ind) const
return the index for a multi_index
Definition: lagrange.h:1008
void grad(grad_type &g, const size_t i, const MathVector< dim > &x) const
evaluates the gradient of the shape function
Definition: lagrange.h:963
FlexLagrangeLSFS()
default Constructor
Definition: lagrange.h:918
bool continuous() const
returns if space constructs continuous functions
Definition: lagrange.h:927
std::vector< Polynomial1D > m_vPolynom
Shape Polynomials.
Definition: lagrange.h:1043
size_t num_sh() const
Definition: lagrange.h:930
size_t p
order
Definition: lagrange.h:1038
MathVector< dim, int > mapped_multi_index(size_t i) const
return the multi_index for an index
Definition: lagrange.h:1016
number shape(const MathVector< dim, int > &ind, const MathVector< dim > &x) const
shape value for a Multi Index
Definition: lagrange.h:953
const MathVector< dim, int > & multi_index(size_t i) const
return Multi index for index i
Definition: lagrange.h:992
void check_multi_index(const MathVector< dim, int > &ind) const
checks in debug mode that multi-index is valid
Definition: lagrange.h:1445
std::vector< Polynomial1D > m_vPolynom
Shape Polynomials.
Definition: lagrange.h:1460
bool continuous() const
returns if space constructs continuous functions
Definition: lagrange.h:1284
size_t p
order
Definition: lagrange.h:1455
void check_index(size_t i) const
checks in debug mode that index is valid
Definition: lagrange.h:1439
FlexLagrangeLSFS()
default Constructor
Definition: lagrange.h:1275
number shape(const size_t i, const MathVector< dim > &x) const
evaluates the shape function
Definition: lagrange.h:1303
size_t mapped_index(const MathVector< dim, int > &ind) const
return the index for a multi_index
Definition: lagrange.h:1381
size_t num_sh() const
Definition: lagrange.h:1287
std::vector< MathVector< dim, int > > m_vMultiIndex
Definition: lagrange.h:1463
MathVector< dim, int > mapped_multi_index(size_t i) const
return the multi_index for an index
Definition: lagrange.h:1401
std::vector< Polynomial1D > m_vDPolynom
Derivative of Shape Polynomial.
Definition: lagrange.h:1461
void grad(grad_type &g, const size_t i, const MathVector< dim > &x) const
evaluates the gradient of the shape function
Definition: lagrange.h:1326
number shape(const MathVector< dim, int > &ind, const MathVector< dim > &x) const
shape value for a Multi Index
Definition: lagrange.h:1310
size_t nsh
Number of shape functions.
Definition: lagrange.h:1458
bool position(size_t i, MathVector< dim > &pos) const
local position of DoF i
Definition: lagrange.h:1290
void grad(grad_type &g, const MathVector< dim, int > ind, const MathVector< dim > &x) const
evaluates the gradient
Definition: lagrange.h:1332
FlexLagrangeLSFS(size_t order)
Constructor.
Definition: lagrange.h:1278
const MathVector< dim, int > & multi_index(size_t i) const
return Multi index for index i
Definition: lagrange.h:1365
size_t index(const MathVector< dim, int > &ind) const
return the index for a multi_index
Definition: lagrange.h:1372
size_t index(const MathVector< dim, int > &ind) const
return the index for a multi_index
Definition: lagrange.h:686
void check_multi_index(const MathVector< dim, int > &ind) const
checks in debug mode that multi-index is valid
Definition: lagrange.h:732
size_t nsh
Number of shape functions.
Definition: lagrange.h:744
FlexLagrangeLSFS(size_t order)
Constructor.
Definition: lagrange.h:592
bool continuous() const
returns if space constructs continuous functions
Definition: lagrange.h:598
number shape(const size_t i, const MathVector< dim > &x) const
evaluates the shape function
Definition: lagrange.h:617
size_t mapped_index(const MathVector< dim, int > &ind) const
return the index for a multi_index
Definition: lagrange.h:695
void check_index(size_t i) const
checks in debug mode that index is valid
Definition: lagrange.h:726
number shape(const MathVector< dim, int > &ind, const MathVector< dim > &x) const
shape value for a Multi Index
Definition: lagrange.h:624
std::vector< Polynomial1D > m_vDPolynom
Derivative of Shape Polynomial.
Definition: lagrange.h:747
std::vector< Polynomial1D > m_vPolynom
Shape Polynomials.
Definition: lagrange.h:746
void grad(grad_type &g, const size_t i, const MathVector< dim > &x) const
evaluates the shape function
Definition: lagrange.h:640
MathVector< dim, int > mapped_multi_index(size_t i) const
return the multi_index for an index
Definition: lagrange.h:708
bool position(size_t i, MathVector< dim > &pos) const
local position of DoF i
Definition: lagrange.h:604
size_t p
order
Definition: lagrange.h:741
FlexLagrangeLSFS()
default Constructor
Definition: lagrange.h:589
void grad(grad_type &g, const MathVector< dim, int > ind, const MathVector< dim > &x) const
evaluates the gradient
Definition: lagrange.h:646
std::vector< MathVector< dim, int > > m_vMultiIndex
Definition: lagrange.h:749
const MathVector< dim, int > & multi_index(size_t i) const
return Multi index for index i
Definition: lagrange.h:679
size_t num_sh() const
Definition: lagrange.h:601
void grad(grad_type &g, size_t i, const MathVector< dim > &x) const
evaluates the gradient of the shape function
Definition: lagrange.h:160
FlexLagrangeLSFS()
default Constructor
Definition: lagrange.h:136
size_t p
order
Definition: lagrange.h:166
bool continuous() const
returns if space constructs continuous functions
Definition: lagrange.h:142
shape_type shape(size_t i, const MathVector< dim > &x) const
evaluates the shape function
Definition: lagrange.h:154
FlexLagrangeLSFS(size_t order)
Constructor.
Definition: lagrange.h:139
bool position(size_t i, MathVector< dim > &pos) const
local position of DoF i
Definition: lagrange.h:148
size_t num_sh() const
Definition: lagrange.h:145
Lagrange Shape Function Set without virtual functions and flexible order.
Definition: lagrange.h:52
Lagrange DoF Set.
Definition: lagrange_local_dof.h:55
bool continuous() const
returns if space constructs continuous functions
Definition: lagrange.h:215
shape_type shape(size_t i, const MathVector< dim > &x) const
evaluates the shape function
Definition: lagrange.h:228
base_type::shape_type shape_type
Shape type.
Definition: lagrange.h:195
BaseLSFS< LagrangeLSFS< ReferenceEdge, TOrder >, 1 > base_type
base class
Definition: lagrange.h:191
void grad(grad_type &g, size_t i, const MathVector< dim > &x) const
evaluates the gradient of the shape function
Definition: lagrange.h:234
size_t num_sh() const
Definition: lagrange.h:218
base_type::grad_type grad_type
Gradient type.
Definition: lagrange.h:198
size_t index(const MathVector< dim, int > &ind) const
return the index for a multi_index
Definition: lagrange.h:247
bool position(size_t i, MathVector< dim > &pos) const
local position of DoF i
Definition: lagrange.h:221
void check_multi_index(const MathVector< dim, int > &ind) const
checks in debug mode that multi-index is valid
Definition: lagrange.h:276
MathVector< dim, int > mapped_multi_index(size_t i) const
return Multi index for index i
Definition: lagrange.h:256
const MathVector< dim, int > & multi_index(size_t i) const
return Multi index for index i
Definition: lagrange.h:240
size_t mapped_index(const MathVector< dim, int > &ind) const
return the index for a multi_index
Definition: lagrange.h:263
void check_index(size_t i) const
checks in debug mode that index is valid
Definition: lagrange.h:270
void grad(grad_type &g, const size_t i, const MathVector< dim > &x) const
evaluates the gradient of the shape function
Definition: lagrange.h:2176
void check_multi_index(const MathVector< dim, int > &ind) const
checks in debug mode that multi-index is valid
Definition: lagrange.h:2243
void grad(grad_type &g, const MathVector< dim, int > ind, const MathVector< dim > &x) const
evaluates the gradient
Definition: lagrange.h:2182
size_t num_sh() const
Definition: lagrange.h:2142
BaseLSFS< LagrangeLSFS< ReferenceHexahedron, TOrder >, 3 > base_type
base class
Definition: lagrange.h:2115
number shape(const MathVector< dim, int > &ind, const MathVector< dim > &x) const
shape value for a Multi Index
Definition: lagrange.h:2165
bool position(size_t i, MathVector< dim > &pos) const
local position of DoF i
Definition: lagrange.h:2145
number shape(const size_t i, const MathVector< dim > &x) const
evaluates the shape function
Definition: lagrange.h:2158
void check_index(size_t i) const
checks in debug mode that index is valid
Definition: lagrange.h:2237
const MathVector< dim, int > & multi_index(size_t i) const
return Multi index for index i
Definition: lagrange.h:2205
base_type::shape_type shape_type
Shape type.
Definition: lagrange.h:2119
size_t mapped_index(const MathVector< dim, int > &ind) const
return the index for a multi_index
Definition: lagrange.h:2221
bool continuous() const
returns if space constructs continuous functions
Definition: lagrange.h:2139
MathVector< dim, int > mapped_multi_index(size_t i) const
return the multi_index for an index
Definition: lagrange.h:2229
base_type::grad_type grad_type
Gradient type.
Definition: lagrange.h:2122
size_t index(const MathVector< dim, int > &ind) const
return the index for a multi_index
Definition: lagrange.h:2212
number shape(const MathVector< dim, int > &ind, const MathVector< dim > &x) const
shape value for a Multi Index
Definition: lagrange.h:2508
void grad(grad_type &g, const MathVector< dim, int > ind, const MathVector< dim > &x) const
evaluates the gradient
Definition: lagrange.h:2623
void check_multi_index(const MathVector< dim, int > &ind) const
checks in debug mode that multi-index is valid
Definition: lagrange.h:2652
size_t index(const MathVector< dim, int > &ind) const
return the index for a multi_index
Definition: lagrange.h:2637
size_t num_sh() const
Definition: lagrange.h:2446
base_type::shape_type shape_type
Shape type.
Definition: lagrange.h:2423
void grad(grad_type &g, const size_t i, const MathVector< dim > &x) const
evaluates the gradient of the shape function
Definition: lagrange.h:2517
base_type::grad_type grad_type
Gradient type.
Definition: lagrange.h:2426
const MathVector< dim, int > & multi_index(size_t i) const
return Multi index for index i
Definition: lagrange.h:2630
bool continuous() const
returns if space constructs continuous functions
Definition: lagrange.h:2443
void check_index(size_t i) const
checks in debug mode that index is valid
Definition: lagrange.h:2646
BaseLSFS< LagrangeLSFS< ReferenceOctahedron, TOrder >, 3 > base_type
base class
Definition: lagrange.h:2419
number shape(const size_t i, const MathVector< dim > &x) const
evaluates the shape function
Definition: lagrange.h:2462
bool position(size_t i, MathVector< dim > &pos) const
local position of DoF i
Definition: lagrange.h:2449
BaseLSFS< LagrangeLSFS< ReferencePrism, TOrder >, 3 > base_type
base class
Definition: lagrange.h:1483
void grad(grad_type &g, const MathVector< dim, int > ind, const MathVector< dim > &x) const
evaluates the gradient
Definition: lagrange.h:1559
size_t index(const MathVector< dim, int > &ind) const
return the index for a multi_index
Definition: lagrange.h:1608
bool continuous() const
returns if space constructs continuous functions
Definition: lagrange.h:1507
number shape(const MathVector< dim, int > &ind, const MathVector< dim > &x) const
shape value for a Multi Index
Definition: lagrange.h:1535
size_t num_sh() const
Definition: lagrange.h:1510
size_t mapped_index(const MathVector< dim, int > &ind) const
return the index for a multi_index
Definition: lagrange.h:1617
void check_index(size_t i) const
checks in debug mode that index is valid
Definition: lagrange.h:1651
base_type::grad_type grad_type
Gradient type.
Definition: lagrange.h:1490
void grad(grad_type &g, const size_t i, const MathVector< dim > &x) const
evaluates the gradient of the shape function
Definition: lagrange.h:1553
bool position(size_t i, MathVector< dim > &pos) const
local position of DoF i
Definition: lagrange.h:1513
number shape(const size_t i, const MathVector< dim > &x) const
evaluates the shape function
Definition: lagrange.h:1528
const MathVector< dim, int > & multi_index(size_t i) const
return Multi index for index i
Definition: lagrange.h:1601
base_type::shape_type shape_type
Shape type.
Definition: lagrange.h:1487
void check_multi_index(const MathVector< dim, int > &ind) const
checks in debug mode that multi-index is valid
Definition: lagrange.h:1657
MathVector< dim, int > mapped_multi_index(size_t i) const
return the multi_index for an index
Definition: lagrange.h:1632
void grad(grad_type &g, const size_t i, const MathVector< dim > &x) const
evaluates the gradient of the shape function
Definition: lagrange.h:1976
const MathVector< dim, int > & multi_index(size_t i) const
return Multi index for index i
Definition: lagrange.h:2028
void check_index(size_t i) const
checks in debug mode that index is valid
Definition: lagrange.h:2081
size_t index(const MathVector< dim, int > &ind) const
return the index for a multi_index
Definition: lagrange.h:2035
void grad(grad_type &g, const MathVector< dim, int > ind, const MathVector< dim > &x) const
evaluates the gradient
Definition: lagrange.h:2021
void check_multi_index(const MathVector< dim, int > &ind) const
checks in debug mode that multi-index is valid
Definition: lagrange.h:2087
size_t num_sh() const
Definition: lagrange.h:1929
bool position(size_t i, MathVector< dim > &pos) const
local position of DoF i
Definition: lagrange.h:1932
MathVector< dim, int > mapped_multi_index(size_t i) const
return the multi_index for an index
Definition: lagrange.h:2062
bool continuous() const
returns if space constructs continuous functions
Definition: lagrange.h:1926
std::vector< std::vector< Polynomial1D > > m_vvPolynom
Definition: lagrange.h:2095
std::vector< std::vector< Polynomial1D > > m_vvDPolynom
Definition: lagrange.h:2096
number shape(const size_t i, const MathVector< dim > &x) const
evaluates the shape function
Definition: lagrange.h:1945
size_t mapped_index(const MathVector< dim, int > &ind) const
return the index for a multi_index
Definition: lagrange.h:2044
BaseLSFS< LagrangeLSFS< ReferencePyramid, TOrder >, 3 > base_type
base class
Definition: lagrange.h:1902
number shape(const MathVector< dim, int > &ind, const MathVector< dim > &x) const
shape value for a Multi Index
Definition: lagrange.h:1966
base_type::shape_type shape_type
Shape type.
Definition: lagrange.h:1906
base_type::grad_type grad_type
Gradient type.
Definition: lagrange.h:1909
MathVector< dim, int > mapped_multi_index(size_t i) const
return the multi_index for an index
Definition: lagrange.h:879
void grad(grad_type &g, const size_t i, const MathVector< dim > &x) const
evaluates the gradient of the shape function
Definition: lagrange.h:826
bool continuous() const
returns if space constructs continuous functions
Definition: lagrange.h:790
const MathVector< dim, int > & multi_index(size_t i) const
return Multi index for index i
Definition: lagrange.h:855
void check_index(size_t i) const
checks in debug mode that index is valid
Definition: lagrange.h:887
size_t index(const MathVector< dim, int > &ind) const
return the index for a multi_index
Definition: lagrange.h:862
BaseLSFS< LagrangeLSFS< ReferenceQuadrilateral, TOrder >, 2 > base_type
base class
Definition: lagrange.h:766
size_t num_sh() const
Definition: lagrange.h:793
base_type::grad_type grad_type
Gradient type.
Definition: lagrange.h:773
void grad(grad_type &g, const MathVector< dim, int > ind, const MathVector< dim > &x) const
evaluates the gradient
Definition: lagrange.h:832
number shape(const size_t i, const MathVector< dim > &x) const
evaluates the shape function
Definition: lagrange.h:809
size_t mapped_index(const MathVector< dim, int > &ind) const
return the index for a multi_index
Definition: lagrange.h:871
base_type::shape_type shape_type
Shape type.
Definition: lagrange.h:770
number shape(const MathVector< dim, int > &ind, const MathVector< dim > &x) const
shape value for a Multi Index
Definition: lagrange.h:816
bool position(size_t i, MathVector< dim > &pos) const
local position of DoF i
Definition: lagrange.h:796
void check_multi_index(const MathVector< dim, int > &ind) const
checks in debug mode that multi-index is valid
Definition: lagrange.h:893
bool continuous() const
returns if space constructs continuous functions
Definition: lagrange.h:1087
base_type::grad_type grad_type
Gradient type.
Definition: lagrange.h:1070
bool position(size_t i, MathVector< dim > &pos) const
local position of DoF i
Definition: lagrange.h:1093
const MathVector< dim, int > & multi_index(size_t i) const
return Multi index for index i
Definition: lagrange.h:1168
void check_index(size_t i) const
checks in debug mode that index is valid
Definition: lagrange.h:1242
MathVector< dim, int > mapped_multi_index(size_t i) const
return the multi_index for an index
Definition: lagrange.h:1204
size_t num_sh() const
Definition: lagrange.h:1090
BaseLSFS< LagrangeLSFS< ReferenceTetrahedron, TOrder >, 3 > base_type
base class
Definition: lagrange.h:1063
void check_multi_index(const MathVector< dim, int > &ind) const
checks in debug mode that multi-index is valid
Definition: lagrange.h:1248
base_type::shape_type shape_type
Shape type.
Definition: lagrange.h:1067
number shape(const size_t i, const MathVector< dim > &x) const
evaluates the shape function
Definition: lagrange.h:1106
size_t index(const MathVector< dim, int > &ind) const
return the index for a multi_index
Definition: lagrange.h:1175
void grad(grad_type &g, const size_t i, const MathVector< dim > &x) const
evaluates the gradient of the shape function
Definition: lagrange.h:1129
number shape(const MathVector< dim, int > &ind, const MathVector< dim > &x) const
shape value for a Multi Index
Definition: lagrange.h:1113
void grad(grad_type &g, const MathVector< dim, int > ind, const MathVector< dim > &x) const
evaluates the gradient
Definition: lagrange.h:1135
size_t mapped_index(const MathVector< dim, int > &ind) const
return the index for a multi_index
Definition: lagrange.h:1184
const MathVector< dim, int > & multi_index(size_t i) const
return Multi index for index i
Definition: lagrange.h:510
size_t num_sh() const
Definition: lagrange.h:432
base_type::grad_type grad_type
Gradient type.
Definition: lagrange.h:412
number shape(const MathVector< dim, int > &ind, const MathVector< dim > &x) const
shape value for a Multi Index
Definition: lagrange.h:455
void check_index(size_t i) const
checks in debug mode that index is valid
Definition: lagrange.h:557
size_t mapped_index(const MathVector< dim, int > &ind) const
return the index for a multi_index
Definition: lagrange.h:526
void grad(grad_type &g, const MathVector< dim, int > ind, const MathVector< dim > &x) const
evaluates the gradient
Definition: lagrange.h:477
size_t index(const MathVector< dim, int > &ind) const
return the index for a multi_index
Definition: lagrange.h:517
bool position(size_t i, MathVector< dim > &pos) const
local position of DoF i
Definition: lagrange.h:435
base_type::shape_type shape_type
Shape type.
Definition: lagrange.h:409
void grad(grad_type &g, const size_t i, const MathVector< dim > &x) const
evaluates the shape function
Definition: lagrange.h:471
number shape(const size_t i, const MathVector< dim > &x) const
evaluates the shape function
Definition: lagrange.h:448
void check_multi_index(const MathVector< dim, int > &ind) const
checks in debug mode that multi-index is valid
Definition: lagrange.h:563
MathVector< dim, int > mapped_multi_index(size_t i) const
return the multi_index for an index
Definition: lagrange.h:539
BaseLSFS< LagrangeLSFS< ReferenceTriangle, TOrder >, 2 > base_type
base class
Definition: lagrange.h:405
bool continuous() const
returns if space constructs continuous functions
Definition: lagrange.h:429
bool continuous() const
returns if space constructs continuous functions
Definition: lagrange.h:98
bool position(size_t i, MathVector< dim > &pos) const
local position of DoF i
Definition: lagrange.h:104
size_t num_sh() const
Definition: lagrange.h:101
base_type::grad_type grad_type
Gradient type.
Definition: lagrange.h:81
void grad(grad_type &g, size_t i, const MathVector< dim > &x) const
evaluates the gradient of the shape function
Definition: lagrange.h:116
shape_type shape(size_t i, const MathVector< dim > &x) const
evaluates the shape function
Definition: lagrange.h:110
base_type::shape_type shape_type
Shape type.
Definition: lagrange.h:78
BaseLSFS< LagrangeLSFS< ReferenceVertex, TOrder >, 0 > base_type
base class
Definition: lagrange.h:74
LagrangeLSFS()
Constructor.
Definition: lagrange.h:95
Lagrange Shape Function Set without virtual functions and fixed order.
Definition: lagrange.h:48
a mathematical Vector with N entries.
Definition: math_vector.h:97
Definition: polynomial1d.h:51
Definition: reference_element.h:345
static const int dim
dimension of reference element
Definition: reference_element.h:351
reference element for a hexahedron
Definition: reference_element.h:648
static const int dim
dimension of reference element
Definition: reference_element.h:654
Definition: reference_element.h:699
Definition: reference_element.h:595
static const int dim
dimension of reference element
Definition: reference_element.h:601
Definition: reference_element.h:546
Definition: reference_element.h:445
static const int dim
dimension of reference element
Definition: reference_element.h:451
Definition: reference_element.h:494
static const int dim
dimension of reference element
Definition: reference_element.h:500
Definition: reference_element.h:394
static const int dim
dimension of reference element
Definition: reference_element.h:400
Definition: reference_element.h:303
static const int dim
dimension of reference element
Definition: reference_element.h:309
static number position(const size_t i, const size_t degree)
returns the position of the i'th interpolation point
Definition: lagrange1d.h:191
#define UG_ASSERT(expr, msg)
Definition: assert.h:70
#define UG_THROW(msg)
Definition: error.h:57
double number
Definition: types.h:124
int BinomCoeff(int n, int k)
Returns the BinomialCoefficient.
Definition: math_util.cpp:553
const number SMALL
Definition: math_constants.h:41
Definition: metaprogramming_util.h:188