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]
float
Bv(self, v)
returns inner product of element p and div(v)
 
__init__(self, domain, adaptSubTolerance=True, **kwargs)
initialize the Stokes Problem
SolverOptions
getSolverOptionsDiv(self)
returns the solver options for solving the equation to project the divergence of the velocity onto the function space of presure.
SolverOptions
getSolverOptionsPressure(self)
returns the solver options used solve the equation for pressure.
SolverOptions
getSolverOptionsVelocity(self)
returns the solver options used solve the equation for velocity.
 
getV(self, p, v0)
return the value for v for a given p (overwrite)
 
initialize(self, f=<esys.escript.escriptcpp.Data object at 0x9e183c4>, fixed_u_mask=<esys.escript.escriptcpp.Data object at 0x9e183ec>, eta=1, surface_stress=<esys.escript.escriptcpp.Data object at 0x9e18414>, stress=<esys.escript.escriptcpp.Data object at 0x9e1843c>)
assigns values to the model parameters
float
inner_p(self, p0, p1)
Returns inner product of p0 and p1
float
inner_pBv(self, p, Bv)
returns inner product of element p and Bv=-div(v)
equal to the type of p
norm_Bv(self, Bv)
Returns Bv (overwrite).
non-negative float
norm_v(self, v)
returns the norm of v
 
setSolverOptionsDiv(self, options=None)
set the solver options for solving the equation to project the divergence of the velocity onto the function space of presure.
 
setSolverOptionsPressure(self, options=None)
set the solver options for solving the equation for pressure.
 
setSolverOptionsVelocity(self, options=None)
set the solver options for solving the equation for velocity.
 
setSubProblemTolerance(self)
Updates the tolerance for subproblems
 
solve_AinvBt(self, p)
Solves Av=B^*p with accuracy self.getSubProblemTolerance()
equal to the type of p
solve_prec(self, Bv)
applies preconditioner for for BA^{-1}B^* to Bv with accuracy self.getSubProblemTolerance()

Inherited from pdetools.HomogeneousSaddlePointProblem: adaptSubTolerance, getAbsoluteTolerance, getSubProblemTolerance, getTolerance, norm_p, setAbsoluteTolerance, 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]

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

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

 

initialize the Stokes Problem

Parameters:
  • domain (Domain) - domain of the problem. The approximation order needs to be two.
  • adaptSubTolerance (bool) - If True the tolerance for subproblem is set automatically.
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 0x9e183c4>, fixed_u_mask=<esys.escript.escriptcpp.Data object at 0x9e183ec>, eta=1, surface_stress=<esys.escript.escriptcpp.Data object at 0x9e18414>, stress=<esys.escript.escriptcpp.Data object at 0x9e1843c>)

 

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

 

returns inner product of element p and Bv=-div(v)

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

norm_Bv(self, Bv)

 

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

setSolverOptionsDiv(self, options=None)

 

set the solver options for solving the equation to project the divergence of the velocity onto the function space of presure.

Parameters:

setSolverOptionsPressure(self, options=None)

 

set the solver options for solving the equation for pressure.

Parameters:

setSolverOptionsVelocity(self, options=None)

 

set the solver options for solving the equation for velocity.

Parameters:

setSubProblemTolerance(self)

 

Updates the tolerance for subproblems

Overrides: pdetools.HomogeneousSaddlePointProblem.setSubProblemTolerance

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

 

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

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_prec

Note: boundary conditions on p are zero.