Hello everyone,
I am trying to implement a CG Solver with my own VectorType. According to 
Lecture 21, what one needs is that the Vector and Operator are compatible, 
and that the operator has a vmult-function. However, the compiler misses a 
lot of member function of my own Vector class. Am I doing something wrong 
or do I need to implement all additional member function for "MyVector"? 

Thanks in advance,
Stefan

Examplary error message:  ‘class MyVector’ has no member named ‘reinit’

Minimal (Not) working example:

#include <deal.II/lac/solver_cg.h>
#include <deal.II/lac/vector_memory.templates.h>

class MyVector : public dealii::Subscriptor
{
public: 
MyVector(){};

using value_type = double;
};
template class dealii::VectorMemory<MyVector>;
template class dealii::GrowingVectorMemory<MyVector>;

class MySystemMatrix : public dealii::Subscriptor
{
public:
MySystemMatrix();

void vmult(MyVector & dst,
const MyVector &src) const;

};

class InverseMatrix : public dealii::Subscriptor
{
public:
InverseMatrix(const MySystemMatrix & matrix);

void vmult(MyVector &dst, const MyVector &src) const;

private:
const dealii::SmartPointer<const MySystemMatrix> _matrix;
};

void InverseMatrix::vmult(
MyVector& dst,
const MyVector& src) const
{
dealii::SolverControl solver_control( 100, 1e-6 );

dealii::GrowingVectorMemory<MyVector> GVM;
dealii::SolverCG<MyVector> solver(solver_control, GVM);

solver.solve<MySystemMatrix, MySystemMatrix>(*_matrix, dst, src, *_matrix);
}

InverseMatrix::InverseMatrix(
const MySystemMatrix & matrix)
: _matrix(&matrix)
{}

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/b5cd8b75-8ca6-40f6-96c3-e8beab330197n%40googlegroups.com.

Reply via email to