getfem-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Getfem-users] Question on Preconditioners


From: Yves Renard
Subject: Re: [Getfem-users] Question on Preconditioners
Date: Fri, 6 Oct 2006 09:28:19 +0200
User-agent: KMail/1.7.2

The diagonal precondtioner just stores the inverse (if nonzero)  of the 
diagonal of the matrix argument of the constructor. All matrix types are 
allowed. But off course, the preconditioner has to be built only when the the 
matrix is filled. If you need to declare the preconditioner before you fill 
the matrix, you can declare it without argument, then use P.build_with(SM) to 
build the preconditioner. For instance:

typedef gmm::row_matrix< gmm::wsvector<complex<double> > > mymatrixtype;
mymatrixtype C(N2,N2);
gmm::diagonal_precond<mymatrixtype>  P();

// ...
... fill C
// ...

P.build_with(C);

Sincerly,

Yves.



Le Jeudi 5 Octobre 2006 17:47, vous avez écrit :
> I have an embarassingly simple question. In the user manual for gmm++
> there is the following:
>
> >>>>> gmm::diagonal_precond<matrix_type> P(SM)
>
> The question is what is SM? Is this the coefficient matrix from which the
> diagonal is extracted? If my coefficient matrix is of type:
>
> >>>>> gmm::row_matrix< gmm::wsvector<complex<double> > >
>
> what matrix type should matrices P and SM be?




> Hi:
>
> I am trying to solve a system of equations using iterative solver, QMR, in
> particular. I have a problem with getting preconditioners. I tried the
> following, where C(N2,N2) is the coefficient matrix:
>
> **********************
> gmm::row_matrix< gmm::wsvector<complex<double> > > C(N2,N2);
> gmm::row_matrix<std::vector<std::complex<double> > > C1(N2,N2);
> gmm::copy(C,C1);
> gmm::diagonal_precond<gmm::row_matrix<std::vector<std::complex<double> > > > 
> P(C1); 
>
> ****************
>
> This did not work owing to the large size of C1(N2,N2). What is
> permissible for matrix_type in "gmm::diagonal_precond<matrix_type>? Note
> that the I tried the following and it did not work:
>
> gmm::diagonal_precond<gmm::row_matrix<std::vector<std::complex<double> > >
>
> > P(C);
>
> Please help. It appears that matrix_type cannot be:
> gmm::row_matrix< gmm::wsvector<complex<double> > >
>
> Sincerely,
> -- Bwalya
> Bwalya Malama, Ph.D.
> Center for Geophysical Research of the Shallow Subsurface
> Boise State University
> Boise, Idaho
> tel: 208-426-2959
> email: address@hidden
>
> _______________________________________________
> Getfem-users mailing list
> address@hidden
> https://mail.gna.org/listinfo/getfem-users

-- 
-------------------------------------------------------------------------
  Yves Renard (address@hidden)       tel : (33) 04.72.43.80.11
  Pole de Mathematiques, INSA de Lyon          fax : (33) 04.72.43.85.29
  Departement d'Informatique
  Institut Camille Jordan - UMR 5208
  20, rue Albert Einstein
  69621 Villeurbanne Cedex, FRANCE
  http://math.univ-lyon1.fr/~renard
-------------------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]