Re: [deal.II] Re: Solving the linear system of equations using PETSc BlockSparseMatrix

2022-08-30 Thread Masoud Ahmadi
Dear Bruno and Daniel,

Thanks for your replies.
I used linear_operator and then solve the problem like step-70. 
I guess there is no "Direct solver" for this situation, the one like we had 
for dealii BlockSparseMatrix.

Best regards,
Masoud


On Tuesday, 23 August 2022 at 16:11:12 UTC+1 d.arnd...@gmail.com wrote:

> Adding to what Bruno is saying,
>
> If you are not taking advantage of the block structure, you should be able 
> to treat the block matrix as "regular", i.e., non-block, matrix possibly by 
> copying it to a corresponding non-block type.
>
> Best,
> Daniel
>
> On Mon, Aug 22, 2022 at 10:51 AM Bruno Turcksin  
> wrote:
>
>> Hi,
>>
>> If you search for "block solver" here 
>> https://dealii.org/developer/doxygen/deal.II/Tutorial.html, you will see 
>> all the tutorials that use block solvers. I think that only deal.II's own 
>> solvers support BlockSparseMatrix directly.
>>
>> Best,
>>
>> Bruno
>>
>> On Monday, August 22, 2022 at 9:02:28 AM UTC-4 masou...@gmail.com wrote:
>>
>>> Dear All,
>>>
>>> The following system of equations:
>>> KQ=R
>>> where,
>>> [image: Screenshot from 2022-08-22 13-45-45.png]
>>> were solved using BlockSparseMatrix to form tangent matrix K. It was 
>>> solved by:
>>>
>>> SparseDirectUMFPACK A_direct; 
>>> A_direct.initialize(K); 
>>> A_direct.vmult(Q_stp, R);
>>>
>>> Now, I'm trying to run my code with MPI using PETSc/Trilinos, but the 
>>> solver does not except  PETSc/Trilinos BlockSparseMatrix. How do we solve 
>>> such a general system of equations? 
>>>
>> -- 
>>
> 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 dealii+un...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/dealii/9c70b7e9-08ed-4cd6-bfd7-7eefe5eb2159n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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 dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/1fe4c5db-0e4d-4662-996c-c4363d6326adn%40googlegroups.com.


Re: [deal.II] Re: Solving the linear system of equations using PETSc BlockSparseMatrix

2022-08-23 Thread Daniel Arndt
Adding to what Bruno is saying,

If you are not taking advantage of the block structure, you should be able
to treat the block matrix as "regular", i.e., non-block, matrix possibly by
copying it to a corresponding non-block type.

Best,
Daniel

On Mon, Aug 22, 2022 at 10:51 AM Bruno Turcksin 
wrote:

> Hi,
>
> If you search for "block solver" here
> https://dealii.org/developer/doxygen/deal.II/Tutorial.html, you will see
> all the tutorials that use block solvers. I think that only deal.II's own
> solvers support BlockSparseMatrix directly.
>
> Best,
>
> Bruno
>
> On Monday, August 22, 2022 at 9:02:28 AM UTC-4 masou...@gmail.com wrote:
>
>> Dear All,
>>
>> The following system of equations:
>> KQ=R
>> where,
>> [image: Screenshot from 2022-08-22 13-45-45.png]
>> were solved using BlockSparseMatrix to form tangent matrix K. It was
>> solved by:
>>
>> SparseDirectUMFPACK A_direct;
>> A_direct.initialize(K);
>> A_direct.vmult(Q_stp, R);
>>
>> Now, I'm trying to run my code with MPI using PETSc/Trilinos, but the
>> solver does not except  PETSc/Trilinos BlockSparseMatrix. How do we solve
>> such a general system of equations?
>>
> --
> 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 dealii+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/dealii/9c70b7e9-08ed-4cd6-bfd7-7eefe5eb2159n%40googlegroups.com
> 
> .
>

-- 
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 dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/CAOYDWbKvTYa%3DgLNqz0pfcs58dz0m1o%2BV1zVFXwhdVqL0GYMViw%40mail.gmail.com.


Re: [deal.II] Re: Solving the linear system of equations using PETSc BlockSparseMatrix

2022-08-23 Thread Bruno Turcksin
I am not sure what you mean by solving for diagonal blocks. The solver is
general; it is the preconditioner that is block diagonal. If you want to
use MPI, I assume that you have a large system. In this case, direct
solvers are not very effective and you need to use an iterative solver.
deal.II's iterative solvers work with any BlockSparseMatrix. The tutorials
show you how to take advantage of the blocks to build a good
preconditioner. If you don't want to use a preconditioner, that's fine. The
code will be similar to what you have now but it will be slow.

Le mar. 23 août 2022 à 09:19, Masoud Ahmadi  a
écrit :

