// $Id$
// Version: $Name$
//
-// Copyright (C) 2001, 2002 by the deal authors
+// Copyright (C) 2001, 2002, 2003 by the deal authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
* @p{DifferenceFormula} of the
* order @p{ord} at minimum.
*/
- static DifferenceFormula get_formula_of_order(const unsigned int ord);
+ static
+ DifferenceFormula
+ get_formula_of_order (const unsigned int ord);
/**
* Exception.
// $Id$
// Version: $Name$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 by the deal authors
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 by the deal authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
*
* Still not implemented.
*/
- void evaluate_convergence_rates (const std::string &data_column_key,
- const std::string &reference_column_key,
- const RateMode rate_mode);
+ void
+ evaluate_convergence_rates (const std::string &data_column_key,
+ const std::string &reference_column_key,
+ const RateMode rate_mode);
/**
* the @p{set_tex_supercaption (...)} function
* of the base class @p{TableHandler}.
*/
- void evaluate_convergence_rates (const std::string &data_column_key,
- const RateMode rate_mode);
+ void
+ evaluate_convergence_rates (const std::string &data_column_key,
+ const RateMode rate_mode);
/**
* Omit this column @p{key}
* omitting the column from convergence
* rate evalution.
*/
- void omit_column_from_convergence_rate_evaluation(const std::string &key);
+ void
+ omit_column_from_convergence_rate_evaluation(const std::string &key);
/**
* Evaluates convergence rates
* should omitted by calling the
* @p{omit_column_from_convergence_rate_evaluation(..)}.
*/
- void evaluate_all_convergence_rates(const std::string &reference_column_key,
- const RateMode rate_mode);
+ void
+ evaluate_all_convergence_rates(const std::string &reference_column_key,
+ const RateMode rate_mode);
/**
* Evaluates convergence rates
* should omitted by calling the
* @p{omit_column_from_convergence_rate_evaluation(..)}.
*/
- void evaluate_all_convergence_rates(const RateMode rate_mode);
+ void
+ evaluate_all_convergence_rates(const RateMode rate_mode);
/**
* Exception
*/
DXFlags (const bool write_multigrid = false,
const bool write_neighbors = false);
-
- public:
+
/**
* Declare all flags with name
* and type as offered by this
* This function was originally written
* by Stefan Nauber.
*/
- static RgbValues default_color_function (const double value,
- const double min_value,
- const double max_value);
+ static RgbValues
+ default_color_function (const double value,
+ const double min_value,
+ const double max_value);
/**
* This is an alternative color
* @p{color_function} variable to the
* address of this function.
*/
- static RgbValues grey_scale_color_function (const double value,
- const double min_value,
- const double max_value);
+ static RgbValues
+ grey_scale_color_function (const double value,
+ const double min_value,
+ const double max_value);
/**
* This is one more
* variable to the address of
* this function.
*/
- static RgbValues reverse_grey_scale_color_function (const double value,
- const double min_value,
- const double max_value);
+ static RgbValues
+ reverse_grey_scale_color_function (const double value,
+ const double min_value,
+ const double max_value);
/**
* Constructor.
inline
bool
-DataOutBase::EpsFlags::RgbValues::is_grey () const
+DataOutBase::EpsFlags::RgbValues::is_grey () const
{
return (red == green) && (red == blue);
}
#define DeclException2(Exception2, type1, type2, outsequence) \
class Exception2 : public ExceptionBase { \
public: \
- Exception2 (const type1 a1, const type2 a2) : \
+ Exception2 (const type1 a1, const type2 a2) : \
arg1 (a1), arg2(a2) {}; \
virtual ~Exception2 () throw () {}; \
virtual void PrintInfo (std::ostream &out) const { \
#define DeclException3(Exception3, type1, type2, type3, outsequence) \
class Exception3 : public ExceptionBase { \
public: \
- Exception3 (const type1 a1, const type2 a2, const type3 a3) : \
+ Exception3 (const type1 a1, const type2 a2, const type3 a3) : \
arg1 (a1), arg2(a2), arg3(a3) {}; \
virtual ~Exception3 () throw () {}; \
virtual void PrintInfo (std::ostream &out) const { \
class Exception4 : public ExceptionBase { \
public: \
Exception4 (const type1 a1, const type2 a2, \
- const type3 a3, const type4 a4) : \
+ const type3 a3, const type4 a4) : \
arg1 (a1), arg2(a2), arg3(a3), arg4(a4) {}; \
virtual ~Exception4 () throw () {}; \
virtual void PrintInfo (std::ostream &out) const { \
class Exception5 : public ExceptionBase { \
public: \
Exception5 (const type1 a1, const type2 a2, const type3 a3, \
- const type4 a4, const type5 a5) : \
+ const type4 a4, const type5 a5) : \
arg1 (a1), arg2(a2), arg3(a3), arg4(a4), arg5(a5) {}; \
virtual ~Exception5 () throw () {}; \
virtual void PrintInfo (std::ostream &out) const { \
template <int dim> class Point;
template <int rank_, int dim> class Tensor;
template <int dim> class Tensor<1,dim>;
-template<typename number> class Vector;
+template <typename number> class Vector;
/**
* This class is a model for a general function. It serves the purpose
* size beforehand,
* i.e. @p{n_components}.
*/
- virtual void vector_value (const Point<dim> &p,
- Vector<double> &values) const;
+ virtual void vector_value (const Point<dim> &p,
+ Vector<double> &values) const;
/**
* Set @p{values} to the point
* components of the
* function at the given point.
*/
- virtual void vector_gradient (const Point<dim> &p,
- std::vector<Tensor<1,dim> > &gradients) const;
+ virtual void vector_gradient (const Point<dim> &p,
+ std::vector<Tensor<1,dim> > &gradients) const;
/**
* Set @p{gradients} to the
* at the given point for all
* components.
*/
- virtual void vector_value (const Point<dim> &p,
- Vector<double> &return_value) const;
+ virtual void vector_value (const Point<dim> &p,
+ Vector<double> &return_value) const;
/**
* Set @p{values} to the point values
* function at the given point,
* for all components.
*/
- virtual void vector_gradient (const Point<dim> &p,
- std::vector<Tensor<1,dim> > &gradients) const;
+ virtual void vector_gradient (const Point<dim> &p,
+ std::vector<Tensor<1,dim> > &gradients) const;
/**
* Set @p{gradients} to the gradients of
const double function_value;
};
+
+
/**
* This is a constant vector-valued function, that is different from
* zero only in one component.
// $Id$
// Version: $Name$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 by the deal authors
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 by the deal authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
* and the step size @p{h} of the
* difference formula.
*/
- FunctionDerivative (const Function<dim>& f,
- const Point<dim>& direction,
- const double h = 1.e-6);
+ FunctionDerivative (const Function<dim> &f,
+ const Point<dim> &direction,
+ const double h = 1.e-6);
/**
* Constructor. Provided are the
* points.
*/
virtual void value_list (const std::vector<Point<dim> > &points,
- std::vector<double> &values,
- const unsigned int component = 0) const;
+ std::vector<double> &values,
+ const unsigned int component = 0) const;
/**
* Determine an estimate for
* formula.
*/
double h;
+
/**
* Difference formula.
*/
DifferenceFormula formula;
+
/**
* Helper object. Contains the
* increment vector for the
// $Id$
// Version: $Name$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 by the deal authors
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 by the deal authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
const unsigned int component = 0) const;
/**
- * Gradient at a single point.
+ * Second derivatives at a
+ * single point.
*/
virtual Tensor<2,dim> hessian (const Point<dim> &p,
const unsigned int component = 0) const;
/**
- * Gradients at multiple points.
+ * Second derivatives at
+ * multiple points.
*/
virtual void hessian_list (const std::vector<Point<dim> > &points,
std::vector<Tensor<2,dim> > &hessians,
const unsigned int component = 0) const;
/**
- * Function values at multiple points.
+ * Function values at multiple
+ * points.
*/
virtual void value_list (const std::vector<Point<dim> > &points,
std::vector<double> &values,
// $Id$
// Version: $Name$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 by the deal authors
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 by the deal authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
// $Id$
// Version: $Name$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 by the deal authors
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 by the deal authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
/**
* Return the value of @p{id}.
*/
- const std::string operator () ()const;
+ const std::string operator () () const;
private:
/**
* this function with @p{n=0}, no
* console output will be written.
*/
- void depth_console (unsigned int n);
+ void depth_console (const unsigned int n);
/**
* Maximum number of levels to be
* with care, since it may spoile
* the value of a log file.
*/
- void depth_file (unsigned int n);
+ void depth_file (const unsigned int n);
/**
* Set time printing flag. If this flag
* be prepended by the user time used
* by the running program so far.
*/
- void log_execution_time (bool flag);
+ void log_execution_time (const bool flag);
/**
* Output time differences
* not changed by this function,
* just the output.
*/
- void log_time_differences (bool flag);
+ void log_time_differences (const bool flag);
/**
* Output a constant something
* optional time information and
* the contents of the prefix stack.
*/
- void print_line_head();
+ void print_line_head ();
/**
* Actually do the work of
namespace MemoryConsumption
{
inline
- unsigned int memory_consumption (const bool)
+ unsigned int memory_consumption (const bool)
{
return sizeof(bool);
}
// $Id$
// Version: $Name$
//
-// Copyright (C) 2000, 2001, 2002 by the deal authors
+// Copyright (C) 2000, 2001, 2002, 2003 by the deal authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
* detection failed or if
* detection is not supported.
*/
- MultithreadInfo();
+ MultithreadInfo ();
/**
* The number of CPUs in the
* Inhibit automatic
* CopyConstructor.
*/
- ParameterHandler(const ParameterHandler&);
+ ParameterHandler (const ParameterHandler&);
/**
* Inhibit automatic
* assignment operator.
*/
- ParameterHandler& operator=(const ParameterHandler&);
+ ParameterHandler& operator= (const ParameterHandler&);
public:
/**
// $Id$
// Version: $Name$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 by the deal authors
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 by the deal authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
{
public:
/**
- * Standard constructor. Creates an origin.
+ * Standard constructor. Creates
+ * an origin.
*/
Point ();
+
/**
- * Constructor. Initialize all entries
- * to zero if @p{initialize==true}.
+ * Constructor. Initialize all
+ * entries to zero if
+ * @p{initialize==true}.
*/
explicit Point (const bool initialize);
template <int dim>
inline
-Point<dim>::Point (const bool initialize) :
+Point<dim>::Point (const bool initialize)
+ :
Tensor<1,dim>(initialize)
{}
template <int dim>
inline
-Point<dim>::Point (const Tensor<1,dim> &t) :
+Point<dim>::Point (const Tensor<1,dim> &t)
+ :
Tensor<1,dim>(t)
{}
template <int dim>
inline
-double & Point<dim>::operator () (const unsigned int index)
+double & Point<dim>::operator () (const unsigned int index)
{
Assert (index<dim, ExcIndexRange (index, 0, dim));
return this->values[index];
template <int dim>
inline
-Point<dim> Point<dim>::operator + (const Tensor<1,dim> &p) const
+Point<dim> Point<dim>::operator + (const Tensor<1,dim> &p) const
{
return (Point<dim>(*this) += p);
}
template <int dim>
inline
-Point<dim> Point<dim>::operator - (const Tensor<1,dim> &p) const
+Point<dim> Point<dim>::operator - (const Tensor<1,dim> &p) const
{
return (Point<dim>(*this) -= p);
}
template <int dim>
inline
-Point<dim> Point<dim>::operator - () const
+Point<dim> Point<dim>::operator - () const
{
Point<dim> result;
for (unsigned int i=0; i<dim; ++i)
template <int dim>
inline
-Point<dim> Point<dim>::operator * (const double factor) const
+Point<dim> Point<dim>::operator * (const double factor) const
{
return (Point<dim>(*this) *= factor);
}
template <int dim>
inline
-double Point<dim>::operator * (const Tensor<1,dim> &p) const
+double Point<dim>::operator * (const Tensor<1,dim> &p) const
{
// simply pass down
return Tensor<1,dim>::operator * (p);
template <int dim>
inline
-double Point<dim>::square () const
+double Point<dim>::square () const
{
double q=0;
for (unsigned int i=0; i<dim; ++i)
template <int dim>
inline
-Point<dim> Point<dim>::operator / (const double factor) const
+Point<dim> Point<dim>::operator / (const double factor) const
{
return (Point<dim>(*this) /= factor);
}
*/
template <int dim>
inline
-Point<dim> operator * (const double factor, const Point<dim> &p)
+Point<dim> operator * (const double factor, const Point<dim> &p)
{
return p*factor;
}
// $Id$
// Version: $Name$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 by the deal authors
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 by the deal authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
* @p{Quadrature<dim-1>}.
*/
Quadrature (const SubQuadrature &,
- const Quadrature<1> &);
+ const Quadrature<1> &);
/**
* Construct a quadrature formula
virtual ~Quadrature ();
/**
- * Return the @p{i}th quadrature point.
+ * Return the @p{i}th quadrature
+ * point.
*/
const Point<dim> & point (const unsigned int i) const;
/**
- * Return a reference to the whole array of
- * quadrature points.
+ * Return a reference to the
+ * whole array of quadrature
+ * points.
*/
const std::vector<Point<dim> > & get_points () const;
};
+
/**
* Quadrature formula constructed by iteration of another quadrature formula in
* each direction. In more than one space dimension, the resulting quadrature
* points at the left and right end points
* of the interval.
*/
- static bool uses_both_endpoints (const Quadrature<1> &base_quadrature);
+ static bool
+ uses_both_endpoints (const Quadrature<1> &base_quadrature);
};
+
/**
* This class is a helper class to facilitate the usage of quadrature formulae
* on faces or subfaces of cells. It computes the locations of quadrature
const std::vector<double> & Quadrature<0>::get_weights () const;
template <>
-void QProjector<1>::project_to_face (const Quadrature<0> &,
- const unsigned int,
- std::vector<Point<1> > &);
+void
+QProjector<1>::project_to_face (const Quadrature<0> &,
+ const unsigned int,
+ std::vector<Point<1> > &);
template <>
-void QProjector<2>::project_to_face (const Quadrature<1> &quadrature,
- const unsigned int face_no,
- std::vector<Point<2> > &q_points);
+void
+QProjector<2>::project_to_face (const Quadrature<1> &quadrature,
+ const unsigned int face_no,
+ std::vector<Point<2> > &q_points);
template <>
-void QProjector<3>::project_to_face (const Quadrature<2> &quadrature,
- const unsigned int face_no,
- std::vector<Point<3> > &q_points);
+void
+QProjector<3>::project_to_face (const Quadrature<2> &quadrature,
+ const unsigned int face_no,
+ std::vector<Point<3> > &q_points);
template <>
-Quadrature<1> QProjector<1>::project_to_all_faces (const Quadrature<0> &quadrature);
+Quadrature<1>
+QProjector<1>::project_to_all_faces (const Quadrature<0> &quadrature);
template <>
-void QProjector<1>::project_to_subface (const Quadrature<0> &,
- const unsigned int,
- const unsigned int,
- std::vector<Point<1> > &);
+void
+QProjector<1>::project_to_subface (const Quadrature<0> &,
+ const unsigned int,
+ const unsigned int,
+ std::vector<Point<1> > &);
template <>
-void QProjector<2>::project_to_subface (const Quadrature<1> &quadrature,
- const unsigned int face_no,
- const unsigned int subface_no,
- std::vector<Point<2> > &q_points);
+void
+QProjector<2>::project_to_subface (const Quadrature<1> &quadrature,
+ const unsigned int face_no,
+ const unsigned int subface_no,
+ std::vector<Point<2> > &q_points);
template <>
-void QProjector<3>::project_to_subface (const Quadrature<2> &quadrature,
- const unsigned int face_no,
- const unsigned int subface_no,
- std::vector<Point<3> > &q_points);
+void
+QProjector<3>::project_to_subface (const Quadrature<2> &quadrature,
+ const unsigned int face_no,
+ const unsigned int subface_no,
+ std::vector<Point<3> > &q_points);
template <>
-Quadrature<1> QProjector<1>::project_to_all_subfaces (const Quadrature<0> &quadrature);
+Quadrature<1>
+QProjector<1>::project_to_all_subfaces (const Quadrature<0> &quadrature);
template <>
bool
QIterated<1>::uses_both_endpoints (const Quadrature<1> &base_quadrature);
+
template <>
QIterated<1>::QIterated (const Quadrature<1> &base_quadrature,
const unsigned int n_copies);
// $Id$
// Version: $Name$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 by the deal authors
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 by the deal authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
/**
* Standard constructor for null pointer.
*/
- SmartPointer();
+ SmartPointer ();
/*
* Copy constructor for
- * @p{SmartPointer}. We copy the object
- * subscribed to from @p{tt}, but subscribe
+ * @p{SmartPointer}. We do now
+ * copy the object subscribed to
+ * from @p{tt}, but subscribe
* ourselves to it again.
*/
SmartPointer (const SmartPointer<T> &tt);
/**
- * Constructor taking a normal pointer.
- * If possible, i.e. if the pointer
- * is not a null pointer, the constructor
- * subscribes to the given object to
- * lock it, i.e. to prevent its
- * destruction before the end of its use.
+ * Constructor taking a normal
+ * pointer. If possible, i.e. if
+ * the pointer is not a null
+ * pointer, the constructor
+ * subscribes to the given object
+ * to lock it, i.e. to prevent
+ * its destruction before the end
+ * of its use.
*/
SmartPointer (T *t);
/**
- * Destructor, removing the subscription.
+ * Destructor, removing the
+ * subscription.
*/
~SmartPointer();
template <typename T>
-SmartPointer<T>::SmartPointer () :
+SmartPointer<T>::SmartPointer ()
+ :
t (0)
{}
template <typename T>
-SmartPointer<T>::SmartPointer (T *t) :
+SmartPointer<T>::SmartPointer (T *t)
+ :
t (t)
{
if (t != 0)
template <typename T>
-SmartPointer<T>::SmartPointer (const SmartPointer<T> &tt) :
+SmartPointer<T>::SmartPointer (const SmartPointer<T> &tt)
+ :
t (tt.t)
{
if (t != 0)
template <typename T>
-SmartPointer<T> & SmartPointer<T>::operator = (const SmartPointer<T>& tt)
+SmartPointer<T> &
+SmartPointer<T>::operator = (const SmartPointer<T>& tt)
{
// if objects on the left and right
// hand side of the operator= are
* private.
*/
Accessor ();
+
/**
* Copy constructor. Not
* needed, and invisible, so
* don't know here whether
* copying is expensive or not.
*/
- const T & el (const TableIndices<N> &indices) const;
+ const T & el (const TableIndices<N> &indices) const;
/**
* Direct read-only access to
*/
template <int N,typename T>
class Table : public TableBase<N,T>
-{};
+{
+};
/**
inline
-TableIndices<1>::TableIndices (const unsigned int index1)
+TableIndices<1>::TableIndices (const unsigned int index1)
{
this->indices[0] = index1;
}
inline
-TableIndices<4>::TableIndices ()
+TableIndices<4>::TableIndices ()
{
this->indices[0] = this->indices[1] = this->indices[2] = this->indices[3] = 0;
}
inline
-TableIndices<5>::TableIndices ()
+TableIndices<5>::TableIndices ()
{
- this->indices[0] = this->indices[1] = this->indices[2] = this->indices[3] = this->indices[4] = 0;
+ this->indices[0] = this->indices[1]
+ = this->indices[2]
+ = this->indices[3]
+ = this->indices[4] = 0;
}
inline
-TableIndices<6>::TableIndices ()
+TableIndices<6>::TableIndices ()
{
this->indices[0] = this->indices[1] = this->indices[2]
= this->indices[3] = this->indices[4] = 0;
template <int N, typename T, bool C, unsigned int P>
inline
Accessor<N,T,C,P-1>
- Accessor<N,T,C,P>::operator [] (const unsigned int i) const
+ Accessor<N,T,C,P>::operator [] (const unsigned int i) const
{
Assert (i < table.size()[N-P],
ExcIndexRange (i, 0, table.size()[N-P]));
template <int N, typename T, bool C>
inline
typename Accessor<N,T,C,1>::reference
- Accessor<N,T,C,1>::operator [] (const unsigned int i) const
+ Accessor<N,T,C,1>::operator [] (const unsigned int i) const
{
Assert (i < table.size()[N-1],
ExcIndexRange (i, 0, table.size()[N-1]));
template <int N, typename T>
TableBase<N,T>&
-TableBase<N,T>::operator = (const TableBase<N,T>& m)
+TableBase<N,T>::operator = (const TableBase<N,T>& m)
{
reinit (m.size());
if (!empty())
template <int N, typename T>
template <typename T2>
TableBase<N,T>&
-TableBase<N,T>::operator = (const TableBase<N,T2>& m)
+TableBase<N,T>::operator = (const TableBase<N,T2>& m)
{
reinit (m.size());
if (!empty())
template <int N, typename T>
inline
unsigned int
-TableBase<N,T>::position (const TableIndices<N> &indices) const
+TableBase<N,T>::position (const TableIndices<N> &indices) const
{
// specialize this for the
// different numbers of dimensions,
template <typename T>
-Table<1,T>::Table ()
+Table<1,T>::Table ()
{}
template <typename T>
-Table<3,T>::Table ()
+Table<3,T>::Table ()
{}
template <typename T>
-Table<4,T>::Table ()
+Table<4,T>::Table ()
{}
template <typename T>
-Table<5,T>::Table ()
+Table<5,T>::Table ()
{}
template <typename T>
-Table<6,T>::Table ()
+Table<6,T>::Table ()
{}
/**
* Write the table entry as text.
*/
- virtual void write_text (std::ostream &) const =0;
+ virtual void write_text (std::ostream &) const = 0;
/**
* Write the table entry in tex format.
*/
- virtual void write_tex (std::ostream &) const =0;
+ virtual void write_tex (std::ostream &) const = 0;
};
/**
* Constructor.
*/
- TableEntry(const value_type value);
+ TableEntry (const value_type value);
/**
* Destructor.
* Returns the value of this
* table entry.
*/
- value_type value() const;
+ value_type value () const;
/**
* Write the table entry as text.
/**
* Constructor.
*/
- TableHandler();
+ TableHandler ();
/**
* Adds a column (if not yet
// $Id$
// Version: $Name$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 by the deal authors
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 by the deal authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
// also, it would be sufficient to make
// the function unroll_loops a friend,
// but that seems to be impossible as well.
- template<int otherrank, int otherdim> friend class Tensor;
+ template <int otherrank, int otherdim> friend class Tensor;
};
template <int dim>
void outer_product (Tensor<2,dim> &dst,
const Tensor<1,dim> &src1,
- const Tensor<1,dim> &src2)
+ const Tensor<1,dim> &src2)
{
for (unsigned int i=0; i<dim; ++i)
for (unsigned int j=0; j<dim; ++j)
template <int dim>
void outer_product (Tensor<3,dim> &dst,
const Tensor<1,dim> &src1,
- const Tensor<2,dim> &src2)
+ const Tensor<2,dim> &src2)
{
for (unsigned int i=0; i<dim; ++i)
for (unsigned int j=0; j<dim; ++j)
template <int dim>
void outer_product (Tensor<3,dim> &dst,
const Tensor<2,dim> &src1,
- const Tensor<1,dim> &src2)
+ const Tensor<1,dim> &src2)
{
for (unsigned int i=0; i<dim; ++i)
for (unsigned int j=0; j<dim; ++j)
template <int dim>
void outer_product (Tensor<1,dim> &dst,
const double src1,
- const Tensor<1,dim> &src2)
+ const Tensor<1,dim> &src2)
{
for (unsigned int i=0; i<dim; ++i)
dst[i] = src1 * src2[i];
template <int dim>
void outer_product (Tensor<1,dim> &dst,
const Tensor<1,dim> src1,
- const double src2)
+ const double src2)
{
for (unsigned int i=0; i<dim; ++i)
dst[i] = src1[i] * src2;
template <int dim>
inline
Tensor<2,dim>
-transpose (const Tensor<2,dim> &t)
+transpose (const Tensor<2,dim> &t)
{
Tensor<2,dim> tt = t;
for (unsigned int i=0; i<dim; ++i)
*/
inline
Tensor<2,1>
-transpose (const Tensor<2,1> &t)
+transpose (const Tensor<2,1> &t)
{
return t;
}
*/
inline
Tensor<2,2>
-transpose (const Tensor<2,2> &t)
+transpose (const Tensor<2,2> &t)
{
const double x[2][2] = {{t[0][0], t[1][0]}, {t[0][1], t[1][1]}};
return Tensor<2,2>(x);
*/
inline
Tensor<2,3>
-transpose (const Tensor<2,3> &t)
+transpose (const Tensor<2,3> &t)
{
const double x[3][3] = {{t[0][0], t[1][0], t[2][0]},
{t[0][1], t[1][1], t[2][1]},
Tensor<1,dim> & operator = (const Tensor<1,dim> &);
/**
- * Test for equality of two points.
+ * Test for equality of two
+ * tensors.
*/
bool operator == (const Tensor<1,dim> &) const;
/**
- * Test for inequality of two points.
+ * Test for inequality of two
+ * tensors.
*/
bool operator != (const Tensor<1,dim> &) const;
* offset.
*/
Tensor<1,dim> & operator += (const Tensor<1,dim> &);
+
/**
* Subtract another vector.
*/
* that seems to be impossible as
* well.
*/
- template<int otherrank, int otherdim> friend class Tensor;
+ template <int otherrank, int otherdim> friend class Tensor;
/**
* Point is allowed access to
// $Id$
// Version: $Name$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 by the deal authors
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 by the deal authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
* for use in the template
* functions below.
*/
- void deregister_thread ();
+ void deregister_thread ();
}
} // end declarations of namespace Threads
// $Id$
// Version: $Name$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 by the deal authors
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 by the deal authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
template <int dim>
-AutoDerivativeFunction<dim>::AutoDerivativeFunction (const double hh,
- const unsigned int n_components,
- const double initial_time):
+AutoDerivativeFunction<dim>::
+AutoDerivativeFunction (const double hh,
+ const unsigned int n_components,
+ const double initial_time)
+ :
Function<dim>(n_components, initial_time),
h(1),
ht(dim),
template <int dim>
-void AutoDerivativeFunction<dim>::vector_gradient (const Point<dim> &p,
- std::vector<Tensor<1,dim> > &gradients) const
+void
+AutoDerivativeFunction<dim>::
+vector_gradient (const Point<dim> &p,
+ std::vector<Tensor<1,dim> > &gradients) const
{
Assert (gradients.size() == this->n_components,
ExcDimensionMismatch(gradients.size(), this->n_components));
}
break;
}
+
case Euler:
{
Point<dim> q1, q2;
}
break;
}
+
case FourthOrder:
{
Point<dim> q1, q2, q3, q4;
}
break;
}
+
default:
Assert(false, ExcInvalidFormula());
}
template <int dim>
-void AutoDerivativeFunction<dim>::gradient_list (const std::vector<Point<dim> > &points,
- std::vector<Tensor<1,dim> > &gradients,
- const unsigned int comp) const
+void
+AutoDerivativeFunction<dim>::
+gradient_list (const std::vector<Point<dim> > &points,
+ std::vector<Tensor<1,dim> > &gradients,
+ const unsigned int comp) const
{
Assert (gradients.size() == points.size(),
ExcDimensionMismatch(gradients.size(), points.size()));
}
break;
}
+
case Euler:
{
Point<dim> q1, q2;
}
break;
}
+
case FourthOrder:
{
Point<dim> q1, q2, q3, q4;
}
break;
}
+
default:
Assert(false, ExcInvalidFormula());
}
}
break;
}
+
case Euler:
{
Point<dim> q1, q2;
q1=points[p]+ht[i];
q2=points[p]-ht[i];
for (unsigned int comp=0; comp<this->n_components; ++comp)
- gradients[p][comp][i]=(this->value(q1, comp)-this->value(q2, comp))/(2*h);
+ gradients[p][comp][i]=(this->value(q1, comp) -
+ this->value(q2, comp))/(2*h);
}
break;
}
+
case FourthOrder:
{
Point<dim> q1, q2, q3, q4;
}
break;
}
+
default:
Assert(false, ExcInvalidFormula());
}
// $Id$
// Version: $Name$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 by the deal authors
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 by the deal authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
#include <cmath>
-ConvergenceTable::ConvergenceTable()
+ConvergenceTable::ConvergenceTable()
{}
}
-void ConvergenceTable::evaluate_convergence_rates(const std::string &data_column_key,
- const RateMode rate_mode)
+
+void
+ConvergenceTable::evaluate_convergence_rates(const std::string &data_column_key,
+ const RateMode rate_mode)
{
Assert(columns.count(data_column_key), ExcColumnNotExistent(data_column_key));
{
case none:
break;
+
case reduction_rate:
rate_key+="red.rate";
Assert(columns.count(rate_key)==0, ExcRateColumnAlreadyExists(rate_key));
for (unsigned int i=1; i<n; ++i)
add_value(rate_key, values[i-1]/values[i]);
break;
+
case reduction_rate_log2:
rate_key+="red.rate.log2";
Assert(columns.count(rate_key)==0, ExcRateColumnAlreadyExists(rate_key));
for (unsigned int i=1; i<n; ++i)
add_value(rate_key, std::log(values[i-1]/values[i])/std::log(2.0));
break;
+
default:
ExcNotImplemented();
}
add_column_to_supercolumn(rate_key, superkey);
}
-void ConvergenceTable::omit_column_from_convergence_rate_evaluation(const std::string &key)
+
+
+void
+ConvergenceTable::omit_column_from_convergence_rate_evaluation(const std::string &key)
{
Assert(columns.count(key), ExcColumnNotExistent(key));
}
-void ConvergenceTable::evaluate_all_convergence_rates(const std::string &reference_column_key,
- const RateMode rate_mode)
+
+void
+ConvergenceTable::evaluate_all_convergence_rates(const std::string &reference_column_key,
+ const RateMode rate_mode)
{
for (std::map<std::string, Column>::const_iterator col_iter=columns.begin();
col_iter!=columns.end(); ++col_iter)
}
-void ConvergenceTable::evaluate_all_convergence_rates(const RateMode rate_mode)
+
+void
+ConvergenceTable::evaluate_all_convergence_rates(const RateMode rate_mode)
{
for (std::map<std::string, Column>::const_iterator col_iter=columns.begin();
col_iter!=columns.end(); ++col_iter)
template <int dim, int spacedim>
-DataOutBase::Patch<dim,spacedim>::Patch () :
+DataOutBase::Patch<dim,spacedim>::Patch ()
+ :
patch_index(no_neighbor),
n_subdivisions (1)
-
// all the other data has a
// constructor of its own, except
// for the "neighbors" field, which
-DataOutBase::UcdFlags::UcdFlags (const bool write_preamble) :
+DataOutBase::UcdFlags::UcdFlags (const bool write_preamble)
+ :
write_preamble (write_preamble)
{}
DataOutBase::PovrayFlags::PovrayFlags (const bool smooth,
const bool bicubic_patch,
- const bool external_data) :
+ const bool external_data)
+ :
smooth (smooth),
bicubic_patch(bicubic_patch),
external_data(external_data)
DataOutBase::DXFlags::DXFlags (const bool write_multigrid,
- const bool write_neighbors) :
+ const bool write_neighbors)
+ :
write_multigrid(write_multigrid),
write_neighbors(write_neighbors)
{}
const bool draw_mesh,
const bool draw_cells,
const bool shade_cells,
- const ColorFunction color_function) :
+ const ColorFunction color_function)
+ :
height_vector(height_vector),
color_vector(color_vector),
size_type(size_type),
-DataOutBase::TecplotFlags::TecplotFlags (const char* tecplot_binary_file_name) :
- tecplot_binary_file_name(tecplot_binary_file_name)
-{
-}
+DataOutBase::TecplotFlags::
+TecplotFlags (const char* tecplot_binary_file_name)
+ :
+ tecplot_binary_file_name(tecplot_binary_file_name)
+{}
{
class TecplotMacros
{
- public:
- TecplotMacros(const unsigned int n_nodes = 0,
- const unsigned int n_vars = 0,
- const unsigned int n_cells = 0,
- const unsigned int n_vert = 0);
- ~TecplotMacros();
- float & nd(const unsigned int i, const unsigned int j);
- int & cd(const unsigned int i, const unsigned int j);
- std::vector<float> nodalData;
- std::vector<int> connData;
- private:
- unsigned int n_nodes;
- unsigned int n_vars;
- unsigned int n_cells;
- unsigned int n_vert;
+ public:
+ TecplotMacros(const unsigned int n_nodes = 0,
+ const unsigned int n_vars = 0,
+ const unsigned int n_cells = 0,
+ const unsigned int n_vert = 0);
+ ~TecplotMacros();
+ float & nd(const unsigned int i, const unsigned int j);
+ int & cd(const unsigned int i, const unsigned int j);
+ std::vector<float> nodalData;
+ std::vector<int> connData;
+ private:
+ unsigned int n_nodes;
+ unsigned int n_vars;
+ unsigned int n_cells;
+ unsigned int n_vert;
};
TecplotMacros::TecplotMacros(const unsigned int n_nodes,
const unsigned int n_vars,
const unsigned int n_cells,
- const unsigned int n_vert) :
+ const unsigned int n_vert)
+ :
n_nodes(n_nodes),
n_vars(n_vars),
n_cells(n_cells),
inline
TecplotMacros::~TecplotMacros()
- {
- }
+ {}
inline
- float & TecplotMacros::nd(const unsigned int i, const unsigned int j)
+ float & TecplotMacros::nd (const unsigned int i,
+ const unsigned int j)
{
return nodalData[(i)*(n_nodes) + (j)];
}
inline
- int & TecplotMacros::cd(const unsigned int i, const unsigned int j)
+ int & TecplotMacros::cd (const unsigned int i,
+ const unsigned int j)
{
return connData[(i) + (j)*(n_vert)];
}
#ifndef DEAL_II_HAVE_TECPLOT
- // simply call the ASCII output function if the Tecplot API isn't present
+ // simply call the ASCII output
+ // function if the Tecplot API
+ // isn't present
write_tecplot (patches, data_names, flags, out);
return;
#else
- // Tecplot binary output only good for 2D & 3D
+ // Tecplot binary output only good
+ // for 2D & 3D
if (dim == 1)
{
write_tecplot (patches, data_names, flags, out);
return;
};
- // if the user hasn't specified a file name we should
- // call the ASCII function and use the ostream @p{out}
- // instead of doing something silly later
+ // if the user hasn't specified a
+ // file name we should call the
+ // ASCII function and use the
+ // ostream @p{out} instead of doing
+ // something silly later
char* file_name = (char*) flags.tecplot_binary_file_name;
if (file_name == NULL)
// and cells for later use
unsigned int n_cells = 0,
n_nodes = 0;
- for (typename std::vector<Patch<dim,spacedim> >::const_iterator patch=patches.begin();
+ for (typename std::vector<Patch<dim,spacedim> >::const_iterator
+ patch=patches.begin();
patch!=patches.end(); ++patch)
switch (dim)
{
template <int dim, int spacedim>
-void DataOutInterface<dim,spacedim>::set_default_format(const OutputFormat fmt)
+void
+DataOutInterface<dim,spacedim>::set_default_format(const OutputFormat fmt)
{
- Assert(fmt != default_format, ExcNotImplemented());
+ Assert (fmt != default_format, ExcNotImplemented());
default_fmt = fmt;
}
template <int dim, int spacedim>
-void DataOutInterface<dim,spacedim>::set_flags (const DXFlags &flags)
+void
+DataOutInterface<dim,spacedim>::set_flags (const DXFlags &flags)
{
dx_flags = flags;
}
template <int dim, int spacedim>
-void DataOutInterface<dim,spacedim>::set_flags (const UcdFlags &flags)
+void
+DataOutInterface<dim,spacedim>::set_flags (const UcdFlags &flags)
{
ucd_flags = flags;
}
template <int dim, int spacedim>
-void DataOutInterface<dim,spacedim>::set_flags (const GnuplotFlags &flags)
+void
+DataOutInterface<dim,spacedim>::set_flags (const GnuplotFlags &flags)
{
gnuplot_flags = flags;
}
template <int dim, int spacedim>
-void DataOutInterface<dim,spacedim>::set_flags (const PovrayFlags &flags)
+void
+DataOutInterface<dim,spacedim>::set_flags (const PovrayFlags &flags)
{
povray_flags = flags;
}
template <int dim, int spacedim>
-void DataOutInterface<dim,spacedim>::set_flags (const EpsFlags &flags)
+void
+DataOutInterface<dim,spacedim>::set_flags (const EpsFlags &flags)
{
eps_flags = flags;
}
template <int dim, int spacedim>
-void DataOutInterface<dim,spacedim>::set_flags (const GmvFlags &flags)
+void
+DataOutInterface<dim,spacedim>::set_flags (const GmvFlags &flags)
{
gmv_flags = flags;
}
template <int dim, int spacedim>
-void DataOutInterface<dim,spacedim>::set_flags (const TecplotFlags &flags)
+void
+DataOutInterface<dim,spacedim>::set_flags (const TecplotFlags &flags)
{
tecplot_flags = flags;
}
template <int dim, int spacedim>
-void DataOutInterface<dim,spacedim>::set_flags (const VtkFlags &flags)
+void
+DataOutInterface<dim,spacedim>::set_flags (const VtkFlags &flags)
{
vtk_flags = flags;
}
template <int dim, int spacedim>
std::string
-DataOutInterface<dim,spacedim>::default_suffix (const OutputFormat output_format_) const
+DataOutInterface<dim,spacedim>::
+default_suffix (const OutputFormat output_format_) const
{
OutputFormat output_format = output_format_;
if (output_format == default_format)
template <int dim, int spacedim>
typename DataOutInterface<dim,spacedim>::OutputFormat
-DataOutInterface<dim,spacedim>::parse_output_format (const std::string &format_name)
+DataOutInterface<dim,spacedim>::
+parse_output_format (const std::string &format_name)
{
if (format_name == "dx")
return dx;
template <int dim, int spacedim>
-std::string DataOutInterface<dim,spacedim>::get_output_format_names ()
+std::string
+DataOutInterface<dim,spacedim>::get_output_format_names ()
{
return "dx|ucd|gnuplot|povray|eps|gmv|tecplot|vtk";
}
template <int dim, int spacedim>
-void DataOutInterface<dim,spacedim>::declare_parameters (ParameterHandler &prm)
+void
+DataOutInterface<dim,spacedim>::declare_parameters (ParameterHandler &prm)
{
prm.declare_entry ("Output format", "gnuplot",
Patterns::Selection (get_output_format_names ()));
template <int dim, int spacedim>
-void DataOutInterface<dim,spacedim>::parse_parameters (ParameterHandler &prm)
+void
+DataOutInterface<dim,spacedim>::parse_parameters (ParameterHandler &prm)
{
const std::string& output_name = prm.get ("Output format");
default_fmt = parse_output_format (output_name);
}
+
template <int dim, int spacedim>
unsigned int
DataOutInterface<dim,spacedim>::memory_consumption () const
-ExceptionBase::ExceptionBase () :
+ExceptionBase::ExceptionBase ()
+ :
file(""), line(0), function(""), cond(""), exc("")
{}
ExceptionBase::ExceptionBase (const char* f, const int l, const char *func,
- const char* c, const char *e) :
+ const char* c, const char *e)
+ :
file(f), line(l), function(func), cond(c), exc(e)
{}
template <int dim>
Function<dim>::Function (const unsigned int n_components,
- const double initial_time) :
+ const double initial_time)
+ :
FunctionTime(initial_time),
n_components(n_components)
{}
//------------------------------------------------------------//
template <int dim>
-ZeroFunction<dim>::ZeroFunction (const unsigned int n_components) :
+ZeroFunction<dim>::ZeroFunction (const unsigned int n_components)
+ :
Function<dim> (n_components)
{}
template <int dim>
ConstantFunction<dim>::ConstantFunction (const double value,
- const unsigned int n_components) :
+ const unsigned int n_components)
+ :
ZeroFunction<dim> (n_components),
function_value (value)
{}
+
template <int dim>
ConstantFunction<dim>::~ConstantFunction () {}
+
template <int dim>
double ConstantFunction<dim>::value (const Point<dim> &,
const unsigned int) const
}
+
template <int dim>
void ConstantFunction<dim>::vector_value (const Point<dim> &,
Vector<double> &return_value) const
}
+
template <int dim>
void ConstantFunction<dim>::value_list (const std::vector<Point<dim> > &points,
std::vector<double> &values,
}
+
template <int dim>
void ConstantFunction<dim>::vector_value_list (const std::vector<Point<dim> > &points,
std::vector<Vector<double> > &values) const
//------------------------------------------------------------//
template <int dim>
-ComponentSelectFunction<dim>::ComponentSelectFunction (const unsigned int selected,
- const double value,
- const unsigned int n_components)
+ComponentSelectFunction<dim>::
+ComponentSelectFunction (const unsigned int selected,
+ const double value,
+ const unsigned int n_components)
:
ConstantFunction<dim> (value, n_components),
- selected(selected)
+ selected(selected)
{}
+
template <int dim>
void ComponentSelectFunction<dim>::vector_value (const Point<dim> &,
Vector<double> &return_value) const
const std::vector<double> &weights)
:
Function<dim> (1),
- fourier_coefficients (fourier_coefficients),
- weights (weights)
+ fourier_coefficients (fourier_coefficients),
+ weights (weights)
{
Assert (fourier_coefficients.size() > 0, ExcInvalidArraySize());
Assert (fourier_coefficients.size() == weights.size(),
// $Id$
// Version: $Name$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 by the deal authors
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 by the deal authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
// $Id$
// Version: $Name$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 by the deal authors
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 by the deal authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
time(initial_time)
{}
+
+
FunctionTime::~FunctionTime()
{}
+
+
void
FunctionTime::set_time (const double new_time)
{
time = new_time;
}
+
+
void
FunctionTime::advance_time (const double delta_t)
{
void
-LogStream::depth_console(unsigned n)
+LogStream::depth_console (const unsigned n)
{
std_depth = n;
}
void
-LogStream::depth_file(unsigned n)
+LogStream::depth_file (const unsigned n)
{
file_depth = n;
}
void
-LogStream::log_execution_time (bool flag)
+LogStream::log_execution_time (const bool flag)
{
print_utime = flag;
}
void
-LogStream::log_time_differences (bool flag)
+LogStream::log_time_differences (const bool flag)
{
diff_utime = flag;
}
#endif
-MultithreadInfo::MultithreadInfo () :
+MultithreadInfo::MultithreadInfo ()
+ :
n_cpus (get_n_cpus()),
n_default_threads (n_cpus)
{}
# include <limits>
#endif
+//TODO[WB]: Remove the "status" flag -- it's only a remnant of the DiffPack past of this class and doesn't really serve any useful purpose any more
namespace Patterns
{
Integer::Integer (const int lower_bound,
- const int upper_bound) :
+ const int upper_bound)
+ :
lower_bound (lower_bound),
upper_bound (upper_bound)
{}
#endif
Double::Double (const double lower_bound,
- const double upper_bound) :
+ const double upper_bound)
+ :
lower_bound (lower_bound),
upper_bound (upper_bound)
{}
- Bool::Bool () :
+ Bool::Bool ()
+ :
Selection ("true|false")
{}
-ParameterHandler::ParameterHandler () :
+ParameterHandler::ParameterHandler ()
+ :
status(true) {}
if (p->entries.find (entry) != p->entries.end())
return false;
+ // entry doesn't yet exist, but
+ // map::operator[] will create it
p->entries[entry] = std::make_pair(default_value, pattern.clone());
- // check whether default answer matches
- // the pattern
+ // check whether default answer
+ // matches the pattern
if (!pattern.match(default_value))
return false;
};
-// entry exists; now find out whether
- // it was changed:
+ // entry exists; now find out
+ // whether it was changed:
Section::EntryType::const_iterator ptr;
ptr = pc->entries.find (entry_string);
if (ptr != pc->entries.end())
ParameterHandler::log_parameters (LogStream &out)
{
out.push("parameters");
- // dive recursively into the subsections
+ // dive recursively into the
+ // subsections
log_parameters_section (out);
out.pop();
-MultipleParameterLoop::MultipleParameterLoop() :
+MultipleParameterLoop::MultipleParameterLoop()
+ :
n_branches(0)
{}
MultipleParameterLoop::Entry::Entry (const std::vector<std::string> &ssp,
const std::string &Name,
- const std::string &Value) :
+ const std::string &Value)
+ :
subsection_path (ssp), entry_name(Name), entry_value(Value)
{}
template <typename number>
void
- Polynomial<number>::scale(std::vector<number> &coefficients,
- const number factor)
+ Polynomial<number>::scale (std::vector<number> &coefficients,
+ const number factor)
{
double f = 1.;
for (typename std::vector<number>::iterator c = coefficients.begin();
template <typename number>
void
- Polynomial<number>::scale(const number factor)
+ Polynomial<number>::scale (const number factor)
{
scale (coefficients, factor);
}
template <typename number>
void
- Polynomial<number>::multiply(std::vector<number> &coefficients,
- const number factor)
+ Polynomial<number>::multiply (std::vector<number> &coefficients,
+ const number factor)
{
for (typename std::vector<number>::iterator c = coefficients.begin();
c != coefficients.end(); ++c)
template <typename number>
template <typename number2>
void
- Polynomial<number>::shift(const number2 offset)
+ Polynomial<number>::shift (const number2 offset)
{
- shift(coefficients, offset);
+ shift (coefficients, offset);
}
template <typename number>
void
- Polynomial<number>::print(std::ostream& out) const
+ Polynomial<number>::print (std::ostream& out) const
{
for (int i=degree();i>=0;--i)
{
template <>
void
PolynomialSpace<1>::
-compute_index(const unsigned int n,
- unsigned int (&index)[1]) const
+compute_index (const unsigned int n,
+ unsigned int (&index)[1]) const
{
index[0] = n;
}
template <int dim>
Quadrature<dim>::Quadrature (const std::vector<Point<dim> > &points,
- const std::vector<double> &weights)
+ const std::vector<double> &weights)
:
n_quadrature_points(points.size()),
quadrature_points(points),
weights(weights)
{
- Assert(weights.size() == points.size(),
- ExcDimensionMismatch(weights.size(), points.size()));
+ Assert (weights.size() == points.size(),
+ ExcDimensionMismatch(weights.size(), points.size()));
}
template <int dim>
-Quadrature<dim>::Quadrature (const Point<dim> &point):
+Quadrature<dim>::Quadrature (const Point<dim> &point)
+ :
n_quadrature_points(1),
quadrature_points(std::vector<Point<dim> > (1, point)),
weights(std::vector<double> (1, 1.))
template <>
Quadrature<0>::Quadrature (const Quadrature<-1> &,
const Quadrature<1> &)
- : n_quadrature_points (0)
+ :
+ n_quadrature_points (0)
{
Assert (false, ExcInternalError());
}
template <>
Quadrature<1>::Quadrature (const Quadrature<0> &,
- const Quadrature<1> &) :
+ const Quadrature<1> &)
+ :
n_quadrature_points (0)
{
Assert (false, ExcInternalError());
template <int dim>
Quadrature<dim>::Quadrature (const SubQuadrature &q1,
- const Quadrature<1> &q2)
+ const Quadrature<1> &q2)
:
n_quadrature_points (q1.n_quadrature_points *
q2.n_quadrature_points),
template <>
-const Point<0> & Quadrature<0>::point (const unsigned int) const
+const Point<0> &
+Quadrature<0>::point (const unsigned int) const
{
Assert (false, ExcInternalError());
static const Point<0> dummy;
template <int dim>
-const Point<dim> & Quadrature<dim>::point (const unsigned int i) const
+const Point<dim> &
+Quadrature<dim>::point (const unsigned int i) const
{
Assert (i<n_quadrature_points, ExcIndexRange(i, 0, n_quadrature_points));
return quadrature_points[i];
template <>
-const std::vector<Point<0> > & Quadrature<0>::get_points () const
+const std::vector<Point<0> > &
+Quadrature<0>::get_points () const
{
Assert (false, ExcInternalError());
return quadrature_points;
template <int dim>
-const std::vector<Point<dim> > & Quadrature<dim>::get_points () const
+const std::vector<Point<dim> > &
+Quadrature<dim>::get_points () const
{
return quadrature_points;
}
template <>
-double Quadrature<0>::weight (const unsigned int) const
+double
+Quadrature<0>::weight (const unsigned int) const
{
Assert (false, ExcInternalError());
return 0;
template <int dim>
-double Quadrature<dim>::weight (const unsigned int i) const
+double
+Quadrature<dim>::weight (const unsigned int i) const
{
Assert (i<n_quadrature_points, ExcIndexRange(i, 0, n_quadrature_points));
return weights[i];
template <int dim>
-const std::vector<double> & Quadrature<dim>::get_weights () const
+const std::vector<double> &
+Quadrature<dim>::get_weights () const
{
return weights;
}
template <>
-const std::vector<double> & Quadrature<0>::get_weights () const
+const std::vector<double> &
+Quadrature<0>::get_weights () const
{
Assert (false, ExcInternalError());
return weights;
template <>
-void QProjector<1>::project_to_face (const Quadrature<0> &,
- const unsigned int,
- std::vector<Point<1> > &)
+void
+QProjector<1>::project_to_face (const Quadrature<0> &,
+ const unsigned int,
+ std::vector<Point<1> > &)
{
- Assert(false, ExcNotImplemented());
+ Assert (false, ExcNotImplemented());
}
template <>
-void QProjector<2>::project_to_face (const Quadrature<1> &quadrature,
- const unsigned int face_no,
- std::vector<Point<2> > &q_points)
+void
+QProjector<2>::project_to_face (const Quadrature<1> &quadrature,
+ const unsigned int face_no,
+ std::vector<Point<2> > &q_points)
{
const unsigned int dim=2;
Assert (face_no<2*dim, ExcIndexRange (face_no, 0, 2*dim));
template <>
-void QProjector<3>::project_to_face (const Quadrature<2> &quadrature,
- const unsigned int face_no,
- std::vector<Point<3> > &q_points)
+void
+QProjector<3>::project_to_face (const Quadrature<2> &quadrature,
+ const unsigned int face_no,
+ std::vector<Point<3> > &q_points)
{
const unsigned int dim=3;
Assert (face_no<2*dim, ExcIndexRange (face_no, 0, 2*dim));
template <>
-void QProjector<1>::project_to_subface (const Quadrature<0> &,
- const unsigned int,
- const unsigned int,
- std::vector<Point<1> > &)
+void
+QProjector<1>::project_to_subface (const Quadrature<0> &,
+ const unsigned int,
+ const unsigned int,
+ std::vector<Point<1> > &)
{
Assert(false, ExcNotImplemented());
}
template <>
-void QProjector<2>::project_to_subface (const Quadrature<1> &quadrature,
- const unsigned int face_no,
- const unsigned int subface_no,
- std::vector<Point<2> > &q_points)
+void
+QProjector<2>::project_to_subface (const Quadrature<1> &quadrature,
+ const unsigned int face_no,
+ const unsigned int subface_no,
+ std::vector<Point<2> > &q_points)
{
const unsigned int dim=2;
Assert (face_no<2*dim, ExcIndexRange (face_no, 0, 2*dim));
template <>
-void QProjector<3>::project_to_subface (const Quadrature<2> &quadrature,
- const unsigned int face_no,
- const unsigned int subface_no,
- std::vector<Point<3> > &q_points)
+void
+QProjector<3>::project_to_subface (const Quadrature<2> &quadrature,
+ const unsigned int face_no,
+ const unsigned int subface_no,
+ std::vector<Point<3> > &q_points)
{
const unsigned int dim=3;
Assert (face_no<2*dim, ExcIndexRange (face_no, 0, 2*dim));
template <>
QIterated<1>::QIterated (const Quadrature<1> &base_quadrature,
- const unsigned int n_copies) :
+ const unsigned int n_copies)
+ :
Quadrature<1> (uses_both_endpoints(base_quadrature) ?
(base_quadrature.n_quadrature_points-1) * n_copies + 1 :
base_quadrature.n_quadrature_points * n_copies)
// of lower dimensional iterated quadrature formulae
template <int dim>
QIterated<dim>::QIterated (const Quadrature<1> &base_quadrature,
- const unsigned int N) :
+ const unsigned int N)
+ :
Quadrature<dim> (QIterated<dim-1>(base_quadrature, N),
QIterated<1>(base_quadrature, N))
{}
// $Id$
// Version: $Name$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 by the deal authors
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 by the deal authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
template <>
QGauss<1>::QGauss (const unsigned int n)
- : Quadrature<1> (n)
+ :
+ Quadrature<1> (n)
{
const unsigned int m = (n+1)/2;
long double z;
template <>
-QGauss2<1>::QGauss2 () :
+QGauss2<1>::QGauss2 ()
+ :
Quadrature<1> (2)
{
// points on [-1,1]
}
+
template <>
-QGauss3<1>::QGauss3 () :
+QGauss3<1>::QGauss3 ()
+ :
Quadrature<1> (3)
{
// points on [-1,1]
}
+
template <>
-QGauss4<1>::QGauss4 () :
+QGauss4<1>::QGauss4 ()
+ :
Quadrature<1> (4)
{
// points on [-1,1]
template <>
-QGauss5<1>::QGauss5 () :
+QGauss5<1>::QGauss5 ()
+ :
Quadrature<1> (5)
{
// points on [-1,1]
}
+
template <>
-QGauss6<1>::QGauss6 () :
+QGauss6<1>::QGauss6 ()
+ :
Quadrature<1> (6)
{
// points on [-1,1]
}
+
template <>
-QGauss7<1>::QGauss7 () :
+QGauss7<1>::QGauss7 ()
+ :
Quadrature<1> (7)
{
// points on [-1,1]
template <>
-QMidpoint<1>::QMidpoint () :
+QMidpoint<1>::QMidpoint ()
+ :
Quadrature<1>(1)
{
this->quadrature_points[0] = Point<1>(0.5);
}
+
template <>
-QTrapez<1>::QTrapez () :
+QTrapez<1>::QTrapez ()
+ :
Quadrature<1> (2)
{
static const double xpts[] = { 0.0, 1.0 };
}
+
template <>
-QSimpson<1>::QSimpson () :
+QSimpson<1>::QSimpson ()
+ :
Quadrature<1> (3)
{
static const double xpts[] = { 0.0, 0.5, 1.0 };
}
+
template <>
-QMilne<1>::QMilne () :
+QMilne<1>::QMilne ()
+ :
Quadrature<1> (5)
{
static const double xpts[] = { 0.0, .25, .5, .75, 1.0 };
}
+
template <>
-QWeddle<1>::QWeddle () :
+QWeddle<1>::QWeddle ()
+ :
Quadrature<1> (7)
{
static const double xpts[] = { 0.0, 1./6., 1./3., .5, 2./3., 5./6., 1.0 };
template <int dim>
-QGauss2<dim>::QGauss2 () : Quadrature<dim> (QGauss2<dim-1>(), QGauss2<1>()) {}
+QGauss2<dim>::QGauss2 ()
+ :
+ Quadrature<dim> (QGauss2<dim-1>(), QGauss2<1>())
+{}
+
+
template <int dim>
-QGauss3<dim>::QGauss3 () :
- Quadrature<dim> (QGauss3<dim-1>(), QGauss3<1>()){}
+QGauss3<dim>::QGauss3 ()
+ :
+ Quadrature<dim> (QGauss3<dim-1>(), QGauss3<1>())
+{}
+
+
template <int dim>
-QGauss4<dim>::QGauss4 () :
- Quadrature<dim> (QGauss4<dim-1>(), QGauss4<1>()){}
+QGauss4<dim>::QGauss4 ()
+ :
+ Quadrature<dim> (QGauss4<dim-1>(), QGauss4<1>())
+{}
+
+
template <int dim>
-QGauss5<dim>::QGauss5 () :
- Quadrature<dim> (QGauss5<dim-1>(), QGauss5<1>()){}
+QGauss5<dim>::QGauss5 ()
+ :
+ Quadrature<dim> (QGauss5<dim-1>(), QGauss5<1>())
+{}
+
+
template <int dim>
-QGauss6<dim>::QGauss6 () :
- Quadrature<dim> (QGauss6<dim-1>(), QGauss6<1>()){}
+QGauss6<dim>::QGauss6 ()
+ :
+ Quadrature<dim> (QGauss6<dim-1>(), QGauss6<1>())
+{}
+
+
template <int dim>
-QGauss7<dim>::QGauss7 () :
- Quadrature<dim> (QGauss7<dim-1>(), QGauss7<1>()){}
+QGauss7<dim>::QGauss7 ()
+ :
+ Quadrature<dim> (QGauss7<dim-1>(), QGauss7<1>())
+{}
+
template <int dim>
-QMidpoint<dim>::QMidpoint () :
- Quadrature<dim> (QMidpoint<dim-1>(), QMidpoint<1>()){}
+QMidpoint<dim>::QMidpoint ()
+ :
+ Quadrature<dim> (QMidpoint<dim-1>(), QMidpoint<1>())
+{}
+
+
template <int dim>
-QTrapez<dim>::QTrapez () :
- Quadrature<dim> (QTrapez<dim-1>(), QTrapez<1>()){}
+QTrapez<dim>::QTrapez ()
+ :
+ Quadrature<dim> (QTrapez<dim-1>(), QTrapez<1>())
+{}
+
+
template <int dim>
-QSimpson<dim>::QSimpson () :
- Quadrature<dim> (QSimpson<dim-1>(), QSimpson<1>()){}
+QSimpson<dim>::QSimpson ()
+ :
+ Quadrature<dim> (QSimpson<dim-1>(), QSimpson<1>())
+{}
+
+
template <int dim>
-QMilne<dim>::QMilne () :
- Quadrature<dim> (QMilne<dim-1>(), QMilne<1>()){}
+QMilne<dim>::QMilne ()
+ :
+ Quadrature<dim> (QMilne<dim-1>(), QMilne<1>())
+{}
+
template <int dim>
-QWeddle<dim>::QWeddle () :
- Quadrature<dim> (QWeddle<dim-1>(), QWeddle<1>()){}
+QWeddle<dim>::QWeddle ()
+ :
+ Quadrature<dim> (QWeddle<dim-1>(), QWeddle<1>())
+{}
// explicit specialization
-Subscriptor::Subscriptor () :
+Subscriptor::Subscriptor ()
+ :
counter (0),
object_info (0)
{}
-Subscriptor::Subscriptor (const Subscriptor &) :
+Subscriptor::Subscriptor (const Subscriptor &)
+ :
counter (0),
object_info (0)
{}
}
-void Subscriptor::unsubscribe () const {
+void Subscriptor::unsubscribe () const
+{
Assert (counter>0, ExcNotUsed());
Threads::ThreadMutex::ScopedLock lock (subscription_lock);
--counter;
}
-unsigned int Subscriptor::n_subscriptions () const
+unsigned int Subscriptor::n_subscriptions () const
{
return counter;
}
/*---------------------------------------------------------------------*/
template <typename number>
-TableEntry<number>::TableEntry(const number value):
- val(value) {}
+TableEntry<number>::TableEntry(const number value)
+ :
+ val(value)
+{}
+
+
template <typename number>
TableEntry<number>::~TableEntry()
{}
+
+
template <typename number>
number TableEntry<number>::value() const
{
}
+
template <typename number>
void TableEntry<number>::write_tex (std::ostream &out) const
{
out << val;
}
+
+
template <typename number>
void TableEntry<number>::write_text (std::ostream &out) const
{
/*---------------------------------------------------------------------*/
-TableHandler::Column::Column(const std::string &tex_caption):
+TableHandler::Column::Column(const std::string &tex_caption)
+ :
tex_caption(tex_caption),
tex_format("c"),
precision(4),
{}
-TableHandler::Column::Column():
+
+TableHandler::Column::Column()
+ :
tex_caption(),
tex_format("c"),
precision(4),
{}
+
TableHandler::Column::~Column()
{
for (unsigned int i=0; i<entries.size(); ++i)
}
-void TableHandler::write_tex(std::ofstream &out) const
+void TableHandler::write_tex (std::ofstream &out) const
{
AssertThrow (out, ExcIO());
unsigned int TableHandler::n_rows() const
{
std::map<std::string, Column>::const_iterator col_iter=columns.begin();
- unsigned int n=col_iter->second.entries.size();
+ unsigned int n = col_iter->second.entries.size();
std::string first_name=col_iter->first;
for (++col_iter; col_iter!=columns.end(); ++col_iter)
// $Id$
// Version: $Name$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 by the deal authors
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 by the deal authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
{}
+
template <int rank, int dim>
TensorFunction<rank, dim>::~TensorFunction ()
{}
ThreadMutex n_existing_threads_mutex;
- void register_thread ()
+ void register_thread ()
{
ThreadMutex::ScopedLock lock (n_existing_threads_mutex);
++n_existing_threads_counter;
unsigned int n_existing_threads ()
{
ThreadMutex::ScopedLock lock (internal::n_existing_threads_mutex);
- const unsigned int n = internal::n_existing_threads_counter;
- return n;
+ return internal::n_existing_threads_counter;
}
// $Id$
// Version: $Name$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 by the deal authors
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 by the deal authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
Timer::Timer()
- : cumulative_time (0.)
+ :
+ cumulative_time (0.)
{
start();
}
#endif
//
// last known and checked version is 3.4:
-#if (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ > 4))
+#if (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ > 5))
# if defined(BOOST_ASSERT_CONFIG)
# error "Unknown compiler version - please run the configure tests and report the results"
# else
TriaAccessor (const Triangulation<dim> *parent = 0,
const int level = -1,
const int index = -1,
- const AccessorData * = 0) :
+ const AccessorData * = 0)
+ :
present_level (level),
present_index (index),
tria (parent) {};
/**
* Same as above.
*/
- TriaAccessor &operator = (const TriaAccessor &);
+ TriaAccessor & operator = (const TriaAccessor &);
protected:
TriaObjectAccessor (const Triangulation<dim> *parent = 0,
const int level = -1,
const int index = -1,
- const AccessorData *local_data = 0) :
- TriaAccessor<dim> (parent, level, index, local_data) {};
+ const AccessorData *local_data = 0)
+ :
+ TriaAccessor<dim> (parent, level, index, local_data)
+ {};
/**
* Copy the data of a line. Only
*
* Implemented only for @p{celldim>1}.
*/
- TriaIterator<dim,TriaObjectAccessor<1, dim> > line (const unsigned int i) const;
+ TriaIterator<dim,TriaObjectAccessor<1, dim> >
+ line (const unsigned int i) const;
/**
* Line index of the @p{i}th
*
* Implemented only for @p{celldim>2}.
*/
- TriaIterator<dim,TriaObjectAccessor<2, dim> > quad (const unsigned int i) const;
+ TriaIterator<dim,TriaObjectAccessor<2, dim> >
+ quad (const unsigned int i) const;
/**
* Quad index of the @p{i}th
* you are doing! This value is
* reserved for another purpose
* and algorithms may not work if
- * boundary cells have have this
+ * boundary cells have this
* boundary indicator or if
* interior cells have boundary
* indicators other than 255.
*/
- void set_boundary_indicator (unsigned char) const;
+ void set_boundary_indicator (const unsigned char) const;
/**
* Return whether this object is
TriaObjectAccessor (const Triangulation<dim> *parent = 0,
const int level = -1,
const int index = -1,
- const AccessorData *local_data = 0) :
+ const AccessorData *local_data = 0)
+ :
TriaAccessor<dim> (parent, level, index, local_data)
{
Assert (false, ExcInternalError());
TriaObjectAccessor (const Triangulation<dim> *parent = 0,
const int level = -1,
const int index = -1,
- const AccessorData *local_data = 0) :
- TriaAccessor<dim> (parent, level, index, local_data) {};
+ const AccessorData *local_data = 0)
+ :
+ TriaAccessor<dim> (parent, level, index, local_data)
+ {};
/**
* Copy the data of the given
* interior cells have boundary
* indicators other than 255.
*/
- void set_boundary_indicator (unsigned char) const;
+ void set_boundary_indicator (const unsigned char) const;
/**
* Return whether this line is at
TriaObjectAccessor (const Triangulation<dim> *parent = 0,
const int level = -1,
const int index = -1,
- const AccessorData *local_data = 0) :
- TriaAccessor<dim> (parent, level, index, local_data) {};
+ const AccessorData *local_data = 0)
+ :
+ TriaAccessor<dim> (parent, level, index, local_data)
+ {};
/**
* Copy the data of the given quad.
* doing, since this value is
* reserved for another purpose
* and algorithms may not work if
- * boundary cells have have this
+ * boundary cells have this
* boundary indicator or if
* interior cells have boundary
* indicators other than 255.
*/
- void set_boundary_indicator (unsigned char) const;
+ void set_boundary_indicator (const unsigned char) const;
/**
* Return whether this quad is at
TriaObjectAccessor (const Triangulation<dim> *parent = 0,
const int level = -1,
const int index = -1,
- const AccessorData *local_data = 0) :
- TriaAccessor<dim> (parent, level, index, local_data) {};
+ const AccessorData *local_data = 0)
+ :
+ TriaAccessor<dim> (parent, level, index, local_data)
+ {};
/**
* Copy the data of the given
* doing, since this value is
* reserved for another purpose
* and algorithms may not work if
- * boundary cells have have this
+ * boundary cells have this
* boundary indicator or if
* interior cells have boundary
* indicators other than 255.
*/
- void set_boundary_indicator (unsigned char) const;
+ void set_boundary_indicator (const unsigned char) const;
/**
* Return whether this hex is at
CellAccessor (const Triangulation<dim> *parent = 0,
const int level = -1,
const int index = -1,
- const AccessorData *local_data = 0) :
- TriaObjectAccessor<dim,dim> (parent, level, index, local_data) {};
+ const AccessorData *local_data = 0)
+ :
+ TriaObjectAccessor<dim,dim> (parent, level, index, local_data)
+ {};
/**
* Return a pointer to the
template <int dim>
-void TriaObjectAccessor<1, dim>::set_boundary_indicator (unsigned char boundary_ind) const
+void TriaObjectAccessor<1, dim>::set_boundary_indicator (const unsigned char boundary_ind) const
{
Assert (dim>=2, typename TriaAccessor<dim>::ExcNotUsefulForThisDimension());
Assert (used(), typename TriaAccessor<dim>::ExcCellNotUsed());
template <int dim>
-void TriaObjectAccessor<2, dim>::set_boundary_indicator (unsigned char boundary_ind) const
+void TriaObjectAccessor<2, dim>::set_boundary_indicator (const unsigned char boundary_ind) const
{
Assert (dim>=3, typename TriaAccessor<dim>::ExcNotUsefulForThisDimension());
Assert (used(), typename TriaAccessor<dim>::ExcCellNotUsed());
template <int dim>
-void TriaObjectAccessor<3, dim>::set_boundary_indicator (unsigned char boundary_ind) const
+void TriaObjectAccessor<3, dim>::set_boundary_indicator (const unsigned char boundary_ind) const
{
Assert (dim<4, typename TriaAccessor<dim>::ExcNotUsefulForThisDimension());
Assert (used(), typename TriaAccessor<dim>::ExcCellNotUsed());
# run-time checking of parameters and internal states is performed, so
# you should set this value to `on' while you develop your program,
# and to `off' when running production computations.
-debug-mode = on
+debug-mode = off
# As third field, we need to give the path to the top-level deal.II
inline
std::pair<unsigned int,unsigned int>
-BlockIndices::global_to_local (const unsigned int i) const
+BlockIndices::global_to_local (const unsigned int i) const throw()
{
Assert (i<total_size(), ExcIndexRange(i, 0, total_size()));
inline
unsigned int
BlockIndices::local_to_global (const unsigned int block,
- const unsigned int index) const
+ const unsigned int index) const throw()
{
Assert (block < n_blocks, ExcIndexRange(block, 0, n_blocks));
Assert (index < start_indices[block+1]-start_indices[block],
inline
unsigned int
-BlockIndices::size () const
+BlockIndices::size () const throw()
{
return n_blocks;
}
inline
unsigned int
-BlockIndices::total_size () const
+BlockIndices::total_size () const throw()
{
return start_indices[n_blocks];
}
inline
unsigned int
-BlockIndices::block_size (const unsigned int block) const
+BlockIndices::block_size (const unsigned int block) const throw()
{
Assert (block < n_blocks, ExcIndexRange(block, 0, n_blocks));
return start_indices[block+1]-start_indices[block];
inline
bool
-BlockIndices::operator == (const BlockIndices &b) const
+BlockIndices::operator == (const BlockIndices &b) const throw()
{
if (n_blocks != b.n_blocks)
return false;
inline
void
-BlockIndices::swap (BlockIndices &b)
+BlockIndices::swap (BlockIndices &b) throw()
{
Assert (n_blocks == b.n_blocks,
ExcDimensionMismatch(n_blocks, b.n_blocks));
inline
unsigned int
-BlockIndices::memory_consumption () const
+BlockIndices::memory_consumption () const throw()
{
return (sizeof(*this) +
start_indices.size() * sizeof(start_indices[0]));
* @author Wolfgang Bangerth, 2000
*/
inline
-void swap (BlockIndices &u, BlockIndices &v)
+void swap (BlockIndices &u, BlockIndices &v) throw()
{
u.swap (v);
}
template <class MATRIX>
class BlockDiagonalMatrix : public Subscriptor
{
-public:
- /**
- * Constructor for an @p{n_blocks}
- * by @p{n_blocks} matrix with
- * diagonal blocks @p{M}.
- */
- BlockDiagonalMatrix (const MATRIX& M,
- unsigned int n_blocks);
-
- /**
- * Matrix-vector-multiplication.
- */
- template <typename number1, typename number2>
- void vmult (BlockVector<number1>& dst,
- const BlockVector<number2>& src) const;
+ public:
+ /**
+ * Constructor for an @p{n_blocks}
+ * by @p{n_blocks} matrix with
+ * diagonal blocks @p{M}.
+ */
+ BlockDiagonalMatrix (const MATRIX &M,
+ const unsigned int n_blocks);
+
+ /**
+ * Matrix-vector-multiplication.
+ */
+ template <typename number1, typename number2>
+ void vmult (BlockVector<number1>& dst,
+ const BlockVector<number2>& src) const;
- /**
- * Transposed matrix-vector-multiplication.
- */
- template <typename number1, typename number2>
- void Tvmult (BlockVector<number1>& dst,
- const BlockVector<number2>& src) const;
-private:
- /**
- * Number of blocks.
- */
- unsigned int num_blocks;
- /**
- * Diagonal entry.
- */
- SmartPointer<const MATRIX> matrix;
+ /**
+ * Transposed matrix-vector-multiplication.
+ */
+ template <typename number1, typename number2>
+ void Tvmult (BlockVector<number1>& dst,
+ const BlockVector<number2>& src) const;
+ private:
+ /**
+ * Number of blocks.
+ */
+ unsigned int num_blocks;
+
+ /**
+ * Diagonal entry.
+ */
+ SmartPointer<const MATRIX> matrix;
};
template <class MATRIX>
BlockDiagonalMatrix<MATRIX>::BlockDiagonalMatrix (const MATRIX& M,
- unsigned int num_blocks)
- : num_blocks (num_blocks),
- matrix(&M)
+ const unsigned int num_blocks)
+ :
+ num_blocks (num_blocks),
+ matrix(&M)
{}
template <typename number1, typename number2>
void
BlockDiagonalMatrix<MATRIX>::vmult (BlockVector<number1>& dst,
- const BlockVector<number2>& src) const
+ const BlockVector<number2>& src) const
{
Assert (dst.n_blocks()==num_blocks,
ExcDimensionMismatch(dst.n_blocks(),num_blocks));
* access, a const matrix
* pointer is sufficient.
*/
- Accessor (const BlockSparseMatrix<number>*,
- unsigned int row,
- unsigned short index);
+ Accessor (const BlockSparseMatrix<number> *m,
+ const unsigned int row,
+ const unsigned short index);
/**
* Row number of the element
template <typename number>
inline
-BlockSparseMatrix<number>::Accessor::Accessor (
- const BlockSparseMatrix<number>* matrix,
- unsigned int r,
- unsigned short i)
- : matrix(matrix),
- base_iterator(matrix->block(0,0).begin()),
- block_row(0),
- row_start(0),
- block_col(0),
- col_start(0),
- a_index(0)
+BlockSparseMatrix<number>::Accessor::
+Accessor (const BlockSparseMatrix<number> *matrix,
+ const unsigned int r,
+ const unsigned short i)
+ :
+ matrix(matrix),
+ base_iterator(matrix->block(0,0).begin()),
+ block_row(0),
+ row_start(0),
+ block_col(0),
+ col_start(0),
+ a_index(0)
{
Assert (i==0, ExcNotImplemented());
template <typename number>
inline
-BlockSparseMatrix<number>::const_iterator::const_iterator(
- const BlockSparseMatrix<number>* m,
- unsigned int r,
- unsigned short i)
- : BlockSparseMatrix<number>::Accessor(m, r, i)
+BlockSparseMatrix<number>::const_iterator::
+const_iterator(const BlockSparseMatrix<number>* m,
+ unsigned int r,
+ unsigned short i)
+ :
+ BlockSparseMatrix<number>::Accessor(m, r, i)
{}
template <typename number>
inline
bool
-BlockSparseMatrix<number>::const_iterator::operator == (const const_iterator& i) const
+BlockSparseMatrix<number>::const_iterator::
+operator == (const const_iterator& i) const
{
if (this->matrix != i->matrix)
return false;
template <typename number>
inline
bool
-BlockSparseMatrix<number>::const_iterator::operator != (const const_iterator& i) const
+BlockSparseMatrix<number>::const_iterator::
+operator != (const const_iterator& i) const
{
return !(*this == i);
}
template <typename number>
inline
bool
-BlockSparseMatrix<number>::const_iterator::operator < (const const_iterator& i) const
+BlockSparseMatrix<number>::const_iterator::
+operator < (const const_iterator& i) const
{
if (this->block_row<i->block_row)
return true;
template <typename somenumber>
void
BlockSparseMatrix<number>::
-precondition_Jacobi (BlockVector<somenumber> &dst,
+precondition_Jacobi (BlockVector<somenumber> &dst,
const BlockVector<somenumber> &src,
- const number omega) const
+ const number omega) const
{
Assert (rows == columns, ExcMatrixNotBlockSquare());
Assert (dst.n_blocks() == rows,
}
+
template <typename number>
inline
typename BlockSparseMatrix<number>::const_iterator
return const_iterator(this, 0, 0);
}
+
+
template <typename number>
inline
typename BlockSparseMatrix<number>::const_iterator
return const_iterator(this, m(), 0);
}
+
+
template <typename number>
inline
typename BlockSparseMatrix<number>::const_iterator
return const_iterator(this, r, 0);
}
+
+
template <typename number>
inline
typename BlockSparseMatrix<number>::const_iterator
*/
const SparseMatrixEZ<Number>&
block (const unsigned int row,
- const unsigned int column) const;
+ const unsigned int column) const;
/**
* Return the number of blocks in a
dst = 0.;
for (unsigned int row=0; row<n_block_rows(); ++row)
- {
- for (unsigned int col=0; col<n_block_cols(); ++col)
- block(row,col).vmult_add (dst.block(row),
- src.block(col));
- };
+ for (unsigned int col=0; col<n_block_cols(); ++col)
+ block(row,col).vmult_add (dst.block(row),
+ src.block(col));
}
template <typename Number>
template <typename somenumber>
void
-BlockSparseMatrixEZ<Number>::vmult_add (
- BlockVector<somenumber> &dst,
- const BlockVector<somenumber> &src) const
+BlockSparseMatrixEZ<Number>::
+vmult_add (BlockVector<somenumber> &dst,
+ const BlockVector<somenumber> &src) const
{
Assert (dst.n_blocks() == n_block_rows(),
ExcDimensionMismatch(dst.n_blocks(), n_block_rows()));
ExcDimensionMismatch(src.n_blocks(), n_block_cols()));
for (unsigned int row=0; row<n_block_rows(); ++row)
- {
- for (unsigned int col=0; col<n_block_cols(); ++col)
- block(row,col).vmult_add (dst.block(row),
- src.block(col));
- };
+ for (unsigned int col=0; col<n_block_cols(); ++col)
+ block(row,col).vmult_add (dst.block(row),
+ src.block(col));
}
template <typename Number>
template <typename somenumber>
void
-BlockSparseMatrixEZ<Number>::Tvmult (
- BlockVector<somenumber> &dst,
- const BlockVector<somenumber>& src) const
+BlockSparseMatrixEZ<Number>::
+Tvmult (BlockVector<somenumber> &dst,
+ const BlockVector<somenumber> &src) const
{
Assert (dst.n_blocks() == n_block_cols(),
ExcDimensionMismatch(dst.n_blocks(), n_block_cols()));
dst = 0.;
for (unsigned int row=0; row<n_block_rows(); ++row)
- {
- for (unsigned int col=0; col<n_block_cols(); ++col)
- block(row,col).Tvmult_add (dst.block(col),
- src.block(row));
- };
+ for (unsigned int col=0; col<n_block_cols(); ++col)
+ block(row,col).Tvmult_add (dst.block(col),
+ src.block(row));
}
template <typename Number>
template <typename somenumber>
void
-BlockSparseMatrixEZ<Number>::Tvmult_add (
- BlockVector<somenumber> &dst,
- const BlockVector<somenumber> &src) const
+BlockSparseMatrixEZ<Number>::
+Tvmult_add (BlockVector<somenumber> &dst,
+ const BlockVector<somenumber> &src) const
{
Assert (dst.n_blocks() == n_block_cols(),
ExcDimensionMismatch(dst.n_blocks(), n_block_cols()));
template <class STREAM>
inline
void
-BlockSparseMatrixEZ<number>::print_statistics(STREAM& out, bool full)
+BlockSparseMatrixEZ<number>::print_statistics (STREAM& out, bool full)
{
unsigned int used_total = 0;
unsigned int allocated_total = 0;
inline
SparsityPatternBase &
BlockSparsityPatternBase<SparsityPatternBase>::block (const unsigned int row,
- const unsigned int column)
+ const unsigned int column)
{
Assert (row<rows, ExcIndexRange(row,0,rows));
Assert (column<columns, ExcIndexRange(column,0,columns));
inline
const SparsityPatternBase &
BlockSparsityPatternBase<SparsityPatternBase>::block (const unsigned int row,
- const unsigned int column) const
+ const unsigned int column) const
{
Assert (row<rows, ExcIndexRange(row,0,rows));
Assert (column<columns, ExcIndexRange(column,0,columns));
public std::iterator<std::random_access_iterator_tag,
typename Types<number,constness>::NumberType>
#else
- random_access_iterator<typename Types<number,constness>::NumberType,int>
+ random_access_iterator<typename Types<number,constness>::NumberType,int>
#endif
{
private:
} // namespace BlockVectorIterators
} // namespace internal
+
+
/**
* A vector composed of several blocks each representing a vector of
* its own.
template <typename Number>
inline
BlockVector<Number> &
-BlockVector<Number>::operator *= (const Number factor)
+BlockVector<Number>::operator *= (const Number factor)
{
scale (factor);
return *this;
template <typename Number>
inline
BlockVector<Number> &
-BlockVector<Number>::operator /= (const Number factor)
+BlockVector<Number>::operator /= (const Number factor)
{
scale (1./factor);
return *this;
template <typename number, bool constness>
inline
bool
- Iterator<number,constness>::operator == (const Iterator &i) const
+ Iterator<number,constness>::
+ operator == (const Iterator &i) const
{
Assert (parent == i.parent, ExcPointerToDifferentVectors());
template <typename number, bool constness>
inline
bool
- Iterator<number,constness>::operator == (const InverseConstnessIterator &i) const
+ Iterator<number,constness>::
+ operator == (const InverseConstnessIterator &i) const
{
Assert (parent == i.parent, ExcPointerToDifferentVectors());
template <typename number, bool constness>
inline
bool
- Iterator<number,constness>::operator != (const Iterator &i) const
+ Iterator<number,constness>::
+ operator != (const Iterator &i) const
{
Assert (parent == i.parent, ExcPointerToDifferentVectors());
template <typename number, bool constness>
inline
bool
- Iterator<number,constness>::operator != (const InverseConstnessIterator &i) const
+ Iterator<number,constness>::
+ operator != (const InverseConstnessIterator &i) const
{
Assert (parent == i.parent, ExcPointerToDifferentVectors());
template <typename number, bool constness>
inline
bool
- Iterator<number,constness>::operator < (const Iterator &i) const
+ Iterator<number,constness>::
+ operator < (const Iterator &i) const
{
Assert (parent == i.parent, ExcPointerToDifferentVectors());
template <typename number, bool constness>
inline
bool
- Iterator<number,constness>::operator < (const InverseConstnessIterator &i) const
+ Iterator<number,constness>::
+ operator < (const InverseConstnessIterator &i) const
{
Assert (parent == i.parent, ExcPointerToDifferentVectors());
template <typename number, bool constness>
inline
bool
- Iterator<number,constness>::operator <= (const Iterator &i) const
+ Iterator<number,constness>::
+ operator <= (const Iterator &i) const
{
Assert (parent == i.parent, ExcPointerToDifferentVectors());
template <typename number, bool constness>
inline
bool
- Iterator<number,constness>::operator <= (const InverseConstnessIterator &i) const
+ Iterator<number,constness>::
+ operator <= (const InverseConstnessIterator &i) const
{
Assert (parent == i.parent, ExcPointerToDifferentVectors());
template <typename number, bool constness>
inline
bool
- Iterator<number,constness>::operator > (const Iterator &i) const
+ Iterator<number,constness>::
+ operator > (const Iterator &i) const
{
Assert (parent == i.parent, ExcPointerToDifferentVectors());
template <typename number, bool constness>
inline
bool
- Iterator<number,constness>::operator > (const InverseConstnessIterator &i) const
+ Iterator<number,constness>::
+ operator > (const InverseConstnessIterator &i) const
{
Assert (parent == i.parent, ExcPointerToDifferentVectors());
template <typename number, bool constness>
inline
bool
- Iterator<number,constness>::operator >= (const Iterator &i) const
+ Iterator<number,constness>::
+ operator >= (const Iterator &i) const
{
Assert (parent == i.parent, ExcPointerToDifferentVectors());
template <typename number, bool constness>
inline
bool
- Iterator<number,constness>::operator >= (const InverseConstnessIterator &i) const
+ Iterator<number,constness>::
+ operator >= (const InverseConstnessIterator &i) const
{
Assert (parent == i.parent, ExcPointerToDifferentVectors());
template <typename number, bool constness>
inline
typename Iterator<number,constness>::difference_type
- Iterator<number,constness>::operator - (const Iterator &i) const
+ Iterator<number,constness>::
+ operator - (const Iterator &i) const
{
Assert (parent == i.parent, ExcPointerToDifferentVectors());
template <typename number, bool constness>
inline
typename Iterator<number,constness>::difference_type
- Iterator<number,constness>::operator - (const InverseConstnessIterator &i) const
+ Iterator<number,constness>::
+ operator - (const InverseConstnessIterator &i) const
{
Assert (parent == i.parent, ExcPointerToDifferentVectors());
template <typename number, bool constness>
inline
Iterator<number,constness>
- Iterator<number,constness>::operator + (const difference_type &d) const
+ Iterator<number,constness>::
+ operator + (const difference_type &d) const
{
// if the index pointed to is
// still within the block we
template <typename number, bool constness>
inline
Iterator<number,constness>
- Iterator<number,constness>::operator - (const difference_type &d) const
+ Iterator<number,constness>::
+ operator - (const difference_type &d) const
{
// if the index pointed to is
// still within the block we
template <typename number, bool constness>
inline
Iterator<number,constness> &
- Iterator<number,constness>::operator += (const difference_type &d)
+ Iterator<number,constness>::
+ operator += (const difference_type &d)
{
// if the index pointed to is
// still within the block we
template <typename number, bool constness>
inline
Iterator<number,constness> &
- Iterator<number,constness>::operator -= (const difference_type &d)
+ Iterator<number,constness>::
+ operator -= (const difference_type &d)
{
// if the index pointed to is
// still within the block we
* Check if a value at a certain
* position may be non-zero.
*/
- bool exists (const unsigned int i, const unsigned int j) const;
+ bool exists (const unsigned int i,
+ const unsigned int j) const;
- /**
+ /**
* Make the sparsity pattern
* symmetric by adding the
* sparsity pattern of the
/**
* Constructor. Set the shift parameter.
*/
- AdditionalData (const double shift = 0.):
+ AdditionalData (const double shift = 0.)
+ :
shift(shift)
{}
*/
AdditionalData (double relaxation = 1.,
unsigned int start_adaption = 6,
- bool use_residual = true):
- relaxation(relaxation),
- start_adaption(start_adaption),
- use_residual(use_residual)
- {}
+ bool use_residual = true)
+ :
+ relaxation(relaxation),
+ start_adaption(start_adaption),
+ use_residual(use_residual)
+ {}
};
template <class VECTOR>
EigenPower<VECTOR>::EigenPower (SolverControl &cn,
VectorMemory<VECTOR> &mem,
- const AdditionalData &data):
+ const AdditionalData &data)
+ :
Solver<VECTOR>(cn, mem),
additional_data(data)
{}
+
template <class VECTOR>
EigenPower<VECTOR>::~EigenPower ()
{}
+
template <class VECTOR>
template <class MATRIX>
void
template <class VECTOR>
EigenInverse<VECTOR>::EigenInverse (SolverControl &cn,
VectorMemory<VECTOR> &mem,
- const AdditionalData &data):
+ const AdditionalData &data)
+ :
Solver<VECTOR>(cn, mem),
additional_data(data)
{}
+
template <class VECTOR>
EigenInverse<VECTOR>::~EigenInverse ()
{}
+
template <class VECTOR>
template <class MATRIX>
void
template <class MATRIX, class VECTOR>
-FilteredMatrix<MATRIX,VECTOR>::
-FilteredMatrix ()
+FilteredMatrix<MATRIX,VECTOR>::FilteredMatrix ()
{}
template <class MATRIX, class VECTOR>
void
-FilteredMatrix<MATRIX,VECTOR>::clear_constraints ()
+FilteredMatrix<MATRIX,VECTOR>::clear_constraints ()
{
// swap vectors to release memory
std::vector<IndexValuePair> empty;
int,
<< "This function is not implemented for the given"
<< " matrix dimension " << arg1);
-
- private:
};
reinit (M.m(), M.n());
typename MATRIX::const_iterator entry;
const typename MATRIX::const_iterator end = M.end();
- for (entry = M.begin();entry != end;++entry)
+ for (entry = M.begin(); entry != end; ++entry)
el(entry->row(), entry->column()) = entry->value();
- }
+}
+
/*---------------------------- fullmatrix.h ---------------------------*/
template <typename number>
-FullMatrix<number>::FullMatrix (const FullMatrix &m) :
+FullMatrix<number>::FullMatrix (const FullMatrix &m)
+ :
Table<2,number> (m)
{}
template <typename number>
void FullMatrix<number>::add_col (const unsigned int i, const number s,
- const unsigned int j)
+ const unsigned int j)
{
Assert (this->data() != 0, ExcEmptyMatrix());
template <typename number>
void FullMatrix<number>::add_col (const unsigned int i, const number s,
- const unsigned int j, const number t,
- const unsigned int k)
+ const unsigned int j, const number t,
+ const unsigned int k)
{
Assert (this->data() != 0, ExcEmptyMatrix());
}
+
template <typename number>
void FullMatrix<number>::swap_row (const unsigned int i, const unsigned int j)
{
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())
{
+this->el(2,0)*this->el(0,1)*this->el(1,2)
-this->el(2,0)*this->el(0,2)*this->el(1,1));
default:
+ Assert (false,
+ ExcNotImplemented(this->n_cols()));
return 0;
};
}
}
+
template <typename number>
number
FullMatrix<number>::relative_symmetry_norm2 () const
}
+
template <typename number>
template <typename number2>
void
template <typename number>
void
-FullMatrix<number>::gauss_jordan()
+FullMatrix<number>::gauss_jordan ()
{
Assert (this->data() != 0, ExcEmptyMatrix());
Assert (this->n_cols() == this->n_rows(), ExcNotQuadratic());
template <typename number>
template <typename number2>
double
-FullMatrix<number>::least_squares(Vector<number2>& dst, Vector<number2>& src)
+FullMatrix<number>::least_squares (Vector<number2>& dst,
+ Vector<number2>& src)
{
Assert (this->data() != 0, ExcEmptyMatrix());
* modify the output of the
* @ref{MatrixOut} class.
*/
- class Options
+ struct Options
{
- public:
/**
* If @p{true}, only show the
* absolute values of the
static double get_gridpoint_value (const Matrix &matrix,
const unsigned int i,
const unsigned int j,
- const Options &options);
+ const Options &options);
};
return const_iterator(this, r, 0);
}
+
+
template <typename number>
inline
typename SparseMatrix<number>::const_iterator
template <typename number>
-SparseMatrix<number>::SparseMatrix () :
+SparseMatrix<number>::SparseMatrix ()
+ :
cols(0),
val(0),
max_len(0)
template <typename number>
-SparseMatrix<number>::SparseMatrix (const SparseMatrix &m) :
+SparseMatrix<number>::SparseMatrix (const SparseMatrix &m)
+ :
Subscriptor (m),
cols(0),
val(0),
template <typename number>
template <typename somenumber>
void
-SparseMatrix<number>::Tvmult (Vector<somenumber>& dst, const Vector<somenumber>& src) const
+SparseMatrix<number>::Tvmult (Vector<somenumber>& dst,
+ const Vector<somenumber>& src) const
{
Assert (val != 0, ExcMatrixNotInitialized());
Assert (cols != 0, ExcMatrixNotInitialized());
template <typename number>
template <typename somenumber>
void
-SparseMatrix<number>::vmult_add (Vector<somenumber>& dst, const Vector<somenumber>& src) const
+SparseMatrix<number>::vmult_add (Vector<somenumber>& dst,
+ const Vector<somenumber>& src) const
{
Assert (cols != 0, ExcMatrixNotInitialized());
Assert (val != 0, ExcMatrixNotInitialized());
template <typename number>
template <typename somenumber>
void
-SparseMatrix<number>::Tvmult_add (Vector<somenumber>& dst, const Vector<somenumber>& src) const
+SparseMatrix<number>::Tvmult_add (Vector<somenumber>& dst,
+ const Vector<somenumber>& src) const
{
Assert (val != 0, ExcMatrixNotInitialized());
Assert (cols != 0, ExcMatrixNotInitialized());
template <typename number>
template <typename somenumber>
void
-SparseMatrix<number>::threaded_matrix_norm_square (const Vector<somenumber> &v,
- const unsigned int begin_row,
- const unsigned int end_row,
- somenumber *partial_sum) const
+SparseMatrix<number>::
+threaded_matrix_norm_square (const Vector<somenumber> &v,
+ const unsigned int begin_row,
+ const unsigned int end_row,
+ somenumber *partial_sum) const
{
// this function should not be called
// when not in parallel mode.
template <typename number>
template <typename somenumber>
void
-SparseMatrix<number>::threaded_matrix_scalar_product (const Vector<somenumber> &u,
- const Vector<somenumber> &v,
- const unsigned int begin_row,
- const unsigned int end_row,
- somenumber *partial_sum) const
+SparseMatrix<number>::
+threaded_matrix_scalar_product (const Vector<somenumber> &u,
+ const Vector<somenumber> &v,
+ const unsigned int begin_row,
+ const unsigned int end_row,
+ somenumber *partial_sum) const
{
// this function should not be called
// when not in parallel mode.
template <typename number>
template <typename somenumber>
void
-SparseMatrix<number>::precondition_SOR (Vector<somenumber>& dst, const Vector<somenumber>& src,
- const number om) const
+SparseMatrix<number>::precondition_SOR (Vector<somenumber>& dst,
+ const Vector<somenumber>& src,
+ const number om) const
{
Assert (cols != 0, ExcMatrixNotInitialized());
Assert (val != 0, ExcMatrixNotInitialized());
template <typename number>
template <typename somenumber>
void
-SparseMatrix<number>::precondition_TSOR (Vector<somenumber>& dst, const Vector<somenumber>& src,
- const number om) const
+SparseMatrix<number>::precondition_TSOR (Vector<somenumber>& dst,
+ const Vector<somenumber>& src,
+ const number om) const
{
Assert (cols != 0, ExcMatrixNotInitialized());
Assert (val != 0, ExcMatrixNotInitialized());
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 om) const
{
Assert (cols != 0, ExcMatrixNotInitialized());
Assert (val != 0, ExcMatrixNotInitialized());
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 om) const
{
Assert (cols != 0, ExcMatrixNotInitialized());
Assert (val != 0, ExcMatrixNotInitialized());
template <typename number>
template <typename somenumber>
void
-SparseMatrix<number>::PSOR (
- Vector<somenumber>& dst,
- const std::vector<unsigned int>& permutation,
- const std::vector<unsigned int>& inverse_permutation,
- const number om) const
+SparseMatrix<number>::PSOR (Vector<somenumber>& dst,
+ const std::vector<unsigned int>& permutation,
+ const std::vector<unsigned int>& inverse_permutation,
+ const number om) const
{
Assert (cols != 0, ExcMatrixNotInitialized());
Assert (val != 0, ExcMatrixNotInitialized());
template <typename number>
template <typename somenumber>
void
-SparseMatrix<number>::TPSOR (
- Vector<somenumber>& dst,
- const std::vector<unsigned int>& permutation,
- const std::vector<unsigned int>& inverse_permutation,
- const number om) const
+SparseMatrix<number>::TPSOR (Vector<somenumber>& dst,
+ const std::vector<unsigned int>& permutation,
+ const std::vector<unsigned int>& inverse_permutation,
+ const number om) const
{
Assert (cols != 0, ExcMatrixNotInitialized());
Assert (val != 0, ExcMatrixNotInitialized());
}
+
template <typename number>
template <typename somenumber>
void
SparseMatrix<number>::SOR_step (Vector<somenumber> &v,
- const Vector<somenumber> &b,
- const number om) const
+ const Vector<somenumber> &b,
+ const number om) const
{
Assert (cols != 0, ExcMatrixNotInitialized());
Assert (val != 0, ExcMatrixNotInitialized());
}
}
+
+
template <typename number>
template <typename somenumber>
void
SparseMatrix<number>::TSOR_step (Vector<somenumber> &v,
- const Vector<somenumber> &b,
- const number om) const
+ const Vector<somenumber> &b,
+ const number om) const
{
Assert (cols != 0, ExcMatrixNotInitialized());
Assert (val != 0, ExcMatrixNotInitialized());
}
}
+
+
template <typename number>
template <typename somenumber>
void
SparseMatrix<number>::SSOR_step (Vector<somenumber> &v,
- const Vector<somenumber> &b,
- const number om) const
+ const Vector<somenumber> &b,
+ const number om) const
{
SOR_step(v,b,om);
TSOR_step(v,b,om);
}
+
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 om) const
{
Assert (cols != 0, ExcMatrixNotInitialized());
Assert (val != 0, ExcMatrixNotInitialized());
// Vector (const Vector<OtherNumber> &v);
/**
- * Constructor. Set dimension to @p{n} and
- * initialize all elements with zero.
+ * Constructor. Set dimension to
+ * @p{n} and initialize all
+ * elements with zero.
*/
explicit Vector (const unsigned int n);
* the cellwise ratio of true to estimated
* error.
*
- * This vector is appropriately scaled to
- * hold the result.
+ * This vector is appropriately
+ * scaled to hold the result.
*
- * If any of the @p{b[i]} is zero, the result
- * is undefined. No attempt is made to
- * catch such situations.
+ * If any of the @p{b[i]} is
+ * zero, the result is
+ * undefined. No attempt is made
+ * to catch such situations.
*/
void ratio (const Vector<Number> &a,
const Vector<Number> &b);
template <typename Number>
inline
-Vector<Number>::Vector () :
+Vector<Number>::Vector ()
+ :
dim(0),
maxdim(0),
val(0)
template <typename Number>
inline
-Vector<Number>::Vector (const unsigned int n) :
+Vector<Number>::Vector (const unsigned int n)
+ :
dim(0),
maxdim(0),
val(0)
template <typename Number>
inline
typename Vector<Number>::const_iterator
-Vector<Number>::end () const
+Vector<Number>::end () const
{
return &val[dim];
}
template <typename Number>
inline
-Vector<Number> & Vector<Number>::operator *= (const Number factor)
+Vector<Number> & Vector<Number>::operator *= (const Number factor)
{
scale (factor);
return *this;
template <typename Number>
inline
-Vector<Number> & Vector<Number>::operator /= (const Number factor)
+Vector<Number> & Vector<Number>::operator /= (const Number factor)
{
scale (1./factor);
return *this;
template <typename Number>
-Vector<Number>::Vector (const Vector<Number>& v) :
+Vector<Number>::Vector (const Vector<Number>& v)
+ :
dim(v.size()),
maxdim(v.size()),
val(0)
template <typename Number>
-Number Vector<Number>::linfty_norm () const {
+Number Vector<Number>::linfty_norm () const
+{
Assert (dim!=0, ExcEmptyVector());
Number max0=0.,
template <typename Number>
-void Vector<Number>::sadd (const Number x, const Number a, const Vector<Number>& v)
+void Vector<Number>::sadd (const Number x, const Number a,
+ const Vector<Number>& v)
{
Assert (dim!=0, ExcEmptyVector());
Assert (dim == v.dim, ExcDimensionMismatch(dim, v.dim));
template <typename Number>
void Vector<Number>::sadd (const Number x, const Number a,
- const Vector<Number>& v, const Number b, const Vector<Number>& w)
+ const Vector<Number>& v, const Number b,
+ const Vector<Number>& w)
{
Assert (dim!=0, ExcEmptyVector());
Assert (dim == v.dim, ExcDimensionMismatch(dim, v.dim));
template <typename Number>
void Vector<Number>::sadd (const Number x, const Number a,
const Vector<Number>& v, const Number b,
- const Vector<Number>& w, const Number c, const Vector<Number>& y)
+ const Vector<Number>& w, const Number c,
+ const Vector<Number>& y)
{
Assert (dim!=0, ExcEmptyVector());
Assert (dim == v.dim, ExcDimensionMismatch(dim, v.dim));
#include <numeric>
#include <functional>
-CompressedSparsityPattern::CompressedSparsityPattern () :
+CompressedSparsityPattern::CompressedSparsityPattern ()
+ :
rows(0),
cols(0)
{}
-CompressedSparsityPattern::CompressedSparsityPattern (const CompressedSparsityPattern &s) :
+CompressedSparsityPattern::
+CompressedSparsityPattern (const CompressedSparsityPattern &s)
+ :
Subscriptor(),
rows(0),
cols(0)
CompressedSparsityPattern::CompressedSparsityPattern (const unsigned int m,
const unsigned int n)
- : rows(0),
- cols(0)
+ :
+ rows(0),
+ cols(0)
{
reinit (m,n);
}
CompressedSparsityPattern::CompressedSparsityPattern (const unsigned int n)
- : rows(0),
- cols(0)
+ :
+ rows(0),
+ cols(0)
{
reinit (n,n);
}
unsigned int
-CompressedSparsityPattern::max_entries_per_row () const
+CompressedSparsityPattern::max_entries_per_row () const
{
unsigned int m = 0;
for (unsigned int i=1; i<rows; ++i)
void
-CompressedSparsityPattern::symmetrize ()
+CompressedSparsityPattern::symmetrize ()
{
Assert (rows==cols, ExcNotSquare());
// TYPEMAT and TYPEVEC are defined in sparsematrix?.cc
-template void SparseMatrix<TYPEMAT>::vmult<TYPEVEC> (
- Vector<TYPEVEC> &,
- const Vector<TYPEVEC> &) const;
-template void SparseMatrix<TYPEMAT>::Tvmult<TYPEVEC> (
- Vector<TYPEVEC> &,
- const Vector<TYPEVEC> &) const;
-template void SparseMatrix<TYPEMAT>::vmult_add<TYPEVEC> (
- Vector<TYPEVEC> &,
- const Vector<TYPEVEC> &) const;
-template void SparseMatrix<TYPEMAT>::Tvmult_add<TYPEVEC> (
- Vector<TYPEVEC> &,
- const Vector<TYPEVEC> &) const;
+template void SparseMatrix<TYPEMAT>::
+vmult<TYPEVEC> (Vector<TYPEVEC> &,
+ const Vector<TYPEVEC> &) const;
+template void SparseMatrix<TYPEMAT>::
+Tvmult<TYPEVEC> (Vector<TYPEVEC> &,
+ const Vector<TYPEVEC> &) const;
+template void SparseMatrix<TYPEMAT>::
+vmult_add<TYPEVEC> (Vector<TYPEVEC> &,
+ const Vector<TYPEVEC> &) const;
+template void SparseMatrix<TYPEMAT>::
+Tvmult_add<TYPEVEC> (Vector<TYPEVEC> &,
+ const Vector<TYPEVEC> &) const;
template TYPEVEC
-SparseMatrix<TYPEMAT>::matrix_norm_square<TYPEVEC> (
- const Vector<TYPEVEC> &) const;
+SparseMatrix<TYPEMAT>::
+matrix_norm_square<TYPEVEC> (const Vector<TYPEVEC> &) const;
template TYPEVEC
-SparseMatrix<TYPEMAT>::matrix_scalar_product<TYPEVEC> (
- const Vector<TYPEVEC> &,
- const Vector<TYPEVEC> &) const;
+SparseMatrix<TYPEMAT>::
+matrix_scalar_product<TYPEVEC> (const Vector<TYPEVEC> &,
+ const Vector<TYPEVEC> &) const;
-template TYPEVEC SparseMatrix<TYPEMAT>::residual<TYPEVEC> (
- Vector<TYPEVEC> &,
- const Vector<TYPEVEC> &,
- const Vector<TYPEVEC> &) const;
+template TYPEVEC SparseMatrix<TYPEMAT>::
+residual<TYPEVEC> (Vector<TYPEVEC> &,
+ const Vector<TYPEVEC> &,
+ const Vector<TYPEVEC> &) const;
-template void SparseMatrix<TYPEMAT>::precondition_SSOR<TYPEVEC> (
- Vector<TYPEVEC> &,
- const Vector<TYPEVEC> &,
- const TYPEMAT) const;
+template void SparseMatrix<TYPEMAT>::
+precondition_SSOR<TYPEVEC> (Vector<TYPEVEC> &,
+ const Vector<TYPEVEC> &,
+ const TYPEMAT) const;
-template void SparseMatrix<TYPEMAT>::precondition_SOR<TYPEVEC> (
- Vector<TYPEVEC> &,
- const Vector<TYPEVEC> &,
- const TYPEMAT) const;
+template void SparseMatrix<TYPEMAT>::
+precondition_SOR<TYPEVEC> (Vector<TYPEVEC> &,
+ const Vector<TYPEVEC> &,
+ const TYPEMAT) const;
-template void SparseMatrix<TYPEMAT>::precondition_TSOR<TYPEVEC> (
- Vector<TYPEVEC> &,
- const Vector<TYPEVEC> &,
- const TYPEMAT) const;
+template void SparseMatrix<TYPEMAT>::
+precondition_TSOR<TYPEVEC> (Vector<TYPEVEC> &,
+ const Vector<TYPEVEC> &,
+ const TYPEMAT) const;
-template void SparseMatrix<TYPEMAT>::precondition_Jacobi<TYPEVEC> (
- Vector<TYPEVEC> &,
- const Vector<TYPEVEC> &,
- const TYPEMAT) const;
+template void SparseMatrix<TYPEMAT>::
+precondition_Jacobi<TYPEVEC> (Vector<TYPEVEC> &,
+ const Vector<TYPEVEC> &,
+ const TYPEMAT) const;
-template void SparseMatrix<TYPEMAT>::SOR<TYPEVEC> (
- Vector<TYPEVEC> &,
- const TYPEMAT) const;
-template void SparseMatrix<TYPEMAT>::TSOR<TYPEVEC> (
- Vector<TYPEVEC> &,
- const TYPEMAT) const;
-template void SparseMatrix<TYPEMAT>::SSOR<TYPEVEC> (
- Vector<TYPEVEC> &,
- const TYPEMAT) const;
-template void SparseMatrix<TYPEMAT>::PSOR<TYPEVEC> (
- Vector<TYPEVEC> &,
- const std::vector<unsigned int>&,
- const std::vector<unsigned int>&,
- const TYPEMAT) const;
-template void SparseMatrix<TYPEMAT>::TPSOR<TYPEVEC> (
- Vector<TYPEVEC> &,
- const std::vector<unsigned int>&,
- const std::vector<unsigned int>&,
- const TYPEMAT) const;
-template void SparseMatrix<TYPEMAT>::SOR_step<TYPEVEC> (
- Vector<TYPEVEC> &,
- const Vector<TYPEVEC> &,
- const TYPEMAT) const;
-template void SparseMatrix<TYPEMAT>::TSOR_step<TYPEVEC> (
- Vector<TYPEVEC> &,
- const Vector<TYPEVEC> &,
- const TYPEMAT) const;
-template void SparseMatrix<TYPEMAT>::SSOR_step<TYPEVEC> (
- Vector<TYPEVEC> &,
- const Vector<TYPEVEC> &,
- const TYPEMAT) const;
+template void SparseMatrix<TYPEMAT>::
+SOR<TYPEVEC> (Vector<TYPEVEC> &,
+ const TYPEMAT) const;
+template void SparseMatrix<TYPEMAT>::
+TSOR<TYPEVEC> (Vector<TYPEVEC> &,
+ const TYPEMAT) const;
+template void SparseMatrix<TYPEMAT>::
+SSOR<TYPEVEC> (Vector<TYPEVEC> &,
+ const TYPEMAT) const;
+template void SparseMatrix<TYPEMAT>::
+PSOR<TYPEVEC> (Vector<TYPEVEC> &,
+ const std::vector<unsigned int>&,
+ const std::vector<unsigned int>&,
+ const TYPEMAT) const;
+template void SparseMatrix<TYPEMAT>::
+TPSOR<TYPEVEC> (Vector<TYPEVEC> &,
+ const std::vector<unsigned int>&,
+ const std::vector<unsigned int>&,
+ const TYPEMAT) const;
+template void SparseMatrix<TYPEMAT>::
+SOR_step<TYPEVEC> (Vector<TYPEVEC> &,
+ const Vector<TYPEVEC> &,
+ const TYPEMAT) const;
+template void SparseMatrix<TYPEMAT>::
+TSOR_step<TYPEVEC> (Vector<TYPEVEC> &,
+ const Vector<TYPEVEC> &,
+ const TYPEMAT) const;
+template void SparseMatrix<TYPEMAT>::
+SSOR_step<TYPEVEC> (Vector<TYPEVEC> &,
+ const Vector<TYPEVEC> &,
+ const TYPEMAT) const;