Reference documentation for deal.II version 9.0.0
schur_complement.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2015 - 2018 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE at
12 // the top level of the deal.II distribution.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii_schur_complement_h
17 #define dealii_schur_complement_h
18 
19 #include <deal.II/base/config.h>
20 #include <deal.II/base/exceptions.h>
21 #include <deal.II/lac/vector_memory.h>
22 #include <deal.II/lac/linear_operator.h>
23 #include <deal.II/lac/packaged_operation.h>
24 
25 
26 DEAL_II_NAMESPACE_OPEN
27 
32 
225 template <typename Range_1, typename Domain_1,
226  typename Range_2, typename Domain_2,
227  typename Payload>
233 {
234  // We return the result of the compound LinearOperator
235  // directly, so as to ensure that the underlying Payload
236  // definition aligns with the operations expressed here.
237  // All of the memory allocations etc. are taken care of
238  // internally.
239  if (D.is_null_operator == false)
240  return D - C*A_inv*B;
241  else
242  return -1.0*C*A_inv*B;
243 }
244 
246 
247 
252 
275 template <typename Range_1, typename Domain_1,
276  typename Range_2, typename Payload>
280  const Range_1 &f,
281  const Range_2 &g)
282 {
283  // We return the result of the compound PackagedOperation
284  // directly, so as to ensure that the underlying Payload
285  // definition aligns with the operations expressed here.
286  // All of the memory allocations etc. are taken care of
287  // internally.
288  return g - C*A_inv*f;
289 }
290 
312 template <typename Range_1, typename Domain_1,
313  typename Domain_2, typename Payload>
317  const Domain_2 &y,
318  const Range_1 &f)
319 {
320  // We return the result of the compound PackagedOperation
321  // directly, so as to ensure that the underlying Payload
322  // definition aligns with the operations expressed here.
323  // All of the memory allocations etc. are taken care of
324  // internally.
325  return A_inv*(f - B*y);
326 }
327 
329 
330 DEAL_II_NAMESPACE_CLOSE
331 
332 #endif
PackagedOperation< Domain_1 > postprocess_schur_solution(const LinearOperator< Range_1, Domain_1, Payload > &A_inv, const LinearOperator< Range_1, Domain_2, Payload > &B, const Domain_2 &y, const Range_1 &f)
LinearOperator< Range_2, Domain_2, Payload > schur_complement(const LinearOperator< Domain_1, Range_1, Payload > &A_inv, const LinearOperator< Range_1, Domain_2, Payload > &B, const LinearOperator< Range_2, Domain_1, Payload > &C, const LinearOperator< Range_2, Domain_2, Payload > &D)
PackagedOperation< Range_2 > condense_schur_rhs(const LinearOperator< Range_1, Domain_1, Payload > &A_inv, const LinearOperator< Range_2, Domain_1, Payload > &C, const Range_1 &f, const Range_2 &g)