Reference documentation for deal.II version 8.5.1
schur_complement.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2015 - 2017 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 #ifdef DEAL_II_WITH_CXX11
26 
27 DEAL_II_NAMESPACE_OPEN
28 
33 
226 template <typename Range_1, typename Domain_1,
227  typename Range_2, typename Domain_2,
228  typename Payload>
234 {
235  // We return the result of the compound LinearOperator
236  // directly, so as to ensure that the underlying Payload
237  // definition aligns with the operations expressed here.
238  // All of the memory allocations etc. are taken care of
239  // internally.
240  if (D.is_null_operator == false)
241  return D - C*A_inv*B;
242  else
243  return -1.0*C*A_inv*B;
244 }
245 
247 
248 
253 
276 template <typename Range_1, typename Domain_1,
277  typename Range_2, typename Payload>
281  const Range_1 &f,
282  const Range_2 &g)
283 {
284  // We return the result of the compound PackagedOperation
285  // directly, so as to ensure that the underlying Payload
286  // definition aligns with the operations expressed here.
287  // All of the memory allocations etc. are taken care of
288  // internally.
289  return g - C*A_inv*f;
290 }
291 
313 template <typename Range_1, typename Domain_1,
314  typename Domain_2, typename Payload>
318  const Domain_2 &y,
319  const Range_1 &f)
320 {
321  // We return the result of the compound PackagedOperation
322  // directly, so as to ensure that the underlying Payload
323  // definition aligns with the operations expressed here.
324  // All of the memory allocations etc. are taken care of
325  // internally.
326  return A_inv*(f - B*y);
327 }
328 
330 
331 DEAL_II_NAMESPACE_CLOSE
332 
333 #endif // DEAL_II_WITH_CXX11
334 #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)