freepooma-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[newfield_revision] Nearest Neighbors, Reduction Functions


From: Jeffrey Oldham
Subject: [newfield_revision] Nearest Neighbors, Reduction Functions
Date: Thu, 2 Aug 2001 15:51:39 -0700
User-agent: Mutt/1.2.5i

The attached patch revises FieldOffset, eliminating the Type template
parameter and adding miscellaneous functionality such as operator<<
and operator==.  The eliminated Type parameter indicated whether the
underlying field had one subfield or multiple subfields, which are
accessed differently.  Stephen, Scott, and I all repeatedly tripped
over the template parameter, which propagated itself through much of
the code changes.  Instead, of a compile-time parameter, we use a
run-time computation to decide how to access a field.  The associated
test program is also revised.

More importantly, this patch also adds FieldOffsetList,
nearestNeighbors(), NearestNeighbors, associated reduction functions,
and associated test programs FieldReductions and NearestNeighbors.  A
FieldOffsetList is a list of FieldOffsets.  Given input and output
centerings, nearestNeighbors() returns a std::vector of
FieldOffsetLists.  Each FieldOffsetList specifies the locations of the
input field values closest (using the Manhattan norm) to the
corresponding output field value.  Many of the Caramana hydrodynamics
and Chevron kernel operations use nearest neighbors since physics
operates locally.  FieldReductions, taking an input field, a
FieldOffsetList, and an output cell location, apply a reduction to the
specified input cells.

All these changes were added to the newfield_revision branch, which is
being developed by Scott Haney, Jeffrey D. Oldham, and Stephen Smith.
The branch code is not guaranteed to compile, be correct, or stable.

2001-08-02  Jeffrey D. Oldham  <address@hidden>

        * FieldCentering.cmpl.cpp
        (CanonicalCentering::CanonicalCentering): Fix continuity label for
        canonical discontinuous vertex centering.
        * Field.h: Include NearestNeighbors.h
        (View2<..., FieldOffset<...> >): New class merging previous
        FieldOffset<...,[01]> code.
        (View2<..., FieldOffset<...,1> >): Removed.
        (View2<..., FieldOffset<...,0> >): Removed.
        * FieldOffset.h: (FieldOffset<...>): New class merging previous
        FieldOffset<...,[01]> code.
        (FieldOffset<...,1>): Removed.
        (FieldOffset<...,0>): Removed.
        (FieldOffset::FieldOffset()): New function.
        (FieldOffset::setSubFieldNumber): Likewise.
        (FieldOffset::modifyCellOffset): Likewise.
        (operator<<(...,FieldOffset)): Likewise.
        (operator==(FieldOffset,...)): Likewise.
        (operator!=(FieldOffset,...)): Likewise.
        (FieldOffsetList): New class.
        (operator<<(...,FieldOffsetList)): New function.
        (accumulate): Likewise.
        (sum): Likewise.
        (average): Likewise.
        (minimum): Likewise.
        (maximum): Likewise.
        * NearestNeighbors.h (NearestNeighborClass): New class.
        (nearestNeighbors): New function.
        * objfile.mk ($(UNIQUE)_OBJS): Add FieldOffset.cmpl.o.
        * tests/FieldOffset.cpp: Removed second template parameter from
        all uses.
        * tests/FieldReductions.cpp: New testing file.
        * tests/NearestNeighbors.cpp: Likewise.
        * tests/makefile: Add support for FieldReductions and
        NearestNeighbors.  Remove support for ScalarAdvection and
        ScalarAdvectionXB.

Tested on       sequential Linux using gcc3.0 by building Pooma library and 
NewField executables
                also tested using KCC by Stephen Smith
Applied to      newfield_revision development branch
Approved by     Stephen Smith

Thanks,
Jeffrey D. Oldham
address@hidden

Attachment: 02Aug.12.7.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]