Package esys :: Package escript :: Module linearPDEs :: Class PDECoef
[hide private]
[frames] | no frames]

Class PDECoef

object --+
         |
        PDECoef

A class for describing a PDE coefficient.

Instance Methods [hide private]
 
__CompTuple2(self, t1, t2)
Compares two tuples of possible number of equations and number of solutions.
 
__init__(self, where, pattern, altering)
Initialises a PDE coefficient type.
bool
definesNumEquation(self)
Checks if the coefficient allows to estimate the number of equations.
bool
definesNumSolutions(self)
Checks if the coefficient allows to estimate the number of solution components.
tuple of two int values or None
estimateNumEquationsAndNumSolutions(self, domain, shape=())
Tries to estimate the number of equations and number of solutions if the coefficient has the given shape.
FunctionSpace
getFunctionSpace(self, domain, reducedEquationOrder=False, reducedSolutionOrder=False)
Returns the FunctionSpace of the coefficient.
tuple of int values
getShape(self, domain, numEquations=1, numSolutions=1)
Builds the required shape of the coefficient.
Data
getValue(self)
Returns the value of the coefficient.
bool
isAlteringOperator(self)
Checks if the coefficient alters the operator of the PDE.
bool
isAlteringRightHandSide(self)
Checks if the coefficient alters the right hand side of the PDE.
 
resetValue(self)
Resets the coefficient value to the default.
 
setValue(self, domain, numEquations=1, numSolutions=1, reducedEquationOrder=False, reducedSolutionOrder=False, newValue=None)
Sets the value of the coefficient to a new value.

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables [hide private]
  BOTH = 12
indicator that the the coefficient alters the operator as well as the right hand side of the PDE
  BOUNDARY = 1
indicator that coefficient is defined on the boundary of the PDE domain
  BOUNDARY_REDUCED = 14
indicator that coefficient is defined on the boundary of the PDE domain using a reduced integration order
  BY_DIM = 7
indicator that the dimension of the coefficient shape is defined by the spatial dimension
  BY_EQUATION = 5
indicator that the dimension of the coefficient shape is defined by the number of PDE equations
  BY_SOLUTION = 6
indicator that the dimension of the coefficient shape is defined by the number of PDE solutions
  CONTACT = 2
indicator that coefficient is defined on the contact region within the PDE domain
  CONTACT_REDUCED = 15
indicator that coefficient is defined on the contact region within the PDE domain using a reduced integration order
  INTERIOR = 0
indicator that coefficient is defined on the interior of the PDE domain
  INTERIOR_REDUCED = 13
indicator that coefficient is defined on the interior of the PDE domain using a reduced integration order
  OPERATOR = 10
indicator that the the coefficient alters the operator of the PDE
  REDUCED = 4
indicator that coefficient is defined through a reduced solution of the PDE
  RIGHTHANDSIDE = 11
indicator that the the coefficient alters the right hand side of the PDE
  SOLUTION = 3
indicator that coefficient is defined through a solution of the PDE
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__CompTuple2(self, t1, t2)

 

Compares two tuples of possible number of equations and number of solutions.

Parameters:
  • t1 - the first tuple
  • t2 - the second tuple
Returns:
0, 1, or -1

__init__(self, where, pattern, altering)
(Constructor)

 

Initialises a PDE coefficient type.

Parameters:
Overrides: object.__init__

definesNumEquation(self)

 

Checks if the coefficient allows to estimate the number of equations.

Returns: bool
True if the coefficient allows an estimate of the number of equations, False otherwise

definesNumSolutions(self)

 

Checks if the coefficient allows to estimate the number of solution components.

Returns: bool
True if the coefficient allows an estimate of the number of solution components, False otherwise

estimateNumEquationsAndNumSolutions(self, domain, shape=())

 

Tries to estimate the number of equations and number of solutions if the coefficient has the given shape.

Parameters:
  • domain (Domain) - domain on which the PDE uses the coefficient
  • shape (tuple of int values) - suggested shape of the coefficient
Returns: tuple of two int values or None
the number of equations and number of solutions of the PDE if the coefficient has given shape. If no appropriate numbers could be identified, None is returned

getFunctionSpace(self, domain, reducedEquationOrder=False, reducedSolutionOrder=False)

 

Returns the FunctionSpace of the coefficient.

Parameters:
  • domain (Domain) - domain on which the PDE uses the coefficient
  • reducedEquationOrder (bool) - True to indicate that reduced order is used to represent the equation
  • reducedSolutionOrder (bool) - True to indicate that reduced order is used to represent the solution
Returns: FunctionSpace
FunctionSpace of the coefficient

getShape(self, domain, numEquations=1, numSolutions=1)

 

Builds the required shape of the coefficient.

Parameters:
  • domain (Domain) - domain on which the PDE uses the coefficient
  • numEquations (int) - number of equations of the PDE
  • numSolutions (int) - number of components of the PDE solution
Returns: tuple of int values
shape of the coefficient

getValue(self)

 

Returns the value of the coefficient.

Returns: Data
value of the coefficient

isAlteringOperator(self)

 

Checks if the coefficient alters the operator of the PDE.

Returns: bool
True if the operator of the PDE is changed when the coefficient is changed

isAlteringRightHandSide(self)

 

Checks if the coefficient alters the right hand side of the PDE.

Returns: bool
True if the right hand side of the PDE is changed when the coefficient is changed, None otherwise.

setValue(self, domain, numEquations=1, numSolutions=1, reducedEquationOrder=False, reducedSolutionOrder=False, newValue=None)

 

Sets the value of the coefficient to a new value.

Parameters:
  • domain (Domain) - domain on which the PDE uses the coefficient
  • numEquations (int) - number of equations of the PDE
  • numSolutions (int) - number of components of the PDE solution
  • reducedEquationOrder (bool) - True to indicate that reduced order is used to represent the equation
  • reducedSolutionOrder (bool) - True to indicate that reduced order is used to represent the solution
  • newValue (any object that can be converted into a Data object with the appropriate shape and FunctionSpace) - number of components of the PDE solution
Raises: