vecUnknown.cpp 3.21 KB
Newer Older
prudhomm's avatar
prudhomm committed
1
2
/*
  This file is part of the LifeV library
3
  Copyright (C) 2001,2002,2003,2004 EPFL, INRIA and Politechnico di Milano
prudhomm's avatar
prudhomm committed
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
  
  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License, or (at your option) any later version.
  
  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  Lesser General Public License for more details.
  
  You should have received a copy of the GNU Lesser General Public
  License along with this library; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
19
20
21
22
#include "vecUnknown.hpp"

//! the case of VectorBlock type
PhysVectUnknown<VectorBlock>::
prudhomm's avatar
prudhomm committed
23
PhysVectUnknown(UInt const Ndof):super(Ndof,nDimensions),_size(Ndof){}
24
25
26
27
28

  //! the case of VectorBlock type
GenericVecHdl<VectorBlock>::
GenericVecHdl(const ScalUnknown<VectorBlock> &RhScU1,
	      const ScalUnknown<VectorBlock> &RhScU2):
prudhomm's avatar
prudhomm committed
29
  super(RhScU1.size()+RhScU2.size()),_size(RhScU1.size()+RhScU2.size()),
30
31
32
  _nbcomp(RhScU1.nbcomp()+RhScU2.nbcomp())
{
  for (UInt i=0; i<RhScU1.size(); ++i)
prudhomm's avatar
prudhomm committed
33
    numBlock(i)= RhScU1.numBlock(i);
34
  for (UInt i=0; i<RhScU2.size(); ++i)
prudhomm's avatar
prudhomm committed
35
    numBlock(i+RhScU1.size())= RhScU2.numBlock(i);
36
37
38
39
40
41
}

//! the case of VectorBlock type
GenericVecHdl<VectorBlock>::
GenericVecHdl(const PhysVectUnknown<VectorBlock> &RhPhVU,
	      const ScalUnknown<VectorBlock> &RhScU):
prudhomm's avatar
prudhomm committed
42
  super(RhPhVU.size()+RhScU.size()),_size(RhPhVU.size()+RhScU.size()),
43
44
45
  _nbcomp(RhPhVU.nbcomp()+RhScU.nbcomp())
{
  for (UInt i=0; i<RhPhVU.size(); ++i)
prudhomm's avatar
prudhomm committed
46
    numBlock(i)=RhPhVU.numBlock(i);
47
  for (UInt i=0; i<RhScU.size(); ++i)
prudhomm's avatar
prudhomm committed
48
    numBlock(RhPhVU.size()+i)=RhScU.numBlock(i);
49
50
51
52
53
54
}

//! the case of VectorBlock type
GenericVecHdl<VectorBlock>::
GenericVecHdl(const ScalUnknown<VectorBlock> &RhScU,
	      const PhysVectUnknown<VectorBlock> &RhPhVU):
prudhomm's avatar
prudhomm committed
55
  super(RhPhVU.size()+RhScU.size()),_size(RhPhVU.size()+RhScU.size()),
56
57
58
  _nbcomp(RhPhVU.nbcomp()+RhScU.nbcomp())
{
  for (UInt i=0; i<RhScU.size(); ++i)
prudhomm's avatar
prudhomm committed
59
    numBlock(i)=RhScU.numBlock(i);
60
  for (UInt i=0; i<RhPhVU.size(); ++i)
prudhomm's avatar
prudhomm committed
61
    numBlock(RhScU.size()+i)=RhPhVU.numBlock(i);
62
63
64
65
66
67
}

//! the case of VectorBlock type
GenericVecHdl<VectorBlock>::
GenericVecHdl(const PhysVectUnknown<VectorBlock> &RhPhVU,
	      const GenericVecHdl<VectorBlock> &RhGenVec):
prudhomm's avatar
prudhomm committed
68
  super(RhPhVU.size()+RhGenVec.size()),
69
70
71
72
  _size(RhPhVU.size()+RhGenVec.size()),
  _nbcomp(RhPhVU.nbcomp()+RhGenVec.nbcomp())
{
  for (UInt i=0;i<RhPhVU.size();++i)
prudhomm's avatar
prudhomm committed
73
    numBlock(i)=RhPhVU.numBlock(i);
74
  for (UInt i=0;i<RhGenVec.size();++i)
prudhomm's avatar
prudhomm committed
75
    numBlock(RhPhVU.size()+i)=RhGenVec.numBlock(i);
76
77
78
79
80
}
//! the case of VectorBlock type
GenericVecHdl<VectorBlock>::
GenericVecHdl(const GenericVecHdl<VectorBlock> &RhGenVec,
	      const PhysVectUnknown<VectorBlock> &RhPhVU):
prudhomm's avatar
prudhomm committed
81
  super(RhPhVU.size()+RhGenVec.size()),
82
83
84
85
  _size(RhPhVU.size()+RhGenVec.size()),
  _nbcomp(RhPhVU.nbcomp()+RhGenVec.nbcomp())
{
  for (UInt i=0;i<RhGenVec.size();++i)
prudhomm's avatar
prudhomm committed
86
    numBlock(i)=RhGenVec.numBlock(i);
87
  for (UInt i=0;i<RhPhVU.size();++i)
prudhomm's avatar
prudhomm committed
88
    numBlock(i+RhGenVec.size())=RhPhVU.numBlock(i);
89
}