Re: [deal.II] how to get the inverse of a sparse matrix?

2018-11-18 Thread FU
Dear Jean-Paul,

Thank you very much for your help. According to your prompt, after many 
reflections in the past two days, I have come up with a solution, but it 
has not been verified yet.
With new progress, I will communicate with you again.
Thanks again for your help.

Best,
FU

在 2018年11月16日星期五 UTC+8下午2:59:45,Jean-Paul Pelteret写道:
>
> Dear FU,
>
> Yes, I think that the LinearOperator 
>  class 
> and family of helper functions 
>  can 
> help you here. This is because you never use the matrix “A” in isolation, 
> but rather have it operating on the vector “T” (or some increment of “T” in 
> your nonlinear solution algorithm). So you can use the LinearOperator class 
> to create the composite operator “A”, which does not ever compute or hold 
> the individual entries of “A” itself, but rather performs the action on a 
> vector that is equivalent to what “A” would. You should have a look at the 
> class documentation that I linked to earlier. The step-44 tutorial 
> 
>  also 
> provides an example of its use.
>
> I hope that this helps you move forward with your problem.
> Best,
> Jean-Paul
>
> On 16 Nov 2018, at 01:01, FU > wrote:
>
> Hi,
> I want to solve AT+BFT^4=C  (1), 
> A, B, F are sparse matrix, T, T^4 are the solution vector.
> By Newton method, we need to (1) derivation.
> So I want to know how to get A.
> Or what do you think of solving this equation?
>
> best,
> FU
>
>
> 在 2018年11月15日星期四 UTC+8下午10:45:24,Jean-Paul Pelteret写道:
>>
>> Hi,
>>
>> In general there is, to the best of my knowledge, no easy answer to your 
>> question. Can you explain what you intend to do with the matrix “A"? That 
>> would help a great deal, as there may still be some functionality in the 
>> library to help you. If you intend to perform some operations with “A” then 
>> we have some wrapper classes called LinearOperators that can produce an 
>> effective “A” (without computing it directly). But whether or not this 
>> makes sense depends on the context in which you want to use “A”.
>>
>> Best,
>> Jean-Paul
>>
>> On 15 Nov 2018, at 15:28, FU  wrote:
>>
>> Thank you very much for your reply.
>>
>> I probably understand the methods you mentioned, but there is no 
>> multiplication vector behind the sparse matrix of the solution I asked for.
>>
>> A=M- (N^T) (M^-1) N,
>>
>> This is the construction equation of the original sparse matrix.
>>
>> A is the sparse matrix that I want to get in the end, where N and M are 
>> sparse matrices.
>>
>> What else can you do to solve this problem?
>>
>> Thank you
>>
>> FU在 2018年11月14日星期三 UTC+8下午2:32:03,Jean-Paul Pelteret写道:
>>>
>>> Hi,
>>>
>>> To compute the sparse matrix inverse M^{-1} you would have to use a 
>>> direct solver such as SparseDirectUMFPACK 
>>> . 
>>> If this operation (M^{-1})N appears in the context of matrix-vector 
>>> products, i.e. you’re actually computing something like y = (M^{-1})Nx then 
>>> you could use an iterative solver 
>>>  to 
>>> invert the system My = (Nx) = b. Here you could be computing the solution y 
>>> = M^{-1}b using an iterative method.
>>>
>>> I hope that this helps.
>>> Best,
>>> Jean-Paul
>>>
>>> On 14 Nov 2018, at 03:01, FU  wrote:
>>>
>>> (M^-1)N,
>>> M and N are sparse matrix,
>>> so how to get the inverse of a sparse 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 dealii+un...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>>
>>>
>> -- 
>> 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.
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
> -- 
> 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 .
> For more options, visit https://groups.

Re: [deal.II] Saving boundary faces in half_hyper_shell to msh file

2018-11-18 Thread Praveen C
On 18-Nov-2018, at 7:35 PM, luca.heltai  wrote:Did you use the option “colorize=on”?L.Yes, I have done that.I have tried a different way to set the id which works correctly, attached code.Bestpraveen



-- 
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.
For more options, visit https://groups.google.com/d/optout.


main.cc
Description: Binary data




-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Saving boundary faces in half_hyper_shell to msh file

2018-11-18 Thread luca.heltai
Did you use the option “colorize=on”?

L.

