esys.modellib.geometry Package

Classes

class esys.modellib.geometry.ConstrainerAtBoxVertex(**kwargs)

Bases: esys.escript.modelframe.Model

Creates a characteristic function for the location of constraints for all components of a value and selects the value from an initial value ate these locations.

In the case that the spatial dimension is two, the arguments front and back are ignored.

Variables:
  • domain – domain (in).
  • tol – absolute tolerance for “x=left, front, bottom vertex” condition, default 1.e-8 (in).
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.

location_of_constraint()

return the values used to constrain a solution

Returns:the mask marking the locations of the constraints
Return type:escript.Scalar
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.

value_of_constraint()

return the values used to constrain a solution

Returns:values to be used at the locations of the constraints. If value is not given None is rerturned.
Return type:escript.Scalar
writeXML(ostream=<open file '<stdout>', mode 'w' at 0x7ff1daf8c1e0>)

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

class esys.modellib.geometry.ConstrainerOverBox(**kwargs)

Bases: esys.escript.modelframe.Model

Creates a characteristic function for the location of constraints for all components of a value and selects the value from an initial value ate these locations.

In the case that the spatial dimension is two, the arguments front and back are ignored.

Variables:
  • domain – domain (in).
  • left – True to set a constraint at the left face of the domain (x[0]=min x[0]), default False (in).
  • right – True to set a constraint at the left face of the domain (x[0]=max x[0]), default False (in).
  • top – True to set a constraint at the left face of the domain (x[1]=min x[1]), default False (in).
  • bottom – True to set a constraint at the left face of the domain (x[1]=max x[1]), default False (in).
  • front – True to set a constraint at the left face of the domain (x[2]=min x[2]), default False (in).
  • back – True to set a constraint at the left face of the domain (x[2]=max x[2]), default False (in).
  • tol – absolute tolerance for “x=max x” condition, default 1.e-8 (in).
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.

location_of_constraint()

return the values used to constrain a solution

Returns:the mask marking the locations of the constraints
Return type:escript.Scalar
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.

value_of_constraint()

return the values used to constrain a solution

Returns:values to be used at the locations of the constraints. If value is not given None is rerturned.
Return type:escript.Scalar
writeXML(ostream=<open file '<stdout>', mode 'w' at 0x7ff1daf8c1e0>)

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

class esys.modellib.geometry.DomainReader(domainmodule=None, **kwargs)

Bases: esys.escript.modelframe.ParameterSet

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.

domain()

returns the domain

Returns:the domain
Return type:Domain
classmethod fromDom(esysxml, node)
getAttributeObject(name)

Returns the object stored for attribute name.

hasAttribute(name)

Returns True if self has attribute name.

releaseParameters(name)

Removes parameter name from the parameters.

showParameters()

Returns a description of the parameters.

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 0x7ff1daf8c1e0>)

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

class esys.modellib.geometry.FinleyReader(**kw)

Bases: esys.modellib.geometry.DomainReader

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.

domain()

returns the domain

Returns:the domain
Return type:Domain
classmethod fromDom(esysxml, node)
getAttributeObject(name)

Returns the object stored for attribute name.

hasAttribute(name)

Returns True if self has attribute name.

releaseParameters(name)

Removes parameter name from the parameters.

showParameters()

Returns a description of the parameters.

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 0x7ff1daf8c1e0>)

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

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

Bases: esys.escript.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 0x7ff1daf8c1e0>)

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

class esys.modellib.geometry.ParameterSet(parameters=[], **kwargs)

Bases: esys.escript.modelframe.LinkableObject

A class which allows to emphasize attributes to be written and read to XML.

Leaves of an ESySParameters object can be:

  • a real number
  • an integer number
  • a string
  • a boolean value
  • a ParameterSet object
  • a Simulation object
  • a Model object
  • a numpy object
  • a list of booleans
  • any other object (not considered by writeESySXML and writeXML)

Example for how to create an ESySParameters object:

p11=ParameterSet(gamma1=1.,gamma2=2.,gamma3=3.)
p1=ParameterSet(dim=2,tol_v=0.001,output_file="/tmp/u.%3.3d.dx",runFlag=True,parm11=p11)
parm=ParameterSet(parm1=p1,parm2=ParameterSet(alpha=Link(p11,"gamma1")))

This can be accessed as:

parm.parm1.gamma=0.
parm.parm1.dim=2
parm.parm1.tol_v=0.001
parm.parm1.output_file="/tmp/u.%3.3d.dx"
parm.parm1.runFlag=True
parm.parm1.parm11.gamma1=1.
parm.parm1.parm11.gamma2=2.
parm.parm1.parm11.gamma3=3.
parm.parm2.alpha=1. (value of parm.parm1.parm11.gamma1)
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.

