LifeV
MonolithicBlockMatrixRN.cpp
Go to the documentation of this file.
1 /* -*- mode: c++ -*- */
2 //@HEADER
3 /*
4 *******************************************************************************
5 
6  Copyright (C) 2004, 2005, 2007 EPFL, Politecnico di Milano, INRIA
7  Copyright (C) 2010 EPFL, Politecnico di Milano, Emory University
8 
9  This file is part of LifeV.
10 
11  LifeV is free software; you can redistribute it and/or modify
12  it under the terms of the GNU Lesser General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  LifeV is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  Lesser General Public License for more details.
20 
21  You should have received a copy of the GNU Lesser General Public License
22  along with LifeV. If not, see <http://www.gnu.org/licenses/>.
23 
24 *******************************************************************************
25 */
26 //@HEADER
27 
28 #include <EpetraExt_MatrixMatrix.h>
29 
30 #include <lifev/fsi/solver/MonolithicBlockMatrixRN.hpp>
31 
32 namespace LifeV
33 {
34 
35 
36 // ===================================================
37 //! Public Methods
38 // ===================================================
39 
40 
41 void MonolithicBlockMatrixRN::setDataFromGetPot ( const GetPot& data, const std::string& section )
42 {
43  super_Type::setDataFromGetPot (data, section);
44  setRobinData (data, section + "/robin");
45 }
46 
47 void MonolithicBlockMatrixRN::coupler (mapPtr_Type& map,
48  const std::map<ID, ID>& locDofMap,
49  const vectorPtr_Type& numerationInterface,
50  const Real& timeStep,
51  const Real& coefficient,
52  const Real& rescaleFactor,
53  UInt couplingFlag
54  )
55 {
56  super_Type::coupler ( map, locDofMap, numerationInterface, timeStep , coefficient, rescaleFactor, couplingFlag);
57 }
58 
59 void MonolithicBlockMatrixRN::coupler (mapPtr_Type& map,
60  const std::map<ID, ID>& locDofMap,
61  const vectorPtr_Type& numerationInterface,
62  const Real& timeStep,
63  const Real& coefficient,
64  const Real& rescaleFactor)
65 {
66  super_Type::coupler (map, locDofMap, numerationInterface, timeStep, coefficient, rescaleFactor);
67  M_robinCoupling.reset (new matrix_Type (M_coupling->map(), 0) );
68  robinCoupling ( M_robinCoupling, M_alphaf, M_alphas, 7, M_FESpace[1], M_offset[1], M_FESpace[0], M_offset[0], locDofMap, numerationInterface );
69  M_robinCoupling->globalAssemble( );
70  // M_robinCoupling->spy("RC");
71 }
72 
73 void MonolithicBlockMatrixRN::GlobalAssemble()
74 {
75  super_Type::GlobalAssemble();
76  vector_Type rhs ( (*M_robinCoupling) * (*M_rhsVec) );
77  *M_rhsVec += rhs;
78 }
79 
80 void MonolithicBlockMatrixRN::blockAssembling()
81 {
82  M_coupling->globalAssemble();
83  M_globalMatrix.reset (new matrix_Type (M_coupling->map() ) );
84  *M_globalMatrix += *M_coupling;
85  for (UInt k = 0; k < super_Type::M_blocks.size(); ++k)
86  {
87  super_Type::M_blocks[k]->globalAssemble();
88  }
89 
90  applyRobinCoupling (M_blocks);
91  M_robinPart->globalAssemble();
92 
93  matrixPtr_Type fluidRobinBlock (new matrix_Type (M_robinCoupling->map(), 1) );
94  *fluidRobinBlock += *M_blocks[1];
95  *fluidRobinBlock += *M_robinPart;
96  fluidRobinBlock->globalAssemble();
97  M_blocks[1]->swapCrsMatrix ( fluidRobinBlock->matrixPtr() );
98 
99  for (UInt k = 0; k < M_blocks.size(); ++k)
100  {
101  *M_globalMatrix += *M_blocks[k];
102  }
103 }
104 
105 } // Namespace LifeV
void updateInverseJacobian(const UInt &iQuadPt)
double Real
Generic real data.
Definition: LifeV.hpp:175
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191