esys.modellib.flow Package

Classes

class esys.modellib.flow.Data((object)arg1)

Bases: Boost.Python.instance

Represents a collection of datapoints. It is used to store the values of a function. For more details please consult the c++ class documentation.

copy((Data)arg1, (Data)other) → None :

Make this object a copy of other

note:The two objects will act independently from now on. That is, changing other after this call will not change this object and vice versa.
copy( (Data)arg1) -> Data :
note:In the no argument form, a new object will be returned which is an independent copy of this object.
copyWithMask((Data)arg1, (Data)other, (Data)mask) → None :

Selectively copy values from other Data.Datapoints which correspond to positive values in mask will be copied from other

Parameters:
  • other (Data) – source of values
  • mask (Scalar Data) –
delay((Data)arg1) → Data :

Convert this object into lazy representation

dump((Data)arg1, (str)fileName) → None :

Save the data as a netCDF file

Parameters:fileName (string) –
expand((Data)arg1) → None :

Convert the data to expanded representation if it is not expanded already.

getDomain((Data)arg1) → Domain :
Return type:Domain
getFunctionSpace((Data)arg1) → FunctionSpace :
Return type:FunctionSpace
getNumberOfDataPoints((Data)arg1) → int :
Return type:int
Returns:Number of datapoints in the object
getRank((Data)arg1) → int :
Returns:the number of indices required to address a component of a datapoint
Return type:positive int
getShape((Data)arg1) → tuple :

Returns the shape of the datapoints in this object as a python tuple. Scalar data has the shape ()

Return type:tuple
getTagNumber((Data)arg1, (int)dpno) → int :

Return tag number for the specified datapoint

Return type:int
Parameters:dpno (int) – datapoint number
getTupleForDataPoint((Data)arg1, (int)dataPointNo) → object :
Returns:Value of the specified datapoint
Return type:tuple
Parameters:dataPointNo (int) – datapoint to access
getTupleForGlobalDataPoint((Data)arg1, (int)procNo, (int)dataPointNo) → object :

Get a specific datapoint from a specific process

Return type:

tuple

Parameters:
  • procNo (positive int) – MPI rank of the process
  • dataPointNo (int) – datapoint to access
interpolate((Data)arg1, (FunctionSpace)functionspace) → Data :

Interpolate this object’s values into a new functionspace.

interpolateTable((Data)arg1, (object)table, (float)Amin, (float)Astep, (Data)B, (float)Bmin, (float)Bstep[, (float)undef=1e+50[, (bool)check_boundaries=False]]) → Data :

Creates a new Data object by interpolating using the source data (which are looked up in table) A must be the outer dimension on the table

param table:two dimensional collection of values
param Amin:The base of locations in table
type Amin:float
param Astep:size of gap between each item in the table
type Astep:float
param undef:upper bound on interpolated values
type undef:float
param B:Scalar representing the second coordinate to be mapped into the table
type B:Data
param Bmin:The base of locations in table for 2nd dimension
type Bmin:float
param Bstep:size of gap between each item in the table for 2nd dimension
type Bstep:float
param check_boundaries:
 if true, then values outside the boundaries will be rejected. If false, then boundary values will be used.
raise RuntimeError(DataException):
 if the coordinates do not map into the table or if the interpolated value is above undef
rtype:Data

interpolateTable( (Data)arg1, (object)table, (float)Amin, (float)Astep [, (float)undef=1e+50 [, (bool)check_boundaries=False]]) -> Data

isConstant((Data)arg1) → bool :
Return type:bool
Returns:True if this Data is an instance of DataConstant
Note:This does not mean the data is immutable.
isEmpty((Data)arg1) → bool :

Is this object an instance of DataEmpty

Return type:bool
Note:This is not the same thing as asking if the object contains datapoints.
isExpanded((Data)arg1) → bool :
Return type:bool
Returns:True if this Data is expanded.
isLazy((Data)arg1) → bool :
Return type:bool
Returns:True if this Data is lazy.
isProtected((Data)arg1) → bool :

Can this instance be modified. :rtype: bool

isReady((Data)arg1) → bool :
Return type:bool
Returns:True if this Data is not lazy.
isTagged((Data)arg1) → bool :
Return type:bool
Returns:True if this Data is expanded.
maxGlobalDataPoint((Data)arg1) → tuple :

Please consider using getSupLocator() from pdetools instead.

minGlobalDataPoint((Data)arg1) → tuple :

Please consider using getInfLocator() from pdetools instead.

nonuniformInterpolate((Data)arg1, (object)in, (object)out, (bool)check_boundaries) → Data :

1D interpolation with non equally spaced points

nonuniformSlope((Data)arg1, (object)in, (object)out, (bool)check_boundaries) → Data :

1D interpolation of slope with non equally spaced points

resolve((Data)arg1) → None :

Convert the data to non-lazy representation.

setProtection((Data)arg1) → None :

Disallow modifications to this data object

Note:This method does not allow you to undo protection.
setTaggedValue((Data)arg1, (int)tagKey, (object)value) → None :

Set the value of tagged Data.

param tagKey:tag to update
type tagKey:int
setTaggedValue( (Data)arg1, (str)name, (object)value) -> None :
param name:tag to update
type name:string
param value:value to set tagged data to
type value:object which acts like an array, tuple or list
setToZero((Data)arg1) → None :

After this call the object will store values of the same shape as before but all components will be zero.

setValueOfDataPoint((Data)arg1, (int)dataPointNo, (object)value) → None

setValueOfDataPoint( (Data)arg1, (int)arg2, (object)arg3) -> None

setValueOfDataPoint( (Data)arg1, (int)arg2, (float)arg3) -> None :

Modify the value of a single datapoint.

param dataPointNo:
 
type dataPointNo:
 int
param value:
type value:float or an object which acts like an array, tuple or list
warning:Use of this operation is discouraged. It prevents some optimisations from operating.
tag((Data)arg1) → None :

Convert data to tagged representation if it is not already tagged or expanded

toListOfTuples((Data)arg1[, (bool)scalarastuple=False]) → object :

Return the datapoints of this object in a list. Each datapoint is stored as a tuple.

Parameters:scalarastuple – if True, scalar data will be wrapped as a tuple. True => [(0), (1), (2)]; False => [0, 1, 2]
class esys.modellib.flow.IterationDivergenceError

Bases: exceptions.Exception

Exception which is thrown if there is no convergence of the iteration process at a time step.

But there is a chance that a smaller step could help to reach convergence.

args
message
class esys.modellib.flow.LameEquation(domain, debug=False, useFast=False)

Bases: esys.escriptcore.linearPDEs.LinearPDE

Class to define a Lame equation problem. This problem is defined as:

-grad(mu*(grad(u[i])[j]+grad(u[j])[i]))[j] - grad(lambda*grad(u[k])[k])[j] = F_i -grad(sigma[ij])[j]

with natural boundary conditions:

n[j]*(mu*(grad(u[i])[j]+grad(u[j])[i]) + lambda*grad(u[k])[k]) = f_i +n[j]*sigma[ij]

and constraints:

u[i]=r[i] where q[i]>0

alteredCoefficient(name)

Announces that coefficient name has been changed.

Parameters:name (string) – name of the coefficient affected
Raises IllegalCoefficient:
 if name is not a coefficient of the PDE
Note:if name is q or r, the method will not trigger a rebuild of the system as constraints are applied to the solved system.
checkReciprocalSymmetry(name0, name1, verbose=True)

Tests two coefficients for reciprocal symmetry.

Parameters:
  • name0 (str) – name of the first coefficient
  • name1 (str) – name of the second coefficient
  • verbose (bool) – if set to True or not present a report on coefficients which break the symmetry is printed
Returns:

True if coefficients name0 and name1 are reciprocally symmetric.

Return type:

bool

checkSymmetricTensor(name, verbose=True)

Tests a coefficient for symmetry.

Parameters:
  • name (str) – name of the coefficient
  • verbose (bool) – if set to True or not present a report on coefficients which break the symmetry is printed.
Returns:

True if coefficient name is symmetric

Return type:

bool

checkSymmetry(verbose=True)

Tests the PDE for symmetry.

Parameters:verbose (bool) – if set to True or not present a report on coefficients which break the symmetry is printed.
Returns:True if the PDE is symmetric
Return type:bool
Note:This is a very expensive operation. It should be used for degugging only! The symmetry flag is not altered.
createCoefficient(name)

Creates a Data object corresponding to coefficient name.

Returns:the coefficient name initialized to 0
Return type:Data
Raises IllegalCoefficient:
 if name is not a coefficient of the PDE
createOperator()

Returns an instance of a new operator.

createRightHandSide()

Returns an instance of a new right hand side.

createSolution()

Returns an instance of a new solution.

getCoefficient(name)

Returns the value of the coefficient name of the general PDE.

Parameters:name (string) – name of the coefficient requested
Returns:the value of the coefficient name
Return type:Data
Raises IllegalCoefficient:
 invalid coefficient name
getCurrentOperator()

Returns the operator in its current state.

getCurrentRightHandSide()

Returns the right hand side in its current state.

getCurrentSolution()

Returns the solution in its current state.

getDim()

Returns the spatial dimension of the PDE.

Returns:the spatial dimension of the PDE domain
Return type:int
getDomain()

Returns the domain of the PDE.

Returns:the domain of the PDE
Return type:Domain
getDomainStatus()

Return the status indicator of the domain

getFlux(u=None)

Returns the flux J for a given u.

