LifeV
MatrixBlockStructure.cpp
Go to the documentation of this file.
1 //@HEADER
2 /*
3 *******************************************************************************
4 
5  Copyright (C) 2004, 2005, 2007 EPFL, Politecnico di Milano, INRIA
6  Copyright (C) 2010 EPFL, Politecnico di Milano, Emory University
7 
8  This file is part of LifeV.
9 
10  LifeV is free software; you can redistribute it and/or modify
11  it under the terms of the GNU Lesser General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  LifeV is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public License
21  along with LifeV. If not, see <http://www.gnu.org/licenses/>.
22 
23 *******************************************************************************
24 */
25 //@HEADER
26 
27 /*!
28  @file
29  @brief Implementation file for MatrixBlockStructure
30 
31  @author Gwenol Grandperrin <gwenol.grandperrin@gmail.com>
32  @date 21-08-2012
33  */
34 
35 #include <lifev/core/array/MatrixBlockStructure.hpp>
36 
37 namespace LifeV
38 {
39 
40 // ===================================================
41 // Constructors & Destructor
42 // ===================================================
43 
46 {
47 
48 }
49 
51  const map_Type& columnMap )
53 {
54 
55 }
56 
59 {
60 
61 }
62 
64  const mapVector_Type& columnMapVector )
66 {
67 
68 }
69 
72 {
73 
74 }
75 
77  const VectorBlockStructure& columnsBlockStructure )
79 {
80 
81 }
82 
85 {
86 
87 }
88 
92 {
93 
94 }
95 
97 {
98 
99 }
100 
101 // ===================================================
102 // Set Methods
103 // ===================================================
104 
105 void
106 MatrixBlockStructure::setBlockStructure ( const std::vector<UInt>& blockNumRows,
107  const std::vector<UInt>& blockNumColumns )
108 {
109  M_rowsBlockStructure.setBlockStructure ( blockNumRows );
110  M_columnsBlockStructure.setBlockStructure ( blockNumColumns );
111 }
112 
113 void
114 MatrixBlockStructure::setBlockStructure ( const std::vector<UInt>& blocksSize )
115 {
116  M_rowsBlockStructure.setBlockStructure ( blocksSize );
117  M_columnsBlockStructure.setBlockStructure ( blocksSize );
118 }
119 
120 void
122  const MapVector<MapEpetra>& columnMapVector )
123 {
124  M_rowsBlockStructure.setBlockStructure ( rowMapVector );
125  M_columnsBlockStructure.setBlockStructure ( columnMapVector );
126 }
127 
128 void
130 {
131  M_rowsBlockStructure.setBlockStructure ( mapVector );
132  M_columnsBlockStructure.setBlockStructure ( mapVector );
133 }
134 
135 void
137 {
138  M_rowsBlockStructure.setBlockStructure ( blockStructure.M_rowsBlockStructure );
139  M_columnsBlockStructure.setBlockStructure ( blockStructure.M_columnsBlockStructure );
140 }
141 
142 void
144  const VectorBlockStructure& columnsBlockStructure )
145 {
146  M_rowsBlockStructure.setBlockStructure ( rowsBlockStructure );
147  M_columnsBlockStructure.setBlockStructure ( columnsBlockStructure );
148 }
149 
150 void
152 {
153  M_rowsBlockStructure.setBlockStructure ( vectorBlockStructure );
154  M_columnsBlockStructure.setBlockStructure ( vectorBlockStructure );
155 }
156 
157 // ===================================================
158 // Get Methods
159 // ===================================================
160 
161 UInt
162 MatrixBlockStructure::blockNumRows ( const UInt& rowIndex ) const
163 {
164  return M_rowsBlockStructure.blockSize ( rowIndex );
165 }
166 
167 UInt
168 MatrixBlockStructure::blockNumColumns ( const UInt& columnIndex ) const
169 {
170  return M_columnsBlockStructure.blockSize ( columnIndex );
171 }
172 
173 UInt
175 {
176  return M_rowsBlockStructure.blockFirstIndex ( index );
177 }
178 
179 UInt
181 {
182  return M_columnsBlockStructure.blockFirstIndex ( index );
183 }
184 
185 UInt
187 {
188  return M_rowsBlockStructure.numBlocks();
189 }
190 
191 UInt
193 {
194  return M_columnsBlockStructure.numBlocks();
195 }
196 
197 UInt
199 {
200  return M_rowsBlockStructure.totalSize();
201 }
202 
203 UInt
205 {
206  return M_columnsBlockStructure.totalSize();
207 }
208 
211 {
212  return M_rowsBlockStructure;
213 }
214 
217 {
218  return M_columnsBlockStructure;
219 }
220 
221 } // Namespace LifeV
void setBlockStructure(const VectorBlockStructure &vectorBlockStructure)
Set the block structure from row and column structures.
void setBlockStructure(const VectorBlockStructure &rowsBlockStructure, const VectorBlockStructure &columnsBlockStructure)
Set the block structure from row and column structures.
MatrixBlockStructure(const VectorBlockStructure &rowsBlockStructure, const VectorBlockStructure &columnsBlockStructure)
Construction with row and column structure.
void setBlockStructure(const MapVector< MapEpetra > &rowMapVector, const MapVector< MapEpetra > &columnMapVector)
VectorBlockStructure - class representing the structure of a vector.
MatrixBlockStructure(const map_Type &rowMap, const map_Type &columnMap)
Constructor with the monolithic maps.
UInt numColumns() const
Number of rows.
MatrixBlockStructure()
Default constructor.
MatrixBlockStructure(const map_Type &map)
Constructor with a unique monolithic map.
void updateInverseJacobian(const UInt &iQuadPt)
const VectorBlockStructure & columnsBlockStructure() const
Get the columns block structure.
UInt blockNumRows(const UInt &rowIndex) const
Returns the number of rows of the block.
void setBlockStructure(const std::vector< UInt > &blockNumRows, const std::vector< UInt > &blockNumColumns)
Epetra_Import const & importer()
Getter for the Epetra_Import.
Definition: MapEpetra.cpp:394
MapEpetra map_Type
Type of the map to be used.
MatrixBlockStructure - class representing the structure of a vector.
UInt numRows() const
Number of rows.
UInt numRowBlocks() const
Number of row blocks.
MatrixBlockStructure(const mapVector_Type &mapVector)
Construction with a map.
const VectorBlockStructure & rowsBlockStructure() const
Get the rows block structure.
void setBlockStructure(const MapVector< MapEpetra > &mapVector)
MatrixBlockStructure(const MatrixBlockStructure &blockStructure)
Copy constructor.
MatrixBlockStructure(const mapVector_Type &rowMapVector, const mapVector_Type &columnMapVector)
Construction with a map.
UInt numColumnBlocks() const
Number of column blocks.
UInt columnBlockFirstIndex(const UInt &index) const
This class is used to store maps that will be used for block defined problems.
Definition: MapVector.hpp:61
UInt blockNumColumns(const UInt &columnIndex) const
Returns the number of columns of the block.
MatrixBlockStructure(const VectorBlockStructure &vectorStructure)
Construction with vector structure.
void setBlockStructure(const std::vector< UInt > &blocksSize)
UInt rowBlockFirstIndex(const UInt &index) const
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191
MapVector< map_Type > mapVector_Type
Type of the MapVector to be used with this class.
void setBlockStructure(const MatrixBlockStructure &blockStructure)
Set the block structure from a matrix structure object.