[deal.II] trilinos sparse matrix creation problem

2019-10-28 Thread Pai Liu
Hi all, I need to manually create a trilinos sparse matrix (which a rectangular matrix here) and setup the entries of this matrix. When I do this with the following codes on one MPI rank: TrilinosWrappers::SparseMatrix T_mat( locally_owned_dofs_DG, locally_owned_dofs_NdRho, MPI_

Re: [deal.II] Re: Particle contact detection

2019-10-28 Thread Shahab Golshan
Very helpful. Thank you so much again. Best, Shahab -- 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"

Re: [deal.II] Re: optimization, SolverBFGS

2019-10-28 Thread Juan Carlos Araujo Cabarcas
Thanks for the help, now it is running nicely! On Monday, 28 October 2019 15:05:19 UTC+1, Bruno Turcksin wrote: > > There is a small bug in the lambda: > > Le lun. 28 oct. 2019 à 09:36, Juan Carlos Araujo Cabarcas > > a écrit : > > auto my_lambda = [&polar](Vector a, Vectorb) { > >

Re: [deal.II] Re: optimization, SolverBFGS

2019-10-28 Thread Bruno Turcksin
There is a small bug in the lambda: Le lun. 28 oct. 2019 à 09:36, Juan Carlos Araujo Cabarcas a écrit : > auto my_lambda = [&polar](Vector a, Vectorb) { > return polar.objective_fun(a,b); > }; //polar.Callback (a,b);}; You want the vector to be passed by reference not

Re: [deal.II] Re: optimization, SolverBFGS

2019-10-28 Thread Juan Carlos Araujo Cabarcas
Hi, thanks! that worked by using polar.objective_fun(a,b), instead of Callback. Now, it seems that SolverBFGS is not starting, and terminates in the first function call! However, the optimization should not be done since |grad x| is not small. This is what I do: Vector X (N), Dx (N);

Re: [deal.II] Re: optimization, SolverBFGS

2019-10-28 Thread Bruno Turcksin
Here is a simple example: https://wandbox.org/permlink/fbcldo9PIiHl6tfI In your case, try something like auto my_lambda = [&polar](Vector a, Vectorb) {return polar.Callback(a,b);}; opt.solve ( my_lambda, X ); Bruno Le lun. 28 oct. 2019 à 06:30, Juan Carlos Araujo Cabarcas a écrit : > > Thanks

[deal.II] Re: optimization, SolverBFGS

2019-10-28 Thread Juan Carlos Araujo Cabarcas
Thanks Bruno for your prompt reply, I got the important part of the code compiling, however since I am new to this lambda (functional) functions, I do not know how to pass the new definitions to SolverBFGS. Looking at your suggestion I do the following: class Shape_compute { public: