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-2025 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
39namespace 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 ExactPreconditioner.
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
85 ExactPreconditionerFactory::create_exact_preconditioner();
87 new NavierStokesSchurComplementPreconditioner(problem_pt);
88
89 // set defaults
91
92 // default super lu
94 ExactPreconditionerFactory::create_exact_preconditioner();
95
96 // create the matrix vector product operatrs
97 Solid_fluid_matvec_pt = new MatrixVectorProduct;
98 Solid_pseudo_elastic_matvec_pt = new MatrixVectorProduct;
99 Fluid_pseudo_elastic_matvec_pt = new MatrixVectorProduct;
100 Lagrange_solid_matvec_pt = new MatrixVectorProduct;
101 }
102
103 // destructor
105 {
106 // clean the memory
107 this->clean_up_memory();
108
109 // delete the pseudo solid preconditioner
111
112 // delete the navier stokes preconditioner
115
116 // delete the solid preconditioner if default
118 {
120 }
121
122 // delete the matrix vector product operators
127 }
128
129 /// Broken copy constructor
131 delete;
132
133 /// Broken assignment operator
134 // Commented out broken assignment operator because this can lead to a
135 // conflict warning when used in the virtual inheritence hierarchy.
136 // Essentially the compiler doesn't realise that two separate
137 // implementations of the broken function are the same and so, quite
138 // rightly, it shouts.
139 /*void operator=(const PseudoElasticFSIPreconditioner&) =
140 delete;*/
141
142 /// clean up memory method
143 void clean_up_memory();
144
145 /// Setup the precoonditioner.
146 void setup();
147
148 /// Apply the preconditioner
149 void preconditioner_solve(const DoubleVector& r, DoubleVector& z);
150
151 /// specify the mesh containing the combined fluid/pseudo solid elements
153 {
155 }
156
157 /// specify the mesh containing the solid elements
158 void set_solid_mesh_pt(Mesh* mesh_pt)
159 {
160 Solid_mesh_pt = mesh_pt;
161 }
162
163 /// specify the mesh containing the lagrange multiplier elements
165 {
167 }
168
169 /// speicify a non default solid preconditioner. This preconditioner
170 /// will not delete it
171 void set_solid_preconditioner(Preconditioner* prec_pt)
172 {
174 {
176 }
177 Solid_preconditioner_pt = prec_pt;
179 }
180
181 /// Access function to the pseudo elastic subsidiary preconditioner
186
187 /// Access function to the Navier Stokes Schur complement preconditioner.
188 NavierStokesSchurComplementPreconditioner* const navier_stokes_schur_complement_preconditioner_pt()
189 {
191 }
192
193 /// Call to use the Navier Stokes Schur complement
194 /// preconditioner.
199
200 /// Call to use the ExactPreconditioner is used for the
201 /// Navier Stokes subsidiary system.
206
207 private:
208 /// pointer to the pseudo solid preconditioner
210
211 /// pointer to the navier stokes precondtioner
213
214 /// Navier Stokes Schur complement preconditioner.
215 NavierStokesSchurComplementPreconditioner*
217
218 /// pointer to the solid preconditioner
219 Preconditioner* Solid_preconditioner_pt;
220
221 /// boolean flag to indicate whether default Solid preconditioner
222 /// is used
224
225 /// boolean flag to indicate whether the Solid preconditioner is a
226 /// block preconditioner
228
229 /// fluid onto pseudosolid matrix vector operator
230 MatrixVectorProduct* Fluid_pseudo_elastic_matvec_pt;
231
232 /// solid onto fluid matrix vector operatio
233 MatrixVectorProduct* Solid_fluid_matvec_pt;
234
235 /// solid onto pseudo solid matrix vector operatio
236 MatrixVectorProduct* Solid_pseudo_elastic_matvec_pt;
237
238 // lagrange onto solid matric vector product
239 MatrixVectorProduct* Lagrange_solid_matvec_pt;
240
241 /// Mesh containing the combined fluid and pseudo solid element
243
244 /// Mesh containing the solid elements
246
247 /// Mesh containing the lagrange multiplier elements
249
250 /// the dimension of the fluid
251 unsigned Dim;
252
253 /// If true the Navier Stokes Schur complement preconditioner
254 /// is used. Otherwise ExactPreconditioner is used for the
255 /// Navier Stokes subsidiary system.
257
258 }; // end of class FSILagrangeMultiplierPreconditioner
259
260} // namespace oomph
261#endif
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.
PseudoElasticPreconditioner *const pseudo_elastic_preconditioner_pt()
Access function to the pseudo elastic subsidiary 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 ExactPreconditioner is u...
bool Using_default_solid_preconditioner
boolean flag to indicate whether default Solid preconditioner is used
NavierStokesSchurComplementPreconditioner *const navier_stokes_schur_complement_preconditioner_pt()
Access function to the Navier Stokes Schur complement preconditioner.
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
void disable_navier_stokes_schur_complement_preconditioner()
Call to use the ExactPreconditioner 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.
A subsidiary preconditioner for the pseudo-elastic FSI preconditioner. Also a stand-alone preconditio...