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]
equal to the type of p
Bv(self, v)
Returns Bv (overwrite).
 
__Aprod_GMRES(self, p)
 
__Aprod_PCG(self, p)
 
__Msolve_PCG(self, r)
 
__init__(self, adaptSubTolerance=True, **kwargs)
initializes the saddle point problem
 
__inner_GMRES(self, p0, p1)
 
__inner_PCG(self, p, r)
 
adaptSubTolerance(self)
Returns True if tolerance adaption for subproblem is choosen.
float
getAbsoluteTolerance(self)
Returns the absolute tolerance.
 
getSubProblemTolerance(self)
Sets the relative tolerance to solve the subproblem(s).
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, Bv)
Returns inner product of element p and Bv (overwrite).
equal to the type of p
norm_Bv(self, Bv)
Returns the norm of 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)
Updates the tolerance for subproblems
 
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, 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_prec(self, Bv)
Provides a preconditioner for BA^{-1}B^* applied to Bv 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]

Bv(self, v)

 

Returns Bv (overwrite).

Returns: equal to the type of p

Note: boundary conditions on p should be zero!

__init__(self, adaptSubTolerance=True, **kwargs)
(Constructor)

 

initializes the saddle point problem

Parameters:
  • adaptSubTolerance (bool) - If True the tolerance for subproblem is set automatically.
Overrides: object.__init__

getAbsoluteTolerance(self)

 

Returns the absolute tolerance.

Returns: float
absolute tolerance

getSubProblemTolerance(self)

 

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

Parameters:
  • rtol (positive float) - relative tolerence

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, Bv)

 

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, Bv)

 

Returns the norm of 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)

 

Updates the tolerance for subproblems

Note: method is typically the method is overwritten.

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, 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.
  • 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_prec(self, Bv)

 

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

Returns: equal to the type of p

Note: boundary conditions on p should be zero!