TensorIndex(...);
/**
- *
* Access operator returning index
* in #n#th component
- *
*/
unsigned int operator () (unsigned int n) const;
- DeclException1(ExcRank, int,
+
+ /**
+ * Exception.
+ */
+ DeclException1(ExcRank, int,
<< "Index " << arg1 << " higher than maximum " << rank-1);
};
/**
- *
* Access operator returning index
* in #n#th component
- *
*/
unsigned int operator () (unsigned int n) const
{
/**
* Field of indices.
*/
- unsigned index[3];
-public:
- /**
- * Constructor taking #rank# indices.
- */
- TensorIndex(unsigned i0, unsigned i1, unsigned i2)
+ unsigned index[3];
+ public:
+ /**
+ * Constructor taking #rank# indices.
+ */
+ TensorIndex(unsigned i0, unsigned i1, unsigned i2)
{
index[0] = i0;
index[1] = i1;
}
- /**
- *
- * Access operator returning index
- * in #n#th component
- *
- */
- unsigned operator () (unsigned n) const
+ /**
+ * Access operator returning index
+ * in #n#th component
+ *
+ */
+ unsigned operator () (unsigned n) const
{
Assert(n<3, ExcRank(n));
return index[n];
}
- DeclException1(ExcRank, unsigned,
- << "Index " << arg1 << " higher than maximum 2");
+ DeclException1(ExcRank, unsigned,
+ << "Index " << arg1 << " higher than maximum 2");
};
template<>
class TensorIndex<2>
{
-private:
- /**
- * Field of indices.
- */
- unsigned index[4];
-public:
- /**
- * Constructor taking #rank# indices.
- */
- TensorIndex(unsigned i0, unsigned i1)
+ private:
+ /**
+ * Field of indices.
+ */
+ unsigned index[4];
+ public:
+ /**
+ * Constructor taking #rank# indices.
+ */
+ TensorIndex(unsigned i0, unsigned i1)
{
index[0] = i0;
index[1] = i1;
}
- /**
- *
- * Access operator returning index
- * in #n#th component
- *
- */
- unsigned operator () (unsigned n) const
+ /**
+ * Access operator returning index
+ * in #n#th component
+ */
+ unsigned operator () (unsigned n) const
{
Assert(n<2, ExcRank(n));
return index[n];
}
- DeclException1(ExcRank, unsigned,
- << "Index " << arg1 << " higher than maximum 1");
+ DeclException1(ExcRank, unsigned,
+ << "Index " << arg1 << " higher than maximum 1");
};
template<>
class TensorIndex<1>
{
-private:
- /**
- * Field of indices.
- */
- unsigned index[1];
-public:
- /**
- * Constructor taking #rank# indices.
- */
- TensorIndex(unsigned i0)
+ private:
+ /**
+ * Field of indices.
+ */
+ unsigned index[1];
+ public:
+ /**
+ * Constructor taking #rank# indices.
+ */
+ TensorIndex(unsigned i0)
{
index[0] = i0;
}
- /**
- *
- * Access operator returning index
- * in #n#th component
- *
- */
- unsigned operator () (unsigned n) const
+ /**
+ * Access operator returning index
+ * in #n#th component
+ */
+ unsigned operator () (unsigned n) const
{
Assert(n<1, ExcRank(n));
return index[n];
}
- DeclException1(ExcRank, unsigned,
- << "Index " << arg1 << " higher than maximum 0");
+ DeclException1(ExcRank, unsigned,
+ << "Index " << arg1 << " higher than maximum 0");
};
+
+
template<int rank>
inline unsigned
-TensorIndex<rank>::operator() (unsigned n) const
+TensorIndex<rank>::
+operator() (unsigned n) const
{
Assert(n<rank, ExcRank(n));
return index[n];
-// $Id$
+/*---------------------------- mg_base.h ---------------------------*/
+/* $Id$ */
+#ifndef __mg_base_H
+#define __mg_base_H
+/*---------------------------- mg_base.h ---------------------------*/
-#ifndef __lac_mg_base_h
-#define __lac_mg_base_h
#include <base/subscriptor.h>
#include <base/smartpointer.h>
+
+
template<class SOLVER, class MATRIX, class PRECOND>
-MGCoarseGridLACIteration<SOLVER, MATRIX, PRECOND>
-::MGCoarseGridLACIteration(SOLVER& s, const MATRIX& m, const PRECOND& p)
+MGCoarseGridLACIteration<SOLVER, MATRIX, PRECOND>::
+MGCoarseGridLACIteration(SOLVER& s, const MATRIX& m, const PRECOND& p)
:
solver(s), matrix(m), precondition(p)
{}
solver.solve(matrix, dst, src, precondition);
}
-//////////////////////////////////////////////////////////////////////
+
+
+
+/* ------------------------------------------------------------------- */
template<class VECTOR>
MGVector<VECTOR>::MGVector(unsigned int min, unsigned int max)
return vector<VECTOR>::operator[](i-minlevel);
}
-//////////////////////////////////////////////////////////////////////
+
+
+/* ------------------------------------------------------------------- */
+
template<class MATRIX>
MGMatrix<MATRIX>::MGMatrix(unsigned int min, unsigned int max)
return vector<MATRIX>::operator[](i-minlevel);
}
-//////////////////////////////////////////////////////////////////////
+
+
+/* ------------------------------------------------------------------- */
+
template<class MG, class VECTOR>
PreconditionMG<MG, VECTOR>::PreconditionMG(MG& mg,
- const MGSmootherBase& pre,
- const MGSmootherBase& post,
- const MGCoarseGridSolver& coarse)
+ const MGSmootherBase& pre,
+ const MGSmootherBase& post,
+ const MGCoarseGridSolver& coarse)
:
multigrid(&mg),
pre(&pre),
coarse(&coarse)
{}
+
+
template<class MG, class VECTOR>
void
-PreconditionMG<MG, VECTOR>::operator() (VECTOR& dst, const VECTOR& src) const
+PreconditionMG<MG, VECTOR>::operator() (VECTOR& dst,
+ const VECTOR& src) const
{
multigrid->copy_to_mg(src);
multigrid->vcycle(*pre, *post, *coarse);
}
+
+/*---------------------------- mg_base.h ---------------------------*/
+/* end of #ifndef __mg_base_H */
#endif
+/*---------------------------- mg_base.h ---------------------------*/
-// $Id$
+/*---------------------------- mgbase.h ---------------------------*/
+/* $Id$ */
+#ifndef __mgbase_H
+#define __mgbase_H
+/*---------------------------- mgbase.h ---------------------------*/
-#ifndef __lac_mgbase_h
-#define __lac_mgbase_h
#include <base/subscriptor.h>
#include <base/smartpointer.h>
+
+
template<class SOLVER, class MATRIX, class PRECOND>
-MGCoarseGridLACIteration<SOLVER, MATRIX, PRECOND>
-::MGCoarseGridLACIteration(SOLVER& s, const MATRIX& m, const PRECOND& p)
+MGCoarseGridLACIteration<SOLVER, MATRIX, PRECOND>::
+MGCoarseGridLACIteration(SOLVER& s, const MATRIX& m, const PRECOND& p)
:
solver(s), matrix(m), precondition(p)
{}
solver.solve(matrix, dst, src, precondition);
}
-//////////////////////////////////////////////////////////////////////
+
+
+
+/* ------------------------------------------------------------------- */
template<class VECTOR>
MGVector<VECTOR>::MGVector(unsigned int min, unsigned int max)
return vector<VECTOR>::operator[](i-minlevel);
}
-//////////////////////////////////////////////////////////////////////
+
+
+/* ------------------------------------------------------------------- */
+
template<class MATRIX>
MGMatrix<MATRIX>::MGMatrix(unsigned int min, unsigned int max)
return vector<MATRIX>::operator[](i-minlevel);
}
-//////////////////////////////////////////////////////////////////////
+
+
+/* ------------------------------------------------------------------- */
+
template<class MG, class VECTOR>
PreconditionMG<MG, VECTOR>::PreconditionMG(MG& mg,
- const MGSmootherBase& pre,
- const MGSmootherBase& post,
- const MGCoarseGridSolver& coarse)
+ const MGSmootherBase& pre,
+ const MGSmootherBase& post,
+ const MGCoarseGridSolver& coarse)
:
multigrid(&mg),
pre(&pre),
coarse(&coarse)
{}
+
+
template<class MG, class VECTOR>
void
-PreconditionMG<MG, VECTOR>::operator() (VECTOR& dst, const VECTOR& src) const
+PreconditionMG<MG, VECTOR>::operator() (VECTOR& dst,
+ const VECTOR& src) const
{
multigrid->copy_to_mg(src);
multigrid->vcycle(*pre, *post, *coarse);
}
+
+/*---------------------------- mgbase.h ---------------------------*/
+/* end of #ifndef __mgbase_H */
#endif
+/*---------------------------- mgbase.h ---------------------------*/