00001 #ifndef VIENNAFEM_BASES_TRIANGLE_HPP
00002 #define VIENNAFEM_BASES_TRIANGLE_HPP
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include <vector>
00018 #include "viennagrid/topology/triangle.hpp"
00019 #include "viennagrid/topology/tetrahedron.hpp"
00020 #include "viennagrid/forwards.h"
00021 #include "viennamath/expression.hpp"
00022 #include "viennafem/forwards.h"
00023
00028 namespace viennafem
00029 {
00030
00031
00032
00033
00034
00035
00036
00037
00039 template <typename InterfaceType, std::size_t order>
00040 struct local_basis <InterfaceType,
00041 viennafem::lagrange_tag<order>,
00042 unit_triangle,
00043 0,
00044 0>
00045 {
00046 typedef viennamath::rt_expr<InterfaceType> expression_type;
00047
00048 typedef viennamath::ct_binary_expr< viennamath::ct_binary_expr< viennamath::ct_constant<1>,
00049 viennamath::op_minus<viennafem::numeric_type>,
00050 viennamath::ct_variable<0> >,
00051 viennamath::op_minus<viennafem::numeric_type>,
00052 viennamath::ct_variable<1>
00053 > type;
00054
00055 static expression_type get() { return expression_type(type()); }
00056 };
00057
00059 template <typename InterfaceType, std::size_t order>
00060 struct local_basis <InterfaceType,
00061 viennafem::lagrange_tag<order>,
00062 unit_triangle,
00063 0,
00064 1>
00065 {
00066 typedef viennamath::rt_expr<InterfaceType> expression_type;
00067
00068 typedef viennamath::ct_variable<0> type;
00069
00070 static expression_type get() { return expression_type(type()); }
00071 };
00072
00073
00075 template <typename InterfaceType, std::size_t order>
00076 struct local_basis <InterfaceType,
00077 viennafem::lagrange_tag<order>,
00078 unit_triangle,
00079 0,
00080 2>
00081 {
00082 typedef viennamath::rt_expr<InterfaceType> expression_type;
00083
00084 typedef viennamath::ct_variable<1> type;
00085
00086 static expression_type get() { return expression_type(type()); }
00087 };
00088
00089
00090
00091
00092
00093
00095 template <typename InterfaceType>
00096 struct local_basis <InterfaceType,
00097 viennafem::lagrange_tag<2>,
00098 unit_triangle,
00099 1,
00100 0>
00101 {
00102 typedef viennamath::rt_expr<InterfaceType> expression_type;
00103 typedef typename InterfaceType::numeric_type NumericT;
00104
00105 typedef typename local_basis <InterfaceType,
00106 viennafem::lagrange_tag<2>,
00107 unit_triangle,
00108 0,
00109 0>::type phi_0;
00110
00111 typedef typename local_basis <InterfaceType,
00112 viennafem::lagrange_tag<2>,
00113 unit_triangle,
00114 0,
00115 1>::type phi_1;
00116
00117 typedef viennamath::ct_binary_expr<phi_0,
00118 viennamath::op_mult<NumericT>,
00119 phi_1
00120 > type;
00121
00122 static expression_type get() { return expression_type(type()); }
00123 };
00124
00125
00127 template <typename InterfaceType>
00128 struct local_basis <InterfaceType,
00129 viennafem::lagrange_tag<2>,
00130 unit_triangle,
00131 1,
00132 1>
00133 {
00134 typedef viennamath::rt_expr<InterfaceType> expression_type;
00135 typedef typename InterfaceType::numeric_type NumericT;
00136
00137 typedef typename local_basis <InterfaceType,
00138 viennafem::lagrange_tag<2>,
00139 unit_triangle,
00140 0,
00141 0>::type phi_0;
00142
00143 typedef typename local_basis <InterfaceType,
00144 viennafem::lagrange_tag<2>,
00145 unit_triangle,
00146 0,
00147 2>::type phi_1;
00148
00149 typedef viennamath::ct_binary_expr<phi_0,
00150 viennamath::op_mult<NumericT>,
00151 phi_1
00152 > type;
00153
00154 static expression_type get() { return expression_type(type()); }
00155 };
00156
00158 template <typename InterfaceType>
00159 struct local_basis <InterfaceType,
00160 viennafem::lagrange_tag<2>,
00161 unit_triangle,
00162 1,
00163 2>
00164 {
00165 typedef viennamath::rt_expr<InterfaceType> expression_type;
00166 typedef typename InterfaceType::numeric_type NumericT;
00167
00168 typedef typename local_basis <InterfaceType,
00169 viennafem::lagrange_tag<2>,
00170 unit_triangle,
00171 0,
00172 1>::type phi_0;
00173
00174 typedef typename local_basis <InterfaceType,
00175 viennafem::lagrange_tag<2>,
00176 unit_triangle,
00177 0,
00178 2>::type phi_1;
00179
00180
00181 typedef viennamath::ct_binary_expr<phi_0,
00182 viennamath::op_mult<NumericT>,
00183 phi_1
00184 > type;
00185
00186 static expression_type get() { return expression_type(type()); }
00187 };
00188
00189
00190 }
00191
00192 #endif