> Thanks for the reply.
> I had seen that, they solve it for the "diagonal" blocks; I want a general
> method. My system of equations is not like any special cases in the
> Tutorials.
> As I said, I solve the one without Trilinos/PETSc by:
>
> SparseDirectUMFPACK A_direct;
> A_direct.initialize(K);
> A_direct.vmult(Q_stp, R);
>
> I am looking for something similar.
>
> On Tuesday, 23 August 2022 at 13:57:18 UTC+1 bruno.t...@gmail.com wrote:
>
>> They do. Take for example step-70, the matrix is a
>> LA::MPI::BlockSparseMatrix
>> 
>> which is a PETSc or a Trilinos BlockSpaceMatrix depending on how deal.II
>> was configured.
>>
>> Bruno
>>
>> Le mar. 23 août 2022 à 06:43, Masoud Ahmadi  a
>> écrit :
>>
>>> Dear Bruno,
>>>
>>> Thanks for your reply.
>>> I had seen those before, but, unfortunately none of those solve a
>>> general PETSc/Trilinos BlockSparseMatrix problem.
>>>
>>>
>>> On Monday, 22 August 2022 at 15:51:03 UTC+1 bruno.t...@gmail.com wrote:
>>>
 Hi,

 If you search for "block solver" here
 https://dealii.org/developer/doxygen/deal.II/Tutorial.html, you will
 see all the tutorials that use block solvers. I think that only deal.II's
 own solvers support BlockSparseMatrix directly.

 Best,

 Bruno

 On Monday, August 22, 2022 at 9:02:28 AM UTC-4 masou...@gmail.com
 wrote:

> Dear All,
>
> The following system of equations:
> KQ=R
> where,
> [image: Screenshot from 2022-08-22 13-45-45.png]
> were solved using BlockSparseMatrix to form tangent matrix K. It was
> solved by:
>
> SparseDirectUMFPACK A_direct;
> A_direct.initialize(K);
> A_direct.vmult(Q_stp, R);
>
> Now, I'm trying to run my code with MPI using PETSc/Trilinos, but the
> solver does not except  PETSc/Trilinos BlockSparseMatrix. How do we solve
> such a general system of equations?
>
 --
>>> 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 a topic in the
>>> Google Groups "deal.II User Group" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/dealii/vRkKqpMC21E/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> dealii+un...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/dealii/96e7565f-4e69-4bb9-8de8-ddcf4f3d4067n%40googlegroups.com
>>> 
>>> .
>>>
>> --
> 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 a topic in the
> Google Groups "deal.II User Group" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/dealii/vRkKqpMC21E/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> dealii+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/dealii/4cb3ddef-efc4-4921-8fe7-b9e969a64d98n%40googlegroups.com
> 
> .
>

-- 
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 dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/CAGVt9eOwrLzzGwRkvi-cFQy5YB9RRfXOfiGVcxVq0d0Lr7DF-w%40mail.gmail.com.


Re: [deal.II] Re: Solving the linear system of equations using PETSc BlockSparseMatrix

2022-08-23 Thread Masoud Ahmadi
Thanks for the reply.
I had seen that, they solve it for the "diagonal" blocks; I want a general 
method. My system of equations is not like any special cases in the 
Tutorials.
As I said, I solve the one without Trilinos/PETSc by:

SparseDirectUMFPACK A_direct; 
A_direct.initialize(K); 
A_direct.vmult(Q_stp, R);

I am looking for something similar.

On Tuesday, 23 August 2022 at 13:57:18 UTC+1 bruno.t...@gmail.com wrote:

> They do. Take for example step-70, the matrix is a 
> LA::MPI::BlockSparseMatrix 
> 
>  
> which is a PETSc or a Trilinos BlockSpaceMatrix depending on how deal.II 
> was configured.
>
> Bruno
>
> Le mar. 23 août 2022 à 06:43, Masoud Ahmadi  a écrit :
>
>> Dear Bruno,
>>
>> Thanks for your reply.
>> I had seen those before, but, unfortunately none of those solve a general 
>> PETSc/Trilinos BlockSparseMatrix problem.
>>
>>
>> On Monday, 22 August 2022 at 15:51:03 UTC+1 bruno.t...@gmail.com wrote:
>>
>>> Hi,
>>>
>>> If you search for "block solver" here 
>>> https://dealii.org/developer/doxygen/deal.II/Tutorial.html, you will 
>>> see all the tutorials that use block solvers. I think that only deal.II's 
>>> own solvers support BlockSparseMatrix directly.
>>>
>>> Best,
>>>
>>> Bruno
>>>
>>> On Monday, August 22, 2022 at 9:02:28 AM UTC-4 masou...@gmail.com wrote:
>>>
 Dear All,

 The following system of equations:
 KQ=R
 where,
 [image: Screenshot from 2022-08-22 13-45-45.png]
 were solved using BlockSparseMatrix to form tangent matrix K. It was 
 solved by:

 SparseDirectUMFPACK A_direct; 
 A_direct.initialize(K); 
 A_direct.vmult(Q_stp, R);

 Now, I'm trying to run my code with MPI using PETSc/Trilinos, but the 
 solver does not except  PETSc/Trilinos BlockSparseMatrix. How do we solve 
 such a general system of equations? 

>>> -- 
>> 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 a topic in the 
>> Google Groups "deal.II User Group" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/dealii/vRkKqpMC21E/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> dealii+un...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/dealii/96e7565f-4e69-4bb9-8de8-ddcf4f3d4067n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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 dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/4cb3ddef-efc4-4921-8fe7-b9e969a64d98n%40googlegroups.com.


Re: [deal.II] Re: Solving the linear system of equations using PETSc BlockSparseMatrix

2022-08-23 Thread Bruno Turcksin
They do. Take for example step-70, the matrix is a
LA::MPI::BlockSparseMatrix

which is a PETSc or a Trilinos BlockSpaceMatrix depending on how deal.II
was configured.

Bruno

Le mar. 23 août 2022 à 06:43, Masoud Ahmadi  a
écrit :

> Dear Bruno,
>
> Thanks for your reply.
> I had seen those before, but, unfortunately none of those solve a general
> PETSc/Trilinos BlockSparseMatrix problem.
>
>
> On Monday, 22 August 2022 at 15:51:03 UTC+1 bruno.t...@gmail.com wrote:
>
>> Hi,
>>
>> If you search for "block solver" here
>> https://dealii.org/developer/doxygen/deal.II/Tutorial.html, you will see
>> all the tutorials that use block solvers. I think that only deal.II's own
>> solvers support BlockSparseMatrix directly.
>>
>> Best,
>>
>> Bruno
>>
>> On Monday, August 22, 2022 at 9:02:28 AM UTC-4 masou...@gmail.com wrote:
>>
>>> Dear All,
>>>
>>> The following system of equations:
>>> KQ=R
>>> where,
>>> [image: Screenshot from 2022-08-22 13-45-45.png]
>>> were solved using BlockSparseMatrix to form tangent matrix K. It was
>>> solved by:
>>>
>>> SparseDirectUMFPACK A_direct;
>>> A_direct.initialize(K);
>>> A_direct.vmult(Q_stp, R);
>>>
>>> Now, I'm trying to run my code with MPI using PETSc/Trilinos, but the
>>> solver does not except  PETSc/Trilinos BlockSparseMatrix. How do we solve
>>> such a general system of equations?
>>>
>> --
> 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 a topic in the
> Google Groups "deal.II User Group" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/dealii/vRkKqpMC21E/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> dealii+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/dealii/96e7565f-4e69-4bb9-8de8-ddcf4f3d4067n%40googlegroups.com
> 
> .
>

-- 
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 dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/CAGVt9ePczofc33HvqSzhg_X5GfOQxu92Eh2DKn_o6J70wNFxxA%40mail.gmail.com.


[deal.II] Re: Solving the linear system of equations using PETSc BlockSparseMatrix

2022-08-23 Thread Masoud Ahmadi
Dear Bruno,

Thanks for your reply.
I had seen those before, but, unfortunately none of those solve a general 
PETSc/Trilinos BlockSparseMatrix problem.


On Monday, 22 August 2022 at 15:51:03 UTC+1 bruno.t...@gmail.com wrote:

> Hi,
>
> If you search for "block solver" here 
> https://dealii.org/developer/doxygen/deal.II/Tutorial.html, you will see 
> all the tutorials that use block solvers. I think that only deal.II's own 
> solvers support BlockSparseMatrix directly.
>
> Best,
>
> Bruno
>
> On Monday, August 22, 2022 at 9:02:28 AM UTC-4 masou...@gmail.com wrote:
>
>> Dear All,
>>
>> The following system of equations:
>> KQ=R
>> where,
>> [image: Screenshot from 2022-08-22 13-45-45.png]
>> were solved using BlockSparseMatrix to form tangent matrix K. It was 
>> solved by:
>>
>> SparseDirectUMFPACK A_direct; 
>> A_direct.initialize(K); 
>> A_direct.vmult(Q_stp, R);
>>
>> Now, I'm trying to run my code with MPI using PETSc/Trilinos, but the 
>> solver does not except  PETSc/Trilinos BlockSparseMatrix. How do we solve 
>> such a general system of equations? 
>>
>

-- 
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 dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/96e7565f-4e69-4bb9-8de8-ddcf4f3d4067n%40googlegroups.com.


[deal.II] Re: Solving the linear system of equations using PETSc BlockSparseMatrix

2022-08-22 Thread Bruno Turcksin
Hi,

If you search for "block solver" here 
https://dealii.org/developer/doxygen/deal.II/Tutorial.html, you will see 
all the tutorials that use block solvers. I think that only deal.II's own 
solvers support BlockSparseMatrix directly.

Best,

Bruno

On Monday, August 22, 2022 at 9:02:28 AM UTC-4 masou...@gmail.com wrote:

> Dear All,
>
> The following system of equations:
> KQ=R
> where,
> [image: Screenshot from 2022-08-22 13-45-45.png]
> were solved using BlockSparseMatrix to form tangent matrix K. It was 
> solved by:
>
> SparseDirectUMFPACK A_direct; 
> A_direct.initialize(K); 
> A_direct.vmult(Q_stp, R);
>
> Now, I'm trying to run my code with MPI using PETSc/Trilinos, but the 
> solver does not except  PETSc/Trilinos BlockSparseMatrix. How do we solve 
> such a general system of equations? 
>

-- 
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 dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/9c70b7e9-08ed-4cd6-bfd7-7eefe5eb2159n%40googlegroups.com.