Package esys :: Package escript :: Module pdetools :: Class SaddlePointProblem
[hide private]
[frames] | no frames]

Class SaddlePointProblem

object --+
         |
        SaddlePointProblem

This implements a solver for a saddle point problem

f(u,p)=0 g(u)=0

for u and p. The problem is solved with an inexact Uszawa scheme for p:

Q_f (u^{k+1}-u^{k}) = - f(u^{k},p^{k}) Q_g (p^{k+1}-p^{k}) = g(u^{k+1})

where Q_f is an approximation of the Jacobian A_f of f with respect to u and Q_f is an approximation of A_g A_f^{-1} A_g with A_g is the Jacobian of g with respect to p. As a the construction of a 'proper' Q_g can be difficult, non-linear conjugate gradient method is applied to solve for p, so Q_g plays in fact the role of a preconditioner.

Instance Methods [hide private]
 
__init__(self, verbose=False, *args)
Initializes the problem.
float
inner(self, p0, p1)
Inner product of p0 and p1 approximating p.
 
solve(self, u0, p0, tolerance=1e-06, tolerance_u=None, iter_max=100, accepted_reduction=0.995, relaxation=None)
Runs the solver.
escript.Data
solve_f(self, u, p, tol=1e-08)
Solves
escript.Data
solve_g(self, u, tol=1e-08)
Solves
 
trace(self, text)
Prints text if verbose has been set.

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables [hide private]
  subiter_max = 3
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, verbose=False, *args)
(Constructor)

 

Initializes the problem.

Parameters:
  • verbose (bool) - if True, some information is printed in the process
Overrides: object.__init__

Note: this method may be overwritten by a particular saddle point problem

inner(self, p0, p1)

 

Inner product of p0 and p1 approximating p. Typically this returns integrate(p0*p1).

Returns: float
inner product of p0 and p1

solve(self, u0, p0, tolerance=1e-06, tolerance_u=None, iter_max=100, accepted_reduction=0.995, relaxation=None)

 

Runs the solver.

Parameters:
  • u0 (esys.escript.Data) - initial guess for u
  • p0 (esys.escript.Data) - initial guess for p
  • tolerance (positive float) - tolerance for relative error in u and p
  • tolerance_u (positive float) - tolerance for relative error in u if different from tolerance
  • iter_max (int) - maximum number of iteration steps
  • accepted_reduction (positive float or None) - if the norm g cannot be reduced by accepted_reduction backtracking to adapt the relaxation factor. If accepted_reduction=None no backtracking is used.
  • relaxation (float or None) - initial relaxation factor. If relaxation==None, the last relaxation factor is used.

solve_f(self, u, p, tol=1e-08)

 

Solves

A_f du = f(u,p)

with tolerance tol and returns du. A_f is Jacobian of f with respect to u.

Parameters:
  • u (escript.Data) - current approximation of u
  • p (escript.Data) - current approximation of p
  • tol (float) - tolerance expected for du
Returns: escript.Data
increment du

Note: this method has to be overwritten by a particular saddle point problem

solve_g(self, u, tol=1e-08)

 

Solves

Q_g dp = g(u)

where Q_g is a preconditioner for A_g A_f^{-1} A_g with A_g is the Jacobian of g with respect to p.

Parameters:
  • u (escript.Data) - current approximation of u
  • tol (float) - tolerance expected for dp
Returns: escript.Data
increment dp

Note: this method has to be overwritten by a particular saddle point problem

trace(self, text)

 

Prints text if verbose has been set.

Parameters:
  • text (str) - a text message