LifeV
MonolithicBlockComposedDNND.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 #include <lifev/core/LifeV.hpp>
28 
29 #include <lifev/fsi/solver/MonolithicBlockComposedDNND.hpp>
30 
31 namespace LifeV
32 {
33 
34 
35 // ===================================================
36 //! Public Methods
37 // ===================================================
38 
39 void MonolithicBlockComposedDNND::coupler (mapPtr_Type& map,
40  const std::map<ID, ID>& locDofMap,
41  const vectorPtr_Type& numerationInterface,
42  const Real& timeStep,
43  const Real& coefficient,
44  const Real& rescaleFactor)
45 {
46  UInt totalDofs = map->map (Unique)->NumGlobalElements();
47  UInt fluidSolid = M_offset[0] + M_FESpace[0]->map().map (Unique)->NumGlobalElements();
48 
49  for (ID k = 0; k < 2; ++k)
50  {
51  M_blocks[k]->globalAssemble();
52  matrixPtr_Type block (new matrix_Type (*M_blocks[k]) );
53  M_blocks.push_back (block);
54  M_bch.push_back (M_bch[k]);
55  M_FESpace.push_back (M_FESpace[k]);
56  M_offset.push_back (M_offset[k]);
57  M_recompute[2 + k] = (M_recompute[k]);
58  M_blockReordering->push_back ( (*M_blockReordering) [k]);
59  }
60 
61 
62 
63  matrixPtr_Type coupling (new matrix_Type (*map) );
64  UInt one (1.);
65 
66  coupling.reset (new matrix_Type (*map, 0) );
67  coupling->insertValueDiagonal (one, M_offset[fluid], M_offset[solid] );
68  coupling->insertValueDiagonal (one, fluidSolid, totalDofs);
69  couplingMatrix (coupling, (*M_couplingFlags) [0]/*8*/, M_FESpace, M_offset, locDofMap, numerationInterface, timeStep, 2., coefficient, rescaleFactor);
70  M_coupling.push_back (coupling);
71 
72  coupling.reset (new matrix_Type (*map, 0) );
73  coupling->insertValueDiagonal ( one, M_FESpace[solid]->map() , M_offset[solid] );
74  coupling->insertValueDiagonal (one, fluidSolid, totalDofs);
75  couplingMatrix (coupling, (*M_couplingFlags) [1]/*4*/, M_FESpace, M_offset, locDofMap, numerationInterface, timeStep, 4., coefficient, rescaleFactor/**/);
76  couplingMatrix (coupling, (*M_couplingFlags) [2]/*2*/, M_FESpace, M_offset, locDofMap, numerationInterface, timeStep, 2., coefficient, rescaleFactor);
77  M_coupling.push_back (coupling);
78 
79  coupling.reset ( new matrix_Type ( *map, 0 ) );
80  coupling->insertValueDiagonal ( one, M_offset[fluid], M_offset[solid] );
81  coupling->insertValueDiagonal ( -1, fluidSolid, totalDofs );
82  couplingMatrix ( coupling, (*M_couplingFlags) [3]/*8*/, M_FESpace, M_offset, locDofMap, numerationInterface, timeStep, 2., coefficient, rescaleFactor );
83  couplingMatrix ( coupling, (*M_couplingFlags) [4]/*1*/, M_FESpace, M_offset, locDofMap, numerationInterface, timeStep, 4., coefficient, rescaleFactor/**/ );
84  M_coupling.push_back ( coupling );
85 
86  coupling.reset (new matrix_Type ( *map, 0 ) );
87  coupling->insertValueDiagonal ( one, M_FESpace[solid]->map(), M_offset[solid] );
88  coupling->insertValueDiagonal ( one, fluidSolid, totalDofs );
89  couplingMatrix ( coupling, (*M_couplingFlags) [5]/*2*/, M_FESpace, M_offset, locDofMap, numerationInterface, timeStep, 2., coefficient, rescaleFactor );
90  M_coupling.push_back ( coupling );
91 
92  M_prec.resize (M_blocks.size() );
93  //M_blockPrecs.reset(new ComposedOperator<ComposedOperator<Ifpack_Preconditioner> >(&M_blocks[0]->getMatrixPtr()->Comm()));
94 }
95 
96 } // Namespace LifeV
void updateInverseJacobian(const UInt &iQuadPt)
uint32_type ID
IDs.
Definition: LifeV.hpp:194
double Real
Generic real data.
Definition: LifeV.hpp:175
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191