// explicit instantiations
-template class Function<1>;
-template class Function<2>;
-template class ZeroFunction<1>;
-template class ZeroFunction<2>;
-
-template class ConstantFunction<1>;
-template class ConstantFunction<2>;
+template class Function<deal_II_dimension>;
+template class ZeroFunction<deal_II_dimension>;
+template class ConstantFunction<deal_II_dimension>;
+#if deal_II_dimension == 2
template <>
void QProjector<2>::project_to_face (const Quadrature<1> &quadrature,
};
};
+#endif
-// explicite instantiations
+// explicit instantiations; note: we need them all for all dimensions
template class Quadrature<1>;
template class Quadrature<2>;
#include <cmath>
+// please note: for a given dimension, we need the quadrature formulae
+// for all lower dimensions as well. That is why in this file the check
+// is for deal_II_dimension >= any_number and not for ==
+
+
+
+#if deal_II_dimension >= 1
template <>
QGauss2<1>::QGauss2 () :
template <>
-QGauss2<2>::QGauss2 () :
- Quadrature<2> (4)
+QGauss3<1>::QGauss3 () :
+ Quadrature<1> (3)
{
// points on [-1,1]
- static const double xpts_normal[] = { -sqrt(1./3.), sqrt(1./3.) };
+ static const double xpts_normal[] = { -sqrt(3./5.),
+ 0.,
+ sqrt(3./5.) };
// weights on [-1,1]
- static const double wts_normal[] = { 1., 1. };
+ static const double wts_normal[] = { 5./9.,
+ 8./9.,
+ 5./9. };
- // points and weights on [0,1]^2
+ // points and weights on [0,1]
static const double xpts[] = { (xpts_normal[0]+1)/2.,
- (xpts_normal[0]+1)/2.,
(xpts_normal[1]+1)/2.,
- (xpts_normal[1]+1)/2. };
- static const double ypts[] = { (xpts_normal[0]+1)/2.,
+ (xpts_normal[2]+1)/2. };
+ static const double wts[] = { wts_normal[0]/2.,
+ wts_normal[1]/2.,
+ wts_normal[2]/2. };
+
+ for (unsigned int i=0; i<n_quadrature_points; ++i)
+ {
+ quadrature_points[i] = Point<1>(xpts[i]);
+ weights[i] = wts[i];
+ };
+};
+
+
+template <>
+QGauss4<1>::QGauss4 () :
+ Quadrature<1> (4)
+{
+ // points on [-1,1]
+ static const double xpts_normal[] = { -sqrt(1./7.*(3-4*sqrt(0.3))),
+ -sqrt(1./7.*(3+4*sqrt(0.3))),
+ +sqrt(1./7.*(3-4*sqrt(0.3))),
+ +sqrt(1./7.*(3+4*sqrt(0.3))) };
+ // weights on [-1,1]
+ static const double wts_normal[] = { 1./2. + 1./12.*sqrt(10./3.),
+ 1./2. - 1./12.*sqrt(10./3.),
+ 1./2. + 1./12.*sqrt(10./3.),
+ 1./2. - 1./12.*sqrt(10./3.) };
+
+ // points and weights on [0,1]
+ static const double xpts[] = { (xpts_normal[0]+1)/2.,
(xpts_normal[1]+1)/2.,
- (xpts_normal[0]+1)/2.,
- (xpts_normal[1]+1)/2. };
- static const double wts[] = { wts_normal[0]/4.,
- wts_normal[1]/4.,
- wts_normal[0]/4.,
- wts_normal[1]/4. };
+ (xpts_normal[2]+1)/2.,
+ (xpts_normal[3]+1)/2. };
+ static const double wts[] = { wts_normal[0]/2.,
+ wts_normal[1]/2.,
+ wts_normal[2]/2.,
+ wts_normal[3]/2. };
for (unsigned int i=0; i<n_quadrature_points; ++i)
{
- quadrature_points[i] = Point<2>(xpts[i], ypts[i]);
+ quadrature_points[i] = Point<1>(xpts[i]);
weights[i] = wts[i];
};
};
+template <>
+QGauss5<1>::QGauss5 () :
+ Quadrature<1> (5)
+{
+ // points on [-1,1]
+ static const double xpts_normal[] = { -sqrt(1./9.*(5.-2*sqrt(10./7.))),
+ -sqrt(1./9.*(5.+2*sqrt(10./7.))),
+ 0,
+ +sqrt(1./9.*(5.-2*sqrt(10./7.))),
+ +sqrt(1./9.*(5.+2*sqrt(10./7.))) };
+ // weights on [-1,1]
+ static const double wts_normal[] = { 0.3*(-0.7+5.*sqrt(0.7))/(-2.+5.*sqrt(0.7)),
+ 0.3*(+0.7+5.*sqrt(0.7))/(+2.+5.*sqrt(0.7)),
+ 128./225.,
+ 0.3*(-0.7+5.*sqrt(0.7))/(-2.+5.*sqrt(0.7)),
+ 0.3*(+0.7+5.*sqrt(0.7))/(+2.+5.*sqrt(0.7)) };
+
+ // points and weights on [0,1]
+ static const double xpts[] = { (xpts_normal[0]+1)/2.,
+ (xpts_normal[1]+1)/2.,
+ (xpts_normal[2]+1)/2.,
+ (xpts_normal[3]+1)/2.,
+ (xpts_normal[4]+1)/2. };
+ static const double wts[] = { wts_normal[0]/2.,
+ wts_normal[1]/2.,
+ wts_normal[2]/2.,
+ wts_normal[3]/2.,
+ wts_normal[4]/2. };
+
+ for (unsigned int i=0; i<n_quadrature_points; ++i)
+ {
+ quadrature_points[i] = Point<1>(xpts[i]);
+ weights[i] = wts[i];
+ };
+};
+
template <>
-QGauss3<1>::QGauss3 () :
- Quadrature<1> (3)
+QGauss6<1>::QGauss6 () :
+ Quadrature<1> (6)
{
// points on [-1,1]
- static const double xpts_normal[] = { -sqrt(3./5.),
- 0.,
- sqrt(3./5.) };
+ static const double xpts_normal[] = { -0.932469514203152,
+ -0.661209386466265,
+ -0.238619186083197,
+ +0.238619186083197,
+ +0.661209386466265,
+ +0.932469514203152 };
// weights on [-1,1]
- static const double wts_normal[] = { 5./9.,
- 8./9.,
- 5./9. };
+ static const double wts_normal[] = { 0.171324492379170,
+ 0.360761573048139,
+ 0.467913934572691,
+ 0.467913934572691,
+ 0.360761573048139,
+ 0.171324492379170 };
// points and weights on [0,1]
static const double xpts[] = { (xpts_normal[0]+1)/2.,
(xpts_normal[1]+1)/2.,
- (xpts_normal[2]+1)/2. };
+ (xpts_normal[2]+1)/2.,
+ (xpts_normal[3]+1)/2.,
+ (xpts_normal[4]+1)/2.,
+ (xpts_normal[5]+1)/2. };
static const double wts[] = { wts_normal[0]/2.,
wts_normal[1]/2.,
- wts_normal[2]/2. };
+ wts_normal[2]/2.,
+ wts_normal[3]/2.,
+ wts_normal[4]/2.,
+ wts_normal[5]/2. };
for (unsigned int i=0; i<n_quadrature_points; ++i)
{
template <>
-QGauss3<2>::QGauss3 () :
- Quadrature<2> (9)
+QGauss7<1>::QGauss7 () :
+ Quadrature<1> (7)
{
// points on [-1,1]
- static const double xpts_normal[] = { -sqrt(3./5.),
- 0.,
- sqrt(3./5.) };
+ static const double xpts_normal[] = { -0.949107912342759,
+ -0.741531185599394,
+ -0.405845151377397,
+ 0,
+ +0.405845151377397,
+ +0.741531185599394,
+ +0.949107912342759 };
// weights on [-1,1]
- static const double wts_normal[] = { 5./9.,
- 8./9.,
- 5./9. };
+ static const double wts_normal[] = { 0.129484966168870,
+ 0.279705391489277,
+ 0.381830050505119,
+ 0.417959183673469,
+ 0.381830050505119,
+ 0.279705391489277,
+ 0.129484966168870 };
- // points and weights on [0,1]^2
+ // points and weights on [0,1]
static const double xpts[] = { (xpts_normal[0]+1)/2.,
(xpts_normal[1]+1)/2.,
(xpts_normal[2]+1)/2.,
- (xpts_normal[0]+1)/2.,
+ (xpts_normal[3]+1)/2.,
+ (xpts_normal[4]+1)/2.,
+ (xpts_normal[5]+1)/2.,
+ (xpts_normal[6]+1)/2. };
+ static const double wts[] = { wts_normal[0]/2.,
+ wts_normal[1]/2.,
+ wts_normal[2]/2.,
+ wts_normal[3]/2.,
+ wts_normal[4]/2.,
+ wts_normal[5]/2.,
+ wts_normal[6]/2. };
+
+ for (unsigned int i=0; i<n_quadrature_points; ++i)
+ {
+ quadrature_points[i] = Point<1>(xpts[i]);
+ weights[i] = wts[i];
+ };
+};
+
+
+
+template <>
+QGauss8<1>::QGauss8 () :
+ Quadrature<1> (8)
+{
+ // points on [-1,1]
+ static const double xpts_normal[] = { -0.960289856497536,
+ -0.796666477413627,
+ -0.525532409916329,
+ -0.183434642495650,
+ +0.183434642495650,
+ +0.525532409916329,
+ +0.796666477413627,
+ +0.960289856497536 };
+ // weights on [-1,1]
+ static const double wts_normal[] = { 0.101228536200376,
+ 0.222381034453374,
+ 0.313706645877887,
+ 0.362683783378362,
+ 0.362683783378362,
+ 0.313706645877887,
+ 0.222381034453374,
+ 0.101228536200376 };
+
+ // points and weights on [0,1]
+ static const double xpts[] = { (xpts_normal[0]+1)/2.,
(xpts_normal[1]+1)/2.,
(xpts_normal[2]+1)/2.,
+ (xpts_normal[3]+1)/2.,
+ (xpts_normal[4]+1)/2.,
+ (xpts_normal[5]+1)/2.,
+ (xpts_normal[6]+1)/2.,
+ (xpts_normal[7]+1)/2. };
+ static const double wts[] = { wts_normal[0]/2.,
+ wts_normal[1]/2.,
+ wts_normal[2]/2.,
+ wts_normal[3]/2.,
+ wts_normal[4]/2.,
+ wts_normal[5]/2.,
+ wts_normal[6]/2.,
+ wts_normal[7]/2. };
+
+ for (unsigned int i=0; i<n_quadrature_points; ++i)
+ {
+ quadrature_points[i] = Point<1>(xpts[i]);
+ weights[i] = wts[i];
+ };
+};
+
+
+
+template <>
+QMidpoint<1>::QMidpoint () :
+ Quadrature<1>(1)
+{
+ quadrature_points[0] = Point<1>(0.5);
+ weights[0] = 1.0;
+};
+
+
+
+template <>
+QSimpson<1>::QSimpson () :
+ Quadrature<1> (3)
+{
+ static const double xpts[] = { 0.0, 0.5, 1.0 };
+ static const double wts[] = { 1./6., 2./3., 1./6. };
+
+ for (unsigned int i=0; i<n_quadrature_points; ++i)
+ {
+ quadrature_points[i] = Point<1>(xpts[i]);
+ weights[i] = wts[i];
+ };
+};
+
+
+
+template <>
+QTrapez<1>::QTrapez () :
+ Quadrature<1> (2)
+{
+ static const double xpts[] = { 0.0, 1.0 };
+ static const double wts[] = { 0.5, 0.5 };
+
+ for (unsigned int i=0; i<n_quadrature_points; ++i)
+ {
+ quadrature_points[i] = Point<1>(xpts[i]);
+ weights[i] = wts[i];
+ };
+};
+
+#endif
+
+
+
+#if deal_II_dimension >= 2
+
+template <>
+QGauss2<2>::QGauss2 () :
+ Quadrature<2> (4)
+{
+ // points on [-1,1]
+ static const double xpts_normal[] = { -sqrt(1./3.), sqrt(1./3.) };
+ // weights on [-1,1]
+ static const double wts_normal[] = { 1., 1. };
+
+ // points and weights on [0,1]^2
+ static const double xpts[] = { (xpts_normal[0]+1)/2.,
(xpts_normal[0]+1)/2.,
(xpts_normal[1]+1)/2.,
- (xpts_normal[2]+1)/2. };
+ (xpts_normal[1]+1)/2. };
static const double ypts[] = { (xpts_normal[0]+1)/2.,
- (xpts_normal[0]+1)/2.,
- (xpts_normal[0]+1)/2.,
- (xpts_normal[1]+1)/2.,
- (xpts_normal[1]+1)/2.,
(xpts_normal[1]+1)/2.,
- (xpts_normal[2]+1)/2.,
- (xpts_normal[2]+1)/2.,
- (xpts_normal[2]+1)/2. };
- static const double wts[] = { wts_normal[0]/2.*wts_normal[0]/2.,
- wts_normal[1]/2.*wts_normal[0]/2.,
- wts_normal[2]/2.*wts_normal[0]/2.,
- wts_normal[0]/2.*wts_normal[1]/2.,
- wts_normal[1]/2.*wts_normal[1]/2.,
- wts_normal[2]/2.*wts_normal[1]/2.,
- wts_normal[0]/2.*wts_normal[2]/2.,
- wts_normal[1]/2.*wts_normal[2]/2.,
- wts_normal[2]/2.*wts_normal[2]/2. };
-
+ (xpts_normal[0]+1)/2.,
+ (xpts_normal[1]+1)/2. };
+ static const double wts[] = { wts_normal[0]/4.,
+ wts_normal[1]/4.,
+ wts_normal[0]/4.,
+ wts_normal[1]/4. };
+
for (unsigned int i=0; i<n_quadrature_points; ++i)
{
quadrature_points[i] = Point<2>(xpts[i], ypts[i]);
-
-
-
template <>
-QGauss4<1>::QGauss4 () :
- Quadrature<1> (4)
+QGauss3<2>::QGauss3 () :
+ Quadrature<2> (9)
{
// points on [-1,1]
- static const double xpts_normal[] = { -sqrt(1./7.*(3-4*sqrt(0.3))),
- -sqrt(1./7.*(3+4*sqrt(0.3))),
- +sqrt(1./7.*(3-4*sqrt(0.3))),
- +sqrt(1./7.*(3+4*sqrt(0.3))) };
+ static const double xpts_normal[] = { -sqrt(3./5.),
+ 0.,
+ sqrt(3./5.) };
// weights on [-1,1]
- static const double wts_normal[] = { 1./2. + 1./12.*sqrt(10./3.),
- 1./2. - 1./12.*sqrt(10./3.),
- 1./2. + 1./12.*sqrt(10./3.),
- 1./2. - 1./12.*sqrt(10./3.) };
+ static const double wts_normal[] = { 5./9.,
+ 8./9.,
+ 5./9. };
- // points and weights on [0,1]
+ // points and weights on [0,1]^2
static const double xpts[] = { (xpts_normal[0]+1)/2.,
(xpts_normal[1]+1)/2.,
(xpts_normal[2]+1)/2.,
- (xpts_normal[3]+1)/2. };
- static const double wts[] = { wts_normal[0]/2.,
- wts_normal[1]/2.,
- wts_normal[2]/2.,
- wts_normal[3]/2. };
-
+ (xpts_normal[0]+1)/2.,
+ (xpts_normal[1]+1)/2.,
+ (xpts_normal[2]+1)/2.,
+ (xpts_normal[0]+1)/2.,
+ (xpts_normal[1]+1)/2.,
+ (xpts_normal[2]+1)/2. };
+ static const double ypts[] = { (xpts_normal[0]+1)/2.,
+ (xpts_normal[0]+1)/2.,
+ (xpts_normal[0]+1)/2.,
+ (xpts_normal[1]+1)/2.,
+ (xpts_normal[1]+1)/2.,
+ (xpts_normal[1]+1)/2.,
+ (xpts_normal[2]+1)/2.,
+ (xpts_normal[2]+1)/2.,
+ (xpts_normal[2]+1)/2. };
+ static const double wts[] = { wts_normal[0]/2.*wts_normal[0]/2.,
+ wts_normal[1]/2.*wts_normal[0]/2.,
+ wts_normal[2]/2.*wts_normal[0]/2.,
+ wts_normal[0]/2.*wts_normal[1]/2.,
+ wts_normal[1]/2.*wts_normal[1]/2.,
+ wts_normal[2]/2.*wts_normal[1]/2.,
+ wts_normal[0]/2.*wts_normal[2]/2.,
+ wts_normal[1]/2.*wts_normal[2]/2.,
+ wts_normal[2]/2.*wts_normal[2]/2. };
+
for (unsigned int i=0; i<n_quadrature_points; ++i)
{
- quadrature_points[i] = Point<1>(xpts[i]);
+ quadrature_points[i] = Point<2>(xpts[i], ypts[i]);
weights[i] = wts[i];
};
};
-
-template <>
-QGauss5<1>::QGauss5 () :
- Quadrature<1> (5)
-{
- // points on [-1,1]
- static const double xpts_normal[] = { -sqrt(1./9.*(5.-2*sqrt(10./7.))),
- -sqrt(1./9.*(5.+2*sqrt(10./7.))),
- 0,
- +sqrt(1./9.*(5.-2*sqrt(10./7.))),
- +sqrt(1./9.*(5.+2*sqrt(10./7.))) };
- // weights on [-1,1]
- static const double wts_normal[] = { 0.3*(-0.7+5.*sqrt(0.7))/(-2.+5.*sqrt(0.7)),
- 0.3*(+0.7+5.*sqrt(0.7))/(+2.+5.*sqrt(0.7)),
- 128./225.,
- 0.3*(-0.7+5.*sqrt(0.7))/(-2.+5.*sqrt(0.7)),
- 0.3*(+0.7+5.*sqrt(0.7))/(+2.+5.*sqrt(0.7)) };
-
- // points and weights on [0,1]
- static const double xpts[] = { (xpts_normal[0]+1)/2.,
- (xpts_normal[1]+1)/2.,
- (xpts_normal[2]+1)/2.,
- (xpts_normal[3]+1)/2.,
- (xpts_normal[4]+1)/2. };
- static const double wts[] = { wts_normal[0]/2.,
- wts_normal[1]/2.,
- wts_normal[2]/2.,
- wts_normal[3]/2.,
- wts_normal[4]/2. };
-
- for (unsigned int i=0; i<n_quadrature_points; ++i)
- {
- quadrature_points[i] = Point<1>(xpts[i]);
- weights[i] = wts[i];
- };
-};
-
-
-
template <>
QGauss5<2>::QGauss5 () :
Quadrature<2> (25)
-template <>
-QGauss6<1>::QGauss6 () :
- Quadrature<1> (6)
-{
- // points on [-1,1]
- static const double xpts_normal[] = { -0.932469514203152,
- -0.661209386466265,
- -0.238619186083197,
- +0.238619186083197,
- +0.661209386466265,
- +0.932469514203152 };
- // weights on [-1,1]
- static const double wts_normal[] = { 0.171324492379170,
- 0.360761573048139,
- 0.467913934572691,
- 0.467913934572691,
- 0.360761573048139,
- 0.171324492379170 };
-
- // points and weights on [0,1]
- static const double xpts[] = { (xpts_normal[0]+1)/2.,
- (xpts_normal[1]+1)/2.,
- (xpts_normal[2]+1)/2.,
- (xpts_normal[3]+1)/2.,
- (xpts_normal[4]+1)/2.,
- (xpts_normal[5]+1)/2. };
- static const double wts[] = { wts_normal[0]/2.,
- wts_normal[1]/2.,
- wts_normal[2]/2.,
- wts_normal[3]/2.,
- wts_normal[4]/2.,
- wts_normal[5]/2. };
-
- for (unsigned int i=0; i<n_quadrature_points; ++i)
- {
- quadrature_points[i] = Point<1>(xpts[i]);
- weights[i] = wts[i];
- };
-};
-
-
-
-template <>
-QGauss7<1>::QGauss7 () :
- Quadrature<1> (7)
-{
- // points on [-1,1]
- static const double xpts_normal[] = { -0.949107912342759,
- -0.741531185599394,
- -0.405845151377397,
- 0,
- +0.405845151377397,
- +0.741531185599394,
- +0.949107912342759 };
- // weights on [-1,1]
- static const double wts_normal[] = { 0.129484966168870,
- 0.279705391489277,
- 0.381830050505119,
- 0.417959183673469,
- 0.381830050505119,
- 0.279705391489277,
- 0.129484966168870 };
-
- // points and weights on [0,1]
- static const double xpts[] = { (xpts_normal[0]+1)/2.,
- (xpts_normal[1]+1)/2.,
- (xpts_normal[2]+1)/2.,
- (xpts_normal[3]+1)/2.,
- (xpts_normal[4]+1)/2.,
- (xpts_normal[5]+1)/2.,
- (xpts_normal[6]+1)/2. };
- static const double wts[] = { wts_normal[0]/2.,
- wts_normal[1]/2.,
- wts_normal[2]/2.,
- wts_normal[3]/2.,
- wts_normal[4]/2.,
- wts_normal[5]/2.,
- wts_normal[6]/2. };
-
- for (unsigned int i=0; i<n_quadrature_points; ++i)
- {
- quadrature_points[i] = Point<1>(xpts[i]);
- weights[i] = wts[i];
- };
-};
-
-
-
-template <>
-QGauss8<1>::QGauss8 () :
- Quadrature<1> (8)
-{
- // points on [-1,1]
- static const double xpts_normal[] = { -0.960289856497536,
- -0.796666477413627,
- -0.525532409916329,
- -0.183434642495650,
- +0.183434642495650,
- +0.525532409916329,
- +0.796666477413627,
- +0.960289856497536 };
- // weights on [-1,1]
- static const double wts_normal[] = { 0.101228536200376,
- 0.222381034453374,
- 0.313706645877887,
- 0.362683783378362,
- 0.362683783378362,
- 0.313706645877887,
- 0.222381034453374,
- 0.101228536200376 };
-
- // points and weights on [0,1]
- static const double xpts[] = { (xpts_normal[0]+1)/2.,
- (xpts_normal[1]+1)/2.,
- (xpts_normal[2]+1)/2.,
- (xpts_normal[3]+1)/2.,
- (xpts_normal[4]+1)/2.,
- (xpts_normal[5]+1)/2.,
- (xpts_normal[6]+1)/2.,
- (xpts_normal[7]+1)/2. };
- static const double wts[] = { wts_normal[0]/2.,
- wts_normal[1]/2.,
- wts_normal[2]/2.,
- wts_normal[3]/2.,
- wts_normal[4]/2.,
- wts_normal[5]/2.,
- wts_normal[6]/2.,
- wts_normal[7]/2. };
-
- for (unsigned int i=0; i<n_quadrature_points; ++i)
- {
- quadrature_points[i] = Point<1>(xpts[i]);
- weights[i] = wts[i];
- };
-};
-
-
-
-
-
-
-
-
-
-template <>
-QMidpoint<1>::QMidpoint () :
- Quadrature<1>(1)
-{
- quadrature_points[0] = Point<1>(0.5);
- weights[0] = 1.0;
-};
-
-
-
template <>
QMidpoint<2>::QMidpoint () :
Quadrature<2>(1)
-
-template <>
-QSimpson<1>::QSimpson () :
- Quadrature<1> (3)
-{
- static const double xpts[] = { 0.0, 0.5, 1.0 };
- static const double wts[] = { 1./6., 2./3., 1./6. };
-
- for (unsigned int i=0; i<n_quadrature_points; ++i)
- {
- quadrature_points[i] = Point<1>(xpts[i]);
- weights[i] = wts[i];
- };
-};
-
-
-
template <>
QSimpson<2>::QSimpson () :
Quadrature<2> (9)
-
-
-
-template <>
-QTrapez<1>::QTrapez () :
- Quadrature<1> (2)
-{
- static const double xpts[] = { 0.0, 1.0 };
- static const double wts[] = { 0.5, 0.5 };
-
- for (unsigned int i=0; i<n_quadrature_points; ++i)
- {
- quadrature_points[i] = Point<1>(xpts[i]);
- weights[i] = wts[i];
- };
-};
-
-
-
template <>
QTrapez<2>::QTrapez () :
Quadrature<2> (4)
};
};
-
-
-
+#endif
# If you want your program to be linked with extra object or library
# files, specify them here:
-user-libs = ../../../mia/control.o
+user-libs = ../../../mia/control.o ../../lib/libfe.g.a
# To run the program, use "make run"; to give parameters to the program,
# give the parameters to the following variable:
-
+#if deal_II_dimension == 1
void PoissonEquation<1>::assemble (dFMatrix &cell_matrix,
dVector &rhs,
};
};
+#endif
+
+#if deal_II_dimension == 2
+
void PoissonEquation<2>::assemble (dFMatrix &cell_matrix,
dVector &rhs,
const FEValues<2> &fe_values,
};
};
+#endif
+
template <int dim>
-template class PoissonEquation<1>;
template class PoissonEquation<2>;
# $Id$
# Global options for all compilations
+deal_II_dimension=2
CXX = c++
INCLUDE = -I../../include -I../../../lac/include \
-I../../../base/include -I../../../mia/include
CXXFLAGS.g= -DDEBUG -g -Wall -W -pedantic -Wconversion \
-Winline -Woverloaded-virtual -fno-rtti -fno-exceptions \
- $(INCLUDE)
+ $(INCLUDE) -Ddeal_II_dimension=$(deal_II_dimension)
CXXFLAGS =-O3 -Wuninitialized -finline-functions -ffast-math \
-funroll-loops -felide-constructors -fnonnull-objects \
- -pg -fno-rtti -fno-exceptions $(INCLUDE)
+ -pg -fno-rtti -fno-exceptions $(INCLUDE) \
+ -Ddeal_II_dimension=$(deal_II_dimension)
ifeq ($(shell uname),Linux)
CXX = /home/wolf/bin/gcc/bin/c++
/*------------------------- Functions: DoFLineAccessor -----------------------*/
-template <int dim, class BaseClass>
+template <int dim, typename BaseClass>
int DoFLineAccessor<dim,BaseClass>::dof_index (const unsigned int i) const {
Assert (dof_handler != 0, ExcInvalidObject());
// make sure a FE has been selected
-template <int dim, class BaseClass>
+template <int dim, typename BaseClass>
void DoFLineAccessor<dim,BaseClass>::set_dof_index (const unsigned int i,
const int index) const {
Assert (dof_handler != 0, ExcInvalidObject());
-template <int dim, class BaseClass>
+template <int dim, typename BaseClass>
int DoFLineAccessor<dim,BaseClass>::vertex_dof_index (const unsigned int vertex,
const unsigned int i) const {
Assert (dof_handler != 0, ExcInvalidObject());
-template <int dim, class BaseClass>
+template <int dim, typename BaseClass>
void DoFLineAccessor<dim,BaseClass>::set_vertex_dof_index (const unsigned int vertex,
const unsigned int i,
const int index) const {
-template <int dim, class BaseClass>
+template <int dim, typename BaseClass>
void
DoFLineAccessor<dim,BaseClass>::get_dof_indices (vector<int> &dof_indices) const {
Assert (dof_handler != 0, ExcInvalidObject());
-template <int dim, class BaseClass>
+template <int dim, typename BaseClass>
TriaIterator<dim,DoFLineAccessor<dim,BaseClass> >
DoFLineAccessor<dim,BaseClass>::child (const unsigned int i) const {
TriaIterator<dim,DoFLineAccessor<dim,BaseClass> > q (tria,
-template <int dim, class BaseClass>
+template <int dim, typename BaseClass>
void DoFLineAccessor<dim,BaseClass>::copy_from (const DoFLineAccessor<dim,BaseClass> &a) {
BaseClass::copy_from (a);
set_dof_handler (a.dof_handler);
/*------------------------- Functions: DoFQuadAccessor -----------------------*/
-template <int dim, class BaseClass>
+template <int dim, typename BaseClass>
int DoFQuadAccessor<dim,BaseClass>::dof_index (const unsigned int i) const {
Assert (dof_handler != 0, ExcInvalidObject());
// make sure a FE has been selected
-template <int dim, class BaseClass>
+template <int dim, typename BaseClass>
void DoFQuadAccessor<dim,BaseClass>::set_dof_index (const unsigned int i,
const int index) const {
Assert (dof_handler != 0, ExcInvalidObject());
-template <int dim, class BaseClass>
+template <int dim, typename BaseClass>
int DoFQuadAccessor<dim,BaseClass>::vertex_dof_index (const unsigned int vertex,
const unsigned int i) const {
Assert (dof_handler != 0, ExcInvalidObject());
-template <int dim, class BaseClass>
+template <int dim, typename BaseClass>
void DoFQuadAccessor<dim,BaseClass>::set_vertex_dof_index (const unsigned int vertex,
const unsigned int i,
const int index) const {
-template <int dim, class BaseClass>
+template <int dim, typename BaseClass>
void
DoFQuadAccessor<dim,BaseClass>::get_dof_indices (vector<int> &dof_indices) const {
Assert (dof_handler != 0, ExcInvalidObject());
-template <int dim, class BaseClass>
+template <int dim, typename BaseClass>
TriaIterator<dim,DoFLineAccessor<dim,LineAccessor<dim> > >
DoFQuadAccessor<dim,BaseClass>::line (const unsigned int i) const {
Assert (i<4, ExcInvalidIndex (i, 0, 4));
-template <int dim, class BaseClass>
+template <int dim, typename BaseClass>
TriaIterator<dim,DoFQuadAccessor<dim,BaseClass> >
DoFQuadAccessor<dim,BaseClass>::child (const unsigned int i) const {
TriaIterator<dim,DoFQuadAccessor<dim,BaseClass> > q (tria,
-template <int dim, class BaseClass>
+template <int dim, typename BaseClass>
void DoFQuadAccessor<dim,BaseClass>::copy_from (const DoFQuadAccessor<dim,BaseClass> &a) {
BaseClass::copy_from (a);
set_dof_handler (a.dof_handler);
+#if deal_II_dimension == 1
template <>
DoFSubstructAccessor<1>::face_iterator
-template <>
-DoFSubstructAccessor<2>::face_iterator
-DoFCellAccessor<2>::face (const unsigned int i) const {
- return line(i);
-};
-
-
-
template <>
void
DoFCellAccessor<1>::get_dof_values (const dVector &values,
*next_dof_value++ = values(dof_index(d));
};
+#endif
+
+
+
+#if deal_II_dimension == 2
+
+template <>
+DoFSubstructAccessor<2>::face_iterator
+DoFCellAccessor<2>::face (const unsigned int i) const {
+ return line(i);
+};
*next_dof_value++ = values(dof_index(d));
};
-
+#endif
// explicit instantiations
+#if deal_II_dimension == 1
template class DoFLineAccessor<1,CellAccessor<1> >;
template class DoFCellAccessor<1>;
+template class TriaRawIterator<1,DoFCellAccessor<1> >;
+template class TriaIterator<1,DoFCellAccessor<1> >;
+template class TriaActiveIterator<1,DoFCellAccessor<1> >;
+#endif
+
+#if deal_II_dimension == 2
template class DoFLineAccessor<2,LineAccessor<2> >;
template class DoFQuadAccessor<2,QuadAccessor<2> >;
template class DoFQuadAccessor<2,CellAccessor<2> >;
template class DoFCellAccessor<2>;
-template class TriaRawIterator<1,DoFCellAccessor<1> >;
template class TriaRawIterator<2,DoFLineAccessor<2,LineAccessor<2> > >;
template class TriaRawIterator<2,DoFCellAccessor<2> >;
-
-template class TriaIterator<1,DoFCellAccessor<1> >;
template class TriaIterator<2,DoFLineAccessor<2,LineAccessor<2> > >;
template class TriaIterator<2,DoFCellAccessor<2> >;
-
-template class TriaActiveIterator<1,DoFCellAccessor<1> >;
template class TriaActiveIterator<2,DoFLineAccessor<2,LineAccessor<2> > >;
template class TriaActiveIterator<2,DoFCellAccessor<2> >;
+#endif
+
+
template <int dim>
DoFHandler<dim>::DoFHandler (Triangulation<dim> *tria) :
tria(tria),
+
+#if deal_II_dimension == 1
+
template <>
DoFHandler<1>::raw_cell_iterator
DoFHandler<1>::begin_raw (const unsigned int level) const {
-
-
template <>
-DoFHandler<2>::raw_cell_iterator
-DoFHandler<2>::begin_raw (const unsigned int level) const {
- return begin_raw_quad (level);
+DoFDimensionInfo<1>::raw_face_iterator
+DoFHandler<1>::begin_raw_face (const unsigned int) const {
+ Assert (false, ExcFunctionNotUseful());
+ return 0;
};
template <>
-DoFHandler<2>::cell_iterator
-DoFHandler<2>::begin (const unsigned int level) const {
- return begin_quad (level);
+DoFDimensionInfo<1>::face_iterator
+DoFHandler<1>::begin_face (const unsigned int) const {
+ Assert (false, ExcFunctionNotUseful());
+ return 0;
};
template <>
-DoFHandler<2>::active_cell_iterator
-DoFHandler<2>::begin_active (const unsigned int level) const {
- return begin_active_quad (level);
+DoFDimensionInfo<1>::active_face_iterator
+DoFHandler<1>::begin_active_face (const unsigned int) const {
+ Assert (false, ExcFunctionNotUseful());
+ return 0;
};
template <>
-DoFHandler<2>::raw_cell_iterator
-DoFHandler<2>::end () const {
- return end_quad ();
+DoFDimensionInfo<1>::raw_face_iterator
+DoFHandler<1>::end_face () const {
+ Assert (false, ExcFunctionNotUseful());
+ return 0;
};
template <>
-DoFHandler<2>::raw_cell_iterator
-DoFHandler<2>::last_raw () const {
- return last_raw_quad ();
+DoFDimensionInfo<1>::raw_face_iterator
+DoFHandler<1>::last_raw_face () const {
+ Assert (false, ExcFunctionNotUseful());
+ return 0;
};
template <>
-DoFHandler<2>::raw_cell_iterator
-DoFHandler<2>::last_raw (const unsigned int level) const {
- return last_raw_quad (level);
+DoFDimensionInfo<1>::raw_face_iterator
+DoFHandler<1>::last_raw_face (const unsigned int) const {
+ Assert (false, ExcFunctionNotUseful());
+ return 0;
};
template <>
-DoFHandler<2>::cell_iterator
-DoFHandler<2>::last () const {
- return last_quad ();
+DoFDimensionInfo<1>::face_iterator
+DoFHandler<1>::last_face () const {
+ Assert (false, ExcFunctionNotUseful());
+ return 0;
};
template <>
-DoFHandler<2>::cell_iterator
-DoFHandler<2>::last (const unsigned int level) const {
- return last_quad (level);
+DoFDimensionInfo<1>::face_iterator
+DoFHandler<1>::last_face (const unsigned int) const {
+ Assert (false, ExcFunctionNotUseful());
+ return 0;
};
template <>
-DoFHandler<2>::active_cell_iterator
-DoFHandler<2>::last_active () const {
- return last_active_quad ();
+DoFDimensionInfo<1>::active_face_iterator
+DoFHandler<1>::last_active_face () const {
+ Assert (false, ExcFunctionNotUseful());
+ return 0;
};
template <>
-DoFHandler<2>::active_cell_iterator
-DoFHandler<2>::last_active (const unsigned int level) const {
- return last_active_quad (level);
+DoFDimensionInfo<1>::active_face_iterator
+DoFHandler<1>::last_active_face (const unsigned int) const {
+ Assert (false, ExcFunctionNotUseful());
+ return 0;
};
-//------------------------------------------------------------------
+template <>
+DoFHandler<1>::raw_quad_iterator
+DoFHandler<1>::begin_raw_quad (const unsigned int) const {
+ Assert (false, ExcNotImplemented());
+ return 0;
+};
template <>
-DoFDimensionInfo<1>::raw_face_iterator
-DoFHandler<1>::begin_raw_face (const unsigned int) const {
- Assert (false, ExcFunctionNotUseful());
+DoFHandler<1>::quad_iterator
+DoFHandler<1>::begin_quad (const unsigned int) const {
+ Assert (false, ExcNotImplemented());
return 0;
};
template <>
-DoFDimensionInfo<1>::face_iterator
-DoFHandler<1>::begin_face (const unsigned int) const {
- Assert (false, ExcFunctionNotUseful());
+DoFHandler<1>::active_quad_iterator
+DoFHandler<1>::begin_active_quad (const unsigned int) const {
+ Assert (false, ExcNotImplemented());
return 0;
};
template <>
-DoFDimensionInfo<1>::active_face_iterator
-DoFHandler<1>::begin_active_face (const unsigned int) const {
- Assert (false, ExcFunctionNotUseful());
+DoFHandler<1>::raw_quad_iterator
+DoFHandler<1>::end_quad () const {
+ Assert (false, ExcNotImplemented());
return 0;
};
template <>
-DoFDimensionInfo<1>::raw_face_iterator
-DoFHandler<1>::end_face () const {
- Assert (false, ExcFunctionNotUseful());
+DoFHandler<1>::raw_quad_iterator
+DoFHandler<1>::last_raw_quad (const unsigned int) const {
+ Assert (false, ExcNotImplemented());
return 0;
};
-
template <>
-DoFDimensionInfo<1>::raw_face_iterator
-DoFHandler<1>::last_raw_face () const {
- Assert (false, ExcFunctionNotUseful());
+DoFHandler<1>::quad_iterator
+DoFHandler<1>::last_quad (const unsigned int) const {
+ Assert (false, ExcNotImplemented());
return 0;
};
template <>
-DoFDimensionInfo<1>::raw_face_iterator
-DoFHandler<1>::last_raw_face (const unsigned int) const {
- Assert (false, ExcFunctionNotUseful());
+DoFHandler<1>::active_quad_iterator
+DoFHandler<1>::last_active_quad (const unsigned int) const {
+ Assert (false, ExcNotImplemented());
return 0;
};
template <>
-DoFDimensionInfo<1>::face_iterator
-DoFHandler<1>::last_face () const {
- Assert (false, ExcFunctionNotUseful());
+DoFHandler<1>::raw_quad_iterator
+DoFHandler<1>::last_raw_quad () const {
+ Assert (false, ExcNotImplemented());
return 0;
};
template <>
-DoFDimensionInfo<1>::face_iterator
-DoFHandler<1>::last_face (const unsigned int) const {
- Assert (false, ExcFunctionNotUseful());
+DoFHandler<1>::quad_iterator
+DoFHandler<1>::last_quad () const {
+ Assert (false, ExcNotImplemented());
return 0;
};
template <>
-DoFDimensionInfo<1>::active_face_iterator
-DoFHandler<1>::last_active_face () const {
- Assert (false, ExcFunctionNotUseful());
+DoFHandler<1>::active_quad_iterator
+DoFHandler<1>::last_active_quad () const {
+ Assert (false, ExcNotImplemented());
return 0;
};
+#endif
+
+#if deal_II_dimension == 2
template <>
-DoFDimensionInfo<1>::active_face_iterator
-DoFHandler<1>::last_active_face (const unsigned int) const {
- Assert (false, ExcFunctionNotUseful());
- return 0;
+DoFHandler<2>::raw_cell_iterator
+DoFHandler<2>::begin_raw (const unsigned int level) const {
+ return begin_raw_quad (level);
+};
+
+
+
+template <>
+DoFHandler<2>::cell_iterator
+DoFHandler<2>::begin (const unsigned int level) const {
+ return begin_quad (level);
+};
+
+
+
+template <>
+DoFHandler<2>::active_cell_iterator
+DoFHandler<2>::begin_active (const unsigned int level) const {
+ return begin_active_quad (level);
};
+template <>
+DoFHandler<2>::raw_cell_iterator
+DoFHandler<2>::end () const {
+ return end_quad ();
+};
+
+
+
+template <>
+DoFHandler<2>::raw_cell_iterator
+DoFHandler<2>::last_raw () const {
+ return last_raw_quad ();
+};
+
+
+
+template <>
+DoFHandler<2>::raw_cell_iterator
+DoFHandler<2>::last_raw (const unsigned int level) const {
+ return last_raw_quad (level);
+};
+
+
+
+template <>
+DoFHandler<2>::cell_iterator
+DoFHandler<2>::last () const {
+ return last_quad ();
+};
+
+
+
+template <>
+DoFHandler<2>::cell_iterator
+DoFHandler<2>::last (const unsigned int level) const {
+ return last_quad (level);
+};
+
+
+
+template <>
+DoFHandler<2>::active_cell_iterator
+DoFHandler<2>::last_active () const {
+ return last_active_quad ();
+};
+
+
+
+template <>
+DoFHandler<2>::active_cell_iterator
+DoFHandler<2>::last_active (const unsigned int level) const {
+ return last_active_quad (level);
+};
template <>
return last_active_line (level);
};
+#endif
-// ---------------------------------------------------------------
-
template <int dim>
-template <>
-DoFHandler<1>::raw_quad_iterator
-DoFHandler<1>::begin_raw_quad (const unsigned int) const {
- Assert (false, ExcNotImplemented());
- return 0;
-};
-
-
-
template <int dim>
typename DoFHandler<dim>::raw_quad_iterator
DoFHandler<dim>::begin_raw_quad (const unsigned int level) const {
-template <>
-DoFHandler<1>::quad_iterator
-DoFHandler<1>::begin_quad (const unsigned int) const {
- Assert (false, ExcNotImplemented());
- return 0;
-};
-
-
-
template <int dim>
typename DoFHandler<dim>::quad_iterator
DoFHandler<dim>::begin_quad (const unsigned int level) const {
-template <>
-DoFHandler<1>::active_quad_iterator
-DoFHandler<1>::begin_active_quad (const unsigned int) const {
- Assert (false, ExcNotImplemented());
- return 0;
-};
-
-
-
template <int dim>
typename DoFHandler<dim>::active_quad_iterator
DoFHandler<dim>::begin_active_quad (const unsigned int level) const {
-template <>
-DoFHandler<1>::raw_quad_iterator
-DoFHandler<1>::end_quad () const {
- Assert (false, ExcNotImplemented());
- return 0;
-};
-
-
-
template <int dim>
typename DoFHandler<dim>::raw_quad_iterator
DoFHandler<dim>::end_quad () const {
-
template <int dim>
typename DoFHandler<dim>::raw_line_iterator
DoFHandler<dim>::last_raw_line (const unsigned int level) const {
-template <>
-DoFHandler<1>::raw_quad_iterator
-DoFHandler<1>::last_raw_quad (const unsigned int) const {
- Assert (false, ExcNotImplemented());
- return 0;
-};
-
-
template <int dim>
typename DoFHandler<dim>::raw_quad_iterator
DoFHandler<dim>::last_raw_quad (const unsigned int level) const {
-template <>
-DoFHandler<1>::quad_iterator
-DoFHandler<1>::last_quad (const unsigned int) const {
- Assert (false, ExcNotImplemented());
- return 0;
-};
-
-
-
template <int dim>
typename DoFHandler<dim>::quad_iterator
DoFHandler<dim>::last_quad (const unsigned int level) const {
-template <>
-DoFHandler<1>::active_quad_iterator
-DoFHandler<1>::last_active_quad (const unsigned int) const {
- Assert (false, ExcNotImplemented());
- return 0;
-};
-
-
-
template <int dim>
typename DoFHandler<dim>::active_quad_iterator
DoFHandler<dim>::last_active_quad (const unsigned int level) const {
-template <>
-DoFHandler<1>::raw_quad_iterator
-DoFHandler<1>::last_raw_quad () const {
- Assert (false, ExcNotImplemented());
- return 0;
-};
-
-
-
template <int dim>
typename DoFHandler<dim>::raw_quad_iterator
DoFHandler<dim>::last_raw_quad () const {
-template <>
-DoFHandler<1>::quad_iterator
-DoFHandler<1>::last_quad () const {
- Assert (false, ExcNotImplemented());
- return 0;
-};
-
-
-
template <int dim>
typename DoFHandler<dim>::quad_iterator
DoFHandler<dim>::last_quad () const {
-template <>
-DoFHandler<1>::active_quad_iterator
-DoFHandler<1>::last_active_quad () const {
- Assert (false, ExcNotImplemented());
- return 0;
-};
-
-
-
template <int dim>
typename DoFHandler<dim>::active_quad_iterator
DoFHandler<dim>::last_active_quad () const {
+//------------------------------------------------------------------
+
+
+
+
+
+
template <int dim>
unsigned int DoFHandler<dim>::n_dofs () const {
+#if deal_II_dimension == 1
+
template <>
unsigned int DoFHandler<1>::n_boundary_dofs () const {
Assert (selected_fe != 0, ExcNoFESelected());
+template <>
+unsigned int DoFHandler<1>::n_boundary_dofs (const FunctionMap &) const {
+ Assert (selected_fe != 0, ExcNoFESelected());
+ Assert (false, ExcNotImplemented());
+ return 0;
+};
+
+#endif
+
+
+
+
+
template <int dim>
unsigned int DoFHandler<dim>::n_boundary_dofs () const {
Assert (selected_fe != 0, ExcNoFESelected());
-template <>
-unsigned int DoFHandler<1>::n_boundary_dofs (const FunctionMap &) const {
- Assert (selected_fe != 0, ExcNoFESelected());
- Assert (false, ExcNotImplemented());
- return 0;
-};
-
-
template <int dim>
unsigned int DoFHandler<dim>::n_boundary_dofs (const FunctionMap &boundary_indicators) const {
Assert (selected_fe != 0, ExcNoFESelected());
+#if deal_II_dimension == 1
+
template <>
unsigned int DoFHandler<1>::distribute_dofs_on_cell (active_cell_iterator &cell,
unsigned int next_free_dof) {
return next_free_dof;
};
+#endif
+#if deal_II_dimension == 2
template <>
unsigned int DoFHandler<2>::distribute_dofs_on_cell (active_cell_iterator &cell,
return next_free_dof;
};
+#endif
+
template <int dim>
};
+#if deal_II_dimension == 1
template <>
void DoFHandler<1>::do_renumbering (const vector<int> &new_numbers) {
*i = new_numbers[*i];
};
+#endif
+#if deal_II_dimension == 2
+
template <>
void DoFHandler<2>::do_renumbering (const vector<int> &new_numbers) {
for (vector<int>::iterator i=vertex_dofs.begin(); i!=vertex_dofs.end(); ++i)
};
};
+#endif
+#if deal_II_dimension == 1
template <>
void DoFHandler<1>::make_constraint_matrix (ConstraintMatrix &cm) const {
cm.close ();
};
+#endif
-
+
+
+#if deal_II_dimension == 2
template <>
void DoFHandler<2>::make_constraint_matrix (ConstraintMatrix &constraints) const {
constraints.close ();
};
+#endif
};
+#if deal_II_dimension == 1
template <>
void DoFHandler<1>::make_boundary_sparsity_pattern (const vector<int> &,
+template <>
+void DoFHandler<1>::make_boundary_sparsity_pattern (const FunctionMap &,
+ const vector<int> &,
+ dSMatrixStruct &) const {
+ Assert (selected_fe != 0, ExcNoFESelected());
+ Assert (false, ExcInternalError());
+};
+
+#endif
+
+
+
template <int dim>
void DoFHandler<dim>::make_boundary_sparsity_pattern (const vector<int> &dof_to_boundary_mapping,
dSMatrixStruct &sparsity) const {
-template <>
-void DoFHandler<1>::make_boundary_sparsity_pattern (const FunctionMap &,
- const vector<int> &,
- dSMatrixStruct &) const {
- Assert (selected_fe != 0, ExcNoFESelected());
- Assert (false, ExcInternalError());
-};
-
-
-
template <int dim>
void DoFHandler<dim>::make_boundary_sparsity_pattern (const FunctionMap &boundary_indicators,
const vector<int> &dof_to_boundary_mapping,
+#if deal_II_dimension == 1
template <>
unsigned int DoFHandler<1>::max_couplings_between_dofs () const {
+template <>
+unsigned int DoFHandler<1>::max_couplings_between_boundary_dofs () const {
+ Assert (selected_fe != 0, ExcNoFESelected());
+ Assert (false, ExcInternalError());
+ return 0;
+};
+
+
+
+template <>
+unsigned int DoFHandler<1>::max_transfer_entries (const unsigned int max_level_diff) const {
+ Assert (max_level_diff<2, ExcOnlyOnelevelTransferImplemented());
+ switch (max_level_diff)
+ {
+ case 0:
+ return 1;
+ case 1:
+ return (2*selected_fe->dofs_per_line+
+ selected_fe->dofs_per_vertex) * 2 + 1;
+ };
+ return 0;
+};
+
+#endif
+
+
+
+#if deal_II_dimension == 2
+
template <>
unsigned int DoFHandler<2>::max_couplings_between_dofs () const {
Assert (selected_fe != 0, ExcNoFESelected());
-template <>
-unsigned int DoFHandler<1>::max_couplings_between_boundary_dofs () const {
- Assert (selected_fe != 0, ExcNoFESelected());
- Assert (false, ExcInternalError());
- return 0;
-};
-
-
-
template <>
unsigned int DoFHandler<2>::max_couplings_between_boundary_dofs () const {
Assert (selected_fe != 0, ExcNoFESelected());
-
-template <>
-unsigned int DoFHandler<1>::max_transfer_entries (const unsigned int max_level_diff) const {
- Assert (max_level_diff<2, ExcOnlyOnelevelTransferImplemented());
- switch (max_level_diff)
- {
- case 0:
- return 1;
- case 1:
- return (2*selected_fe->dofs_per_line+
- selected_fe->dofs_per_vertex) * 2 + 1;
- };
- return 0;
-};
-
-
-
template <>
unsigned int DoFHandler<2>::max_transfer_entries (const unsigned int max_level_diff) const {
Assert (max_level_diff<2, ExcOnlyOnelevelTransferImplemented());
return 0;
};
+#endif
+
+
+
template <int dim>
+#if deal_II_dimension == 1
+
template <>
void DoFHandler<1>::map_dof_to_boundary_indices (vector<int> &) const {
Assert (selected_fe != 0, ExcNoFESelected());
+template <>
+void DoFHandler<1>::map_dof_to_boundary_indices (const FunctionMap &,
+ vector<int> &) const {
+ Assert (selected_fe != 0, ExcNoFESelected());
+ Assert (false, ExcNotImplemented());
+};
+
+#endif
+
+
+
template <int dim>
void DoFHandler<dim>::map_dof_to_boundary_indices (vector<int> &mapping) const {
Assert (selected_fe != 0, ExcNoFESelected());
-template <>
-void DoFHandler<1>::map_dof_to_boundary_indices (const FunctionMap &,
- vector<int> &) const {
- Assert (selected_fe != 0, ExcNoFESelected());
- Assert (false, ExcNotImplemented());
-};
-
-
-
template <int dim>
void DoFHandler<dim>::map_dof_to_boundary_indices (const FunctionMap &boundary_indicators,
vector<int> &mapping) const {
-
+#if deal_II_dimension == 1
template <>
void DoFHandler<1>::reserve_space () {
};
};
+#endif
+#if deal_II_dimension == 2
+
template <>
void DoFHandler<2>::reserve_space () {
Assert (selected_fe != 0, ExcNoFESelected());
};
};
-
+#endif
/*-------------- Explicit Instantiations -------------------------------*/
-template class DoFHandler<1>;
-template class DoFHandler<2>;
+template class DoFHandler<deal_II_dimension>;
/*------------------------------- FiniteElementData ----------------------*/
+#if deal_II_dimension == 1
bool FiniteElementData<1>::operator== (const FiniteElementData<1> &f) const {
return ((dofs_per_vertex == f.dofs_per_vertex) &&
(total_dofs == f.total_dofs));
};
+#endif
+
+#if deal_II_dimension == 2
+
bool FiniteElementData<2>::operator== (const FiniteElementData<2> &f) const {
return ((dofs_per_vertex == f.dofs_per_vertex) &&
(dofs_per_line == f.dofs_per_line) &&
(total_dofs == f.total_dofs));
};
-
+#endif
/*------------------------------- FiniteElementBase ----------------------*/
-
+#if deal_II_dimension == 1
template <>
FiniteElementBase<1>::FiniteElementBase (const unsigned int dofs_per_vertex,
interface_constraints(0,0)=1.;
};
+#endif
+
+#if deal_II_dimension == 2
template <>
FiniteElementBase<2>::FiniteElementBase (const unsigned int dofs_per_vertex,
2*dofs_per_vertex+dofs_per_line);
};
+#endif
+
template <int dim>
// egcs wants this, but gcc2.8.1 produces an internal compiler error, so
// we drop this declaration again for the time being
+#if deal_II_dimension == 1
+
//template <>
//void FiniteElement<1>::get_ansatz_points (const DoFHandler<1>::cell_iterator &cell,
// const Boundary<1> &,
};
-template <int dim>
-void FiniteElement<dim>::fill_fe_values (const DoFHandler<dim>::cell_iterator &,
- const vector<Point<dim> > &,
- vector<dFMatrix> &,
- const bool,
- vector<Point<dim> > &,
- const bool,
- vector<Point<dim> > &,
- const bool,
- const Boundary<dim> &) const {
- Assert (false, ExcPureFunctionCalled());
-};
-
-
template <>
void FiniteElement<1>::fill_fe_face_values (const DoFHandler<1>::cell_iterator &,
};
+template <>
+void FiniteElement<1>::fill_fe_subface_values (const DoFHandler<1>::cell_iterator &,
+ const unsigned int ,
+ const unsigned int ,
+ const vector<Point<0> > &,
+ const vector<Point<1> > &,
+ vector<dFMatrix> &,
+ const bool ,
+ vector<Point<1> > &,
+ const bool ,
+ vector<double> &,
+ const bool ,
+ vector<Point<1> > &,
+ const bool,
+ const Boundary<1> &) const {
+ Assert (false, ExcNotImplemented());
+};
+
+
+
+template <>
+void FiniteElement<1>::get_ansatz_points (const DoFHandler<1>::cell_iterator &cell,
+ const Boundary<1> &,
+ vector<Point<1> > &ansatz_points) const {
+ Assert (ansatz_points.size() == total_dofs,
+ ExcWrongFieldDimension(ansatz_points.size(), total_dofs));
+ // compute ansatz points. The first ones
+ // belong to vertex one, the second ones
+ // to vertex two, all following are
+ // equally spaced along the line
+ unsigned int next = 0;
+ // local mesh width
+ const double h=(cell->vertex(1)(0) - cell->vertex(0)(0));
+ // first the dofs in the vertices
+ for (unsigned int vertex=0; vertex<2; vertex++)
+ for (unsigned int i=0; i<dofs_per_vertex; ++i)
+ ansatz_points[next++] = cell->vertex(vertex);
+
+ // now dofs on line
+ for (unsigned int i=0; i<dofs_per_line; ++i)
+ ansatz_points[next++] = cell->vertex(0) +
+ Point<1>((i+1.0)/(total_dofs+1.0)*h);
+};
+
+#endif
+
+
+
+template <int dim>
+void FiniteElement<dim>::fill_fe_values (const DoFHandler<dim>::cell_iterator &,
+ const vector<Point<dim> > &,
+ vector<dFMatrix> &,
+ const bool,
+ vector<Point<dim> > &,
+ const bool,
+ vector<Point<dim> > &,
+ const bool,
+ const Boundary<dim> &) const {
+ Assert (false, ExcPureFunctionCalled());
+};
+
+
template <int dim>
void FiniteElement<dim>::fill_fe_face_values (const DoFHandler<dim>::cell_iterator &cell,
-template <>
-void FiniteElement<1>::fill_fe_subface_values (const DoFHandler<1>::cell_iterator &,
- const unsigned int ,
- const unsigned int ,
- const vector<Point<0> > &,
- const vector<Point<1> > &,
- vector<dFMatrix> &,
- const bool ,
- vector<Point<1> > &,
- const bool ,
- vector<double> &,
- const bool ,
- vector<Point<1> > &,
- const bool,
- const Boundary<1> &) const {
- Assert (false, ExcNotImplemented());
-};
-
-
-
template <int dim>
void FiniteElement<dim>::fill_fe_subface_values (const DoFHandler<dim>::cell_iterator &cell,
const unsigned int face_no,
-
-template <>
-void FiniteElement<1>::get_ansatz_points (const DoFHandler<1>::cell_iterator &cell,
- const Boundary<1> &,
- vector<Point<1> > &ansatz_points) const {
- Assert (ansatz_points.size() == total_dofs,
- ExcWrongFieldDimension(ansatz_points.size(), total_dofs));
- // compute ansatz points. The first ones
- // belong to vertex one, the second ones
- // to vertex two, all following are
- // equally spaced along the line
- unsigned int next = 0;
- // local mesh width
- const double h=(cell->vertex(1)(0) - cell->vertex(0)(0));
- // first the dofs in the vertices
- for (unsigned int vertex=0; vertex<2; vertex++)
- for (unsigned int i=0; i<dofs_per_vertex; ++i)
- ansatz_points[next++] = cell->vertex(vertex);
-
- // now dofs on line
- for (unsigned int i=0; i<dofs_per_line; ++i)
- ansatz_points[next++] = cell->vertex(0) +
- Point<1>((i+1.0)/(total_dofs+1.0)*h);
-};
-
-
-
template <int dim>
void FiniteElement<dim>::get_ansatz_points (const DoFHandler<dim>::cell_iterator &,
const Boundary<dim> &,
/*------------------------------- Explicit Instantiations -------------*/
-template class FiniteElementData<1>;
-template class FiniteElementData<2>;
-
-template class FiniteElementBase<1>;
-template class FiniteElementBase<2>;
-
-template class FiniteElement<1>;
-template class FiniteElement<2>;
-
+template class FiniteElementData<deal_II_dimension>;
+template class FiniteElementBase<deal_II_dimension>;
+template class FiniteElement<deal_II_dimension>;
#include <algorithm>
+#if deal_II_dimension == 1
template <>
FELinear<1>::FELinear () :
template <>
+inline
Point<1>
FELinear<1>::shape_grad(const unsigned int i,
const Point<1>&) const
local_mass_matrix(0,1) = local_mass_matrix(1,0) = 1./6.*h;
};
+#endif
+
+
+#if deal_II_dimension == 2
+
template <>
FELinear<2>::FELinear () :
FiniteElement<2> (1, 0, 0)
template <>
+inline
Point<2>
FELinear<2>::shape_grad (const unsigned int i,
const Point<2>& p) const
+template <>
+void FELinear<2>::get_face_jacobians (const DoFHandler<2>::face_iterator &face,
+ const Boundary<2> &,
+ const vector<Point<1> > &unit_points,
+ vector<double> &face_jacobians) const {
+ Assert (unit_points.size() == face_jacobians.size(),
+ ExcWrongFieldDimension (unit_points.size(), face_jacobians.size()));
+
+ // a linear mapping for a single line
+ // produces particularly simple
+ // expressions for the jacobi
+ // determinant :-)
+ const double h = sqrt((face->vertex(1) - face->vertex(0)).square());
+ fill_n (face_jacobians.begin(),
+ unit_points.size(),
+ h);
+};
+
+
+
+template <>
+void FELinear<2>::get_subface_jacobians (const DoFHandler<2>::face_iterator &face,
+ const unsigned int,
+ const vector<Point<1> > &unit_points,
+ vector<double> &face_jacobians) const {
+ Assert (unit_points.size() == face_jacobians.size(),
+ ExcWrongFieldDimension (unit_points.size(), face_jacobians.size()));
+ Assert (face->at_boundary() == false,
+ ExcBoundaryFaceUsed ());
+
+ // a linear mapping for a single line
+ // produces particularly simple
+ // expressions for the jacobi
+ // determinant :-)
+ const double h = sqrt((face->vertex(1) - face->vertex(0)).square());
+ fill_n (face_jacobians.begin(),
+ unit_points.size(),
+ h/2);
+};
+
+
+
+template <>
+void FELinear<2>::get_normal_vectors (const DoFHandler<2>::cell_iterator &cell,
+ const unsigned int face_no,
+ const Boundary<2> &,
+ const vector<Point<1> > &unit_points,
+ vector<Point<2> > &normal_vectors) const {
+ Assert (unit_points.size() == normal_vectors.size(),
+ ExcWrongFieldDimension (unit_points.size(), normal_vectors.size()));
+
+ const DoFHandler<2>::face_iterator face = cell->face(face_no);
+ // compute direction of line
+ const Point<2> line_direction = (face->vertex(1) - face->vertex(0));
+ // rotate to the right by 90 degrees
+ const Point<2> normal_direction(line_direction(1),
+ -line_direction(0));
+
+ if (face_no <= 1)
+ // for sides 0 and 1: return the correctly
+ // scaled vector
+ fill (normal_vectors.begin(), normal_vectors.end(),
+ normal_direction / sqrt(normal_direction.square()));
+ else
+ // for sides 2 and 3: scale and invert
+ // vector
+ fill (normal_vectors.begin(), normal_vectors.end(),
+ normal_direction / (-sqrt(normal_direction.square())));
+};
+
+
+
+template <>
+void FELinear<2>::get_normal_vectors (const DoFHandler<2>::cell_iterator &cell,
+ const unsigned int face_no,
+ const unsigned int,
+ const vector<Point<1> > &unit_points,
+ vector<Point<2> > &normal_vectors) const {
+ // note, that in 2D the normal vectors to the
+ // subface have the same direction as that
+ // for the face
+ Assert (unit_points.size() == normal_vectors.size(),
+ ExcWrongFieldDimension (unit_points.size(), normal_vectors.size()));
+ Assert (cell->face(face_no)->at_boundary() == false,
+ ExcBoundaryFaceUsed ());
+
+ const DoFHandler<2>::face_iterator face = cell->face(face_no);
+ // compute direction of line
+ const Point<2> line_direction = (face->vertex(1) - face->vertex(0));
+ // rotate to the right by 90 degrees
+ const Point<2> normal_direction(line_direction(1),
+ -line_direction(0));
+
+ if (face_no <= 1)
+ // for sides 0 and 1: return the correctly
+ // scaled vector
+ fill (normal_vectors.begin(), normal_vectors.end(),
+ normal_direction / sqrt(normal_direction.square()));
+ else
+ // for sides 2 and 3: scale and invert
+ // vector
+ fill (normal_vectors.begin(), normal_vectors.end(),
+ normal_direction / (-sqrt(normal_direction.square())));
+};
+
+#endif
+
+
+
template <int dim>
void FELinear<dim>::fill_fe_values (const DoFHandler<dim>::cell_iterator &cell,
const vector<Point<dim> > &unit_points,
-template <>
-void FELinear<2>::get_face_jacobians (const DoFHandler<2>::face_iterator &face,
- const Boundary<2> &,
- const vector<Point<1> > &unit_points,
- vector<double> &face_jacobians) const {
- Assert (unit_points.size() == face_jacobians.size(),
- ExcWrongFieldDimension (unit_points.size(), face_jacobians.size()));
-
- // a linear mapping for a single line
- // produces particularly simple
- // expressions for the jacobi
- // determinant :-)
- const double h = sqrt((face->vertex(1) - face->vertex(0)).square());
- fill_n (face_jacobians.begin(),
- unit_points.size(),
- h);
-};
-
-
-
-template <>
-void FELinear<2>::get_subface_jacobians (const DoFHandler<2>::face_iterator &face,
- const unsigned int,
- const vector<Point<1> > &unit_points,
- vector<double> &face_jacobians) const {
- Assert (unit_points.size() == face_jacobians.size(),
- ExcWrongFieldDimension (unit_points.size(), face_jacobians.size()));
- Assert (face->at_boundary() == false,
- ExcBoundaryFaceUsed ());
-
- // a linear mapping for a single line
- // produces particularly simple
- // expressions for the jacobi
- // determinant :-)
- const double h = sqrt((face->vertex(1) - face->vertex(0)).square());
- fill_n (face_jacobians.begin(),
- unit_points.size(),
- h/2);
-};
-
-
-
-template <>
-void FELinear<2>::get_normal_vectors (const DoFHandler<2>::cell_iterator &cell,
- const unsigned int face_no,
- const Boundary<2> &,
- const vector<Point<1> > &unit_points,
- vector<Point<2> > &normal_vectors) const {
- Assert (unit_points.size() == normal_vectors.size(),
- ExcWrongFieldDimension (unit_points.size(), normal_vectors.size()));
-
- const DoFHandler<2>::face_iterator face = cell->face(face_no);
- // compute direction of line
- const Point<2> line_direction = (face->vertex(1) - face->vertex(0));
- // rotate to the right by 90 degrees
- const Point<2> normal_direction(line_direction(1),
- -line_direction(0));
-
- if (face_no <= 1)
- // for sides 0 and 1: return the correctly
- // scaled vector
- fill (normal_vectors.begin(), normal_vectors.end(),
- normal_direction / sqrt(normal_direction.square()));
- else
- // for sides 2 and 3: scale and invert
- // vector
- fill (normal_vectors.begin(), normal_vectors.end(),
- normal_direction / (-sqrt(normal_direction.square())));
-};
-
-
-
-template <>
-void FELinear<2>::get_normal_vectors (const DoFHandler<2>::cell_iterator &cell,
- const unsigned int face_no,
- const unsigned int,
- const vector<Point<1> > &unit_points,
- vector<Point<2> > &normal_vectors) const {
- // note, that in 2D the normal vectors to the
- // subface have the same direction as that
- // for the face
- Assert (unit_points.size() == normal_vectors.size(),
- ExcWrongFieldDimension (unit_points.size(), normal_vectors.size()));
- Assert (cell->face(face_no)->at_boundary() == false,
- ExcBoundaryFaceUsed ());
-
- const DoFHandler<2>::face_iterator face = cell->face(face_no);
- // compute direction of line
- const Point<2> line_direction = (face->vertex(1) - face->vertex(0));
- // rotate to the right by 90 degrees
- const Point<2> normal_direction(line_direction(1),
- -line_direction(0));
-
- if (face_no <= 1)
- // for sides 0 and 1: return the correctly
- // scaled vector
- fill (normal_vectors.begin(), normal_vectors.end(),
- normal_direction / sqrt(normal_direction.square()));
- else
- // for sides 2 and 3: scale and invert
- // vector
- fill (normal_vectors.begin(), normal_vectors.end(),
- normal_direction / (-sqrt(normal_direction.square())));
-};
-
+#if deal_II_dimension == 1
template <>
FEQuadratic<1>::FEQuadratic () :
Assert (false, ExcInternalError());
};
+#endif
-
+#if deal_II_dimension == 2
template <>
FEQuadratic<2>::FEQuadratic () :
Assert (false, ExcNotImplemented());
};
+#endif
+
template <int dim>
-
+#if deal_II_dimension == 1
template <>
FECubic<1>::FECubic () :
Assert (false, ExcInternalError());
};
+#endif
+
+
+#if deal_II_dimension == 2
template <>
FECubic<2>::FECubic () :
FiniteElement<2> (1, 2, 4) {};
+#endif
// explicit instantiations
-template class FELinear<1>;
-template class FELinear<2>;
-template class FEQuadratic<1>;
-template class FEQuadratic<2>;
-template class FECubic<1>;
-template class FECubic<2>;
+template class FELinear<deal_II_dimension>;
+template class FEQuadratic<deal_II_dimension>;
+template class FECubic<deal_II_dimension>;
/*------------------------------- Explicit Instantiations -------------*/
-template class FEValuesBase<1>;
-template class FEValuesBase<2>;
-
-template class FEValues<1>;
-template class FEValues<2>;
-
-template class FEFaceValuesBase<2>;
-template class FEFaceValues<2>;
-template class FESubfaceValues<2>;
-
+template class FEValuesBase<deal_II_dimension>;
+template class FEValues<deal_II_dimension>;
+
+#if deal_II_dimension >= 2
+template class FEFaceValuesBase<deal_II_dimension>;
+template class FEFaceValues<deal_II_dimension>;
+template class FESubfaceValues<deal_II_dimension>;
+#endif
for (unsigned int i=0; i<levels.size(); ++i)
delete levels[i];
- levels.resize (0);
+ levels.clear ();
};
/*--------- Put the next functions a bit out-or-order to avoid use before
--------- explicit specialization, which is not allowed. */
+#if deal_II_dimension == 1
template <>
TriaDimensionInfo<1>::cell_iterator
Triangulation<1>::begin (const unsigned int level) const {
};
-
template <>
-TriaDimensionInfo<2>::cell_iterator
-Triangulation<2>::begin (const unsigned int level) const {
- return begin_quad (level);
+TriaDimensionInfo<1>::raw_cell_iterator
+Triangulation<1>::end () const {
+ return end_line ();
};
+#endif
+
+#if deal_II_dimension == 2
template <>
-TriaDimensionInfo<1>::raw_cell_iterator
-Triangulation<1>::end () const {
- return end_line ();
+TriaDimensionInfo<2>::cell_iterator
+Triangulation<2>::begin (const unsigned int level) const {
+ return begin_quad (level);
};
+
template <>
TriaDimensionInfo<2>::raw_cell_iterator
Triangulation<2>::end () const {
return end_quad ();
};
+#endif
/*-----------------------------------------------------------------*/
+#if deal_II_dimension == 1
+
template <>
void Triangulation<1>::create_triangulation (const vector<Point<1> > &v,
const vector<CellData<1> > &cells,
+
+template <>
+void Triangulation<1>::create_hypercube (const double left,
+ const double right) {
+ Assert (vertices.size() == 0, ExcTriangulationNotEmpty());
+ Assert (n_lines() == 0, ExcTriangulationNotEmpty());
+
+ const Point<1> vertices[2] = { Point<1>(left), Point<1>(right) };
+ vector<CellData<1> > cells (1, CellData<1>());
+ cells[0].vertices[0] = 0;
+ cells[0].vertices[1] = 1;
+ cells[0].material_id = 0;
+
+ create_triangulation (vector<Point<1> >(&vertices[0], &vertices[2]),
+ cells,
+ SubCellData()); // no boundary information
+};
+
+
+
+template <>
+void Triangulation<1>::create_hyper_L (const double, const double) {
+ Assert (false, ExcInternalError());
+};
+
+
+
+template <>
+void Triangulation<1>::create_hyper_ball (const Point<1> &, const double) {
+ Assert (false, ExcInternalError());
+};
+
+#endif
+
+
+
+#if deal_II_dimension == 2
+
template <>
void Triangulation<2>::create_triangulation (const vector<Point<2> > &v,
const vector<CellData<2> > &c,
};
-
-template <>
-void Triangulation<1>::create_hypercube (const double left,
- const double right) {
- Assert (vertices.size() == 0, ExcTriangulationNotEmpty());
- Assert (n_lines() == 0, ExcTriangulationNotEmpty());
-
- const Point<1> vertices[2] = { Point<1>(left), Point<1>(right) };
- vector<CellData<1> > cells (1, CellData<1>());
- cells[0].vertices[0] = 0;
- cells[0].vertices[1] = 1;
- cells[0].material_id = 0;
-
- create_triangulation (vector<Point<1> >(&vertices[0], &vertices[2]),
- cells,
- SubCellData()); // no boundary information
-};
-
-
-
template <>
void Triangulation<2>::create_hypercube (const double left,
-template <>
-void Triangulation<1>::create_hyper_L (const double, const double) {
- Assert (false, ExcInternalError());
-};
-
-
-
template <>
void Triangulation<2>::create_hyper_L (const double a, const double b) {
const unsigned int dim=2;
-template <>
-void Triangulation<1>::create_hyper_ball (const Point<1> &, const double) {
- Assert (false, ExcInternalError());
-};
-
-
-
template <>
void Triangulation<2>::create_hyper_ball (const Point<2> &p, const double radius) {
const unsigned int dim=2;
SubCellData()); // no boundary information
};
+#endif
+
+
};
-
+#if deal_II_dimension == 1
template <>
void Triangulation<1>::clear_user_flags () {
+template <>
+void Triangulation<1>::save_user_flags (ostream &out) const {
+ save_user_flags_line (out);
+};
+
+#endif
+
+
+#if deal_II_dimension == 2
+
template <>
void Triangulation<2>::clear_user_flags () {
line_iterator line = begin_line(),
-
-template <>
-void Triangulation<1>::save_user_flags (ostream &out) const {
- save_user_flags_line (out);
-};
-
-
-
template <>
void Triangulation<2>::save_user_flags (ostream &out) const {
save_user_flags_line (out);
save_user_flags_quad (out);
};
+#endif
+
template <int dim>
+
+#if deal_II_dimension == 1
+
template <>
void Triangulation<1>::save_user_flags_quad (ostream &) const {
Assert (false, ExcFunctionNotUseful());
};
+template <>
+void Triangulation<1>::load_user_flags_quad (istream &) {
+ Assert (false, ExcFunctionNotUseful());
+};
+
+#endif
+
+
+
template <int dim>
void Triangulation<dim>::save_user_flags_quad (ostream &out) const {
-template <>
-void Triangulation<1>::load_user_flags_quad (istream &) {
- Assert (false, ExcFunctionNotUseful());
-};
-
-
-
template <int dim>
void Triangulation<dim>::load_user_flags_quad (istream &in) {
unsigned int magic_number;
+
+/*------------------------ Iterator functions ------------------------*/
+
+
+#if deal_II_dimension == 1
+
template <>
TriaDimensionInfo<1>::raw_cell_iterator
Triangulation<1>::begin_raw (const unsigned int level) const {
-
-
template <>
-TriaDimensionInfo<2>::raw_cell_iterator
-Triangulation<2>::begin_raw (const unsigned int level) const {
- return begin_raw_quad (level);
+TriaDimensionInfo<1>::raw_face_iterator
+Triangulation<1>::begin_raw_face (const unsigned int) const {
+ Assert (false, ExcFunctionNotUseful());
+ return 0;
};
template <>
-TriaDimensionInfo<2>::active_cell_iterator
-Triangulation<2>::begin_active (const unsigned int level) const {
- return begin_active_quad (level);
+TriaDimensionInfo<1>::face_iterator
+Triangulation<1>::begin_face (const unsigned int) const {
+ Assert (false, ExcFunctionNotUseful());
+ return 0;
};
template <>
-TriaDimensionInfo<2>::raw_cell_iterator
-Triangulation<2>::last_raw () const {
- return last_raw_quad ();
+TriaDimensionInfo<1>::active_face_iterator
+Triangulation<1>::begin_active_face (const unsigned int) const {
+ Assert (false, ExcFunctionNotUseful());
+ return 0;
};
template <>
-TriaDimensionInfo<2>::raw_cell_iterator
-Triangulation<2>::last_raw (const unsigned int level) const {
- return last_raw_quad (level);
+TriaDimensionInfo<1>::raw_face_iterator
+Triangulation<1>::end_face () const {
+ Assert (false, ExcFunctionNotUseful());
+ return 0;
};
template <>
-TriaDimensionInfo<2>::cell_iterator
-Triangulation<2>::last () const {
- return last_quad ();
+TriaDimensionInfo<1>::raw_face_iterator
+Triangulation<1>::last_raw_face () const {
+ Assert (false, ExcFunctionNotUseful());
+ return 0;
};
template <>
-TriaDimensionInfo<2>::cell_iterator
-Triangulation<2>::last (const unsigned int level) const {
- return last_quad (level);
+TriaDimensionInfo<1>::raw_face_iterator
+Triangulation<1>::last_raw_face (const unsigned int) const {
+ Assert (false, ExcFunctionNotUseful());
+ return 0;
};
template <>
-TriaDimensionInfo<2>::active_cell_iterator
-Triangulation<2>::last_active () const {
- return last_active_quad ();
+TriaDimensionInfo<1>::face_iterator
+Triangulation<1>::last_face () const {
+ Assert (false, ExcFunctionNotUseful());
+ return 0;
};
template <>
-TriaDimensionInfo<2>::active_cell_iterator
-Triangulation<2>::last_active (const unsigned int level) const {
- return last_active_quad (level);
+TriaDimensionInfo<1>::face_iterator
+Triangulation<1>::last_face (const unsigned int) const {
+ Assert (false, ExcFunctionNotUseful());
+ return 0;
};
+template <>
+TriaDimensionInfo<1>::active_face_iterator
+Triangulation<1>::last_active_face () const {
+ Assert (false, ExcFunctionNotUseful());
+ return 0;
+};
+
+template <>
+TriaDimensionInfo<1>::active_face_iterator
+Triangulation<1>::last_active_face (const unsigned int) const {
+ Assert (false, ExcFunctionNotUseful());
+ return 0;
+};
template <>
-TriaDimensionInfo<1>::raw_face_iterator
-Triangulation<1>::begin_raw_face (const unsigned int) const {
+TriaDimensionInfo<1>::raw_quad_iterator
+Triangulation<1>::begin_raw_quad (unsigned int) const {
Assert (false, ExcFunctionNotUseful());
return 0;
};
template <>
-TriaDimensionInfo<1>::face_iterator
-Triangulation<1>::begin_face (const unsigned int) const {
+TriaDimensionInfo<1>::quad_iterator
+Triangulation<1>::begin_quad (unsigned int) const {
Assert (false, ExcFunctionNotUseful());
return 0;
};
template <>
-TriaDimensionInfo<1>::active_face_iterator
-Triangulation<1>::begin_active_face (const unsigned int) const {
+TriaDimensionInfo<1>::active_quad_iterator
+Triangulation<1>::begin_active_quad (unsigned int) const {
Assert (false, ExcFunctionNotUseful());
return 0;
};
template <>
-TriaDimensionInfo<1>::raw_face_iterator
-Triangulation<1>::end_face () const {
+TriaDimensionInfo<1>::raw_quad_iterator
+Triangulation<1>::end_quad () const {
Assert (false, ExcFunctionNotUseful());
return 0;
};
template <>
-TriaDimensionInfo<1>::raw_face_iterator
-Triangulation<1>::last_raw_face () const {
+TriaDimensionInfo<1>::raw_quad_iterator
+Triangulation<1>::last_raw_quad (const unsigned int) const {
Assert (false, ExcFunctionNotUseful());
return 0;
};
template <>
-TriaDimensionInfo<1>::raw_face_iterator
-Triangulation<1>::last_raw_face (const unsigned int) const {
+TriaDimensionInfo<1>::raw_quad_iterator
+Triangulation<1>::last_raw_quad () const {
Assert (false, ExcFunctionNotUseful());
return 0;
};
template <>
-TriaDimensionInfo<1>::face_iterator
-Triangulation<1>::last_face () const {
+TriaDimensionInfo<1>::quad_iterator
+Triangulation<1>::last_quad (const unsigned int) const {
Assert (false, ExcFunctionNotUseful());
return 0;
};
template <>
-TriaDimensionInfo<1>::face_iterator
-Triangulation<1>::last_face (const unsigned int) const {
+TriaDimensionInfo<1>::quad_iterator
+Triangulation<1>::last_quad () const {
Assert (false, ExcFunctionNotUseful());
return 0;
};
template <>
-TriaDimensionInfo<1>::active_face_iterator
-Triangulation<1>::last_active_face () const {
+TriaDimensionInfo<1>::active_quad_iterator
+Triangulation<1>::last_active_quad (const unsigned int) const {
Assert (false, ExcFunctionNotUseful());
return 0;
};
template <>
-TriaDimensionInfo<1>::active_face_iterator
-Triangulation<1>::last_active_face (const unsigned int) const {
+TriaDimensionInfo<1>::active_quad_iterator
+Triangulation<1>::last_active_quad () const {
Assert (false, ExcFunctionNotUseful());
return 0;
};
+#endif
+
+
+
+
+#if deal_II_dimension == 2
+
+template <>
+TriaDimensionInfo<2>::raw_cell_iterator
+Triangulation<2>::begin_raw (const unsigned int level) const {
+ return begin_raw_quad (level);
+};
+
+
+
+template <>
+TriaDimensionInfo<2>::active_cell_iterator
+Triangulation<2>::begin_active (const unsigned int level) const {
+ return begin_active_quad (level);
+};
+
+
+
+template <>
+TriaDimensionInfo<2>::raw_cell_iterator
+Triangulation<2>::last_raw () const {
+ return last_raw_quad ();
+};
+
+
+
+template <>
+TriaDimensionInfo<2>::raw_cell_iterator
+Triangulation<2>::last_raw (const unsigned int level) const {
+ return last_raw_quad (level);
+};
+
+
+
+template <>
+TriaDimensionInfo<2>::cell_iterator
+Triangulation<2>::last () const {
+ return last_quad ();
+};
+
+
+
+template <>
+TriaDimensionInfo<2>::cell_iterator
+Triangulation<2>::last (const unsigned int level) const {
+ return last_quad (level);
+};
+
+
+
+template <>
+TriaDimensionInfo<2>::active_cell_iterator
+Triangulation<2>::last_active () const {
+ return last_active_quad ();
+};
+
+
+
+template <>
+TriaDimensionInfo<2>::active_cell_iterator
+Triangulation<2>::last_active (const unsigned int level) const {
+ return last_active_quad (level);
+};
+
+
+
+
return last_active_line (level);
};
+#endif
-template <>
-TriaDimensionInfo<1>::raw_quad_iterator
-Triangulation<1>::begin_raw_quad (unsigned int) const {
- Assert (false, ExcFunctionNotUseful());
- return 0;
-};
-
-
-
template <int dim>
typename TriaDimensionInfo<dim>::raw_quad_iterator
Triangulation<dim>::begin_raw_quad (unsigned int level) const {
-template <>
-TriaDimensionInfo<1>::quad_iterator
-Triangulation<1>::begin_quad (unsigned int) const {
- Assert (false, ExcFunctionNotUseful());
- return 0;
-};
-
-
-
template <int dim>
typename TriaDimensionInfo<dim>::quad_iterator
Triangulation<dim>::begin_quad (unsigned int level) const {
-template <>
-TriaDimensionInfo<1>::active_quad_iterator
-Triangulation<1>::begin_active_quad (unsigned int) const {
- Assert (false, ExcFunctionNotUseful());
- return 0;
-};
-
-
-
template <int dim>
typename TriaDimensionInfo<dim>::active_quad_iterator
Triangulation<dim>::begin_active_quad (unsigned int level) const {
-template <>
-TriaDimensionInfo<1>::raw_quad_iterator
-Triangulation<1>::end_quad () const {
- Assert (false, ExcFunctionNotUseful());
- return 0;
-};
-
-
-
template <int dim>
typename TriaDimensionInfo<dim>::raw_quad_iterator
Triangulation<dim>::end_quad () const {
-template <>
-TriaDimensionInfo<1>::raw_quad_iterator
-Triangulation<1>::last_raw_quad (const unsigned int) const {
- Assert (false, ExcFunctionNotUseful());
- return 0;
-};
-
-
-
template <int dim>
typename TriaDimensionInfo<dim>::raw_quad_iterator
Triangulation<dim>::last_raw_quad (const unsigned int level) const {
-template <>
-TriaDimensionInfo<1>::raw_quad_iterator
-Triangulation<1>::last_raw_quad () const {
- Assert (false, ExcFunctionNotUseful());
- return 0;
-};
-
-
-
template <int dim>
typename TriaDimensionInfo<dim>::raw_quad_iterator
Triangulation<dim>::last_raw_quad () const {
-template <>
-TriaDimensionInfo<1>::quad_iterator
-Triangulation<1>::last_quad (const unsigned int) const {
- Assert (false, ExcFunctionNotUseful());
- return 0;
-};
-
-
-
template <int dim>
typename TriaDimensionInfo<dim>::quad_iterator
Triangulation<dim>::last_quad (const unsigned int level) const {
-template <>
-TriaDimensionInfo<1>::quad_iterator
-Triangulation<1>::last_quad () const {
- Assert (false, ExcFunctionNotUseful());
- return 0;
-};
-
-
-
-
template <int dim>
typename TriaDimensionInfo<dim>::quad_iterator
Triangulation<dim>::last_quad () const {
-template <>
-TriaDimensionInfo<1>::active_quad_iterator
-Triangulation<1>::last_active_quad (const unsigned int) const {
- Assert (false, ExcFunctionNotUseful());
- return 0;
-};
-
-
-
-
template <int dim>
typename TriaDimensionInfo<dim>::active_quad_iterator
Triangulation<dim>::last_active_quad (const unsigned int level) const {
-template <>
-TriaDimensionInfo<1>::active_quad_iterator
-Triangulation<1>::last_active_quad () const {
- Assert (false, ExcFunctionNotUseful());
- return 0;
-};
-
-
-
template <int dim>
typename TriaDimensionInfo<dim>::active_quad_iterator
-template <>
-unsigned int Triangulation<1>::n_cells (const unsigned int level) const {
- return n_lines (level);
-};
-
-
-
-template <>
-unsigned int Triangulation<2>::n_cells (const unsigned int level) const {
- return n_quads (level);
-};
-
-
-
template <int dim>
unsigned int Triangulation<dim>::n_active_cells () const {
unsigned int n=0;
+#if deal_II_dimension == 1
+
template <>
unsigned int Triangulation<1>::n_active_cells (const unsigned int level) const {
return n_active_lines (level);
};
+template <>
+unsigned int Triangulation<1>::n_cells (const unsigned int level) const {
+ return n_lines (level);
+};
+
+#endif
+
+
+
+#if deal_II_dimension == 2
+
+template <>
+unsigned int Triangulation<2>::n_cells (const unsigned int level) const {
+ return n_quads (level);
+};
+
+
template <>
unsigned int Triangulation<2>::n_active_cells (const unsigned int level) const {
return n_active_quads (level);
};
+#endif
+
+
template <int dim>
+#if deal_II_dimension == 1
+
template <>
unsigned int Triangulation<1>::n_quads (const unsigned int) const {
Assert (false, ExcFunctionNotUseful());
+template <>
+unsigned int Triangulation<1>::n_active_quads (const unsigned int) const {
+ Assert (false, ExcFunctionNotUseful());
+ return 0;
+};
+
+
+#endif
+
+
template <int dim>
unsigned int Triangulation<dim>::n_quads (const unsigned int level) const {
if (levels[level]->quads.quads.size() == 0)
-template <>
-unsigned int Triangulation<1>::n_active_quads (const unsigned int) const {
- Assert (false, ExcFunctionNotUseful());
- return 0;
-};
-
-
-
template <int dim>
unsigned int Triangulation<dim>::n_active_quads (const unsigned int level) const {
if (levels[level]->quads.quads.size() == 0)
+#if deal_II_dimension == 1
+
template <>
unsigned int Triangulation<1>::max_adjacent_cells () const {
return 2;
};
+#endif
+
template <int dim>
+#if deal_II_dimension == 1
+
template <>
void Triangulation<1>::print_gnuplot (ostream &out,
const active_cell_iterator & cell) const {
<< endl;
};
+#endif
+
+#if deal_II_dimension == 2
template <>
void Triangulation<2>::print_gnuplot (ostream &out,
<< endl;
};
+#endif
};
+
+static
inline
double sqr(double a) {
return a*a;
};
+
template <int dim>
void Triangulation<dim>::refine_fixed_fraction (const dVector &criteria,
const double fraction_of_error,
+#if deal_II_dimension == 1
+
template <>
void Triangulation<1>::execute_refinement () {
prepare_refinement ();
#endif
};
+#endif
-
+#if deal_II_dimension == 2
template <>
void Triangulation<2>::execute_refinement () {
#endif
};
+#endif
+#if deal_II_dimension >= 2
+
void TriangulationLevel<2>::reserve_space (const unsigned int new_quads) {
vector<bool>::iterator u = quads.used.begin(),
e = quads.used.end();
TriangulationLevel<1>::monitor_memory (true_dimension);
};
-
+#endif
// explicit instantiations
-template class Triangulation<1>;
-template class Triangulation<2>;
+template class Triangulation<deal_II_dimension>;
-template class TriaAccessor<1>;
-template class TriaAccessor<2>;
-
-
/*------------------------ Functions: LineAccessor ---------------------------*/
-template class LineAccessor<1>;
-template class LineAccessor<2>;
-
-
/*------------------------ Functions: QuadAccessor ---------------------------*/
template <int dim>
-template class QuadAccessor<2>;
-
-
/*------------------------ Functions: CellAccessor<1> -----------------------*/
+#if deal_II_dimension == 1
+
template <>
bool CellAccessor<1>::at_boundary () const {
return at_boundary(0) || at_boundary(1);
return 0;
};
-
+#endif
/*------------------------ Functions: CellAccessor<2> -----------------------*/
+#if deal_II_dimension == 2
+
template <>
bool CellAccessor<2>::at_boundary () const {
return at_boundary(0) || at_boundary(1) || at_boundary(2) || at_boundary(3);
return line(i);
};
+#endif
+
/*------------------------ Functions: CellAccessor<dim> -----------------------*/
// explicit instantiations
-template class CellAccessor<1>;
-template class CellAccessor<2>;
-
-template class TriaRawIterator<1,LineAccessor<1> >;
-template class TriaRawIterator<1,CellAccessor<1> >;
-template class TriaRawIterator<2,LineAccessor<2> >;
-template class TriaRawIterator<2,QuadAccessor<2> >;
-template class TriaRawIterator<2,CellAccessor<2> >;
-
-template class TriaIterator<1,LineAccessor<1> >;
-template class TriaIterator<1,CellAccessor<1> >;
-template class TriaIterator<2,LineAccessor<2> >;
-template class TriaIterator<2,QuadAccessor<2> >;
-template class TriaIterator<2,CellAccessor<2> >;
-
-template class TriaActiveIterator<1,LineAccessor<1> >;
-template class TriaActiveIterator<1,CellAccessor<1> >;
-template class TriaActiveIterator<2,LineAccessor<2> >;
-template class TriaActiveIterator<2,QuadAccessor<2> >;
-template class TriaActiveIterator<2,CellAccessor<2> >;
+template class TriaAccessor<deal_II_dimension>;
+template class LineAccessor<deal_II_dimension>;
+template class CellAccessor<deal_II_dimension>;
+template class TriaRawIterator<deal_II_dimension,LineAccessor<deal_II_dimension> >;
+template class TriaRawIterator<deal_II_dimension,CellAccessor<deal_II_dimension> >;
+template class TriaIterator<deal_II_dimension,LineAccessor<deal_II_dimension> >;
+template class TriaIterator<deal_II_dimension,CellAccessor<deal_II_dimension> >;
+template class TriaActiveIterator<deal_II_dimension,LineAccessor<deal_II_dimension> >;
+template class TriaActiveIterator<deal_II_dimension,CellAccessor<deal_II_dimension> >;
+
+#if deal_II_dimension >= 2
+template class QuadAccessor<deal_II_dimension>;
+template class TriaRawIterator<deal_II_dimension,QuadAccessor<deal_II_dimension> >;
+template class TriaIterator<deal_II_dimension,QuadAccessor<deal_II_dimension> >;
+template class TriaActiveIterator<deal_II_dimension,QuadAccessor<deal_II_dimension> >;
+#endif
+
+
+
+
// explicit instantiations
-template class Equation<1>;
-template class Equation<2>;
+template class Equation<deal_II_dimension>;
+template class Assembler<deal_II_dimension>;
+template class AssemblerData<deal_II_dimension>;
-template class Assembler<1>;
-template class Assembler<2>;
-
-
-template class AssemblerData<1>;
-template class AssemblerData<2>;
-
-
-template class TriaRawIterator<1,Assembler<1> >;
-template class TriaIterator<1,Assembler<1> >;
-template class TriaActiveIterator<1,Assembler<1> >;
-template class TriaRawIterator<2,Assembler<2> >;
-template class TriaIterator<2,Assembler<2> >;
-template class TriaActiveIterator<2,Assembler<2> >;
+template class TriaRawIterator<deal_II_dimension,Assembler<deal_II_dimension> >;
+template class TriaIterator<deal_II_dimension,Assembler<deal_II_dimension> >;
+template class TriaActiveIterator<deal_II_dimension,Assembler<deal_II_dimension> >;
// explicit instantiations
-template class ProblemBase<1>;
-template class ProblemBase<2>;
+template class ProblemBase<deal_II_dimension>;
+#if deal_II_dimension == 1
+
template <>
unsigned int DataOut<1>::n_boundary_faces () const {
return 0;
};
+#endif
+
template <int dim>
+
+#if deal_II_dimension == 1
+
template <>
void DataOut<1>::write_ucd_faces (ostream &, const unsigned int) const {
return;
};
+#endif
template <int dim>
//explicite instantiations
-template class DataIn<1>;
-template class DataIn<2>;
-template class DataOut<1>;
-template class DataOut<2>;
+
+template class DataIn<deal_II_dimension>;
+template class DataOut<deal_II_dimension>;
-inline double sqr (const double x) {
+inline static double sqr (const double x) {
return x*x;
};
+#if deal_II_dimension == 1
+
template <>
void KellyErrorEstimator<1>::estimate_error (const DoFHandler<1> &,
const Quadrature<0> &,
Assert(false, ExcNotImplemented());
};
+#endif
template <int dim>
-
+#if deal_II_dimension == 1
template <>
void KellyErrorEstimator<1>::integrate_over_regular_face (const active_cell_iterator &,
+template <>
+void KellyErrorEstimator<1>::
+integrate_over_irregular_face (const active_cell_iterator &,
+ const unsigned int ,
+ const FiniteElement<1> &,
+ const Boundary<1> &,
+ const unsigned int ,
+ FEFaceValues<1> &,
+ FESubfaceValues<1> &,
+ FaceIntegrals &,
+ const dVector &) {
+ Assert (false, ExcInternalError());
+};
+
+#endif
+
+
template <int dim>
void KellyErrorEstimator<dim>::
-template <>
-void KellyErrorEstimator<1>::
-integrate_over_irregular_face (const active_cell_iterator &,
- const unsigned int ,
- const FiniteElement<1> &,
- const Boundary<1> &,
- const unsigned int ,
- FEFaceValues<1> &,
- FESubfaceValues<1> &,
- FaceIntegrals &,
- const dVector &) {
- Assert (false, ExcInternalError());
-};
-
-
-
template <int dim>
void KellyErrorEstimator<dim>::
integrate_over_irregular_face (const active_cell_iterator &cell,
// explicit instantiations
-template class KellyErrorEstimator<1>;
-template class KellyErrorEstimator<2>;
+template class KellyErrorEstimator<deal_II_dimension>;
+#if deal_II_dimension == 1
template <>
void MatrixCreator<1>::create_boundary_mass_matrix (const DoFHandler<1> &,
Assert (false, ExcNotImplemented());
};
+#endif
+
template <int dim>
-template class MatrixCreator<1>;
-template class MatrixCreator<2>;
-template class MatrixTools<1>;
-template class MatrixTools<2>;
-template class MassMatrix<1>;
-template class MassMatrix<2>;
-template class LaplaceMatrix<1>;
-template class LaplaceMatrix<2>;
+template class MatrixCreator<deal_II_dimension>;
+template class MatrixTools<deal_II_dimension>;
+template class MassMatrix<deal_II_dimension>;
+template class LaplaceMatrix<deal_II_dimension>;
+#if deal_II_dimension == 1
template <>
void VectorTools<1>::project (const DoFHandler<1> &,
Assert (false, ExcNotImplemented());
};
+#endif
+
+#if deal_II_dimension == 1
+
template <>
void
VectorTools<1>::interpolate_boundary_values (const DoFHandler<1> &,
Assert (false, ExcNotImplemented());
};
+#endif
};
-template VectorTools<1>;
-template VectorTools<2>;
+template VectorTools<deal_II_dimension>;
# If you want your program to be linked with extra object or library
# files, specify them here:
-user-libs = ../../../mia/control.o
+user-libs = ../../../mia/control.o ../../lib/libfe.g.a
# To run the program, use "make run"; to give parameters to the program,
# give the parameters to the following variable:
-
+#if deal_II_dimension == 1
void PoissonEquation<1>::assemble (dFMatrix &cell_matrix,
dVector &rhs,
};
};
+#endif
+
+#if deal_II_dimension == 2
+
void PoissonEquation<2>::assemble (dFMatrix &cell_matrix,
dVector &rhs,
const FEValues<2> &fe_values,
};
};
+#endif
+
template <int dim>
-template class PoissonEquation<1>;
template class PoissonEquation<2>;