LifeV
VectorElemental.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 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 #include <lifev/core/array/VectorElemental.hpp>
37 
38 namespace LifeV
39 {
40 
41 VectorElemental::VectorElemental ( int nNode1, int nbr1 ) :
42  super ( nNode1* nbr1 )
43 {
44  _nBlockRow = nbr1;
45  _nRow.resize ( _nBlockRow );
46  _firstRow.resize ( _nBlockRow );
47  int first = 0, n;
48  for ( n = 0; n < nbr1; n++ )
49  {
50  _nRow[ n ] = nNode1;
51  _firstRow[ n ] = first;
52  first += nNode1;
53  }
54 }
55 
56 VectorElemental::VectorElemental ( int nNode1, int nbr1,
57  int nNode2, int nbr2 ) :
58  super ( nNode1 * nbr1 + nNode2* nbr2 )
59 {
60  _nBlockRow = nbr1 + nbr2;
61  _nRow.resize ( _nBlockRow );
62  _firstRow.resize ( _nBlockRow );
63  int first = 0, n;
64  for ( n = 0; n < nbr1; n++ )
65  {
66  _nRow[ n ] = nNode1;
67  _firstRow[ n ] = first;
68  first += nNode1;
69  }
70  for ( n = nbr1; n < nbr1 + nbr2; n++ )
71  {
72  _nRow[ n ] = nNode2;
73  _firstRow[ n ] = first;
74  first += nNode2;
75  }
76 }
77 
78 VectorElemental::VectorElemental ( int nNode1, int nbr1,
79  int nNode2, int nbr2,
80  int nNode3, int nbr3 ) :
81  super ( nNode1 * nbr1 + nNode2 * nbr2 + nNode3* nbr3 )
82 {
83  _nBlockRow = nbr1 + nbr2 + nbr3;
84  _nRow.resize ( _nBlockRow );
85  _firstRow.resize ( _nBlockRow );
86  int first = 0, n;
87  for ( n = 0; n < nbr1; n++ )
88  {
89  _nRow[ n ] = nNode1;
90  _firstRow[ n ] = first;
91  first += nNode1;
92  }
93  for ( n = nbr1; n < nbr1 + nbr2; n++ )
94  {
95  _nRow[ n ] = nNode2;
96  _firstRow[ n ] = first;
97  first += nNode2;
98  }
99  for ( n = nbr1 + nbr2; n < nbr1 + nbr2 + nbr3; n++ )
100  {
101  _nRow[ n ] = nNode3;
102  _firstRow[ n ] = first;
103  first += nNode3;
104  }
105 }
106 
107 
108 void VectorElemental::showMe ( std::ostream& c )
109 {
110  for ( int i = 0; i < _nBlockRow; i++ )
111  {
112  c << "Block (" << i << "), " << block ( i ) << std::endl;
113  }
114 }
115 }
VectorElemental(int nNode1, int nbr1, int nNode2, int nbr2, int nNode3, int nbr3)
VectorElemental(int nNode1, int nbr1)
void updateInverseJacobian(const UInt &iQuadPt)
VectorElemental(int nNode1, int nbr1, int nNode2, int nbr2)
void showMe(std::ostream &c=std::cout)