esys.escript.rheologies Package

Classes

class esys.escript.rheologies.IncompressibleIsotropicFlowCartesian(domain, stress=0, v=0, p=0, t=0, numMaterials=1, verbose=True)

Bases: esys.escript.rheologies.PowerLaw, esys.escript.rheologies.Rheology, esys.escript.flows.StokesProblemCartesian

This class implements the rheology of an isotropic Kelvin material.

Typical usage:

sp = IncompressibleIsotropicFlowCartesian(domain, stress=0, v=0)
sp.initialize(...)
v,p = sp.solve()
Note :This model has been used in the self-consistent plate-mantle model proposed in U{Hans-Bernd Muhlhaus<emailto:h.muhlhaus@uq.edu.au>} and U{Klaus Regenauer-Lieb<mailto:klaus.regenauer-lieb@csiro.au>}: I{Towards a self-consistent plate mantle model that includes elasticity: simple benchmarks and application to basic modes of convection}, see U{doi: 10.1111/j.1365-246X.2005.02742.x<http://www3.interscience.wiley.com/journal/118661486/abstract>}
Bv(v, tol)

returns inner product of element p and div(v)

Parameters:v – a residual
Returns:inner product of element p and div(v)
Return type:float
checkVerbose()

Returns True if verbose is switched on

Returns:value of verbosity flag
Return type:bool
getAbsoluteTolerance()

Returns the absolute tolerance.

Returns:absolute tolerance
Return type:float
getCurrentEtaEff()

returns the effective viscosity used in the last iteration step of the last time step.

getDV(p, v, tol)

return the value for v for a given p

Parameters:
  • p – a pressure
  • v – a initial guess for the value v to return.
Returns:

dv given as Adv=(f-Av-B^*p)

getDeviatoricStrain(v=None)

Returns deviatoric strain of current velocity or if v is present the deviatoric strain of velocity v:

Parameters:v (Data of rank 1) – a velocity field
Returns:deviatoric strain of the current velocity field or if v is present the deviatoric strain of velocity v
Return type:Data of rank 2
getDeviatoricStress()

Returns current deviatoric stress.

Returns:current deviatoric stress
Return type:Data of rank 2
getDomain()

returns the domain.

Returns:the domain
Return type:Domain
getElasticShearModulus()

returns the elastic shear modulus.

Returns:elastic shear modulus
getEtaEff(gamma_dot, eta0=None, pressure=None, dt=None, iter_max=30)

returns the effective viscosity eta_eff such that

tau=eta_eff * gamma_dot

by solving a non-linear problem for tau.

Parameters:
  • gamma_dot – equivalent strain gamma_dot
  • eta0 – initial guess for the effective viscosity (e.g from a previous time step). If not present, an initial guess is calculated.
  • pressure – pressure used to calculate yield condition
  • dt (positive float if present) – time step size. only needed if elastic component is considered.
  • iter_max (int) – maximum number of iteration steps.
Returns:

effective viscosity.

getEtaN(id=None)

returns the viscosity

Parameters:id (int) – if present, the viscosity for material id is returned.
Returns:the list of the viscosities for all matrials is returned. If id is present only the viscosity for material id is returned.
getEtaTolerance()

returns the relative tolerance for the effectice viscosity.

Returns:relative tolerance
Return type:positive float
getForce()

Returns the external force

Returns:external force
Return type:Data
getFriction()

returns the friction coefficient

Returns:friction coefficient
getGammaDot(D=None)

Returns current second invariant of deviatoric strain rate or if D is present the second invariant of D.

Parameters:D (Data of rank 0) – deviatoric strain rate tensor
Returns:second invariant of deviatoric strain
Return type:scalar Data
getNumMaterials()

returns the numebr of materials

Returns:number of materials
Return type:int
getPower(id=None)

returns the power in the power law

Parameters:id (int) – if present, the power for material id is returned.
Returns:the list of the powers for all matrials is returned. If id is present only the power for material id is returned.
getPressure()

Returns current pressure.

Returns:current stress
Return type:scalar Data
getRestorationFactor()

Returns the restoring force factor

@return: restoring force factor @rtype: C{float} or L{Data}

getSolverOptionsDiv()

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

Return type:SolverOptions
getSolverOptionsPressure()

returns the solver options used solve the equation for pressure. :rtype: SolverOptions

getSolverOptionsVelocity()

returns the solver options used solve the equation for velocity.

Return type:SolverOptions
getStress()

Returns current stress.

Returns:current stress
Return type:Data of rank 2
getSurfaceForce()

Returns the surface force

Returns:surface force
Return type:Data
getTau()

Returns current second invariant of deviatoric stress

Returns:second invariant of deviatoric stress
Return type:scalar Data
getTauT(id=None)

returns the transition stress

Parameters:id (int) – if present, the transition stress for material id is returned.
Returns:the list of the transition stresses for all matrials is returned. If id is present only the transition stress for material id is returned.
getTauY()

returns the yield stress

Returns:the yield stress
getTime()

Returns current time.

Returns:current time
Return type:float
getTolerance()

Returns the relative tolerance.

Returns:relative tolerance
Return type:float
getVelocity()

Returns current velocity.

Returns:current velocity
Return type:vector Data
getVelocityConstraint()

Returns the constraint for the velocity as a pair of the mask of the location of the constraint and the values.

Returns:the locations of fixed velocity and value of velocities at these locations
Return type:tuple of Data s
initialize(F=None, f=None, fixed_v_mask=None, v_boundary=None, restoration_factor=None)

sets external forces and velocity constraints

Parameters:
  • F (vector value/field) – external force
  • f (vector value/field on boundary) – surface force
  • fixed_v_mask (vector value/field) – location of constraints maked by positive values
  • v_boundary (vector value/field) – value of velocity at location of constraints
  • restoration_factor (scalar values/field) – factor for normal restoration force
Note :

Only changing parameters need to be specified.

inner_p(p0, p1)

Returns inner product of p0 and p1

Parameters:
  • p0 – a pressure
  • p1 – a pressure
Returns:

inner product of p0 and p1

Return type:

float

inner_pBv(p, Bv)

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

Parameters:
  • p – a pressure increment
  • Bv – a residual
Returns:

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

Return type:

float

norm_Bv(Bv)

Returns Bv (overwrite).

Return type:equal to the type of p
Note :boundary conditions on p should be zero!
norm_p(p)

calculates the norm of p

Parameters:p – a pressure
Returns:the norm of p using the inner product for pressure
Return type:float
norm_v(v)

returns the norm of v

Parameters:v – a velovity
Returns:norm of v
Return type:non-negative float
resetControlParameters(K_p=1.0, K_v=1.0, rtol_max=0.01, rtol_min=1e-07, chi_max=0.5, reduction_factor=0.3, theta=0.1)

sets a control parameter

Parameters:
  • K_p (float) – initial value for constant to adjust pressure tolerance
  • K_v (float) – initial value for constant to adjust velocity tolerance
  • rtol_max (float) – maximuim relative tolerance used to calculate presssure and velocity increment.
  • chi_max (float) – maximum tolerable converegence rate.
  • reduction_factor (float) – reduction factor for adjustment factors.
setAbsoluteTolerance(tolerance=0.0)

Sets the absolute tolerance.

Parameters:tolerance (non-negative float) – tolerance to be used
setControlParameter(K_p=None, K_v=None, rtol_max=None, rtol_min=None, chi_max=None, reduction_factor=None, theta=None)

sets a control parameter

Parameters:
  • K_p (float) – initial value for constant to adjust pressure tolerance
  • K_v (float) – initial value for constant to adjust velocity tolerance
  • rtol_max (float) – maximuim relative tolerance used to calculate presssure and velocity increment.
  • chi_max (float) – maximum tolerable converegence rate.
setDeviatoricStrain(D=None)

set deviatoric strain

Parameters:D (Data of rank 2) – new deviatoric strain. If D is not present the current velocity is used.
setDeviatoricStress(stress)

Sets the current deviatoric stress

Parameters:stress (Data of rank 2) – new deviatoric stress
setDruckerPragerLaw(tau_Y=None, friction=None)

Sets the parameters for the Drucker-Prager model.

Parameters:
  • tau_Y – yield stress
  • friction – friction coefficient
setElasticShearModulus(mu=None)

Sets the elastic shear modulus.

Parameters:mu – elastic shear modulus
setEtaTolerance(rtol=0.0001)

sets the relative tolerance for the effectice viscosity.

Parameters:rtol (positive float) – relative tolerance
setExternals(F=None, f=None, fixed_v_mask=None, v_boundary=None, restoration_factor=None)

sets external forces and velocity constraints

Parameters:
  • F (vector value/field) – external force
  • f (vector value/field on boundary) – surface force
  • fixed_v_mask (vector value/field) – location of constraints maked by positive values
  • v_boundary (vector value/field) – value of velocity at location of constraints
  • restoration_factor (scalar values/field) – factor for normal restoration force
Note :

Only changing parameters need to be specified.

setGammaDot(gammadot=None)

set the second invariant of deviatoric strain rate. If gammadot is not present zero is used.

Parameters:gammadot (Data of rank 1) – second invariant of deviatoric strain rate.
setPowerLaw(eta_N, id=0, tau_t=1, power=1)

Sets the power-law parameters for material id

Parameters:
  • id (int) – material id
  • eta_N – viscosity for tau=tau_t
  • tau_t – transition stress
  • power – power law coefficient
setPowerLaws(eta_N, tau_t, power)

Sets the parameters of the power-law for all materials.

Parameters:
  • eta_N – list of viscosities for tau=tau_t
  • tau_t – list of transition stresses
  • power – list of power law coefficient
setPressure(p)

Sets current pressure. :param p: new deviatoric stress :type p: scalar Data

setSolverOptionsDiv(options=None)

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

Parameters:options (SolverOptions) – new solver options
setSolverOptionsPressure(options=None)

set the solver options for solving the equation for pressure. :param options: new solver options :type options: SolverOptions

setSolverOptionsVelocity(options=None)

set the solver options for solving the equation for velocity.

Parameters:options (SolverOptions) – new solver options
setStatus(t, v, p, stress)

Resets the current status given by pressure p and velocity v.

@param t: new time mark @type t: C{float} @param v: new current velocity @type v: vector L{Data} @param p: new deviatoric stress @type p: scalar L{Data} @param stress: new deviatoric stress @type stress: L{Data} of rank 2

setStokesEquation(f=None, fixed_u_mask=None, eta=None, surface_stress=None, stress=None, restoration_factor=None)

assigns new values to the model parameters.

Parameters:
  • f (Vector object in FunctionSpace Function or similar) – external force
  • fixed_u_mask (Vector object on FunctionSpace Solution or similar) – mask of locations with fixed velocity.
  • eta (Scalar object on FunctionSpace Function or similar) – viscosity
  • surface_stress (Vector object on FunctionSpace FunctionOnBoundary or similar) – normal surface stress
  • stress (Tensor object on FunctionSpace Function or similar) – initial stress
setTime(t=0.0)

Updates current time.

Parameters:t (float) – new time mark
setTolerance(tolerance=0.0001)

Sets the relative tolerance for (v,p).

Parameters:tolerance (non-negative float) – tolerance to be used
setVelocity(v)

Sets current velocity.

Parameters:v (vector Data) – new current velocity
solve(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)
Return type:

tuple of Data objects

Note :

typically this method is overwritten by a subclass. It provides a wrapper for the _solve method.

solve_AinvBt(p, tol)

Solves Av=B^*p with accuracy tol

Parameters:p – a pressure increment
Returns:the solution of Av=B^*p
Note :boundary conditions on v should be zero!
solve_prec(Bv, tol)

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

Parameters:Bv – velocity increment
Returns:p=P(Bv) where P^{-1} is an approximation of BA^{-1}B^ * )
Note :boundary conditions on p are zero.
update(dt, iter_max=10, eta_iter_max=20, verbose=False, usePCG=True, max_correction_steps=50)

