void
precondition_SOR(Vector<somenumber> & dst,
const Vector<somenumber> &src,
- const number om = 1.) const;
+ const number omega = 1.) const;
/**
* Apply transpose SOR preconditioning matrix to <tt>src</tt>.
void
precondition_TSOR(Vector<somenumber> & dst,
const Vector<somenumber> &src,
- const number om = 1.) const;
+ const number omega = 1.) const;
/**
* Perform SSOR preconditioning in-place. Apply the preconditioner matrix
*/
template <typename somenumber>
void
- SOR(Vector<somenumber> &v, const number om = 1.) const;
+ SOR(Vector<somenumber> &v, const number omega = 1.) const;
/**
* Perform a transpose SOR preconditioning in-place. <tt>omega</tt> is the
*/
template <typename somenumber>
void
- TSOR(Vector<somenumber> &v, const number om = 1.) const;
+ TSOR(Vector<somenumber> &v, const number omega = 1.) const;
/**
* Perform a permuted SOR preconditioning in-place.
PSOR(Vector<somenumber> & v,
const std::vector<size_type> &permutation,
const std::vector<size_type> &inverse_permutation,
- const number om = 1.) const;
+ const number omega = 1.) const;
/**
* Perform a transposed permuted SOR preconditioning in-place.
TPSOR(Vector<somenumber> & v,
const std::vector<size_type> &permutation,
const std::vector<size_type> &inverse_permutation,
- const number om = 1.) const;
+ const number omega = 1.) const;
/**
* Do one Jacobi step on <tt>v</tt>. Performs a direct Jacobi step with
void
Jacobi_step(Vector<somenumber> & v,
const Vector<somenumber> &b,
- const number om = 1.) const;
+ const number omega = 1.) const;
/**
* Do one SOR step on <tt>v</tt>. Performs a direct SOR step with right
void
SOR_step(Vector<somenumber> & v,
const Vector<somenumber> &b,
- const number om = 1.) const;
+ const number omega = 1.) const;
/**
* Do one adjoint SOR step on <tt>v</tt>. Performs a direct TSOR step with
void
TSOR_step(Vector<somenumber> & v,
const Vector<somenumber> &b,
- const number om = 1.) const;
+ const number omega = 1.) const;
/**
* Do one SSOR step on <tt>v</tt>. Performs a direct SSOR step with right
void
SSOR_step(Vector<somenumber> & v,
const Vector<somenumber> &b,
- const number om = 1.) const;
+ const number omega = 1.) const;
//@}
/**
* @name Iterators
void
SparseMatrix<number>::precondition_Jacobi(Vector<somenumber> & dst,
const Vector<somenumber> &src,
- const number om) const
+ const number omega) const
{
Assert(cols != nullptr, ExcNeedsSparsityPattern());
Assert(val != nullptr, ExcNotInitialized());
// in each row, i.e. at index
// rowstart[i]. and we do have a
// square matrix by above assertion
- if (om != number(1.))
+ if (omega != number(1.))
for (size_type i = 0; i < n; ++i, ++dst_ptr, ++src_ptr, ++rowstart_ptr)
- *dst_ptr = somenumber(om) * *src_ptr / somenumber(val[*rowstart_ptr]);
+ *dst_ptr = somenumber(omega) * *src_ptr / somenumber(val[*rowstart_ptr]);
else
for (size_type i = 0; i < n; ++i, ++dst_ptr, ++src_ptr, ++rowstart_ptr)
*dst_ptr = *src_ptr / somenumber(val[*rowstart_ptr]);
SparseMatrix<number>::precondition_SSOR(
Vector<somenumber> & dst,
const Vector<somenumber> & src,
- const number om,
+ const number omega,
const std::vector<std::size_t> &pos_right_of_diagonal) const
{
// to understand how this function works
s += val[j] * number(dst(cols->colnums[j]));
// divide by diagonal element
- *dst_ptr -= s * om;
+ *dst_ptr -= s * omega;
*dst_ptr /= val[*rowstart_ptr];
}
rowstart_ptr = cols->rowstart.get();
dst_ptr = &dst(0);
for (; rowstart_ptr != &cols->rowstart[n]; ++rowstart_ptr, ++dst_ptr)
- *dst_ptr *=
- somenumber(om * (number(2.) - om)) * somenumber(val[*rowstart_ptr]);
+ *dst_ptr *= somenumber(omega * (number(2.) - omega)) *
+ somenumber(val[*rowstart_ptr]);
// backward sweep
rowstart_ptr = &cols->rowstart[n - 1];
for (size_type j = first_right_of_diagonal_index; j < end_row; ++j)
s += val[j] * number(dst(cols->colnums[j]));
- *dst_ptr -= s * om;
+ *dst_ptr -= s * omega;
*dst_ptr /= val[*rowstart_ptr];
};
return;
s += val[j] * number(dst(cols->colnums[j]));
// divide by diagonal element
- *dst_ptr -= s * om;
+ *dst_ptr -= s * omega;
Assert(val[*rowstart_ptr] != number(), ExcDivideByZero());
*dst_ptr /= val[*rowstart_ptr];
};
rowstart_ptr = cols->rowstart.get();
dst_ptr = &dst(0);
for (size_type row = 0; row < n; ++row, ++rowstart_ptr, ++dst_ptr)
- *dst_ptr *= somenumber((number(2.) - om)) * somenumber(val[*rowstart_ptr]);
+ *dst_ptr *=
+ somenumber((number(2.) - omega)) * somenumber(val[*rowstart_ptr]);
// backward sweep
rowstart_ptr = &cols->rowstart[n - 1];
number s = 0;
for (size_type j = first_right_of_diagonal_index; j < end_row; ++j)
s += val[j] * number(dst(cols->colnums[j]));
- *dst_ptr -= s * om;
+ *dst_ptr -= s * omega;
Assert(val[*rowstart_ptr] != number(), ExcDivideByZero());
*dst_ptr /= val[*rowstart_ptr];
};
void
SparseMatrix<number>::precondition_SOR(Vector<somenumber> & dst,
const Vector<somenumber> &src,
- const number om) const
+ const number omega) const
{
Assert(cols != nullptr, ExcNeedsSparsityPattern());
Assert(val != nullptr, ExcNotInitialized());
dst = src;
- SOR(dst, om);
+ SOR(dst, omega);
}
void
SparseMatrix<number>::precondition_TSOR(Vector<somenumber> & dst,
const Vector<somenumber> &src,
- const number om) const
+ const number omega) const
{
Assert(cols != nullptr, ExcNeedsSparsityPattern());
Assert(val != nullptr, ExcNotInitialized());
dst = src;
- TSOR(dst, om);
+ TSOR(dst, omega);
}
template <typename number>
template <typename somenumber>
void
-SparseMatrix<number>::SOR(Vector<somenumber> &dst, const number om) const
+SparseMatrix<number>::SOR(Vector<somenumber> &dst, const number omega) const
{
Assert(cols != nullptr, ExcNeedsSparsityPattern());
Assert(val != nullptr, ExcNotInitialized());
s -= somenumber(val[j]) * dst(col);
}
- dst(row) = s * somenumber(om) / somenumber(val[cols->rowstart[row]]);
+ dst(row) = s * somenumber(omega) / somenumber(val[cols->rowstart[row]]);
}
}
template <typename number>
template <typename somenumber>
void
-SparseMatrix<number>::TSOR(Vector<somenumber> &dst, const number om) const
+SparseMatrix<number>::TSOR(Vector<somenumber> &dst, const number omega) const
{
Assert(cols != nullptr, ExcNeedsSparsityPattern());
Assert(val != nullptr, ExcNotInitialized());
if (cols->colnums[j] > row)
s -= somenumber(val[j]) * dst(cols->colnums[j]);
- dst(row) = s * somenumber(om) / somenumber(val[cols->rowstart[row]]);
+ dst(row) = s * somenumber(omega) / somenumber(val[cols->rowstart[row]]);
if (row == 0)
break;
SparseMatrix<number>::PSOR(Vector<somenumber> & dst,
const std::vector<size_type> &permutation,
const std::vector<size_type> &inverse_permutation,
- const number om) const
+ const number omega) const
{
Assert(cols != nullptr, ExcNeedsSparsityPattern());
Assert(val != nullptr, ExcNotInitialized());
}
}
- dst(row) = s * somenumber(om) / somenumber(val[cols->rowstart[row]]);
+ dst(row) = s * somenumber(omega) / somenumber(val[cols->rowstart[row]]);
}
}
SparseMatrix<number>::TPSOR(Vector<somenumber> & dst,
const std::vector<size_type> &permutation,
const std::vector<size_type> &inverse_permutation,
- const number om) const
+ const number omega) const
{
Assert(cols != nullptr, ExcNeedsSparsityPattern());
Assert(val != nullptr, ExcNotInitialized());
s -= somenumber(val[j]) * dst(col);
}
- dst(row) = s * somenumber(om) / somenumber(val[cols->rowstart[row]]);
+ dst(row) = s * somenumber(omega) / somenumber(val[cols->rowstart[row]]);
}
}
void
SparseMatrix<number>::Jacobi_step(Vector<somenumber> & v,
const Vector<somenumber> &b,
- const number om) const
+ const number omega) const
{
Assert(cols != nullptr, ExcNeedsSparsityPattern());
Assert(val != nullptr, ExcNotInitialized());
}
else
w->equ(-1., b);
- precondition_Jacobi(*w, *w, om);
+ precondition_Jacobi(*w, *w, omega);
v -= *w;
}
void
SparseMatrix<number>::SOR_step(Vector<somenumber> & v,
const Vector<somenumber> &b,
- const number om) const
+ const number omega) const
{
Assert(cols != nullptr, ExcNeedsSparsityPattern());
Assert(val != nullptr, ExcNotInitialized());
{
s -= somenumber(val[j]) * v(cols->colnums[j]);
}
- v(row) += s * somenumber(om) / somenumber(val[cols->rowstart[row]]);
+ v(row) += s * somenumber(omega) / somenumber(val[cols->rowstart[row]]);
}
}
void
SparseMatrix<number>::TSOR_step(Vector<somenumber> & v,
const Vector<somenumber> &b,
- const number om) const
+ const number omega) const
{
Assert(cols != nullptr, ExcNeedsSparsityPattern());
Assert(val != nullptr, ExcNotInitialized());
{
s -= somenumber(val[j]) * v(cols->colnums[j]);
}
- v(row) += s * somenumber(om) / somenumber(val[cols->rowstart[row]]);
+ v(row) += s * somenumber(omega) / somenumber(val[cols->rowstart[row]]);
}
}
void
SparseMatrix<number>::SSOR_step(Vector<somenumber> & v,
const Vector<somenumber> &b,
- const number om) const
+ const number omega) const
{
- SOR_step(v, b, om);
- TSOR_step(v, b, om);
+ SOR_step(v, b, omega);
+ TSOR_step(v, b, omega);
}
template <typename number>
template <typename somenumber>
void
-SparseMatrix<number>::SSOR(Vector<somenumber> &dst, const number om) const
+SparseMatrix<number>::SSOR(Vector<somenumber> &dst, const number omega) const
{
- // TODO: Is this called anywhere? If so, multiplication with om(2-om)D is
- // missing
+ // TODO: Is this called anywhere? If so, multiplication with omega(2-omega)D
+ // is missing
Assert(false, ExcNotImplemented());
Assert(cols != nullptr, ExcNeedsSparsityPattern());
s += somenumber(val[j]) * dst(p);
}
}
- dst(i) -= s * somenumber(om);
+ dst(i) -= s * somenumber(omega);
dst(i) /= somenumber(val[cols->rowstart[i]]);
}
s += somenumber(val[j]) * dst(p);
}
}
- dst(i) -= s * somenumber(om) / somenumber(val[cols->rowstart[i]]);
+ dst(i) -= s * somenumber(omega) / somenumber(val[cols->rowstart[i]]);
}
}