[Trilinos-Users] [EXTERNAL] How to implement matrix-free operation?

Baker, Christopher G. bakercg at ornl.gov
Tue Jul 17 09:10:17 MDT 2012


Chen-Liang, 

The solvers require a linear operator. This can be provided as one of a
few abstract interfaces. The most widely supported one is Epetra_Operator.

If you look at the documentation for Epetra_Operator here:
http://trilinos.sandia.gov/packages/docs/r10.10/packages/epetra/doc/html/cl
assEpetra__Operator.html

you will see that it is a C++ abstract base class. If you write a new
class, inherit from Epetra_Operator, and then fill out all of the pure
virtual methods (most importantly, apply()), then your class (that is,
your linear operator) can be used by the linear solvers.

For some examples of Epetra_Operator subclasses, look at the inheritance
tree for Epetra_Operator at the above page.

Chris


On 7/17/12 3:56 AM, "chenliang wang" <hi181904665 at msn.com> wrote:

>Thanks for your reply, you make me clear about the idea. But I am still
>confused with these interface. May I ask for a more sightly detailed
>instruction about progress or a complete tiny example?
>Many thanks!
>Best,
>Chen-Liang Wang
>
>On 07/17/2012 10:19 AM, Heroux, Michael A wrote:
>> All Trilinos solvers perform the matrix operator using a linear operator
>> interface.  If you are using Epetra, you can implement your own
>> matrix-free operation by providing an adapter for Epetra_Operator.  If
>>in
>> addition you want matrix coefficient access (needed if you want to use
>> Trilinos preconditioners), you can provide your own adapter for
>> Epetra_RowMatrix (although I would suggest starting with
>> Epetra_BasicRowMatrix).
>>
>> Mike
>>
>> On 7/16/12 9:09 PM, "chenliang wang" <hi181904665 at msn.com> wrote:
>>
>>> Hi,there
>>> Is it any possible to implement matrix-free operation to compute pcg or
>>> any other linear iterative solver? I know FLENS and MTL4 can do this,
>>> but we have already write full matrix version at cluster. And we want
>>>to
>>> transplant this code into pc . We still want to use trilinos . Thanks
>>>in
>>> advance.
>>>
>>>
>>> Best,
>>> Chen-Liang Wang
>>>
>>> _______________________________________________
>>> Trilinos-Users mailing list
>>> Trilinos-Users at software.sandia.gov
>>> http://software.sandia.gov/mailman/listinfo/trilinos-users
>>
>>
>>
>
>
>
>_______________________________________________
>Trilinos-Users mailing list
>Trilinos-Users at software.sandia.gov
>http://software.sandia.gov/mailman/listinfo/trilinos-users
>





More information about the Trilinos-Users mailing list