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

Class HomogeneousSaddlePointProblem

object --+
         |
        HomogeneousSaddlePointProblem
Known Subclasses:

This class provides a framework for solving linear homogeneous saddle point problems of the form:

   M{Av+B^*p=f}
   M{Bv     =0}

for the unknowns v and p and given operators A and B and given right hand side f. B^* is the adjoint operator of B.

Instance Methods [hide private]
 
__Aprod_GMRES(self, p)
 
__Aprod_PCG(self, p)
 
__Msolve_PCG(self, v)
 
__init__(self, **kwargs)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
__inner_GMRES(self, p0, p1)
 
__inner_PCG(self, p, v)
float
getAbsoluteTolerance(self)
Returns the absolute tolerance.
float
getSubProblemTolerance(self)
Returns the subproblem reduction factor.
float
getTolerance(self)
Returns the relative tolerance.
 
getV(self, p, v0)
return the value for v for a given p (overwrite)
 
initialize(self)
Initializes the problem (overwrite).
float
inner_p(self, p0, p1)
Returns inner product of p0 and p1 (overwrite).
float
inner_pBv(self, p, v)
Returns inner product of element p and Bv (overwrite).
equal to the type of p
norm_Bv(self, v)
Returns Bv (overwrite).
float
norm_p(self, p)
calculates the norm of p
non-negative float
norm_v(self, v)
Returns the norm of v (overwrite).
 
setAbsoluteTolerance(self, tolerance=0.0)
Sets the absolute tolerance.
 
setSubProblemTolerance(self, rtol=None)
Sets the relative tolerance to solve the subproblem(s).
 
setTolerance(self, tolerance=0.0001)
Sets the relative tolerance for (v,p).
tuple of Data objects
solve(self, v, p, max_iter=20, verbose=False, show_details=False, usePCG=True, iter_restart=20, max_correction_steps=10)
Solves the saddle point problem using initial guesses v and p.
 
solve_AinvBt(self, p)
Solves Av=B^*p with accuracy self.getSubProblemTolerance() (overwrite).
equal to the type of p
solve_precB(self, v)
Provides a preconditioner for BA^{-1}B^* with accuracy self.getSubProblemTolerance() (overwrite).

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, **kwargs)
(Constructor)

 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

getAbsoluteTolerance(self)

 

Returns the absolute tolerance.

Returns: float
absolute tolerance

getSubProblemTolerance(self)

 

Returns the subproblem reduction factor.

Returns: float
subproblem reduction factor

getTolerance(self)

 

Returns the relative tolerance.

Returns: float
relative tolerance

getV(self, p, v0)

 

return the value for v for a given p (overwrite)

Parameters:
  • p - a pressure
  • v0 - a initial guess for the value v to return.
Returns:
v given as v= A^{-1} (f-B^*p)

inner_p(self, p0, p1)

 

Returns inner product of p0 and p1 (overwrite).

Parameters:
  • p0 - a pressure
  • p1 - a pressure
Returns: float
inner product of p0 and p1

inner_pBv(self, p, v)

 

Returns inner product of element p and Bv (overwrite).

Parameters:
  • p - a pressure increment
  • v - a residual
Returns: float
inner product of element p and Bv

Note: used if PCG is applied.

norm_Bv(self, v)

 

Returns Bv (overwrite).

Returns: equal to the type of p

Note: boundary conditions on p should be zero!

norm_p(self, p)

 

calculates the norm of p

Parameters:
  • p - a pressure
Returns: float
the norm of p using the inner product for pressure

norm_v(self, v)

 

Returns the norm of v (overwrite).

Parameters:
  • v - a velovity
Returns: non-negative float
norm of v

setAbsoluteTolerance(self, tolerance=0.0)

 

Sets the absolute tolerance.

Parameters:
  • tolerance (non-negative float) - tolerance to be used

setSubProblemTolerance(self, rtol=None)

 

Sets the relative tolerance to solve the subproblem(s).

Parameters:
  • rtol (positive float) - relative tolerence

setTolerance(self, tolerance=0.0001)

 

Sets the relative tolerance for (v,p).

Parameters:
  • tolerance (non-negative float) - tolerance to be used

solve(self, v, p, max_iter=20, verbose=False, show_details=False, usePCG=True, iter_restart=20, max_correction_steps=10)

 

Solves the saddle point problem using initial guesses v and p.

Parameters:
  • v (Data) - initial guess for velocity
  • p (Data) - initial guess for pressure
  • usePCG (bool) - indicates the usage of the PCG rather than GMRES scheme.
  • max_iter (int) - maximum number of iteration steps per correction attempt
  • verbose (bool) - if True, shows information on the progress of the saddlepoint problem solver.
  • show_details (bool) - if True, shows details of the sub problem solver
  • iter_restart (int) - restart the iteration after iter_restart steps (only used if useUzaw=False)
Returns: tuple of Data objects

solve_AinvBt(self, p)

 

Solves Av=B^*p with accuracy self.getSubProblemTolerance() (overwrite).

Parameters:
  • p - a pressure increment
Returns:
the solution of Av=B^*p

Note: boundary conditions on v should be zero!

solve_precB(self, v)

 

Provides a preconditioner for BA^{-1}B^* with accuracy self.getSubProblemTolerance() (overwrite).

Returns: equal to the type of p

Note: boundary conditions on p should be zero!