LifeV
VectorElemental.hpp
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 Vector for elementary assembly
30 
31  @contributor Matteo Astorino <matteo.astorino@epfl.ch>
32  @mantainer Matteo Astorino <matteo.astorino@epfl.ch>
33 
34  */
35 
36 #ifndef ELEMVEC_H
37 #define ELEMVEC_H
38 
39 #include <iomanip>
40 
41 #include <lifev/core/LifeV.hpp>
42 #include <lifev/core/array/RNM.hpp>
43 
44 namespace LifeV
45 {
47  :
48 public KN<Real>
49  //public Tab1d
50 {
51 public:
52  //typedef Tab1d super;
53  typedef KN<Real> super;
54  typedef KN_<Real> vector_view;
55 
56 
57  VectorElemental ( int nNode1, int nbr1 );
58  VectorElemental ( int nNode1, int nbr1,
59  int nNode2, int nbr2 );
60  VectorElemental ( int nNode1, int nbr1,
61  int nNode2, int nbr2,
62  int nNode3, int nbr3 );
63 
64  VectorElemental& operator= ( super const& __v )
65  {
66  if ( this == &__v )
67  {
68  return * this;
69  }
70  super::operator= ( ( super const& ) __v );
71  return *this;
72  }
73 
75  {
76  return * this;
77  };
78  const super& vec() const
79  {
80  return * this;
81  };
82  int nBlockRow() const
83  {
84  return _nBlockRow;
85  }
86  //Tab1dView block( int i )
87  vector_view block ( int i )
88  {
89  return ( *this ) ( SubArray ( _nRow[ i ], _firstRow[ i ] ) );
90  //return Tab1dView( *this, TabRange( _firstRow[i], _nRow[ i ] ) );
91  }
92  // inline void zero(){_vec=Tab1d(_nBlockRow*_vec.N(),0.0);};
93  void zero()
94  {
95  //( *this ) = ZeroVector( this->size() );
96  super& __super = ( super& ) * this;
97  __super = super ( this->N(), 0.0 );
98  }
99  void showMe ( std::ostream& c = std::cout );
100 private:
101  int _nBlockRow; // number of block rows
102  std::vector<int> _nRow; // _nRow[i]=nb of rows in the i-th block row
103  std::vector<int> _firstRow; //_firstRow[i]=index of first row of i-th block row
104 
105 };
106 }
107 
108 
109 #endif
vector_view block(int i)
VectorElemental(int nNode1, int nbr1, int nNode2, int nbr2, int nNode3, int nbr3)
VectorElemental & operator=(super const &__v)
VectorElemental(int nNode1, int nbr1)
void updateInverseJacobian(const UInt &iQuadPt)
std::vector< int > _nRow
std::vector< int > _firstRow
double Real
Generic real data.
Definition: LifeV.hpp:175
VectorElemental(int nNode1, int nbr1, int nNode2, int nbr2)
void showMe(std::ostream &c=std::cout)
const super & vec() const