// shape functions, since they
// have no support no-where on
// the boundary
- if (((dim==2) && (shape_index>=first_quad_index))
+ if (((dim==2) && (shape_index>=this->first_quad_index))
||
- ((dim==3) && (shape_index>=first_hex_index)))
+ ((dim==3) && (shape_index>=this->first_hex_index)))
return false;
// let's see whether this is a
// vertex
- if (shape_index < first_line_index)
+ if (shape_index < this->first_line_index)
{
// for Q elements, there is
// one dof per vertex, so
// ok, dof is on a line
{
const unsigned int line_index
- = (shape_index - first_line_index) / dofs_per_line;
+ = (shape_index - first_line_index) / this->dofs_per_line;
Assert (line_index < GeometryInfo<dim>::lines_per_cell,
ExcInternalError());
// dof is on a quad
{
const unsigned int quad_index
- = (shape_index - first_quad_index) / dofs_per_quad;
+ = (shape_index - first_quad_index) / this->dofs_per_quad;
Assert (static_cast<signed int>(quad_index) <
static_cast<signed int>(GeometryInfo<dim>::quads_per_cell),
ExcInternalError());
FESystem<dim>::has_support_on_face (const unsigned int shape_index,
const unsigned int face_index) const
{
- return (base_element(system_to_base_index(shape_index).first.first)
- .has_support_on_face(system_to_base_index(shape_index).second,
+ return (base_element(this->system_to_base_index(shape_index).first.first)
+ .has_support_on_face(this->system_to_base_index(shape_index).second,
face_index));
}
{
Assert (index < this->dofs_per_cell,
ExcIndexRange (index, 0, this->dofs_per_cell));
- Assert ((unit_support_points.size() == this->dofs_per_cell) ||
- (unit_support_points.size() == 0),
+ Assert ((this->unit_support_points.size() == this->dofs_per_cell) ||
+ (this->unit_support_points.size() == 0),
typename FiniteElementBase<dim>::ExcFEHasNoSupportPoints ());
// let's see whether we have the
// no. ask the base element
// whether it would like to
// provide this information
- return (base_element(system_to_base_index(index).first.first)
- .unit_support_point(system_to_base_index(index).second));
+ return (base_element(this->system_to_base_index(index).first.first)
+ .unit_support_point(this->system_to_base_index(index).second));
};
{
Assert (index < this->dofs_per_face,
ExcIndexRange (index, 0, this->dofs_per_face));
- Assert ((unit_face_support_points.size() == this->dofs_per_face) ||
- (unit_face_support_points.size() == 0),
+ Assert ((this->unit_face_support_points.size() == this->dofs_per_face) ||
+ (this->unit_face_support_points.size() == 0),
typename FiniteElementBase<dim>::ExcFEHasNoSupportPoints ());
// let's see whether we have the
// no. ask the base element
// whether it would like to
// provide this information
- return (base_element(face_system_to_base_index(index).first.first)
- .unit_face_support_point(face_system_to_base_index(index).second));
+ return (base_element(this->face_system_to_base_index(index).first.first)
+ .unit_face_support_point(this->face_system_to_base_index(index).second));
};
this->col_start = 0;
this->a_index = 0;
++local_row;
- if (local_row>=this->matrix->block(block_row,0).m())
+ if (local_row>=this->matrix->block(this->block_row,0).m())
{
// If final row in
// block, go to next
void
SparseLUDecomposition<number>::prebuild_lower_bound()
{
- const unsigned int* const column_numbers = get_sparsity_pattern().get_column_numbers();
- const unsigned int* const rowstart_indices = get_sparsity_pattern().get_rowstart_indices();
- const unsigned int N = m();
+ const unsigned int * const
+ column_numbers = this->get_sparsity_pattern().get_column_numbers();
+ const unsigned int * const
+ rowstart_indices = this->get_sparsity_pattern().get_rowstart_indices();
+ const unsigned int N = this->m();
prebuilt_lower_bound.resize (N);
SparseLUDecomposition<number>::copy_from (const SparseMatrix<somenumber>& matrix)
{
// preset the elements
- std::fill_n (&global_entry(0),
- n_nonzero_elements(),
+ std::fill_n (&this->global_entry(0),
+ this->n_nonzero_elements(),
0);
// note: pointers to the sparsity
const unsigned int * const column_numbers
= matrix.get_sparsity_pattern().get_column_numbers();
- for (unsigned int row=0; row<m(); ++row)
+ for (unsigned int row=0; row<this->m(); ++row)
for (const unsigned int * col = &column_numbers[rowstart_indices[row]];
col != &column_numbers[rowstart_indices[row+1]]; ++col)
- set (row, *col, matrix.global_entry(col-column_numbers));
+ this->set (row, *col, matrix.global_entry(col-column_numbers));
}
void
SparseLUDecomposition<number>::strengthen_diagonal_impl ()
{
- for (unsigned int row=0; row<m(); ++row)
+ for (unsigned int row=0; row<this->m(); ++row)
{
// get the length of the row
// (without the diagonal element)
- const unsigned int rowlength = get_sparsity_pattern().get_rowstart_indices()[row+1]
- -get_sparsity_pattern().get_rowstart_indices()[row]
- -1;
+ const unsigned int rowlength
+ = (this->get_sparsity_pattern().get_rowstart_indices()[row+1]
+ -this->get_sparsity_pattern().get_rowstart_indices()[row]
+ -1);
// get the global index of the first
// non-diagonal element in this row
const unsigned int rowstart
= get_sparsity_pattern().get_rowstart_indices()[row] + 1;
- number * const diagonal_element = &global_entry(rowstart-1);
+ number * const diagonal_element = &this->global_entry(rowstart-1);
number rowsum = 0;
for (unsigned int global_index=rowstart;
Assert (strengthen_diagonal>=0, ExcInvalidStrengthening (strengthen_diagonal));
- copy_from (matrix);
+ this->copy_from (matrix);
- if(strengthen_diagonal>0)
- strengthen_diagonal_impl();
+ if (strengthen_diagonal>0)
+ this->strengthen_diagonal_impl();
const SparsityPattern &sparsity = this->get_sparsity_pattern();
const unsigned int * const rowstart_indices = sparsity.get_rowstart_indices();
// diagonal element at start
const unsigned int * first_of_row
= &column_numbers[rowstart_indices[row]+1];
- const unsigned int * first_after_diagonal = prebuilt_lower_bound[row];
+ const unsigned int * first_after_diagonal = this->prebuilt_lower_bound[row];
// k := *col_ptr
for (const unsigned int * col_ptr = first_of_row;
const unsigned int * const rowstart = &column_numbers[rowstart_indices[row]+1];
// find the position where the part
// right of the diagonal starts
- const unsigned int * const first_after_diagonal = prebuilt_lower_bound[row];
+ const unsigned int * const first_after_diagonal = this->prebuilt_lower_bound[row];
for (const unsigned int * col=rowstart; col!=first_after_diagonal; ++col)
dst(row) -= this->global_entry (col-column_numbers) * dst(*col);
const unsigned int * const rowend = &column_numbers[rowstart_indices[row+1]];
// find the position where the part
// right of the diagonal starts
- const unsigned int * const first_after_diagonal = prebuilt_lower_bound[row];
+ const unsigned int * const first_after_diagonal = this->prebuilt_lower_bound[row];
for (const unsigned int * col=first_after_diagonal; col!=rowend; ++col)
dst(row) -= this->global_entry (col-column_numbers) * dst(*col);
typename SparseMatrix<number>::const_iterator&
SparseMatrix<number>::const_iterator::operator++ ()
{
- Assert (this->a_row < matrix->m(), ExcIteratorPastEnd());
+ Assert (this->a_row < this->matrix->m(), ExcIteratorPastEnd());
++this->a_index;
- if (this->a_index >= this->matrix->get_sparsity_pattern().row_length(this->a_row))
+ if (this->a_index >=
+ this->matrix->get_sparsity_pattern().row_length(this->a_row))
{
this->a_index = 0;
this->a_row++;
SparseLUDecomposition<number>::decompose(matrix, 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));
if (strengthen_diagonal > 0)
- strengthen_diagonal_impl ();
+ this->strengthen_diagonal_impl ();
// MIC implementation: (S. Margenov lectures)
// x[i] = a[i][i] - sum(k=1, i-1,
// implementation would store this
// values in the underlying sparse
// matrix itself.
- diag.resize (m());
- inv_diag.resize (m());
- inner_sums.resize (m());
+ diag.resize (this->m());
+ inv_diag.resize (this->m());
+ inner_sums.resize (this->m());
// precalc sum(j=k+1, N, a[k][j]))
for(unsigned int row=0; row<m(); row++) {
inner_sums[row] = get_rowsum(row);
}
- const unsigned int* const col_nums = get_sparsity_pattern().get_column_numbers();
- const unsigned int* const rowstarts = get_sparsity_pattern().get_rowstart_indices();
+ const unsigned int* const col_nums = this->get_sparsity_pattern().get_column_numbers();
+ const unsigned int* const rowstarts = this->get_sparsity_pattern().get_rowstart_indices();
- for(unsigned int row=0; row<m(); row++) {
- number temp = diag_element(row);
+ for(unsigned int row=0; row<this->m(); row++) {
+ number temp = this->diag_element(row);
number temp1 = 0;
- const unsigned int * const first_after_diagonal = prebuilt_lower_bound[row];
+ const unsigned int * const first_after_diagonal = this->prebuilt_lower_bound[row];
unsigned int k = 0;
for (const unsigned int * col=&col_nums[rowstarts[row]+1];
inline number
SparseMIC<number>::get_rowsum (const unsigned int row) const
{
- Assert(m()==n(), ExcMatrixNotSquare());
+ Assert(this->m()==this->n(), ExcMatrixNotSquare());
// get start of this row. skip the
// diagonal element
- const unsigned int * const column_numbers = get_sparsity_pattern().get_column_numbers();
- const unsigned int * const rowstart_indices = get_sparsity_pattern().get_rowstart_indices();
+ const unsigned int * const column_numbers = this->get_sparsity_pattern().get_column_numbers();
+ const unsigned int * const rowstart_indices = this->get_sparsity_pattern().get_rowstart_indices();
const unsigned int * const rowend = &column_numbers[rowstart_indices[row+1]];
// find the position where the part
// right of the diagonal starts
- const unsigned int * const first_after_diagonal = prebuilt_lower_bound[row];
+ const unsigned int * const first_after_diagonal = this->prebuilt_lower_bound[row];
number rowsum = 0;
for (const unsigned int * col=first_after_diagonal; col!=rowend; ++col)
- rowsum += global_entry (col-column_numbers);
+ rowsum += this->global_entry (col-column_numbers);
return rowsum;
};
{
SparseLUDecomposition<number>::vmult (dst, src);
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 = get_sparsity_pattern().get_rowstart_indices();
- const unsigned int * const column_numbers = get_sparsity_pattern().get_column_numbers();
+ const unsigned int * const rowstart_indices = this->get_sparsity_pattern().get_rowstart_indices();
+ const unsigned int * const column_numbers = this->get_sparsity_pattern().get_column_numbers();
// We assume the underlying matrix A is:
// A = X - L - U, where -L and -U are
// strictly lower- and upper- diagonal
// get start of this row. skip
// the diagonal element
const unsigned int * const rowstart = &column_numbers[rowstart_indices[row]+1];
- const unsigned int * const fad = prebuilt_lower_bound[row];
+ const unsigned int * const fad = this->prebuilt_lower_bound[row];
for (const unsigned int * col=rowstart; col!=fad; ++col)
- dst(row) -= global_entry (col-column_numbers) * dst(*col);
+ dst(row) -= this->global_entry (col-column_numbers) * dst(*col);
dst(row) *= inv_diag[row];
};
{
// get end of this row
const unsigned int * const rowend = &column_numbers[rowstart_indices[row+1]];
- const unsigned int * const fad = prebuilt_lower_bound[row];
+ const unsigned int * const fad = this->prebuilt_lower_bound[row];
for (const unsigned int * col=fad; col!=rowend; ++col)
- dst(row) -= global_entry (col-column_numbers) * dst(*col);
+ dst(row) -= this->global_entry (col-column_numbers) * dst(*col);
dst(row) *= inv_diag[row];
};
// if no blocking is required, pass
// down to the underlying class
if (n_blocks == 1)
- apply_preconditioner (dst, src);
+ this->apply_preconditioner (dst, src);
else
// otherwise: blocking requested
{
}
else
for (unsigned int block=0; block<n_blocks; ++block)
- apply_preconditioner (dst, src,
- &dof_masks[block]);
+ this->apply_preconditioner (dst, src,
+ &dof_masks[block]);
}
}