Updates stress, velocity and pressure for time increment dt.

Parameters:
  • dt – time increment
  • iter_max – maximum number of iteration steps in the incompressible solver
  • eta_iter_max – maximum number of iteration steps in the incompressible solver
  • verbose – prints some infos in the incompressible solver
updateStokesEquation(v, p)

updates the underlying Stokes equation to consider dependencies from v and p

validMaterialId(id=0)

checks if a given material id is valid

Parameters:id (int) – a material id
Returns:True is the id is valid
Return type:bool
class esys.escript.rheologies.MaxIterReached

Bases: esys.escript.pdetools.SolverSchemeException

Exception thrown if the maximum number of iteration steps is reached.

args
message
class esys.escript.rheologies.PowerLaw(numMaterials=1, verbose=False)

Bases: object

this implements the power law for a composition of a set of materials where the viscosity eta of each material is given by a power law relationship of the form

eta=eta_N*(tau/tau_t)**(1./power-1.)

where tau is equivalent stress and eta_N, tau_t and power are given constant. Moreover an elastic component can be considered. Moreover tau meets the Drucker-Prager type yield condition

tau <= tau_Y + friction * pressure

where gamma_dot is the equivalent.

getElasticShearModulus()

returns the elastic shear modulus.

Returns:elastic shear modulus
getEtaEff(gamma_dot, eta0=None, pressure=None, dt=None, iter_max=30)

