From: wolf Date: Tue, 7 May 2002 06:53:21 +0000 (+0000) Subject: Fix a really frightening number of places where we need to indicate access to members... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=614fb2c2c9d265c7336a7df0c3f3ff0d6bbd35c9;p=dealii-svn.git Fix a really frightening number of places where we need to indicate access to members of base classes by this-> since the base class is template dependent and lookup would not find its members in derived classes unless marked with this->. While most compilers accept it nevertheless, the C++ standard requires us to do this. git-svn-id: https://svn.dealii.org/trunk@5832 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/include/base/point.h b/deal.II/base/include/base/point.h index 4dfd03f7da..71e53792ed 100644 --- a/deal.II/base/include/base/point.h +++ b/deal.II/base/include/base/point.h @@ -17,6 +17,7 @@ #include #include #include +#include /** diff --git a/deal.II/base/source/auto_derivative_function.cc b/deal.II/base/source/auto_derivative_function.cc index 96fa2898e1..5d44b32cc4 100644 --- a/deal.II/base/source/auto_derivative_function.cc +++ b/deal.II/base/source/auto_derivative_function.cc @@ -120,14 +120,15 @@ template void AutoDerivativeFunction::vector_gradient (const Point &p, typename std::vector > &gradients) const { - Assert (gradients.size() == n_components, ExcDimensionMismatch(gradients.size(), n_components)); + Assert (gradients.size() == this->n_components, + ExcDimensionMismatch(gradients.size(), this->n_components)); switch (formula) { case UpwindEuler: { Point q1; - Vector v(n_components), v1(n_components); + Vector v(this->n_components), v1(this->n_components); const double h_inv=1./h; for (unsigned int i=0; i::vector_gradient (const Point &p, vector_value(p, v); vector_value(q1, v1); - for (unsigned int comp=0; compn_components; ++comp) gradients[comp][i]=(v(comp)-v1(comp))*h_inv; } break; @@ -143,7 +144,7 @@ void AutoDerivativeFunction::vector_gradient (const Point &p, case Euler: { Point q1, q2; - Vector v1(n_components), v2(n_components); + Vector v1(this->n_components), v2(this->n_components); const double h_inv_2=1./(2*h); for (unsigned int i=0; i::vector_gradient (const Point &p, vector_value(q1, v1); vector_value(q2, v2); - for (unsigned int comp=0; compn_components; ++comp) gradients[comp][i]=(v1(comp)-v2(comp))*h_inv_2; } break; @@ -160,7 +161,9 @@ void AutoDerivativeFunction::vector_gradient (const Point &p, case FourthOrder: { Point q1, q2, q3, q4; - Vector v1(n_components), v2(n_components), v3(n_components), v4(n_components); + Vector + v1(this->n_components), v2(this->n_components), + v3(this->n_components), v4(this->n_components); const double h_inv_12=1./(12*h); for (unsigned int i=0; i::vector_gradient (const Point &p, vector_value(q3, v3); vector_value(q4, v4); - for (unsigned int comp=0; compn_components; ++comp) gradients[comp][i]=(-v1(comp)+8*v2(comp)-8*v3(comp)+v4(comp))*h_inv_12; } break; @@ -250,8 +253,8 @@ vector_gradient_list (const typename std::vector > &points Assert (gradients.size() == points.size(), ExcDimensionMismatch(gradients.size(), points.size())); for (unsigned p=0; pn_components, + ExcDimensionMismatch(gradients.size(), this->n_components)); switch (formula) { @@ -262,7 +265,7 @@ vector_gradient_list (const typename std::vector > &points for (unsigned int i=0; in_components; ++comp) gradients[p][comp][i]=(value(points[p], comp)-value(q1, comp))/h; } break; @@ -275,7 +278,7 @@ vector_gradient_list (const typename std::vector > &points { q1=points[p]+ht[i]; q2=points[p]-ht[i]; - for (unsigned int comp=0; compn_components; ++comp) gradients[p][comp][i]=(value(q1, comp)-value(q2, comp))/(2*h); } break; @@ -290,7 +293,7 @@ vector_gradient_list (const typename std::vector > &points q1=q2+ht[i]; q3=points[p]-ht[i]; q4=q3-ht[i]; - for (unsigned int comp=0; compn_components; ++comp) gradients[p][comp][i]=(- value(q1, comp) +8*value(q2, comp) -8*value(q3, comp) diff --git a/deal.II/base/source/function.cc b/deal.II/base/source/function.cc index 3c30336006..d97171adaf 100644 --- a/deal.II/base/source/function.cc +++ b/deal.II/base/source/function.cc @@ -217,8 +217,8 @@ template void ZeroFunction::vector_value (const Point &, Vector &return_value) const { - Assert (return_value.size() == n_components, - ExcDimensionMismatch (return_value.size(), n_components)); + Assert (return_value.size() == this->n_components, + ExcDimensionMismatch (return_value.size(), this->n_components)); std::fill (return_value.begin(), return_value.end(), 0.0); }; @@ -244,8 +244,8 @@ void ZeroFunction::vector_value_list (const typename std::vector for (unsigned int i=0; in_components, + ExcDimensionMismatch(values[i].size(), this->n_components)); std::fill (values[i].begin(), values[i].end(), 0.); }; }; @@ -263,10 +263,10 @@ template void ZeroFunction::vector_gradient (const Point &, typename std::vector > &gradients) const { - Assert (gradients.size() == n_components, - ExcDimensionMismatch(gradients.size(), n_components)); + Assert (gradients.size() == this->n_components, + ExcDimensionMismatch(gradients.size(), this->n_components)); - for (unsigned int c=0; cn_components; ++c) gradients[c].clear (); }; @@ -292,9 +292,9 @@ void ZeroFunction::vector_gradient_list (const typename std::vectorn_components, + ExcDimensionMismatch(gradients[i].size(), this->n_components)); + for (unsigned int c=0; cn_components; ++c) gradients[i][c].clear (); }; }; @@ -306,7 +306,8 @@ template ConstantFunction::ConstantFunction (const double value, const unsigned int n_components) : ZeroFunction (n_components), - function_value (value) {}; + function_value (value) +{}; template @@ -325,8 +326,8 @@ template void ConstantFunction::vector_value (const Point &, Vector &return_value) const { - Assert (return_value.size() == n_components, - ExcDimensionMismatch (return_value.size(), n_components)); + Assert (return_value.size() == this->n_components, + ExcDimensionMismatch (return_value.size(), this->n_components)); std::fill (return_value.begin(), return_value.end(), function_value); }; @@ -353,8 +354,8 @@ void ConstantFunction::vector_value_list (const typename std::vectorn_components, + ExcDimensionMismatch(values[i].size(), this->n_components)); std::fill (values[i].begin(), values[i].end(), function_value); }; }; @@ -386,11 +387,11 @@ template void ComponentSelectFunction::vector_value (const Point &, Vector &return_value) const { - Assert (return_value.size() == n_components, - ExcDimensionMismatch (return_value.size(), n_components)); + Assert (return_value.size() == this->n_components, + ExcDimensionMismatch (return_value.size(), this->n_components)); std::fill (return_value.begin(), return_value.end(), 0.); - return_value(selected) = function_value; + return_value(selected) = this->function_value; } @@ -404,10 +405,10 @@ void ComponentSelectFunction::vector_value_list (const typename std::vector for (unsigned int i=0; in_components, + ExcDimensionMismatch(values[i].size(), this->n_components)); std::fill (values[i].begin(), values[i].end(), 0.); - values[i](selected) = function_value; + values[i](selected) = this->function_value; } } diff --git a/deal.II/base/source/function_lib_cutoff.cc b/deal.II/base/source/function_lib_cutoff.cc index 53660bacb8..59105accd2 100644 --- a/deal.II/base/source/function_lib_cutoff.cc +++ b/deal.II/base/source/function_lib_cutoff.cc @@ -87,8 +87,10 @@ namespace Functions CutOffFunctionLinfty::value (const Point &p, const unsigned int component) const { - if (selected==no_component || component==selected) - return ((center.distance(p)selected==CutOffFunctionBase::no_component + || + component==this->selected) + return ((this->center.distance(p)radius) ? 1. : 0.); return 0.; } @@ -101,13 +103,15 @@ namespace Functions { Assert (values.size() == points.size(), ExcDimensionMismatch(values.size(), points.size())); - Assert (component < n_components, - ExcIndexRange(component,0,n_components)); + Assert (component < this->n_components, + ExcIndexRange(component,0,this->n_components)); - if (selected==no_component || component==selected) + if (this->selected==CutOffFunctionBase::no_component + || + component==this->selected) for (unsigned int k=0;kcenter.distance(points[k])radius) ? 1. : 0.; else std::fill (values.begin(), values.end(), 0.); } @@ -124,13 +128,14 @@ namespace Functions for (unsigned int k=0;kcenter.distance(points[k])radius) ? 1. : 0.; + if (this->selected==CutOffFunctionBase::no_component) values[k] = val; else { values[k].clear (); - values[k](selected) = val; + values[k](this->selected) = val; } } } @@ -151,10 +156,12 @@ namespace Functions CutOffFunctionW1::value (const Point &p, const unsigned int component) const { - if (selected==no_component || component==selected) + if (this->selected==CutOffFunctionBase::no_component + || + component==this->selected) { - const double d = center.distance(p); - return ((dcenter.distance(p); + return ((dradius) ? (this->radius-d) : 0.); } return 0.; } @@ -169,11 +176,13 @@ namespace Functions Assert (values.size() == points.size(), ExcDimensionMismatch(values.size(), points.size())); - if (selected==no_component || component==selected) + if (this->selected==CutOffFunctionBase::no_component + || + component==this->selected) for (unsigned int i=0;icenter.distance(points[i]); + values[i] = ((dradius) ? (this->radius-d) : 0.); } else std::fill (values.begin(), values.end(), 0.); @@ -192,14 +201,15 @@ namespace Functions for (unsigned int k=0;kcenter.distance(points[k]); + const double + val = (dradius) ? (this->radius-d) : 0.; + if (this->selected==CutOffFunctionBase::no_component) values[k] = val; else { values[k].clear (); - values[k](selected) = val; + values[k](this->selected) = val; } } } @@ -220,10 +230,12 @@ namespace Functions CutOffFunctionCinfty::value (const Point &p, const unsigned int component) const { - if (selected==no_component || component==selected) + if (this->selected==CutOffFunctionBase::no_component + || + component==this->selected) { - const double d = center.distance(p); - const double r = radius; + const double d = this->center.distance(p); + const double r = this->radius; if (d>=r) return 0.; const double e = -r*r/(r*r-d*d); @@ -242,12 +254,14 @@ namespace Functions Assert (values.size() == points.size(), ExcDimensionMismatch(values.size(), points.size())); - const double r = radius; + const double r = this->radius; - if (selected==no_component || component==selected) - for (unsigned int i=0;iselected==CutOffFunctionBase::no_component + || + component==this->selected) + for (unsigned int i=0; icenter.distance(points[i]); if (d>=r) { values[i] = 0.; @@ -272,23 +286,23 @@ namespace Functions for (unsigned int k=0;kcenter.distance(points[k]); + const double r = this->radius; double e = 0.; double val = 0.; - if (dradius) { e = -r*r/(r*r-d*d); if (e>-50) val = M_E * exp(e); } - if (selected==no_component) + if (this->selected==CutOffFunctionBase::no_component) values[k] = val; else { values[k].clear (); - values[k](selected) = val; + values[k](this->selected) = val; } } } @@ -300,14 +314,14 @@ namespace Functions CutOffFunctionCinfty::gradient (const Point &p, const unsigned int) const { - const double d = center.distance(p); - const double r = radius; + const double d = this->center.distance(p); + const double r = this->radius; if (d>=r) return Tensor<1,dim>(); const double e = -d*d/(r-d)/(r+d); return ((e<-50) ? Point() : - (p-center)/d*(-2.0*r*r/pow(-r*r+d*d,2.0)*d*exp(e))); + (p-this->center)/d*(-2.0*r*r/pow(-r*r+d*d,2.0)*d*exp(e))); } diff --git a/deal.II/base/source/quadrature.cc b/deal.II/base/source/quadrature.cc index 71da6368c9..cdfae8341f 100644 --- a/deal.II/base/source/quadrature.cc +++ b/deal.II/base/source/quadrature.cc @@ -744,10 +744,12 @@ QIterated<1>::QIterated (const Quadrature<1> &base_quadrature, for (unsigned int copy=0; copy(base_quadrature.point(q_point)(0) / n_copies - + - (1.0*copy)/n_copies); - weights[next_point] = base_quadrature.weight(q_point) / n_copies; + this->quadrature_points[next_point] + = Point<1>(base_quadrature.point(q_point)(0) / n_copies + + + (1.0*copy)/n_copies); + this->weights[next_point] + = base_quadrature.weight(q_point) / n_copies; ++next_point; }; @@ -793,9 +795,10 @@ QIterated<1>::QIterated (const Quadrature<1> &base_quadrature, (base_quadrature.point(q_point) == Point<1>(0.0))) continue; - quadrature_points[next_point] = Point<1>(base_quadrature.point(q_point)(0) / n_copies - + - (1.0*copy)/n_copies); + this->quadrature_points[next_point] + = Point<1>(base_quadrature.point(q_point)(0) / n_copies + + + (1.0*copy)/n_copies); // if this is the // rightmost point of one @@ -804,9 +807,10 @@ QIterated<1>::QIterated (const Quadrature<1> &base_quadrature, // double weight if ((copy != n_copies-1) && (base_quadrature.point(q_point) == Point<1>(1.0))) - weights[next_point] = double_point_weight; + this->weights[next_point] = double_point_weight; else - weights[next_point] = base_quadrature.weight(q_point) / n_copies; + this->weights[next_point] = base_quadrature.weight(q_point) / + n_copies; ++next_point; }; @@ -814,8 +818,8 @@ QIterated<1>::QIterated (const Quadrature<1> &base_quadrature, #if DEBUG double sum_of_weights = 0; - for (unsigned int i=0; in_quadrature_points; ++i) + sum_of_weights += this->weight(i); Assert (std::fabs(sum_of_weights-1) < 1e-15, ExcSumOfWeightsNotOne()); #endif diff --git a/deal.II/base/source/quadrature_lib.cc b/deal.II/base/source/quadrature_lib.cc index 9e1950e1fe..b2c0847144 100644 --- a/deal.II/base/source/quadrature_lib.cc +++ b/deal.II/base/source/quadrature_lib.cc @@ -62,12 +62,12 @@ QGauss<1>::QGauss (const unsigned int n) while (abs(p1/pp) > 1.e-19); double x = .5*z; - quadrature_points[i-1] = Point<1>(.5-x); - quadrature_points[n-i] = Point<1>(.5+x); + this->quadrature_points[i-1] = Point<1>(.5-x); + this->quadrature_points[n-i] = Point<1>(.5+x); double w = 1./((1.-z*z)*pp*pp); - weights[i-1] = w; - weights[n-i] = w; + this->weights[i-1] = w; + this->weights[n-i] = w; } } @@ -88,10 +88,10 @@ QGauss2<1>::QGauss2 () : static const double wts[] = { wts_normal[0]/2., wts_normal[1]/2. }; - for (unsigned int i=0; in_quadrature_points; ++i) { - quadrature_points[i] = Point<1>(xpts[i]); - weights[i] = wts[i]; + this->quadrature_points[i] = Point<1>(xpts[i]); + this->weights[i] = wts[i]; }; }; @@ -117,10 +117,10 @@ QGauss3<1>::QGauss3 () : wts_normal[1]/2., wts_normal[2]/2. }; - for (unsigned int i=0; in_quadrature_points; ++i) { - quadrature_points[i] = Point<1>(xpts[i]); - weights[i] = wts[i]; + this->quadrature_points[i] = Point<1>(xpts[i]); + this->weights[i] = wts[i]; }; }; @@ -150,10 +150,10 @@ QGauss4<1>::QGauss4 () : wts_normal[2]/2., wts_normal[3]/2. }; - for (unsigned int i=0; in_quadrature_points; ++i) { - quadrature_points[i] = Point<1>(xpts[i]); - weights[i] = wts[i]; + this->quadrature_points[i] = Point<1>(xpts[i]); + this->weights[i] = wts[i]; }; }; @@ -187,10 +187,10 @@ QGauss5<1>::QGauss5 () : wts_normal[3]/2., wts_normal[4]/2. }; - for (unsigned int i=0; in_quadrature_points; ++i) { - quadrature_points[i] = Point<1>(xpts[i]); - weights[i] = wts[i]; + this->quadrature_points[i] = Point<1>(xpts[i]); + this->weights[i] = wts[i]; }; }; @@ -228,10 +228,10 @@ QGauss6<1>::QGauss6 () : wts_normal[4]/2., wts_normal[5]/2. }; - for (unsigned int i=0; in_quadrature_points; ++i) { - quadrature_points[i] = Point<1>(xpts[i]); - weights[i] = wts[i]; + this->quadrature_points[i] = Point<1>(xpts[i]); + this->weights[i] = wts[i]; }; }; @@ -273,10 +273,10 @@ QGauss7<1>::QGauss7 () : wts_normal[5]/2., wts_normal[6]/2. }; - for (unsigned int i=0; in_quadrature_points; ++i) { - quadrature_points[i] = Point<1>(xpts[i]); - weights[i] = wts[i]; + this->quadrature_points[i] = Point<1>(xpts[i]); + this->weights[i] = wts[i]; }; }; @@ -286,8 +286,8 @@ template <> QMidpoint<1>::QMidpoint () : Quadrature<1>(1) { - quadrature_points[0] = Point<1>(0.5); - weights[0] = 1.0; + this->quadrature_points[0] = Point<1>(0.5); + this->weights[0] = 1.0; }; @@ -298,10 +298,10 @@ QTrapez<1>::QTrapez () : static const double xpts[] = { 0.0, 1.0 }; static const double wts[] = { 0.5, 0.5 }; - for (unsigned int i=0; in_quadrature_points; ++i) { - quadrature_points[i] = Point<1>(xpts[i]); - weights[i] = wts[i]; + this->quadrature_points[i] = Point<1>(xpts[i]); + this->weights[i] = wts[i]; }; }; @@ -313,10 +313,10 @@ QSimpson<1>::QSimpson () : 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; in_quadrature_points; ++i) { - quadrature_points[i] = Point<1>(xpts[i]); - weights[i] = wts[i]; + this->quadrature_points[i] = Point<1>(xpts[i]); + this->weights[i] = wts[i]; }; }; @@ -328,10 +328,10 @@ QMilne<1>::QMilne () : static const double xpts[] = { 0.0, .25, .5, .75, 1.0 }; static const double wts[] = { 7./90., 32./90., 12./90., 32./90., 7./90. }; - for (unsigned int i=0; in_quadrature_points; ++i) { - quadrature_points[i] = Point<1>(xpts[i]); - weights[i] = wts[i]; + this->quadrature_points[i] = Point<1>(xpts[i]); + this->weights[i] = wts[i]; }; }; @@ -345,10 +345,10 @@ QWeddle<1>::QWeddle () : 27./840., 216./840., 41./840. }; - for (unsigned int i=0; in_quadrature_points; ++i) { - quadrature_points[i] = Point<1>(xpts[i]); - weights[i] = wts[i]; + this->quadrature_points[i] = Point<1>(xpts[i]); + this->weights[i] = wts[i]; }; }; diff --git a/deal.II/deal.II/include/dofs/dof_accessor.templates.h b/deal.II/deal.II/include/dofs/dof_accessor.templates.h index 558f1626f0..65f7ca249e 100644 --- a/deal.II/deal.II/include/dofs/dof_accessor.templates.h +++ b/deal.II/deal.II/include/dofs/dof_accessor.templates.h @@ -68,7 +68,7 @@ inline DoFAccessor & DoFAccessor::operator = (const DoFAccessor &da) { - set_dof_handler (da.dof_handler); + this->set_dof_handler (da.dof_handler); return *this; }; @@ -93,15 +93,15 @@ DoFObjectAccessor<1,dim>::dof_index (const unsigned int i) const // qualified exception names typedef DoFAccessor BaseClass; - Assert (dof_handler != 0, typename BaseClass::ExcInvalidObject()); + Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); // make sure a FE has been selected // and enough room was reserved - Assert (dof_handler->selected_fe != 0, typename BaseClass::ExcInvalidObject()); - Assert (iselected_fe->dofs_per_line, - ExcIndexRange (i, 0, dof_handler->selected_fe->dofs_per_line)); + Assert (this->dof_handler->selected_fe != 0, typename BaseClass::ExcInvalidObject()); + Assert (idof_handler->selected_fe->dofs_per_line, + ExcIndexRange (i, 0, this->dof_handler->selected_fe->dofs_per_line)); - return dof_handler->levels[present_level] - ->line_dofs[present_index*dof_handler->selected_fe->dofs_per_line+i]; + return this->dof_handler->levels[this->present_level] + ->line_dofs[this->present_index*this->dof_handler->selected_fe->dofs_per_line+i]; }; @@ -122,16 +122,16 @@ DoFObjectAccessor<1,dim>::vertex_dof_index (const unsigned int vertex, // qualified exception names typedef DoFAccessor BaseClass; - Assert (dof_handler != 0, typename BaseClass::ExcInvalidObject()); - Assert (dof_handler->selected_fe != 0, typename BaseClass::ExcInvalidObject()); + Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); + Assert (this->dof_handler->selected_fe != 0, typename BaseClass::ExcInvalidObject()); Assert (vertex<2, ExcIndexRange (i,0,2)); - Assert (iselected_fe->dofs_per_vertex, - ExcIndexRange (i, 0, dof_handler->selected_fe->dofs_per_vertex)); + Assert (idof_handler->selected_fe->dofs_per_vertex, + ExcIndexRange (i, 0, this->dof_handler->selected_fe->dofs_per_vertex)); - const unsigned int dof_number = (vertex_index(vertex) * - dof_handler->selected_fe->dofs_per_vertex + + const unsigned int dof_number = (this->vertex_index(vertex) * + this->dof_handler->selected_fe->dofs_per_vertex + i); - return dof_handler->vertex_dofs[dof_number]; + return this->dof_handler->vertex_dofs[dof_number]; }; @@ -151,14 +151,14 @@ DoFObjectAccessor<1,dim>::get_dof_indices (std::vector &dof_indice // qualified exception names typedef DoFAccessor BaseClass; - Assert (dof_handler != 0, typename BaseClass::ExcInvalidObject()); - Assert (dof_handler->selected_fe != 0, typename BaseClass::ExcInvalidObject()); - Assert (dof_indices.size() == (2*dof_handler->get_fe().dofs_per_vertex + - dof_handler->get_fe().dofs_per_line), + Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); + Assert (this->dof_handler->selected_fe != 0, typename BaseClass::ExcInvalidObject()); + Assert (dof_indices.size() == (2*this->dof_handler->get_fe().dofs_per_vertex + + this->dof_handler->get_fe().dofs_per_line), typename BaseClass::ExcVectorDoesNotMatch()); - const unsigned int dofs_per_vertex = dof_handler->get_fe().dofs_per_vertex, - dofs_per_line = dof_handler->get_fe().dofs_per_line; + const unsigned int dofs_per_vertex = this->dof_handler->get_fe().dofs_per_vertex, + dofs_per_line = this->dof_handler->get_fe().dofs_per_line; std::vector::iterator next = dof_indices.begin(); for (unsigned int vertex=0; vertex<2; ++vertex) for (unsigned int d=0; d > DoFObjectAccessor<1,dim>::child (const unsigned int i) const { - TriaIterator > q (tria, - present_level+1, - child_index (i), - dof_handler); + TriaIterator > q (this->tria, + this->present_level+1, + this->child_index (i), + this->dof_handler); #ifdef DEBUG if (q.state() != IteratorState::past_the_end) @@ -192,7 +192,7 @@ void DoFObjectAccessor<1,dim>::copy_from (const DoFObjectAccessor<1,dim> &a) { BaseClass::copy_from (a); - set_dof_handler (a.dof_handler); + this->set_dof_handler (a.dof_handler); }; @@ -202,17 +202,17 @@ template inline unsigned int DoFObjectAccessor<2,dim>::dof_index (const unsigned int i) const { - Assert (dof_handler != 0, + Assert (this->dof_handler != 0, typename DoFAccessor::ExcInvalidObject()); // make sure a FE has been selected // and enough room was reserved - Assert (dof_handler->selected_fe != 0, + Assert (this->dof_handler->selected_fe != 0, typename DoFAccessor::ExcInvalidObject()); - Assert (iselected_fe->dofs_per_quad, - ExcIndexRange (i, 0, dof_handler->selected_fe->dofs_per_quad)); + Assert (idof_handler->selected_fe->dofs_per_quad, + ExcIndexRange (i, 0, this->dof_handler->selected_fe->dofs_per_quad)); - return dof_handler->levels[present_level] - ->quad_dofs[present_index*dof_handler->selected_fe->dofs_per_quad+i]; + return this->dof_handler->levels[this->present_level] + ->quad_dofs[this->present_index*this->dof_handler->selected_fe->dofs_per_quad+i]; }; @@ -222,18 +222,18 @@ unsigned int DoFObjectAccessor<2,dim>::vertex_dof_index (const unsigned int vertex, const unsigned int i) const { - Assert (dof_handler != 0, + Assert (this->dof_handler != 0, typename DoFAccessor::ExcInvalidObject()); - Assert (dof_handler->selected_fe != 0, + Assert (this->dof_handler->selected_fe != 0, typename DoFAccessor::ExcInvalidObject()); Assert (vertex<4, ExcIndexRange (i,0,4)); - Assert (iselected_fe->dofs_per_vertex, - ExcIndexRange (i, 0, dof_handler->selected_fe->dofs_per_vertex)); + Assert (idof_handler->selected_fe->dofs_per_vertex, + ExcIndexRange (i, 0, this->dof_handler->selected_fe->dofs_per_vertex)); - const unsigned int dof_number = (vertex_index(vertex) * - dof_handler->selected_fe->dofs_per_vertex + + const unsigned int dof_number = (this->vertex_index(vertex) * + this->dof_handler->selected_fe->dofs_per_vertex + i); - return dof_handler->vertex_dofs[dof_number]; + return this->dof_handler->vertex_dofs[dof_number]; }; @@ -248,18 +248,18 @@ inline void DoFObjectAccessor<2,dim>::get_dof_indices (std::vector &dof_indices) const { - Assert (dof_handler != 0, + Assert (this->dof_handler != 0, typename DoFAccessor::ExcInvalidObject()); - Assert (dof_handler->selected_fe != 0, + Assert (this->dof_handler->selected_fe != 0, typename DoFAccessor::ExcInvalidObject()); - Assert (dof_indices.size() == (4*dof_handler->get_fe().dofs_per_vertex + - 4*dof_handler->get_fe().dofs_per_line + - dof_handler->get_fe().dofs_per_quad), + Assert (dof_indices.size() == (4*this->dof_handler->get_fe().dofs_per_vertex + + 4*this->dof_handler->get_fe().dofs_per_line + + this->dof_handler->get_fe().dofs_per_quad), typename DoFAccessor::ExcVectorDoesNotMatch()); - const unsigned int dofs_per_vertex = dof_handler->get_fe().dofs_per_vertex, - dofs_per_line = dof_handler->get_fe().dofs_per_line, - dofs_per_quad = dof_handler->get_fe().dofs_per_quad; + const unsigned int dofs_per_vertex = this->dof_handler->get_fe().dofs_per_vertex, + dofs_per_line = this->dof_handler->get_fe().dofs_per_line, + dofs_per_quad = this->dof_handler->get_fe().dofs_per_quad; std::vector::iterator next = dof_indices.begin(); for (unsigned int vertex=0; vertex<4; ++vertex) for (unsigned int d=0; d::line (const unsigned int i) const return TriaIterator > ( - tria, - present_level, - line_index (i), - dof_handler + this->tria, + this->present_level, + this->line_index (i), + this->dof_handler ); }; @@ -294,10 +294,10 @@ inline TriaIterator > DoFObjectAccessor<2,dim>::child (const unsigned int i) const { - TriaIterator > q (tria, - present_level+1, - child_index (i), - dof_handler); + TriaIterator > q (this->tria, + this->present_level+1, + this->child_index (i), + this->dof_handler); #ifdef DEBUG if (q.state() != IteratorState::past_the_end) @@ -313,7 +313,7 @@ void DoFObjectAccessor<2,dim>::copy_from (const DoFObjectAccessor<2,dim> &a) { BaseClass::copy_from (a); - set_dof_handler (a.dof_handler); + this->set_dof_handler (a.dof_handler); }; @@ -325,17 +325,17 @@ inline unsigned int DoFObjectAccessor<3,dim>::dof_index (const unsigned int i) const { - Assert (dof_handler != 0, + Assert (this->dof_handler != 0, typename DoFAccessor::ExcInvalidObject()); // make sure a FE has been selected // and enough room was reserved - Assert (dof_handler->selected_fe != 0, + Assert (this->dof_handler->selected_fe != 0, typename DoFAccessor::ExcInvalidObject()); - Assert (iselected_fe->dofs_per_hex, - ExcIndexRange (i, 0, dof_handler->selected_fe->dofs_per_hex)); + Assert (idof_handler->selected_fe->dofs_per_hex, + ExcIndexRange (i, 0, this->dof_handler->selected_fe->dofs_per_hex)); - return dof_handler->levels[present_level] - ->hex_dofs[present_index*dof_handler->selected_fe->dofs_per_hex+i]; + return this->dof_handler->levels[this->present_level] + ->hex_dofs[this->present_index*this->dof_handler->selected_fe->dofs_per_hex+i]; }; @@ -345,18 +345,18 @@ unsigned int DoFObjectAccessor<3,dim>::vertex_dof_index (const unsigned int vertex, const unsigned int i) const { - Assert (dof_handler != 0, + Assert (this->dof_handler != 0, typename DoFAccessor::ExcInvalidObject()); - Assert (dof_handler->selected_fe != 0, + Assert (this->dof_handler->selected_fe != 0, typename DoFAccessor::ExcInvalidObject()); Assert (vertex<8, ExcIndexRange (i,0,8)); - Assert (iselected_fe->dofs_per_vertex, - ExcIndexRange (i, 0, dof_handler->selected_fe->dofs_per_vertex)); + Assert (idof_handler->selected_fe->dofs_per_vertex, + ExcIndexRange (i, 0, this->dof_handler->selected_fe->dofs_per_vertex)); - const unsigned int dof_number = (vertex_index(vertex) * - dof_handler->selected_fe->dofs_per_vertex + + const unsigned int dof_number = (this->vertex_index(vertex) * + this->dof_handler->selected_fe->dofs_per_vertex + i); - return dof_handler->vertex_dofs[dof_number]; + return this->dof_handler->vertex_dofs[dof_number]; }; @@ -365,20 +365,20 @@ inline void DoFObjectAccessor<3,dim>::get_dof_indices (std::vector &dof_indices) const { - Assert (dof_handler != 0, + Assert (this->dof_handler != 0, typename DoFAccessor::ExcInvalidObject()); - Assert (dof_handler->selected_fe != 0, + Assert (this->dof_handler->selected_fe != 0, typename DoFAccessor::ExcInvalidObject()); - Assert (dof_indices.size() == (8*dof_handler->get_fe().dofs_per_vertex + - 12*dof_handler->get_fe().dofs_per_line + - 6*dof_handler->get_fe().dofs_per_quad + - dof_handler->get_fe().dofs_per_hex), + Assert (dof_indices.size() == (8*this->dof_handler->get_fe().dofs_per_vertex + + 12*this->dof_handler->get_fe().dofs_per_line + + 6*this->dof_handler->get_fe().dofs_per_quad + + this->dof_handler->get_fe().dofs_per_hex), typename DoFAccessor::ExcVectorDoesNotMatch()); - const unsigned int dofs_per_vertex = dof_handler->get_fe().dofs_per_vertex, - dofs_per_line = dof_handler->get_fe().dofs_per_line, - dofs_per_quad = dof_handler->get_fe().dofs_per_quad, - dofs_per_hex = dof_handler->get_fe().dofs_per_hex; + const unsigned int dofs_per_vertex = this->dof_handler->get_fe().dofs_per_vertex, + dofs_per_line = this->dof_handler->get_fe().dofs_per_line, + dofs_per_quad = this->dof_handler->get_fe().dofs_per_quad, + dofs_per_hex = this->dof_handler->get_fe().dofs_per_hex; std::vector::iterator next = dof_indices.begin(); for (unsigned int vertex=0; vertex<8; ++vertex) for (unsigned int d=0; d::line (const unsigned int i) const TriaIterator > l = BaseClass::line(i); return TriaIterator > ( - tria, - present_level, + this->tria, + this->present_level, l->index(), - dof_handler + this->dof_handler ); }; @@ -419,10 +419,10 @@ DoFObjectAccessor<3,dim>::quad (const unsigned int i) const return TriaIterator > ( - tria, - present_level, - quad_index (i), - dof_handler + this->tria, + this->present_level, + this->quad_index (i), + this->dof_handler ); }; @@ -432,10 +432,10 @@ inline TriaIterator > DoFObjectAccessor<3,dim>::child (const unsigned int i) const { - TriaIterator > q (tria, - present_level+1, - child_index (i), - dof_handler); + TriaIterator > q (this->tria, + this->present_level+1, + this->child_index (i), + this->dof_handler); #ifdef DEBUG if (q.state() != IteratorState::past_the_end) @@ -449,7 +449,7 @@ template void DoFObjectAccessor<3,dim>::copy_from (const DoFObjectAccessor<3,dim> &a) { BaseClass::copy_from (a); - set_dof_handler (a.dof_handler); + this->set_dof_handler (a.dof_handler); }; @@ -461,10 +461,10 @@ inline TriaIterator > DoFCellAccessor::neighbor (const unsigned int i) const { - TriaIterator > q (tria, - neighbor_level (i), - neighbor_index (i), - dof_handler); + TriaIterator > q (this->tria, + this->neighbor_level (i), + this->neighbor_index (i), + this->dof_handler); #ifdef DEBUG if (q.state() != IteratorState::past_the_end) @@ -479,10 +479,10 @@ inline TriaIterator > DoFCellAccessor::child (const unsigned int i) const { - TriaIterator > q (tria, - present_level+1, - child_index (i), - dof_handler); + TriaIterator > q (this->tria, + this->present_level+1, + this->child_index (i), + this->dof_handler); #ifdef DEBUG if (q.state() != IteratorState::past_the_end) diff --git a/deal.II/deal.II/include/grid/tria_accessor.templates.h b/deal.II/deal.II/include/grid/tria_accessor.templates.h index e5d17ed87d..802d7b7c8c 100644 --- a/deal.II/deal.II/include/grid/tria_accessor.templates.h +++ b/deal.II/deal.II/include/grid/tria_accessor.templates.h @@ -117,9 +117,9 @@ inline bool TriaObjectAccessor<1,dim>::used () const { - Assert (state() == IteratorState::valid, + Assert (this->state() == IteratorState::valid, typename TriaAccessor::ExcDereferenceInvalidObject()); - return tria->levels[present_level]->lines.used[present_index]; + return this->tria->levels[this->present_level]->lines.used[this->present_index]; }; @@ -129,8 +129,8 @@ inline bool TriaObjectAccessor<1,dim>::user_flag_set () const { - Assert (used(), typename TriaAccessor::ExcCellNotUsed()); - return tria->levels[present_level]->lines.user_flags[present_index]; + Assert (this->used(), typename TriaAccessor::ExcCellNotUsed()); + return this->tria->levels[this->present_level]->lines.user_flags[this->present_index]; }; @@ -140,8 +140,8 @@ inline void TriaObjectAccessor<1,dim>::set_user_flag () const { - Assert (used(), typename TriaAccessor::ExcCellNotUsed()); - tria->levels[present_level]->lines.user_flags[present_index] = true; + Assert (this->used(), typename TriaAccessor::ExcCellNotUsed()); + this->tria->levels[this->present_level]->lines.user_flags[this->present_index] = true; }; @@ -151,8 +151,8 @@ inline void TriaObjectAccessor<1,dim>::clear_user_flag () const { - Assert (used(), typename TriaAccessor::ExcCellNotUsed()); - tria->levels[present_level]->lines.user_flags[present_index] = false; + Assert (this->used(), typename TriaAccessor::ExcCellNotUsed()); + this->tria->levels[this->present_level]->lines.user_flags[this->present_index] = false; }; @@ -165,7 +165,7 @@ TriaObjectAccessor<1,dim>::child (const unsigned int i) const Assert (i<2, ExcIndexRange(i,0,2)); TriaIterator > - q (tria, present_level+1, child_index (i)); + q (tria, this->present_level+1, child_index (i)); Assert ((q.state() == IteratorState::past_the_end) || q->used(), typename TriaAccessor::ExcUnusedCellAsChild()); @@ -181,7 +181,7 @@ int TriaObjectAccessor<1,dim>::child_index (unsigned const int i) const { Assert (i<2, ExcIndexRange(i,0,2)); - return tria->levels[present_level]->lines.children[present_index]+i; + return this->tria->levels[this->present_level]->lines.children[this->present_index]+i; }; @@ -191,9 +191,9 @@ inline bool TriaObjectAccessor<1,dim>::has_children () const { - Assert (state() == IteratorState::valid, + Assert (this->state() == IteratorState::valid, typename TriaAccessor::ExcDereferenceInvalidObject()); - return (tria->levels[present_level]->lines.children[present_index] != -1); + return (this->tria->levels[this->present_level]->lines.children[this->present_index] != -1); } @@ -218,22 +218,22 @@ inline void TriaObjectAccessor<1,dim>::operator ++ () { - ++present_index; + ++this->present_index; // is index still in the range of // the vector? - while (present_index + while (this->present_index >= - static_cast(tria->levels[present_level]->lines.lines.size())) + static_cast(this->tria->levels[this->present_level]->lines.lines.size())) { // no -> go one level up until we find // one with more than zero cells - ++present_level; - present_index = 0; + ++this->present_level; + this->present_index = 0; // highest level reached? - if (present_level >= static_cast(tria->levels.size())) + if (this->present_level >= static_cast(this->tria->levels.size())) { // return with past the end pointer - present_level = present_index = -1; + this->present_level = this->present_index = -1; return; }; }; @@ -246,22 +246,22 @@ inline void TriaObjectAccessor<1,dim>::operator -- () { - --present_index; + --this->present_index; // is index still in the range of // the vector? - while (present_index < 0) + while (this->present_index < 0) { // no -> go one level down - --present_level; + --this->present_level; // lowest level reached? - if (present_level == -1) + if (this->present_level == -1) { // return with past the end pointer - present_level = present_index = -1; + this->present_level = this->present_index = -1; return; }; // else - present_index = tria->levels[present_level]->lines.lines.size()-1; + this->present_index = this->tria->levels[this->present_level]->lines.lines.size()-1; }; }; @@ -274,9 +274,9 @@ inline bool TriaObjectAccessor<2,dim>::used () const { - Assert (state() == IteratorState::valid, + Assert (this->state() == IteratorState::valid, typename TriaAccessor::ExcDereferenceInvalidObject()); - return tria->levels[present_level]->quads.used[present_index]; + return this->tria->levels[this->present_level]->quads.used[this->present_index]; }; @@ -286,8 +286,8 @@ inline bool TriaObjectAccessor<2,dim>::user_flag_set () const { - Assert (used(), typename TriaAccessor::ExcCellNotUsed()); - return tria->levels[present_level]->quads.user_flags[present_index]; + Assert (this->used(), typename TriaAccessor::ExcCellNotUsed()); + return this->tria->levels[this->present_level]->quads.user_flags[this->present_index]; }; @@ -297,8 +297,8 @@ inline void TriaObjectAccessor<2,dim>::set_user_flag () const { - Assert (used(), typename TriaAccessor::ExcCellNotUsed()); - tria->levels[present_level]->quads.user_flags[present_index] = true; + Assert (this->used(), typename TriaAccessor::ExcCellNotUsed()); + this->tria->levels[this->present_level]->quads.user_flags[this->present_index] = true; }; @@ -308,8 +308,8 @@ inline void TriaObjectAccessor<2,dim>::clear_user_flag () const { - Assert (used(), typename TriaAccessor::ExcCellNotUsed()); - tria->levels[present_level]->quads.user_flags[present_index] = false; + Assert (this->used(), typename TriaAccessor::ExcCellNotUsed()); + this->tria->levels[this->present_level]->quads.user_flags[this->present_index] = false; }; @@ -323,7 +323,7 @@ TriaObjectAccessor<2,dim>::line (const unsigned int i) const TriaIterator > ( tria, - present_level, + this->present_level, line_index (i) ); }; @@ -337,7 +337,7 @@ TriaObjectAccessor<2,dim>::line_index (const unsigned int i) const { Assert (i<4, ExcIndexRange(i,0,4)); - return tria->levels[present_level]->quads.quads[present_index].line(i); + return this->tria->levels[this->present_level]->quads.quads[this->present_index].line(i); }; @@ -350,7 +350,7 @@ TriaObjectAccessor<2,dim>::child (const unsigned int i) const Assert (i<4, ExcIndexRange(i,0,4)); TriaIterator > - q (tria, present_level+1, child_index (i)); + q (tria, this->present_level+1, child_index (i)); Assert ((q.state() == IteratorState::past_the_end) || q->used(), typename TriaAccessor::ExcUnusedCellAsChild()); @@ -365,7 +365,7 @@ inline int TriaObjectAccessor<2,dim>::child_index (const unsigned int i) const { Assert (i<4, ExcIndexRange(i,0,4)); - return tria->levels[present_level]->quads.children[present_index]+i; + return this->tria->levels[this->present_level]->quads.children[this->present_index]+i; }; @@ -375,9 +375,9 @@ inline bool TriaObjectAccessor<2,dim>::has_children () const { - Assert (state() == IteratorState::valid, + Assert (this->state() == IteratorState::valid, typename TriaAccessor::ExcDereferenceInvalidObject()); - return (tria->levels[present_level]->quads.children[present_index] != -1); + return (this->tria->levels[this->present_level]->quads.children[this->present_index] != -1); }; @@ -405,21 +405,21 @@ inline void TriaObjectAccessor<2,dim>::operator ++ () { - ++present_index; + ++this->present_index; // is index still in the range of // the vector? - while (present_index + while (this->present_index >= - static_cast(tria->levels[present_level]->quads.quads.size())) + static_cast(this->tria->levels[this->present_level]->quads.quads.size())) { // no -> go one level up - ++present_level; - present_index = 0; + ++this->present_level; + this->present_index = 0; // highest level reached? - if (present_level >= static_cast(tria->levels.size())) + if (this->present_level >= static_cast(this->tria->levels.size())) { // return with past the end pointer - present_level = present_index = -1; + this->present_level = this->present_index = -1; return; }; }; @@ -432,22 +432,22 @@ inline void TriaObjectAccessor<2,dim>::operator -- () { - --present_index; + --this->present_index; // is index still in the range of // the vector? - while (present_index < 0) + while (this->present_index < 0) { // no -> go one level down - --present_level; + --this->present_level; // lowest level reached? - if (present_level == -1) + if (this->present_level == -1) { // return with past the end pointer - present_level = present_index = -1; + this->present_level = this->present_index = -1; return; }; // else - present_index = tria->levels[present_level]->quads.quads.size()-1; + this->present_index = this->tria->levels[this->present_level]->quads.quads.size()-1; }; }; @@ -460,9 +460,9 @@ inline bool TriaObjectAccessor<3,dim>::used () const { - Assert (state() == IteratorState::valid, + Assert (this->state() == IteratorState::valid, typename TriaAccessor::ExcDereferenceInvalidObject()); - return tria->levels[present_level]->hexes.used[present_index]; + return this->tria->levels[this->present_level]->hexes.used[this->present_index]; }; @@ -472,8 +472,8 @@ inline bool TriaObjectAccessor<3,dim>::user_flag_set () const { - Assert (used(), typename TriaAccessor::ExcCellNotUsed()); - return tria->levels[present_level]->hexes.user_flags[present_index]; + Assert (this->used(), typename TriaAccessor::ExcCellNotUsed()); + return this->tria->levels[this->present_level]->hexes.user_flags[this->present_index]; }; @@ -483,8 +483,8 @@ inline void TriaObjectAccessor<3,dim>::set_user_flag () const { - Assert (used(), typename TriaAccessor::ExcCellNotUsed()); - tria->levels[present_level]->hexes.user_flags[present_index] = true; + Assert (this->used(), typename TriaAccessor::ExcCellNotUsed()); + this->tria->levels[this->present_level]->hexes.user_flags[this->present_index] = true; }; @@ -493,8 +493,8 @@ template inline void TriaObjectAccessor<3,dim>::clear_user_flag () const { - Assert (used(), typename TriaAccessor::ExcCellNotUsed()); - tria->levels[present_level]->hexes.user_flags[present_index] = false; + Assert (this->used(), typename TriaAccessor::ExcCellNotUsed()); + this->tria->levels[this->present_level]->hexes.user_flags[this->present_index] = false; }; @@ -504,7 +504,7 @@ inline TriaIterator > TriaObjectAccessor<3,dim>::line (const unsigned int i) const { - Assert (used(), typename TriaAccessor::ExcCellNotUsed()); + Assert (this->used(), typename TriaAccessor::ExcCellNotUsed()); Assert (i<12, ExcIndexRange (i,0,12)); // egcs 1.1.2 gets into trouble if we @@ -543,12 +543,12 @@ inline TriaIterator > TriaObjectAccessor<3,dim>::quad (const unsigned int i) const { - Assert (used(), typename TriaAccessor::ExcCellNotUsed()); + Assert (this->used(), typename TriaAccessor::ExcCellNotUsed()); return TriaIterator > ( tria, - present_level, + this->present_level, quad_index (i) ); }; @@ -592,7 +592,7 @@ TriaObjectAccessor<3,dim>::quad_index (const unsigned int i) const { Assert (i<6, ExcIndexRange(i,0,6)); - return tria->levels[present_level]->hexes.hexes[present_index].quad(i); + return this->tria->levels[this->present_level]->hexes.hexes[this->present_index].quad(i); }; @@ -604,7 +604,7 @@ TriaObjectAccessor<3,dim>::child (const unsigned int i) const { Assert (i<8, ExcIndexRange(i,0,8)); - TriaIterator > q (tria, present_level+1, child_index (i)); + TriaIterator > q (tria, this->present_level+1, child_index (i)); Assert ((q.state() == IteratorState::past_the_end) || q->used(), typename TriaAccessor::ExcUnusedCellAsChild()); @@ -619,7 +619,7 @@ inline int TriaObjectAccessor<3,dim>::child_index (const unsigned int i) const { Assert (i<8, ExcIndexRange(i,0,8)); - return tria->levels[present_level]->hexes.children[present_index]+i; + return this->tria->levels[this->present_level]->hexes.children[this->present_index]+i; }; @@ -627,9 +627,9 @@ int TriaObjectAccessor<3,dim>::child_index (const unsigned int i) const template bool TriaObjectAccessor<3,dim>::has_children () const { - Assert (state() == IteratorState::valid, + Assert (this->state() == IteratorState::valid, typename TriaAccessor::ExcDereferenceInvalidObject()); - return (tria->levels[present_level]->hexes.children[present_index] != -1); + return (this->tria->levels[this->present_level]->hexes.children[this->present_index] != -1); }; @@ -663,21 +663,21 @@ inline void TriaObjectAccessor<3,dim>::operator ++ () { - ++present_index; + ++this->present_index; // is index still in the range of // the vector? - while (present_index + while (this->present_index >= - static_cast(tria->levels[present_level]->hexes.hexes.size())) + static_cast(this->tria->levels[this->present_level]->hexes.hexes.size())) { // no -> go one level up - ++present_level; - present_index = 0; + ++this->present_level; + this->present_index = 0; // highest level reached? - if (present_level >= static_cast(tria->levels.size())) + if (this->present_level >= static_cast(this->tria->levels.size())) { // return with past the end pointer - present_level = present_index = -1; + this->present_level = this->present_index = -1; return; }; }; @@ -690,22 +690,22 @@ inline void TriaObjectAccessor<3,dim>::operator -- () { - --present_index; + --this->present_index; // is index still in the range of // the vector? - while (present_index < 0) + while (this->present_index < 0) { // no -> go one level down - --present_level; + --this->present_level; // lowest level reached? - if (present_level == -1) + if (this->present_level == -1) { // return with past the end pointer - present_level = present_index = -1; + this->present_level = this->present_index = -1; return; }; // else - present_index = tria->levels[present_level]->hexes.hexes.size()-1; + this->present_index = this->tria->levels[this->present_level]->hexes.hexes.size()-1; }; }; @@ -718,8 +718,8 @@ inline bool TriaObjectAccessor::used () const { - Assert (state() == IteratorState::valid, ExcDereferenceInvalidObject()); - return tria->levels[present_level]->hexes.used[present_index]; + Assert (this->state() == IteratorState::valid, ExcDereferenceInvalidObject()); + return this->tria->levels[this->present_level]->hexes.used[this->present_index]; }; @@ -729,8 +729,8 @@ inline bool TriaObjectAccessor::user_flag_set () const { - Assert (used(), ExcCellNotUsed()); - return tria->levels[present_level]->hexes.user_flags[present_index]; + Assert (this->used(), ExcCellNotUsed()); + return this->tria->levels[this->present_level]->hexes.user_flags[this->present_index]; }; @@ -740,8 +740,8 @@ inline void TriaObjectAccessor::set_user_flag () const { - Assert (used(), ExcCellNotUsed()); - tria->levels[present_level]->hexes.user_flags[present_index] = true; + Assert (this->used(), ExcCellNotUsed()); + this->tria->levels[this->present_level]->hexes.user_flags[this->present_index] = true; }; @@ -750,8 +750,8 @@ template inline void TriaObjectAccessor::clear_user_flag () const { - Assert (used(), ExcCellNotUsed()); - tria->levels[present_level]->hexes.user_flags[present_index] = false; + Assert (this->used(), ExcCellNotUsed()); + this->tria->levels[this->present_level]->hexes.user_flags[this->present_index] = false; }; @@ -761,7 +761,7 @@ inline TriaIterator > TriaObjectAccessor::line (const unsigned int i) const { - Assert (used(), ExcCellNotUsed()); + Assert (this->used(), ExcCellNotUsed()); Assert (i < GeometryInfo::lines_per_cell, ExcIndexRange(i,0,GeometryInfo::lines_per_cell)); @@ -771,8 +771,8 @@ TriaObjectAccessor::line (const unsigned int i) const return TriaIterator > ( - tria, - present_level, + this->tria, + this->present_level, line_index (i) ); case 3: @@ -798,7 +798,7 @@ TriaObjectAccessor::line (const unsigned int i) const Assert(false, ExcNotImplemented()); } - return TriaIterator >(tria, -1, -1, 0); + return TriaIterator >(this->tria, -1, -1, 0); }; @@ -808,14 +808,14 @@ inline TriaIterator > TriaObjectAccessor::quad (const unsigned int i) const { - Assert (used(), ExcCellNotUsed()); + Assert (this->used(), ExcCellNotUsed()); Assert (i < GeometryInfo::quads_per_cell, ExcIndexRange(i,0,GeometryInfo::quads_per_cell)); return TriaIterator > ( - tria, - present_level, + this->tria, + this->present_level, quad_index (i) ); }; @@ -833,8 +833,8 @@ TriaObjectAccessor::line_index (const unsigned int i) const switch(celldim) { case 2: - return tria->levels[present_level] - ->quads.quads[present_index].line(i); + return this->tria->levels[this->present_level] + ->quads.quads[this->present_index].line(i); case 3: if (i<4) return quad(0)->line_index(i); @@ -870,7 +870,7 @@ TriaObjectAccessor::quad_index (const unsigned int i) const Assert (i < GeometryInfo::quads_per_cell, ExcIndexRange(i,0,GeometryInfo::quads_per_cell)); - return tria->levels[present_level]->hexes.hexes[present_index].quad(i); + return this->tria->levels[this->present_level]->hexes.hexes[this->present_index].quad(i); }; @@ -884,7 +884,7 @@ TriaObjectAccessor::child (const unsigned int i) const ExcIndexRange(i,0,GeometryInfo::children_per_cell)); TriaIterator > - q (tria, present_level+1, child_index (i)); + q (this->tria, this->present_level+1, child_index (i)); Assert ((q.state() == IteratorState::past_the_end) || q->used(), ExcUnusedCellAsChild()); @@ -900,7 +900,7 @@ int TriaObjectAccessor::child_index (const unsigned int i) const { Assert (i < GeometryInfo::children_per_cell, ExcIndexRange(i,0,GeometryInfo::children_per_cell)); - return tria->levels[present_level]->hexes.children[present_index]+i; + return this->tria->levels[this->present_level]->hexes.children[this->present_index]+i; }; @@ -908,9 +908,9 @@ int TriaObjectAccessor::child_index (const unsigned int i) const template bool TriaObjectAccessor::has_children () const { - Assert (state() == IteratorState::valid, + Assert (this->state() == IteratorState::valid, typename TriaAccessor::ExcDereferenceInvalidObject()); - return (tria->levels[present_level]->hexes.children[present_index] != -1); + return (this->tria->levels[this->present_level]->hexes.children[this->present_index] != -1); }; @@ -931,10 +931,10 @@ TriaObjectAccessor::max_refinement_depth () const child(5)->max_refinement_depth() + 1, child(6)->max_refinement_depth() + 1, child(7)->max_refinement_depth() + 1 }; - return max (max (max (depths[0], depths[1]), - max (depths[2], depths[3])), - max (max (depths[4], depths[5]), - max (depths[6], depths[7]))); + return std::max (std::max (std::max (depths[0], depths[1]), + std::max (depths[2], depths[3])), + std::max (std::max (depths[4], depths[5]), + std::max (depths[6], depths[7]))); }; @@ -944,21 +944,21 @@ inline void TriaObjectAccessor::operator ++ () { - ++present_index; + ++this->present_index; // is index still in the range of // the vector? - while (present_index + while (this->present_index >= - static_cast(tria->levels[present_level]->hexes.hexes.size())) + static_cast(this->tria->levels[this->present_level]->hexes.hexes.size())) { // no -> go one level up - ++present_level; - present_index = 0; + ++this->present_level; + this->present_index = 0; // highest level reached? - if (present_level >= static_cast(tria->levels.size())) + if (this->present_level >= static_cast(this->tria->levels.size())) { // return with past the end pointer - present_level = present_index = -1; + this->present_level = this->present_index = -1; return; }; }; @@ -971,22 +971,22 @@ inline void TriaObjectAccessor::operator -- () { - --present_index; + --this->present_index; // is index still in the range of // the vector? - while (present_index < 0) + while (this->present_index < 0) { // no -> go one level down - --present_level; + --this->present_level; // lowest level reached? - if (present_level == -1) + if (this->present_level == -1) { // return with past the end pointer - present_level = present_index = -1; + this->present_level = this->present_index = -1; return; }; // else - present_index = tria->levels[present_level]->hexes.hexes.size()-1; + this->present_index = this->tria->levels[this->present_level]->hexes.hexes.size()-1; }; }; @@ -1010,7 +1010,7 @@ inline Triangulation<2>::face_iterator CellAccessor<2>::face (const unsigned int i) const { - return line(i); + return this->line(i); }; @@ -1032,8 +1032,8 @@ CellAccessor::neighbor_index (const unsigned int i) const { Assert (i::faces_per_cell, typename TriaAccessor::ExcInvalidNeighbor(i)); - return tria->levels[present_level]-> - neighbors[present_index*GeometryInfo::faces_per_cell+i].second; + return this->tria->levels[this->present_level]-> + neighbors[this->present_index*GeometryInfo::faces_per_cell+i].second; }; @@ -1045,8 +1045,8 @@ CellAccessor::neighbor_level (const unsigned int i) const { Assert (i::faces_per_cell, typename TriaAccessor::ExcInvalidNeighbor(i)); - return tria->levels[present_level]-> - neighbors[present_index*GeometryInfo::faces_per_cell+i].first; + return this->tria->levels[this->present_level]-> + neighbors[this->present_index*GeometryInfo::faces_per_cell+i].first; }; @@ -1056,15 +1056,15 @@ inline bool CellAccessor::refine_flag_set () const { - Assert (used(), typename TriaAccessor::ExcCellNotUsed()); + Assert (this->used(), typename TriaAccessor::ExcCellNotUsed()); // cells flagged for refinement must be active // (the @p{set_refine_flag} function checks this, // but activity may change when refinement is // executed and for some reason the refine // flag is not cleared). - Assert (active() || !tria->levels[present_level]->refine_flags[present_index], + Assert (this->active() || !this->tria->levels[this->present_level]->refine_flags[this->present_index], ExcRefineCellNotActive()); - return tria->levels[present_level]->refine_flags[present_index]; + return this->tria->levels[this->present_level]->refine_flags[this->present_index]; }; @@ -1074,11 +1074,11 @@ inline void CellAccessor::set_refine_flag () const { - Assert (used() && active(), ExcRefineCellNotActive()); + Assert (this->used() && this->active(), ExcRefineCellNotActive()); Assert (!coarsen_flag_set(), ExcCellFlaggedForCoarsening()); - tria->levels[present_level]->refine_flags[present_index] = true; + this->tria->levels[this->present_level]->refine_flags[this->present_index] = true; }; @@ -1088,8 +1088,8 @@ inline void CellAccessor::clear_refine_flag () const { - Assert (used() && active(), ExcRefineCellNotActive()); - tria->levels[present_level]->refine_flags[present_index] = false; + Assert (this->used() && this->active(), ExcRefineCellNotActive()); + this->tria->levels[this->present_level]->refine_flags[this->present_index] = false; }; @@ -1099,15 +1099,15 @@ inline bool CellAccessor::coarsen_flag_set () const { - Assert (used(), typename TriaAccessor::ExcCellNotUsed()); + Assert (this->used(), typename TriaAccessor::ExcCellNotUsed()); // cells flagged for coarsening must be active // (the @p{set_refine_flag} function checks this, // but activity may change when refinement is // executed and for some reason the refine // flag is not cleared). - Assert (active() || !tria->levels[present_level]->coarsen_flags[present_index], + Assert (this->active() || !this->tria->levels[this->present_level]->coarsen_flags[this->present_index], ExcRefineCellNotActive()); - return tria->levels[present_level]->coarsen_flags[present_index]; + return this->tria->levels[this->present_level]->coarsen_flags[this->present_index]; }; @@ -1117,10 +1117,10 @@ inline void CellAccessor::set_coarsen_flag () const { - Assert (used() && active(), ExcRefineCellNotActive()); + Assert (this->used() && this->active(), ExcRefineCellNotActive()); Assert (!refine_flag_set(), ExcCellFlaggedForRefinement()); - tria->levels[present_level]->coarsen_flags[present_index] = true; + this->tria->levels[this->present_level]->coarsen_flags[this->present_index] = true; }; @@ -1130,8 +1130,8 @@ inline void CellAccessor::clear_coarsen_flag () const { - Assert (used() && active(), ExcRefineCellNotActive()); - tria->levels[present_level]->coarsen_flags[present_index] = false; + Assert (this->used() && this->active(), ExcRefineCellNotActive()); + this->tria->levels[this->present_level]->coarsen_flags[this->present_index] = false; }; @@ -1142,7 +1142,7 @@ TriaIterator > CellAccessor::neighbor (const unsigned int i) const { TriaIterator > - q (tria, neighbor_level (i), neighbor_index (i)); + q (this->tria, neighbor_level (i), neighbor_index (i)); Assert ((q.state() == IteratorState::past_the_end) || q->used(), typename TriaAccessor::ExcUnusedCellAsNeighbor()); @@ -1158,7 +1158,7 @@ TriaIterator > CellAccessor::child (const unsigned int i) const { TriaIterator > - q (tria, present_level+1, child_index (i)); + q (this->tria, this->present_level+1, this->child_index (i)); Assert ((q.state() == IteratorState::past_the_end) || q->used(), typename TriaAccessor::ExcUnusedCellAsChild()); @@ -1173,7 +1173,7 @@ inline bool CellAccessor::active () const { - return !has_children(); + return !this->has_children(); }; diff --git a/deal.II/lac/include/lac/full_matrix.templates.h b/deal.II/lac/include/lac/full_matrix.templates.h index 8734282943..2f6ad1bdd7 100644 --- a/deal.II/lac/include/lac/full_matrix.templates.h +++ b/deal.II/lac/include/lac/full_matrix.templates.h @@ -92,8 +92,8 @@ template FullMatrix & FullMatrix::operator *= (const double factor) { - number *p = &el(0,0); - const number *e = &el(0,0) + n()*m(); + number *p = &this->el(0,0); + const number *e = &this->el(0,0) + n()*m(); while (p != e) *p++ *= factor; @@ -291,7 +291,7 @@ void FullMatrix::Tvmult (Vector &dst, { number2 s = 0.; for (unsigned int j=0; jel(j,i); dst(i) = s; }; } @@ -301,7 +301,7 @@ void FullMatrix::Tvmult (Vector &dst, { number2 s = 0.; for (unsigned int j=0; jel(j,i); dst(i) += s; }; }; @@ -327,7 +327,7 @@ double FullMatrix::residual (Vector& dst, { s = right(i); for (unsigned int j=0; jel(i,j); dst(i) = s; res += s*s; } @@ -352,8 +352,8 @@ void FullMatrix::forward (Vector &dst, for (i=0; iel(i,j); + dst(i) = s/this->el(i,i); } } @@ -372,8 +372,8 @@ void FullMatrix::backward (Vector &dst, for (int i=nu-1; i>=0; --i) { s = src(i); - for (j=i+1; jel(i,j); + dst(i) = s/this->el(i,i); } } @@ -390,7 +390,7 @@ void FullMatrix::fill (const FullMatrix &src, for (unsigned int ii=0; iiel(ii+i,jj+j) = src.el(ii,jj); } @@ -400,14 +400,14 @@ void FullMatrix::fill_permutation (const FullMatrix &src, const std::vector& p_rows, const std::vector& p_cols) { - Assert (p_rows.size() == n_rows(), - ExcDimensionMismatch (p_rows.size(), n_rows())); - Assert (p_cols.size() == n_cols(), - ExcDimensionMismatch (p_cols.size(), n_cols())); - - for (unsigned int i=0;in_rows(), + ExcDimensionMismatch (p_rows.size(), this->n_rows())); + Assert (p_cols.size() == this->n_cols(), + ExcDimensionMismatch (p_cols.size(), this->n_cols())); + + for (unsigned int i=0;in_rows();++i) + for (unsigned int j=0;jn_cols();++j) + this->el(i,j) = src(p_rows[i], p_cols[j]); } @@ -430,7 +430,7 @@ void FullMatrix::add_row (const unsigned int i, Assert (this->data() != 0, ExcEmptyMatrix()); for (unsigned int k=0; kel(i,k) += s*this->el(j,k); } @@ -445,7 +445,7 @@ void FullMatrix::add_row (const unsigned int i, const unsigned int size_m = m(); for (unsigned l=0; lel(i,l) += s*this->el(j,l) + t*this->el(k,l); } @@ -456,7 +456,7 @@ void FullMatrix::add_col (const unsigned int i, const number s, Assert (this->data() != 0, ExcEmptyMatrix()); for (unsigned int k=0; kel(k,i) += s*this->el(k,j); } @@ -468,7 +468,7 @@ void FullMatrix::add_col (const unsigned int i, const number s, Assert (this->data() != 0, ExcEmptyMatrix()); for (unsigned int l=0; lel(l,i) += s*this->el(l,j) + t*this->el(l,k); } @@ -480,7 +480,7 @@ void FullMatrix::swap_row (const unsigned int i, const unsigned int j) number s; for (unsigned int k=0; kel(i,k); this->el(i,k) = this->el(j,k); this->el(j,k) = s; } } @@ -493,7 +493,7 @@ void FullMatrix::swap_col (const unsigned int i, const unsigned int j) number s; for (unsigned int k=0; kel(k,i); this->el(k,i) = this->el(k,j); this->el(k,j) = s; } } @@ -505,7 +505,7 @@ void FullMatrix::diagadd (const number src) Assert (m() == n(), ExcDimensionMismatch(m(),n())); for (unsigned int i=0; iel(i,i) += src; } @@ -526,7 +526,7 @@ void FullMatrix::mmult (FullMatrix &dst, { number2 s = 0.; for (unsigned k=0; kel(i,k) * src.el(k,j); dst.el(i,j) = s; } else @@ -535,7 +535,7 @@ void FullMatrix::mmult (FullMatrix &dst, { number2 s = 0.; for (unsigned k=0; kel(i,k) * src.el(k,j); dst.el(i,j) += s; } } @@ -559,7 +559,7 @@ void FullMatrix::Tmmult (FullMatrix &dst, { number2 s = 0; for (unsigned int k=0; kel(k,i) * src.el(k,j); dst.el(i,j) = s; } else @@ -568,7 +568,7 @@ void FullMatrix::Tmmult (FullMatrix &dst, { number2 s = 0; for (unsigned int k=0; kel(k,i) * src.el(k,j); dst.el(i,j) += s; } } @@ -646,8 +646,8 @@ FullMatrix::symmetrize () for (unsigned int i=0; iel(i,j) + this->el(j,i)) / 2; + this->el(i,j) = this->el(j,i) = t; }; }; @@ -664,7 +664,7 @@ number FullMatrix::l1_norm () const { sum=0; for (unsigned int row=0; rowel(row,col)); if (sum > max) max = sum; } @@ -684,7 +684,7 @@ number FullMatrix::linfty_norm () const { sum=0; for (unsigned int col=0; colel(row,col)); if (sum > max) max = sum; } @@ -700,10 +700,10 @@ FullMatrix::print (std::ostream &s, { Assert (this->data() != 0, ExcEmptyMatrix()); - for (unsigned int i=0; im(); ++i) { - for (unsigned int j=0; jn(); ++j) + s << std::setw(w) << std::setprecision(p) << this->el(i,j); s << std::endl; } } @@ -1111,9 +1111,10 @@ FullMatrix::determinant () const { Assert (this->data() != 0, ExcEmptyMatrix()); - Assert (n_cols() == n_rows(), - ExcDimensionMismatch(n_cols(), n_rows())); - Assert ((n_cols()>=1) && (n_cols()<=3), ExcNotImplemented(n_cols())); + Assert (this->n_cols() == this->n_rows(), + ExcDimensionMismatch(this->n_cols(), this->n_rows())); + Assert ((this->n_cols()>=1) && (this->n_cols()<=3), + ExcNotImplemented(this->n_cols())); switch (this->n_cols()) { @@ -1174,11 +1175,12 @@ FullMatrix::invert (const FullMatrix &M) { Assert (this->data() != 0, ExcEmptyMatrix()); - Assert (n_cols() == n_rows(), ExcNotQuadratic()); - Assert (n_cols() == M.n_cols(), - ExcDimensionMismatch(n_cols(),M.n_cols())); - Assert (n_rows() == M.n_rows(), - ExcDimensionMismatch(n_rows(),M.n_rows())); + Assert (this->n_cols() == this->n_rows(), + ExcNotQuadratic()); + Assert (this->n_cols() == M.n_cols(), + ExcDimensionMismatch(this->n_cols(), M.n_cols())); + Assert (this->n_rows() == M.n_rows(), + ExcDimensionMismatch(this->n_rows(), M.n_rows())); switch (this->n_cols()) { @@ -1363,7 +1365,7 @@ FullMatrix::print_formatted (std::ostream &out, { unsigned int width = width_; - Assert ((this->data() != 0) || (n_cols()+n_rows()==0), + Assert ((this->data() != 0) || (this->n_cols()+this->n_rows()==0), ExcInternalError()); // set output format, but store old @@ -1406,7 +1408,7 @@ void FullMatrix::gauss_jordan() { Assert (this->data() != 0, ExcEmptyMatrix()); - Assert (n_cols() == n_rows(), ExcNotQuadratic()); + Assert (this->n_cols() == this->n_rows(), ExcNotQuadratic()); // Gauss-Jordan-Algorithmus // cf. Stoer I (4th Edition) p. 153 @@ -1497,9 +1499,11 @@ FullMatrix::householder(Vector& src) { Assert (this->data() != 0, ExcEmptyMatrix()); - // m > n, src.n() = m - Assert (n_cols() <= n_rows(), ExcDimensionMismatch(n_cols(), n_rows())); - Assert (src.size() == n_rows(), ExcDimensionMismatch(src.size(), n_rows())); + // m > n, src.n() = m + Assert (this->n_cols() <= this->n_rows(), + ExcDimensionMismatch(this->n_cols(), this->n_rows())); + Assert (src.size() == this->n_rows(), + ExcDimensionMismatch(src.size(), this->n_rows())); for (unsigned int j=0 ; j // exceptions that do not take // args... typedef PreconditionBlock BaseClass; - Assert(A!=0, ExcNotInitialized()); + Assert(this->A!=0, ExcNotInitialized()); - const SparseMatrix &M=*A; - const unsigned int n_cells=M.m()/blocksize; + const SparseMatrix &M=*this->A; + const unsigned int n_cells=M.m()/this->blocksize; - Vector b_cell(blocksize), x_cell(blocksize); + Vector b_cell(this->blocksize), x_cell(this->blocksize); // cell_row, cell_column are the // numbering of the blocks (cells). @@ -264,48 +264,56 @@ void PreconditionBlockJacobi // of the unkowns. unsigned int row, row_cell, begin_diag_block=0; - if (!inverses_ready()) + if (!this->inverses_ready()) { - FullMatrix M_cell(blocksize); + FullMatrix M_cell(this->blocksize); for (unsigned int cell=0; cellblocksize, row_cell=0; + row_cellblocksize; + ++row_cell, ++row) { b_cell(row_cell)=src(row); - for (unsigned int column_cell=0, column=cell*blocksize; - column_cellblocksize; + column_cellblocksize; ++column_cell, ++column) M_cell(row_cell,column_cell)=M(row,column); } M_cell.householder(b_cell); M_cell.backward(x_cell,b_cell); // distribute x_cell to dst - for (row=cell*blocksize, row_cell=0; row_cellblocksize, row_cell=0; + row_cellblocksize; + ++row_cell, ++row) if (adding) dst(row)+=x_cell(row_cell); else dst(row)=x_cell(row_cell); - begin_diag_block+=blocksize; + begin_diag_block+=this->blocksize; } } else for (unsigned int cell=0; cellblocksize, row_cell=0; + row_cellblocksize; + ++row_cell, ++row) { b_cell(row_cell)=src(row); } - inverse(cell).vmult(x_cell, b_cell); + this->inverse(cell).vmult(x_cell, b_cell); // distribute x_cell to dst - for (row=cell*blocksize, row_cell=0; row_cellblocksize, row_cell=0; + row_cellblocksize; + ++row_cell, ++row) if (adding) dst(row)+=x_cell(row_cell); else dst(row)=x_cell(row_cell); - begin_diag_block+=blocksize; + begin_diag_block+=this->blocksize; } - dst.scale(relaxation); + dst.scale(this->relaxation); } @@ -374,16 +382,16 @@ void PreconditionBlockSOR::vmult (Vector &ds // args... typedef PreconditionBlock BaseClass; - Assert (A!=0, ExcNotInitialized()); + Assert (this->A!=0, ExcNotInitialized()); - const SparseMatrix &M=*A; - const unsigned int n_cells=M.m()/blocksize; + const SparseMatrix &M=*this->A; + const unsigned int n_cells=M.m()/this->blocksize; const SparsityPattern &spars = M.get_sparsity_pattern(); const unsigned int *rowstart = spars.get_rowstart_indices(); const unsigned int *columns = spars.get_column_numbers(); - Vector b_cell(blocksize), x_cell(blocksize); + Vector b_cell(this->blocksize), x_cell(this->blocksize); // cell_row, cell_column are the // numbering of the blocks (cells). @@ -395,35 +403,42 @@ void PreconditionBlockSOR::vmult (Vector &ds unsigned int row, column, row_cell, begin_diag_block=0; number2 b_cell_row; - if (!inverses_ready()) + if (!this->inverses_ready()) { - FullMatrix M_cell(blocksize); + FullMatrix M_cell(this->blocksize); for (unsigned int cell=0; cellblocksize, row_cell=0; + row_cellblocksize; + ++row_cell, ++row) { b_cell_row=src(row); for (unsigned int j=rowstart[row]; jblocksize; + column_cellblocksize; + ++column_cell, ++column) M_cell(row_cell,column_cell)=M(row,column); } M_cell.householder(b_cell); M_cell.backward(x_cell,b_cell); // distribute x_cell to dst - for (row=cell*blocksize, row_cell=0; row_cellblocksize, row_cell=0; + row_cellblocksize; + ++row_cell, ++row) + dst(row)=this->relaxation*x_cell(row_cell); - begin_diag_block+=blocksize; + begin_diag_block+=this->blocksize; } } else for (unsigned int cell=0; cellblocksize, row_cell=0; + row_cellblocksize; + ++row_cell, ++row) { b_cell_row=src(row); for (unsigned int j=rowstart[row]; j::vmult (Vector &ds } b_cell(row_cell)=b_cell_row; } - inverse(cell).vmult(x_cell, b_cell); + this->inverse(cell).vmult(x_cell, b_cell); // distribute x_cell to dst - for (row=cell*blocksize, row_cell=0; row_cellblocksize, row_cell=0; + row_cellblocksize; + ++row_cell, ++row) + dst(row)=this->relaxation*x_cell(row_cell); - begin_diag_block+=blocksize; + begin_diag_block+=this->blocksize; } } @@ -466,16 +483,16 @@ void PreconditionBlockSOR::Tvmult (Vector &d // args... typedef PreconditionBlock BaseClass; - Assert (A!=0, ExcNotInitialized()); + Assert (this->A!=0, ExcNotInitialized()); - const SparseMatrix &M=*A; - const unsigned int n_cells=M.m()/blocksize; + const SparseMatrix &M=*this->A; + const unsigned int n_cells=M.m()/this->blocksize; const SparsityPattern &spars = M.get_sparsity_pattern(); const unsigned int *rowstart = spars.get_rowstart_indices(); const unsigned int *columns = spars.get_column_numbers(); - Vector b_cell(blocksize), x_cell(blocksize); + Vector b_cell(this->blocksize), x_cell(this->blocksize); // cell_row, cell_column are the // numbering of the blocks (cells). @@ -484,17 +501,20 @@ void PreconditionBlockSOR::Tvmult (Vector &d // blocks. // row, column are the global numbering // of the unkowns. - unsigned int row, column, row_cell, end_diag_block=blocksize *n_cells; + unsigned int row, column, row_cell; + unsigned int end_diag_block=this->blocksize *n_cells; number2 b_cell_row; - if (!inverses_ready()) + if (!this->inverses_ready()) { - FullMatrix M_cell(blocksize); + FullMatrix M_cell(this->blocksize); for (int icell=n_cells-1; icell>=0 ; --icell) { unsigned int cell = (unsigned int) icell; // Collect upper triangle - for (row=cell*blocksize, row_cell=0; row_cellblocksize, row_cell=0; + row_cellblocksize; + ++row_cell, ++row) { b_cell_row=src(row); for (unsigned int j=rowstart[row]; j::Tvmult (Vector &d b_cell(row_cell)=b_cell_row; // Collect diagonal block - for (unsigned int column_cell=0, column=cell*blocksize; - column_cellblocksize; + column_cellblocksize; ++column_cell, ++column) M_cell(row_cell,column_cell)=M(row,column); } M_cell.householder(b_cell); M_cell.backward(x_cell,b_cell); // distribute x_cell to dst - for (row=cell*blocksize, row_cell=0; row_cellblocksize, row_cell=0; + row_cellblocksize; + ++row_cell, ++row) + dst(row)=this->relaxation*x_cell(row_cell); - end_diag_block-=blocksize; + end_diag_block-=this->blocksize; } } else for (int icell=n_cells-1; icell >=0 ; --icell) { unsigned int cell = (unsigned int) icell; - for (row=cell*blocksize, row_cell=0; row_cellblocksize, row_cell=0; + row_cellblocksize; + ++row_cell, ++row) { b_cell_row=src(row); for (unsigned int j=rowstart[row]; j::Tvmult (Vector &d } b_cell(row_cell)=b_cell_row; } - inverse(cell).vmult(x_cell, b_cell); + this->inverse(cell).vmult(x_cell, b_cell); // distribute x_cell to dst - for (row=cell*blocksize, row_cell=0; row_cellblocksize, row_cell=0; + row_cellblocksize; + ++row_cell, ++row) + dst(row)=this->relaxation*x_cell(row_cell); - end_diag_block-=blocksize; + end_diag_block-=this->blocksize; } } @@ -549,7 +575,7 @@ void PreconditionBlockSOR::Tvmult (Vector &d template PreconditionBlockSSOR::PreconditionBlockSSOR () { - store_diagonals = 1; + this->store_diagonals = 1; } @@ -563,23 +589,23 @@ void PreconditionBlockSSOR::vmult (Vector &d PreconditionBlockSOR::vmult(help, src); - Vector cell_src(blocksize); - Vector cell_dst(blocksize); + Vector cell_src(this->blocksize); + Vector cell_dst(this->blocksize); - const unsigned int n_cells = A->m()/blocksize; + const unsigned int n_cells = this->A->m()/this->blocksize; // Multiply with diagonal blocks for (unsigned int cell=0; cellblocksize; - for (unsigned int row_cell=0; row_cellblocksize; ++row_cell) cell_src(row_cell)=help(row+row_cell); - diagonal(cell).vmult(cell_dst, cell_src); + this->diagonal(cell).vmult(cell_dst, cell_src); - for (unsigned int row_cell=0; row_cellblocksize; ++row_cell) + help(row+row_cell)=this->relaxation*cell_dst(row_cell); } PreconditionBlockSOR::Tvmult(dst, help); @@ -595,23 +621,23 @@ void PreconditionBlockSSOR::Tvmult (Vector & PreconditionBlockSOR::Tvmult(help, src); - Vector cell_src(blocksize); - Vector cell_dst(blocksize); + Vector cell_src(this->blocksize); + Vector cell_dst(this->blocksize); - const unsigned int n_cells = A->m()/blocksize; + const unsigned int n_cells = this->A->m()/this->blocksize; // Multiply with diagonal blocks for (unsigned int cell=0; cellblocksize; - for (unsigned int row_cell=0; row_cellblocksize; ++row_cell) cell_src(row_cell)=help(row+row_cell); - diagonal(cell).vmult(cell_dst, cell_src); + this->diagonal(cell).vmult(cell_dst, cell_src); - for (unsigned int row_cell=0; row_cellblocksize; ++row_cell) + help(row+row_cell)=this->relaxation*cell_dst(row_cell); } PreconditionBlockSOR::vmult(dst, help); diff --git a/deal.II/lac/include/lac/sparse_ilu.templates.h b/deal.II/lac/include/lac/sparse_ilu.templates.h index 47a0cdbc16..608d889a0c 100644 --- a/deal.II/lac/include/lac/sparse_ilu.templates.h +++ b/deal.II/lac/include/lac/sparse_ilu.templates.h @@ -58,8 +58,8 @@ void SparseILU::decompose (const SparseMatrix &matrix, const double strengthen_diagonal) { Assert (matrix.m()==matrix.n(), ExcMatrixNotSquare ()); - Assert (m()==n(), ExcMatrixNotSquare ()); - Assert (matrix.m()==m(), ExcSizeMismatch(matrix.m(), m())); + Assert (this->m()==this->n(), ExcMatrixNotSquare ()); + Assert (matrix.m()==this->m(), ExcSizeMismatch(matrix.m(), this->m())); Assert (strengthen_diagonal>=0, ExcInvalidStrengthening (strengthen_diagonal)); @@ -155,7 +155,7 @@ void SparseILU::decompose (const SparseMatrix &matrix, ExcDivideByZero()); this->global_entry (rowstart_indices[row-1]) - = 1./global_entry (rowstart_indices[row-1]); + = 1./this->global_entry (rowstart_indices[row-1]); // let k run over all lower-left // elements of row i; skip @@ -215,7 +215,7 @@ void SparseILU::decompose (const SparseMatrix &matrix, // element still has to be inverted // because the for-loop doesn't do // it... - this->diag_element(this->m()-1) = 1./this->diag_element(m()-1); + this->diag_element(this->m()-1) = 1./this->diag_element(this->m()-1); /* OLD CODE, rather crude first implementation with an algorithm taken @@ -271,7 +271,7 @@ void SparseILU::apply_decomposition (Vector &dst, const Vector &src) const { Assert (dst.size() == src.size(), ExcSizeMismatch(dst.size(), src.size())); - Assert (dst.size() == m(), ExcSizeMismatch(dst.size(), m())); + Assert (dst.size() == this->m(), ExcSizeMismatch(dst.size(), this->m())); const unsigned int N=dst.size(); const unsigned int * const rowstart_indices diff --git a/deal.II/lac/include/lac/swappable_vector.templates.h b/deal.II/lac/include/lac/swappable_vector.templates.h index 07ed8d017d..7baefed61f 100644 --- a/deal.II/lac/include/lac/swappable_vector.templates.h +++ b/deal.II/lac/include/lac/swappable_vector.templates.h @@ -104,7 +104,7 @@ void SwappableVector::swap_out (const std::string &name) filename = name; - Assert (size() != 0, ExcSizeZero()); + Assert (this->size() != 0, ExcSizeZero()); // if in MT mode, block all other // operations @@ -118,10 +118,10 @@ void SwappableVector::swap_out (const std::string &name) Assert (data_is_preloaded == false, ExcInternalError()); std::ofstream tmp_out(filename.c_str()); - block_write (tmp_out); + this->block_write (tmp_out); tmp_out.close (); - reinit (0); + this->reinit (0); #ifdef DEAL_II_USE_MT lock.release (); @@ -181,7 +181,7 @@ void SwappableVector::alert () // calling this function while the // vector is active does no harm // either - (size() != 0)) + (this->size() != 0)) lock.release (); else // data has not been preloaded so @@ -200,10 +200,10 @@ template void SwappableVector::reload_vector (const bool set_flag) { Assert (filename != "", ExcInvalidFilename (filename)); - Assert (size() == 0, ExcSizeNonzero()); + Assert (this->size() == 0, ExcSizeNonzero()); std::ifstream tmp_in(filename.c_str()); - block_read (tmp_in); + this->block_read (tmp_in); tmp_in.close (); // release the lock that was