RFA: More Minor Changes to Tutorials
Jeffrey Oldham
oldham at codesourcery.com
Wed Mar 21 23:25:39 UTC 2001
Here are changes to tutorials starting with tut-09.html. OK to
commit?
Wed Mar 21 15:05:19 2001 Jeffrey D. Oldham <oldham at codesourcery.com>
* tut-09.html: Fix minor typographical errors.
Fix line number references.
(Summary): Change "particles" to typewriter font. Correct
possessive of singular <tt>Particles</tt>. Change second
parameter of "deferredDestroy" to match the following text.
* tut-11.html: Remove second of two contiguous periods.
(PrintArray Class): Change "print" to typewriter font. Fix
typos. Add a space between a type and a variable.
(dbprint): s/;/,/
s/dB*/db*/
Change type's and function's names to typewriter fonts.
* tut-12.html (Object Serialization): s/principle/principal/
(Using POOMA I/O): Add a comma and change "type" to typewriter
font.
How do we verify these changes?
Thanks,
Jeffrey D. Oldham
oldham at codesourcery.com
-------------- next part --------------
Index: tut-09.html
===================================================================
RCS file: /home/pooma/Repository/r2/docs/tut-09.html,v
retrieving revision 1.1
diff -c -p -r1.1 tut-09.html
*** tut-09.html 2001/03/19 16:11:14 1.1
--- tut-09.html 2001/03/21 23:22:01
*************** then randomize the balls' initial positi
*** 869,881 ****
<p>Lines 103-110 are the most novel part of this simulation, as they
create reflecting boundary conditions for the simulation, and add them
! to the <tt>balls</tt> object. Lines 103-108 defines where particles
bounce; again, this is done in a dimension-independent fashion in
! order to make code evolution as easy as possible. Line 104 turns
<tt>upper</tt> and <tt>lower</tt> into a reversing boundary condition,
! which line 105 then adds to <tt>balls</tt>. The main simulation
loop now consists of nothing more than advancing the balls in each
! time step, and calling <tt>sync()</tt> to enforce the boundary
conditions.
<!---------------------------------------------------------------------->
--- 869,881 ----
<p>Lines 103-110 are the most novel part of this simulation, as they
create reflecting boundary conditions for the simulation, and add them
! to the <tt>balls</tt> object. Lines 103-108 define where particles
bounce; again, this is done in a dimension-independent fashion in
! order to make code evolution as easy as possible. Line 109 turns
<tt>upper</tt> and <tt>lower</tt> into a reversing boundary condition,
! which line 110 then adds to <tt>balls</tt>. The main simulation
loop now consists of nothing more than advancing the balls in each
! time step, and calling <tt>applyBoundaryCondition()</tt> to enforce the boundary
conditions.
<!---------------------------------------------------------------------->
*************** list below summarizes the most important
*** 892,898 ****
<ul>
<li><tt>Particles<PL>::initialize(PL &layout)</tt>:
! Initialize the particles object with the given particle layout. This
should be used if the <tt>Particles</tt> object was created with the
default constructor.
--- 892,898 ----
<ul>
<li><tt>Particles<PL>::initialize(PL &layout)</tt>:
! Initialize the <tt>Particles</tt> object with the given particle layout. This
should be used if the <tt>Particles</tt> object was created with the
default constructor.
*************** Return the number of registered attribut
*** 909,918 ****
<li><tt>addAttribute(attrib)</tt>:
Add the given attribute (should be a <tt>DynamicArray</tt> of the
! proper engine type) to the <tt>Particles</tt>' attribute list.
<li><tt>removeAttribute(attrib)</tt>:
! Remove the given attribute from the <tt>Particles</tt>' attribute
list.
<li><tt>sync(posattrib)</tt>:
--- 909,918 ----
<li><tt>addAttribute(attrib)</tt>:
Add the given attribute (should be a <tt>DynamicArray</tt> of the
! proper engine type) to the <tt>Particles</tt>'s attribute list.
<li><tt>removeAttribute(attrib)</tt>:
! Remove the given attribute from the <tt>Particles</tt>'s attribute
list.
<li><tt>sync(posattrib)</tt>:
*************** Destroy any particles that were specifie
*** 933,939 ****
<li><tt>renumber()</tt>:
Recalculate the per-patch and total domain of the system by inspecting
! the <tt>Particles</tt>' attribute layout.
<li><tt>create(N, patch, renum)</tt>:
Create <em>N</em> particles in the specified patch (and optionally
--- 933,939 ----
<li><tt>renumber()</tt>:
Recalculate the per-patch and total domain of the system by inspecting
! the <tt>Particles</tt>'s attribute layout.
<li><tt>create(N, patch, renum)</tt>:
Create <em>N</em> particles in the specified patch (and optionally
*************** renumber. The domain may be a one-dimen
*** 951,957 ****
numbers or a list of index numbers. (See the note below on the
<tt>patchId</tt> parameter.)
! <li><tt>deferredDestroy(domain, patch)</tt>:
Put the indices of the particles in the given domain in the deferred
destroy list of the <tt>Particles</tt> object, so that they will be
destroyed by the next call to <tt>performDestroy()</tt>.
--- 951,957 ----
numbers or a list of index numbers. (See the note below on the
<tt>patchId</tt> parameter.)
! <li><tt>deferredDestroy(domain, patchId)</tt>:
Put the indices of the particles in the given domain in the deferred
destroy list of the <tt>Particles</tt> object, so that they will be
destroyed by the next call to <tt>performDestroy()</tt>.
Index: tut-11.html
===================================================================
RCS file: /home/pooma/Repository/r2/docs/tut-11.html,v
retrieving revision 1.1
diff -c -p -r1.1 tut-11.html
*** tut-11.html 2001/03/19 16:11:14 1.1
--- tut-11.html 2001/03/21 23:22:01
*************** special "off" setting, by calling <tt>se
*** 147,153 ****
<p>When running with multiple threads in a context, only one thread does the
output, either for standard C++ stream output, or for <tt>Inform</tt>
! output.. This is the "control" thread, which manages task assignment to the
others. It is important to note that any output to an <tt>Inform</tt> which
reads data from a multi-patch container is independent of whether other
threads might be currently modifying those values. To avoid this, insert a
--- 147,153 ----
<p>When running with multiple threads in a context, only one thread does the
output, either for standard C++ stream output, or for <tt>Inform</tt>
! output. This is the "control" thread, which manages task assignment to the
others. It is important to note that any output to an <tt>Inform</tt> which
reads data from a multi-patch container is independent of whether other
threads might be currently modifying those values. To avoid this, insert a
*************** containers.</p>
*** 218,224 ****
<h3><a NAME="PrintArray"></a>The <tt>PrintArray</tt> Class</h3>
<p>The typical way to use <tt>PrintArray</tt> is to construct a
! <tt>PrintArray</tt> object, then use its print() methods for sending formatted
ASCII output of POOMA container data to a stream such as <tt>cout</tt> or an
<tt>Inform</tt> object. The constructor accepts values for six formatting
parameters, which are maintained as member data in the object.
--- 218,224 ----
<h3><a NAME="PrintArray"></a>The <tt>PrintArray</tt> Class</h3>
<p>The typical way to use <tt>PrintArray</tt> is to construct a
! <tt>PrintArray</tt> object, then use its <tt>print()</tt> methods for sending formatted
ASCII output of POOMA container data to a stream such as <tt>cout</tt> or an
<tt>Inform</tt> object. The constructor accepts values for six formatting
parameters, which are maintained as member data in the object.
*************** the total number of significant digits.<
*** 261,267 ****
<tt>setCarReturn(), carReturn() </tt>:</dt>
<dd>
! If less than 0, print all values in a row (first array index) one one like
of output. If greater than 0, specifies the number of values to print before
breaking the output with a carriage return.</dd>
--- 261,267 ----
<tt>setCarReturn(), carReturn() </tt>:</dt>
<dd>
! If less than 0, print all values in a row (first array index) on one line
of output. If greater than 0, specifies the number of values to print before
breaking the output with a carriage return.</dd>
*************** attributes from <tt>Particles</tt>), but
*** 302,308 ****
restrictions are that the container must export an <tt>enum</tt> value
<tt>dimensions</tt>, such as <tt>Array::dimensions</tt>, and must have an
array-indexing capability such that
! <tt>operator()(int io, int i1, ..., int iN)</tt>
returns a contained data value. (Here, <tt>N=dimensions-1</tt>.)</p>
<p>If you pass in a view of an <tt>Array</tt>, for example, to the first
--- 302,308 ----
restrictions are that the container must export an <tt>enum</tt> value
<tt>dimensions</tt>, such as <tt>Array::dimensions</tt>, and must have an
array-indexing capability such that
! <tt>operator()(int i0, int i1, ..., int iN)</tt>
returns a contained data value. (Here, <tt>N=dimensions-1</tt>.)</p>
<p>If you pass in a view of an <tt>Array</tt>, for example, to the first
*************** These code snips illustrate the differen
*** 314,320 ****
like for a 3D <tt>Array</tt>:
<blockquote><pre>
! Range<3>r(Range<1>(2,10,2),Range<1>(1,3,1),Range<1>(3));
Array<3> a(20,20,20); <i>// ... assign values to a ...</i>
Inform pout; <i>// An output stream</i>
--- 314,320 ----
like for a 3D <tt>Array</tt>:
<blockquote><pre>
! Range<3> r(Range<1>(2,10,2),Range<1>(1,3,1),Range<1>(3));
Array<3> a(20,20,20); <i>// ... assign values to a ...</i>
Inform pout; <i>// An output stream</i>
*************** prints
*** 389,395 ****
<p>Many debuggers have a command prompt or expression-evaluation window and
allow interactive calling of functions with simple arguments. Few, if any, of
these debuggers have a convenient means to invoke template functions even when
! the templates have been instantiated in the executable code; and none allow
interactive construction of objects or invocation of objects' member
functions, whether the associated class and/or member functions are templated
or not.</p>
--- 389,395 ----
<p>Many debuggers have a command prompt or expression-evaluation window and
allow interactive calling of functions with simple arguments. Few, if any, of
these debuggers have a convenient means to invoke template functions even when
! the templates have been instantiated in the executable code, and none allow
interactive construction of objects or invocation of objects' member
functions, whether the associated class and/or member functions are templated
or not.</p>
*************** or <tt>s(s.physicalDomain())</tt>, to ex
*** 739,745 ****
not possible interactively.</p>
<p>The <tt>dbSetCarReturn()</tt> invocations illustrate more of the POOMA
! <tt>dB*()</tt> function family. These invoke the corresponding
<tt>PrintArray</tt> functions on a global <tt>PrintArray</tt> object
maintained internally by POOMA. This sets a format state that persists from
one interactive function call to the next. Here is the set of these
--- 739,745 ----
not possible interactively.</p>
<p>The <tt>dbSetCarReturn()</tt> invocations illustrate more of the POOMA
! <tt>db*()</tt> function family. These invoke the corresponding
<tt>PrintArray</tt> functions on a global <tt>PrintArray</tt> object
maintained internally by POOMA. This sets a format state that persists from
one interactive function call to the next. Here is the set of these
*************** int dbSpacing();
*** 761,768 ****
void dbSetSpacing(int val);
</pre></blockquote>
! <p>Two additional functions allow toggling between the default Inform object
! used by dbprint() and one or more user-defined Inform objects:
<dl>
<dt>
--- 761,768 ----
void dbSetSpacing(int val);
</pre></blockquote>
! <p>Two additional functions allow toggling between the default <tt>Inform</tt> object
! used by <tt>dbprint()</tt> and one or more user-defined <tt>Inform</tt> objects:
<dl>
<dt>
Index: tut-12.html
===================================================================
RCS file: /home/pooma/Repository/r2/docs/tut-12.html,v
retrieving revision 1.1
diff -c -p -r1.1 tut-12.html
*** tut-12.html 2001/03/19 16:11:14 1.1
--- tut-12.html 2001/03/21 23:22:02
*************** but not as good for multi-application co
*** 93,99 ****
other hand, there are many situations when one would just as soon not have
the overhead of an object-oriented database no matter how streamlined.
<p>Object-oriented applications benefit enormously from object-oriented
! data management. After all, the principle reason many programmers prefer
object-oriented languages is so that they can create and exploit new data
types. Object storage systems provide a way to store and retrieve user-defined
types as easily as intrinsic types.
--- 93,99 ----
other hand, there are many situations when one would just as soon not have
the overhead of an object-oriented database no matter how streamlined.
<p>Object-oriented applications benefit enormously from object-oriented
! data management. After all, the principal reason many programmers prefer
object-oriented languages is so that they can create and exploit new data
types. Object storage systems provide a way to store and retrieve user-defined
types as easily as intrinsic types.
*************** may be summarized as follows:
*** 234,240 ****
Report the number of distinct types in the object set.</li>
<li>
! Report the name of a type given its index <i>k</i>, where <i>k = 0, ...
(number of types -1)</i>.</li>
<li>
--- 234,240 ----
Report the number of distinct types in the object set.</li>
<li>
! Report the name of a type given its index <i>k</i>, where <i>k = 0, ...,
(number of types -1)</i>.</li>
<li>
*************** instances.</li>
*** 245,251 ****
For a given type indicated by type name or index <i>k</i>, report the name
of object <i>j</i> where<i> j = 0 , ..., (number of instances -1)</i>.</li>
</ul>
! The ID of an object is an integer (type <i>long</i>) that by convention
is the position of the object in the list of instances of that type. That
is, if an instance of a given type is second on the list, its ID is 1 (indexed
from zero). The primary key for objects contained in an object set is the
--- 245,251 ----
For a given type indicated by type name or index <i>k</i>, report the name
of object <i>j</i> where<i> j = 0 , ..., (number of instances -1)</i>.</li>
</ul>
! The ID of an object is an integer (type <tt>long</tt>) that by convention
is the position of the object in the list of instances of that type. That
is, if an instance of a given type is second on the list, its ID is 1 (indexed
from zero). The primary key for objects contained in an object set is the
More information about the pooma-dev
mailing list