> On 18 Nov 2018, at 10:45, Praveen C  wrote:
> 
> 
> 
>> On 18-Nov-2018, at 2:59 PM, luca.heltai  wrote:
>> 
>> Dear Praveen, 
>> 
>> this is actually a feature, and not a bug. The reason is that, by default, 
>> deal.II generates triangulations with boundary id = 0. If you don’t specify 
>> a boundary id in the gmsh file, then all boundary faces get boundary id = 0.
>> 
>> This allows us to save space in the output grid, since there is no need to 
>> save faces with id = 0, because they will be recreated correctly when you 
>> read the mesh back in.
>> 
>> Best,
>> Luca.
>  
> 
> ok. This is fine for deal.II but if I try to use this mesh with other tools, 
> then it may not be ideal. Maybe an option to save id=0 faces also might be 
> useful.
> 
> The other issue is that both inner sphere and part of the outer sphere are 
> getting id=0. This makes it difficult to use the boundary id to set different 
> boundary conditions on the inner and outer sphere.
> 
> The description says faces on outer sphere should get id=1 but that is not 
> happening.
> 
> Best
> praveen
> 
> -- 
> 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.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Re: Installation of deal.II with CUDA

2018-11-18 Thread Chih-Che Chueh
Daniel,


Using MPI and CUDA together is pretty much work in progress. On the
> developer branch, LinearAlgebra::distributed::Vector supports
> storing its elements on a CUDA device, but the values are copied to the
> CPU for MPI communication.
> The pull request https://github.com/dealii/dealii/pull/7303 allows to use
> CUDA-aware MPI instead but the memory transfer needs to be optimized.
>

If I could get involved in this development, I would be helpful to optimize
the memory transfer between GPU and CPU by testing different CUDA C
programming schemes like this:
https://devblogs.nvidia.com/how-overlap-data-transfers-cuda-cc/

In fact, as a principal investigator at Taiwan, I am qualified to submit
jobs into Taiwania, a recently established super computing machine
established in 2017, equipped with NVIDIA Tesla P100 SXM2. Moreover,
sometime next year, we will have another super computing machine available
to use (Taiwania 2), which now ranks 20th in the world with NVIDIA Tesla
V100 SXM2.

https://www.top500.org/system/179590

Sincerely,

Chih-Che

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Saving boundary faces in half_hyper_shell to msh file

2018-11-18 Thread Praveen C


> On 18-Nov-2018, at 2:59 PM, luca.heltai  wrote:
> 
> Dear Praveen, 
> 
> this is actually a feature, and not a bug. The reason is that, by default, 
> deal.II generates triangulations with boundary id = 0. If you don’t specify a 
> boundary id in the gmsh file, then all boundary faces get boundary id = 0.
> 
> This allows us to save space in the output grid, since there is no need to 
> save faces with id = 0, because they will be recreated correctly when you 
> read the mesh back in.
> 
> Best,
> Luca.
 

ok. This is fine for deal.II but if I try to use this mesh with other tools, 
then it may not be ideal. Maybe an option to save id=0 faces also might be 
useful.

The other issue is that both inner sphere and part of the outer sphere are 
getting id=0. This makes it difficult to use the boundary id to set different 
boundary conditions on the inner and outer sphere.

The description says faces on outer sphere should get id=1 but that is not 
happening.

Best
praveen

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Saving boundary faces in half_hyper_shell to msh file

2018-11-18 Thread luca.heltai
Dear Praveen, 

this is actually a feature, and not a bug. The reason is that, by default, 
deal.II generates triangulations with boundary id = 0. If you don’t specify a 
boundary id in the gmsh file, then all boundary faces get boundary id = 0.

This allows us to save space in the output grid, since there is no need to save 
faces with id = 0, because they will be recreated correctly when you read the 
mesh back in.

Best,
Luca.

Ps: there is a new pull request https://github.com/dealii/dealii/pull/7427 that 
allows you to save both boundary ids and manifold ids using the vtk format 
instead of the msh format (that does not allow saving manifold id information 
on the file).

> On 18 Nov 2018, at 4:17, Praveen C  wrote:
> 
> Dear ll
> 
> I am using GridGenerator::half_hyper_shell and save the mesh in msh format. I 
> also want boundary faces to be saved. However not all boundary faces are 
> being saved. See attached figure.
> 
> There are two problems.
> 
> Some boundary faces have id = 0 which do not get saved to msh file.
> 
> -- 
> 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.
> For more options, visit https://groups.google.com/d/optout.
> 
> Both inner sphere and part of the outer sphere are getting same id of 0
> 
> You can first run attached code and see default behaviour. 
> 
> Then uncomment call to set_boundary_id function and run again which now saves 
> all boundary faces.
> 
> I changed boundary id 0 to 3 and also modified check to determine boundary 
> face. I am not sure this works for all cases though.
> 
> If this something that needs to be fixed in the library ?
> 
> Thanks
> praveen

-- 
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.
For more options, visit https://groups.google.com/d/optout.