Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Stokhos_EpetraSparse3Tensor.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Stokhos Package
4 //
5 // Copyright 2009 NTESS and the Stokhos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef STOKHOS_EPETRA_SPARSE_3_TENSOR_HPP
11 #define STOKHOS_EPETRA_SPARSE_3_TENSOR_HPP
12 
13 #include "Teuchos_RCP.hpp"
17 #include "EpetraExt_MultiComm.h"
18 #include "Epetra_BlockMap.h"
19 #include "Epetra_CrsGraph.h"
20 
21 namespace Stokhos {
22 
24  public:
25 
31  int k_begin = 0, int k_end = -1);
32 
37  const Teuchos::RCP<const EpetraExt::MultiComm>& globalMultiComm,
40  int k_begin = 0, int k_end = -1);
41 
43  EpetraSparse3Tensor(const EpetraSparse3Tensor& epetraCijk,
44  int k_begin_ = 0, int k_end_ = -1);
45 
48 
50  void rebalance(Teuchos::ParameterList& isorropia_params);
51 
53  void transformToLocal();
54 
56  int getKBegin() const { return k_begin; }
57 
59  int getKEnd() const { return k_end; }
60 
62  bool isStochasticParallel() const { return is_parallel; }
63 
65  int GRID(int lrid) const { return stoch_row_map->GID(lrid); }
66 
68  int GCID(int lcid) const { return stoch_col_map->GID(lcid); }
69 
71  bool myGRID(int grid) const { return stoch_row_map->MyGID(grid); }
72 
74  bool myGCID(int gcid) const { return stoch_col_map->MyGID(gcid); }
75 
77  int numMyRows() const { return stoch_row_map->NumMyElements(); }
78 
80  int numMyCols() const { return stoch_col_map->NumMyElements(); }
81 
84  getMultiComm() const { return globalMultiComm; }
85 
88  getStochasticComm() const { return stoch_comm; }
89 
92  getStochasticRowMap() const { return stoch_row_map; }
93 
96  getStochasticColMap() const { return stoch_col_map; }
97 
100  getCijk() const { return Cijk; }
101 
104  getParallelCijk() const { return Cijk_parallel; }
105 
108  getStochasticGraph() const { return stoch_graph; }
109 
110  protected:
111 
113 
116 
117  protected:
118 
121 
124 
127 
130 
132  int k_begin;
133 
135  int k_end;
136 
139 
142 
145 
148 
151 
154 
155  }; // class EpetraSparse3Tensor
156 
157 } // namespace Stokhos
158 
159 #endif // STOKHOS_EPETRA_SPARSE_3_TENSOR_HPP
Teuchos::RCP< const Epetra_CrsGraph > stoch_graph
Stochastic operator graph.
int getKBegin() const
Return k_begin index.
int GRID(int lrid) const
Return global row id for given local row id.
Teuchos::RCP< const Epetra_BlockMap > getStochasticColMap() const
Get stochastic column map.
void transformToLocal()
Transform Cijk to local i and j indices.
Teuchos::RCP< const Epetra_CrsGraph > getStochasticGraph() const
Get stochastic graph.
int getKEnd() const
Return k_end index.
Teuchos::RCP< const Epetra_BlockMap > stoch_col_map
Stochastic col-map.
bool isStochasticParallel() const
Return whether stochastic blocks are parallel distributed.
EpetraSparse3Tensor(const Teuchos::RCP< const Stokhos::OrthogPolyBasis< int, double > > &basis, const Teuchos::RCP< const Stokhos::Sparse3Tensor< int, double > > &Cijk, const Teuchos::RCP< const EpetraExt::MultiComm > &globalMultiComm, int k_begin=0, int k_end=-1)
Constructor from a full Cijk.
int NumMyElements() const
Teuchos::RCP< const Epetra_BlockMap > getStochasticRowMap() const
Get stochastic row map.
int GID(int LID) const
Teuchos::RCP< const Stokhos::Sparse3Tensor< int, double > > getCijk() const
Get Cijk.
Teuchos::RCP< const Cijk_type > Cijk
Triple product.
Teuchos::RCP< const EpetraExt::MultiComm > globalMultiComm
Multi-comm.
Teuchos::RCP< const Cijk_type > Cijk_parallel
Cijk tensor parallel over i.
Teuchos::RCP< const EpetraExt::MultiComm > getMultiComm() const
Get global comm.
bool MyGID(int GID_in) const
bool myGCID(int gcid) const
Return true if global column id is on processor.
Teuchos::RCP< const Epetra_BlockMap > stoch_row_map
Stochastic row-map.
void rebalance(Teuchos::ParameterList &isorropia_params)
Rebalance maps and graph using Isorropia.
Teuchos::RCP< const Stokhos::Sparse3Tensor< int, double > > getParallelCijk() const
Get parallel Cijk.
Teuchos::RCP< const Stokhos::OrthogPolyBasis< int, double > > basis
Basis.
int numMyRows() const
Return number of rows on this processor.
Teuchos::RCP< const Epetra_Comm > getStochasticComm() const
Get stochastic comm.
Teuchos::RCP< const Epetra_Comm > stoch_comm
Stochastic comm.
bool myGRID(int grid) const
Return true if global row id is on processor.
Teuchos::RCP< Cijk_type > buildParallelCijk() const
Build parallel Cijk tensor from a parallel row map.
int num_global_stoch_blocks
Number of global stochastic blocks.
Stokhos::Sparse3Tensor< int, double > Cijk_type
int GCID(int lcid) const
Return global column id for given local column id.
int numMyCols() const
Return number of columns on this processor.
bool is_parallel
Whether stochastic blocks are parallel.