/[escript]/branches/trilinos_from_5897/trilinoswrap/src/types.h
ViewVC logotype

Contents of /branches/trilinos_from_5897/trilinoswrap/src/types.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6104 - (show annotations)
Wed Mar 30 06:01:20 2016 UTC (3 years ago) by caltinay
File MIME type: text/plain
File size: 2301 byte(s)
Factored out and templetized preconditioner,solver and direct solver creation.
The SystemMatrix constructor now takes an optional arg 'isComplex'.
Some complex operations are commented out as we need the complex getSampleData*
methods from trunk for them to work.

It looks like we have to modify the Abstract class in escript eventually as
there is a single method that takes a `double` argument (nullifyRowsAndCols).


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 Open Software License version 3.0
9 * http://www.opensource.org/licenses/osl-3.0.php
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 __TRILINOSWRAP_TYPES_H__
18 #define __TRILINOSWRAP_TYPES_H__
19
20 #include <escript/DataTypes.h>
21
22 #include <Tpetra_CrsGraph.hpp>
23 #include <Tpetra_CrsMatrix.hpp>
24
25 namespace esys_trilinos {
26
27 /// Scalar types
28 typedef escript::DataTypes::real_t real_t;
29 typedef escript::DataTypes::cplx_t cplx_t;
30
31 /// Global Ordinal type
32 typedef escript::DataTypes::index_t GO;
33 /// Local Ordinal type
34 typedef escript::DataTypes::index_t LO;
35 /// Kokkos Node type
36 #ifdef _OPENMP
37 typedef Kokkos::Compat::KokkosOpenMPWrapperNode NT;
38 #elif USE_CUDA
39 typedef Kokkos::Compat::KokkosCudaWrapperNode NT;
40 #else
41 typedef Kokkos::Compat::KokkosSerialWrapperNode NT;
42 #endif
43
44 typedef Tpetra::CrsGraph<LO,GO,NT> GraphType;
45 typedef Tpetra::Import<LO,GO,NT> ImportType;
46 typedef Teuchos::RCP<GraphType> TrilinosGraph_ptr;
47 typedef Teuchos::RCP<const GraphType> const_TrilinosGraph_ptr;
48 typedef GraphType::map_type MapType;
49 typedef Teuchos::RCP<MapType> TrilinosMap_ptr;
50 typedef Teuchos::RCP<const MapType> const_TrilinosMap_ptr;
51
52 template<typename ST> using MatrixType = Tpetra::CrsMatrix<ST,LO,GO,NT>;
53 template<typename ST> using VectorType = Tpetra::MultiVector<ST,LO,GO,NT>;
54 template<typename ST> using OpType = Tpetra::Operator<ST,LO,GO,NT>;
55
56 typedef VectorType<real_t> RealVector;
57 typedef MatrixType<real_t> RealMatrix;
58 typedef OpType<real_t> RealOperator;
59
60 typedef VectorType<cplx_t> ComplexVector;
61 typedef MatrixType<cplx_t> ComplexMatrix;
62 typedef OpType<cplx_t> ComplexOperator;
63
64 inline
65 Teuchos::RCP<const Teuchos::Comm<int> > TeuchosCommFromEsysComm(MPI_Comm comm)
66 {
67 return Teuchos::rcp(new Teuchos::MpiComm<int>(comm));
68 }
69
70 } // namespace esys_trilinos
71
72 #endif // __TRILINOSWRAP_TYPES_H__

  ViewVC Help
Powered by ViewVC 1.1.26