pseudo_elastic_fsi_preconditioner.h
Go to the documentation of this file.
1 //LIC// ====================================================================
2 //LIC// This file forms part of oomph-lib, the object-oriented,
3 //LIC// multi-physics finite-element library, available
4 //LIC// at http://www.oomph-lib.org.
5 //LIC//
6 //LIC// Version 1.0; svn revision $LastChangedRevision$
7 //LIC//
8 //LIC// $LastChangedDate$
9 //LIC//
10 //LIC// Copyright (C) 2006-2016 Matthias Heil and Andrew Hazel
11 //LIC//
12 //LIC// This library is free software; you can redistribute it and/or
13 //LIC// modify it under the terms of the GNU Lesser General Public
14 //LIC// License as published by the Free Software Foundation; either
15 //LIC// version 2.1 of the License, or (at your option) any later version.
16 //LIC//
17 //LIC// This library is distributed in the hope that it will be useful,
18 //LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
19 //LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 //LIC// Lesser General Public License for more details.
21 //LIC//
22 //LIC// You should have received a copy of the GNU Lesser General Public
23 //LIC// License along with this library; if not, write to the Free Software
24 //LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 //LIC// 02110-1301 USA.
26 //LIC//
27 //LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
28 //LIC//
29 //LIC//====================================================================
30 #ifndef OOMPH_PSEUDO_ELASTIC_FSI_PRECONDITIONER
31 #define OOMPH_PSEUDO_ELASTIC_FSI_PRECONDITIONER
32 
33 // includes
34 #include "../generic/problem.h"
35 #include "../generic/block_preconditioner.h"
36 #include "../generic/preconditioner.h"
37 #include "../generic/SuperLU_preconditioner.h"
38 #include "../generic/matrix_vector_product.h"
39 #include "../navier_stokes/navier_stokes_preconditioners.h"
40 #include "../generic/general_purpose_block_preconditioners.h"
42 
43 namespace oomph {
44 
45  //============================================================================
46  /// \short Preconditioner for FSI problems with pseudo-elastic fluid node
47  /// updates.
48  /// Note:
49  /// NavierStokesSchurComplementPreconditioner is applied to the Navier Stokes
50  /// subsidiary system.
51  /// Default solid preconditioner is SuperLUPreconditioner.
52  /// \b Enumeration of Elastic DOF types in the Pseudo-Elastic Elements
53  /// The method get_dof_types_for_unknowns() must be implemented such that
54  /// DOFs subject be Lagrange multiplier and DOFs NOT subject to Lagrange
55  /// multiplier have different labels. For example in a 3D problem there are
56  /// 6 DOF types and the following labelling must be implemented:
57  /// 0 - x displacement (without lagr mult traction)
58  /// 1 - y displacement (without lagr mult traction)
59  /// 2 - z displacement (without lagr mult traction)
60  /// 3 - x displacement (with lagr mult traction)
61  /// 4 - y displacement (with lagr mult traction)
62  /// 5 - z displacement (with lagr mult traction)
63  //============================================================================
65  public BlockPreconditioner<CRDoubleMatrix>
66  {
67 
68  public:
69 
70  /// \short constructor - just set defaults. Specify the spatial
71  /// dimension of the fluid and a (non-const) problem pointer needed for
72  /// the underlying NavierStokesSchurComplementPreconditioner.
73  PseudoElasticFSIPreconditioner(const unsigned& dim, Problem* problem_pt)
74  : Dim(dim)
75  {
77 
78  // set the number of meshes
79  this->set_nmesh(3);
80 
81  // null pointers
83  Solid_mesh_pt = 0;
85 
86  // create the pseudo solid preconditioner
89 
90  // using Schur complement preconditioner for NS
91  Navier_stokes_preconditioner_pt = new SuperLUPreconditioner;
93  = new NavierStokesSchurComplementPreconditioner(problem_pt);
94 
95  // set defaults
97 
98  // default super lu
99  Solid_preconditioner_pt = new SuperLUPreconditioner;
100 
101  // create the matrix vector product operatrs
102  Solid_fluid_matvec_pt = new MatrixVectorProduct;
103  Solid_pseudo_elastic_matvec_pt = new MatrixVectorProduct;
104  Fluid_pseudo_elastic_matvec_pt = new MatrixVectorProduct;
105  Lagrange_solid_matvec_pt = new MatrixVectorProduct;
106  }
107 
108  // destructor
110  {
111  // clean the memory
112  this->clean_up_memory();
113 
114  // delete the pseudo solid preconditioner
116 
117  // delete the navier stokes preconditioner
120 
121  // delete the solid preconditioner if default
123  {
125  }
126 
127  // delete the matrix vector product operators
129  delete Solid_fluid_matvec_pt;
132  }
133 
134  /// Broken copy constructor
136  {
137  BrokenCopy::broken_copy("PseudoElasticFSIPreconditioner");
138  }
139 
140  /// Broken assignment operator
141 //Commented out broken assignment operator because this can lead to a conflict warning
142 //when used in the virtual inheritence hierarchy. Essentially the compiler doesn't
143 //realise that two separate implementations of the broken function are the same and so,
144 //quite rightly, it shouts.
145  /*void operator=(const PseudoElasticFSIPreconditioner&)
146  {
147  BrokenCopy::broken_assign("PseudoElasticFSIPreconditioner");
148  }*/
149 
150  /// clean up memory method
151  void clean_up_memory();
152 
153  /// \short Setup the precoonditioner.
154  void setup();
155 
156  /// \short Apply the preconditioner
157  void preconditioner_solve(const DoubleVector& r,
158  DoubleVector& z);
159 
160  /// specify the mesh containing the combined fluid/pseudo solid elements
162  {
164  }
165 
166  /// specify the mesh containing the solid elements
167  void set_solid_mesh_pt(Mesh* mesh_pt)
168  {
169  Solid_mesh_pt = mesh_pt;
170  }
171 
172  /// specify the mesh containing the lagrange multiplier elements
174  {
175  Lagrange_multiplier_mesh_pt = mesh_pt;
176  }
177 
178  /// \short speicify a non default solid preconditioner. This preconditioner
179  /// will not delete it
180  void set_solid_preconditioner(Preconditioner* prec_pt)
181  {
183  {
185  }
186  Solid_preconditioner_pt = prec_pt;
188  }
189 
190  /// Access function to the pseudo elastic subsidiary preconditioner
193  {
195  }
196 
197  /// Access function to the Navier Stokes Schur complement preconditioner.
198  NavierStokesSchurComplementPreconditioner* const
200  {
202  }
203 
204  /// \short Call to use the Navier Stokes Schur complement
205  /// preconditioner.
208 
209  /// \short Call to use the SuperLUPreconditioner is used for the
210  /// Navier Stokes subsidiary system.
213 
214  private:
215 
216  /// \short pointer to the pseudo solid preconditioner
219 
220  /// \short pointer to the navier stokes precondtioner
222 
223  /// \short Navier Stokes Schur complement preconditioner.
224  NavierStokesSchurComplementPreconditioner*
226 
227  /// \short pointer to the solid preconditioner
228  Preconditioner* Solid_preconditioner_pt;
229 
230  /// \short boolean flag to indicate whether default Solid preconditioner
231  /// is used
233 
234  /// \short boolean flag to indicate whether the Solid preconditioner is a
235  /// block preconditioner
237 
238  /// fluid onto pseudosolid matrix vector operator
239  MatrixVectorProduct* Fluid_pseudo_elastic_matvec_pt;
240 
241  /// solid onto fluid matrix vector operatio
242  MatrixVectorProduct* Solid_fluid_matvec_pt;
243 
244  /// solid onto pseudo solid matrix vector operatio
245  MatrixVectorProduct* Solid_pseudo_elastic_matvec_pt;
246 
247  // lagrange onto solid matric vector product
248  MatrixVectorProduct* Lagrange_solid_matvec_pt;
249 
250  /// \short Mesh containing the combined fluid and pseudo solid element
252 
253  /// \short Mesh containing the solid elements
255 
256  /// \short Mesh containing the lagrange multiplier elements
258 
259  /// \short the dimension of the fluid
260  unsigned Dim;
261 
262  /// \short If true the Navier Stokes Schur complement preconditioner
263  /// is used. Otherwise SuperLUPreconditioner is used for the
264  /// Navier Stokes subsidiary system.
266 
267  }; // end of class FSILagrangeMultiplierPreconditioner
268 
269 } // end of oomph namespace
270 #endif
void preconditioner_solve(const DoubleVector &r, DoubleVector &z)
Apply the preconditioner.
MatrixVectorProduct * Solid_fluid_matvec_pt
solid onto fluid matrix vector operatio
void set_fluid_and_pseudo_elastic_mesh_pt(Mesh *mesh_pt)
specify the mesh containing the combined fluid/pseudo solid elements
void clean_up_memory()
Broken assignment operator.
PseudoElasticFSIPreconditioner(const unsigned &dim, Problem *problem_pt)
constructor - just set defaults. Specify the spatial dimension of the fluid and a (non-const) problem...
Preconditioner for FSI problems with pseudo-elastic fluid node updates. Note: NavierStokesSchurComple...
A subsidiary preconditioner for the pseudo-elastic FSI preconditioner. Also a stand-alone preconditio...
void disable_navier_stokes_schur_complement_preconditioner()
Call to use the SuperLUPreconditioner is used for the Navier Stokes subsidiary system.
Preconditioner * Navier_stokes_preconditioner_pt
pointer to the navier stokes precondtioner
NavierStokesSchurComplementPreconditioner * Navier_stokes_schur_complement_preconditioner_pt
Navier Stokes Schur complement preconditioner.
void set_solid_mesh_pt(Mesh *mesh_pt)
specify the mesh containing the solid elements
void enable_navier_stokes_schur_complement_preconditioner()
Call to use the Navier Stokes Schur complement preconditioner.
Mesh * Lagrange_multiplier_mesh_pt
Mesh containing the lagrange multiplier elements.
MatrixVectorProduct * Fluid_pseudo_elastic_matvec_pt
fluid onto pseudosolid matrix vector operator
NavierStokesSchurComplementPreconditioner *const navier_stokes_schur_complement_preconditioner_pt()
Access function to the Navier Stokes Schur complement preconditioner.
bool Solid_preconditioner_is_block_preconditioner
boolean flag to indicate whether the Solid preconditioner is a block preconditioner ...
void set_lagrange_multiplier_mesh_pt(Mesh *mesh_pt)
specify the mesh containing the lagrange multiplier elements
Mesh * Solid_mesh_pt
Mesh containing the solid elements.
MatrixVectorProduct * Solid_pseudo_elastic_matvec_pt
solid onto pseudo solid matrix vector operatio
Preconditioner * Solid_preconditioner_pt
pointer to the solid preconditioner
bool Use_navier_stokes_schur_complement_preconditioner
If true the Navier Stokes Schur complement preconditioner is used. Otherwise SuperLUPreconditioner is...
bool Using_default_solid_preconditioner
boolean flag to indicate whether default Solid preconditioner is used
PseudoElasticPreconditioner * Pseudo_elastic_preconditioner_pt
pointer to the pseudo solid preconditioner
Mesh * Fluid_and_pseudo_elastic_mesh_pt
Mesh containing the combined fluid and pseudo solid element.
void set_solid_preconditioner(Preconditioner *prec_pt)
speicify a non default solid preconditioner. This preconditioner will not delete it ...
PseudoElasticPreconditioner *const pseudo_elastic_preconditioner_pt()
Access function to the pseudo elastic subsidiary preconditioner.
PseudoElasticFSIPreconditioner(const PseudoElasticFSIPreconditioner &)
Broken copy constructor.