Re: [deal.II] Create a LinearOperator with a function instead of a matrix

2019-07-19 Thread Wolfgang Bangerth
> Would that work together with the GMG-preconditioner? You mean you want to use the linear operator as a smoother for the GMG? Or where in the GMG do you want to use it? > Will test it there as > soon as my problem in my second question could be solved. > There I have the following code: > |

Re: [deal.II] Create a LinearOperator with a function instead of a matrix

2019-07-19 Thread 'Maxi Miller' via deal.II User Group
Would that work together with the GMG-preconditioner? Will test it there as soon as my problem in my second question could be solved. There I have the following code: SolverControlcoarse_solver_control(1000, 1e-10, false, false); SolverGMRES

Re: [deal.II] Create a LinearOperator with a function instead of a matrix

2019-07-19 Thread Wolfgang Bangerth
On 7/19/19 9:47 AM, 'Maxi Miller' via deal.II User Group wrote: > What I did was the replacement of system_matrix with a function, providing a > vmult()-function. Now I would like to add a preconditioner based on that > function to reduce the necessary GMRES-iterations. But until now most of the

Re: [deal.II] Create a LinearOperator with a function instead of a matrix

2019-07-19 Thread 'Maxi Miller' via deal.II User Group
What I did was the replacement of system_matrix with a function, providing a vmult()-function. Now I would like to add a preconditioner based on that function to reduce the necessary GMRES-iterations. But until now most of the preconditioners require a matrix for initialization. Thus I wanted

Re: [deal.II] Create a LinearOperator with a function instead of a matrix

2019-07-19 Thread Wolfgang Bangerth
On 7/19/19 9:34 AM, 'Maxi Miller' via deal.II User Group wrote: > I.e. (based on step-37) I can write something like > | > LinearOperator jacobian_operator; > //vmult-operation is added later > > using SystemMatrixType = jacobian_operator; > SystemMatrixType system_matrix; > | > > and follow the

Re: [deal.II] Create a LinearOperator with a function instead of a matrix

2019-07-19 Thread 'Maxi Miller' via deal.II User Group
I.e. (based on step-37) I can write something like LinearOperator jacobian_operator; //vmult-operation is added later using SystemMatrixType = jacobian_operator; SystemMatrixType system_matrix; and follow the example accordingly? Am Freitag, 19. Juli 2019 17:26:31 UTC+2 schrieb Wolfgang

Re: [deal.II] Create a LinearOperator with a function instead of a matrix

2019-07-19 Thread Wolfgang Bangerth
On 7/19/19 9:18 AM, 'Maxi Miller' via deal.II User Group wrote: > Is it then possible to use this LinearOperator in a preconditioner? The code > works without one (i.e. PreconditionIdentity()), but the Iterations are > increasing quite fast, thus negating all speedup gained from the >

Re: [deal.II] Create a LinearOperator with a function instead of a matrix

2019-07-19 Thread 'Maxi Miller' via deal.II User Group
Is it then possible to use this LinearOperator in a preconditioner? The code works without one (i.e. PreconditionIdentity()), but the Iterations are increasing quite fast, thus negating all speedup gained from the LinearOperator. I tried to find something in the examples, but only found data

Re: [deal.II] Create a LinearOperator with a function instead of a matrix

2019-07-16 Thread Matthias Maier
A short comment: On Tue, Jul 16, 2019, at 11:18 CDT, Matthias Maier wrote: > struct LeftVector { > }; > struct RightVector { > }; These two classes are of course just decoration (showing the minimal interface a vector has to possess). There is usually no need to define custom Vector clases.

Re: [deal.II] Create a LinearOperator with a function instead of a matrix

2019-07-16 Thread Matthias Maier
Hi, the following example (which is a simplified version of test lac/linear_operator_01) should get you started. In short: Simply create an empty LinearOperator object (with the appropriate template parameters) and populate the corresponding std::function objects. Best, Matthias #include

[deal.II] Create a LinearOperator with a function instead of a matrix

2019-07-16 Thread 'Maxi Miller' via deal.II User Group
I tried to follow the examples for setting up a LinearOperator (such as shown in Step-22 and Step-20), but instead of a matrix I wanted to provide my own function which should serve as vmult-function (i.e. a matrix-free linear operator). Is that possible? My initial test was the following code: