Debian Codegraph @

packages/shylu/shylu_dd/frosch/src/SolverInterfaces/FROSch_Solver_def.hpp

raw
1 // @HEADER
2 // *****************************************************************************
3 // ShyLU: Scalable Hybrid LU Preconditioner and Solver
4 //
5 // Copyright 2011 NTESS and the ShyLU contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9
10 #ifndef _FROSCH_SOLVER_DEF_HPP
11 #define _FROSCH_SOLVER_DEF_HPP
12
13 #include <FROSch_Solver_decl.hpp>
14
15
16 namespace FROSch {
17
18 using namespace Teuchos;
19 using namespace Xpetra;
20
21 template<class SC,class LO,class GO,class NO>
22 const typename Solver<SC,LO,GO,NO>::ConstXMapPtr Solver<SC,LO,GO,NO>::getDomainMap() const
23 {
24 return K_->getDomainMap();
25 }
26
27 template<class SC,class LO,class GO,class NO>
28 const typename Solver<SC,LO,GO,NO>::ConstXMapPtr Solver<SC,LO,GO,NO>::getRangeMap() const
29 {
30 return K_->getRangeMap();
31 }
32
33 template<class SC,class LO,class GO,class NO>
34 bool Solver<SC,LO,GO,NO>::isInitialized() const
35 {
36 return IsInitialized_;
37 }
38
39 template<class SC,class LO,class GO,class NO>
40 bool Solver<SC,LO,GO,NO>::isComputed() const
41 {
42 return IsComputed_;
43 }
44
45 template<class SC,class LO,class GO,class NO>
46 void Solver<SC,LO,GO,NO>::residual(const XMultiVector & x,
47 const XMultiVector & b,
48 XMultiVector& r) const
49 {
50 apply(x,r);
51 r.update(ScalarTraits<SC>::one(),b,-ScalarTraits<SC>::one());
52 }
53
54 template<class SC,class LO,class GO,class NO>
55 Solver<SC,LO,GO,NO>::Solver(ConstXMatrixPtr k,
56 ParameterListPtr parameterList,
57 string description) :
58 K_ (k),
59 ParameterList_ (parameterList),
60 Description_ (description)
61 {}
62
63 }
64
65 #endif