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.
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.
note: | In the no argument form, a new object will be returned which is an independent copy of this object. |
---|
Selectively copy values from other Data.Datapoints which correspond to positive values in mask will be copied from other
Parameters: |
---|
Convert this object into lazy representation
Save the data as a netCDF file
Parameters: | fileName (string) – |
---|
Convert the data to expanded representation if it is not expanded already.
Return type: | Domain |
---|
Return type: | FunctionSpace |
---|
Return type: | int |
---|---|
Returns: | Number of datapoints in the object |
Returns: | the number of indices required to address a component of a datapoint |
---|---|
Return type: | positive int |
Returns the shape of the datapoints in this object as a python tuple. Scalar data has the shape ()
Return type: | tuple |
---|
Return tag number for the specified datapoint
Return type: | int |
---|---|
Parameters: | dpno (int) – datapoint number |
Returns: | Value of the specified datapoint |
---|---|
Return type: | tuple |
Parameters: | dataPointNo (int) – datapoint to access |
Get a specific datapoint from a specific process
Return type: | tuple |
---|---|
Parameters: |
|
Interpolate this object’s values into a new functionspace.
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
Return type: | bool |
---|---|
Returns: | True if this Data is an instance of DataConstant |
Note : | This does not mean the data is immutable. |
Is this object an instance of DataEmpty
Return type: | bool |
---|---|
Note : | This is not the same thing as asking if the object contains datapoints. |
Return type: | bool |
---|---|
Returns: | True if this Data is expanded. |
Return type: | bool |
---|---|
Returns: | True if this Data is lazy. |
Can this instance be modified. :rtype: bool
Return type: | bool |
---|---|
Returns: | True if this Data is not lazy. |
Return type: | bool |
---|---|
Returns: | True if this Data is expanded. |
Please consider using getSupLocator() from pdetools instead.
Please consider using getInfLocator() from pdetools instead.
1D interpolation with non equally spaced points
1D interpolation of slope with non equally spaced points
Convert the data to non-lazy representation.
Disallow modifications to this data object
Note : | This method does not allow you to undo protection. |
---|
Set the value of tagged Data.
param tagKey: tag to update type tagKey: int
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 |
After this call the object will store values of the same shape as before but all components will be zero.
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.
Convert data to tagged representation if it is not already tagged or expanded
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] |
---|
Bases: object
A Link makes an attribute of an object callable:
o.object()
o.a=8
l=Link(o,"a")
assert l()==8
Returns the name of the attribute the link is pointing to.
Returns the target.
Returns true if an attribute name is set.
Sets a new attribute name to be collected from the target object. The target object must have the attribute with name attribute.
toDom method of Link. Creates a Link node and appends it to the current XML esysxml.
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.
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.
Declares one or more new parameters and their initial value.
Declares a set of parameters. parameters can be a list, a dictionary or a ParameterSet.
Finalizes the time stepping.
This function may be overwritten.
Finalises the initialization iteration process. This method is not called in case of a restart.
This function may be overwritten.
Performs an iteration step in the initialization phase. This method is not called in case of a restart.
This function may be overwritten.
Initializes the time stepping scheme. This method is not called in case of a restart.
This function may be overwritten.
Executes an iteration step at a time step.
dt is the currently used time step size.
This function may be overwritten.
Finalises the time step.
dt is the currently used time step size.
This function may be overwritten.
Sets up a time step of step size dt.
This function may be overwritten.
Returns False if the time stepping is finalized.
This function may be overwritten.
Returns the object stored for attribute name.
Returns a time step size which can be safely used.
dt gives the previously used step size.
This function may be overwritten.
Returns True if self has attribute name.
Removes parameter name from the parameters.
Sets up the model.
This function may be overwritten.
Returns a description of the parameters.
Returns True if iteration at the inital phase is terminated.
Returns True if iteration on a time step is terminated.
toDom method of Model class.
If debugging is on, prints the message, otherwise does nothing.
Writes the object as an XML object into an output stream.
Bases: esys.escriptcore.modelframe.Model
Generic visualization Model
Variables: |
|
---|
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.
Declares one or more new parameters and their initial value.
Declares a set of parameters. parameters can be a list, a dictionary or a ParameterSet.
Finalizes the time stepping.
This function may be overwritten.
Finalises the initialization iteration process. This method is not called in case of a restart.
This function may be overwritten.
Performs an iteration step in the initialization phase. This method is not called in case of a restart.
This function may be overwritten.
does some kind of initialisation
Executes an iteration step at a time step.
dt is the currently used time step size.
This function may be overwritten.
Finalises the time step.
dt is the currently used time step size.
This function may be overwritten.
Sets up a time step of step size dt.
This function may be overwritten.
Returns False if the time stepping is finalized.
This function may be overwritten.
Returns the object stored for attribute name.
returns a frame counter
returns new step size
Parameters: | dt (float) – last time step size used |
---|---|
Returns: | time step size that can savely be used |
Return type: | float |
Returns True if self has attribute name.
Removes parameter name from the parameters.
Sets up the model.
This function may be overwritten.
Returns a description of the parameters.
Returns True if iteration at the inital phase is terminated.
Returns True if iteration on a time step is terminated.
toDom method of Model class.
If debugging is on, prints the message, otherwise does nothing.
returns True if the time stamp for writing frame is reached.
Writes the object as an XML object into an output stream.
Bases: esys.modellib.visualization.Visualization
Writes data into a VTK file.
The Model can handel up to 20 data sets that are written into a single file tagged with the given name. If no name is given and the data are defined by a Link the name of the target attribute is used as a tag.
Variables: |
|
---|
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.
Declares one or more new parameters and their initial value.
Declares a set of parameters. parameters can be a list, a dictionary or a ParameterSet.
Finalizes the time stepping.
This function may be overwritten.
writes vtk file at the end of initial iteration
Performs an iteration step in the initialization phase. This method is not called in case of a restart.
This function may be overwritten.
does some kind of initialisation
Executes an iteration step at a time step.
dt is the currently used time step size.
This function may be overwritten.
writes vtk file at the end of time iteration
Sets up a time step of step size dt.
This function may be overwritten.
Returns False if the time stepping is finalized.
This function may be overwritten.
Returns the object stored for attribute name.
returns a frame counter
returns new step size
Parameters: | dt (float) – last time step size used |
---|---|
Returns: | time step size that can savely be used |
Return type: | float |
Returns True if self has attribute name.
Removes parameter name from the parameters.
Sets up the model.
This function may be overwritten.
Returns a description of the parameters.
Returns True if iteration at the inital phase is terminated.
Returns True if iteration on a time step is terminated.
toDom method of Model class.
If debugging is on, prints the message, otherwise does nothing.
returns True if the time stamp for writing frame is reached.
Writes the object as an XML object into an output stream.
Writes Data objects and their mesh to a file using the VTK XML file format.
Example:
temp=Scalar(..)
v=Vector(..)
saveVTK("solution.vtu", temperature=temp, velocity=v)
temp and v are written to “solution.vtu” where temp is named “temperature” and v is named “velocity”.
Meta tags, e.g. a timeStamp, can be added to the file, for instance:
tmp=Scalar(..)
v=Vector(..)
saveVTK("solution.vtu", temperature=tmp, velocity=v,
metadata="<timeStamp>1.234</timeStamp>",
metadata_schema={"gml":"http://www.opengis.net/gml"})
The argument metadata_schema allows the definition of name spaces with a schema used in the definition of meta tags.
Parameters: |
|
---|---|
Note : | All data objects have to be defined on the same domain. They may not be in the same FunctionSpace but not all combinations of FunctionSpace s can be written to a single VTK file. Typically, data on the boundary and on the interior cannot be mixed. |