Changeset 3119


Ignore:
Timestamp:
Jun 8, 2006, 2:53:26 PM (19 years ago)
Author:
howard
Message:

Modified the description of symbolic tags in 3.1.7

File:
1 edited

Legend:

Unmodified
Added
Removed
  • documentation/user_manual/anuga_user_manual.tex

    r3114 r3119  
    310310   \item a dictionary \code{boundary} that stores the edges on
    311311   the boundary and associates each with one of the symbolic tags \code{`left'}, \code{`right'},
    312    \code{`top'} or \code{`bottom'}.
     312   \code{`top'} or \code{`bottom'}. (For more details on symbolic tags,
     313   see page \pageref{ref:tagdescription}.)
    313314
    314315\end{itemize}
     
    494495\end{itemize}
    495496
    496 Before describing how these boundary conditions are assigned, we
    497 recall that the definition of a mesh uses a variable \code{boundary}
    498 to store the edges of the mesh that lie on the boundary. (In the
    499 code we are discussing, \code{boundary} was one of the three
    500 variables returned by the function \code{rectangular}.)
    501 
    502 This variable \code{boundary} is a Python dictionary and it serves
    503 not only to hold the edges that make up the boundary but also to
    504 assign symbolic tags to these edges to distinguish different parts
    505 of the boundary. In this example, the tags  used are \code{`left',
    506 \code{`right'}, \code{`top'} and \code{`bottom'}, corresponding to
    507 the left, right, top and bottom of the rectangle bounding the mesh,
    508 and the function \code{rectangular} automatically assigns these tags
    509 to the boundary edges when it generates the mesh. The tags are used
    510 as keys for the dictionary, so that, for example,
    511 \code{boundary[`left']} is a list of the mesh edges that lie along
    512 the left part of the boundary.
     497\label{ref:tagdescription}Before describing how these boundary
     498conditions are assigned, we recall that a mesh is specified using
     499three variables \code{points}, \code{vertices} and \code{boundary}.
     500In the code we are discussing, these three variables are returned by
     501the function \code{rectangular}; however, the example given in
     502Section \ref{sec:realdataexample} illustrates another way of
     503assigning the values, by means of the function
     504\code{create\_mesh\_from\_regions}.
     505
     506These variables store the data determining the mesh as follows. (You
     507may find that the example given in Section \ref{sec:meshexample}
     508helps to clarify the following discussion, even though that example
     509is a \emph{non-rectangular} mesh.)
     510
     511\begin{itemize}
     512\item The variable \code{points} stores a list of 2-tuples giving the
     513coordinates of the mesh points.
     514
     515\item The variable \code{vertices} stores a list of 3-tuples of
     516numbers, representing vertices of triangles in the mesh. In this
     517list, the triangle whose vertices are \code{points[i]},
     518\code{points[j]}, \code{points[k]} is represented by the 3-tuple
     519\code{(i, j, k)}.
     520
     521\item The variable \code{boundary} is a Python dictionary that
     522not only stores the edges that make up the boundary but also assigns
     523symbolic tags to these edges to distinguish different parts of the
     524boundary. An edge with endpoints \code{points[i]} and
     525\code{points[j]} is represented by the 2-tuple \code{(i, j)}. The
     526keys for the dictionary are the 2-tuples \code{[i, j]} corresponding
     527to boundary edges in the mesh, and the values are the tags are used
     528to label them. In the present example, the value \code{boundary[i,
     529j]} assigned to \code{[i, j]} is one of the four tags \code{`left'},
     530\code{`right'}, \code{`top'} or \code{`bottom'}, depending on
     531whether the boundary edge represented by \code{(i, j)} occurs at the
     532left, right, top or bottom of the rectangle bounding the mesh. The
     533function \code{rectangular} automatically assigns these tags to the
     534boundary edges when it generates the mesh.
     535\end{itemize}
    513536
    514537The tags provide the means to assign different boundary conditions
    515538to an edge depending on which part of the boundary it belongs to.
    516 (Later we shall describe an example that uses different boundary
    517 tags---we are not limited to using `left', `right', `top' and
    518 `bottom'.)
     539(In Section \ref{sec:realdataexample} we describe an example that
     540uses different boundary tags---in general, the possible tags are not
     541limited to `left', `right', `top' and `bottom', but can be selected
     542by the user.)
    519543
    520544Using the boundary objects described above, we assign a boundary
     
    564588See Section \ref{sec:file formats} (page \pageref{sec:file formats})
    565589for more on NetCDF and other file formats.
     590
     591The following is a listing of the screen output seen by the user
     592when this example is run:
     593
     594\verbatiminput{examples/runupoutput.txt}
    566595
    567596
     
    26452674
    26462675\subsubsection{How do I tag interior polygons?}
    2647 At the moment create_mesh_from_regions does not allow interior polygons
    2648 with symbolict tags. If tags are needed, the interior polygons must be
    2649 created subsequently. For example, given a filename of polygons representing
    2650 solid walls (in Arc Ungenerate format) can be tagged as such using the code
    2651 snippet:
    2652 \begin{verbatim} 
     2676At the moment create_mesh_from_regions does not allow interior
     2677polygons with symbolic tags. If tags are needed, the interior
     2678polygons must be created subsequently. For example, given a filename
     2679of polygons representing solid walls (in Arc Ungenerate format) can
     2680be tagged as such using the code snippet:
     2681\begin{verbatim}
    26532682  # Create mesh outline with tags
    26542683  mesh = create_mesh_from_regions(bounding_polygon,
     
    26592688
    26602689  # Generate and write mesh to file
    2661   mesh.generate_mesh(maximum_triangle_area=max_area)                 
     2690  mesh.generate_mesh(maximum_triangle_area=max_area)
    26622691  mesh.export_mesh_file(mesh_filename)
    2663 \end{verbatim} 
     2692\end{verbatim}
    26642693
    26652694Note that a mesh object is returned from \code{create_mesh_from_regions}
Note: See TracChangeset for help on using the changeset viewer.