Changeset 2631
- Timestamp:
- Mar 29, 2006, 4:22:08 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
documentation/user_manual/anuga_user_manual.tex
r2628 r2631 910 910 911 911 \begin{funcdesc} {set\_name}{name} 912 Module: \code e{pyvolution.domain}912 Module: \code{pyvolution.domain} 913 913 914 914 Assigns the name \code{name} to the domain … … 926 926 927 927 Sets the directory used for data to the value \code{name}. The default value, before 928 \code{set\_datadir} is run, is the value \code{default_datadir} specified in \config.py}. 928 \code{set\_datadir} is run, is the value \code{default_datadir} 929 specified in \code{config.py}. 929 930 \end{funcdesc} 930 931 … … 933 934 934 935 Returns the data directory set by \code{set\_datadir} or, if \code{set\_datadir} has not 935 been run, returns the value \code{default_datadir} specified in \config.py}. 936 been run, returns the value \code{default_datadir} specified in 937 \code{config.py}. 936 938 \end{funcdesc} 937 939 … … 946 948 \section{Setting Quantities} 947 949 948 \begin{funcdesc}{set\_quantity}{name, numeric = None, quantity = None, function = None, 949 geospatial_data = None, filename = None, attribute_name = None, 950 alpha = None, location = 'vertices', indices = None, verbose = False, 951 use_cache = False} 952 Module: \code{pyvolution.domain} (see also 953 \code{pyvolution.quantity.set_values}) 954 955 This function is used to assign values to individual quantities for a domain. It is very flexible and can be 956 used with many data types: a statement of the form \code{domain.set\_quantity{name, x}} can 957 be used to define a quantity having the name \code{name}, where the other argument \code{x} can 958 be any of the following: 950 \begin{funcdesc}{set\_quantity}{name, 951 numeric = None, 952 quantity = None, 953 function = None, 954 geospatial_data = None, 955 filename = None, 956 attribute_name = None, 957 alpha = None, 958 location = 'vertices', 959 indices = None, 960 verbose = False, 961 use_cache = False} 962 Module: \code{pyvolution.domain} 963 (see also \code{pyvolution.quantity.set_values}) 964 965 This function is used to assign values to individual quantities for a 966 domain. It is very flexible and can be used with many data types: a 967 statement of the form \code{domain.set\_quantity(name, x)} can be used 968 to define a quantity having the name \code{name}, where the other 969 argument \code{x} can be any of the following: 959 970 960 971 \begin{itemize} 961 \item a number in which case all vertices in the mesh gets that for the quantity in question. 972 \item a number, in which case all vertices in the mesh gets that for 973 the quantity in question. 962 974 \item a list of numbers or a Numeric array ordered the same way as the mesh vertices. 963 975 \item a function (e.g.\ see the samples introduced in Chapter 2) 964 976 \item an expression composed of other quantities and numbers, arrays, lists (for 965 977 example, a linear combination of quantities) 966 \item the name of a file from which the data can be read 967 \item a geospatial dataset (See ?????) 978 \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. 979 \item a geospatial dataset (See ?????). Optional argument attribute_name applies here as with files. 968 980 \end{itemize} 969 981 … … 972 984 numeric, quantity, function, points, filename 973 985 must be present. 986 987 988 Set quantity will look at the type of the second argument (\code{numeric}) and 989 determine what action to take. 990 991 Values can also be set using the appropriate keyword arguments. 992 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)} 993 are all equivalent. 994 995 996 Other optional arguments are 997 \begin{itemize} 998 \item \code{indices} which is a list of ids of triangles to which set_quantity should apply its assignment of values. 999 \item \code{location} determines which part of the triangles to assign to. Options are 'vertices' (default), 'edges', and 'centroids'. 1000 \end{itemize} 1001 1002 1003 a number, in which case all vertices in the mesh gets that for 1004 the quantity in question. 1005 \item a list of numbers or a Numeric array ordered the same way as the mesh vertices. 1006 1007 974 1008 \end{funcdesc} 1009 1010 1011 1012 1013 1014 975 1015 976 1016 %%% … … 1025 1065 Module: \code{pyvolution.least\_squares} 1026 1066 1027 Given a time series defined at the vertices of a 1028 triangular mesh (such as those stored in \code{sww} files), 1029 \code{Interpolation\_function} is used to create a callable object 1030 that assigns a value \code{f(t, x, y)}, interpolated from the given time-series values, 1031 to an arbitrary time \code{t} and point \code{(x, y)} 1032 within the mesh region. Since, in practice, values need to be computed at specified 1067 Given a time series, either as a sequence of numbers or 1068 defined at the vertices of a triangular mesh (such 1069 as those stored in \code{sww} files), \code{Interpolation\_function} 1070 is used to create a callable object that interpolates a value for 1071 an arbitrary time \code{t} within the model limits and possibly a 1072 point \code{(x, y)} within a mesh region. 1073 1074 The actual time series at which data is available is specified by means 1075 of an array \code{time} of monotonically increasing times. 1076 The quantities containing the values to be interpolated are specified in 1077 an array---or dictionary of arrays (used in conjunction with the optional argument 1078 \code{quantitity\_names}) --- called \code{quantities}. 1079 The optional arguments \code{vertex_coordinates} and \code{triangles} represent 1080 the spatial mesh associated with the quantity arrays. If omitted the function created 1081 by \code{Interpolation\_function} will be a function of \code{t} only. 1082 1083 1084 Since, in practice, values need to be computed at specified 1033 1085 points, the syntax allows the user to specify, once and for all, a list 1034 1086 \code{interpolation\_points} of points at which values are required. In this case, … … 1036 1088 index identifying a member of \code{interpolation\_points}. 1037 1089 1038 The time series is specified by means of an array \code{time} 1039 of monotonically increasing times and an array---or dictionary of arrays---\code{quantities} 1040 containing the values to be interpolated. 1090 1091 1092 1093 1041 1094 \end{classdesc} 1042 1095 … … 1053 1106 \section{Boundary Conditions} 1054 1107 1055 \anuga provides a large number of predefined boundary conditions, represented by 1056 objects such as \code{Reflective\_boundary(domain)} and \code{Dirichlet\_boundary([0.2, 0.0, 0.0])}, 1057 described in the examples in Chapter 2. Alternatively, you may prefer to ``roll 1058 your own'', following the method explained in \ref{sec:roll_your_own}. 1108 \anuga provides a large number of predefined boundary conditions, 1109 represented by objects such as \code{Reflective\_boundary(domain)} and 1110 \code{Dirichlet\_boundary([0.2, 0.0, 0.0])}, described in the examples 1111 in Chapter 2. Alternatively, you may prefer to ``roll your own'', 1112 following the method explained in Section \ref{sec:roll your own}. 1059 1113 1060 1114 These boundary objects may be used with the function \code{set\_boundary} described below … … 1073 1127 \end{funcdesc} 1074 1128 1075 \begin{funcdesc} {get_boundary_tags}{??} 1129 \begin{funcdesc} {get_boundary_tags}{} 1130 Module: \code{pyvolution.mesh} 1076 1131 \end{funcdesc} 1077 1132 … … 1128 1183 1129 1184 \subsection{User-defined boundary conditions} 1130 \label{sec:roll _your_own}1185 \label{sec:roll your own} 1131 1186 [How to roll your own] 1132 1187
Note: See TracChangeset
for help on using the changeset viewer.