Re: [deal.II] Re: Read serial vector into a parallel vector
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.
[deal.II] Re: Reuse factorization in Trilinos direct solver
FYI, the doxygen field was wrong for the extra solve() function, thus it was not shown. Should be fixed in https://github.com/dealii/dealii/pull/2694 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: Reuse factorization in Trilinos direct solver
Hi Praven, I don't think you need to hack anything, this is AFAIK already possible, see https://github.com/dealii/dealii/pull/2493 You need to compile deal.II from Git to get this. Regards, Denis. 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.
Re: [deal.II] WorkStream iterator
So glad I asked this question instead of reinventing the wheel :) I was mostly working off the Boussinesq and elasticity examples, so I missed step-35. On Sunday, June 19, 2016 at 3:18:33 PM UTC-7, bangerth wrote: > > On 06/19/2016 04:12 PM, Daniel Shapero wrote: > > I'm working on a problem which involves iterating over the DoFHandlers > of both > > a scalar and a vector field at the same time, similar to step 31 > > < > https://urldefense.proofpoint.com/v2/url?u=https-3A__dealii.org_developer_doxygen_deal.II_step-5F31.html-23BoussinesqFlowProblemassemble-5Fstokes-5Fsystem&d=AwMFaQ&c=ODFT-G5SujMiGrKuoJJjVg&r=bn1clvQAiDQrfAC4yKbN0PlSr7RWRs-U3WJ0zRBB2qM&m=LKWtqGDlr1IIKNzL19q-BeEv113uSM-htWgg0-mfxtg&s=ZhkrkZJVtq3qsxTuL_dfYkgGkRnWYG_k859WMeIjWYQ&e=>. > > > > I'm creating an iterator class which will wrap up the iterators for both > the > > scalar and vector field into one object using a std::array of > > active_cell_iterators. The increment operator is implemented by > incrementing > > each active_cell_iterator in the array; the dereference operator returns > a > > reference to the array; etc. I've tested this out and it works fine. > > > > I'd like to be able to parallelize the assembly using WorkStream, which > uses > > an iterator range. What operations are required of the iterators passed > to > > WorkStream? From the comments in the source code, it looks like the > iterator > > must have operator- defined, so I take it that it must be a > random-access > > iterator > > < > https://urldefense.proofpoint.com/v2/url?u=http-3A__en.cppreference.com_w_cpp_concept_RandomAccessIterator&d=AwMFaQ&c=ODFT-G5SujMiGrKuoJJjVg&r=bn1clvQAiDQrfAC4yKbN0PlSr7RWRs-U3WJ0zRBB2qM&m=LKWtqGDlr1IIKNzL19q-BeEv113uSM-htWgg0-mfxtg&s=vlOxQjDUZgqn4d-Y5UwVkuANFbQJHZSsP3ooIzECGyc&e=>. > > > > The simple multi-iterator implementation I have now is only a forward > > iterator, since that was the bare minimum needed to get things working > in > > single-threaded mode. > > Daniel, > you are looking for the SynchronousIterator class :-) > > Cheers > W. > > -- > > Wolfgang Bangerth email:bang...@math.tamu.edu > > www: http://www.math.tamu.edu/~bangerth/ > > -- 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
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.
Re: [deal.II] Re: Reuse factorization in Trilinos direct solver
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 < dealii@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+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: Read serial vector into a parallel vector
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 ? If not, what other option do I have to achieve this result. Thanks praveen On Mon, Jun 20, 2016 at 7:45 PM, Daniel Arndt < d.ar...@math.uni-goettingen.de> wrote: > 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. > -- 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
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
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
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.
[deal.II] Reuse factorization in Trilinos direct solver
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.