#include <base/config.h>
#include <base/exceptions.h>
#include <base/tensor_base.h>
+#include <cmath>
/**
void AutoDerivativeFunction<dim>::vector_gradient (const Point<dim> &p,
typename std::vector<Tensor<1,dim> > &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<dim> q1;
- Vector<double> v(n_components), v1(n_components);
+ Vector<double> v(this->n_components), v1(this->n_components);
const double h_inv=1./h;
for (unsigned int i=0; i<dim; ++i)
{
vector_value(p, v);
vector_value(q1, v1);
- for (unsigned int comp=0; comp<n_components; ++comp)
+ for (unsigned int comp=0; comp<this->n_components; ++comp)
gradients[comp][i]=(v(comp)-v1(comp))*h_inv;
}
break;
case Euler:
{
Point<dim> q1, q2;
- Vector<double> v1(n_components), v2(n_components);
+ Vector<double> v1(this->n_components), v2(this->n_components);
const double h_inv_2=1./(2*h);
for (unsigned int i=0; i<dim; ++i)
{
vector_value(q1, v1);
vector_value(q2, v2);
- for (unsigned int comp=0; comp<n_components; ++comp)
+ for (unsigned int comp=0; comp<this->n_components; ++comp)
gradients[comp][i]=(v1(comp)-v2(comp))*h_inv_2;
}
break;
case FourthOrder:
{
Point<dim> q1, q2, q3, q4;
- Vector<double> v1(n_components), v2(n_components), v3(n_components), v4(n_components);
+ Vector<double>
+ 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<dim; ++i)
{
vector_value(q3, v3);
vector_value(q4, v4);
- for (unsigned int comp=0; comp<n_components; ++comp)
+ for (unsigned int comp=0; comp<this->n_components; ++comp)
gradients[comp][i]=(-v1(comp)+8*v2(comp)-8*v3(comp)+v4(comp))*h_inv_12;
}
break;
Assert (gradients.size() == points.size(),
ExcDimensionMismatch(gradients.size(), points.size()));
for (unsigned p=0; p<points.size(); ++p)
- Assert (gradients[p].size() == n_components,
- ExcDimensionMismatch(gradients.size(), n_components));
+ Assert (gradients[p].size() == this->n_components,
+ ExcDimensionMismatch(gradients.size(), this->n_components));
switch (formula)
{
for (unsigned int i=0; i<dim; ++i)
{
q1=points[p]-ht[i];
- for (unsigned int comp=0; comp<n_components; ++comp)
+ for (unsigned int comp=0; comp<this->n_components; ++comp)
gradients[p][comp][i]=(value(points[p], comp)-value(q1, comp))/h;
}
break;
{
q1=points[p]+ht[i];
q2=points[p]-ht[i];
- for (unsigned int comp=0; comp<n_components; ++comp)
+ for (unsigned int comp=0; comp<this->n_components; ++comp)
gradients[p][comp][i]=(value(q1, comp)-value(q2, comp))/(2*h);
}
break;
q1=q2+ht[i];
q3=points[p]-ht[i];
q4=q3-ht[i];
- for (unsigned int comp=0; comp<n_components; ++comp)
+ for (unsigned int comp=0; comp<this->n_components; ++comp)
gradients[p][comp][i]=(- value(q1, comp)
+8*value(q2, comp)
-8*value(q3, comp)
void ZeroFunction<dim>::vector_value (const Point<dim> &,
Vector<double> &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);
};
for (unsigned int i=0; i<points.size(); ++i)
{
- Assert (values[i].size() == n_components,
- ExcDimensionMismatch(values[i].size(), n_components));
+ Assert (values[i].size() == this->n_components,
+ ExcDimensionMismatch(values[i].size(), this->n_components));
std::fill (values[i].begin(), values[i].end(), 0.);
};
};
void ZeroFunction<dim>::vector_gradient (const Point<dim> &,
typename std::vector<Tensor<1,dim> > &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; c<n_components; ++c)
+ for (unsigned int c=0; c<this->n_components; ++c)
gradients[c].clear ();
};
ExcDimensionMismatch(gradients.size(), points.size()));
for (unsigned int i=0; i<points.size(); ++i)
{
- Assert (gradients[i].size() == n_components,
- ExcDimensionMismatch(gradients[i].size(), n_components));
- for (unsigned int c=0; c<n_components; ++c)
+ Assert (gradients[i].size() == this->n_components,
+ ExcDimensionMismatch(gradients[i].size(), this->n_components));
+ for (unsigned int c=0; c<this->n_components; ++c)
gradients[i][c].clear ();
};
};
ConstantFunction<dim>::ConstantFunction (const double value,
const unsigned int n_components) :
ZeroFunction<dim> (n_components),
- function_value (value) {};
+ function_value (value)
+{};
template <int dim>
void ConstantFunction<dim>::vector_value (const Point<dim> &,
Vector<double> &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);
};
for (unsigned int i=0; i<points.size(); ++i)
{
- Assert (values[i].size() == n_components,
- ExcDimensionMismatch(values[i].size(), n_components));
+ Assert (values[i].size() == this->n_components,
+ ExcDimensionMismatch(values[i].size(), this->n_components));
std::fill (values[i].begin(), values[i].end(), function_value);
};
};
void ComponentSelectFunction<dim>::vector_value (const Point<dim> &,
Vector<double> &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;
}
for (unsigned int i=0; i<points.size(); ++i)
{
- Assert (values[i].size() == n_components,
- ExcDimensionMismatch(values[i].size(), n_components));
+ Assert (values[i].size() == this->n_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;
}
}
CutOffFunctionLinfty<dim>::value (const Point<dim> &p,
const unsigned int component) const
{
- if (selected==no_component || component==selected)
- return ((center.distance(p)<radius) ? 1. : 0.);
+ if (this->selected==CutOffFunctionBase<dim>::no_component
+ ||
+ component==this->selected)
+ return ((this->center.distance(p)<this->radius) ? 1. : 0.);
return 0.;
}
{
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<dim>::no_component
+ ||
+ component==this->selected)
for (unsigned int k=0;k<values.size();++k)
- values[k] = (center.distance(points[k])<radius) ? 1. : 0.;
+ values[k] = (this->center.distance(points[k])<this->radius) ? 1. : 0.;
else
std::fill (values.begin(), values.end(), 0.);
}
for (unsigned int k=0;k<values.size();++k)
{
- double val = (center.distance(points[k])<radius) ? 1. : 0.;
- if (selected==no_component)
+ const double
+ val = (this->center.distance(points[k])<this->radius) ? 1. : 0.;
+ if (this->selected==CutOffFunctionBase<dim>::no_component)
values[k] = val;
else
{
values[k].clear ();
- values[k](selected) = val;
+ values[k](this->selected) = val;
}
}
}
CutOffFunctionW1<dim>::value (const Point<dim> &p,
const unsigned int component) const
{
- if (selected==no_component || component==selected)
+ if (this->selected==CutOffFunctionBase<dim>::no_component
+ ||
+ component==this->selected)
{
- const double d = center.distance(p);
- return ((d<radius) ? (radius-d) : 0.);
+ const double d = this->center.distance(p);
+ return ((d<this->radius) ? (this->radius-d) : 0.);
}
return 0.;
}
Assert (values.size() == points.size(),
ExcDimensionMismatch(values.size(), points.size()));
- if (selected==no_component || component==selected)
+ if (this->selected==CutOffFunctionBase<dim>::no_component
+ ||
+ component==this->selected)
for (unsigned int i=0;i<values.size();++i)
{
- const double d = center.distance(points[i]);
- values[i] = ((d<radius) ? (radius-d) : 0.);
+ const double d = this->center.distance(points[i]);
+ values[i] = ((d<this->radius) ? (this->radius-d) : 0.);
}
else
std::fill (values.begin(), values.end(), 0.);
for (unsigned int k=0;k<values.size();++k)
{
- const double d = center.distance(points[k]);
- double val = (d<radius) ? (radius-d) : 0.;
- if (selected==no_component)
+ const double d = this->center.distance(points[k]);
+ const double
+ val = (d<this->radius) ? (this->radius-d) : 0.;
+ if (this->selected==CutOffFunctionBase<dim>::no_component)
values[k] = val;
else
{
values[k].clear ();
- values[k](selected) = val;
+ values[k](this->selected) = val;
}
}
}
CutOffFunctionCinfty<dim>::value (const Point<dim> &p,
const unsigned int component) const
{
- if (selected==no_component || component==selected)
+ if (this->selected==CutOffFunctionBase<dim>::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);
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;i<values.size();++i)
+ if (this->selected==CutOffFunctionBase<dim>::no_component
+ ||
+ component==this->selected)
+ for (unsigned int i=0; i<values.size();++i)
{
- const double d = center.distance(points[i]);
+ const double d = this->center.distance(points[i]);
if (d>=r)
{
values[i] = 0.;
for (unsigned int k=0;k<values.size();++k)
{
- const double d = center.distance(points[k]);
- const double r = radius;
+ const double d = this->center.distance(points[k]);
+ const double r = this->radius;
double e = 0.;
double val = 0.;
- if (d<radius)
+ if (d<this->radius)
{
e = -r*r/(r*r-d*d);
if (e>-50)
val = M_E * exp(e);
}
- if (selected==no_component)
+ if (this->selected==CutOffFunctionBase<dim>::no_component)
values[k] = val;
else
{
values[k].clear ();
- values[k](selected) = val;
+ values[k](this->selected) = val;
}
}
}
CutOffFunctionCinfty<dim>::gradient (const Point<dim> &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<dim>() :
- (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)));
}
for (unsigned int copy=0; copy<n_copies; ++copy)
for (unsigned int q_point=0; q_point<base_quadrature.n_quadrature_points; ++q_point)
{
- quadrature_points[next_point] = Point<1>(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;
};
(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
// 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;
};
#if DEBUG
double sum_of_weights = 0;
- for (unsigned int i=0; i<n_quadrature_points; ++i)
- sum_of_weights += weight(i);
+ for (unsigned int i=0; i<this->n_quadrature_points; ++i)
+ sum_of_weights += this->weight(i);
Assert (std::fabs(sum_of_weights-1) < 1e-15,
ExcSumOfWeightsNotOne());
#endif
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;
}
}
static const double wts[] = { wts_normal[0]/2.,
wts_normal[1]/2. };
- for (unsigned int i=0; i<n_quadrature_points; ++i)
+ for (unsigned int i=0; i<this->n_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];
};
};
wts_normal[1]/2.,
wts_normal[2]/2. };
- for (unsigned int i=0; i<n_quadrature_points; ++i)
+ for (unsigned int i=0; i<this->n_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];
};
};
wts_normal[2]/2.,
wts_normal[3]/2. };
- for (unsigned int i=0; i<n_quadrature_points; ++i)
+ for (unsigned int i=0; i<this->n_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];
};
};
wts_normal[3]/2.,
wts_normal[4]/2. };
- for (unsigned int i=0; i<n_quadrature_points; ++i)
+ for (unsigned int i=0; i<this->n_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];
};
};
wts_normal[4]/2.,
wts_normal[5]/2. };
- for (unsigned int i=0; i<n_quadrature_points; ++i)
+ for (unsigned int i=0; i<this->n_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];
};
};
wts_normal[5]/2.,
wts_normal[6]/2. };
- for (unsigned int i=0; i<n_quadrature_points; ++i)
+ for (unsigned int i=0; i<this->n_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];
};
};
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;
};
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)
+ for (unsigned int i=0; i<this->n_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];
};
};
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)
+ for (unsigned int i=0; i<this->n_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];
};
};
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; i<n_quadrature_points; ++i)
+ for (unsigned int i=0; i<this->n_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];
};
};
27./840., 216./840., 41./840.
};
- for (unsigned int i=0; i<n_quadrature_points; ++i)
+ for (unsigned int i=0; i<this->n_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];
};
};
DoFAccessor<dim> &
DoFAccessor<dim>::operator = (const DoFAccessor<dim> &da)
{
- set_dof_handler (da.dof_handler);
+ this->set_dof_handler (da.dof_handler);
return *this;
};
// qualified exception names
typedef DoFAccessor<dim> 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 (i<dof_handler->selected_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 (i<this->dof_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];
};
// qualified exception names
typedef DoFAccessor<dim> 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 (i<dof_handler->selected_fe->dofs_per_vertex,
- ExcIndexRange (i, 0, dof_handler->selected_fe->dofs_per_vertex));
+ Assert (i<this->dof_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];
};
// qualified exception names
typedef DoFAccessor<dim> 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<unsigned int>::iterator next = dof_indices.begin();
for (unsigned int vertex=0; vertex<2; ++vertex)
for (unsigned int d=0; d<dofs_per_vertex; ++d)
TriaIterator<dim,DoFObjectAccessor<1,dim> >
DoFObjectAccessor<1,dim>::child (const unsigned int i) const
{
- TriaIterator<dim,DoFObjectAccessor<1,dim> > q (tria,
- present_level+1,
- child_index (i),
- dof_handler);
+ TriaIterator<dim,DoFObjectAccessor<1,dim> > q (this->tria,
+ this->present_level+1,
+ this->child_index (i),
+ this->dof_handler);
#ifdef DEBUG
if (q.state() != IteratorState::past_the_end)
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);
};
inline
unsigned int DoFObjectAccessor<2,dim>::dof_index (const unsigned int i) const
{
- Assert (dof_handler != 0,
+ Assert (this->dof_handler != 0,
typename DoFAccessor<dim>::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<dim>::ExcInvalidObject());
- Assert (i<dof_handler->selected_fe->dofs_per_quad,
- ExcIndexRange (i, 0, dof_handler->selected_fe->dofs_per_quad));
+ Assert (i<this->dof_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];
};
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<dim>::ExcInvalidObject());
- Assert (dof_handler->selected_fe != 0,
+ Assert (this->dof_handler->selected_fe != 0,
typename DoFAccessor<dim>::ExcInvalidObject());
Assert (vertex<4, ExcIndexRange (i,0,4));
- Assert (i<dof_handler->selected_fe->dofs_per_vertex,
- ExcIndexRange (i, 0, dof_handler->selected_fe->dofs_per_vertex));
+ Assert (i<this->dof_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];
};
void
DoFObjectAccessor<2,dim>::get_dof_indices (std::vector<unsigned int> &dof_indices) const
{
- Assert (dof_handler != 0,
+ Assert (this->dof_handler != 0,
typename DoFAccessor<dim>::ExcInvalidObject());
- Assert (dof_handler->selected_fe != 0,
+ Assert (this->dof_handler->selected_fe != 0,
typename DoFAccessor<dim>::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<dim>::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<unsigned int>::iterator next = dof_indices.begin();
for (unsigned int vertex=0; vertex<4; ++vertex)
for (unsigned int d=0; d<dofs_per_vertex; ++d)
return TriaIterator<dim,DoFObjectAccessor<1,dim> >
(
- tria,
- present_level,
- line_index (i),
- dof_handler
+ this->tria,
+ this->present_level,
+ this->line_index (i),
+ this->dof_handler
);
};
TriaIterator<dim,DoFObjectAccessor<2,dim> >
DoFObjectAccessor<2,dim>::child (const unsigned int i) const
{
- TriaIterator<dim,DoFObjectAccessor<2,dim> > q (tria,
- present_level+1,
- child_index (i),
- dof_handler);
+ TriaIterator<dim,DoFObjectAccessor<2,dim> > q (this->tria,
+ this->present_level+1,
+ this->child_index (i),
+ this->dof_handler);
#ifdef DEBUG
if (q.state() != IteratorState::past_the_end)
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);
};
unsigned int
DoFObjectAccessor<3,dim>::dof_index (const unsigned int i) const
{
- Assert (dof_handler != 0,
+ Assert (this->dof_handler != 0,
typename DoFAccessor<dim>::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<dim>::ExcInvalidObject());
- Assert (i<dof_handler->selected_fe->dofs_per_hex,
- ExcIndexRange (i, 0, dof_handler->selected_fe->dofs_per_hex));
+ Assert (i<this->dof_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];
};
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<dim>::ExcInvalidObject());
- Assert (dof_handler->selected_fe != 0,
+ Assert (this->dof_handler->selected_fe != 0,
typename DoFAccessor<dim>::ExcInvalidObject());
Assert (vertex<8, ExcIndexRange (i,0,8));
- Assert (i<dof_handler->selected_fe->dofs_per_vertex,
- ExcIndexRange (i, 0, dof_handler->selected_fe->dofs_per_vertex));
+ Assert (i<this->dof_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];
};
void
DoFObjectAccessor<3,dim>::get_dof_indices (std::vector<unsigned int> &dof_indices) const
{
- Assert (dof_handler != 0,
+ Assert (this->dof_handler != 0,
typename DoFAccessor<dim>::ExcInvalidObject());
- Assert (dof_handler->selected_fe != 0,
+ Assert (this->dof_handler->selected_fe != 0,
typename DoFAccessor<dim>::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<dim>::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<unsigned int>::iterator next = dof_indices.begin();
for (unsigned int vertex=0; vertex<8; ++vertex)
for (unsigned int d=0; d<dofs_per_vertex; ++d)
TriaIterator<dim,TriaObjectAccessor<1,dim> > l = BaseClass::line(i);
return TriaIterator<dim,DoFObjectAccessor<1,dim> >
(
- tria,
- present_level,
+ this->tria,
+ this->present_level,
l->index(),
- dof_handler
+ this->dof_handler
);
};
return TriaIterator<dim,DoFObjectAccessor<2,dim> >
(
- tria,
- present_level,
- quad_index (i),
- dof_handler
+ this->tria,
+ this->present_level,
+ this->quad_index (i),
+ this->dof_handler
);
};
TriaIterator<dim,DoFObjectAccessor<3,dim> >
DoFObjectAccessor<3,dim>::child (const unsigned int i) const
{
- TriaIterator<dim,DoFObjectAccessor<3,dim> > q (tria,
- present_level+1,
- child_index (i),
- dof_handler);
+ TriaIterator<dim,DoFObjectAccessor<3,dim> > q (this->tria,
+ this->present_level+1,
+ this->child_index (i),
+ this->dof_handler);
#ifdef DEBUG
if (q.state() != IteratorState::past_the_end)
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);
};
TriaIterator<dim,DoFCellAccessor<dim> >
DoFCellAccessor<dim>::neighbor (const unsigned int i) const
{
- TriaIterator<dim,DoFCellAccessor<dim> > q (tria,
- neighbor_level (i),
- neighbor_index (i),
- dof_handler);
+ TriaIterator<dim,DoFCellAccessor<dim> > q (this->tria,
+ this->neighbor_level (i),
+ this->neighbor_index (i),
+ this->dof_handler);
#ifdef DEBUG
if (q.state() != IteratorState::past_the_end)
TriaIterator<dim,DoFCellAccessor<dim> >
DoFCellAccessor<dim>::child (const unsigned int i) const
{
- TriaIterator<dim,DoFCellAccessor<dim> > q (tria,
- present_level+1,
- child_index (i),
- dof_handler);
+ TriaIterator<dim,DoFCellAccessor<dim> > q (this->tria,
+ this->present_level+1,
+ this->child_index (i),
+ this->dof_handler);
#ifdef DEBUG
if (q.state() != IteratorState::past_the_end)
bool
TriaObjectAccessor<1,dim>::used () const
{
- Assert (state() == IteratorState::valid,
+ Assert (this->state() == IteratorState::valid,
typename TriaAccessor<dim>::ExcDereferenceInvalidObject());
- return tria->levels[present_level]->lines.used[present_index];
+ return this->tria->levels[this->present_level]->lines.used[this->present_index];
};
bool
TriaObjectAccessor<1,dim>::user_flag_set () const
{
- Assert (used(), typename TriaAccessor<dim>::ExcCellNotUsed());
- return tria->levels[present_level]->lines.user_flags[present_index];
+ Assert (this->used(), typename TriaAccessor<dim>::ExcCellNotUsed());
+ return this->tria->levels[this->present_level]->lines.user_flags[this->present_index];
};
void
TriaObjectAccessor<1,dim>::set_user_flag () const
{
- Assert (used(), typename TriaAccessor<dim>::ExcCellNotUsed());
- tria->levels[present_level]->lines.user_flags[present_index] = true;
+ Assert (this->used(), typename TriaAccessor<dim>::ExcCellNotUsed());
+ this->tria->levels[this->present_level]->lines.user_flags[this->present_index] = true;
};
void
TriaObjectAccessor<1,dim>::clear_user_flag () const
{
- Assert (used(), typename TriaAccessor<dim>::ExcCellNotUsed());
- tria->levels[present_level]->lines.user_flags[present_index] = false;
+ Assert (this->used(), typename TriaAccessor<dim>::ExcCellNotUsed());
+ this->tria->levels[this->present_level]->lines.user_flags[this->present_index] = false;
};
Assert (i<2, ExcIndexRange(i,0,2));
TriaIterator<dim,TriaObjectAccessor<1,dim> >
- 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<dim>::ExcUnusedCellAsChild());
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;
};
bool
TriaObjectAccessor<1,dim>::has_children () const
{
- Assert (state() == IteratorState::valid,
+ Assert (this->state() == IteratorState::valid,
typename TriaAccessor<dim>::ExcDereferenceInvalidObject());
- return (tria->levels[present_level]->lines.children[present_index] != -1);
+ return (this->tria->levels[this->present_level]->lines.children[this->present_index] != -1);
}
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<int>(tria->levels[present_level]->lines.lines.size()))
+ static_cast<int>(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<int>(tria->levels.size()))
+ if (this->present_level >= static_cast<int>(this->tria->levels.size()))
{
// return with past the end pointer
- present_level = present_index = -1;
+ this->present_level = this->present_index = -1;
return;
};
};
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;
};
};
bool
TriaObjectAccessor<2,dim>::used () const
{
- Assert (state() == IteratorState::valid,
+ Assert (this->state() == IteratorState::valid,
typename TriaAccessor<dim>::ExcDereferenceInvalidObject());
- return tria->levels[present_level]->quads.used[present_index];
+ return this->tria->levels[this->present_level]->quads.used[this->present_index];
};
bool
TriaObjectAccessor<2,dim>::user_flag_set () const
{
- Assert (used(), typename TriaAccessor<dim>::ExcCellNotUsed());
- return tria->levels[present_level]->quads.user_flags[present_index];
+ Assert (this->used(), typename TriaAccessor<dim>::ExcCellNotUsed());
+ return this->tria->levels[this->present_level]->quads.user_flags[this->present_index];
};
void
TriaObjectAccessor<2,dim>::set_user_flag () const
{
- Assert (used(), typename TriaAccessor<dim>::ExcCellNotUsed());
- tria->levels[present_level]->quads.user_flags[present_index] = true;
+ Assert (this->used(), typename TriaAccessor<dim>::ExcCellNotUsed());
+ this->tria->levels[this->present_level]->quads.user_flags[this->present_index] = true;
};
void
TriaObjectAccessor<2,dim>::clear_user_flag () const
{
- Assert (used(), typename TriaAccessor<dim>::ExcCellNotUsed());
- tria->levels[present_level]->quads.user_flags[present_index] = false;
+ Assert (this->used(), typename TriaAccessor<dim>::ExcCellNotUsed());
+ this->tria->levels[this->present_level]->quads.user_flags[this->present_index] = false;
};
TriaIterator<dim,TriaObjectAccessor<1,dim> >
(
tria,
- present_level,
+ this->present_level,
line_index (i)
);
};
{
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);
};
Assert (i<4, ExcIndexRange(i,0,4));
TriaIterator<dim,TriaObjectAccessor<2,dim> >
- 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<dim>::ExcUnusedCellAsChild());
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;
};
bool
TriaObjectAccessor<2,dim>::has_children () const
{
- Assert (state() == IteratorState::valid,
+ Assert (this->state() == IteratorState::valid,
typename TriaAccessor<dim>::ExcDereferenceInvalidObject());
- return (tria->levels[present_level]->quads.children[present_index] != -1);
+ return (this->tria->levels[this->present_level]->quads.children[this->present_index] != -1);
};
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<int>(tria->levels[present_level]->quads.quads.size()))
+ static_cast<int>(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<int>(tria->levels.size()))
+ if (this->present_level >= static_cast<int>(this->tria->levels.size()))
{
// return with past the end pointer
- present_level = present_index = -1;
+ this->present_level = this->present_index = -1;
return;
};
};
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;
};
};
bool
TriaObjectAccessor<3,dim>::used () const
{
- Assert (state() == IteratorState::valid,
+ Assert (this->state() == IteratorState::valid,
typename TriaAccessor<dim>::ExcDereferenceInvalidObject());
- return tria->levels[present_level]->hexes.used[present_index];
+ return this->tria->levels[this->present_level]->hexes.used[this->present_index];
};
bool
TriaObjectAccessor<3,dim>::user_flag_set () const
{
- Assert (used(), typename TriaAccessor<dim>::ExcCellNotUsed());
- return tria->levels[present_level]->hexes.user_flags[present_index];
+ Assert (this->used(), typename TriaAccessor<dim>::ExcCellNotUsed());
+ return this->tria->levels[this->present_level]->hexes.user_flags[this->present_index];
};
void
TriaObjectAccessor<3,dim>::set_user_flag () const
{
- Assert (used(), typename TriaAccessor<dim>::ExcCellNotUsed());
- tria->levels[present_level]->hexes.user_flags[present_index] = true;
+ Assert (this->used(), typename TriaAccessor<dim>::ExcCellNotUsed());
+ this->tria->levels[this->present_level]->hexes.user_flags[this->present_index] = true;
};
inline
void TriaObjectAccessor<3,dim>::clear_user_flag () const
{
- Assert (used(), typename TriaAccessor<dim>::ExcCellNotUsed());
- tria->levels[present_level]->hexes.user_flags[present_index] = false;
+ Assert (this->used(), typename TriaAccessor<dim>::ExcCellNotUsed());
+ this->tria->levels[this->present_level]->hexes.user_flags[this->present_index] = false;
};
TriaIterator<dim,TriaObjectAccessor<1,dim> >
TriaObjectAccessor<3,dim>::line (const unsigned int i) const
{
- Assert (used(), typename TriaAccessor<dim>::ExcCellNotUsed());
+ Assert (this->used(), typename TriaAccessor<dim>::ExcCellNotUsed());
Assert (i<12, ExcIndexRange (i,0,12));
// egcs 1.1.2 gets into trouble if we
TriaIterator<dim,TriaObjectAccessor<2,dim> >
TriaObjectAccessor<3,dim>::quad (const unsigned int i) const
{
- Assert (used(), typename TriaAccessor<dim>::ExcCellNotUsed());
+ Assert (this->used(), typename TriaAccessor<dim>::ExcCellNotUsed());
return
TriaIterator<dim,TriaObjectAccessor<2,dim> >
(
tria,
- present_level,
+ this->present_level,
quad_index (i)
);
};
{
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);
};
{
Assert (i<8, ExcIndexRange(i,0,8));
- TriaIterator<dim,TriaObjectAccessor<3,dim> > q (tria, present_level+1, child_index (i));
+ TriaIterator<dim,TriaObjectAccessor<3,dim> > q (tria, this->present_level+1, child_index (i));
Assert ((q.state() == IteratorState::past_the_end) || q->used(),
typename TriaAccessor<dim>::ExcUnusedCellAsChild());
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;
};
template <int dim>
bool TriaObjectAccessor<3,dim>::has_children () const
{
- Assert (state() == IteratorState::valid,
+ Assert (this->state() == IteratorState::valid,
typename TriaAccessor<dim>::ExcDereferenceInvalidObject());
- return (tria->levels[present_level]->hexes.children[present_index] != -1);
+ return (this->tria->levels[this->present_level]->hexes.children[this->present_index] != -1);
};
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<int>(tria->levels[present_level]->hexes.hexes.size()))
+ static_cast<int>(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<int>(tria->levels.size()))
+ if (this->present_level >= static_cast<int>(this->tria->levels.size()))
{
// return with past the end pointer
- present_level = present_index = -1;
+ this->present_level = this->present_index = -1;
return;
};
};
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;
};
};
bool
TriaObjectAccessor<celldim,dim>::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];
};
bool
TriaObjectAccessor<celldim,dim>::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];
};
void
TriaObjectAccessor<celldim,dim>::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;
};
inline
void TriaObjectAccessor<celldim,dim>::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;
};
TriaIterator<dim,TriaObjectAccessor<1,dim> >
TriaObjectAccessor<celldim,dim>::line (const unsigned int i) const
{
- Assert (used(), ExcCellNotUsed());
+ Assert (this->used(), ExcCellNotUsed());
Assert (i < GeometryInfo<celldim>::lines_per_cell,
ExcIndexRange(i,0,GeometryInfo<celldim>::lines_per_cell));
return
TriaIterator<dim,TriaObjectAccessor<1,dim> >
(
- tria,
- present_level,
+ this->tria,
+ this->present_level,
line_index (i)
);
case 3:
Assert(false, ExcNotImplemented());
}
- return TriaIterator<dim,TriaObjectAccessor<1,dim> >(tria, -1, -1, 0);
+ return TriaIterator<dim,TriaObjectAccessor<1,dim> >(this->tria, -1, -1, 0);
};
TriaIterator<dim,TriaObjectAccessor<2,dim> >
TriaObjectAccessor<celldim,dim>::quad (const unsigned int i) const
{
- Assert (used(), ExcCellNotUsed());
+ Assert (this->used(), ExcCellNotUsed());
Assert (i < GeometryInfo<celldim>::quads_per_cell,
ExcIndexRange(i,0,GeometryInfo<celldim>::quads_per_cell));
return
TriaIterator<dim,TriaObjectAccessor<2,dim> >
(
- tria,
- present_level,
+ this->tria,
+ this->present_level,
quad_index (i)
);
};
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);
Assert (i < GeometryInfo<celldim>::quads_per_cell,
ExcIndexRange(i,0,GeometryInfo<celldim>::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);
};
ExcIndexRange(i,0,GeometryInfo<celldim>::children_per_cell));
TriaIterator<dim,TriaObjectAccessor<celldim,dim> >
- 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());
{
Assert (i < GeometryInfo<celldim>::children_per_cell,
ExcIndexRange(i,0,GeometryInfo<celldim>::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;
};
template<int celldim, int dim>
bool TriaObjectAccessor<celldim,dim>::has_children () const
{
- Assert (state() == IteratorState::valid,
+ Assert (this->state() == IteratorState::valid,
typename TriaAccessor<dim>::ExcDereferenceInvalidObject());
- return (tria->levels[present_level]->hexes.children[present_index] != -1);
+ return (this->tria->levels[this->present_level]->hexes.children[this->present_index] != -1);
};
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])));
};
void
TriaObjectAccessor<celldim,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<int>(tria->levels[present_level]->hexes.hexes.size()))
+ static_cast<int>(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<int>(tria->levels.size()))
+ if (this->present_level >= static_cast<int>(this->tria->levels.size()))
{
// return with past the end pointer
- present_level = present_index = -1;
+ this->present_level = this->present_index = -1;
return;
};
};
void
TriaObjectAccessor<celldim,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;
};
};
Triangulation<2>::face_iterator
CellAccessor<2>::face (const unsigned int i) const
{
- return line(i);
+ return this->line(i);
};
{
Assert (i<GeometryInfo<dim>::faces_per_cell,
typename TriaAccessor<dim>::ExcInvalidNeighbor(i));
- return tria->levels[present_level]->
- neighbors[present_index*GeometryInfo<dim>::faces_per_cell+i].second;
+ return this->tria->levels[this->present_level]->
+ neighbors[this->present_index*GeometryInfo<dim>::faces_per_cell+i].second;
};
{
Assert (i<GeometryInfo<dim>::faces_per_cell,
typename TriaAccessor<dim>::ExcInvalidNeighbor(i));
- return tria->levels[present_level]->
- neighbors[present_index*GeometryInfo<dim>::faces_per_cell+i].first;
+ return this->tria->levels[this->present_level]->
+ neighbors[this->present_index*GeometryInfo<dim>::faces_per_cell+i].first;
};
bool
CellAccessor<dim>::refine_flag_set () const
{
- Assert (used(), typename TriaAccessor<dim>::ExcCellNotUsed());
+ Assert (this->used(), typename TriaAccessor<dim>::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];
};
void
CellAccessor<dim>::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;
};
void
CellAccessor<dim>::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;
};
bool
CellAccessor<dim>::coarsen_flag_set () const
{
- Assert (used(), typename TriaAccessor<dim>::ExcCellNotUsed());
+ Assert (this->used(), typename TriaAccessor<dim>::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];
};
void
CellAccessor<dim>::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;
};
void
CellAccessor<dim>::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;
};
CellAccessor<dim>::neighbor (const unsigned int i) const
{
TriaIterator<dim,CellAccessor<dim> >
- 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<dim>::ExcUnusedCellAsNeighbor());
CellAccessor<dim>::child (const unsigned int i) const
{
TriaIterator<dim,CellAccessor<dim> >
- 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<dim>::ExcUnusedCellAsChild());
bool
CellAccessor<dim>::active () const
{
- return !has_children();
+ return !this->has_children();
};
FullMatrix<number> &
FullMatrix<number>::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;
{
number2 s = 0.;
for (unsigned int j=0; j<size_m; ++j)
- s += src(j) * el(j,i);
+ s += src(j) * this->el(j,i);
dst(i) = s;
};
}
{
number2 s = 0.;
for (unsigned int j=0; j<size_m; ++j)
- s += src(j) * el(j,i);
+ s += src(j) * this->el(j,i);
dst(i) += s;
};
};
{
s = right(i);
for (unsigned int j=0; j<size_m; ++j)
- s -= src(j) * el(i,j);
+ s -= src(j) * this->el(i,j);
dst(i) = s;
res += s*s;
}
for (i=0; i<nu; ++i)
{
s = src(i);
- for (j=0; j<i; ++j) s -= dst(j) * el(i,j);
- dst(i) = s/el(i,i);
+ for (j=0; j<i; ++j) s -= dst(j) * this->el(i,j);
+ dst(i) = s/this->el(i,i);
}
}
for (int i=nu-1; i>=0; --i)
{
s = src(i);
- for (j=i+1; j<nu; ++j) s -= dst(j) * el(i,j);
- dst(i) = s/el(i,i);
+ for (j=i+1; j<nu; ++j) s -= dst(j) * this->el(i,j);
+ dst(i) = s/this->el(i,i);
}
}
for (unsigned int ii=0; ii<src.m() ; ++ii)
for (unsigned int jj=0; jj<src.n() ; ++jj)
- el(ii+i,jj+j) = src.el(ii,jj);
+ this->el(ii+i,jj+j) = src.el(ii,jj);
}
const std::vector<unsigned int>& p_rows,
const std::vector<unsigned int>& 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;i<n_rows();++i)
- for (unsigned int j=0;j<n_cols();++j)
- el(i,j) = src(p_rows[i], p_cols[j]);
+ Assert (p_rows.size() == this->n_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;i<this->n_rows();++i)
+ for (unsigned int j=0;j<this->n_cols();++j)
+ this->el(i,j) = src(p_rows[i], p_cols[j]);
}
Assert (this->data() != 0, ExcEmptyMatrix());
for (unsigned int k=0; k<m(); ++k)
- el(i,k) += s*el(j,k);
+ this->el(i,k) += s*this->el(j,k);
}
const unsigned int size_m = m();
for (unsigned l=0; l<size_m; ++l)
- el(i,l) += s*el(j,l) + t*el(k,l);
+ this->el(i,l) += s*this->el(j,l) + t*this->el(k,l);
}
Assert (this->data() != 0, ExcEmptyMatrix());
for (unsigned int k=0; k<n(); ++k)
- el(k,i) += s*el(k,j);
+ this->el(k,i) += s*this->el(k,j);
}
Assert (this->data() != 0, ExcEmptyMatrix());
for (unsigned int l=0; l<n(); ++l)
- el(l,i) += s*el(l,j) + t*el(l,k);
+ this->el(l,i) += s*this->el(l,j) + t*this->el(l,k);
}
number s;
for (unsigned int k=0; k<m(); ++k)
{
- s = el(i,k); el(i,k) = el(j,k); el(j,k) = s;
+ s = this->el(i,k); this->el(i,k) = this->el(j,k); this->el(j,k) = s;
}
}
number s;
for (unsigned int k=0; k<n(); ++k)
{
- s = el(k,i); el(k,i) = el(k,j); el(k,j) = s;
+ s = this->el(k,i); this->el(k,i) = this->el(k,j); this->el(k,j) = s;
}
}
Assert (m() == n(), ExcDimensionMismatch(m(),n()));
for (unsigned int i=0; i<n(); ++i)
- el(i,i) += src;
+ this->el(i,i) += src;
}
{
number2 s = 0.;
for (unsigned k=0; k<n(); k++)
- s+= el(i,k) * src.el(k,j);
+ s+= this->el(i,k) * src.el(k,j);
dst.el(i,j) = s;
}
else
{
number2 s = 0.;
for (unsigned k=0; k<n(); k++)
- s+= el(i,k) * src.el(k,j);
+ s+= this->el(i,k) * src.el(k,j);
dst.el(i,j) += s;
}
}
{
number2 s = 0;
for (unsigned int k=0; k<m(); k++)
- s += el(k,i) * src.el(k,j);
+ s += this->el(k,i) * src.el(k,j);
dst.el(i,j) = s;
}
else
{
number2 s = 0;
for (unsigned int k=0; k<m(); k++)
- s += el(k,i) * src.el(k,j);
+ s += this->el(k,i) * src.el(k,j);
dst.el(i,j) += s;
}
}
for (unsigned int i=0; i<N; ++i)
for (unsigned int j=i+1; j<N; ++j)
{
- const number t = (el(i,j) + el(j,i)) / 2;
- el(i,j) = el(j,i) = t;
+ const number t = (this->el(i,j) + this->el(j,i)) / 2;
+ this->el(i,j) = this->el(j,i) = t;
};
};
{
sum=0;
for (unsigned int row=0; row<n_rows; ++row)
- sum += std::fabs(el(row,col));
+ sum += std::fabs(this->el(row,col));
if (sum > max)
max = sum;
}
{
sum=0;
for (unsigned int col=0; col<n_cols; ++col)
- sum += std::fabs(el(row,col));
+ sum += std::fabs(this->el(row,col));
if (sum > max)
max = sum;
}
{
Assert (this->data() != 0, ExcEmptyMatrix());
- for (unsigned int i=0; i<m(); ++i)
+ for (unsigned int i=0; i<this->m(); ++i)
{
- for (unsigned int j=0; j<n(); ++j)
- s << std::setw(w) << std::setprecision(p) << el(i,j);
+ for (unsigned int j=0; j<this->n(); ++j)
+ s << std::setw(w) << std::setprecision(p) << this->el(i,j);
s << std::endl;
}
}
{
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())
{
{
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())
{
{
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
FullMatrix<number>::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
{
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<n() ; ++j)
{
// exceptions that do not take
// args...
typedef PreconditionBlock<number,inverse_type> BaseClass;
- Assert(A!=0, ExcNotInitialized());
+ Assert(this->A!=0, ExcNotInitialized());
- const SparseMatrix<number> &M=*A;
- const unsigned int n_cells=M.m()/blocksize;
+ const SparseMatrix<number> &M=*this->A;
+ const unsigned int n_cells=M.m()/this->blocksize;
- Vector<number2> b_cell(blocksize), x_cell(blocksize);
+ Vector<number2> b_cell(this->blocksize), x_cell(this->blocksize);
// cell_row, cell_column are the
// numbering of the blocks (cells).
// of the unkowns.
unsigned int row, row_cell, begin_diag_block=0;
- if (!inverses_ready())
+ if (!this->inverses_ready())
{
- FullMatrix<number> M_cell(blocksize);
+ FullMatrix<number> M_cell(this->blocksize);
for (unsigned int cell=0; cell<n_cells; ++cell)
{
- for (row=cell*blocksize, row_cell=0; row_cell<blocksize; ++row_cell, ++row)
+ for (row=cell*this->blocksize, row_cell=0;
+ row_cell<this->blocksize;
+ ++row_cell, ++row)
{
b_cell(row_cell)=src(row);
- for (unsigned int column_cell=0, column=cell*blocksize;
- column_cell<blocksize; ++column_cell, ++column)
+ for (unsigned int column_cell=0, column=cell*this->blocksize;
+ column_cell<this->blocksize; ++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_cell<blocksize; ++row_cell, ++row)
+ for (row=cell*this->blocksize, row_cell=0;
+ row_cell<this->blocksize;
+ ++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; cell<n_cells; ++cell)
{
- for (row=cell*blocksize, row_cell=0; row_cell<blocksize; ++row_cell, ++row)
+ for (row=cell*this->blocksize, row_cell=0;
+ row_cell<this->blocksize;
+ ++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_cell<blocksize; ++row_cell, ++row)
+ for (row=cell*this->blocksize, row_cell=0;
+ row_cell<this->blocksize;
+ ++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);
}
// args...
typedef PreconditionBlock<number,inverse_type> BaseClass;
- Assert (A!=0, ExcNotInitialized());
+ Assert (this->A!=0, ExcNotInitialized());
- const SparseMatrix<number> &M=*A;
- const unsigned int n_cells=M.m()/blocksize;
+ const SparseMatrix<number> &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<number2> b_cell(blocksize), x_cell(blocksize);
+ Vector<number2> b_cell(this->blocksize), x_cell(this->blocksize);
// cell_row, cell_column are the
// numbering of the blocks (cells).
unsigned int row, column, row_cell, begin_diag_block=0;
number2 b_cell_row;
- if (!inverses_ready())
+ if (!this->inverses_ready())
{
- FullMatrix<number> M_cell(blocksize);
+ FullMatrix<number> M_cell(this->blocksize);
for (unsigned int cell=0; cell<n_cells; ++cell)
{
- for (row=cell*blocksize, row_cell=0; row_cell<blocksize; ++row_cell, ++row)
+ for (row=cell*this->blocksize, row_cell=0;
+ row_cell<this->blocksize;
+ ++row_cell, ++row)
{
b_cell_row=src(row);
for (unsigned int j=rowstart[row]; j<rowstart[row+1]; ++j)
if ((column=columns[j]) < begin_diag_block)
b_cell_row -= M.global_entry(j) * dst(column);
b_cell(row_cell)=b_cell_row;
- for (unsigned int column_cell=0, column=cell*blocksize;
- column_cell<blocksize; ++column_cell, ++column)
+ for (unsigned int column_cell=0, column=cell*this->blocksize;
+ column_cell<this->blocksize;
+ ++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_cell<blocksize; ++row_cell, ++row)
- dst(row)=relaxation*x_cell(row_cell);
+ for (row=cell*this->blocksize, row_cell=0;
+ row_cell<this->blocksize;
+ ++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; cell<n_cells; ++cell)
{
- for (row=cell*blocksize, row_cell=0; row_cell<blocksize; ++row_cell, ++row)
+ for (row=cell*this->blocksize, row_cell=0;
+ row_cell<this->blocksize;
+ ++row_cell, ++row)
{
b_cell_row=src(row);
for (unsigned int j=rowstart[row]; j<rowstart[row+1]; ++j)
}
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_cell<blocksize; ++row_cell, ++row)
- dst(row)=relaxation*x_cell(row_cell);
+ for (row=cell*this->blocksize, row_cell=0;
+ row_cell<this->blocksize;
+ ++row_cell, ++row)
+ dst(row)=this->relaxation*x_cell(row_cell);
- begin_diag_block+=blocksize;
+ begin_diag_block+=this->blocksize;
}
}
// args...
typedef PreconditionBlock<number,inverse_type> BaseClass;
- Assert (A!=0, ExcNotInitialized());
+ Assert (this->A!=0, ExcNotInitialized());
- const SparseMatrix<number> &M=*A;
- const unsigned int n_cells=M.m()/blocksize;
+ const SparseMatrix<number> &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<number2> b_cell(blocksize), x_cell(blocksize);
+ Vector<number2> b_cell(this->blocksize), x_cell(this->blocksize);
// cell_row, cell_column are the
// numbering of the blocks (cells).
// 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<number> M_cell(blocksize);
+ FullMatrix<number> 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_cell<blocksize; ++row_cell, ++row)
+ for (row=cell*this->blocksize, row_cell=0;
+ row_cell<this->blocksize;
+ ++row_cell, ++row)
{
b_cell_row=src(row);
for (unsigned int j=rowstart[row]; j<rowstart[row+1]; ++j)
b_cell(row_cell)=b_cell_row;
// Collect diagonal block
- for (unsigned int column_cell=0, column=cell*blocksize;
- column_cell<blocksize; ++column_cell, ++column)
+ for (unsigned int column_cell=0, column=cell*this->blocksize;
+ column_cell<this->blocksize; ++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_cell<blocksize; ++row_cell, ++row)
- dst(row)=relaxation*x_cell(row_cell);
+ for (row=cell*this->blocksize, row_cell=0;
+ row_cell<this->blocksize;
+ ++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_cell<blocksize; ++row_cell, ++row)
+ for (row=cell*this->blocksize, row_cell=0;
+ row_cell<this->blocksize;
+ ++row_cell, ++row)
{
b_cell_row=src(row);
for (unsigned int j=rowstart[row]; j<rowstart[row+1]; ++j)
}
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_cell<blocksize; ++row_cell, ++row)
- dst(row)=relaxation*x_cell(row_cell);
+ for (row=cell*this->blocksize, row_cell=0;
+ row_cell<this->blocksize;
+ ++row_cell, ++row)
+ dst(row)=this->relaxation*x_cell(row_cell);
- end_diag_block-=blocksize;
+ end_diag_block-=this->blocksize;
}
}
template <typename number, typename inverse_type>
PreconditionBlockSSOR<number,inverse_type>::PreconditionBlockSSOR ()
{
- store_diagonals = 1;
+ this->store_diagonals = 1;
}
PreconditionBlockSOR<number,inverse_type>::vmult(help, src);
- Vector<inverse_type> cell_src(blocksize);
- Vector<inverse_type> cell_dst(blocksize);
+ Vector<inverse_type> cell_src(this->blocksize);
+ Vector<inverse_type> 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; cell<n_cells; ++cell)
{
- unsigned int row = cell*blocksize;
+ unsigned int row = cell*this->blocksize;
- for (unsigned int row_cell=0; row_cell<blocksize; ++row_cell)
+ for (unsigned int row_cell=0; row_cell<this->blocksize; ++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_cell<blocksize; ++row_cell)
- help(row+row_cell)=relaxation*cell_dst(row_cell);
+ for (unsigned int row_cell=0; row_cell<this->blocksize; ++row_cell)
+ help(row+row_cell)=this->relaxation*cell_dst(row_cell);
}
PreconditionBlockSOR<number,inverse_type>::Tvmult(dst, help);
PreconditionBlockSOR<number,inverse_type>::Tvmult(help, src);
- Vector<inverse_type> cell_src(blocksize);
- Vector<inverse_type> cell_dst(blocksize);
+ Vector<inverse_type> cell_src(this->blocksize);
+ Vector<inverse_type> 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; cell<n_cells; ++cell)
{
- unsigned int row = cell*blocksize;
+ unsigned int row = cell*this->blocksize;
- for (unsigned int row_cell=0; row_cell<blocksize; ++row_cell)
+ for (unsigned int row_cell=0; row_cell<this->blocksize; ++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_cell<blocksize; ++row_cell)
- help(row+row_cell)=relaxation*cell_dst(row_cell);
+ for (unsigned int row_cell=0; row_cell<this->blocksize; ++row_cell)
+ help(row+row_cell)=this->relaxation*cell_dst(row_cell);
}
PreconditionBlockSOR<number,inverse_type>::vmult(dst, help);
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));
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
// 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
const Vector<somenumber> &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
filename = name;
- Assert (size() != 0, ExcSizeZero());
+ Assert (this->size() != 0, ExcSizeZero());
// if in MT mode, block all other
// operations
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 ();
// 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
void SwappableVector<number>::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