LifeV
MultiscaleAlgorithmBroyden.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 File containing the Multiscale Broyden Algorithm
30  *
31  * @date 26-10-2009
32  * @author Cristiano Malossi <cristiano.malossi@epfl.ch>
33  *
34  * @maintainer Cristiano Malossi <cristiano.malossi@epfl.ch>
35  */
36 
37 #ifndef MultiscaleAlgorithmBroyden_H
38 #define MultiscaleAlgorithmBroyden_H 1
39 
40 // If the following macro is defined, when a simulation restarts the corresponding saved
41 // Broyden matrix is loaded from data file.
42 #define BROYDEN_IMPORTJACOBIAN
43 
44 #include <lifev/core/algorithm/LinearSolver.hpp>
45 
46 #include <lifev/multiscale/algorithms/MultiscaleAlgorithm.hpp>
47 
48 namespace LifeV
49 {
50 namespace Multiscale
51 {
52 
53 //! MultiscaleAlgorithmBroyden - The Multiscale Algorithm implementation of Broyden
54 /*!
55  * @author Cristiano Malossi
56  *
57  * @see Full description of the Geometrical Multiscale Framework: \cite Malossi-Thesis
58  * @see Methodology: \cite Malossi2011Algorithms \cite Malossi2011Algorithms1D \cite Malossi2011Algorithms3D1DFSI \cite BlancoMalossi2012
59  * @see Applications: \cite Malossi2011Algorithms3D1DFSIAortaIliac \cite LassilaMalossi2012IdealLeftVentricle \cite BonnemainMalossi2012LVAD
60  *
61  * The MultiscaleAlgorithmBroyden is an implementation of multiscaleAlgorithm_Type
62  * which implements the Broyden method.
63  */
65 {
66 public:
67 
68  //! @name Constructors & Destructor
69  //@{
70 
71  //! Constructor
72  explicit MultiscaleAlgorithmBroyden();
73 
74  //! Destructor
76 
77  //@}
78 
79 
80  //! @name Multiscale Algorithm Virtual Methods
81  //@{
82 
83  //! Setup the data of the algorithm using a data file
84  /*!
85  * @param FileName Name of the data file.
86  */
87  void setupData ( const std::string& fileName );
88 
89  //! Setup coupling variables and other quantities of the algorithm
90  void setupAlgorithm();
91 
92  //! Perform sub-iteration on the coupling variables
93  void subIterate();
94 
95  //! Display some information about the algorithm
96  void showMe();
97 
98  //@}
99 
100 
101  //! @name Set Methods
102  //@{
103 
104  //! Set the the main parameters of the algorithm (tolerance, maximum number of subiterations, etc.)
105  /*!
106  * @param parameterList teuchos list of parameters
107  */
108  void setAlgorithmParameters ( const multiscaleParameterList_Type& parameterList );
109 
110  //@}
111 
112 private:
113 
114  //! @name Private Types
115  //@{
116 
119 
120  //@}
121 
122 
123  //! @name Unimplemented Methods
124  //@{
125 
127 
129 
130  //@}
131 
132 
133  //! @name Private Methods
134  //@{
135 
136  void assembleJacobianMatrix();
137 
138  void broydenJacobianUpdate ( const multiscaleVector_Type& delta );
139 
140  void orthogonalizationUpdate ( const multiscaleVector_Type& delta );
141 
142 #ifdef HAVE_HDF5
143  //! Export Jacobian matrix to HDF5 file
144  void exportJacobianToHDF5();
145 
146  //! Import Jacobian matrix from an HDF5 file
147  void importJacobianFromHDF5();
148 #endif
149 
150  //@}
151 
154 
162 };
163 
164 //! Factory create function
166 {
167  return new MultiscaleAlgorithmBroyden();
168 }
169 
170 } // Namespace Multiscale
171 } // Namespace LifeV
172 
173 #endif /* MultiscaleAlgorithmBroyden_H */
MultiscaleAlgorithmBroyden & operator=(const MultiscaleAlgorithmBroyden &algorithm)
void showMe()
Display some information about the algorithm.
MultiscaleAlgorithmBroyden(const MultiscaleAlgorithmBroyden &algorithm)
void subIterate()
Perform sub-iteration on the coupling variables.
void broydenJacobianUpdate(const multiscaleVector_Type &delta)
void setAlgorithmParameters(const multiscaleParameterList_Type &parameterList)
Set the the main parameters of the algorithm (tolerance, maximum number of subiterations, etc.)
void updateInverseJacobian(const UInt &iQuadPt)
void orthogonalizationUpdate(const multiscaleVector_Type &delta)
void importJacobianFromHDF5()
Import Jacobian matrix from an HDF5 file.
multiscaleAlgorithm_Type * createMultiscaleAlgorithmBroyden()
Factory create function.
LinearSolver - Class to wrap linear solver.
void setupData(const std::string &fileName)
Setup the data of the algorithm using a data file.
MultiscaleAlgorithm multiscaleAlgorithm_Type
LinearSolver::parameterList_Type multiscaleParameterList_Type
void setupAlgorithm()
Setup coupling variables and other quantities of the algorithm.
std::shared_ptr< multiscaleMatrix_Type > multiscaleMatrixPtr_Type
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191
VectorEpetra multiscaleVector_Type