* an empty object.
*/
NamedData();
+
+ /**
+ * Assignment operator, copying
+ * conversible data from another
+ * object.
+ */
+ template <typename DATA2>
+ NamedData<DATA>& operator = (const NamedData<DATA2>& other);
+
/**
* \name Adding members
*/
* #is_constant set, so will have
* this object after merge.
*/
- void merge(NamedData&);
+ template <typename DATA2>
+ void merge(NamedData<DATA2>&);
/**
* Merge the data of another
* NamedData to the end of this
* data in this object will be
* treated as const.
*/
- void merge(const NamedData&);
+ template <typename DATA2>
+ void merge(const NamedData<DATA2>&);
//@}
/**
* \name Accessing and querying
template<typename DATA>
+template<typename DATA2>
inline
void
-NamedData<DATA>::merge(NamedData<DATA>& other)
+NamedData<DATA>::merge(NamedData<DATA2>& other)
{
Assert(!is_constant, ExcConstantObject());
for (unsigned int i=0;i<other.size();++i)
{
- names.push_back(other.names[i]);
- data.push_back(other.data[i]);
+ names.push_back(other.name(i));
+ data.push_back(other(i));
}
- is_constant = other.is_constant;
+ is_constant = other.is_const();
}
template<typename DATA>
+template<typename DATA2>
inline
void
-NamedData<DATA>::merge(const NamedData<DATA>& other)
+NamedData<DATA>::merge(const NamedData<DATA2>& other)
{
Assert(!is_constant, ExcConstantObject());
for (unsigned int i=0;i<other.size();++i)
{
- names.push_back(other.names[i]);
- data.push_back(other.data[i]);
+ names.push_back(other.name(i));
+ data.push_back(other(i));
}
is_constant = true;
}
+
+
+template<typename DATA>
+template<typename DATA2>
+inline
+NamedData<DATA>&
+NamedData<DATA>::operator= (const NamedData<DATA2>& other)
+{
+ is_constant = false;
+ merge(other);
+ is_constant = other.is_const();
+ return *this;
+}
+
+
template<typename DATA>
inline
unsigned int
* but make sure that the object pointed to is not deleted in the course of
* use of the pointer by signalling the pointee its use.
*
- * Objects pointed to should inherit <tt>Subscriptor</tt> or must implement
- * the same functionality. Null pointers are an exception from this
- * rule and are allowed, too.
+ * Objects pointed to, that is ,the class T, should inherit
+ * Subscriptor or must implement the same functionality. Null pointers
+ * are an exception from this rule and are allowed, too.
+ *
+ * The second template argument P only serves a single purpose: if a
+ * constructor without a debug string is used, then the name of P is
+ * used as the debug string.
*
* SmartPointer does NOT implement any memory handling! Especially,
* deleting a SmartPointer does not delete the object. Writing
* @code
- * SmartPointer<T> dont_do_this = new T;
+ * SmartPointer<T,P> dont_do_this = new T;
* @endcode
* is a sure way to program a memory leak! The secure version is
* @code
* T* p = new T;
* {
- * SmartPointer<T> t(p, "mypointer");
+ * SmartPointer<T,P> t(p);
* ...
* }
* delete p;
* @ingroup memory
* @author Guido Kanschat, Wolfgang Bangerth, 1998 - 2009
*/
-template<typename T>
+template<typename T, typename P = void>
class SmartPointer
{
public:
/**
* Standard constructor for null
- * pointer. @deprecated Since
- * this constructor will leave
- * SmartPointer::id empty, it should be
- * avoided wherever possible and
- * replaced by SmartPointer(0,id).
+ * pointer. The id of this
+ * pointer is set to the name of
+ * the class P.
*/
SmartPointer ();
* copy the object subscribed to
* from <tt>tt</tt>, but subscribe
* ourselves to it again.
- *
- * The <tt>id</tt> is used in the
- * call to
- * Subscriptor::subscribe(typeid(*this).name()). The #id of
- * the object copied is used here.
*/
- SmartPointer (const SmartPointer<T> &tt);
+ template <class Q>
+ SmartPointer (const SmartPointer<T,Q> &tt);
+
+ /*
+ * Copy constructor for
+ * SmartPointer. We do now
+ * copy the object subscribed to
+ * from <tt>tt</tt>, but subscribe
+ * ourselves to it again.
+ */
+ SmartPointer (const SmartPointer<T,P> &tt);
/**
* Constructor taking a normal
*
* The <tt>id</tt> is used in the
* call to
- * Subscriptor::subscribe(typeid(*this).name()) and
+ * Subscriptor::subscribe(id) and
* by ~SmartPointer() in the call
* to Subscriptor::unsubscribe().
*/
- SmartPointer (T *t, const char* id=0);
+ SmartPointer (T *t, const char* id);
+
+ /**
+ * 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. The id of this
+ * pointer is set to the name of
+ * the class P.
+ */
+ SmartPointer (T *t);
/**
* null-pointer, but stilll
* delete the old subscription.
*/
- SmartPointer<T> & operator= (T *tt);
+ SmartPointer<T,P> & operator= (T *tt);
+
+ /**
+ * Assignment operator for
+ * SmartPointer. The pointer
+ * subscribes to the new object
+ * automatically and unsubscribes
+ * to an old one if it exists.
+ */
+ template <class Q>
+ SmartPointer<T,P> & operator= (const SmartPointer<T,Q> &tt);
/**
* Assignment operator for
* automatically and unsubscribes
* to an old one if it exists.
*/
- SmartPointer<T> & operator= (const SmartPointer<T> &tt);
+ SmartPointer<T,P> & operator= (const SmartPointer<T,P> &tt);
/**
* Conversion to normal pointer.
operator T* () const;
/**
- * Dereferencing operator.
+ * Dereferencing operator. This
+ * operator throws an
+ * ExcNotInitialized if the
+ * pointer is a null pointer.
*/
T& operator * () const;
/**
- * Dereferencing operator.
+ * Dereferencing operator. This
+ * operator throws an
+ * ExcNotInitialized if the
+ * pointer is a null pointer.
*/
T * operator -> () const;
* pointer are implemented in
* global namespace.
*/
- void swap (SmartPointer<T> &tt);
+ template <class Q>
+ void swap (SmartPointer<T,Q> &tt);
/**
* Swap pointers between this
/* --------------------------- inline Template functions ------------------------------*/
-template <typename T>
-SmartPointer<T>::SmartPointer ()
+template <typename T, typename P>
+inline
+SmartPointer<T,P>::SmartPointer ()
:
- t (0), id(0)
+ t (0), id(typeid(P).name())
{}
-template <typename T>
-SmartPointer<T>::SmartPointer (T *t, const char* id)
+template <typename T, typename P>
+inline
+SmartPointer<T,P>::SmartPointer (T *t)
+ :
+ t (t), id(typeid(P).name())
+{
+ if (t != 0)
+ t->subscribe(id);
+}
+
+
+
+template <typename T, typename P>
+inline
+SmartPointer<T,P>::SmartPointer (T *t, const char* id)
:
t (t), id(id)
{
-template <typename T>
-SmartPointer<T>::SmartPointer (const SmartPointer<T> &tt)
+template <typename T, typename P>
+template <class Q>
+inline
+SmartPointer<T,P>::SmartPointer (const SmartPointer<T,Q> &tt)
+ :
+ t (tt.t), id(tt.id)
+{
+ if (t != 0)
+ t->subscribe(id);
+}
+
+
+
+template <typename T, typename P>
+inline
+SmartPointer<T,P>::SmartPointer (const SmartPointer<T,P> &tt)
:
t (tt.t), id(tt.id)
{
-template <typename T>
-SmartPointer<T>::~SmartPointer ()
+template <typename T, typename P>
+inline
+SmartPointer<T,P>::~SmartPointer ()
{
if (t != 0)
t->unsubscribe(id);
-template <typename T>
-SmartPointer<T> & SmartPointer<T>::operator = (T *tt)
+template <typename T, typename P>
+inline
+SmartPointer<T,P> & SmartPointer<T,P>::operator = (T *tt)
{
// optimize if no real action is
// requested
-template <typename T>
-SmartPointer<T> &
-SmartPointer<T>::operator = (const SmartPointer<T>& tt)
+template <typename T, typename P>
+template <class Q>
+inline
+SmartPointer<T,P> &
+SmartPointer<T,P>::operator = (const SmartPointer<T,Q>& tt)
+{
+ // if objects on the left and right
+ // hand side of the operator= are
+ // the same, then this is a no-op
+ if (&tt == this)
+ return *this;
+
+ if (t != 0)
+ t->unsubscribe(id);
+ t = static_cast<T*>(tt);
+ if (tt != 0)
+ tt->subscribe(id);
+ return *this;
+}
+
+
+
+template <typename T, typename P>
+inline
+SmartPointer<T,P> &
+SmartPointer<T,P>::operator = (const SmartPointer<T,P>& tt)
{
// if objects on the left and right
// hand side of the operator= are
-template <typename T>
+template <typename T, typename P>
inline
-SmartPointer<T>::operator T* () const
+SmartPointer<T,P>::operator T* () const
{
return t;
}
-template <typename T>
+template <typename T, typename P>
inline
-T & SmartPointer<T>::operator * () const
+T & SmartPointer<T,P>::operator * () const
{
Assert(t != 0, ExcNotInitialized());
return *t;
-template <typename T>
+template <typename T, typename P>
inline
-T * SmartPointer<T>::operator -> () const
+T * SmartPointer<T,P>::operator -> () const
{
Assert(t != 0, ExcNotInitialized());
return t;
-template <typename T>
+template <typename T, typename P>
+template <class Q>
inline
-void SmartPointer<T>::swap (SmartPointer<T> &tt)
+void SmartPointer<T,P>::swap (SmartPointer<T,Q> &tt)
{
#ifdef DEBUG
- SmartPointer<T> aux(t,id);
+ SmartPointer<T,P> aux(t,id);
*this = tt;
tt = aux;
#else
-template <typename T>
+template <typename T, typename P>
inline
-void SmartPointer<T>::swap (T *&tt)
+void SmartPointer<T,P>::swap (T *&tt)
{
if (t != 0)
t->unsubscribe (id);
-template <typename T>
+template <typename T, typename P>
inline
-unsigned int SmartPointer<T>::memory_consumption () const
+unsigned int SmartPointer<T,P>::memory_consumption () const
{
- return sizeof(SmartPointer<T>);
+ return sizeof(SmartPointer<T,P>);
}
* objects to which the pointers point retain to be subscribed to, we
* do not have to change their subscription count.
*/
-template <typename T>
+template <typename T, typename P, class Q>
inline
-void swap (SmartPointer<T> &t1, SmartPointer<T> &t2)
+void swap (SmartPointer<T,P> &t1, SmartPointer<T,Q> &t2)
{
t1.swap (t2);
}
* Note that we indeed need a reference of a pointer, as we want to
* change the pointer variable which we are given.
*/
-template <typename T>
+template <typename T, typename P>
inline
-void swap (SmartPointer<T> &t1, T *&t2)
+void swap (SmartPointer<T,P> &t1, T *&t2)
{
t1.swap (t2);
}
* Note that we indeed need a reference of a pointer, as we want to
* change the pointer variable which we are given.
*/
-template <typename T>
+template <typename T, typename P>
inline
-void swap (T *&t1, SmartPointer<T> &t2)
+void swap (T *&t1, SmartPointer<T,P> &t2)
{
t2.swap (t1);
}
// $Id$
// Version: $Name$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by the deal.II authors
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
* Address of the triangulation to
* work on.
*/
- SmartPointer<const Triangulation<dim,spacedim> > tria;
+ SmartPointer<const Triangulation<dim,spacedim>,DoFHandler<dim,spacedim> > tria;
/**
* Store a pointer to the finite element
* function (this clears all data of
* this object as well, though).
*/
- SmartPointer<const FiniteElement<dim,spacedim> > selected_fe;
+ SmartPointer<const FiniteElement<dim,spacedim>,DoFHandler<dim,spacedim> > selected_fe;
private:
/**
* Storage for the mapping object.
*/
- const SmartPointer<const Mapping<dim,spacedim> > mapping;
+ const SmartPointer<const Mapping<dim,spacedim>,FEValuesBase<dim,spacedim> > mapping;
/**
* Store the finite element for later use.
*/
- const SmartPointer<const FiniteElement<dim,spacedim> > fe;
+ const SmartPointer<const FiniteElement<dim,spacedim>,FEValuesBase<dim,spacedim> > fe;
/**
* Internal data of mapping.
*/
- SmartPointer<typename Mapping<dim,spacedim>::InternalDataBase> mapping_data;
+ SmartPointer<typename Mapping<dim,spacedim>::InternalDataBase,FEValuesBase<dim,spacedim> > mapping_data;
/**
* Internal data of finite element.
*/
- SmartPointer<typename Mapping<dim,spacedim>::InternalDataBase> fe_data;
+ SmartPointer<typename Mapping<dim,spacedim>::InternalDataBase,FEValuesBase<dim,spacedim> > fe_data;
/**
* Initialize some update
*
* @author Michael Stadler, 2001
*/
-template <int dim, class EulerVectorType = Vector<double>, int spacedim=dim >
+template <int dim, class VECTOR = Vector<double>, int spacedim=dim >
class MappingQ1Eulerian : public MappingQ1<dim,spacedim>
{
public:
* can be initialized by
* <tt>DoFAccessor::set_dof_values()</tt>.
*/
- MappingQ1Eulerian (const EulerVectorType &euler_transform_vectors,
+ MappingQ1Eulerian (const VECTOR &euler_transform_vectors,
const DoFHandler<dim,spacedim> &shiftmap_dof_handler);
/**
* Reference to the vector of
* shifts.
*/
- const EulerVectorType &euler_transform_vectors;
+ const VECTOR &euler_transform_vectors;
/**
* Pointer to the DoFHandler to
* which the mapping vector is
* associated.
*/
- const SmartPointer<const DoFHandler<dim,spacedim> > shiftmap_dof_handler;
+ const SmartPointer<const DoFHandler<dim,spacedim>,MappingQ1Eulerian<dim,VECTOR,spacedim> > shiftmap_dof_handler;
private:
// $Id$
// Version: $Name$
//
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by the deal.II authors
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
*
* @author Joshua White, 2008
*/
-template <int dim, class EulerVectorType = Vector<double>, int spacedim=dim >
+template <int dim, class VECTOR = Vector<double>, int spacedim=dim >
class MappingQEulerian : public MappingQ<dim, spacedim>
{
public:
*/
MappingQEulerian (const unsigned int degree,
- const EulerVectorType &euler_vector,
+ const VECTOR &euler_vector,
const DoFHandler<dim> &euler_dof_handler);
/**
* shifts.
*/
- const EulerVectorType &euler_vector;
+ const VECTOR &euler_vector;
/**
* Pointer to the DoFHandler to
* associated.
*/
- const SmartPointer<const DoFHandler<dim> > euler_dof_handler;
+ const SmartPointer<const DoFHandler<dim>,MappingQEulerian<dim,VECTOR,spacedim> > euler_dof_handler;
private:
* Store address of the triangulation to
* be fed with the data read in.
*/
- SmartPointer<Triangulation<dim,spacedim> > tria;
+ SmartPointer<Triangulation<dim,spacedim>,GridIn<dim,spacedim> > tria;
/**
* This function can write the
// $Id$
// Version: $Name$
//
-// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
/**
* Store a pointer to the source grid.
*/
- SmartPointer<const GridClass > source_grid;
+ SmartPointer<const GridClass,InterGridMap<GridClass> > source_grid;
/**
* Likewise for the destination grid.
*/
- SmartPointer<const GridClass > destination_grid;
+ SmartPointer<const GridClass,InterGridMap<GridClass> > destination_grid;
/**
* Set the mapping for the pair of
// $Id$
// Version: $Name$
//
-// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
* This grid shall be used as coarse
* grid.
*/
- SmartPointer<const Triangulation<dim> > coarse_grid;
+ SmartPointer<const Triangulation<dim>,PersistentTriangulation<dim> > coarse_grid;
/**
* Vectors holding the refinement and
* and can thus never be
* associated with a boundary.
*/
- SmartPointer<const Boundary<dim,spacedim> > boundary[255];
+ SmartPointer<const Boundary<dim,spacedim>,Triangulation<dim,spacedim> > boundary[255];
/**
* Collection of ly
* and can thus never be
* associated with a boundary.
*/
- SmartPointer<const Boundary<spacedim,spacedim> > manifold_description[255];
+ SmartPointer<const Boundary<spacedim,spacedim>,Triangulation<dim,spacedim> > manifold_description[255];
/**
* Flag indicating whether
* Address of the triangulation to
* work on.
*/
- SmartPointer<const Triangulation<dim,spacedim> > tria;
+ SmartPointer<const Triangulation<dim,spacedim>,DoFHandler<dim,spacedim> > tria;
/**
* Store a pointer to the finite
* (this clears all data of this
* object as well, though).
*/
- SmartPointer<const hp::FECollection<dim,spacedim> > finite_elements;
+ SmartPointer<const hp::FECollection<dim,spacedim>,hp::DoFHandler<dim,spacedim> > finite_elements;
private:
// $Id$
// Version: $Name$
//
-// Copyright (C) 2003, 2004, 2006, 2007, 2008 by the deal.II authors
+// Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
* collection of finite
* elements to be used.
*/
- const SmartPointer<const dealii::hp::FECollection<dim,FEValues::space_dimension> > fe_collection;
+ const SmartPointer<const dealii::hp::FECollection<dim,FEValues::space_dimension>,
+ FEValuesBase<dim,q_dim,FEValues> > fe_collection;
/**
* A pointer to the
* collection of mappings to
* be used.
*/
- const SmartPointer<const dealii::hp::MappingCollection<dim, FEValues::space_dimension> > mapping_collection;
+ const SmartPointer<const dealii::hp::MappingCollection<dim, FEValues::space_dimension>,
+ FEValuesBase<dim,q_dim,FEValues> > mapping_collection;
/**
* Copy of the quadrature
// $Id$
// Version: $Name$
//
-// Copyright (C) 2005, 2006, 2007, 2008 by the deal.II authors
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
#include <base/config.h>
#include <base/subscriptor.h>
#include <base/quadrature.h>
-#include <base/smartpointer.h>
#include <base/memory_consumption.h>
#include <fe/fe.h>
// $Id$
// Version: $Name$
//
-// Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors
+// Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
/**
* Reference to the solver.
*/
- SmartPointer<SOLVER> solver;
+ SmartPointer<SOLVER,MGCoarseGridLACIteration<SOLVER,VECTOR> > solver;
/**
* Reference to the matrix.
// $Id$
// Version: $Name$
//
-// Copyright (C) 2003, 2004, 2005, 2006 by the deal.II authors
+// Copyright (C) 2003, 2004, 2005, 2006, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
/**
* Pointer to the matrix objects on each level.
*/
- SmartPointer<MGLevelObject<MATRIX> > matrix;
+ SmartPointer<MGLevelObject<MATRIX>,MGMAtrix<MATRIX,VECTOR> > matrix;
};
/**
* Pointer to the matrix objects on each level.
*/
- SmartPointer<MGLevelObject<MATRIX> > matrix;
+ SmartPointer<MGLevelObject<MATRIX>,MGMAtrixSelect<MATRIX,number> > matrix;
/**
* Row coordinate of selected block.
*/
// $Id$
// Version: $Name$
//
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
* additional multiplication
* using #factors is desired.
*/
- SmartPointer<VectorMemory<Vector<number> > > memory;
+ SmartPointer<VectorMemory<Vector<number> >,MGTransferBlock<number> > memory;
};
// $Id$
// Version: $Name$
//
-// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
/**
* The matrix for each level.
*/
- SmartPointer<const MGMatrixBase<VECTOR> > matrix;
+ SmartPointer<const MGMatrixBase<VECTOR>,Multigrid<VECTOR> > matrix;
/**
* The matrix for each level.
*/
- SmartPointer<const MGCoarseGridBase<VECTOR> > coarse;
+ SmartPointer<const MGCoarseGridBase<VECTOR>,Multigrid<VECTOR> > coarse;
/**
* Object for grid tranfer.
*/
- SmartPointer<const MGTransferBase<VECTOR> > transfer;
+ SmartPointer<const MGTransferBase<VECTOR>,Multigrid<VECTOR> > transfer;
/**
* The pre-smoothing object.
*/
- SmartPointer<const MGSmootherBase<VECTOR> > pre_smooth;
+ SmartPointer<const MGSmootherBase<VECTOR>,Multigrid<VECTOR> > pre_smooth;
/**
* The post-smoothing object.
*/
- SmartPointer<const MGSmootherBase<VECTOR> > post_smooth;
+ SmartPointer<const MGSmootherBase<VECTOR>,Multigrid<VECTOR> > post_smooth;
/**
* Edge matrix from fine to coarse.
*/
- SmartPointer<const MGMatrixBase<VECTOR> > edge_down;
+ SmartPointer<const MGMatrixBase<VECTOR>,Multigrid<VECTOR> > edge_down;
/**
* Transpose edge matrix from coarse to fine.
*/
- SmartPointer<const MGMatrixBase<VECTOR> > edge_up;
+ SmartPointer<const MGMatrixBase<VECTOR>,Multigrid<VECTOR> > edge_up;
/**
* Level for debug
/**
* Associated @p MGDoFHandler.
*/
- SmartPointer<const MGDoFHandler<dim> > mg_dof_handler;
+ SmartPointer<const MGDoFHandler<dim>,PreconditionMG<dim,VECTOR,TRANSFER> > mg_dof_handler;
/**
* The multigrid object.
*/
- SmartPointer<Multigrid<VECTOR> > multigrid;
+ SmartPointer<Multigrid<VECTOR>,PreconditionMG<dim,VECTOR,TRANSFER> > multigrid;
/**
* Object for grid tranfer.
*/
- SmartPointer<const TRANSFER> transfer;
+ SmartPointer<const TRANSFER,PreconditionMG<dim,VECTOR,TRANSFER> > transfer;
};
/*@}*/
* object which shall be applied to
* this data vector.
*/
- SmartPointer<const DataPostprocessor<DH::space_dimension> > postprocessor;
+ SmartPointer<const DataPostprocessor<DH::space_dimension>,DataOut_DoFData<DH,patch_dim,patch_space_dim> > postprocessor;
/**
* Number of output variables this
/**
* Pointer to the dof handler object.
*/
- SmartPointer<const DH> dofs;
+ SmartPointer<const DH, DataOut_DoFData<DH,patch_dim,patch_space_dim> > dofs;
/**
* List of data elements with vectors of
// $Id$
// Version: $Name$
//
-// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
* corresponding to the present parameter
* value.
*/
- SmartPointer<const DH> dof_handler;
+ SmartPointer<const DH,DataOutStack<dim,spacedim,DH> > dof_handler;
/**
* List of patches of all past and
// $Id$
// Version: $Name$
//
-// Copyright (C) 2007 by the deal.II authors
+// Copyright (C) 2007, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
/**
* Pointer to the dof handler.
*/
- SmartPointer<const DH> dh;
+ SmartPointer<const DH,FEFieldFunction<dim, DH, VECTOR> > dh;
/**
* A reference to the actual
* Pointer to the object doing
* local integration.
*/
- SmartPointer<const INTEGRATOR> local;
+ SmartPointer<const INTEGRATOR, AssemblingIntegrator<dim,ASSEMBLER,INTEGRATOR> > local;
};
//----------------------------------------------------------------------//
* communicating the cell and
* face vectors.
*/
- typedef NamedData<SmartPointer<BlockVector<number> > > DataVectors;
+ typedef NamedData<SmartPointer<BlockVector<number>,CellsAndFaces<number> > > DataVectors;
/**
* The initialization
class ResidualSimple
{
public:
- void initialize(NamedData<SmartPointer<VECTOR> >& results);
+ void initialize(NamedData<VECTOR*>& results);
/**
* Initialize the local data
* in the
* The global residal vectors
* filled by assemble().
*/
- NamedData<SmartPointer<VECTOR> > residuals;
+ NamedData<SmartPointer<VECTOR,ResidualSimple<VECTOR> > > residuals;
};
/**
* matrix pointers into local
* variables.
*/
- void initialize(NamedData<SmartPointer<VECTOR> >& residuals);
+ void initialize(NamedData<VECTOR*>& residuals);
/**
* Initialize the local data
* in the
* stored as a vector of
* pointers.
*/
- NamedData<SmartPointer<VECTOR> > residuals;
+ NamedData<SmartPointer<VECTOR,ResidualLocalBlocksToGlobalBlocks<VECTOR> > > residuals;
};
* Assemble local matrices into a single global matrix without using
* block structure.
*
+ * After being initialized with a SparseMatrix object (or another
+ * matrix offering the same functionality as SparseMatrix::add()),
+ * this class can be used in a MeshWorker::loop() to assemble the cell
+ * and face matrices into the global matrix.
+ *
+ * @todo On locally refined meshes, a ConstraintMatrix should be used
+ * to automatically eliminate hanging nodes.
+ *
* @author Guido Kanschat, 2009
*/
template <class MATRIX>
* The global matrix being
* assembled.
*/
- SmartPointer<MATRIX> matrix;
+ SmartPointer<MATRIX,MatrixSimple<MATRIX> > matrix;
+
+ /**
+ * The smallest positive
+ * number that will be
+ * entered into the global
+ * matrix. All smaller
+ * absolute values will be
+ * treated as zero and will
+ * not be assembled.
+ */
+ const double threshold;
+
+ };
+
+
+/**
+ * Assemble local matrices into level matrices without using
+ * block structure.
+ *
+ * @todo The matrix structures needed for assembling level matrices
+ * with local refinement and continuous elements are missing.
+ *
+ * @author Guido Kanschat, 2009
+ */
+ template <class MATRIX>
+ class MGMatrixSimple
+ {
+ public:
+ /**
+ * Constructor, initializing
+ * the #threshold, which
+ * limits how small numbers
+ * may be to be entered into
+ * the matrix.
+ */
+ MGMatrixSimple(double threshold = 1.e-12);
+
+ /**
+ * Store the result matrix
+ * for later assembling.
+ */
+ void initialize(MGLevelObject<MATRIX>& m);
+
+ /**
+ * Initialize the matrices
+ * #flux_up and #flux_down
+ * used for local refinement
+ * with discontinuous
+ * Galerkin methods.
+ */
+ void initialize_fluxes(MGLevelObject<MATRIX>& flux_up,
+ MGLevelObject<MATRIX>& flux_down);
+
+ /**
+ * Initialize the local data
+ * in the
+ * DoFInfo
+ * object used later for
+ * assembling.
+ *
+ * The second parameter is
+ * used to distinguish
+ * between the data used on
+ * cells and boundary faces
+ * on the one hand and
+ * interior faces on the
+ * other. Interior faces may
+ * require additional data
+ * being initialized.
+ */
+ template <int dim>
+ void initialize_info(DoFInfo<dim>& info,
+ bool interior_face) const;
+
+ /**
+ * Assemble the matrix
+ * DoFInfo::M1[0]
+ * into the global matrix.
+ */
+ template<int dim>
+ void assemble(const DoFInfo<dim>& info);
+
+ /**
+ * Assemble both local
+ * matrices in the info
+ * objects into the global
+ * matrices.
+ */
+ template<int dim>
+ void assemble(const DoFInfo<dim>& info1,
+ const DoFInfo<dim>& info2);
+ private:
+ /**
+ * Assemble a single matrix
+ * into a global matrix.
+ */
+ void assemble(MATRIX& G,
+ const FullMatrix<double>& M,
+ const std::vector<unsigned int>& i1,
+ const std::vector<unsigned int>& i2,
+ const bool transpose = false);
+
+ /**
+ * The global matrix being
+ * assembled.
+ */
+ SmartPointer<MGLevelObject<MATRIX>,MGMatrixSimple<MATRIX> > matrix;
+
+ /**
+ * The matrix used for face
+ * flux terms across the
+ * refinement edge, coupling
+ * coarse to fine.
+ */
+ SmartPointer<MGLevelObject<MATRIX>,MGMatrixSimple<MATRIX> > flux_up;
+
+ /**
+ * The matrix used for face
+ * flux terms across the
+ * refinement edge, coupling
+ * fine to coarse.
+ */
+ SmartPointer<MGLevelObject<MATRIX>,MGMatrixSimple<MATRIX> > flux_down;
/**
* The smallest positive
template <class VECTOR>
inline void
- ResidualSimple<VECTOR>::initialize(NamedData<SmartPointer<VECTOR> >& results)
+ ResidualSimple<VECTOR>::initialize(NamedData<VECTOR*>& results)
{
residuals = results;
}
template <class VECTOR>
inline void
- ResidualLocalBlocksToGlobalBlocks<VECTOR>::initialize(NamedData<SmartPointer<VECTOR> >& m)
+ ResidualLocalBlocksToGlobalBlocks<VECTOR>::initialize(NamedData<VECTOR*>& m)
{
residuals = m;
}
}
+//----------------------------------------------------------------------//
+
+ template <class MATRIX>
+ inline
+ MGMatrixSimple<MATRIX>::MGMatrixSimple(double threshold)
+ :
+ threshold(threshold)
+ {}
+
+
+ template <class MATRIX>
+ inline void
+ MGMatrixSimple<MATRIX>::initialize(MGLevelObject<MATRIX>& m)
+ {
+ matrix = &m;
+ }
+
+
+ template <class MATRIX>
+ inline void
+ MGMatrixSimple<MATRIX>::initialize_fluxes(
+ MGLevelObject<MATRIX>& up, MGLevelObject<MATRIX>& down)
+ {
+ flux_up = &up;
+ flux_down = &down;
+ }
+
+
+ template <class MATRIX >
+ template <int dim>
+ inline void
+ MGMatrixSimple<MATRIX>::initialize_info(DoFInfo<dim>& info,
+ bool interior_face) const
+ {
+ info.initialize_matrices(1, interior_face);
+ }
+
+
+
+ template <class MATRIX>
+ inline void
+ MGMatrixSimple<MATRIX>::assemble(MATRIX& G,
+ const FullMatrix<double>& M,
+ const std::vector<unsigned int>& i1,
+ const std::vector<unsigned int>& i2,
+ bool transpose)
+ {
+ AssertDimension(M.m(), i1.size());
+ AssertDimension(M.n(), i2.size());
+
+ for (unsigned int j=0; j<i1.size(); ++j)
+ for (unsigned int k=0; k<i2.size(); ++k)
+ if (std::fabs(M(j,k)) >= threshold)
+ {
+ if (transpose)
+ G.add(i1[j], i2[k], M(j,k));
+ else
+ G.add(i1[j], i2[k], M(j,k));
+ }
+ }
+
+
+ template <class MATRIX>
+ template <int dim>
+ inline void
+ MGMatrixSimple<MATRIX>::assemble(const DoFInfo<dim>& info)
+ {
+ assemble(info.M1[0].matrix, info.indices, info.indices);
+ }
+
+
+ template <class MATRIX>
+ template <int dim>
+ inline void
+ MGMatrixSimple<MATRIX>::assemble(const DoFInfo<dim>& info1,
+ const DoFInfo<dim>& info2)
+ {
+ const unsigned int level1 = info1.cell->level();
+ const unsigned int level2 = info2.cell->level();
+
+ if (level1 == level2)
+ {
+ assemble(matrix[level1], info1.M1[0].matrix, info1.indices, info1.indices);
+ assemble(matrix[level1], info1.M2[0].matrix, info1.indices, info2.indices);
+ assemble(matrix[level1], info2.M1[0].matrix, info2.indices, info2.indices);
+ assemble(matrix[level1], info2.M2[0].matrix, info2.indices, info1.indices);
+ }
+ else
+ {
+ Assert(level1 > level2, ExcInternalError());
+ // Do not add info2.M1,
+ // which is done by
+ // the coarser cell
+ assemble(matrix[level1], info1.M1[0].matrix, info1.indices, info1.indices);
+ assemble(flux_up[level1],info1.M2[0].matrix, info1.indices, info2.indices, true);
+ assemble(flux_down[level1], info2.M2[0].matrix, info2.indices, info1.indices);
+ }
+ }
+
+
//----------------------------------------------------------------------//
template <class MATRIX, typename number>
inline void
SystemSimple<MATRIX,VECTOR>::initialize(MATRIX& m, VECTOR& rhs)
{
- NamedData<SmartPointer<VECTOR> > data;
- SmartPointer<VECTOR> p = &rhs;
+ NamedData<VECTOR*> data;
+ VECTOR* p = &rhs;
data.add(p, "right hand side");
MatrixSimple<MATRIX>::initialize(m);
/// The block structure of the system
- SmartPointer<const BlockInfo> block_info;
+ SmartPointer<const BlockInfo,DoFInfo<dim,spacedim> > block_info;
private:
/// Fill index vector
void get_indices(const typename DoFHandler<dim, spacedim>::cell_iterator c);
const FiniteElement<dim, spacedim>& el,
const Mapping<dim, spacedim>& mapping);
- template <class WORKER, class VECTOR>
+ template <class WORKER, class VECTOR,class P>
void initialize(const WORKER&,
const FiniteElement<dim, spacedim>& el,
const Mapping<dim, spacedim>& mapping,
- const NamedData<SmartPointer<VECTOR> >& data);
+ const NamedData<SmartPointer<VECTOR,P> >& data);
// private:
CellInfo cell_info;
template <int dim, int sdim>
- template <class WORKER, class VECTOR>
+ template <class WORKER, class VECTOR, class P>
void
IntegrationInfoBox<dim,sdim>::initialize(
const WORKER& integrator,
const FiniteElement<dim,sdim>& el,
const Mapping<dim,sdim>& mapping,
- const NamedData<SmartPointer<VECTOR> >& data)
+ const NamedData<SmartPointer<VECTOR,P> >& data)
{
cell_info.initialize_data(data);
bdry_info.initialize_data(data);
public VectorDataBase<dim, spacedim>
{
public:
- void initialize(const NamedData<SmartPointer<VECTOR> >&);
+ void initialize(const NamedData<VECTOR*>&);
virtual void fill(
std::vector<std::vector<std::vector<double> > >& values,
unsigned int start,
unsigned int size) const;
private:
- SmartPointer<const NamedData<SmartPointer<VECTOR> > > data;
+ NamedData<SmartPointer<VECTOR,VectorData<VECTOR,dim,spacedim> > > data;
};
//----------------------------------------------------------------------//
template <class VECTOR, int dim, int spacedim>
void
- VectorData<VECTOR, dim, spacedim>::initialize(const NamedData<SmartPointer<VECTOR> >& d)
+ VectorData<VECTOR, dim, spacedim>::initialize(const NamedData<VECTOR*>& d)
{
- data = &d;
+ data = d;
VectorSelector::initialize(d);
}
{
for (unsigned int i=0;i<this->n_values();++i)
{
- const VECTOR& src = *(*data)(this->value_index(i));
+ const VECTOR& src = *data(this->value_index(i));
VectorSlice<std::vector<std::vector<double> > > dst(values[i], component, n_comp);
fe.get_function_values(src, make_slice(index, start, size), dst, true);
}
for (unsigned int i=0;i<this->n_gradients();++i)
{
- const VECTOR& src = *(*data)(this->value_index(i));
+ const VECTOR& src = *data(this->value_index(i));
VectorSlice<std::vector<std::vector<Tensor<1,dim> > > > dst(gradients[i], component, n_comp);
fe.get_function_gradients(src, make_slice(index, start, size), dst, true);
}
for (unsigned int i=0;i<this->n_hessians();++i)
{
- const VECTOR& src = *(*data)(this->value_index(i));
+ const VECTOR& src = *data(this->value_index(i));
VectorSlice<std::vector<std::vector<Tensor<2,dim> > > > dst(hessians[i], component, n_comp);
fe.get_function_hessians(src, make_slice(index, start, size), dst, true);
}
* supplied to the constructor. This can be
* released by calling @p clear().
*/
- SmartPointer<const DoFHandler<dim> > dof_handler;
+ SmartPointer<const DoFHandler<dim>,PointValueHistory<dim> > dof_handler;
/**
* Variable to check that number of dofs
// $Id$
// Version: $Name$
//
-// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by the deal.II authors
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
* @ingroup numerics
* @author Ralf Hartmann, 1999
*/
-template<int dim, typename VectorType=Vector<double>, class DH=DoFHandler<dim> >
+template<int dim, typename VECTOR=Vector<double>, class DH=DoFHandler<dim> >
class SolutionTransfer
{
public:
* onto the new (refined and/or
* coarsenend) grid.
*/
- void prepare_for_coarsening_and_refinement (const std::vector<VectorType> &all_in);
+ void prepare_for_coarsening_and_refinement (const std::vector<VECTOR> &all_in);
/**
* Same as previous function
* but for only one discrete function
* to be interpolated.
*/
- void prepare_for_coarsening_and_refinement (const VectorType &in);
+ void prepare_for_coarsening_and_refinement (const VECTOR &in);
/**
* This function
* allowed. e.g. for interpolating several
* functions.
*/
- void refine_interpolate (const VectorType &in,
- VectorType &out) const;
+ void refine_interpolate (const VECTOR &in,
+ VECTOR &out) const;
/**
* This function
* (@p n_dofs_refined). Otherwise
* an assertion will be thrown.
*/
- void interpolate (const std::vector<VectorType>&all_in,
- std::vector<VectorType> &all_out) const;
+ void interpolate (const std::vector<VECTOR>&all_in,
+ std::vector<VECTOR> &all_out) const;
/**
* Same as the previous function.
* in one step by using
* <tt>interpolate (all_in, all_out)</tt>
*/
- void interpolate (const VectorType &in,
- VectorType &out) const;
+ void interpolate (const VECTOR &in,
+ VECTOR &out) const;
/**
* Determine an estimate for the
*/
DeclException0(ExcNumberOfDoFsPerCellHasChanged);
- /**
- * Exception
- */
- DeclException2(ExcWrongVectorSize,
- int, int,
- << "The size of the vector is " << arg1
- << " although it should be " << arg2 << ".");
-
private:
/**
* Pointer to the degree of freedom handler
* to work with.
*/
- SmartPointer<const DH> dof_handler;
+ SmartPointer<const DH,SolutionTransfer<dim,VECTOR,DH> > dof_handler;
/**
* Stores the number of DoFs before the
unsigned int memory_consumption () const;
std::vector<unsigned int> *indices_ptr;
- std::vector<Vector<typename VectorType::value_type> > *dof_values_ptr;
+ std::vector<Vector<typename VECTOR::value_type> > *dof_values_ptr;
};
/**
* of all cells that'll be coarsened
* will be stored in this vector.
*/
- std::vector<std::vector<Vector<typename VectorType::value_type> > > dof_values_on_cell;
+ std::vector<std::vector<Vector<typename VECTOR::value_type> > > dof_values_on_cell;
};
// $Id$
// Version: $Name$
//
-// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
* objects pointed to by the pointers
* in this collection.
*/
- std::vector<SmartPointer<TimeStepBase> > timesteps;
+ std::vector<SmartPointer<TimeStepBase,TimeDependent> > timesteps;
/**
* Number of the present sweep. This is
* such a behaviour is specified
* in the @p flags structure.
*/
- SmartPointer<Triangulation<dim, dim> > tria;
+ SmartPointer<Triangulation<dim, dim>,TimeStepBase_Tria<dim> > tria;
/**
* Pointer to a grid which is to
* with the owner of this
* management object.
*/
- SmartPointer<const Triangulation<dim, dim> > coarse_grid;
+ SmartPointer<const Triangulation<dim, dim>,TimeStepBase_Tria<dim> > coarse_grid;
/**
* Some flags about how this time level
:
n_quadrature_points (n_q_points),
dofs_per_cell (dofs_per_cell),
- mapping(&mapping),
- fe(&fe),
- mapping_data(0),
- fe_data(0),
+ mapping(&mapping, typeid(*this).name()),
+ fe(&fe, typeid(*this).name()),
+ mapping_data(0, typeid(*this).name()),
+ fe_data(0, typeid(*this).name()),
fe_values_views_cache (*this)
{
this->update_flags = flags;
const DoFHandler<dim,spacedim> &shiftmap_dof_handler)
:
euler_transform_vectors(euler_transform_vectors),
- shiftmap_dof_handler(&shiftmap_dof_handler)
+ shiftmap_dof_handler(&shiftmap_dof_handler, typeid(*this).name())
{}
// $Id$
// Version: $Name$
//
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2008 by the deal.II authors
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
:
MappingQ<dim,spacedim>(degree, true),
euler_vector(euler_vector),
- euler_dof_handler(&euler_dof_handler),
+ euler_dof_handler(&euler_dof_handler, typeid(*this).name()),
support_quadrature(degree),
fe_values(euler_dof_handler.get_fe(),
support_quadrature,
template <int dim, int spacedim>
GridIn<dim, spacedim>::GridIn () :
- tria(0), default_format(ucd)
+ tria(0, typeid(*this).name()), default_format(ucd)
{}
PersistentTriangulation<dim>::
PersistentTriangulation (const Triangulation<dim> &coarse_grid)
:
- coarse_grid (&coarse_grid)
+ coarse_grid (&coarse_grid, typeid(*this).name())
{}
template <int dim, int spacedim>
Triangulation<dim, spacedim>::Triangulation (const MeshSmoothing smooth_grid)
:
- Subscriptor (),
faces(NULL),
anisotropic_refinement(false),
smooth_grid(smooth_grid)
template <int dim, int spacedim>
-Triangulation<dim, spacedim>::Triangulation (const Triangulation<dim, spacedim> &)
- :
- Subscriptor ()
+Triangulation<dim, spacedim>::Triangulation (const Triangulation<dim, spacedim> &)
// do not set any subscriptors;
// anyway, calling this constructor
// is an error!
+ :
+ Subscriptor()
{
Assert (false, ExcInternalError());
}
template<int dim, int spacedim>
DoFHandler<dim,spacedim>::DoFHandler (const Triangulation<dim,spacedim> &tria)
:
- tria(&tria),
+ tria(&tria, typeid(*this).name()),
faces (NULL),
used_dofs (0)
{
// $Id$
// Version: $Name$
//
-// Copyright (C) 2003, 2006, 2007, 2008 by the deal.II authors
+// Copyright (C) 2003, 2006, 2007, 2008, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
:
names(names_in),
data_component_interpretation (data_component_interpretation),
- postprocessor(0),
+ postprocessor(0, typeid(*this).name()),
n_output_variables(names.size())
{
Assert (names.size() == data_component_interpretation.size(),
:
names(data_postprocessor->get_names()),
data_component_interpretation (data_postprocessor->get_data_component_interpretation()),
- postprocessor(data_postprocessor),
+ postprocessor(data_postprocessor, typeid(*this).name()),
n_output_variables(data_postprocessor->n_output_variables())
{
// if there is a post processor, then we
template <int dim>
PointValueHistory<dim>
::PointValueHistory (const unsigned int n_independent_variables) :
- dof_handler (0, "No DoFHandler"),
n_dofs (0),
n_indep (n_independent_variables)
{
template <int dim>
-PointValueHistory<dim>
-::PointValueHistory (const DoFHandler<dim> & dof_handler,
+PointValueHistory<dim>::PointValueHistory (const DoFHandler<dim> & dof_handler,
const unsigned int n_independent_variables) :
- dof_handler (&dof_handler, typeid (*this).name ()),
+ dof_handler (&dof_handler),
n_dofs (dof_handler.n_dofs ()),
n_indep (n_independent_variables)
{
template <int dim>
-PointValueHistory<dim>
-::PointValueHistory (const PointValueHistory & point_value_history)
+PointValueHistory<dim>::PointValueHistory (const PointValueHistory & point_value_history)
{
dataset_key = point_value_history.dataset_key;
independent_values = point_value_history.independent_values;
::clear ()
{
cleared = true;
- dof_handler = SmartPointer<const DoFHandler<dim> > (0, "Cleared");
+ dof_handler = 0;
}
// Need to test that the internal data has a full and complete dataset for
// $Id$
// Version: $Name$
//
-// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008 by the deal.II authors
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
-template<int dim, typename VectorType, class DH>
-SolutionTransfer<dim, VectorType, DH>::SolutionTransfer(const DH &dof):
- dof_handler(&dof),
+template<int dim, typename VECTOR, class DH>
+SolutionTransfer<dim, VECTOR, DH>::SolutionTransfer(const DH &dof):
+ dof_handler(&dof, typeid(*this).name()),
n_dofs_old(0),
prepared_for(none)
{}
-template<int dim, typename VectorType, class DH>
-SolutionTransfer<dim, VectorType, DH>::~SolutionTransfer()
+template<int dim, typename VECTOR, class DH>
+SolutionTransfer<dim, VECTOR, DH>::~SolutionTransfer()
{
clear ();
}
-template<int dim, typename VectorType, class DH>
-SolutionTransfer<dim, VectorType, DH>::Pointerstruct::Pointerstruct():
+template<int dim, typename VECTOR, class DH>
+SolutionTransfer<dim, VECTOR, DH>::Pointerstruct::Pointerstruct():
indices_ptr(0),
dof_values_ptr(0)
{}
-template<int dim, typename VectorType, class DH>
-void SolutionTransfer<dim, VectorType, DH>::clear ()
+template<int dim, typename VECTOR, class DH>
+void SolutionTransfer<dim, VECTOR, DH>::clear ()
{
indices_on_cell.clear();
dof_values_on_cell.clear();
}
-template<int dim, typename VectorType, class DH>
-void SolutionTransfer<dim, VectorType, DH>::prepare_for_pure_refinement()
+template<int dim, typename VECTOR, class DH>
+void SolutionTransfer<dim, VECTOR, DH>::prepare_for_pure_refinement()
{
Assert(prepared_for!=pure_refinement, ExcAlreadyPrepForRef());
Assert(prepared_for!=coarsening_and_refinement,
}
-template<int dim, typename VectorType, class DH>
+template<int dim, typename VECTOR, class DH>
void
-SolutionTransfer<dim, VectorType, DH>::refine_interpolate(const VectorType &in,
- VectorType &out) const
+SolutionTransfer<dim, VECTOR, DH>::refine_interpolate(const VECTOR &in,
+ VECTOR &out) const
{
Assert(prepared_for==pure_refinement, ExcNotPrepared());
- Assert(in.size()==n_dofs_old, ExcWrongVectorSize(in.size(),n_dofs_old));
+ Assert(in.size()==n_dofs_old, ExcDimensionMismatch(in.size(),n_dofs_old));
Assert(out.size()==dof_handler->n_dofs(),
- ExcWrongVectorSize(out.size(),dof_handler->n_dofs()));
+ ExcDimensionMismatch(out.size(),dof_handler->n_dofs()));
Assert(&in != &out,
ExcMessage ("Vectors cannot be used as input and output"
" at the same time!"));
- Vector<typename VectorType::value_type> local_values(0);
+ Vector<typename VECTOR::value_type> local_values(0);
typename DH::cell_iterator cell = dof_handler->begin(),
endc = dof_handler->end();
}
-template<int dim, typename VectorType, class DH>
+template<int dim, typename VECTOR, class DH>
void
-SolutionTransfer<dim, VectorType, DH>::
-prepare_for_coarsening_and_refinement(const std::vector<VectorType> &all_in)
+SolutionTransfer<dim, VECTOR, DH>::
+prepare_for_coarsening_and_refinement(const std::vector<VECTOR> &all_in)
{
Assert(prepared_for!=pure_refinement, ExcAlreadyPrepForRef());
Assert(!prepared_for!=coarsening_and_refinement,
for (unsigned int i=0; i<in_size; ++i)
{
Assert(all_in[i].size()==n_dofs_old,
- ExcWrongVectorSize(all_in[i].size(),n_dofs_old));
+ ExcDimensionMismatch(all_in[i].size(),n_dofs_old));
}
// first count the number
(n_cells_to_stay_or_refine)
.swap(indices_on_cell);
- std::vector<std::vector<Vector<typename VectorType::value_type> > >
+ std::vector<std::vector<Vector<typename VECTOR::value_type> > >
(n_coarsen_fathers,
- std::vector<Vector<typename VectorType::value_type> > (in_size))
+ std::vector<Vector<typename VECTOR::value_type> > (in_size))
.swap(dof_values_on_cell);
// we need counters for
ExcTriaPrepCoarseningNotCalledBefore());
const unsigned int dofs_per_cell=cell->get_fe().dofs_per_cell;
- std::vector<Vector<typename VectorType::value_type> >(in_size,
- Vector<typename VectorType::value_type>(dofs_per_cell))
+ std::vector<Vector<typename VECTOR::value_type> >(in_size,
+ Vector<typename VECTOR::value_type>(dofs_per_cell))
.swap(dof_values_on_cell[n_cf]);
for (unsigned int j=0; j<in_size; ++j)
}
-template<int dim, typename VectorType, class DH>
+template<int dim, typename VECTOR, class DH>
void
-SolutionTransfer<dim, VectorType, DH>::prepare_for_coarsening_and_refinement(const VectorType &in)
+SolutionTransfer<dim, VECTOR, DH>::prepare_for_coarsening_and_refinement(const VECTOR &in)
{
- std::vector<VectorType> all_in=std::vector<VectorType>(1, in);
+ std::vector<VECTOR> all_in=std::vector<VECTOR>(1, in);
prepare_for_coarsening_and_refinement(all_in);
}
-template<int dim, typename VectorType, class DH>
-void SolutionTransfer<dim, VectorType, DH>::
-interpolate (const std::vector<VectorType> &all_in,
- std::vector<VectorType> &all_out) const
+template<int dim, typename VECTOR, class DH>
+void SolutionTransfer<dim, VECTOR, DH>::
+interpolate (const std::vector<VECTOR> &all_in,
+ std::vector<VECTOR> &all_out) const
{
Assert(prepared_for==coarsening_and_refinement, ExcNotPrepared());
const unsigned int size=all_in.size();
Assert(all_out.size()==size, ExcDimensionMismatch(all_out.size(), size));
for (unsigned int i=0; i<size; ++i)
Assert (all_in[i].size() == n_dofs_old,
- ExcWrongVectorSize(all_in[i].size(), n_dofs_old));
+ ExcDimensionMismatch(all_in[i].size(), n_dofs_old));
for (unsigned int i=0; i<all_out.size(); ++i)
Assert (all_out[i].size() == dof_handler->n_dofs(),
- ExcWrongVectorSize(all_out[i].size(), dof_handler->n_dofs()));
+ ExcDimensionMismatch(all_out[i].size(), dof_handler->n_dofs()));
for (unsigned int i=0; i<size; ++i)
for (unsigned int j=0; j<size; ++j)
Assert(&all_in[i] != &all_out[j],
ExcMessage ("Vectors cannot be used as input and output"
" at the same time!"));
- Vector<typename VectorType::value_type> local_values;
+ Vector<typename VECTOR::value_type> local_values;
std::vector<unsigned int> dofs;
typename std::map<std::pair<unsigned int, unsigned int>, Pointerstruct>::const_iterator
const std::vector<unsigned int> * const indexptr
=pointerstruct->second.indices_ptr;
- const std::vector<Vector<typename VectorType::value_type> > * const valuesptr
+ const std::vector<Vector<typename VECTOR::value_type> > * const valuesptr
=pointerstruct->second.dof_values_ptr;
const unsigned int dofs_per_cell=cell->get_fe().dofs_per_cell;
-template<int dim, typename VectorType, class DH>
-void SolutionTransfer<dim, VectorType, DH>::interpolate(const VectorType &in,
- VectorType &out) const
+template<int dim, typename VECTOR, class DH>
+void SolutionTransfer<dim, VECTOR, DH>::interpolate(const VECTOR &in,
+ VECTOR &out) const
{
Assert (in.size()==n_dofs_old,
- ExcWrongVectorSize(in.size(), n_dofs_old));
+ ExcDimensionMismatch(in.size(), n_dofs_old));
Assert (out.size()==dof_handler->n_dofs(),
- ExcWrongVectorSize(out.size(), dof_handler->n_dofs()));
+ ExcDimensionMismatch(out.size(), dof_handler->n_dofs()));
- std::vector<VectorType> all_in(1);
+ std::vector<VECTOR> all_in(1);
all_in[0] = in;
- std::vector<VectorType> all_out(1);
+ std::vector<VECTOR> all_out(1);
all_out[0] = out;
interpolate(all_in,
all_out);
-template<int dim, typename VectorType, class DH>
+template<int dim, typename VECTOR, class DH>
unsigned int
-SolutionTransfer<dim, VectorType, DH>::memory_consumption () const
+SolutionTransfer<dim, VECTOR, DH>::memory_consumption () const
{
// at the moment we do not include the memory
// consumption of the cell_map as we have no
-template<int dim, typename VectorType, class DH>
+template<int dim, typename VECTOR, class DH>
unsigned int
-SolutionTransfer<dim, VectorType, DH>::Pointerstruct::memory_consumption () const
+SolutionTransfer<dim, VECTOR, DH>::Pointerstruct::memory_consumption () const
{
return sizeof(*this);
}
// $Id$
// Version: $Name$
//
-// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2008 by the deal.II authors
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2008, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
else
{
// inner time step
- std::vector<SmartPointer<TimeStepBase> >::iterator insert_position
+ std::vector<SmartPointer<TimeStepBase,TimeDependent> >::iterator insert_position
= std::find(timesteps.begin(), timesteps.end(), position);
(*(insert_position-1))->set_next_timestep (new_timestep);
if (position != 0)
timesteps[position-1]->set_next_timestep ((position<timesteps.size()) ?
timesteps[position] :
- /*null*/SmartPointer<TimeStepBase>());
+ /*null*/SmartPointer<TimeStepBase,TimeDependent>());
// same for "previous" pointer of next
// time step
if (position<timesteps.size())
timesteps[position]->set_previous_timestep ((position!=0) ?
timesteps[position-1] :
- /*null*/SmartPointer<TimeStepBase>());
+ /*null*/SmartPointer<TimeStepBase,TimeDependent>());
}
template <int dim>
TimeStepBase_Tria<dim>::TimeStepBase_Tria() :
TimeStepBase (0),
- tria (0),
- coarse_grid (0),
+ tria (0, typeid(*this).name()),
+ coarse_grid (0, typeid(*this).name()),
flags (),
refinement_flags(0)
{
const RefinementFlags &refinement_flags) :
TimeStepBase (time),
tria(0, typeid(*this).name()),
- coarse_grid (&coarse_grid),
+ coarse_grid (&coarse_grid, typeid(*this).name()),
flags (flags),
refinement_flags (refinement_flags)
{}
// $Id$
// Version: $Name$
//
-// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
/**
* Diagonal entry.
*/
- SmartPointer<const MATRIX> matrix;
+ SmartPointer<const MATRIX,BlockDiagonalMatrix<MATRIX> > matrix;
};
/*@}*/
// $Id$
// Version: $Name$
//
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by the deal.II authors
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
* The memory used for auxiliary
* vectors.
*/
- mutable SmartPointer<VectorMemory<Vector<number> > > mem;
+ mutable SmartPointer<VectorMemory<Vector<number> >,BlockMatrixArray<number> > mem;
};
/*@}*/
/**
* Array of sub-matrices.
*/
- Table<2,SmartPointer<BlockType> > sub_objects;
+ Table<2,SmartPointer<BlockType, BlockMatrixBase<MatrixType> > > sub_objects;
/**
* This function collects the
// $Id$
// Version: $Name$
//
-// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
* it using the SmartPointer
* class.
*/
- SmartPointer<const BlockSparsityPattern> sparsity_pattern;
+ SmartPointer<const BlockSparsityPattern,BlockSparseMatrix<number> > sparsity_pattern;
};
// $Id$
// Version: $Name$
//
-// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008 by the deal.II authors
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
template <typename number>
BlockSparseMatrix<number>::BlockSparseMatrix ()
- :
- sparsity_pattern (0)
{}
template <typename number>
BlockSparseMatrix<number>::
BlockSparseMatrix (const BlockSparsityPattern &sparsity)
- :
- sparsity_pattern (0)
{
reinit (sparsity);
}
/**
* Array of sparsity patterns.
*/
- Table<2,SmartPointer<SparsityPatternBase> > sub_objects;
+ Table<2,SmartPointer<SparsityPatternBase, BlockSparsityPatternBase<SparsityPatternBase> > > sub_objects;
/**
* Object storing and managing
// $Id$
// Version: $Name: $
//
-// Copyright (C) 2008 by the deal.II authors
+// Copyright (C) 2008, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
* it using the SmartPointer
* class.
*/
- SmartPointer<const ChunkSparsityPattern> cols;
+ SmartPointer<const ChunkSparsityPattern,ChunkSparseMatrix<number> > cols;
/**
* Array of values for all the
// $Id$
// Version: $Name$
//
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by the deal.II authors
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
/**
* Pointer to the sparsity
* pattern used for this
- * matrix. In order to guarantee
- * that it is not deleted while
- * still in use, we subscribe to
- * it using the SmartPointer
- * class.
+ * matrix.
*/
std_cxx1x::shared_ptr<PointerMatrixBase<VECTOR> > matrix;
// $Id$
// Version: $Name$
//
-// Copyright (C) 2005, 2006, 2008 by the deal.II authors
+// Copyright (C) 2005, 2006, 2008, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
void Tvmult(BlockVector<number>&,
const BlockVector<number>&) const;
private:
- SmartPointer<const LAPACKFullMatrix<number> > matrix;
- SmartPointer<VectorMemory<Vector<number> > > mem;
+ SmartPointer<const LAPACKFullMatrix<number>,PreconditionLU<number> > matrix;
+ SmartPointer<VectorMemory<Vector<number> >,PreconditionLU<number> > mem;
};
// $Id$
// Version: $Name$
//
-// Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors
+// Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
/**
* Memory for auxiliary vector.
*/
- SmartPointer<VectorMemory<VECTOR> > mem;
+ SmartPointer<VectorMemory<VECTOR>,ProductMatrix<VECTOR> > mem;
/**
* Return some kind of
* identifier.
/**
* The left matrix of the product.
*/
- SmartPointer<const MatrixType> m1;
+ SmartPointer<const MatrixType,ProductSparseMatrix<number,vector_number> > m1;
/**
* The right matrix of the product.
*/
- SmartPointer<const MatrixType> m2;
+ SmartPointer<const MatrixType,ProductSparseMatrix<number,vector_number> > m2;
/**
* Memory for auxiliary vector.
*/
- SmartPointer<VectorMemory<VectorType> > mem;
+ SmartPointer<VectorMemory<VectorType>,ProductSparseMatrix<number,vector_number> > mem;
/**
* Return some kind of
* identifier.
template<class VECTOR>
ProductMatrix<VECTOR>::ProductMatrix ()
- : m1(0), m2(0), mem(0, typeid(*this).name())
+ : m1(0), m2(0), mem(0)
{}
template<class VECTOR>
ProductMatrix<VECTOR>::ProductMatrix (VectorMemory<VECTOR>& m)
- : m1(0), m2(0), mem(&m, typeid(*this).name())
+ : m1(0), m2(0), mem(&m)
{}
const MATRIX1& mat1,
const MATRIX2& mat2,
VectorMemory<VECTOR>& m)
- : mem(&m, typeid(*this).name())
+ : mem(&m)
{
m1 = new PointerMatrix<MATRIX1, VECTOR>(&mat1, typeid(*this).name());
m2 = new PointerMatrix<MATRIX2, VECTOR>(&mat2, typeid(*this).name());
// $Id$
// Version: $Name$
//
-// Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 by the deal.II authors
+// Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
/**
* The pointer to the actual matrix.
*/
- SmartPointer<const MATRIX> m;
+ SmartPointer<const MATRIX,PointerMatrix<MATRIX,VECTOR> > m;
};
* Object for getting the
* auxiliary vector.
*/
- mutable SmartPointer<VectorMemory<VECTOR> > mem;
+ mutable SmartPointer<VectorMemory<VECTOR>,PointerMatrixAux<MATRIX,VECTOR> > mem;
/**
* The pointer to the actual matrix.
*/
- SmartPointer<const MATRIX> m;
+ SmartPointer<const MATRIX,PointerMatrixAux<MATRIX,VECTOR> > m;
};
/**
* The pointer to the actual matrix.
*/
- SmartPointer<const Vector<number> > m;
+ SmartPointer<const Vector<number>,PointerMatrixVector<number> > m;
};
/**
* Pointer to the matrix object.
*/
- SmartPointer<const MATRIX> A;
+ SmartPointer<const MATRIX, PreconditionRelaxation<MATRIX> > A;
/**
* Relaxation parameter.
/**
* The solver object to use.
*/
- SmartPointer<SOLVER> solver;
+ SmartPointer<SOLVER,PreconditionLACSolver<SOLVER,MATRIX,PRECONDITION> > solver;
/**
* The matrix in use.
*/
- SmartPointer<const MATRIX> matrix;
+ SmartPointer<const MATRIX,PreconditionLACSolver<SOLVER,MATRIX,PRECONDITION> > matrix;
/**
* The preconditioner to use.
*/
- SmartPointer<const PRECONDITION> precondition;
+ SmartPointer<const PRECONDITION,PreconditionLACSolver<SOLVER,MATRIX,PRECONDITION> > precondition;
};
* A pointer to the underlying
* matrix.
*/
- SmartPointer<const MATRIX> matrix_ptr;
+ SmartPointer<const MATRIX,PreconditionChebyshev<MATRIX,VECTOR> > matrix_ptr;
/**
* Internal vector used for the
* @p vmult function of the
* derived classes.
*/
- SmartPointer<const MATRIX> A;
+ SmartPointer<const MATRIX,PreconditionBlock<MATRIX,inverse_type> > A;
/**
* Relaxation parameter to be
* used by derived classes.
template <class MATRIX, typename inverse_type>
PreconditionBlock<MATRIX,inverse_type>::PreconditionBlock ():
blocksize(0),
- A(0),
+ A(0, typeid(*this).name()),
store_diagonals(false),
var_same_diagonal(false)
{}
// $Id$
// Version: $Name$
//
-// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
*
* @author Ralf Hartmann, 1999
*/
-template <class Matrix = SparseMatrix<double>,
- class Vector = dealii::Vector<double> >
+template <class MATRIX = SparseMatrix<double>,
+ class VECTOR = dealii::Vector<double> >
class PreconditionSelector : public Subscriptor
{
public:
* the preconditioning.
*/
PreconditionSelector(const std::string &preconditioning,
- const typename Vector::value_type &omega=1.);
+ const typename VECTOR::value_type &omega=1.);
/**
* Destructor.
* matrix. e.g. for @p precondition_jacobi,
* <tt>~_sor</tt>, <tt>~_ssor</tt>.
*/
- void use_matrix(const Matrix &M);
+ void use_matrix(const MATRIX &M);
/**
* Precondition procedure. Calls the
* preconditioning that was specified in
* the constructor.
*/
- virtual void vmult (Vector &dst, const Vector&src) const;
+ virtual void vmult (VECTOR &dst, const VECTOR&src) const;
/**
* Get the names of all implemented
* matrix-builtin preconditioning function.
* cf. also @p PreconditionUseMatrix.
*/
- SmartPointer<const Matrix> A;
+ SmartPointer<const MATRIX,PreconditionSelector<MATRIX,VECTOR> > A;
/**
* Stores the damping parameter
* of the preconditioner.
*/
- const typename Vector::value_type omega;
+ const typename VECTOR::value_type omega;
};
/*@}*/
/* --------------------- Inline and template functions ------------------- */
-template <class Matrix, class Vector>
-PreconditionSelector<Matrix,Vector>
+template <class MATRIX, class VECTOR>
+PreconditionSelector<MATRIX,VECTOR>
::PreconditionSelector(const std::string &preconditioning,
- const typename Vector::value_type &omega) :
+ const typename VECTOR::value_type &omega) :
preconditioning(preconditioning),
omega(omega) {}
-template <class Matrix, class Vector>
-PreconditionSelector<Matrix,Vector>::~PreconditionSelector()
+template <class MATRIX, class VECTOR>
+PreconditionSelector<MATRIX,VECTOR>::~PreconditionSelector()
{
// release the matrix A
A=0;
}
-template <class Matrix, class Vector>
-void PreconditionSelector<Matrix,Vector>::use_matrix(const Matrix &M)
+template <class MATRIX, class VECTOR>
+void PreconditionSelector<MATRIX,VECTOR>::use_matrix(const MATRIX &M)
{
A=&M;
}
-template <class Matrix, class Vector>
-void PreconditionSelector<Matrix,Vector>::vmult (Vector &dst,
- const Vector &src) const
+template <class MATRIX, class VECTOR>
+void PreconditionSelector<MATRIX,VECTOR>::vmult (VECTOR &dst,
+ const VECTOR &src) const
{
if (preconditioning=="none")
{
}
-template <class Matrix, class Vector>
-std::string PreconditionSelector<Matrix,Vector>::get_precondition_names()
+template <class MATRIX, class VECTOR>
+std::string PreconditionSelector<MATRIX,VECTOR>::get_precondition_names()
{
return "none|jacobi|sor|ssor";
}
// $Id$
// Version: $Name$
//
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
/**
* Pointer to inverse of upper left block.
*/
- const SmartPointer<const MA_inverse> Ainv;
+ const SmartPointer<const MA_inverse,SchurMatrix<MA_inverse,MB,MDt,MC> > Ainv;
/**
* Pointer to lower left block.
*/
- const SmartPointer<const MB> B;
+ const SmartPointer<const MB,SchurMatrix<MA_inverse,MB,MDt,MC> > B;
/**
* Pointer to transpose of upper right block.
*/
- const SmartPointer<const MDt> Dt;
+ const SmartPointer<const MDt,SchurMatrix<MA_inverse,MB,MDt,MC> > Dt;
/**
* Pointer to lower right block.
*/
- const SmartPointer<const MC> C;
+ const SmartPointer<const MC,SchurMatrix<MA_inverse,MB,MDt,MC> > C;
/**
* Auxiliary memory for vectors.
*/
// $Id$
// Version: $Name$
//
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
/**
* Storage for base matrix.
*/
- SmartPointer<const MATRIX> A;
+ SmartPointer<const MATRIX,ShiftedMatrix<MATRIX> > A;
/**
* Auxiliary vector.
/**
* Storage for base matrix.
*/
- SmartPointer<const MATRIX> A;
+ SmartPointer<const MATRIX,ShiftedMatrixGeneralized<MATRIX,MASSMATRIX,VECTOR> > A;
/**
* Storage for mass matrix.
*/
- SmartPointer<const MASSMATRIX> M;
+ SmartPointer<const MASSMATRIX,ShiftedMatrixGeneralized<MATRIX,MASSMATRIX,VECTOR> > M;
/**
* Auxiliary vector.
// $Id$
// Version: $Name$
//
-// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
* is needed in the constructor of
* each @p Solver class.
*/
- SmartPointer<SolverControl> control;
+ SmartPointer<SolverControl,SolverSelector<VECTOR> > control;
/**
* Stores the @p VectorMemory that
* is needed in the constructor of
* each @p Solver class.
*/
- SmartPointer<VectorMemory<VECTOR> > vector_memory;
+ SmartPointer<VectorMemory<VECTOR>,SolverSelector<VECTOR> > vector_memory;
private:
/**
// $Id$
// Version: $Name$
//
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by the deal.II authors
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
* that we use the same thing for
* all calls.
*/
- SmartPointer<const SparsityPattern> sparsity_pattern;
+ SmartPointer<const SparsityPattern,SparseDirectMA27> sparsity_pattern;
/**
* Number of nonzero elements in
* to make sure that we use the
* same thing for all calls.
*/
- SmartPointer<const SparseMatrix<double> > matrix;
+ SmartPointer<const SparseMatrix<double>,SparseDirectMA47> matrix;
/**
* Number of nonzero elements in
/**
* Print the matrix to the given
* stream, using the format
- * <tt>(line,col) value</tt>,
+ * <tt>(row,column) value</tt>,
* i.e. one nonzero entry of the
- * matrix per line.
+ * matrix per line. If @p across
+ * is true, print all entries on
+ * a single line, using the
+ * format row,column:value
*/
template <class STREAM>
- void print (STREAM &out) const;
+ void print (STREAM &out, bool across=false) const;
/**
* Print the matrix in the usual
* it using the SmartPointer
* class.
*/
- SmartPointer<const SparsityPattern> cols;
+ SmartPointer<const SparsityPattern,SparseMatrix<number> > cols;
/**
* Array of values for all the
template <typename number>
template <class STREAM>
inline
-void SparseMatrix<number>::print (STREAM &out) const
+void SparseMatrix<number>::print (STREAM &out, bool across) const
{
Assert (cols != 0, ExcNotInitialized());
Assert (val != 0, ExcNotInitialized());
- for (unsigned int i=0; i<cols->rows; ++i)
- for (unsigned int j=cols->rowstart[i]; j<cols->rowstart[i+1]; ++j)
- out << "(" << i << "," << cols->colnums[j] << ") " << val[j] << std::endl;
+ if (across)
+ {
+ for (unsigned int i=0; i<cols->rows; ++i)
+ for (unsigned int j=cols->rowstart[i]; j<cols->rowstart[i+1]; ++j)
+ out << ' ' << i << ',' << cols->colnums[j] << ':' << val[j];
+ out << std::endl;
+ }
+ else
+ for (unsigned int i=0; i<cols->rows; ++i)
+ for (unsigned int j=cols->rowstart[i]; j<cols->rowstart[i+1]; ++j)
+ out << "(" << i << "," << cols->colnums[j] << ") " << val[j] << std::endl;
}
/**
* Pointer to the matrix.
*/
- SmartPointer<const SparseMatrix<number> > matrix;
+ SmartPointer<const SparseMatrix<number>,SparseVanka<number> > matrix;
/**
* Conserve memory flag.
* Only those elements will be used
* that are tagged in @p selected.
*/
- mutable std::vector<SmartPointer<FullMatrix<float> > > inverses;
+ mutable std::vector<SmartPointer<FullMatrix<float>,SparseVanka<number> > > inverses;
/**
* Compute the inverses of all
// $Id$
// Version: $Name$
//
-// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by the deal.II authors
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
const bool conserve_mem,
const unsigned int n_threads)
:
- matrix (&M),
+ matrix (&M, typeid(*this).name()),
conserve_mem (conserve_mem),
selected (selected),
n_threads (n_threads),
template<typename number>
SparseVanka<number>::~SparseVanka()
{
- std::vector<SmartPointer<FullMatrix<float> > >::iterator i;
+ typename std::vector<SmartPointer<FullMatrix<float>,SparseVanka<number> > >::iterator i;
for(i=inverses.begin(); i!=inverses.end(); ++i)
{
FullMatrix<float> *p = *i;
/**
* The pointer to the actual matrix.
*/
- SmartPointer<const MATRIX> m;
+ SmartPointer<const MATRIX,TransposeMatrix<MATRIX,VECTOR> > m;
};
template<class MATRIX, class VECTOR>
TransposeMatrix<MATRIX, VECTOR>::TransposeMatrix (const MATRIX* M)
- : m(M, typeid(*this).name())
+ : m(M)
{}
// $Id$
// Version: $Name$
//
-// Copyright (C) 2005, 2006, 2007 by the deal.II authors
+// Copyright (C) 2005, 2006, 2007, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
#include <base/config.h>
#include <base/subscriptor.h>
-#include <base/smartpointer.h>
#include <lac/lapack_support.h>
#include <vector>
/**
* The memory pool used.
*/
- SmartPointer<VectorMemory<VECTOR> > pool;
+ SmartPointer<VectorMemory<VECTOR>,Pointer> pool;
/**
* The pointer to the vector.
*/
inline
VectorMemory<VECTOR>::Pointer::Pointer(VectorMemory<VECTOR>& mem)
:
- pool(&mem), v(0)
+ pool(&mem, typeid(*this).name()), v(0)
{
v = pool->alloc();
}
// $Id$
// Version: $Name$
//
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
LA_increase_factor (LA_increase_factor),
initialize_called (false),
factorize_called (false),
- sparsity_pattern (0)
+ sparsity_pattern (0, typeid(*this).name())
{}
LA_increase_factor (LA_increase_factor),
initialize_called (false),
factorize_called (false),
- matrix (0)
+ matrix (0, typeid(*this).name())
{}