[Trilinos-Users] How to create a new operator from Belos:Operator

Wu, Hui wu40 at llnl.gov
Thu Mar 29 12:39:37 EDT 2018


I am trying to solve a problem Ax = b using Belos::BlockCGSolMgr where A is a dense matrix and I don't want to calculate and store A. Therefore I cannot use Epetra_Operator as OP in Belos::LinearProblem<ScalarType, MV, OP>. I need to create a new operator to do Ax. I considered the example mentioned here: https://github.com/trilinos/Trilinos/blob/master/packages/belos/test/MVOPTester/MyBetterOperator.hpp


In the new operator, I write a function Apply to do Ax.


However, the following compiling error shows up:


BelosOperatorTraits.hpp(71): error: class "Belos::Operator<double>" has no member "this_type_is_missing_a_specialization"
        OP::this_type_is_missing_a_specialization();
            ^
          detected during:
            instantiation of "void Belos::UndefinedOperatorTraits<ScalarType, MV, OP>::notDefined() [with ScalarType=double, MV=Epetra_MultiVector, OP=Belos::Operator<double>]" at line 131
            instantiation of "void Belos::OperatorTraits<ScalarType, MV, OP>::Apply(const OP &, const MV &, MV &, Belos::ETrans) [with ScalarType=double, MV=Epetra_MultiVector, OP=Belos::Operator<double>]" at line 1130 of "BelosLinearProblem.hpp"
            instantiation of "void Belos::LinearProblem<ScalarType, MV, OP>::computeCurrResVec(MV *, const MV *, const MV *) const [with ScalarType=double, MV=Epetra_MultiVector, OP=Belos::Operator<double>]" at line 867 of "BelosLinearProblem.hpp"
            instantiation of "bool Belos::LinearProblem<ScalarType, MV, OP>::setProblem(const Teuchos::RCP<MV> &, const Teuchos::RCP<const MV> &) [with ScalarType=double, MV=Epetra_MultiVector, OP=Belos::Operator<double>]"


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://trilinos.org/pipermail/trilinos-users/attachments/20180329/25b65429/attachment.html>


More information about the Trilinos-Users mailing list