fsi_preconditioners.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_FSI_PRECONDITIONERS_HEADER
27#define OOMPH_FSI_PRECONDITIONERS_HEADER
28
29
30#include "../navier_stokes/navier_stokes_preconditioners.h"
31
32namespace oomph
33{
34 ///////////////////////////////////////////////////////////////////////////////
35 ///////////////////////////////////////////////////////////////////////////////
36 ///////////////////////////////////////////////////////////////////////////////
37
38
39 //============================================================================
40 /// FSI preconditioner. This extracts upper/lower triangular
41 /// blocks in the 3x3 overall block matrix structure arising from
42 /// the monolithic discretisation of FSI problems with algebraic
43 /// node updates. Dofs are decomposed into fluid velocity, pressure
44 /// and solid unknowns. NavierStokesSchurComplementPreconditioner is used
45 /// as the inexact solver for the fluid block; SuperLU (in
46 /// its incarnation as an "exact" preconditioner) is used for
47 /// the solid block. By default we retain the fluid on solid off
48 /// diagonal blocks.
49 //=============================================================================
50 class FSIPreconditioner : public BlockPreconditioner<CRDoubleMatrix>
51 {
52 public:
53 /// Constructor: By default use block triangular form with retained
54 /// fluid on solid terms. A problem pointer is required for the underlying
55 /// NavierStokesSchurComplementPreconditioner.
57 {
58 // set the mesh pointers
59 this->set_nmesh(2);
61 Wall_mesh_pt = 0;
62
63 // Initially assume that there are no multiple element types in the
64 // meshes.
67
68 // Default setting: Fluid onto solid as it this was shown to be
69 // marginally faster than solid onto fluid; see Heil CMAME 193 (2004)
72
73 // Create the Navier Stokes Schur complement preconditioner
76
77 // Create the Solid preconditioner
80
81 // Preconditioner hasn't been set up yet.
83
84 // Create the matrix vector product operators
87
88 // set Doc_time to false
89 Doc_time = false;
90 }
91
92
93 /// Destructor: Clean up.
95 {
96 // Delete the Navier-Stokes preconditioner (inexact solver)
98
99 // Delete the solid preconditioner (inexact solver)
101
102 // delete the matrix vector product operators
105 }
106
107
108 /// Broken copy constructor
110
111
112 /// Broken assignment operator
113 // Commented out broken assignment operator because this can lead to a
114 // conflict warning when used in the virtual inheritence hierarchy.
115 // Essentially the compiler doesn't realise that two separate
116 // implementations of the broken function are the same and so, quite
117 // rightly, it shouts.
118 /*void operator=(const FSIPreconditioner&) =
119 delete;*/
120
121 /// Set solid preconditioner (deletes existing one)
131
132 /// Read-only access to solid preconditoner (use set_... to set it)
137
138
139 /// Switch to block-diagonal preconditioner
145
146 /// Switch to block-triangular preconditioner in which
147 /// action of fluid dofs onto solid equations is retained
153
154 /// Switch to block-triangular preconditioner in which
155 /// action of solid dofs onto fluid equations is retained
161
162 /// Setter function for the mesh containing the
163 /// block-preconditionable Navier-Stokes elements. The optional argument
164 /// indicates if there are more than one type of elements in same mesh.
166 Mesh* mesh_pt,
168 {
169 // Store the mesh pointer.
171
172 // Are there multiple element types in the Navier-Stokes mesh?
175 }
176
177 /// Setter function for the mesh containing the
178 /// block-preconditionable FSI solid elements. The optional argument
179 /// indicates if there are more than one type of elements in the same mesh.
181 Mesh* mesh_pt,
183 {
184 // Store the mesh pointer
186
187 // Are there multiple element types in the wall mesh?
190 }
191
192 /// Setup the preconditioner
193 void setup();
194
195 /// Apply preconditioner to r
197
198 /// Access function to the Navier Stokes preconditioner (inexact solver)
204
205 /// Enable documentation of time
207 {
208 Doc_time = true;
209 }
210
211 /// Disable documentation of time
213 {
214 Doc_time = false;
215 }
216
217
218 private:
219 /// Pointer the Navier Stokes preconditioner (inexact solver)
221
222 /// Pointer to the solid preconditioner (inexact solver)
224
225 /// Pointer to fluid/solid interaction matrix
227
228 /// Pointer to solid/fluid solid interaction matrix
230
231 /// Boolean indicating the preconditioner has been set up
233
234 /// Boolean flag used to indicate that the solid onto fluid
235 /// interaction terms are to be retained
237
238 /// Boolean flag used to indicate that the fluid onto solid
239 /// interaction terms are to be retained
241
242 /// Set Doc_time to true for outputting results of timings
244
245 /// Pointer to the navier stokes mesh
247
248 /// pointer to the solid mesh
250
251 /// Flag to indicate if there are multiple element types in the
252 /// Navier-Stokes mesh.
254
255 // Flag to indicate if there are multiple element types in the Wall mesh.
257 };
258
259
260 //////////////////////////////////////////////////////////////////////////////
261 //////////////////////////////////////////////////////////////////////////////
262 // FSI preconditioner member functions
263 //////////////////////////////////////////////////////////////////////////////
264 //////////////////////////////////////////////////////////////////////////////
265
266
267 //=============================================================================
268 /// Setup the preconditioner. Note: Matrix must be a CRDoubleMatrix.
269 //=============================================================================
271 {
272 // check the meshes have been set
273#ifdef PARANOID
274 if (Navier_stokes_mesh_pt == 0)
275 {
276 std::ostringstream error_message;
277 error_message << "Pointer to fluid mesh hasn't been set!\n";
278 throw OomphLibError(
280 }
281 if (Wall_mesh_pt == 0)
282 {
283 std::ostringstream error_message;
284 error_message << "Pointer to solid mesh hasn't been set!\n";
285 throw OomphLibError(
287 }
288#endif
289
290 // setup the meshes
291 this->set_mesh(0,
295
296 // get the number of fluid dofs from teh first element in the mesh
297 unsigned n_fluid_dof = this->ndof_types_in_mesh(0);
298 unsigned n_dof = n_fluid_dof + this->ndof_types_in_mesh(1);
299
300 // this fsi preconditioner has two types of DOF fluid dofs and solid dofs
302 for (unsigned i = n_fluid_dof; i < n_dof; i++)
303 {
304 dof_to_block_map[i] = 1;
305 }
306
307 // Call block setup for this preconditioner
308 this->block_setup(dof_to_block_map);
309
310 // Block mapping for the subsidiary Navier Stokes preconditioner:
311 // blocks 0 and 1 in the FSI preconditioner are also blocks 0 and 1
312 // in the subsidiary Navier Stokes one.
314 for (unsigned i = 0; i < n_fluid_dof; i++)
315 {
316 ns_dof_lookup[i] = i;
317 }
318
319 // Turn the Navier Stokes Schur complement preconditioner into a
320 // subsidiary preconditioner of this preconditioner
322 this, ns_dof_lookup);
323
324 // Setup the navier stokes preconditioner: Tell it about the
325 // Navier Stokes mesh and set it up.
329
330 // Extract the additional blocks we need for FSI:
331
332 // Solid tangent stiffness matrix
334 this->get_block(1, 1, block_matrix_1_1);
335
336 // Setup the solid preconditioner (inexact solver)
337 double t_start = TimingHelpers::timer();
339 double t_end = TimingHelpers::timer();
340 block_matrix_1_1.clear();
341 double setup_time = t_end - t_start;
342
343 // Solid on fluid terms (if needed)
345 {
348 Matrix_vector_product_0_1_pt, &block_matrix_0_1, 1);
349 }
350
351 // Fluid on solid terms (if needed)
353 {
356 Matrix_vector_product_1_0_pt, &block_matrix_1_0, 0);
357 }
358
359 // Output times
360 if (Doc_time)
361 {
362 oomph_info << "Solid sub-preconditioner setup time [sec]: " << setup_time
363 << "\n";
364 }
365
366 // We're done (and we stored some data)
368 }
369
370
371 //======================================================================
372 /// Apply preconditioner to Vector r
373 //======================================================================
375 DoubleVector& z)
376 {
377 // if z is not setup then give it the same distribution
378 if (!z.built())
379 {
380 z.build(r.distribution_pt(), 0.0);
381 }
382
383 // Make copy of residual vector (to overcome const-ness
385
386
387 // Retain off-diagonals that represent effect of solid on fluid
388 //-------------------------------------------------------------
390 {
391 // Working vectors
394
395 // Copy solid values from residual to temp_vec:
396 // Loop over all entries in the global vector (this one
397 // includes solid, velocity and pressure dofs in some random fashion)
399
400 // Solve solid system by back-substitution
401 // with LU-decomposed stiffness matrix
405 this->return_block_vector(1, temp_solid_vec2, z);
406
407 // NOTE: temp_solid_vec now contains z_s = S^{-1} r_s
408
409 // Multiply C_{us} by z_s
411 temp_solid_vec.clear();
412
413 // Subtract from fluid residual vector for fluid solve
415 this->get_block_vector(0, res, another_temp_vec);
417 this->return_block_vector(0, another_temp_vec, res);
418
419 // now apply the navier stokes lsc preconditioner
421 }
422
423
424 // Retain off-diagonals that represent effect of fluid on solid
425 //-------------------------------------------------------------
426 // (or diagonal preconditioner)
427 //-----------------------------
428 else
429 {
430 // Call fluid preconditioner for fluid block
432
433 // Working vectors
435
436 // get the solid vector
438
439 // Do matrix vector products with fluid onto solid coupling matrices:
441 {
444
445 // Auxiliary vector to hold the matrix vector product of the
446 // fluid-onto-solid coupling matrices with the fluid solutions:
448
449 // Multiply C_{su} by z_u
451
452 // ...and subtract from r_s:
454 }
455
456 // Solve solid system by back-substitution
457 // with LU-decomposed stiffness matrix
461
462 // Now copy result_vec (i.e. z_s) back into the global vector z.
463 // Loop over all entries in the global results vector z:
465 }
466 }
467
468
469 ///////////////////////////////////////////////////////////////////////////
470 ///////////////////////////////////////////////////////////////////////////
471 ///////////////////////////////////////////////////////////////////////////
472
473
474 //============================================================================
475 /// FSI preconditioner. This extracts upper/lower triangular
476 /// blocks in the 3x3 overall block matrix structure arising from
477 /// the monolithic discretisation of FSI problems with algebraic
478 /// node updates. Dofs are decomposed into fluid velocity, pressure
479 /// and solid unknowns. Blocks are then re-assembled into one global
480 /// matrix and solved with a direct solver (SuperLU in its incarnation
481 /// as an exact preconditioner). By default we retain the fluid on solid off
482 /// diagonal blocks.
483 //=============================================================================
484 template<typename MATRIX>
486 {
487 public:
488 /// Constructor.
490 {
491 // set the mesh pointers
493 Wall_mesh_pt = 0;
494 this->set_nmesh(2);
495
496 // Default setting: Retain fluid on solid
499
500 // Null the preconditioner pointer (inexact solver)
502
503 // Initially assume that there are no multiple element types in
504 // the same mesh.
507 }
508
509
510 /// Destructor: Clean up
512 {
513 // Wiping preconditioner (inexact solver) wipes the stored
514 // LU decompositon
515 if (Preconditioner_pt != 0)
516 {
517 delete Preconditioner_pt;
519 }
520 }
521
522
523 /// Broken copy constructor
525
526
527 /// Broken assignment operator
528 /*void operator=(const SimpleFSIPreconditioner&) = delete;*/
529
530 /// Setter function for the mesh containing the
531 /// block-preconditionable Navier-Stokes elements.
533 Mesh* mesh_pt,
535 {
536 // Store the mesh pointer.
538
539 // Are there multiple elements in this mesh?
542 }
543
544 /// Setter function for the mesh containing the
545 /// block-preconditionable FSI solid elements.
547 Mesh* mesh_pt,
549 {
550 // Store the mesh pointer
552
553 // Are the multiple elements in this mesh?
556 }
557
558 /// Setup the preconditioner
559 void setup();
560
561 /// Apply preconditioner to r
563
564 /// Switch to block-diagonal preconditioner
570
571 /// Switch to block-triangular preconditioner in which
572 /// action of fluid dofs onto solid equations is retained
578
579 /// Switch to block-triangular preconditioner in which
580 /// action of solid dofs onto fluid equations is retained
586
587 private:
588 /// Preconditioner (inexact solver)
590
591 /// Boolean flag used to indicate that the solid onto fluid
592 /// interaction terms are to be retained
594
595 /// Boolean flag used to indicate that the fluid onto solid
596 /// interaction terms are to be retained
598
599 /// Identify the required blocks: Here we only need
600 /// the momentum, gradient and divergence blocks of the
601 /// 2x2 block-structured fluid matrix, the 1x1 solid block
602 /// and the selected FSI-off diagonals.
604
605 /// Pointer to the navier stokes mesh
607
608 /// pointer to the solid mesh
610
611 /// Flag for multiple element types in the Navier-Stokes mesh.
613
614 /// Flag for multiple element types in the Wall mesh
616 };
617
618
619 ////////////////////////////////////////////////////////////////////////
620 ////////////////////////////////////////////////////////////////////////
621 // FSI preconditioner member functions
622 ////////////////////////////////////////////////////////////////////////
623 ////////////////////////////////////////////////////////////////////////
624
625
626 //===========================================================================
627 /// Identify the required blocks: Here we only need
628 /// the momentum, gradient and divergence blocks of the
629 /// 2x2 block-structured fluid matrix, the 1x1 solid block
630 /// and the selected FSI-off diagonals.
631 //===========================================================================
632 template<typename MATRIX>
635 {
636 // find number of block types
637 unsigned n_dof = this->nblock_types();
638
639 // Initialise all blocks to false
640 for (unsigned i = 0; i < n_dof; i++)
641 {
642 for (unsigned j = 0; j < n_dof; j++)
643 {
644 required_blocks(i, j) = false;
645 }
646 }
647
648 // Fluid: Only need momentum, gradient and divergence blocks
649 required_blocks(0, 0) = true;
650 required_blocks(1, 0) = true;
651 required_blocks(0, 1) = true;
652
653 // Always retain the solid block
654 required_blocks(2, 2) = true;
655
656 // Switch on the required off-diagonals
657 if (Retain_solid_onto_fluid_terms)
658 {
659 required_blocks(0, 2) = true;
660 required_blocks(1, 2) = true;
661 }
662 if (Retain_fluid_onto_solid_terms)
663 {
664 required_blocks(2, 0) = true;
665 required_blocks(2, 1) = true;
666 if (Retain_solid_onto_fluid_terms)
667 {
668 std::ostringstream error_message;
669 error_message << "Can't retain all off-diagonal blocks!\n";
670 throw OomphLibError(error_message.str(),
673 }
674 }
675 }
676
677
678 //=============================================================================
679 /// Setup the preconditioner: Copy the upper/lower triangular
680 /// block matrices back into a big matrix (with the entries
681 /// re-ordered relative to the original Jacobian matrix).
682 //=============================================================================
683 template<typename MATRIX>
685 {
686 // Clean up memory
687 if (Preconditioner_pt != 0)
688 {
689 delete Preconditioner_pt;
690 Preconditioner_pt = 0;
691 }
692#ifdef PARANOID
693 if (Navier_stokes_mesh_pt == 0)
694 {
695 std::ostringstream error_message;
696 error_message << "Pointer to fluid mesh hasn't been set!\n";
697 throw OomphLibError(
699 }
700 if (Wall_mesh_pt == 0)
701 {
702 std::ostringstream error_message;
703 error_message << "Pointer to solid mesh hasn't been set!\n";
704 throw OomphLibError(
706 }
707#endif
708
709 // setup the meshes
710 this->set_mesh(0,
711 Navier_stokes_mesh_pt,
712 Allow_multiple_element_type_in_navier_stokes_mesh);
713 this->set_mesh(1, Wall_mesh_pt, Allow_multiple_element_type_in_wall_mesh);
714
715 // get the number of fluid dofs from the first element in the mesh
716 unsigned n_fluid_dof = this->ndof_types_in_mesh(0);
717 unsigned n_dof = n_fluid_dof + this->ndof_types_in_mesh(1);
718
719 // this fsi preconditioner has two types of DOF fluid dofs and solid dofs
721 dof_to_block_map[n_fluid_dof - 1] = 1; // pressure
722 for (unsigned i = n_fluid_dof; i < n_dof; i++) // solid
723 {
724 dof_to_block_map[i] = 2;
725 }
726
727 // Set up the blocks look up schemes
728 this->block_setup(dof_to_block_map);
729
730 // find number of block types
731 n_dof = this->nblock_types();
732
733 // Create matrix that indicates which blocks are required
735
736 // Identify required blocks
737 identify_required_blocks(required_blocks);
738
740
741 for (unsigned dof_i = 0; dof_i < n_dof; dof_i++)
742 {
743 for (unsigned dof_j = 0; dof_j < n_dof; dof_j++)
744 {
745 selected_blocks[dof_i][dof_j].select_block(dof_i, dof_j, false, 0);
746
748 {
749 selected_blocks[dof_i][dof_j].want_block();
750 }
751 }
752 }
753
754 CRDoubleMatrix P_matrix = this->get_concatenated_block(selected_blocks);
755
756 // Setup preconditioner (i.e. inexact solver) -- does the LU decomposition
757 Preconditioner_pt =
759 Preconditioner_pt->setup(&P_matrix);
760 }
761
762
763 //======================================================================
764 /// Apply preconditioner to Vector r
765 //======================================================================
766 template<typename MATRIX>
768 const DoubleVector& r, DoubleVector& z)
769 {
770 // create a temporary vector to hold the result of preconditioning
772
773 // get the reordered vector
774 this->get_block_ordered_preconditioner_vector(r, temp_vec);
775
776 // apply preconditioner to z and store in r
777 Preconditioner_pt->preconditioner_solve(temp_vec, temp_vec);
778
779 // copy the solution back
780 this->return_block_ordered_preconditioner_vector(temp_vec, z);
781 }
782
783
784 ///////////////////////////////////////////////////////////////////////////
785 ///////////////////////////////////////////////////////////////////////////
786 ///////////////////////////////////////////////////////////////////////////
787
788
789} // namespace oomph
790
791#endif
cstr elem_len * i
Definition cfortran.h:603
Block Preconditioner base class. The block structure of the overall problem is determined from the Me...
void return_block_vector(const unsigned &n, const DoubleVector &b, DoubleVector &v) const
Takes the n-th block ordered vector, b, and copies its entries to the appropriate entries in the natu...
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...
unsigned ndof_types_in_mesh(const unsigned &i) const
Return the number of DOF types in mesh i. WARNING: This should only be used by the upper-most master ...
void get_block(const unsigned &i, const unsigned &j, CRDoubleMatrix &output_matrix, const bool &ignore_replacement_block=false) const
Put block (i,j) into output_matrix. This block accounts for any coarsening of dof types and any repla...
void get_block_vector(const unsigned &n, const DoubleVector &v, DoubleVector &b) const
Takes the naturally ordered vector, v and returns the n-th block vector, b. Here n is the block numbe...
void turn_into_subsidiary_block_preconditioner(BlockPreconditioner< MATRIX > *master_block_prec_pt, const Vector< unsigned > &doftype_in_master_preconditioner_coarse)
Function to turn this preconditioner into a subsidiary preconditioner that operates within a bigger "...
void setup_matrix_vector_product(MatrixVectorProduct *matvec_prod_pt, CRDoubleMatrix *block_pt, const Vector< unsigned > &block_col_indices)
Setup a matrix vector product. matvec_prod_pt is a pointer to the MatrixVectorProduct,...
void set_nmesh(const unsigned &n)
Specify the number of meshes required by this block preconditioner. Note: elements in different meshe...
CRDoubleMatrix * matrix_pt() const
Access function to matrix_pt. If this is the master then cast the matrix pointer to MATRIX*,...
virtual void block_setup()
Determine the size of the matrix blocks and setup the lookup schemes relating the global degrees of f...
void set_mesh(const unsigned &i, const Mesh *const mesh_pt, const bool &allow_multiple_element_type_in_mesh=false)
Set the i-th mesh for this block preconditioner. Note: The method set_nmesh(...) must be called befor...
A class for compressed row matrices. This is a distributable object.
Definition matrices.h:888
A vector in the mathematical sense, initially developed for linear algebra type applications....
void build(const DoubleVector &old_vector)
Just copys the argument DoubleVector.
FSI preconditioner. This extracts upper/lower triangular blocks in the 3x3 overall block matrix struc...
void set_solid_preconditioner_pt(Preconditioner *solid_preconditioner_pt)
Broken assignment operator.
Preconditioner * solid_preconditioner_pt() const
Read-only access to solid preconditoner (use set_... to set it)
void use_block_triangular_version_with_solid_on_fluid()
Switch to block-triangular preconditioner in which action of solid dofs onto fluid equations is retai...
Mesh * Navier_stokes_mesh_pt
Pointer to the navier stokes mesh.
NavierStokesSchurComplementPreconditioner * navier_stokes_preconditioner_pt() const
Access function to the Navier Stokes preconditioner (inexact solver)
void enable_doc_time()
Enable documentation of time.
void preconditioner_solve(const DoubleVector &r, DoubleVector &z)
Apply preconditioner to r.
bool Doc_time
Set Doc_time to true for outputting results of timings.
bool Allow_multiple_element_type_in_navier_stokes_mesh
Flag to indicate if there are multiple element types in the Navier-Stokes mesh.
MatrixVectorProduct * Matrix_vector_product_0_1_pt
Pointer to fluid/solid interaction matrix.
FSIPreconditioner(const FSIPreconditioner &)=delete
Broken copy constructor.
void set_navier_stokes_mesh(Mesh *mesh_pt, const bool &allow_multiple_element_type_in_navier_stokes_mesh=false)
Setter function for the mesh containing the block-preconditionable Navier-Stokes elements....
void set_wall_mesh(Mesh *mesh_pt, const bool &allow_multiple_element_type_in_wall_mesh=false)
Setter function for the mesh containing the block-preconditionable FSI solid elements....
~FSIPreconditioner()
Destructor: Clean up.
MatrixVectorProduct * Matrix_vector_product_1_0_pt
Pointer to solid/fluid solid interaction matrix.
void use_block_diagonal_version()
Switch to block-diagonal preconditioner.
void disable_doc_time()
Disable documentation of time.
Preconditioner * Solid_preconditioner_pt
Pointer to the solid preconditioner (inexact solver)
bool Retain_solid_onto_fluid_terms
Boolean flag used to indicate that the solid onto fluid interaction terms are to be retained.
void use_block_triangular_version_with_fluid_on_solid()
Switch to block-triangular preconditioner in which action of fluid dofs onto solid equations is retai...
bool Preconditioner_has_been_setup
Boolean indicating the preconditioner has been set up.
bool Retain_fluid_onto_solid_terms
Boolean flag used to indicate that the fluid onto solid interaction terms are to be retained.
void setup()
Setup the preconditioner.
NavierStokesSchurComplementPreconditioner * Navier_stokes_preconditioner_pt
Pointer the Navier Stokes preconditioner (inexact solver)
Mesh * Wall_mesh_pt
pointer to the solid mesh
FSIPreconditioner(Problem *problem_pt)
Constructor: By default use block triangular form with retained fluid on solid terms....
Matrix vector product helper class - primarily a wrapper to Trilinos's Epetra matrix vector product m...
void multiply(const DoubleVector &x, DoubleVector &y) const
Apply the operator to the vector x and return the result in the vector y.
A general mesh class.
Definition mesh.h:67
The least-squares commutator (LSC; formerly BFBT) Navier Stokes preconditioner. It uses blocks corres...
void set_navier_stokes_mesh(Mesh *mesh_pt, const bool &allow_multiple_element_type_in_navier_stokes_mesh=false)
Specify the mesh containing the block-preconditionable Navier-Stokes elements. The optional argument ...
void preconditioner_solve(const DoubleVector &r, DoubleVector &z)
Apply preconditioner to Vector r.
An OomphLibError object which should be thrown when an run-time error is encountered....
Preconditioner base class. Gives an interface to call all other preconditioners through and stores th...
double setup_time() const
Returns the time to setup the preconditioner.
virtual void setup(DoubleMatrixBase *matrix_pt)
Setup the preconditioner: store the matrix pointer and the communicator pointer then call preconditio...
virtual void preconditioner_solve(const DoubleVector &r, DoubleVector &z)=0
Apply the preconditioner. Pure virtual generic interface function. This method should apply the preco...
////////////////////////////////////////////////////////////////// //////////////////////////////////...
Definition problem.h:154
FSI preconditioner. This extracts upper/lower triangular blocks in the 3x3 overall block matrix struc...
bool Retain_fluid_onto_solid_terms
Boolean flag used to indicate that the fluid onto solid interaction terms are to be retained.
void preconditioner_solve(const DoubleVector &r, DoubleVector &z)
Apply preconditioner to r.
void set_wall_mesh(Mesh *mesh_pt, const bool &allow_multiple_element_type_in_wall_mesh=false)
Setter function for the mesh containing the block-preconditionable FSI solid elements.
Mesh * Wall_mesh_pt
pointer to the solid mesh
bool Retain_solid_onto_fluid_terms
Boolean flag used to indicate that the solid onto fluid interaction terms are to be retained.
bool Allow_multiple_element_type_in_wall_mesh
Flag for multiple element types in the Wall mesh.
~SimpleFSIPreconditioner()
Destructor: Clean up.
void use_block_triangular_version_with_solid_on_fluid()
Switch to block-triangular preconditioner in which action of solid dofs onto fluid equations is retai...
SimpleFSIPreconditioner(const SimpleFSIPreconditioner &)=delete
Broken copy constructor.
Mesh * Navier_stokes_mesh_pt
Pointer to the navier stokes mesh.
bool Allow_multiple_element_type_in_navier_stokes_mesh
Flag for multiple element types in the Navier-Stokes mesh.
void use_block_diagonal_version()
Switch to block-diagonal preconditioner.
Preconditioner * Preconditioner_pt
Preconditioner (inexact solver)
void setup()
Setup the preconditioner.
void set_navier_stokes_mesh(Mesh *mesh_pt, const bool &allow_multiple_element_type_in_navier_stokes_mesh=false)
Broken assignment operator.
virtual void identify_required_blocks(DenseMatrix< bool > &required_blocks)
Identify the required blocks: Here we only need the momentum, gradient and divergence blocks of the 2...
void use_block_triangular_version_with_fluid_on_solid()
Switch to block-triangular preconditioner in which action of fluid dofs onto solid equations is retai...
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
TAdvectionDiffusionReactionElement()
Constructor: Call constructors for TElement and AdvectionDiffusionReaction equations.
Preconditioner * create_exact_preconditioner()
Factory function to create suitable exact preconditioner.
double timer()
returns the time in seconds after some point in past
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
OomphInfo oomph_info
Single (global) instantiation of the OomphInfo object – this is used throughout the library as a "rep...