LifeV
ETMatrixElemental.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 This file contains the implementation of the ETMatrixElemental class
30 
31  @author Samuel Quinodoz <samuel.quinodoz@epfl.ch>
32  @date 06 2011
33  */
34 
35 #include <lifev/eta/array/ETMatrixElemental.hpp>
36 
37 namespace LifeV
38 {
39 
40 // ===================================================
41 // Constructors & Destructor
42 // ===================================================
43 
45 ETMatrixElemental (const UInt& nbRow, const UInt& nbCol )
46  : M_rowIndices (nbRow, 0),
48  M_nbRow (nbRow),
49  M_nbColumn (nbCol),
50  M_rawData (new Real*[nbRow])
51 {
52  for (UInt iRow (0); iRow < nbRow; ++iRow)
53  {
54  M_rawData[iRow] = new Real[nbCol];
55  }
56 
57  zero();
58 }
59 
64  M_nbRow (mat.M_nbRow),
66  M_rawData ( new Real*[M_nbRow])
67 {
68  for (UInt iRow (0); iRow < M_nbRow; ++iRow)
69  {
70  M_rawData[iRow] = new Real[M_nbColumn];
71  for (UInt iCol (0); iCol < M_nbColumn; ++iCol)
72  {
73  M_rawData[iRow][iCol] = mat.M_rawData[iRow][iCol];
74  }
75  }
76 }
77 
80 {
81  for (UInt iRow (0); iRow < M_nbRow; ++iRow)
82  {
83  delete [] M_rawData[iRow];
84  }
85  delete [] M_rawData;
86 }
87 
88 // ===================================================
89 // Methods
90 // ===================================================
91 
92 void
94 showMe ( std::ostream& out ) const
95 {
96  out << " Local matrix : " << M_nbRow << " x " << M_nbColumn << std::endl;
97  for (UInt i (0); i < M_nbRow; ++i)
98  {
99  for (UInt j (0); j < M_nbColumn; ++j)
100  {
101  out << "[" << i << "][" << j << "] " << M_rawData[i][j] << " ";
102  };
103  out << std::endl;
104  }
105 }
106 
107 
108 } // Namespace LifeV
void updateInverseJacobian(const UInt &iQuadPt)
void showMe(std::ostream &out=std::cout) const
Ouput method for the sizes and the stored values.
void zero()
Put zero all the data stored.
virtual ~ETMatrixElemental()
Destructor.
ETMatrixElemental(const UInt &nbRow, const UInt &nbCol)
Constructor with the minimal interface: number of columns and of rows are provided.
double Real
Generic real data.
Definition: LifeV.hpp:175
ETMatrixElemental(const ETMatrixElemental &mat)
Copy constructor (including deep copy of the data)
class ETMatrixElemental A class for describing an elemental matrix
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191