returns the effective viscosity eta_eff such that

tau=eta_eff * gamma_dot

by solving a non-linear problem for tau.

Parameters:
  • gamma_dot – equivalent strain gamma_dot
  • eta0 – initial guess for the effective viscosity (e.g from a previous time step). If not present, an initial guess is calculated.
  • pressure – pressure used to calculate yield condition
  • dt (positive float if present) – time step size. only needed if elastic component is considered.
  • iter_max (int) – maximum number of iteration steps.
Returns:

effective viscosity.

getEtaN(id=None)

returns the viscosity

Parameters:id (int) – if present, the viscosity for material id is returned.
Returns:the list of the viscosities for all matrials is returned. If id is present only the viscosity for material id is returned.
getEtaTolerance()

returns the relative tolerance for the effectice viscosity.

Returns:relative tolerance
Return type:positive float
getFriction()

returns the friction coefficient

Returns:friction coefficient
getNumMaterials()

returns the numebr of materials

Returns:number of materials
Return type:int
getPower(id=None)

returns the power in the power law

Parameters:id (int) – if present, the power for material id is returned.
Returns:the list of the powers for all matrials is returned. If id is present only the power for material id is returned.
getTauT(id=None)

returns the transition stress

Parameters:id (int) – if present, the transition stress for material id is returned.
Returns:the list of the transition stresses for all matrials is returned. If id is present only the transition stress for material id is returned.
getTauY()

returns the yield stress

Returns:the yield stress
setDruckerPragerLaw(tau_Y=None, friction=None)

Sets the parameters for the Drucker-Prager model.

Parameters:
  • tau_Y – yield stress
  • friction – friction coefficient
setElasticShearModulus(mu=None)

Sets the elastic shear modulus.

Parameters:mu – elastic shear modulus
setEtaTolerance(rtol=0.0001)

sets the relative tolerance for the effectice viscosity.

Parameters:rtol (positive float) – relative tolerance
setPowerLaw(eta_N, id=0, tau_t=1, power=1)

Sets the power-law parameters for material id

Parameters:
  • id (int) – material id
  • eta_N – viscosity for tau=tau_t
  • tau_t – transition stress
  • power – power law coefficient
setPowerLaws(eta_N, tau_t, power)

Sets the parameters of the power-law for all materials.

Parameters:
  • eta_N – list of viscosities for tau=tau_t
  • tau_t – list of transition stresses
  • power – list of power law coefficient
validMaterialId(id=0)

checks if a given material id is valid

Parameters:id (int) – a material id
Returns:True is the id is valid
Return type:bool
class esys.escript.rheologies.Rheology(domain, stress=None, v=None, p=None, t=0, verbose=True)

Bases: object

General framework to implement a rheology

checkVerbose()

Returns True if verbose is switched on

Returns:value of verbosity flag
Return type:bool
getDeviatoricStrain(v=None)

Returns deviatoric strain of current velocity or if v is present the deviatoric strain of velocity v:

Parameters:v (Data of rank 1) – a velocity field
Returns:deviatoric strain of the current velocity field or if v is present the deviatoric strain of velocity v
Return type:Data of rank 2
getDeviatoricStress()

Returns current deviatoric stress.

Returns:current deviatoric stress
Return type:Data of rank 2
getDomain()

returns the domain.

Returns:the domain
Return type:Domain
getForce()

Returns the external force

Returns:external force
Return type:Data
getGammaDot(D=None)

