LifeV
MonolithicRobinInterface.hpp
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 /*!
29  @file
30  @brief An interface implementing the Robin coupling
31 
32  @author Paolo Crosetto <crosetto@iacspc70.epfl.ch>
33  @date 09 Jul 2010
34 
35  Used for the robin coupling in a monolithic formulation of a multiphysics problem.
36  */
37 
38 #ifndef MONOLITHICROBININTERFACE_H
39 #define MONOLITHICROBININTERFACE_H 1
40 
41 #include <lifev/core/LifeV.hpp>
42 #include <lifev/fsi/solver/MonolithicBlock.hpp>
43 
44 #include <lifev/core/array/MatrixEpetra.hpp>
45 
46 namespace LifeV
47 {
48 
49 //! MonolithicRobinInterface - Class for the Robin coupling of etherogeneaous problems
50 /*!
51  @author Paolo Crosetto
52 
53  This class is a base interface for the monolithic Robin coupling of 2 problems. A coupled Dirichlet-Neumann problem
54  can be transformed into a Robin one by inheriting from this class. The allocation of the memory for M_robinCoupling
55  has to be done outside.
56 
57  The Robin conditions are obtained algebraically through linear combination of the lines corresponding to the Dirichlet and Neumann
58  coupling conditions already present in the matrix. This is achieved by multiplying the matrix times a restriction
59  matrix (M_robinCoupling) which performs the restriction to the interface and the linear combination. Then the result
60  is summed to the original matrix. The update of the rhs vector must be done outside this class.
61 
62  \todo Remove this class and try to implement the same coupling otherwise.
63  */
64 class MonolithicRobinInterface
65 {
66 public:
67 
68 
69  //! @name Constructor & Destructor
70  //@{
71 
72  MonolithicRobinInterface() :
73  M_alphaf(),
74  M_alphas(),
75  M_robinCoupling(),
76  M_robinPart(),
77  M_rhsVec()
78  {}
79 
80  ~MonolithicRobinInterface() {}
81 
82  //@}
83 
84 
85  //! @name Public Methods
86  //@{
87 
88  //! method to set the data relative to the Robin coupling from GetPot
89  /*!
90  \param data: data file
91  \param section: the section (usually /robin) in the GetPot file where the parameters are specified
92  */
93  void setRobinData (const GetPot& data, const std::string& section);
94 
95  //! method to initialize the pointer to the robin coupling part of the matrix
96  /*!
97  \param data: data file
98  \param section: the section (usually /robin) in the GetPot file where the parameters are specified
99  */
100  void setRobinMatrix ( MonolithicBlock::matrixPtr_Type& robinMatrix )
101  {
102  M_robinPart = robinMatrix;
103  }
104 
105  //! method to initialize the pointer to the robin RHS
106  /*!
107  \param vec: the rhs vector
108  */
109  void setRobinRhs ( MonolithicBlock::vectorPtr_Type& vec )
110  {
111  M_rhsVec = vec;
112  }
113 
114  //! method to apply the robin coupling to the blocks.
115  /*!
116  Note that the coupling matrix M_robinCoupling must be set before calling this.
117  \param blockVector: the vector of blocks to couple.
118  */
119  void applyRobinCoupling ( std::vector<MonolithicBlock::matrixPtr_Type> blockVector);
120 
121  //@}
122 
123 protected:
124 
125 
126  //! @name Protected Methods
127  //@{
128 
129  void applyRobinCoupling ( MonolithicBlock::matrixPtr_Type firstBlock );
130 
131  //@}
132 
133 
134  //! @name Protected Members
135  //@{
136 
137  Real M_alphaf;
138  Real M_alphas;
139  MonolithicBlock::matrixPtr_Type M_robinCoupling;
140  MonolithicBlock::matrixPtr_Type M_robinPart;
141  MonolithicBlock::vectorPtr_Type M_rhsVec;
142  //@}
143 
144 };
145 
146 } // Namespace LifeV
147 
148 #endif /* MONOLITHICROBININTERFACE_H */
void assignFunction(bcBase_Type &base)
Assign the function to the base of the BCHandler.
double Real
Generic real data.
Definition: LifeV.hpp:175