/[escript]/trunk/trilinoswrap/src/BlockCrsMatrixWrapper.h
ViewVC logotype

Contents of /trunk/trilinoswrap/src/BlockCrsMatrixWrapper.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6188 - (show annotations)
Wed Apr 27 03:38:10 2016 UTC (2 years, 7 months ago) by caltinay
File MIME type: text/plain
File size: 2182 byte(s)
silence trilinos matrix constructors and remove unneeded code as the devs
confirmed we don't need resumeFill/fillComplete for block matrices.

1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2016 by The University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Apache License, version 2.0
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development 2012-2013 by School of Earth Sciences
13 * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 *
15 *****************************************************************************/
16
17 #ifndef __ESYS_TRILINOS_BLOCKCRSMATRIXWRAPPER_H__
18 #define __ESYS_TRILINOS_BLOCKCRSMATRIXWRAPPER_H__
19
20 #include <trilinoswrap/AbstractMatrixWrapper.h>
21
22 #include <Tpetra_Experimental_BlockCrsMatrix.hpp>
23
24 namespace esys_trilinos {
25
26 template<typename ST>
27 class BlockCrsMatrixWrapper : public AbstractMatrixWrapper<ST>
28 {
29 typedef Tpetra::Experimental::BlockCrsMatrix<ST,LO,GO,NT> Matrix;
30
31 public:
32 /**
33 \brief
34 Creates a new Trilinos Block CRS matrix wrapper using a compatible
35 fill-complete Trilinos matrix graph and given block size.
36 */
37 BlockCrsMatrixWrapper(const_TrilinosGraph_ptr graph, int blocksize);
38
39 void resetValues();
40
41 /// notifies the matrix that changes are about to happen.
42 inline void resumeFill() {}
43
44 /// notifies the matrix that a set of changes has occured.
45 inline void fillComplete(bool /*localOnly*/) {}
46
47 void nullifyRowsAndCols(const Teuchos::ArrayView<const ST>& rowMask,
48 const Teuchos::ArrayView<const ST>& colView,
49 ST mdv);
50
51 void add(const std::vector<LO>& rowIndex, const std::vector<ST>& array);
52
53 void ypAx(const Teuchos::ArrayView<ST>& y,
54 const Teuchos::ArrayView<const ST>& x) const;
55
56 void solve(const Teuchos::ArrayView<ST>& x,
57 const Teuchos::ArrayView<const ST>& b,
58 escript::SolverBuddy& sb) const;
59
60 void saveMM(const std::string& filename) const;
61
62 private:
63 int blockSize;
64 Matrix mat;
65 MapType colPointMap;
66 };
67
68 } // namespace esys_trilinos
69
70 #endif // __ESYS_TRILINOS_BLOCKCRSMATRIXWRAPPER_H__
71

  ViewVC Help
Powered by ViewVC 1.1.26