Returns current second invariant of deviatoric strain rate or if D is present the second invariant of D.

Parameters:D (Data of rank 0) – deviatoric strain rate tensor
Returns:second invariant of deviatoric strain
Return type:scalar Data
getPressure()

Returns current pressure.

Returns:current stress
Return type:scalar Data
getRestorationFactor()

Returns the restoring force factor

@return: restoring force factor @rtype: C{float} or L{Data}

getStress()

Returns current stress.

Returns:current stress
Return type:Data of rank 2
getSurfaceForce()

Returns the surface force

Returns:surface force
Return type:Data
getTau()

Returns current second invariant of deviatoric stress

Returns:second invariant of deviatoric stress
Return type:scalar Data
getTime()

Returns current time.

Returns:current time
Return type:float
getVelocity()

Returns current velocity.

Returns:current velocity
Return type:vector Data
getVelocityConstraint()

Returns the constraint for the velocity as a pair of the mask of the location of the constraint and the values.

Returns:the locations of fixed velocity and value of velocities at these locations
Return type:tuple of Data s
setDeviatoricStrain(D=None)

set deviatoric strain

Parameters:D (Data of rank 2) – new deviatoric strain. If D is not present the current velocity is used.
setDeviatoricStress(stress)

Sets the current deviatoric stress

Parameters:stress (Data of rank 2) – new deviatoric stress
setExternals(F=None, f=None, fixed_v_mask=None, v_boundary=None, restoration_factor=None)

sets external forces and velocity constraints

Parameters:
  • F (vector value/field) – external force
  • f (vector value/field on boundary) – surface force
  • fixed_v_mask (vector value/field) – location of constraints maked by positive values
  • v_boundary (vector value/field) – value of velocity at location of constraints
  • restoration_factor (scalar values/field) – factor for normal restoration force
Note :

Only changing parameters need to be specified.

setGammaDot(gammadot=None)

set the second invariant of deviatoric strain rate. If gammadot is not present zero is used.

Parameters:gammadot (Data of rank 1) – second invariant of deviatoric strain rate.
setPressure(p)

Sets current pressure. :param p: new deviatoric stress :type p: scalar Data

setStatus(t, v, p, stress)

Resets the current status given by pressure p and velocity v.

@param t: new time mark @type t: C{float} @param v: new current velocity @type v: vector L{Data} @param p: new deviatoric stress @type p: scalar L{Data} @param stress: new deviatoric stress @type stress: L{Data} of rank 2

setTime(t=0.0)

Updates current time.

Parameters:t (float) – new time mark
setVelocity(v)

Sets current velocity.

Parameters:v (vector Data) – new current velocity
class esys.escript.rheologies.StokesProblemCartesian(domain, **kwargs)

Bases: esys.escript.pdetools.HomogeneousSaddlePointProblem

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) sp.setStokesEquation(...) # new values for some parameters v1,p1=sp.solve(v,p)
Bv(v, tol)

returns inner product of element p and div(v)

Parameters:v – a residual
Returns:inner product of element p and div(v)
Return type:float
getAbsoluteTolerance()

Returns the absolute tolerance.

Returns:absolute tolerance
Return type:float
getDV(p, v, tol)

return the value for v for a given p

Parameters:
  • p – a pressure
  • v – a initial guess for the value v to return.
Returns:

dv given as Adv=(f-Av-B^*p)

getSolverOptionsDiv()

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

Return type:SolverOptions
getSolverOptionsPressure()

returns the solver options used solve the equation for pressure. :rtype: SolverOptions

getSolverOptionsVelocity()

returns the solver options used solve the equation for velocity.

Return type:SolverOptions
getTolerance()

Returns the relative tolerance.

Returns:relative tolerance
Return type:float
initialize(f=<esys.escript.escriptcpp.Data object at 0x6378c00>, fixed_u_mask=<esys.escript.escriptcpp.Data object at 0x6378c58>, eta=1, surface_stress=<esys.escript.escriptcpp.Data object at 0x6378cb0>, stress=<esys.escript.escriptcpp.Data object at 0x6378d08>, restoration_factor=0)

assigns values to the model parameters

