-
Notifications
You must be signed in to change notification settings - Fork 475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancements on IterativeSolver, ComplexPetscParMatrix, PetscParVector #651
Comments
Thanks for the suggestions, Changkai!
Can you clarify why
Are you thinking here of
@stefanozampini is probably the best person to address these. |
Hi Tzanio, (1) (2) The second point is also for Changkai |
Update: It seems that there are no functions like |
Hi Changkai, Are you interested in proposing a pull request to add the Tzanio |
Hi Tzanio, I am glad to make any contributions (if I could). It may take some time because I have no experience with git/github and I have to read the source code |
Where is this complex version of MFEM? AFAIK MFEM fakes complex operators using special real block operators. You can always extract the blocks that you want and convert them into a PetscParMatrix. Can you be more specific about your needs? PETSc can be configured with support for complex numbers, i.e. MATAIJ with complex entries. Is this what you would like to have to use MUMPS?
There are some enhancements here https://github.com/mfem/mfem/tree/stefanozampini/small-additions . I have plans to open a PR. Tell me if they fit your needs. |
Hi @stefanozampini , Thanks for your attention. Please accept my apology for the ambiguous description. I know the support of complex operators are handled by block real operators in mfem-complex-mfem-dev. For real-value problems, Below are my needs: While, for complex-value problems (in the real block forms), only The following code So I expect a data structure which stores the sparse matrix arising from complex block problems in the Petsc Mat format, like that implemented for the real-value problem. Hope I have make my needs clear. Thank you very much! Best wishes, |
There should be no need for you to explicitly call PETSc functions. Once the complex branch will get merged to master I'll see if it is reasonable to add the For the time being, if you just need the action of the matrix in the Krylov solver, you don't need to pass a |
Hi @stefanozampini , Thanks for your kind suggestions about the
There is no problem when I tested with [0]PETSC ERROR: --------------------- Error Message -------------------------------------------------------------- Am I missing something in the above code? Best wishes, |
As I said before, since the general convertor in MFEM does not know anything about the complex class of matrices, it creates a MATSHELL which just calls the Mult method of the class when doing matvecs. |
Well, I don't understand 'which requries N matvecs, with N the size of the matrix'. Thanks. |
Being a shell matrix, you need N matrix vector products to compute all the entries (required by MUMPS) |
Hi @stefanozampini , As you suggested, I first call
to obtain the matrix in Then, either
or
won't work. Could you show me the pseudo code how I can solve the complex system using PETSc MUMPS? I have no experience with PETSc before, but use the Fortran version MUMPS directly. Thanks a lot. Changkai |
Hi @stefanozampini , Could you please help me about this issue? I want to use MUMPS through PETSc to verify my solutions. I am still working on a problem like Currently, the residual by Pass : 1 Iteration : 0 || r || = 367.143 In this case, the final solution vector are all zero. If the initial guess is a small number like 1.0e-8, the @mlstowell , any suggestions about what I should do? How can I solve the system equation in Many thanks for all your help. Changkai |
Dear developers,
Here I want to propose a few enhancements:
For
IterativeSolver
:(1) member function to judge if the IterativeSolver has converged to the preset tolerance
(2) member function which returns the absolute (or absolute) tolerance for each linear solve
These two functions will be very useful when the users don't want the solver to print any information to the standard output stream.
(3) a new data structure
ComplexPetscParMatrix
Currently only
ComplexHypreParMatrix
is implemented in the complex version of mfem. There is no member functionSetOperatorType(Operator::PETSC_MATAIJ)
for the classParSesquilinearForm
either, so we can't obtain a PETSc format matrix after callingFormLinearSystem.
This new matrix format will introduce more solvers from PETSc (like MUMPS) for complex mfem.(4) more flexible PetscParVector
I noticed the following code:
/// Creates a PetscParVector from a Vector (data is not copied) PetscParVector(MPI_Comm comm, const Vector &_x);
When I want to get a
PetscParVector
from aVector
(or vice versa), I have to copy the data manually. Maybe more functions (likeoperator=
for copyingVector
andPetscParVector)
are expected.Thanks for your work and consideration.
Best,
Changkai
The text was updated successfully, but these errors were encountered: