*/
DeclException0 (ExcDivideByZero);
+ /**
+ * Exception raised if a number is
+ * not finite.
+ *
+ * This exception should be used to
+ * catch infinite or not a number
+ * results of arithmetic operations
+ * that do not result from a
+ * division by zero (use
+ * ExcDivideByZero for those).
+ */
+ DeclException0 (ExcNumberNotFinite);
+
/**
* Trying to allocate a new
* object failed due to lack of
smoothers[i].initialize(m[i], data[i]);
}
+
template <class RELAX, class VECTOR>
inline void
SmootherRelaxation<RELAX, VECTOR>::smooth(
// have support there. Let's
// eliminate them here.
+ // The Bogner-Fox-Schmidt element
+ // is an example for those.
+
//TODO: Maybe we should figure out if the element really needs this
FilteredMatrix<Vector<double> > filtered_mass_matrix(mass_matrix, true);
for (unsigned int i=0; i<dof_to_boundary_mapping.size(); ++i)
if (dof_to_boundary_mapping[i] != DoFHandler<dim,spacedim>::invalid_dof_index
&& ! excluded_dofs[dof_to_boundary_mapping[i]])
+ {
+ Assert(numbers::is_finite(boundary_projection(dof_to_boundary_mapping[i])), ExcNumberNotFinite());
+
// this dof is on one of the
// interesting boundary parts
//
// number, dof_to_boundary_mapping[i]
// is the number on the boundary and
// thus in the solution vector
- boundary_values[i] = boundary_projection(dof_to_boundary_mapping[i]);
+ boundary_values[i] = boundary_projection(dof_to_boundary_mapping[i]);
+ }
}
#endif
}
// append result of this cell
// to the end of the vector
- Assert (numbers::is_finite(diff), ExcInternalError());
+ Assert (numbers::is_finite(diff), ExcNumberNotFinite());
difference(index) = diff;
}
}
{
for (unsigned int j=0; j<dofs_per_cell; ++j)
if (dof_is_on_face[j] && dof_to_boundary_mapping[dofs[j]] != numbers::invalid_unsigned_int)
- matrix.add(dof_to_boundary_mapping[dofs[i]],
- dof_to_boundary_mapping[dofs[j]],
- cell_matrix(i,j));
-
+ {
+ Assert(numbers::is_finite(cell_matrix(i,j)), ExcNumberNotFinite());
+ matrix.add(dof_to_boundary_mapping[dofs[i]],
+ dof_to_boundary_mapping[dofs[j]],
+ cell_matrix(i,j));
+ }
+ Assert(numbers::is_finite(cell_vector(i)), ExcNumberNotFinite());
rhs_vector(dof_to_boundary_mapping[dofs[i]]) += cell_vector(i);
}
}
{
prepare_set_operation();
- Assert (numbers::is_finite(value),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(value), ExcNumberNotFinite());
const std::pair<unsigned int,unsigned int>
row_index = row_block_indices.global_to_local (i),
const value_type value)
{
- Assert (numbers::is_finite(value),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(value), ExcNumberNotFinite());
prepare_add_operation();
const Number value)
{
- Assert (numbers::is_finite(value),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(value), ExcNumberNotFinite());
const std::pair<unsigned int,unsigned int>
row_index = row_indices.global_to_local (i),
const Number value)
{
- Assert (numbers::is_finite(value),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(value), ExcNumberNotFinite());
const std::pair<unsigned int,unsigned int>
row_index = row_indices.global_to_local (i),
BlockVector<Number>::operator = (const value_type s)
{
- Assert (numbers::is_finite(s),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(s), ExcNumberNotFinite());
BaseClass::operator = (s);
return *this;
void BlockVector<Number>::scale (const value_type factor)
{
- Assert (numbers::is_finite(factor),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(factor), ExcNumberNotFinite());
for (unsigned int i=0; i<this->n_blocks();++i)
this->components[i].scale(factor);
template <class VectorType>
void BlockVectorBase<VectorType>::add (const value_type a)
{
- Assert (numbers::is_finite(a),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(a), ExcNumberNotFinite());
for (unsigned int i=0;i<n_blocks();++i)
{
const BlockVectorBase<VectorType>& v)
{
- Assert (numbers::is_finite(a),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(a), ExcNumberNotFinite());
Assert (n_blocks() == v.n_blocks(),
ExcDimensionMismatch(n_blocks(), v.n_blocks()));
const BlockVectorBase<VectorType>& w)
{
- Assert (numbers::is_finite(a),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
- Assert (numbers::is_finite(b),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(a), ExcNumberNotFinite());
+ Assert (numbers::is_finite(b), ExcNumberNotFinite());
Assert (n_blocks() == v.n_blocks(),
ExcDimensionMismatch(n_blocks(), v.n_blocks()));
const BlockVectorBase<VectorType>& v)
{
- Assert (numbers::is_finite(x),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(x), ExcNumberNotFinite());
Assert (n_blocks() == v.n_blocks(),
ExcDimensionMismatch(n_blocks(), v.n_blocks()));
const BlockVectorBase<VectorType>& v)
{
- Assert (numbers::is_finite(x),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
- Assert (numbers::is_finite(a),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(x), ExcNumberNotFinite());
+ Assert (numbers::is_finite(a), ExcNumberNotFinite());
Assert (n_blocks() == v.n_blocks(),
ExcDimensionMismatch(n_blocks(), v.n_blocks()));
const BlockVectorBase<VectorType>& w)
{
- Assert (numbers::is_finite(x),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
- Assert (numbers::is_finite(a),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
- Assert (numbers::is_finite(b),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(x), ExcNumberNotFinite());
+ Assert (numbers::is_finite(a), ExcNumberNotFinite());
+ Assert (numbers::is_finite(b), ExcNumberNotFinite());
Assert (n_blocks() == v.n_blocks(),
ExcDimensionMismatch(n_blocks(), v.n_blocks()));
const BlockVectorBase<VectorType>& y)
{
- Assert (numbers::is_finite(x),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
- Assert (numbers::is_finite(a),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
- Assert (numbers::is_finite(b),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
- Assert (numbers::is_finite(c),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(x), ExcNumberNotFinite());
+ Assert (numbers::is_finite(a), ExcNumberNotFinite());
+ Assert (numbers::is_finite(b), ExcNumberNotFinite());
+ Assert (numbers::is_finite(c), ExcNumberNotFinite());
Assert (n_blocks() == v.n_blocks(),
ExcDimensionMismatch(n_blocks(), v.n_blocks()));
const BlockVectorBase<VectorType>& w)
{
- Assert (numbers::is_finite(a),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
- Assert (numbers::is_finite(b),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(a), ExcNumberNotFinite());
+ Assert (numbers::is_finite(b), ExcNumberNotFinite());
Assert (n_blocks() == v.n_blocks(),
ExcDimensionMismatch(n_blocks(), v.n_blocks()));
const BlockVector2 &v)
{
- Assert (numbers::is_finite(a),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(a), ExcNumberNotFinite());
Assert (n_blocks() == v.n_blocks(),
ExcDimensionMismatch(n_blocks(), v.n_blocks()));
BlockVectorBase<VectorType>::operator = (const value_type s)
{
- Assert (numbers::is_finite(s),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(s), ExcNumberNotFinite());
for (unsigned int i=0;i<n_blocks();++i)
components[i] = s;
BlockVectorBase<VectorType>&
BlockVectorBase<VectorType>::operator = (const BlockVectorBase<VectorType>& v)
{
- Assert (n_blocks() == v.n_blocks(),
- ExcDimensionMismatch(n_blocks(), v.n_blocks()));
+ AssertDimension(n_blocks(), v.n_blocks());
for (unsigned int i=0;i<n_blocks();++i)
components[i] = v.components[i];
BlockVectorBase<VectorType>&
BlockVectorBase<VectorType>::operator = (const BlockVectorBase<VectorType2> &v)
{
- Assert (n_blocks() == v.n_blocks(),
- ExcDimensionMismatch(n_blocks(), v.n_blocks()));
+ AssertDimension(n_blocks(), v.n_blocks());
for (unsigned int i=0;i<n_blocks();++i)
components[i] = v.components[i];
BlockVectorBase<VectorType>::
operator == (const BlockVectorBase<VectorType2> &v) const
{
- Assert (block_indices == v.block_indices,
- ExcDifferentBlockIndices());
+ Assert (block_indices == v.block_indices, ExcDifferentBlockIndices());
for (unsigned int i=0;i<n_blocks();++i)
if ( ! (components[i] == v.components[i]))
BlockVectorBase<VectorType>::operator *= (const value_type factor)
{
- Assert (numbers::is_finite(factor),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(factor), ExcNumberNotFinite());
for (unsigned int i=0;i<n_blocks();++i)
components[i] *= factor;
BlockVectorBase<VectorType>::operator /= (const value_type factor)
{
- Assert (numbers::is_finite(factor),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
- Assert (factor > 0., ExcZero() );
+ Assert (numbers::is_finite(factor), ExcNumberNotFinite());
+ Assert (factor > 0., ExcDivideByZero() );
for (unsigned int i=0;i<n_blocks();++i)
components[i] /= factor;
// $Id$
// Version: $Name: $
//
-// Copyright (C) 2008, 2009 by the deal.II authors
+// Copyright (C) 2008, 2009, 2010 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
const number value)
{
- Assert (numbers::is_finite(value),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(value), ExcNumberNotFinite());
Assert (cols != 0, ExcNotInitialized());
// it is allowed to set elements of
const number value)
{
- Assert (numbers::is_finite(value),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(value), ExcNumberNotFinite());
Assert (cols != 0, ExcNotInitialized());
new_value += (static_cast<typename VectorType::value_type>
(vec(next_constraint->entries[i].first)) *
next_constraint->entries[i].second);
+ Assert(numbers::is_finite(new_value), ExcNumberNotFinite());
vec(next_constraint->line) = new_value;
}
}
// $Id$
// Version: $Name$
//
-// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by the deal.II authors
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
number
FullMatrix<number>::Accessor::value() const
{
- Assert (numbers::is_finite( matrix->el(a_row, a_col) ),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite( matrix->el(a_row, a_col) ), ExcNumberNotFinite());
return matrix->el(a_row, a_col);
}
// $Id$
// Version: $Name$
//
-// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by the deal.II authors
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
FullMatrix<number>::operator *= (const number factor)
{
- Assert (numbers::is_finite(factor),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(factor), ExcNumberNotFinite());
number *p = &(*this)(0,0);
const number *e = &(*this)(0,0) + n()*m();
FullMatrix<number>::operator /= (const number factor)
{
- Assert (numbers::is_finite(factor),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(factor), ExcNumberNotFinite());
number *p = &(*this)(0,0);
const number *e = &(*this)(0,0) + n()*m();
const number factor_inv = number(1.)/factor;
- Assert (numbers::is_finite(factor_inv),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(factor_inv), ExcNumberNotFinite());
while (p != e)
*p++ *= factor_inv;
const PetscScalar value)
{
- Assert (numbers::is_finite(value),
- ExcMessage("The given value is not finite but either "
- "infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(value), ExcNumberNotFinite());
set (i, 1, &j, &value, false);
}
for (unsigned int j=0; j<n_cols; ++j)
{
const PetscScalar value = values[j];
- Assert (numbers::is_finite(value),
- ExcMessage("The given value is not finite but either "
- "infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(value), ExcNumberNotFinite());
if (value != PetscScalar())
{
column_indices[n_columns] = col_indices[j];
const PetscScalar value)
{
- Assert (numbers::is_finite(value),
- ExcMessage("The given value is not finite but either "
- "infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(value), ExcNumberNotFinite());
if (value == PetscScalar())
{
for (unsigned int j=0; j<n_cols; ++j)
{
const PetscScalar value = values[j];
- Assert (numbers::is_finite(value),
- ExcMessage("The given value is not finite but either "
- "infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(value), ExcNumberNotFinite());
if (value != PetscScalar())
{
column_indices[n_columns] = col_indices[j];
const unsigned int j,
const number value)
{
- Assert (numbers::is_finite(value),
- ExcMessage("The given value is not finite but either "
- "infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(value), ExcNumberNotFinite());
const unsigned int index = cols->operator()(i, j);
const unsigned int j,
const number value)
{
- Assert (numbers::is_finite(value),
- ExcMessage("The given value is not finite but either "
- "infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(value), ExcNumberNotFinite());
if (value == 0)
return;
for (unsigned int j=0; j<n_cols; ++j)
{
const number value = values[j];
- Assert (numbers::is_finite(value),
- ExcMessage("The given value is not finite but either "
- "infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(value), ExcNumberNotFinite());
#ifdef DEBUG
if (elide_zero_values==true && value == 0)
for (unsigned int j=0; j<n_cols; ++j)
{
const number value = values[j];
- Assert (numbers::is_finite(value),
- ExcMessage("The given value is not finite but either "
- "infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(value), ExcNumberNotFinite());
if (value == 0)
continue;
for (unsigned int j=0; j<n_cols; ++j)
{
const number value = values[j];
- Assert (numbers::is_finite(value),
- ExcMessage("The given value is not finite but either "
- "infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(value), ExcNumberNotFinite());
if (index != next_row_index && my_cols[index] == col_indices[j])
goto set_value_checked;
const number value)
{
- Assert (numbers::is_finite(value),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(value), ExcNumberNotFinite());
Assert (i<m(), ExcIndexRange(i,0,m()));
Assert (j<n(), ExcIndexRange(j,0,n()));
const number value)
{
- Assert (numbers::is_finite(value),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(value), ExcNumberNotFinite());
Assert (i<m(), ExcIndexRange(i,0,m()));
Assert (j<n(), ExcIndexRange(j,0,n()));
// $Id$
// Version: $Name$
//
-// Copyright (C) 2008, 2009 by the deal.II authors
+// Copyright (C) 2008, 2009, 2010 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
const TrilinosScalar value)
{
- Assert (numbers::is_finite(value),
- ExcMessage("The given value is not finite but either "
- "infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(value), ExcNumberNotFinite());
set (i, 1, &j, &value, false);
}
for (unsigned int j=0; j<n_cols; ++j)
{
const double value = values[j];
- Assert (numbers::is_finite(value),
- ExcMessage("The given value is not finite but either "
- "infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(value), ExcNumberNotFinite());
if (value != 0)
{
column_indices[n_columns] = col_indices[j];
const TrilinosScalar value)
{
- Assert (numbers::is_finite(value),
- ExcMessage("The given value is not finite but either "
- "infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(value), ExcNumberNotFinite());
if (value == 0)
{
for (unsigned int j=0; j<n_cols; ++j)
{
const double value = values[j];
- Assert (numbers::is_finite(value),
- ExcMessage("The given value is not finite but either "
- "infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(value), ExcNumberNotFinite());
if (value != 0)
{
column_indices[n_columns] = col_indices[j];
// $Id$
// Version: $Name$
//
-// Copyright (C) 2008, 2009 by the deal.II authors
+// Copyright (C) 2008, 2009, 2010 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
VectorBase::operator = (const TrilinosScalar s)
{
- Assert (numbers::is_finite(s),
- ExcMessage("The given value is not finite but either "
- "infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(s), ExcNumberNotFinite());
const int ierr = vector->PutScalar(s);
VectorBase::operator *= (const TrilinosScalar a)
{
- Assert (numbers::is_finite(a),
- ExcMessage("The given value is not finite but "
- "either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(a), ExcNumberNotFinite());
const int ierr = vector->Scale(a);
AssertThrow (ierr == 0, ExcTrilinosError(ierr));
VectorBase::operator /= (const TrilinosScalar a)
{
- Assert (numbers::is_finite(a),
- ExcMessage("The given value is not finite but "
- "either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(a), ExcNumberNotFinite());
const TrilinosScalar factor = 1./a;
- Assert (numbers::is_finite(factor),
- ExcMessage("The given value is not finite but "
- "either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(factor), ExcNumberNotFinite());
const int ierr = vector->Scale(factor);
AssertThrow (ierr == 0, ExcTrilinosError(ierr));
VectorBase::add (const TrilinosScalar s)
{
- Assert (numbers::is_finite(s),
- ExcMessage("The given value is not finite but "
- "either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(s), ExcNumberNotFinite());
unsigned int n_local = local_size();
for (unsigned int i=0; i<n_local; i++)
Assert (size() == v.size(),
ExcDimensionMismatch(size(), v.size()));
- Assert (numbers::is_finite(a),
- ExcMessage("The given value is not finite but "
- "either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(a), ExcNumberNotFinite());
const int ierr = vector->Update(a, *(v.vector), 1.);
AssertThrow (ierr == 0, ExcTrilinosError(ierr));
Assert (size() == w.size(),
ExcDimensionMismatch(size(), w.size()));
- Assert (numbers::is_finite(a),
- ExcMessage("The given value is not finite but "
- "either infinite or Not A Number (NaN)"));
- Assert (numbers::is_finite(b),
- ExcMessage("The given value is not finite but "
- "either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(a), ExcNumberNotFinite());
+ Assert (numbers::is_finite(b), ExcNumberNotFinite());
const int ierr = vector->Update(a, *(v.vector), b, *(w.vector), 1.);
Assert (size() == v.size(),
ExcDimensionMismatch(size(), v.size()));
- Assert (numbers::is_finite(s),
- ExcMessage("The given value is not finite but "
- "either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(s), ExcNumberNotFinite());
const int ierr = vector->Update(1., *(v.vector), s);
Assert (size() == v.size(),
ExcDimensionMismatch(size(), v.size()));
- Assert (numbers::is_finite(s),
- ExcMessage("The given value is not finite but "
- "either infinite or Not A Number (NaN)"));
- Assert (numbers::is_finite(a),
- ExcMessage("The given value is not finite but "
- "either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(s), ExcNumberNotFinite());
+ Assert (numbers::is_finite(a), ExcNumberNotFinite());
const int ierr = vector->Update(a, *(v.vector), s);
ExcDimensionMismatch(size(), w.size()));
- Assert (numbers::is_finite(s),
- ExcMessage("The given value is not finite but "
- "either infinite or Not A Number (NaN)"));
- Assert (numbers::is_finite(a),
- ExcMessage("The given value is not finite but "
- "either infinite or Not A Number (NaN)"));
- Assert (numbers::is_finite(b),
- ExcMessage("The given value is not finite but "
- "either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(s), ExcNumberNotFinite());
+ Assert (numbers::is_finite(a), ExcNumberNotFinite());
+ Assert (numbers::is_finite(b), ExcNumberNotFinite());
const int ierr = vector->Update(a, *(v.vector), b, *(w.vector), s);
Assert (size() == x.size(),
ExcDimensionMismatch(size(), x.size()));
- Assert (numbers::is_finite(s),
- ExcMessage("The given value is not finite but "
- "either infinite or Not A Number (NaN)"));
- Assert (numbers::is_finite(a),
- ExcMessage("The given value is not finite but "
- "either infinite or Not A Number (NaN)"));
- Assert (numbers::is_finite(b),
- ExcMessage("The given value is not finite but "
- "either infinite or Not A Number (NaN)"));
- Assert (numbers::is_finite(c),
- ExcMessage("The given value is not finite but "
- "either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(s), ExcNumberNotFinite());
+ Assert (numbers::is_finite(a), ExcNumberNotFinite());
+ Assert (numbers::is_finite(b), ExcNumberNotFinite());
+ Assert (numbers::is_finite(c), ExcNumberNotFinite());
// Update member can only
// input two other vectors so
const VectorBase &v)
{
- Assert (numbers::is_finite(a),
- ExcMessage("The given value is not finite but "
- "either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(a), ExcNumberNotFinite());
// If we don't have the same map, copy.
if (local_range() != v.local_range())
Assert (v.size() == w.size(),
ExcDimensionMismatch (v.size(), w.size()));
- Assert (numbers::is_finite(a),
- ExcMessage("The given value is not finite but "
- "either infinite or Not A Number (NaN)"));
- Assert (numbers::is_finite(b),
- ExcMessage("The given value is not finite but "
- "either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(a), ExcNumberNotFinite());
+ Assert (numbers::is_finite(b), ExcNumberNotFinite());
// If we don't have the same map, copy.
if (local_range() != v.local_range())
inline
Vector<Number> & Vector<Number>::operator = (const Number s)
{
- Assert (numbers::is_finite(s),
- ExcMessage("The given value is not finite but either infinite or "
- "Not A Number (NaN)"));
-
+ Assert (numbers::is_finite(s), ExcNumberNotFinite());
if (s != Number())
Assert (vec_size!=0, ExcEmptyObject());
if (vec_size>internal::Vector::minimum_parallel_grain_size)
Vector<std::complex<float> > &
Vector<std::complex<float> >::operator = (const std::complex<float> s)
{
- Assert (numbers::is_finite(s),
- ExcMessage("The given value is not finite but either infinite or "
- "Not A Number (NaN)"));
-
+ Assert (numbers::is_finite(s), ExcNumberNotFinite());
if (s != std::complex<float>())
Assert (vec_size!=0, ExcEmptyObject());
if (vec_size!=0)
Vector<Number> & Vector<Number>::operator *= (const Number factor)
{
- Assert (numbers::is_finite(factor),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(factor),ExcNumberNotFinite());
scale (factor);
return *this;
Vector<Number> &
Vector<Number>::operator /= (const Number factor)
{
- Assert (numbers::is_finite(factor),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(factor),ExcNumberNotFinite());
Assert (factor != Number(0.), ExcZero() );
this->operator *= (Number(1.)/factor);
void
Vector<Number>::scale (const Number factor)
{
- Assert (numbers::is_finite(factor),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(factor),ExcNumberNotFinite());
Assert (vec_size!=0, ExcEmptyObject());
Vector<Number>::add (const Number a,
const Vector<Number>& v)
{
- Assert (numbers::is_finite(a),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(a),ExcNumberNotFinite());
Assert (vec_size!=0, ExcEmptyObject());
Assert (vec_size == v.vec_size, ExcDimensionMismatch(vec_size, v.vec_size));
const Number a,
const Vector<Number>& v)
{
- Assert (numbers::is_finite(x),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
- Assert (numbers::is_finite(a),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(x),ExcNumberNotFinite());
+ Assert (numbers::is_finite(a),ExcNumberNotFinite());
Assert (vec_size!=0, ExcEmptyObject());
Assert (vec_size == v.vec_size, ExcDimensionMismatch(vec_size, v.vec_size));
// $Id$
// Version: $Name$
//
-// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by the deal.II authors
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
void Vector<Number>::add (const Number a, const Vector<Number>& v,
const Number b, const Vector<Number>& w)
{
- Assert (numbers::is_finite(a),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
- Assert (numbers::is_finite(b),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(a),ExcNumberNotFinite());
+ Assert (numbers::is_finite(b),ExcNumberNotFinite());
Assert (vec_size!=0, ExcEmptyObject());
Assert (vec_size == v.vec_size, ExcDimensionMismatch(vec_size, v.vec_size));
void Vector<Number>::sadd (const Number x,
const Vector<Number>& v)
{
- Assert (numbers::is_finite(x),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(x),ExcNumberNotFinite());
Assert (vec_size!=0, ExcEmptyObject());
Assert (vec_size == v.vec_size, ExcDimensionMismatch(vec_size, v.vec_size));
const Vector<Number>& v, const Number b,
const Vector<Number>& w)
{
- Assert (numbers::is_finite(x),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
- Assert (numbers::is_finite(a),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
- Assert (numbers::is_finite(b),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(x),ExcNumberNotFinite());
+ Assert (numbers::is_finite(a),ExcNumberNotFinite());
+ Assert (numbers::is_finite(b),ExcNumberNotFinite());
Assert (vec_size!=0, ExcEmptyObject());
Assert (vec_size == v.vec_size, ExcDimensionMismatch(vec_size, v.vec_size));
void Vector<Number>::equ (const Number a, const Vector<Number>& u,
const Number b, const Vector<Number>& v)
{
- Assert (numbers::is_finite(a),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
- Assert (numbers::is_finite(b),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(a),ExcNumberNotFinite());
+ Assert (numbers::is_finite(b),ExcNumberNotFinite());
Assert (vec_size!=0, ExcEmptyObject());
Assert (vec_size == u.vec_size, ExcDimensionMismatch(vec_size, u.vec_size));
VectorBase::operator = (const PetscScalar s)
{
- Assert (numbers::is_finite(s),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(s), ExcNumberNotFinite());
// flush previously cached elements. this
// seems to be necessary since petsc
VectorBase::operator *= (const PetscScalar a)
{
- Assert (numbers::is_finite(a),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(a), ExcNumberNotFinite());
#if DEAL_II_PETSC_VERSION_LT(2,3,0)
const int ierr = VecScale (&a, vector);
VectorBase::operator /= (const PetscScalar a)
{
- Assert (numbers::is_finite(a),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(a), ExcNumberNotFinite());
const PetscScalar factor = 1./a;
- Assert (numbers::is_finite(factor),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(factor), ExcNumberNotFinite());
#if DEAL_II_PETSC_VERSION_LT(2,3,0)
const int ierr = VecScale (&factor, vector);
VectorBase::add (const PetscScalar s)
{
- Assert (numbers::is_finite(s),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(s), ExcNumberNotFinite());
#if DEAL_II_PETSC_VERSION_LT(2,3,0)
const int ierr = VecShift (&s, vector);
const VectorBase &v)
{
- Assert (numbers::is_finite(a),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(a), ExcNumberNotFinite());
#if DEAL_II_PETSC_VERSION_LT(2,3,0)
const int ierr = VecAXPY (&a, v, vector);
const VectorBase &w)
{
- Assert (numbers::is_finite(a),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
- Assert (numbers::is_finite(b),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(a), ExcNumberNotFinite());
+ Assert (numbers::is_finite(b), ExcNumberNotFinite());
const PetscScalar weights[2] = {a,b};
Vec addends[2] = {v.vector, w.vector};
const VectorBase &v)
{
- Assert (numbers::is_finite(s),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(s), ExcNumberNotFinite());
#if DEAL_II_PETSC_VERSION_LT(2,3,0)
const int ierr = VecAYPX (&s, v, vector);
const VectorBase &v)
{
- Assert (numbers::is_finite(s),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
- Assert (numbers::is_finite(a),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(s), ExcNumberNotFinite());
+ Assert (numbers::is_finite(a), ExcNumberNotFinite());
// there is nothing like a AXPAY
// operation in Petsc, so do it in two
const VectorBase &w)
{
- Assert (numbers::is_finite(s),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
- Assert (numbers::is_finite(a),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
- Assert (numbers::is_finite(b),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(s), ExcNumberNotFinite());
+ Assert (numbers::is_finite(a), ExcNumberNotFinite());
+ Assert (numbers::is_finite(b), ExcNumberNotFinite());
// there is no operation like MAXPAY, so
// do it in two steps
const VectorBase &x)
{
- Assert (numbers::is_finite(s),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
- Assert (numbers::is_finite(a),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
- Assert (numbers::is_finite(b),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
- Assert (numbers::is_finite(c),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(s), ExcNumberNotFinite());
+ Assert (numbers::is_finite(a), ExcNumberNotFinite());
+ Assert (numbers::is_finite(b), ExcNumberNotFinite());
+ Assert (numbers::is_finite(c), ExcNumberNotFinite());
// there is no operation like MAXPAY, so
// do it in two steps
const VectorBase &v)
{
- Assert (numbers::is_finite(a),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(a), ExcNumberNotFinite());
Assert (size() == v.size(),
ExcDimensionMismatch (size(), v.size()));
const VectorBase &w)
{
- Assert (numbers::is_finite(a),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
- Assert (numbers::is_finite(b),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (numbers::is_finite(a), ExcNumberNotFinite());
+ Assert (numbers::is_finite(b), ExcNumberNotFinite());
Assert (size() == v.size(),
ExcDimensionMismatch (size(), v.size()));