LifeV
FSIMonolithicGE.hpp
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 Monolithic Geometry--Explicit FSI Solver
30 
31  @author Paolo Crosetto <crosetto@iacspc70.epfl.ch>
32  @date 26 Jul 2010
33 
34  This file implements the Monolithic Geometry--Explicit solver, see \cite CrosettoEtAl2009 for details
35  */
36 
37 #ifndef MONOLITHICGE_H
38 #define MONOLITHICGE_H 1
39 
40 #include <lifev/core/LifeV.hpp>
41 
42 #include <lifev/fsi/solver/MonolithicBlockMatrix.hpp>
43 #include <lifev/fsi/solver/MonolithicBlockMatrixRN.hpp>
44 #include <lifev/fsi/solver/MonolithicBlockComposedDN.hpp>
45 #include <lifev/fsi/solver/MonolithicBlockComposedNN.hpp>
46 #include <lifev/fsi/solver/MonolithicBlockComposedDNND.hpp>
47 
48 #include <lifev/fsi/solver/FSIMonolithic.hpp>
49 
50 namespace LifeV
51 {
52 
53 //! FSIMonolithicGE - FSIMonolithic Geometry-Explicit solver
54 /*!
55  @author Paolo Crosetto
56  @see \cite CrosettoEtAl2009
57 
58  Important parameters to set properly in the data file:
59  - useShapeDerivatives: MUST be false, because in the GE approach the geometry is explicit;
60  - domainVelImplicit: MUST be false, because in the GE approach the geometry is explicit;
61  - convectiveTermDer: false if the convective term is linearized (\f$u^{n+1}\nabla(u^n-w^n)\f$),
62  otherwise it can be either true (if we use the Newton method to solve the convective term nonlinearity) or false
63  (fixed-point method). For the GCE must be false;
64  - semiImplicit: if true only one iteration of the nonlinear solver is performed. Otherwise
65  the nonlinear iterations continue up to the specified tolerance. Set it to true for the GCE;
66  - method: can be either monolithicGE, monolithicGI if the geometry is treated respectively explicitly or implicitly,
67  or exactJacobians, fixedPoint for partitioned strategies;
68  - blockOper: specifies the matrix type to be used for the linear system: if AdditiveSchwarz, the matrix is the standard
69  ine for GE; if AdditiveSchwarzRN the coupling blocks are of Robin type instead of Dirichlet and Neumann. The parameters
70  for the Robin coupling are alphaf and alphas in the data file. NOTE: this method has currently been tested only for
71  alphas=0.
72  - DDBlockPrec: specifies the possible preconditioners to use. Can be: AdditiveSchwarz, MonolithicBlockComposedDN, MonolithicBlockComposedDN2,
73  MonolithicBlockComposedNN, MonolithicBlockComposedDNND.
74  */
75 typedef FactorySingleton<Factory<FSIOperator, std::string> > FSIFactory_Type;
76 class FSIMonolithicGE : public FSIMonolithic
77 {
78 public:
79 
80  typedef FSIMonolithic super_Type;
81 
82  //! @name Constructor & Destructor
83  //@{
84 
85  //! Empty Constructor
86  FSIMonolithicGE() :
87  super_Type()
88  {}
89 
90  //! Destructor
91  ~FSIMonolithicGE()
92  {}
93 
94  //@}
95 
96 
97  //! @name Public Methods
98  //@{
99 
100  //! Setup method for the subfroblem
101  /**
102  Sets up the fluid, solid and harmonic extension finite element spaces and initializes most of the variables
103  used in the solver
104  */
105  void setupFluidSolid ( UInt const fluxes );
106 
107  //! setup of the dofs
108  /** calls super_Type::setupDof and instantiate the boundary condition vector needed to couple fluid--structure and harmonic extention*/
109  void setupDOF();
110 
111  //! setUp from data file
112  /**
113  calls the setup for the fluid, solid and mesh motion problems
114  */
115  void setupSystem();
116 
117  //!Updates the system for the next time step
118  /**
119  Calls the updateSystem of the mother class and updates the solid displacement in the solid problem
120  */
121  void updateSystem();
122 
123  //! Set vectors for restart
124  /*!
125  * Set vectors for restart
126  */
127  void setALEVectorInStencil (const vectorPtr_Type& fluidDisp, const UInt iter, const bool /*lastVector*/);
128 
129  /**
130  evaluates the residual Ax-b
131  \param res: output
132  \param _sol: monolithic solution
133  \param iter: current NonLinearRichardson (Newton) iteration
134  */
135  void evalResidual ( vector_Type& res, const vector_Type& sol, const UInt iter );
136 
137  /**
138  iterates the mesh
139  \param disp: monolithic solution
140  */
141  void iterateMesh ( const vector_Type& disp );
142 
143  //! Applies the bounsary conditions to the matrix
144  void applyBoundaryConditions();
145 
146 
147  void updateSolution ( const vector_Type& solution );
148 
149  //@}
150 
151 
152  //! @name Get Methods
153  //@{
154 
155  //! Gets the solution
156  LIFEV_DEPRECATED ( const vector_Type& solution() const )
157  {
158  if ( M_epetraWorldComm->MyPID() == 0 )
159  {
160  std::cerr << std::endl << "Warning: FSIMonolithic::solution() is deprecated!" << std::endl
161  << " You should not access the solution inside FSIOperator or FSIMonolithic!" << std::endl;
162  }
163 
164  return M_fluidTimeAdvance->singleElement (0);
165  }
166 
167  //@}
168 
169 
170  //! Factory method
171  static FSIOperator* instantiate()
172  {
173  return new FSIMonolithicGE();
174  }
175 
176 private:
177 
178  //!@name Private Methods
179  //@{
180 
181  void createOperator ( std::string& operType )
182  {
183  M_monolithicMatrix.reset (MonolithicBlockMatrix::Factory_Type::instance().createObject ( operType ) );
184  }
185 
186  //@}
187 
188 
189 public:
190 
191  static bool S_register;
192 };
193 
194 //! Factory create function
195 inline FSIMonolithic* createFSIMonolithicGE()
196 {
197  return new FSIMonolithicGE();
198 }
199 
200 } // Namespace LifeV
201 
202 #endif /* MONOLITHICGCE_H */
void assignFunction(bcBase_Type &base)
Assign the function to the base of the BCHandler.
#define LIFEV_DEPRECATED(func)
Definition: LifeV.hpp:117
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191