Package esys :: Package escript :: Module flows :: Class StokesProblemCartesian
[hide private]
[frames] | no frames]

Class StokesProblemCartesian

                            object --+    
                                     |    
pdetools.HomogeneousSaddlePointProblem --+
                                         |
                                        StokesProblemCartesian


solves

     -(eta*(u_{i,j}+u_{j,i}))_j + p_i = f_i-stress_{ij,j}
           u_{i,i}=0

     u=0 where  fixed_u_mask>0
     eta*(u_{i,j}+u_{j,i})*n_j-p*n_i=surface_stress +stress_{ij}n_j

if surface_stress is not given 0 is assumed.

typical usage:

       sp=StokesProblemCartesian(domain)
       sp.setTolerance()
       sp.initialize(...)
       v,p=sp.solve(v0,p0)

Instance Methods [hide private]
 
__init__(self, domain, **kwargs)
initialize the Stokes Problem
 
getV(self, p, v0)
return the value for v for a given p (overwrite)
 
initialize(self, f=<esys.escript.escriptcpp.Data object at 0x9d4643c>, fixed_u_mask=<esys.escript.escriptcpp.Data object at 0x9d46464>, eta=1, surface_stress=<esys.escript.escriptcpp.Data object at 0x9d4648c>, stress=<esys.escript.escriptcpp.Data object at 0x9d464b4>)
assigns values to the model parameters
float
inner_p(self, p0, p1)
Returns inner product of p0 and p1
float
inner_pBv(self, p, v)
returns inner product of element p and div(v)
equal to the type of p
norm_Bv(self, v)
Returns Bv (overwrite).
non-negative float
norm_v(self, v)
returns the norm of v
 
solve_AinvBt(self, p)
Solves Av=B^*p with accuracy self.getSubProblemTolerance()
equal to the type of p
solve_precB(self, v)
applies preconditioner for for BA^{-1}B^* to Bv with accuracy self.getSubProblemTolerance() (overwrite).

Inherited from pdetools.HomogeneousSaddlePointProblem: getAbsoluteTolerance, getSubProblemTolerance, getTolerance, norm_p, setAbsoluteTolerance, setSubProblemTolerance, setTolerance, solve

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, domain, **kwargs)
(Constructor)

 

initialize the Stokes Problem

Parameters:
  • domain (Domain) - domain of the problem. The approximation order needs to be two.
Overrides: object.__init__

Warning: The apprximation order needs to be two otherwise you may see oscilations in the pressure.

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)
Overrides: pdetools.HomogeneousSaddlePointProblem.getV

initialize(self, f=<esys.escript.escriptcpp.Data object at 0x9d4643c>, fixed_u_mask=<esys.escript.escriptcpp.Data object at 0x9d46464>, eta=1, surface_stress=<esys.escript.escriptcpp.Data object at 0x9d4648c>, stress=<esys.escript.escriptcpp.Data object at 0x9d464b4>)

 

assigns values to the model parameters

Parameters:
Overrides: pdetools.HomogeneousSaddlePointProblem.initialize

Note: All values needs to be set.

inner_p(self, p0, p1)

 

Returns inner product of p0 and p1

Parameters:
  • p0 - a pressure
  • p1 - a pressure
Returns: float
inner product of p0 and p1
Overrides: pdetools.HomogeneousSaddlePointProblem.inner_p

inner_pBv(self, p, v)

 

returns inner product of element p and div(v)

Parameters:
  • p - a pressure increment
  • v - a residual
Returns: float
inner product of element p and div(v)
Overrides: pdetools.HomogeneousSaddlePointProblem.inner_pBv

norm_Bv(self, v)

 

Returns Bv (overwrite).

Returns: equal to the type of p
Overrides: pdetools.HomogeneousSaddlePointProblem.norm_Bv

Note: boundary conditions on p should be zero!

norm_v(self, v)

 

returns the norm of v

Parameters:
  • v - a velovity
Returns: non-negative float
norm of v
Overrides: pdetools.HomogeneousSaddlePointProblem.norm_v

solve_AinvBt(self, p)

 

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

Parameters:
  • p - a pressure increment
Returns:
the solution of Av=B^*p
Overrides: pdetools.HomogeneousSaddlePointProblem.solve_AinvBt

Note: boundary conditions on v should be zero!

solve_precB(self, v)

 

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

Parameters:
  • v - velocity increment
Returns: equal to the type of p
p=P(Bv) where P^{-1} is an approximation of BA^{-1}B^*
Overrides: pdetools.HomogeneousSaddlePointProblem.solve_precB

Note: boundary conditions on p are zero.