00001 #ifndef VIENNAFEM_BASES_LINE_HPP
00002 #define VIENNAFEM_BASES_LINE_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_interval,
00043 0,
00044 0>
00045 {
00046 typedef viennamath::rt_expr<InterfaceType> expression_type;
00047
00048 typedef viennamath::ct_binary_expr< viennamath::ct_constant<1>,
00049 viennamath::op_minus<viennafem::numeric_type>,
00050 viennamath::ct_variable<0>
00051 > type;
00052
00053 static expression_type get() { return expression_type(type()); }
00054 };
00055
00057 template <typename InterfaceType, std::size_t order>
00058 struct local_basis <InterfaceType,
00059 viennafem::lagrange_tag<order>,
00060 unit_interval,
00061 0,
00062 1>
00063 {
00064 typedef viennamath::rt_expr<InterfaceType> expression_type;
00065
00066 typedef viennamath::ct_variable<0> type;
00067
00068 static expression_type get() { return expression_type(type()); }
00069 };
00070
00071
00072
00073
00074
00076 template <typename InterfaceType>
00077 struct local_basis <InterfaceType,
00078 viennafem::lagrange_tag<2>,
00079 unit_interval,
00080 1,
00081 0>
00082 {
00083 typedef viennamath::rt_expr<InterfaceType> expression_type;
00084 typedef typename InterfaceType::numeric_type NumericT;
00085
00086 typedef typename local_basis <InterfaceType,
00087 viennafem::lagrange_tag<2>,
00088 unit_interval,
00089 0,
00090 0>::type phi_0;
00091
00092 typedef typename local_basis <InterfaceType,
00093 viennafem::lagrange_tag<2>,
00094 unit_interval,
00095 0,
00096 1>::type phi_1;
00097
00098
00099 typedef viennamath::ct_binary_expr<phi_0,
00100 viennamath::op_mult<NumericT>,
00101 phi_1
00102 > type;
00103
00104 static expression_type get() { return expression_type(type()); }
00105 };
00106
00107
00108
00109
00111 template <typename InterfaceType>
00112 struct local_basis <InterfaceType,
00113 viennafem::lagrange_tag<3>,
00114 unit_interval,
00115 1,
00116 0>
00117 {
00118 typedef viennamath::rt_expr<InterfaceType> expression_type;
00119 typedef typename InterfaceType::numeric_type NumericT;
00120
00121 typedef typename local_basis <InterfaceType,
00122 viennafem::lagrange_tag<3>,
00123 unit_interval,
00124 0,
00125 0>::type phi_0;
00126
00127 typedef typename local_basis <InterfaceType,
00128 viennafem::lagrange_tag<3>,
00129 unit_interval,
00130 0,
00131 1>::type phi_1;
00132
00133
00134 typedef viennamath::ct_binary_expr<phi_0,
00135 viennamath::op_mult<NumericT>,
00136 phi_0
00137 > phi_0_squared;
00138
00139 typedef viennamath::ct_binary_expr<phi_0_squared,
00140 viennamath::op_mult<NumericT>,
00141 phi_1
00142 > type;
00143
00144 static expression_type get() { return expression_type(type()); }
00145 };
00146
00147
00149 template <typename InterfaceType>
00150 struct local_basis <InterfaceType,
00151 viennafem::lagrange_tag<3>,
00152 unit_interval,
00153 1,
00154 1>
00155 {
00156 typedef viennamath::rt_expr<InterfaceType> expression_type;
00157 typedef typename InterfaceType::numeric_type NumericT;
00158
00159 typedef typename local_basis <InterfaceType,
00160 viennafem::lagrange_tag<3>,
00161 unit_interval,
00162 0,
00163 0>::type phi_0;
00164
00165 typedef typename local_basis <InterfaceType,
00166 viennafem::lagrange_tag<3>,
00167 unit_interval,
00168 0,
00169 1>::type phi_1;
00170
00171
00172 typedef viennamath::ct_binary_expr<phi_1,
00173 viennamath::op_mult<NumericT>,
00174 phi_1
00175 > phi_1_squared;
00176
00177 typedef viennamath::ct_binary_expr<phi_0,
00178 viennamath::op_mult<NumericT>,
00179 phi_1_squared
00180 > type;
00181
00182 static expression_type get() { return expression_type(type()); }
00183 };
00184
00185 }
00186
00187 #endif