classmethod fromDom(esysxml, node)
getAttributeObject(name)

Returns the object stored for attribute name.

hasAttribute(name)

Returns True if self has attribute name.

releaseParameters(name)

Removes parameter name from the parameters.

showParameters()

Returns a description of the parameters.

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 0x7ff1daf8c1e0>)

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

class esys.modellib.geometry.RectangularDomain(domainmodule=None, **kwargs)

Bases: esys.escript.modelframe.ParameterSet

Generates a mesh over a rectangular domain.

Variables:
  • dim – spatial dimension, default =2 (in).
  • l – spatial lengths, default [1.,1.,1.] (in).
  • n – number of elements, default [10,10,10] (in).
  • order – element order, default 1 (in).
  • periodic – flags for periodicity, default [False,False,False] (in).
  • intergrationOrder – integration order, default -1 (in).
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.

domain()

returns the domain

Returns:the domain
Return type:Domain
classmethod fromDom(esysxml, node)
getAttributeObject(name)

Returns the object stored for attribute name.

hasAttribute(name)

Returns True if self has attribute name.

releaseParameters(name)

Removes parameter name from the parameters.

showParameters()

Returns a description of the parameters.

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 0x7ff1daf8c1e0>)

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

class esys.modellib.geometry.ScalarConstrainerAtBoxVertex(**kwargs)

Bases: esys.escript.modelframe.Model

Creates a characteristic function for the location of constraints for a scalar value and selects the value from an initial value ate these locations.

In the case that the spatial dimension is two, the arguments front and back are ignored.

Variables:
  • domain – domain (in).
  • tol – absolute tolerance for “x=left, front, bottom vertex” condition, default 1.e-8 (in).
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.

location_of_constraint()

return the values used to constrain a solution

Returns:the mask marking the locations of the constraints
Return type:escript.Scalar
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.

value_of_constraint()

return the values used to constrain a solution

Returns:values to be used at the locations of the constraints. If value is not given None is rerturned.
Return type:escript.Scalar
writeXML(ostream=<open file '<stdout>', mode 'w' at 0x7ff1daf8c1e0>)

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

class esys.modellib.geometry.ScalarConstrainerOverBox(**kwargs)

Bases: esys.escript.modelframe.Model

Creates a characteristic function for the location of constraints for a scalar value and selects the value from an initial value ate these locations.

In the case that the spatial dimension is two, the arguments front and back are ignored.

Variables:
  • domain – domain (in).
  • left – True to set a constraint at the left face of the domain (x[0]=min x[0]), default False (in).
  • right – True to set a constraint at the left face of the domain (x[0]=max x[0]), default False (in).
  • top – True to set a constraint at the left face of the domain (x[1]=min x[1]), default False (in).
  • bottom – True to set a constraint at the left face of the domain (x[1]=max x[1]), default False (in).
  • front – True to set a constraint at the left face of the domain (x[2]=min x[2]), default False (in).
  • back – True to set a constraint at the left face of the domain (x[2]=max x[2]), default False (in).
  • tol – absolute tolerance for “x=max x” condition, default 1.e-8 (in).
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.

location_of_constraint()

return the values used to constrain a solution

Returns:the mask marking the locations of the constraints
Return type:escript.Scalar
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.

value_of_constraint()

return the values used to constrain a solution

Returns:values to be used at the locations of the constraints. If value is not given None is rerturned.
Return type:escript.Scalar
writeXML(ostream=<open file '<stdout>', mode 'w' at 0x7ff1daf8c1e0>)

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

class esys.modellib.geometry.UpdateGeometry(**kwargs)

Bases: esys.escript.modelframe.Model

applies a displacement field to a domain

Variables:
  • displacement – displacements applied to the original mesh coordinates (in).
  • domain – domain
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)

applies the current displacement to mesh nodes.

doStepPostprocessing(dt)

marks nodes as beeing updated.

doStepPreprocessing(dt)

applies the current displacement to mesh nodes if required.

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 0x7ff1daf8c1e0>)

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

class esys.modellib.geometry.VectorConstrainerAtBoxVertex(**kwargs)

Bases: esys.escript.modelframe.Model

Creates a characteristic function for the location of constraints vector value. In the case that the spatial dimension is two, the arguments front and back as well as the third component of each argument is ignored.

