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// Copyright (C) 2006-2023 Matthias Heil and Andrew Hazel
7 // LIC//
8 // LIC// This library is free software; you can redistribute it and/or
9 // LIC// modify it under the terms of the GNU Lesser General Public
10 // LIC// License as published by the Free Software Foundation; either
11 // LIC// version 2.1 of the License, or (at your option) any later version.
12 // LIC//
13 // LIC// This library is distributed in the hope that it will be useful,
14 // LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // LIC// Lesser General Public License for more details.
17 // LIC//
18 // LIC// You should have received a copy of the GNU Lesser General Public
19 // LIC// License along with this library; if not, write to the Free Software
20 // LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 // LIC// 02110-1301 USA.
22 // LIC//
23 // LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
24 // LIC//
25 // LIC//====================================================================
26 #ifndef OOMPH_PSEUDO_ELASTIC_FSI_PRECONDITIONER
27 #define OOMPH_PSEUDO_ELASTIC_FSI_PRECONDITIONER
28 
29 // includes
30 #include "../generic/problem.h"
31 #include "../generic/block_preconditioner.h"
32 #include "../generic/preconditioner.h"
33 #include "../generic/SuperLU_preconditioner.h"
34 #include "../generic/matrix_vector_product.h"
35 #include "../navier_stokes/navier_stokes_preconditioners.h"
36 #include "../generic/general_purpose_block_preconditioners.h"
38 
39 namespace oomph
40 {
41  //============================================================================
42  /// Preconditioner for FSI problems with pseudo-elastic fluid node
43  /// updates.
44  /// Note:
45  /// NavierStokesSchurComplementPreconditioner is applied to the Navier Stokes
46  /// subsidiary system.
47  /// Default solid preconditioner is SuperLUPreconditioner.
48  /// \b Enumeration of Elastic DOF types in the Pseudo-Elastic Elements
49  /// The method get_dof_types_for_unknowns() must be implemented such that
50  /// DOFs subject be Lagrange multiplier and DOFs NOT subject to Lagrange
51  /// multiplier have different labels. For example in a 3D problem there are
52  /// 6 DOF types and the following labelling must be implemented:
53  /// 0 - x displacement (without lagr mult traction)
54  /// 1 - y displacement (without lagr mult traction)
55  /// 2 - z displacement (without lagr mult traction)
56  /// 3 - x displacement (with lagr mult traction)
57  /// 4 - y displacement (with lagr mult traction)
58  /// 5 - z displacement (with lagr mult traction)
59  //============================================================================
61  : public BlockPreconditioner<CRDoubleMatrix>
62  {
63  public:
64  /// constructor - just set defaults. Specify the spatial
65  /// dimension of the fluid and a (non-const) problem pointer needed for
66  /// the underlying NavierStokesSchurComplementPreconditioner.
67  PseudoElasticFSIPreconditioner(const unsigned& dim, Problem* problem_pt)
68  : Dim(dim)
69  {
71 
72  // set the number of meshes
73  this->set_nmesh(3);
74 
75  // null pointers
77  Solid_mesh_pt = 0;
79 
80  // create the pseudo solid preconditioner
82 
83  // using Schur complement preconditioner for NS
87 
88  // set defaults
90 
91  // default super lu
93 
94  // create the matrix vector product operatrs
99  }
100 
101  // destructor
103  {
104  // clean the memory
105  this->clean_up_memory();
106 
107  // delete the pseudo solid preconditioner
109 
110  // delete the navier stokes preconditioner
113 
114  // delete the solid preconditioner if default
116  {
118  }
119 
120  // delete the matrix vector product operators
122  delete Solid_fluid_matvec_pt;
125  }
126 
127  /// Broken copy constructor
129  delete;
130 
131  /// Broken assignment operator
132  // Commented out broken assignment operator because this can lead to a
133  // conflict warning when used in the virtual inheritence hierarchy.
134  // Essentially the compiler doesn't realise that two separate
135  // implementations of the broken function are the same and so, quite
136  // rightly, it shouts.
137  /*void operator=(const PseudoElasticFSIPreconditioner&) =
138  delete;*/
139 
140  /// clean up memory method
141  void clean_up_memory();
142 
143  /// Setup the precoonditioner.
144  void setup();
145 
146  /// Apply the preconditioner
148 
149  /// specify the mesh containing the combined fluid/pseudo solid elements
151  {
153  }
154 
155  /// specify the mesh containing the solid elements
157  {
159  }
160 
161  /// specify the mesh containing the lagrange multiplier elements
163  {
165  }
166 
167  /// speicify a non default solid preconditioner. This preconditioner
168  /// will not delete it
170  {
172  {
174  }
175  Solid_preconditioner_pt = prec_pt;
177  }
178 
179  /// Access function to the pseudo elastic subsidiary preconditioner
181  {
183  }
184 
185  /// Access function to the Navier Stokes Schur complement preconditioner.
187  {
189  }
190 
191  /// Call to use the Navier Stokes Schur complement
192  /// preconditioner.
194  {
196  }
197 
198  /// Call to use the SuperLUPreconditioner is used for the
199  /// Navier Stokes subsidiary system.
201  {
203  }
204 
205  private:
206  /// pointer to the pseudo solid preconditioner
208 
209  /// pointer to the navier stokes precondtioner
211 
212  /// Navier Stokes Schur complement preconditioner.
215 
216  /// pointer to the solid preconditioner
218 
219  /// boolean flag to indicate whether default Solid preconditioner
220  /// is used
222 
223  /// boolean flag to indicate whether the Solid preconditioner is a
224  /// block preconditioner
226 
227  /// fluid onto pseudosolid matrix vector operator
229 
230  /// solid onto fluid matrix vector operatio
232 
233  /// solid onto pseudo solid matrix vector operatio
235 
236  // lagrange onto solid matric vector product
238 
239  /// Mesh containing the combined fluid and pseudo solid element
241 
242  /// Mesh containing the solid elements
244 
245  /// Mesh containing the lagrange multiplier elements
247 
248  /// the dimension of the fluid
249  unsigned Dim;
250 
251  /// If true the Navier Stokes Schur complement preconditioner
252  /// is used. Otherwise SuperLUPreconditioner is used for the
253  /// Navier Stokes subsidiary system.
255 
256  }; // end of class FSILagrangeMultiplierPreconditioner
257 
258 } // namespace oomph
259 #endif
Block Preconditioner base class. The block structure of the overall problem is determined from the Me...
const Mesh * mesh_pt(const unsigned &i) const
Access to i-th mesh (of the various meshes that contain block preconditionable elements of the same n...
void set_nmesh(const unsigned &n)
Specify the number of meshes required by this block preconditioner. Note: elements in different meshe...
A vector in the mathematical sense, initially developed for linear algebra type applications....
Definition: double_vector.h:58
Matrix vector product helper class - primarily a wrapper to Trilinos's Epetra matrix vector product m...
A general mesh class.
Definition: mesh.h:67
///////////////////////////////////////////////////////////////////////// ///////////////////////////...
Preconditioner base class. Gives an interface to call all other preconditioners through and stores th...
////////////////////////////////////////////////////////////////// //////////////////////////////////...
Definition: problem.h:151
Preconditioner for FSI problems with pseudo-elastic fluid node updates. Note: NavierStokesSchurComple...
MatrixVectorProduct * Solid_pseudo_elastic_matvec_pt
solid onto pseudo solid matrix vector operatio
Mesh * Lagrange_multiplier_mesh_pt
Mesh containing the lagrange multiplier elements.
void enable_navier_stokes_schur_complement_preconditioner()
Call to use the Navier Stokes Schur complement preconditioner.
Preconditioner * Solid_preconditioner_pt
pointer to the solid preconditioner
NavierStokesSchurComplementPreconditioner * Navier_stokes_schur_complement_preconditioner_pt
Navier Stokes Schur complement preconditioner.
NavierStokesSchurComplementPreconditioner *const navier_stokes_schur_complement_preconditioner_pt()
Access function to the Navier Stokes Schur complement preconditioner.
Preconditioner * Navier_stokes_preconditioner_pt
pointer to the navier stokes precondtioner
MatrixVectorProduct * Fluid_pseudo_elastic_matvec_pt
fluid onto pseudosolid matrix vector operator
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 set_solid_preconditioner(Preconditioner *prec_pt)
speicify a non default solid preconditioner. This preconditioner will not delete it
Mesh * Fluid_and_pseudo_elastic_mesh_pt
Mesh containing the combined fluid and pseudo solid element.
PseudoElasticFSIPreconditioner(const unsigned &dim, Problem *problem_pt)
constructor - just set defaults. Specify the spatial dimension of the fluid and a (non-const) problem...
bool Solid_preconditioner_is_block_preconditioner
boolean flag to indicate whether the Solid preconditioner is a block 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
void preconditioner_solve(const DoubleVector &r, DoubleVector &z)
Apply the preconditioner.
void set_lagrange_multiplier_mesh_pt(Mesh *mesh_pt)
specify the mesh containing the lagrange multiplier elements
PseudoElasticPreconditioner *const pseudo_elastic_preconditioner_pt()
Access function to the pseudo elastic subsidiary preconditioner.
void disable_navier_stokes_schur_complement_preconditioner()
Call to use the SuperLUPreconditioner is used for the Navier Stokes subsidiary system.
void set_solid_mesh_pt(Mesh *mesh_pt)
specify the mesh containing the solid elements
PseudoElasticFSIPreconditioner(const PseudoElasticFSIPreconditioner &)=delete
Broken copy constructor.
PseudoElasticPreconditioner * Pseudo_elastic_preconditioner_pt
pointer to the pseudo solid preconditioner
Mesh * Solid_mesh_pt
Mesh containing the solid elements.
//////////////////////////////////////////////////////////////////////////// ////////////////////////...
An interface to allow SuperLU to be used as an (exact) Preconditioner.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...