29 #ifndef __BoundaryAdaptedPolynomialSet_H
30 #define __BoundaryAdaptedPolynomialSet_H 1
44 template<uint16_type Dim,
46 template<u
int16_type>
class PolySetType = Scalar,
48 template<u
int16_type,u
int16_type,u
int16_type>
class Convex = Simplex>
49 class BoundaryAdaptedPolynomialSet
52 template<uint16_type Dim,
54 template<u
int16_type>
class PolySetType,
56 class BoundaryAdaptedPolynomialSet<Dim, Order, PolySetType, T, Simplex>
58 public PolynomialSet<BoundaryAdapted<Dim, Order, T>, PolySetType >
60 typedef PolynomialSet<BoundaryAdapted<Dim, Order, T>, PolySetType > super;
63 static const uint16_type nDim = Dim;
64 static const uint16_type nOrder = Order;
66 typedef BoundaryAdaptedPolynomialSet<Dim, Order, PolySetType, T, Simplex> self_type;
67 typedef self_type component_basis_type;
69 typedef typename super::polyset_type polyset_type;
71 static const bool is_continuous =
true;
73 static const bool is_tensor2 = polyset_type::is_tensor2;
74 static const bool is_vectorial = polyset_type::is_vectorial;
75 static const bool is_scalar = polyset_type::is_scalar;
76 static const bool is_modal =
true;
77 static const uint16_type nComponents = polyset_type::nComponents;
78 typedef typename super::component_type component_type;
81 typedef BoundaryAdapted<Dim, Order, T> basis_type;
82 typedef typename basis_type::points_type points_type;
84 typedef Simplex<Dim, Order, Dim> convex_type;
88 typedef Simplex<Dim, O, Dim> type;
90 typedef Reference<convex_type, nDim, nOrder, nDim, value_type> reference_convex_type;
92 typedef typename super::polynomial_type polynomial_type;
95 static const uint16_type nDofPerVertex = convex_type::nbPtsPerVertex;
97 static const uint16_type nDofPerEdge = convex_type::nbPtsPerEdge;
99 static const uint16_type nDofPerFace = convex_type::nbPtsPerFace;
101 static const uint16_type nDofPerVolume = convex_type::nbPtsPerVolume;
103 static const uint16_type nLocalDof = convex_type::numPoints;
105 static const uint16_type nDof = nLocalDof;
106 static const uint16_type nNodes = nDof;
107 static const uint16_type nDofGrad = super::nDim*nDof;
108 static const uint16_type nDofHess = super::nDim*super::nDim*nDof;
110 BoundaryAdaptedPolynomialSet()
112 super( basis_type() )
115 ublas::matrix<value_type> m( ublas::identity_matrix<value_type>( nComponents*convex_type::polyDims( nOrder ) ) );
118 std::cout <<
"[boundaryadaptedpolynomialset] m = " << m <<
"\n";
120 this->setCoefficient( polyset_type::toType( m ),
true );
123 BoundaryAdaptedPolynomialSet<Dim, Order, Scalar,T, Simplex > toScalar()
const
125 return BoundaryAdaptedPolynomialSet<Dim, Order, Scalar,T, Simplex >();
131 std::string familyName()
const
136 points_type
const&
points()
const
138 return this->basis().points();
140 points_type
const&
points(
int f )
const
142 return this->basis().points( f );
146 template<uint16_type Dim,
148 template<u
int16_type>
class PolySetType,
150 const uint16_type BoundaryAdaptedPolynomialSet<Dim, Order, PolySetType,T, Simplex >::nDofPerEdge;
152 template<uint16_type Dim,
154 template<u
int16_type>
class PolySetType,
156 const uint16_type BoundaryAdaptedPolynomialSet<Dim, Order, PolySetType,T, Simplex >::nLocalDof;
159 template<uint16_type Dim,
161 template<u
int16_type>
class PolySetType,
163 class BoundaryAdaptedPolynomialSet<Dim, Order, PolySetType, T, Hypercube>
165 public PolynomialSet<TensorisedBoundaryAdapted<Dim, Order, T>, PolySetType >
167 typedef PolynomialSet<TensorisedBoundaryAdapted<Dim, Order, T>, PolySetType > super;
170 static const uint16_type nDim = Dim;
171 static const uint16_type nOrder = Order;
173 typedef BoundaryAdaptedPolynomialSet<Dim, Order, PolySetType, T, Hypercube> self_type;
174 typedef self_type component_basis_type;
176 typedef typename super::polyset_type polyset_type;
177 static const bool is_continuous =
true;
178 static const bool is_tensor2 = polyset_type::is_tensor2;
179 static const bool is_vectorial = polyset_type::is_vectorial;
180 static const bool is_scalar = polyset_type::is_scalar;
181 static const bool is_modal =
true;
182 static const uint16_type nComponents = polyset_type::nComponents;
183 typedef typename super::component_type component_type;
185 typedef T value_type;
186 typedef TensorisedBoundaryAdapted<Dim, Order, T> basis_type;
187 typedef Hypercube<Dim, Order, Dim> convex_type;
191 typedef Hypercube<Dim, O, Dim> type;
193 typedef Reference<convex_type, nDim, nOrder, nDim, value_type> reference_convex_type;
195 typedef typename super::polynomial_type polynomial_type;
197 typedef typename basis_type::points_type points_type;
201 static const uint16_type nDofPerVertex = convex_type::nbPtsPerVertex;
203 static const uint16_type nDofPerEdge = convex_type::nbPtsPerEdge;
205 static const uint16_type nDofPerFace = convex_type::nbPtsPerFace;
209 static const uint16_type nDofPerVolume = convex_type::nbPtsPerVolume;
216 static const uint16_type nLocalDof = convex_type::numPoints;
219 static const uint16_type nDof = nLocalDof;
220 static const uint16_type nNodes = nDof;
221 static const uint16_type nDofGrad = super::nDim*nDof;
222 static const uint16_type nDofHess = super::nDim*super::nDim*nDof;
224 BoundaryAdaptedPolynomialSet()
226 super( basis_type() )
229 ublas::matrix<value_type> m( ublas::identity_matrix<value_type>( nComponents*convex_type::polyDims( nOrder ) ) );
232 std::cout <<
"[boundaryadaptedpolynomialset] m = " << m <<
"\n";
234 this->setCoefficient( polyset_type::toType( m ),
true );
237 BoundaryAdaptedPolynomialSet<Dim, Order, Scalar,T, Hypercube > toScalar()
const
239 return BoundaryAdaptedPolynomialSet<Dim, Order, Scalar,T, Hypercube >();
245 std::string familyName()
const
247 return "tensorizedba";
250 points_type
const&
points()
const
252 return this->basis().points();
254 points_type
const&
points(
int f )
const
256 return this->basis().points( f );
263 template<uint16_type Order,
264 template<u
int16_type Dim>
class PolySetType = Scalar>
265 class BoundaryAdaptedPolynomialSet
268 template<uint16_type N,
270 typename Convex = Simplex<N> >
273 typedef typename mpl::if_<mpl::bool_<Convex::is_simplex>,
274 mpl::identity<Feel::detail::BoundaryAdaptedPolynomialSet<N,Order,PolySetType,T,Simplex> >,
275 mpl::identity<Feel::detail::
276 BoundaryAdaptedPolynomialSet<N,Order,PolySetType,T,Hypercube> > >::type::type result_type;
277 typedef result_type type;
280 typedef BoundaryAdaptedPolynomialSet<Order,Scalar> component_basis_type;