Variables:
  • domain – domain
  • comp_mask – list of three boolean. comp_mask[i]==True sets a constraint for the i-th component at the left, front, bottom vertex, default [False,False,False] (in).
  • tol – absolute tolerance for “x=left, front, bottom vertex” condition, default 1.e-8 (in).
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.

location_of_constraint()

return the values used to constrain a solution

Returns:the mask marking the locations of the constraints
Return type:escript.Vector
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.

value_of_constraint()

return the values used to constrain a solution

Returns:values to be used at the locations of the constraints. If value is not given None is rerturned.
Return type:escript.Vector
writeXML(ostream=<open file '<stdout>', mode 'w' at 0x7ff1daf8c1e0>)

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

class esys.modellib.geometry.VectorConstrainerOverBox(**kwargs)

Bases: esys.escript.modelframe.Model

Creates a characteristic function for the location of constraints vector value. In the case that the spatial dimension is two, the arguments front and back as well as the third component of each argument is ignored.

Variables:
  • domain – domain
  • left – list of three boolean. left[i]==True sets a constraint for the i-th component at the left face of the domain (x[0]=min x[0]), default [False,False,False] (in).
  • right – list of three boolean. left[i]==True sets a constraint for the i-th component at the right face of the domain (x[0]=max x[0]), default [False,False,False] (in).
  • top – list of three boolean. left[i]==True sets a constraint for the i-th component at the top face of the domain (x[1]=min x[1]), default [False,False,False] (in).
  • bottom – list of three boolean. left[i]==True sets a constraint for the i-th component at the bottom face of the domain (x[1]=min x[1]), default [False,False,False] (in).
  • front – list of three boolean. left[i]==True sets a constraint for the i-th component at the front face of the domain (x[2]=min x[2]), default [False,False,False] (in).
  • back – list of three boolean. left[i]==True sets a constraint for the i-th component at the back face of the domain (x[2]=max x[2]), default [False,False,False] (in).
  • tol – absolute tolerance for “x=max x” condition, default 1.e-8 (in).
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.

location_of_constraint()

return the values used to constrain a solution

Returns:the mask marking the locations of the constraints
Return type:escript.Vector
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.

value_of_constraint()

return the values used to constrain a solution

Returns:values to be used at the locations of the constraints. If value is not given None is rerturned.
Return type:escript.Vector
writeXML(ostream=<open file '<stdout>', mode 'w' at 0x7ff1daf8c1e0>)

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

Functions

esys.modellib.geometry.Scalar([(float)value=0.0[, (FunctionSpace)what=<esys.escript.escriptcpp.FunctionSpace object at 0x4234950>[, (bool)expanded=False]]]) → Data :

Construct a Data object containing scalar data-points.

Parameters:
  • value (float) – scalar value for all points
  • what (FunctionSpace) – FunctionSpace for Data
  • expanded (bool) – If True, a value is stored for each point. If False, more efficient representations may be used
Return type:

Data

esys.modellib.geometry.Vector([(float)value=0.0[, (FunctionSpace)what=<esys.escript.escriptcpp.FunctionSpace object at 0x42349d0>[, (bool)expanded=False]]]) → Data :

Construct a Data object containing rank1 data-points.

param value:scalar value for all points
rtype:Data
type value:float
param what:FunctionSpace for Data
type what:FunctionSpace
param expanded:If True, a value is stored for each point. If False, more efficient representations may be used
type expanded:bool

Vector( (object)value [, (FunctionSpace)what=<esys.escript.escriptcpp.FunctionSpace object at 0x4234a50> [, (bool)expanded=False]]) -> Data

esys.modellib.geometry.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.geometry.length(arg)

Returns the length (Euclidean norm) of argument arg at each data point.

Parameters:arg (float, escript.Data, Symbol, numpy.ndarray) – argument
Return type:float, escript.Data, Symbol depending on the type of arg
esys.modellib.geometry.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
esys.modellib.geometry.whereZero(arg, tol=None, rtol=1.4901161193847656e-08)

Returns mask of zero entries of argument arg.

Parameters:
  • arg (float, escript.Data, Symbol, numpy.ndarray) – argument
  • tol (float) – absolute tolerance. Values with absolute value less than tol are accepted as zero. If tol is not present rtol``*```Lsup` (arg) is used.
  • rtol (non-negative float) – relative tolerance used to define the absolute tolerance if tol is not present.
Return type:

float, escript.Data, Symbol, numpy.ndarray depending on the type of arg

Raises:
  • ValueError – if rtol is non-negative.
  • TypeError – if the type of the argument is not expected

Others

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