J[i,j]=(A[i,j,k,l]+A_reduced[A[i,j,k,l]]*grad(u[k])[l]+(B[i,j,k]+B_reduced[i,j,k])u[k]-X[i,j]-X_reduced[i,j]

or

J[j]=(A[i,j]+A_reduced[i,j])*grad(u)[l]+(B[j]+B_reduced[j])u-X[j]-X_reduced[j]

Parameters:u (Data or None) – argument in the flux. If u is not present or equals None the current solution is used.
Returns:flux
Return type:Data
getFunctionSpaceForCoefficient(name)

Returns the FunctionSpace to be used for coefficient name.

Parameters:name (string) – name of the coefficient enquired
Returns:the function space to be used for coefficient name
Return type:FunctionSpace
Raises IllegalCoefficient:
 if name is not a coefficient of the PDE
getFunctionSpaceForEquation()

Returns the FunctionSpace used to discretize the equation.

Returns:representation space of equation
Return type:FunctionSpace
getFunctionSpaceForSolution()

Returns the FunctionSpace used to represent the solution.

Returns:representation space of solution
Return type:FunctionSpace
getNumEquations()

Returns the number of equations.

Returns:the number of equations
Return type:int
Raises UndefinedPDEError:
 if the number of equations is not specified yet
getNumSolutions()

Returns the number of unknowns.

Returns:the number of unknowns
Return type:int
Raises UndefinedPDEError:
 if the number of unknowns is not specified yet
getOperator()

Returns the operator of the linear problem.

Returns:the operator of the problem
getOperatorType()

Returns the current system type.

getRequiredOperatorType()

Returns the system type which needs to be used by the current set up.

getResidual(u=None)

Returns the residual of u or the current solution if u is not present.

Parameters:u (Data or None) – argument in the residual calculation. It must be representable in self.getFunctionSpaceForSolution(). If u is not present or equals None the current solution is used.
Returns:residual of u
Return type:Data
getRightHandSide()

Returns the right hand side of the linear problem.

Returns:the right hand side of the problem
Return type:Data
getShapeOfCoefficient(name)

Returns the shape of the coefficient name.

Parameters:name (string) – name of the coefficient enquired
Returns:the shape of the coefficient name
Return type:tuple of int
Raises IllegalCoefficient:
 if name is not a coefficient of the PDE
getSolution()

Returns the solution of the PDE.

Returns:the solution
Return type:Data
getSolverOptions()

Returns the solver options

Return type:SolverOptions
getSystem()

Returns the operator and right hand side of the PDE.

Returns:the discrete version of the PDE
Return type:tuple of Operator and Data
getSystemStatus()

Return the domain status used to build the current system

hasCoefficient(name)

Returns True if name is the name of a coefficient.

Parameters:name (string) – name of the coefficient enquired
Returns:True if name is the name of a coefficient of the general PDE, False otherwise
Return type:bool
initializeSystem()

Resets the system clearing the operator, right hand side and solution.

insertConstraint(rhs_only=False)

Applies the constraints defined by q and r to the PDE.

Parameters:rhs_only (bool) – if True only the right hand side is altered by the constraint
introduceCoefficients(**coeff)

Introduces new coefficients into the problem.

Use:

p.introduceCoefficients(A=PDECoef(...), B=PDECoef(...))

to introduce the coefficients A and B.

invalidateOperator()

Indicates the operator has to be rebuilt next time it is used.

invalidateRightHandSide()

Indicates the right hand side has to be rebuilt next time it is used.

invalidateSolution()

Indicates the PDE has to be resolved if the solution is requested.

invalidateSystem()

Announces that everything has to be rebuilt.

isOperatorValid()

Returns True if the operator is still valid.

isRightHandSideValid()

Returns True if the operator is still valid.

isSolutionValid()

Returns True if the solution is still valid.

isSymmetric()

Checks if symmetry is indicated.

Returns:True if a symmetric PDE is indicated, False otherwise
Return type:bool
Note:the method is equivalent to use getSolverOptions().isSymmetric()
isSystemValid()

Returns True if the system (including solution) is still vaild.

isUsingLumping()

Checks if matrix lumping is the current solver method.

Returns:True if the current solver method is lumping
Return type:bool
reduceEquationOrder()

Returns the status of order reduction for the equation.

Returns:True if reduced interpolation order is used for the representation of the equation, False otherwise
Return type:bool
reduceSolutionOrder()

Returns the status of order reduction for the solution.

Returns:True if reduced interpolation order is used for the representation of the solution, False otherwise
Return type:bool
resetAllCoefficients()

Resets all coefficients to their default values.

resetOperator()

Makes sure that the operator is instantiated and returns it initialized with zeros.

resetRightHandSide()

Sets the right hand side to zero.

resetRightHandSideCoefficients()

Resets all coefficients defining the right hand side

resetSolution()

Sets the solution to zero.

setDebug(flag)

Switches debug output on if flag is True otherwise it is switched off.

Parameters:flag (bool) – desired debug status
setDebugOff()

Switches debug output off.

setDebugOn()

Switches debug output on.

setReducedOrderForEquationOff()

Switches reduced order off for equation representation.

Raises RuntimeError:
 if order reduction is altered after a coefficient has been set
setReducedOrderForEquationOn()

Switches reduced order on for equation representation.

Raises RuntimeError:
 if order reduction is altered after a coefficient has been set
setReducedOrderForEquationTo(flag=False)

Sets order reduction state for equation representation according to flag.

Parameters:flag (bool) – if flag is True, the order reduction is switched on for equation representation, otherwise or if flag is not present order reduction is switched off
Raises RuntimeError:
 if order reduction is altered after a coefficient has been set
setReducedOrderForSolutionOff()

Switches reduced order off for solution representation

Raises RuntimeError:
 if order reduction is altered after a coefficient has been set.
setReducedOrderForSolutionOn()

Switches reduced order on for solution representation.

Raises RuntimeError:
 if order reduction is altered after a coefficient has been set
setReducedOrderForSolutionTo(flag=False)

Sets order reduction state for solution representation according to flag.

Parameters:flag (bool) – if flag is True, the order reduction is switched on for solution representation, otherwise or if flag is not present order reduction is switched off
Raises RuntimeError:
 if order reduction is altered after a coefficient has been set
setReducedOrderOff()

Switches reduced order off for solution and equation representation

Raises RuntimeError:
 if order reduction is altered after a coefficient has been set
setReducedOrderOn()

Switches reduced order on for solution and equation representation.

Raises RuntimeError:
 if order reduction is altered after a coefficient has been set
setReducedOrderTo(flag=False)

Sets order reduction state for both solution and equation representation according to flag.

Parameters:flag (bool) – if True, the order reduction is switched on for both solution and equation representation, otherwise or if flag is not present order reduction is switched off
Raises RuntimeError:
 if order reduction is altered after a coefficient has been set
setSolution(u, validate=True)

Sets the solution assuming that makes the system valid with the tolrance defined by the solver options

setSolverOptions(options=None)

Sets the solver options.

Parameters:options (SolverOptions or None) – the new solver options. If equal None, the solver options are set to the default.
Note:The symmetry flag of options is overwritten by the symmetry flag of the LinearProblem.
setSymmetry(flag=False)

Sets the symmetry flag to flag.

Parameters:flag (bool) – If True, the symmetry flag is set otherwise reset.
Note:The method overwrites the symmetry flag set by the solver options
setSymmetryOff()

Clears the symmetry flag. :note: The method overwrites the symmetry flag set by the solver options

setSymmetryOn()

Sets the symmetry flag. :note: The method overwrites the symmetry flag set by the solver options

setSystemStatus(status=None)

Sets the system status to status if status is not present the current status of the domain is used.

setValue(**coefficients)

Sets new values to coefficients.

Parameters:
  • coefficients – new values assigned to coefficients
  • A (any type that can be cast to a Data object on Function) – value for coefficient A
  • A_reduced (any type that can be cast to a Data object on ReducedFunction) – value for coefficient A_reduced
  • B (any type that can be cast to a Data object on Function) – value for coefficient B
  • B_reduced (any type that can be cast to a Data object on ReducedFunction) – value for coefficient B_reduced
  • C (any type that can be cast to a Data object on Function) – value for coefficient C
  • C_reduced (any type that can be cast to a Data object on ReducedFunction) – value for coefficient C_reduced
  • D (any type that can be cast to a Data object on Function) – value for coefficient D
  • D_reduced (any type that can be cast to a Data object on ReducedFunction) – value for coefficient D_reduced
  • X (any type that can be cast to a Data object on Function) – value for coefficient X
  • X_reduced (any type that can be cast to a Data object on ReducedFunction) – value for coefficient X_reduced
  • Y (any type that can be cast to a Data object on Function) – value for coefficient Y
  • Y_reduced (any type that can be cast to a Data object on ReducedFunction) – value for coefficient Y_reduced
  • d (any type that can be cast to a Data object on FunctionOnBoundary) – value for coefficient d
  • d_reduced (any type that can be cast to a Data object on ReducedFunctionOnBoundary) – value for coefficient d_reduced
  • y (any type that can be cast to a Data object on FunctionOnBoundary) – value for coefficient y
  • d_contact (any type that can be cast to a Data object on FunctionOnContactOne or FunctionOnContactZero) – value for coefficient d_contact
  • d_contact_reduced (any type that can be cast to a Data object on ReducedFunctionOnContactOne or ReducedFunctionOnContactZero) – value for coefficient d_contact_reduced
  • y_contact (any type that can be cast to a Data object on FunctionOnContactOne or FunctionOnContactZero) – value for coefficient y_contact
  • y_contact_reduced (any type that can be cast to a Data object on ReducedFunctionOnContactOne or ReducedFunctionOnContactZero) – value for coefficient y_contact_reduced
  • d_dirac (any type that can be cast to a Data object on DiracDeltaFunctions) – value for coefficient d_dirac
  • y_dirac (any type that can be cast to a Data object on DiracDeltaFunctions) – value for coefficient y_dirac
  • r (any type that can be cast to a Data object on Solution or ReducedSolution depending on whether reduced order is used for the solution) – values prescribed to the solution at the locations of constraints
  • q (any type that can be cast to a Data object on Solution or ReducedSolution depending on whether reduced order is used for the representation of the equation) – mask for location of constraints
Raises IllegalCoefficient:
 

if an unknown coefficient keyword is used

setValues(**coefficients)

Sets new values to coefficients.

Parameters:
  • coefficients – new values assigned to coefficients
  • lame_mu (any type that can be cast to a Scalar object on Function) – value for coefficient mu
  • lame_lambda (any type that can be cast to a Scalar object on Function) – value for coefficient lambda
  • F (any type that can be cast to a Vector object on Function) – value for internal force F
  • sigma (any type that can be cast to a Tensor object on Function) – value for initial stress sigma
  • f (any type that can be cast to a Vector object on FunctionOnBoundary) – value for external force f
  • r (any type that can be cast to a Vector object on Solution or ReducedSolution depending on whether reduced order is used for the representation of the equation) – prescribed values r for the solution in constraints
  • q (any type that can be cast to a Vector object on Solution or ReducedSolution depending on whether reduced order is used for the representation of the equation) – mask for the location of constraints
Raises IllegalCoefficient:
 

if an unknown coefficient keyword is used

trace(text)

Prints the text message if debug mode is switched on.

Parameters:text (string) – message to be printed
validOperator()

Marks the operator as valid.

validRightHandSide()

Marks the right hand side as valid.

validSolution()

Marks the solution as valid.

class esys.modellib.flow.Model(parameters=, []**kwargs)

Bases: esys.escriptcore.modelframe.ParameterSet

A Model object represents a process marching over time until a finalizing condition is fulfilled. At each time step an iterative process can be performed and the time step size can be controlled. A Model has the following work flow:

doInitialization()
while not terminateInitialIteration(): doInitialStep()
doInitialPostprocessing()
while not finalize():
    dt=getSafeTimeStepSize(dt)
    doStepPreprocessing(dt)
    while not terminateIteration(): doStep(dt)
    doStepPostprocessing(dt)
doFinalization()

where doInitialization, finalize, getSafeTimeStepSize, doStepPreprocessing, terminateIteration, doStepPostprocessing, doFinalization are methods of the particular instance of a Model. The default implementations of these methods have to be overwritten by the subclass implementing a Model.

UNDEF_DT = 1e+300
checkLinkTargets(models, hash)

Returns a set of tuples (“<self>(<name>)”, <target model>) if the parameter <name> is linked to model <target model> but <target model> is not in the list of models. If a parameter is linked to another parameter set which is not in the hash list the parameter set is checked for its models. hash gives the call history.

declareParameter(**parameters)

Declares one or more new parameters and their initial value.

declareParameters(parameters)

Declares a set of parameters. parameters can be a list, a dictionary or a ParameterSet.

doFinalization()

Finalizes the time stepping.

This function may be overwritten.

doInitialPostprocessing()

Finalises the initialization iteration process. This method is not called in case of a restart.

This function may be overwritten.

doInitialStep()

Performs an iteration step in the initialization phase. This method is not called in case of a restart.

This function may be overwritten.

doInitialization()

Initializes the time stepping scheme. This method is not called in case of a restart.

This function may be overwritten.

doStep(dt)

Executes an iteration step at a time step.

dt is the currently used time step size.

This function may be overwritten.

doStepPostprocessing(dt)

Finalises the time step.

dt is the currently used time step size.

This function may be overwritten.

doStepPreprocessing(dt)

Sets up a time step of step size dt.

This function may be overwritten.

finalize()

Returns False if the time stepping is finalized.

This function may be overwritten.

classmethod fromDom(esysxml, node)
getAttributeObject(name)

Returns the object stored for attribute name.

getSafeTimeStepSize(dt)

Returns a time step size which can be safely used.

dt gives the previously used step size.

This function may be overwritten.

hasAttribute(name)

Returns True if self has attribute name.

releaseParameters(name)

Removes parameter name from the parameters.

setUp()

Sets up the model.

This function may be overwritten.

showParameters()

Returns a description of the parameters.

terminateInitialIteration()

Returns True if iteration at the inital phase is terminated.

terminateIteration()

Returns True if iteration on a time step is terminated.

toDom(esysxml, node)

toDom method of Model class.

trace(msg)

If debugging is on, prints the message, otherwise does nothing.

writeXML(ostream=<open file '<stdout>', mode 'w' at 0x7fd1594eb150>)

Writes the object as an XML object into an output stream.

class esys.modellib.flow.SolverOptions

Bases: Boost.Python.enum

AGGREGATION_COARSENING = esys.escriptcore.escriptcpp.SolverOptions.AGGREGATION_COARSENING
AMG = esys.escriptcore.escriptcpp.SolverOptions.AMG
AMLI = esys.escriptcore.escriptcpp.SolverOptions.AMLI
BACKWARD_EULER = esys.escriptcore.escriptcpp.SolverOptions.BACKWARD_EULER
BICGSTAB = esys.escriptcore.escriptcpp.SolverOptions.BICGSTAB
BOOMERAMG = esys.escriptcore.escriptcpp.SolverOptions.BOOMERAMG
CGS = esys.escriptcore.escriptcpp.SolverOptions.CGS
CHOLEVSKY = esys.escriptcore.escriptcpp.SolverOptions.CHOLEVSKY
CIJP_COARSENING = esys.escriptcore.escriptcpp.SolverOptions.CIJP_COARSENING
CIJP_FIXED_RANDOM_COARSENING = esys.escriptcore.escriptcpp.SolverOptions.CIJP_FIXED_RANDOM_COARSENING
CLASSIC_INTERPOLATION = esys.escriptcore.escriptcpp.SolverOptions.CLASSIC_INTERPOLATION
CLASSIC_INTERPOLATION_WITH_FF_COUPLING = esys.escriptcore.escriptcpp.SolverOptions.CLASSIC_INTERPOLATION_WITH_FF_COUPLING
CR = esys.escriptcore.escriptcpp.SolverOptions.CR
CRANK_NICOLSON = esys.escriptcore.escriptcpp.SolverOptions.CRANK_NICOLSON
DEFAULT = esys.escriptcore.escriptcpp.SolverOptions.DEFAULT
DEFAULT_REORDERING = esys.escriptcore.escriptcpp.SolverOptions.DEFAULT_REORDERING
DIRECT = esys.escriptcore.escriptcpp.SolverOptions.DIRECT
DIRECT_INTERPOLATION = esys.escriptcore.escriptcpp.SolverOptions.DIRECT_INTERPOLATION
FALGOUT_COARSENING = esys.escriptcore.escriptcpp.SolverOptions.FALGOUT_COARSENING
GAUSS_SEIDEL = esys.escriptcore.escriptcpp.SolverOptions.GAUSS_SEIDEL
GMRES = esys.escriptcore.escriptcpp.SolverOptions.GMRES
HMIS_COARSENING = esys.escriptcore.escriptcpp.SolverOptions.HMIS_COARSENING
HRZ_LUMPING = esys.escriptcore.escriptcpp.SolverOptions.HRZ_LUMPING
ILU0 = esys.escriptcore.escriptcpp.SolverOptions.ILU0
ILUT = esys.escriptcore.escriptcpp.SolverOptions.ILUT
ITERATIVE = esys.escriptcore.escriptcpp.SolverOptions.ITERATIVE
JACOBI = esys.escriptcore.escriptcpp.SolverOptions.JACOBI
LINEAR_CRANK_NICOLSON = esys.escriptcore.escriptcpp.SolverOptions.LINEAR_CRANK_NICOLSON
LUMPING = esys.escriptcore.escriptcpp.SolverOptions.LUMPING
MINIMUM_FILL_IN = esys.escriptcore.escriptcpp.SolverOptions.MINIMUM_FILL_IN
MINRES = esys.escriptcore.escriptcpp.SolverOptions.MINRES
MIN_COARSE_MATRIX_SIZE = esys.escriptcore.escriptcpp.SolverOptions.MIN_COARSE_MATRIX_SIZE
MKL = esys.escriptcore.escriptcpp.SolverOptions.MKL
NESTED_DISSECTION = esys.escriptcore.escriptcpp.SolverOptions.NESTED_DISSECTION
NONLINEAR_GMRES = esys.escriptcore.escriptcpp.SolverOptions.NONLINEAR_GMRES
NO_PRECONDITIONER = esys.escriptcore.escriptcpp.SolverOptions.NO_PRECONDITIONER
NO_REORDERING = esys.escriptcore.escriptcpp.SolverOptions.NO_REORDERING
PASO = esys.escriptcore.escriptcpp.SolverOptions.PASO
PASTIX = esys.escriptcore.escriptcpp.SolverOptions.PASTIX
PCG = esys.escriptcore.escriptcpp.SolverOptions.PCG
PMIS_COARSENING = esys.escriptcore.escriptcpp.SolverOptions.PMIS_COARSENING
PRES20 = esys.escriptcore.escriptcpp.SolverOptions.PRES20
REC_ILU = esys.escriptcore.escriptcpp.SolverOptions.REC_ILU
RILU = esys.escriptcore.escriptcpp.SolverOptions.RILU
ROWSUM_LUMPING = esys.escriptcore.escriptcpp.SolverOptions.ROWSUM_LUMPING
RUGE_STUEBEN_COARSENING = esys.escriptcore.escriptcpp.SolverOptions.RUGE_STUEBEN_COARSENING
STANDARD_COARSENING = esys.escriptcore.escriptcpp.SolverOptions.STANDARD_COARSENING
SUPER_LU = esys.escriptcore.escriptcpp.SolverOptions.SUPER_LU
TFQMR = esys.escriptcore.escriptcpp.SolverOptions.TFQMR
TRILINOS = esys.escriptcore.escriptcpp.SolverOptions.TRILINOS
UMFPACK = esys.escriptcore.escriptcpp.SolverOptions.UMFPACK
YAIR_SHAPIRA_COARSENING = esys.escriptcore.escriptcpp.SolverOptions.YAIR_SHAPIRA_COARSENING
bit_length() → int

Number of bits necessary to represent self in binary. >>> bin(37) ‘0b100101’ >>> (37).bit_length() 6

conjugate()

Returns self, the complex conjugate of any int.

denominator

the denominator of a rational number in lowest terms

imag

the imaginary part of a complex number

name
names = {'BICGSTAB': esys.escriptcore.escriptcpp.SolverOptions.BICGSTAB, 'RILU': esys.escriptcore.escriptcpp.SolverOptions.RILU, 'DEFAULT_REORDERING': esys.escriptcore.escriptcpp.SolverOptions.DEFAULT_REORDERING, 'ILU0': esys.escriptcore.escriptcpp.SolverOptions.ILU0, 'TFQMR': esys.escriptcore.escriptcpp.SolverOptions.TFQMR, 'DEFAULT': esys.escriptcore.escriptcpp.SolverOptions.DEFAULT, 'MKL': esys.escriptcore.escriptcpp.SolverOptions.MKL, 'ITERATIVE': esys.escriptcore.escriptcpp.SolverOptions.ITERATIVE, 'DIRECT': esys.escriptcore.escriptcpp.SolverOptions.DIRECT, 'MIN_COARSE_MATRIX_SIZE': esys.escriptcore.escriptcpp.SolverOptions.MIN_COARSE_MATRIX_SIZE, 'BACKWARD_EULER': esys.escriptcore.escriptcpp.SolverOptions.BACKWARD_EULER, 'BOOMERAMG': esys.escriptcore.escriptcpp.SolverOptions.BOOMERAMG, 'GAUSS_SEIDEL': esys.escriptcore.escriptcpp.SolverOptions.GAUSS_SEIDEL, 'CIJP_COARSENING': esys.escriptcore.escriptcpp.SolverOptions.CIJP_COARSENING, 'PCG': esys.escriptcore.escriptcpp.SolverOptions.PCG, 'NO_PRECONDITIONER': esys.escriptcore.escriptcpp.SolverOptions.NO_PRECONDITIONER, 'LUMPING': esys.escriptcore.escriptcpp.SolverOptions.LUMPING, 'PRES20': esys.escriptcore.escriptcpp.SolverOptions.PRES20, 'STANDARD_COARSENING': esys.escriptcore.escriptcpp.SolverOptions.STANDARD_COARSENING, 'CIJP_FIXED_RANDOM_COARSENING': esys.escriptcore.escriptcpp.SolverOptions.CIJP_FIXED_RANDOM_COARSENING, 'PMIS_COARSENING': esys.escriptcore.escriptcpp.SolverOptions.PMIS_COARSENING, 'UMFPACK': esys.escriptcore.escriptcpp.SolverOptions.UMFPACK, 'AMG': esys.escriptcore.escriptcpp.SolverOptions.AMG, 'RUGE_STUEBEN_COARSENING': esys.escriptcore.escriptcpp.SolverOptions.RUGE_STUEBEN_COARSENING, 'MINRES': esys.escriptcore.escriptcpp.SolverOptions.MINRES, 'CLASSIC_INTERPOLATION_WITH_FF_COUPLING': esys.escriptcore.escriptcpp.SolverOptions.CLASSIC_INTERPOLATION_WITH_FF_COUPLING, 'MINIMUM_FILL_IN': esys.escriptcore.escriptcpp.SolverOptions.MINIMUM_FILL_IN, 'CGS': esys.escriptcore.escriptcpp.SolverOptions.CGS, 'CRANK_NICOLSON': esys.escriptcore.escriptcpp.SolverOptions.CRANK_NICOLSON, 'NESTED_DISSECTION': esys.escriptcore.escriptcpp.SolverOptions.NESTED_DISSECTION, 'LINEAR_CRANK_NICOLSON': esys.escriptcore.escriptcpp.SolverOptions.LINEAR_CRANK_NICOLSON, 'NONLINEAR_GMRES': esys.escriptcore.escriptcpp.SolverOptions.NONLINEAR_GMRES, 'AMLI': esys.escriptcore.escriptcpp.SolverOptions.AMLI, 'CHOLEVSKY': esys.escriptcore.escriptcpp.SolverOptions.CHOLEVSKY, 'CLASSIC_INTERPOLATION': esys.escriptcore.escriptcpp.SolverOptions.CLASSIC_INTERPOLATION, 'HRZ_LUMPING': esys.escriptcore.escriptcpp.SolverOptions.HRZ_LUMPING, 'AGGREGATION_COARSENING': esys.escriptcore.escriptcpp.SolverOptions.AGGREGATION_COARSENING, 'ROWSUM_LUMPING': esys.escriptcore.escriptcpp.SolverOptions.ROWSUM_LUMPING, 'TRILINOS': esys.escriptcore.escriptcpp.SolverOptions.TRILINOS, 'PASO': esys.escriptcore.escriptcpp.SolverOptions.PASO, 'NO_REORDERING': esys.escriptcore.escriptcpp.SolverOptions.NO_REORDERING, 'HMIS_COARSENING': esys.escriptcore.escriptcpp.SolverOptions.HMIS_COARSENING, 'YAIR_SHAPIRA_COARSENING': esys.escriptcore.escriptcpp.SolverOptions.YAIR_SHAPIRA_COARSENING, 'CR': esys.escriptcore.escriptcpp.SolverOptions.CR, 'PASTIX': esys.escriptcore.escriptcpp.SolverOptions.PASTIX, 'ILUT': esys.escriptcore.escriptcpp.SolverOptions.ILUT, 'FALGOUT_COARSENING': esys.escriptcore.escriptcpp.SolverOptions.FALGOUT_COARSENING, 'DIRECT_INTERPOLATION': esys.escriptcore.escriptcpp.SolverOptions.DIRECT_INTERPOLATION, 'SUPER_LU': esys.escriptcore.escriptcpp.SolverOptions.SUPER_LU, 'REC_ILU': esys.escriptcore.escriptcpp.SolverOptions.REC_ILU, 'GMRES': esys.escriptcore.escriptcpp.SolverOptions.GMRES, 'JACOBI': esys.escriptcore.escriptcpp.SolverOptions.JACOBI}
numerator

the numerator of a rational number in lowest terms

real

the real part of a complex number

values = {0: esys.escriptcore.escriptcpp.SolverOptions.DEFAULT, 1: esys.escriptcore.escriptcpp.SolverOptions.DIRECT, 2: esys.escriptcore.escriptcpp.SolverOptions.CHOLEVSKY, 3: esys.escriptcore.escriptcpp.SolverOptions.PCG, 4: esys.escriptcore.escriptcpp.SolverOptions.CR, 5: esys.escriptcore.escriptcpp.SolverOptions.CGS, 6: esys.escriptcore.escriptcpp.SolverOptions.BICGSTAB, 8: esys.escriptcore.escriptcpp.SolverOptions.ILU0, 9: esys.escriptcore.escriptcpp.SolverOptions.ILUT, 10: esys.escriptcore.escriptcpp.SolverOptions.JACOBI, 11: esys.escriptcore.escriptcpp.SolverOptions.GMRES, 12: esys.escriptcore.escriptcpp.SolverOptions.PRES20, 13: esys.escriptcore.escriptcpp.SolverOptions.ROWSUM_LUMPING, 14: esys.escriptcore.escriptcpp.SolverOptions.HRZ_LUMPING, 15: esys.escriptcore.escriptcpp.SolverOptions.MKL, 16: esys.escriptcore.escriptcpp.SolverOptions.UMFPACK, 17: esys.escriptcore.escriptcpp.SolverOptions.NO_REORDERING, 18: esys.escriptcore.escriptcpp.SolverOptions.MINIMUM_FILL_IN, 19: esys.escriptcore.escriptcpp.SolverOptions.NESTED_DISSECTION, 20: esys.escriptcore.escriptcpp.SolverOptions.ITERATIVE, 21: esys.escriptcore.escriptcpp.SolverOptions.PASO, 22: esys.escriptcore.escriptcpp.SolverOptions.AMG, 23: esys.escriptcore.escriptcpp.SolverOptions.REC_ILU, 24: esys.escriptcore.escriptcpp.SolverOptions.TRILINOS, 25: esys.escriptcore.escriptcpp.SolverOptions.NONLINEAR_GMRES, 26: esys.escriptcore.escriptcpp.SolverOptions.TFQMR, 27: esys.escriptcore.escriptcpp.SolverOptions.MINRES, 28: esys.escriptcore.escriptcpp.SolverOptions.GAUSS_SEIDEL, 29: esys.escriptcore.escriptcpp.SolverOptions.RILU, 30: esys.escriptcore.escriptcpp.SolverOptions.DEFAULT_REORDERING, 31: esys.escriptcore.escriptcpp.SolverOptions.SUPER_LU, 32: esys.escriptcore.escriptcpp.SolverOptions.PASTIX, 33: esys.escriptcore.escriptcpp.SolverOptions.YAIR_SHAPIRA_COARSENING, 34: esys.escriptcore.escriptcpp.SolverOptions.RUGE_STUEBEN_COARSENING, 35: esys.escriptcore.escriptcpp.SolverOptions.AGGREGATION_COARSENING, 36: esys.escriptcore.escriptcpp.SolverOptions.NO_PRECONDITIONER, 37: esys.escriptcore.escriptcpp.SolverOptions.MIN_COARSE_MATRIX_SIZE, 38: esys.escriptcore.escriptcpp.SolverOptions.AMLI, 39: esys.escriptcore.escriptcpp.SolverOptions.STANDARD_COARSENING, 50: esys.escriptcore.escriptcpp.SolverOptions.CLASSIC_INTERPOLATION_WITH_FF_COUPLING, 51: esys.escriptcore.escriptcpp.SolverOptions.CLASSIC_INTERPOLATION, 52: esys.escriptcore.escriptcpp.SolverOptions.DIRECT_INTERPOLATION, 60: esys.escriptcore.escriptcpp.SolverOptions.BOOMERAMG, 61: esys.escriptcore.escriptcpp.SolverOptions.CIJP_FIXED_RANDOM_COARSENING, 62: esys.escriptcore.escriptcpp.SolverOptions.CIJP_COARSENING, 63: esys.escriptcore.escriptcpp.SolverOptions.FALGOUT_COARSENING, 64: esys.escriptcore.escriptcpp.SolverOptions.PMIS_COARSENING, 65: esys.escriptcore.escriptcpp.SolverOptions.HMIS_COARSENING, 66: esys.escriptcore.escriptcpp.SolverOptions.LINEAR_CRANK_NICOLSON, 67: esys.escriptcore.escriptcpp.SolverOptions.CRANK_NICOLSON, 68: esys.escriptcore.escriptcpp.SolverOptions.BACKWARD_EULER}
class esys.modellib.flow.SteadyIncompressibleFlow(**kwargs)

Bases: esys.escriptcore.modelframe.Model

*-left(etaleft(v_{i,j}+v_{j,i}

ight) ight)_{,j}+p_{,i}=F_i*

sigma_{ij}=2eta D_{ij}-p,delta_{ij}

*D_{ij}=

rac{1}{2}left( v_{j,i} + v_{i,j } ight)*

v_{k,k} = 0
UNDEF_DT = 1e+300
checkLinkTargets(models, hash)

Returns a set of tuples (“<self>(<name>)”, <target model>) if the parameter <name> is linked to model <target model> but <target model> is not in the list of models. If a parameter is linked to another parameter set which is not in the hash list the parameter set is checked for its models. hash gives the call history.

declareParameter(**parameters)

Declares one or more new parameters and their initial value.

declareParameters(parameters)

Declares a set of parameters. parameters can be a list, a dictionary or a ParameterSet.

doFinalization()

Finalizes the time stepping.

This function may be overwritten.

doInitialPostprocessing()

Finalises the initialization iteration process. This method is not called in case of a restart.

This function may be overwritten.

doInitialStep()

Performs an iteration step in the initialization phase. This method is not called in case of a restart.

This function may be overwritten.

doInitialization()

initialize model

doStep(dt)

performs an iteration step of the penalty method. IterationDivergenceError is raised if pressure error cannot be reduced or max_iter is reached.

doStepPostprocessing(dt)
doStepPreprocessing(dt)

step up pressure iteration

if run within a time dependend problem extrapolation of pressure from previous time steps is used to get an initial guess (that needs some work!!!!!!!)

finalize()

Returns False if the time stepping is finalized.

This function may be overwritten.

classmethod fromDom(esysxml, node)
getAttributeObject(name)

Returns the object stored for attribute name.

getSafeTimeStepSize(dt)

Returns a time step size which can be safely used.

dt gives the previously used step size.

This function may be overwritten.

hasAttribute(name)

Returns True if self has attribute name.

releaseParameters(name)

Removes parameter name from the parameters.

setUp()

Sets up the model.

This function may be overwritten.

showParameters()

Returns a description of the parameters.

stress()

returns current stress

stretching()

returns stertching tensor

terminateInitialIteration()

Returns True if iteration at the inital phase is terminated.

terminateIteration()

iteration is terminateIterationd if relative pressure change is less than rel_tol

toDom(esysxml, node)

toDom method of Model class.

trace(msg)

If debugging is on, prints the message, otherwise does nothing.

writeXML(ostream=<open file '<stdout>', mode 'w' at 0x7fd1594eb150>)

Writes the object as an XML object into an output stream.

Functions

esys.modellib.flow.Lsup(arg)

Returns the Lsup-norm of argument arg. This is the maximum absolute value over all data points. This function is equivalent to sup(abs(arg)).

Parameters:arg (float, int, escript.Data, numpy.ndarray) – argument
Returns:maximum value of the absolute value of arg over all components and all data points
Return type:float
Raises TypeError:
 if type of arg cannot be processed
esys.modellib.flow.div(arg, where=None)

Returns the divergence of arg at where.

Parameters:
  • arg (escript.Data or Symbol) – function of which the divergence is to be calculated. Its shape has to be (d,) where d is the spatial dimension.
  • where (None or escript.FunctionSpace) – FunctionSpace in which the divergence will be calculated. If not present or None an appropriate default is used.
Returns:

divergence of arg

Return type:

escript.Data or Symbol

esys.modellib.flow.inf(arg)

Returns the minimum value over all data points.

Parameters:arg (float, int, escript.Data, numpy.ndarray) – argument
Returns:minimum value of arg over all components and all data points
Return type:float
Raises TypeError:
 if type of arg cannot be processed
esys.modellib.flow.kronecker(d=3)

Returns the kronecker delta-symbol.

Parameters:d (int, escript.Domain or escript.FunctionSpace) – dimension or an object that has the getDim method defining the dimension
Returns:the object u of rank 2 with u[i,j]=1 for i=j and u[i,j]=0 otherwise
Return type:numpy.ndarray or escript.Data of rank 2
esys.modellib.flow.sup(arg)

Returns the maximum value over all data points.

Parameters:arg (float, int, escript.Data, numpy.ndarray) – argument
Returns:maximum value of arg over all components and all data points
Return type:float
Raises TypeError:
 if type of arg cannot be processed

Others

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