# Changeset 2631

Ignore:
Timestamp:
Mar 29, 2006, 4:22:08 PM (17 years ago)
Message:

Meeting with Howard

File:
1 edited

### Legend:

Unmodified
 r2628 \begin{funcdesc} {set\_name}{name} Module: \codee{pyvolution.domain} Module: \code{pyvolution.domain} Assigns the name \code{name} to the domain Sets the directory used for data to the value \code{name}. The default value, before \code{set\_datadir} is run, is the value \code{default_datadir} specified in \config.py}. \code{set\_datadir} is run, is the value \code{default_datadir} specified in \code{config.py}. \end{funcdesc} Returns the data directory set by \code{set\_datadir} or, if \code{set\_datadir} has not been run, returns the value \code{default_datadir} specified in \config.py}. been run, returns the value \code{default_datadir} specified in \code{config.py}. \end{funcdesc} \section{Setting Quantities} \begin{funcdesc}{set\_quantity}{name, numeric = None, quantity = None, function = None, geospatial_data = None, filename = None, attribute_name = None, alpha = None, location = 'vertices', indices = None, verbose = False, use_cache = False} Module: \code{pyvolution.domain}  (see also \code{pyvolution.quantity.set_values}) This function is used to assign values to individual quantities for a domain. It is very flexible and can be used with many data types: a statement of the form \code{domain.set\_quantity{name, x}} can be used to define a quantity having the name \code{name}, where the other argument \code{x} can be any of the following: \begin{funcdesc}{set\_quantity}{name, numeric = None, quantity = None, function = None, geospatial_data = None, filename = None, attribute_name = None, alpha = None, location = 'vertices', indices = None, verbose = False, use_cache = False} Module: \code{pyvolution.domain} (see also \code{pyvolution.quantity.set_values}) This function is used to assign values to individual quantities for a domain. It is very flexible and can be used with many data types: a statement of the form \code{domain.set\_quantity(name, x)} can be used to define a quantity having the name \code{name}, where the other argument \code{x} can be any of the following: \begin{itemize} \item a number in which case all vertices in the mesh gets that for the quantity in question. \item a number, in which case all vertices in the mesh gets that for the quantity in question. \item a list of numbers or a Numeric array ordered the same way as the mesh vertices. \item a function (e.g.\ see the samples introduced in Chapter 2) \item an expression composed of other quantities and numbers, arrays, lists (for example, a linear combination of quantities) \item the name of a file from which the data can be read \item a geospatial dataset (See ?????) \item the name of a file from which the data can be read. In this case, the optional argument attribute_name will select which attribute to use from the file. If left out, set_quantity will pick one. This is useful in cases where there is only one attribute. \item a geospatial dataset (See ?????). Optional argument attribute_name applies here as with files. \end{itemize} numeric, quantity, function, points, filename must be present. Set quantity will look at the type of the second argument (\code{numeric}) and determine what action to take. Values can also be set using the appropriate keyword arguments. If x is a function, for example, \code{domain.set\_quantity(name, x)}, \code{domain.set\_quantity(name, numeric=x)}, and \code{domain.set\_quantity(name, function=x)} are all equivalent. Other optional arguments are \begin{itemize} \item \code{indices} which is a list of ids of triangles to which set_quantity should apply its assignment of values. \item \code{location} determines which part of the triangles to assign to. Options are 'vertices' (default), 'edges', and 'centroids'. \end{itemize} a number, in which case all vertices in the mesh gets that for the quantity in question. \item a list of numbers or a Numeric array ordered the same way as the mesh vertices. \end{funcdesc} %%% Module: \code{pyvolution.least\_squares} Given a time series defined at the vertices of a triangular mesh (such as those stored in \code{sww} files), \code{Interpolation\_function} is used to create a callable object that assigns a value \code{f(t, x, y)}, interpolated from the given time-series values, to an arbitrary time \code{t} and point \code{(x, y)} within the mesh region. Since, in practice, values need to be computed at specified Given a time series, either as a sequence of numbers or defined at the vertices of a triangular mesh (such as those stored in \code{sww} files), \code{Interpolation\_function} is used to create a callable object that interpolates a value for an arbitrary time \code{t} within the model limits and possibly a point \code{(x, y)} within a mesh region. The actual time series at which data is available is specified by means of an array \code{time} of monotonically increasing times. The quantities containing the values to be interpolated are specified in an array---or dictionary of arrays (used in conjunction with the optional argument \code{quantitity\_names}) --- called \code{quantities}. The optional arguments \code{vertex_coordinates} and \code{triangles} represent the spatial mesh associated with the quantity arrays. If omitted the function created by \code{Interpolation\_function} will be a function of \code{t} only. Since, in practice, values need to be computed at specified points, the syntax allows the user to specify, once and for all, a list \code{interpolation\_points} of points at which values are required. In this case, index identifying a member of \code{interpolation\_points}. The time series is specified by means of an array \code{time} of monotonically increasing times and an array---or dictionary of arrays---\code{quantities} containing the values to be interpolated. \end{classdesc} \section{Boundary Conditions} \anuga provides a large number of predefined boundary conditions, represented by objects such as \code{Reflective\_boundary(domain)} and \code{Dirichlet\_boundary([0.2, 0.0, 0.0])}, described in the examples in Chapter 2. Alternatively, you may prefer to roll your own'', following the method explained in \ref{sec:roll_your_own}. \anuga provides a large number of predefined boundary conditions, represented by objects such as \code{Reflective\_boundary(domain)} and \code{Dirichlet\_boundary([0.2, 0.0, 0.0])}, described in the examples in Chapter 2. Alternatively, you may prefer to roll your own'', following the method explained in Section \ref{sec:roll your own}. These boundary objects may be used with the function \code{set\_boundary} described below \end{funcdesc} \begin{funcdesc} {get_boundary_tags}{??} \begin{funcdesc} {get_boundary_tags}{} Module: \code{pyvolution.mesh} \end{funcdesc} \subsection{User-defined boundary conditions} \label{sec:roll_your_own} \label{sec:roll your own} [How to roll your own]