Parameters:
  • f (Vector object in FunctionSpace Function or similar) – external force
  • fixed_u_mask (Vector object on FunctionSpace Solution or similar) – mask of locations with fixed velocity.
  • eta (Scalar object on FunctionSpace Function or similar) – viscosity
  • surface_stress (Vector object on FunctionSpace FunctionOnBoundary or similar) – normal surface stress
  • stress (Tensor object on FunctionSpace Function or similar) – initial stress
inner_p(p0, p1)

Returns inner product of p0 and p1

Parameters:
  • p0 – a pressure
  • p1 – a pressure
Returns:

inner product of p0 and p1

Return type:

float

inner_pBv(p, Bv)

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

Parameters:
  • p – a pressure increment
  • Bv – a residual
Returns:

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

Return type:

float

norm_Bv(Bv)

Returns Bv (overwrite).

Return type:equal to the type of p
Note :boundary conditions on p should be zero!
norm_p(p)

calculates the norm of p

Parameters:p – a pressure
Returns:the norm of p using the inner product for pressure
Return type:float
norm_v(v)

returns the norm of v

Parameters:v – a velovity
Returns:norm of v
Return type:non-negative float
resetControlParameters(K_p=1.0, K_v=1.0, rtol_max=0.01, rtol_min=1e-07, chi_max=0.5, reduction_factor=0.3, theta=0.1)

sets a control parameter

Parameters:
  • K_p (float) – initial value for constant to adjust pressure tolerance
  • K_v (float) – initial value for constant to adjust velocity tolerance
  • rtol_max (float) – maximuim relative tolerance used to calculate presssure and velocity increment.
  • chi_max (float) – maximum tolerable converegence rate.
  • reduction_factor (float) – reduction factor for adjustment factors.
setAbsoluteTolerance(tolerance=0.0)

Sets the absolute tolerance.

Parameters:tolerance (non-negative float) – tolerance to be used
setControlParameter(K_p=None, K_v=None, rtol_max=None, rtol_min=None, chi_max=None, reduction_factor=None, theta=None)

sets a control parameter

Parameters:
  • K_p (float) – initial value for constant to adjust pressure tolerance
  • K_v (float) – initial value for constant to adjust velocity tolerance
  • rtol_max (float) – maximuim relative tolerance used to calculate presssure and velocity increment.
  • chi_max (float) – maximum tolerable converegence rate.
setSolverOptionsDiv(options=None)

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

Parameters:options (SolverOptions) – new solver options
setSolverOptionsPressure(options=None)

set the solver options for solving the equation for pressure. :param options: new solver options :type options: SolverOptions

setSolverOptionsVelocity(options=None)

set the solver options for solving the equation for velocity.

Parameters:options (SolverOptions) – new solver options
setStokesEquation(f=None, fixed_u_mask=None, eta=None, surface_stress=None, stress=None, restoration_factor=None)

assigns new values to the model parameters.

Parameters:
  • f (Vector object in FunctionSpace Function or similar) – external force
  • fixed_u_mask (Vector object on FunctionSpace Solution or similar) – mask of locations with fixed velocity.
  • eta (Scalar object on FunctionSpace Function or similar) – viscosity
  • surface_stress (Vector object on FunctionSpace FunctionOnBoundary or similar) – normal surface stress
  • stress (Tensor object on FunctionSpace Function or similar) – initial stress
setTolerance(tolerance=0.0001)

Sets the relative tolerance for (v,p).

Parameters:tolerance (non-negative float) – tolerance to be used
solve(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)
Return type:

tuple of Data objects

Note :

typically this method is overwritten by a subclass. It provides a wrapper for the _solve method.

solve_AinvBt(p, tol)

Solves Av=B^*p with accuracy tol

Parameters:p – a pressure increment
Returns:the solution of Av=B^*p
Note :boundary conditions on v should be zero!
solve_prec(Bv, tol)

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

Parameters:Bv – velocity increment
Returns:p=P(Bv) where P^{-1} is an approximation of BA^{-1}B^ * )
Note :boundary conditions on p are zero.
updateStokesEquation(v, p)

updates the Stokes equation to consider dependencies from v and p :note: This method can be overwritten by a subclass. Use setStokesEquation to set new values to model parameters.

Functions

Others

  • __author__
  • __builtins__
  • __copyright__
  • __doc__
  • __file__
  • __license__
  • __name__
  • __package__
  • __url__