Re: [deal.II] Re: Read serial vector into a parallel vector

2016-06-20 Thread Daniel Arndt
Praveen,

Am Montag, 20. Juni 2016 18:05:12 UTC+2 schrieb Praveen C:
>
> Hello Daniel
>
> I have a normal Triangulation and I solve on this using a Vector. 
> I could save this to file calling Vector::print.
>
> Is it now possible to read this into a TrilinosWrappers::MPI::Vector ?
>
No, there is no such function. A Vector does only make sense in connection 
with a DoFHandler.
Therefore the question is what you want to achieve in the first place.
If you want to write a TrilinosWrappers::Vector to a file and initialize a 
TrilinosWrappers::MPI::Vector with it aftwerwards,
why don't you use a TrilinosWrappers::MPI::Vector from the beginning?

Something you can also try is to associate the DoFs in the serial vector 
with the ones in the parallel vector (e.g. by support_points and component) 
and assign
the values accordingly.
Note that there is also the possibility to initialize a (parallel) 
TrilinosWrappers::MPI::Vector from a (serial) TrilinosWrappers::Vector 
directly [1].

Best,
Daniel

[1] 
https://dealii.org/8.4.1/doxygen/deal.II/classTrilinosWrappers_1_1MPI_1_1Vector.html#a814279778da76eb9a17eedce154a61f7

-- 
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: Reuse factorization in Trilinos direct solver

2016-06-20 Thread 'Uwe Köcher' via deal . II User Group
Here you can find some class, which I'm using for that:

https://github.com/koecher/meat/blob/master/source/DTM%2B%2B/core/lss/SolverAmesos.cc

Best
  Uwe

On Monday, June 20, 2016 at 6:22:40 PM UTC+2, Praveen C wrote:
>
> Thanks Uwe. I will try that.
>
> Best
> praveen
>
> On Mon, Jun 20, 2016 at 7:54 PM, 'Uwe Köcher' via deal.II User Group <
> dea...@googlegroups.com > wrote:
>
>> No, this interface uses a solve function, in which the algebraic and 
>> numeric factorisation is done each time the solve() function
>> is called. This has something to do with the common interface for the 
>> direct and iterative solvers.
>> But it is easy to implement yourself, take a look into 
>> lac/trilinos_sovler.h and lac/trilinos_solver.cc to see how the Amesos 
>> package is
>> called.
>>
>> Best
>>   Uwe
>>
>>
>> On Monday, June 20, 2016 at 3:48:56 PM UTC+2, Praveen C wrote:
>>>
>>> Hi
>>>
>>> I want to use the direct solver MUMPS via Trilinos. I need to solve the 
>>> same matrix problem repeatedly. How can I reuse the LU factorization ?
>>>
>>> In SparseDirectUMFPACK, calling vmult allows me to solve many problems 
>>> with same factorization.
>>>
>>> Is such a thing possible with TrilinosWrappers::SolverDirect ?
>>>
>>> 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+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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[deal.II] Re: Reuse factorization in Trilinos direct solver

2016-06-20 Thread 'Uwe Köcher' via deal . II User Group
No, this interface uses a solve function, in which the algebraic and 
numeric factorisation is done each time the solve() function
is called. This has something to do with the common interface for the 
direct and iterative solvers.
But it is easy to implement yourself, take a look into 
lac/trilinos_sovler.h and lac/trilinos_solver.cc to see how the Amesos 
package is
called.

Best
  Uwe

On Monday, June 20, 2016 at 3:48:56 PM UTC+2, Praveen C wrote:
>
> Hi
>
> I want to use the direct solver MUMPS via Trilinos. I need to solve the 
> same matrix problem repeatedly. How can I reuse the LU factorization ?
>
> In SparseDirectUMFPACK, calling vmult allows me to solve many problems 
> with same factorization.
>
> Is such a thing possible with TrilinosWrappers::SolverDirect ?
>
> 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.


[deal.II] Re: Read serial vector into a parallel vector

2016-06-20 Thread Daniel Arndt
Praveen,

I solve a PDE in serial and save the solution to file.
>
Do you mean that your triangulation is not a 
parallel::distributed::Triangulation or that you are simply running with 
one process?
 

> Is there a way to now read this solution into a 
> TrilinosWrappers::MPI::Vector object ?
>
If you already save the solution from a TrilinosWrappers::MPI::Vector 
object, then parallel::distributed::SolutionTransfer should work for you as 
well.
Note that you are allowed to choose the number of processes when reading 
different from the number of processes you used for writing.
If your original vector is not a TrilinosWrappers::MPI::Vector object, how 
did you write the vector to a file?

Best,
Daniel

-- 
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.


[deal.II] Read serial vector into a parallel vector

2016-06-20 Thread Praveen C
Hello

I solve a PDE in serial and save the solution to file.

Is there a way to now read this solution into a
TrilinosWrappers::MPI::Vector object ?

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.