Patch: Modify Field to Support cxxparse
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patch: Modify Field to Support cxxparse



2001-10-05  Jeffrey D. Oldham  <oldham@xxxxxxxxxxxxxxxx>

        These changes are for two reasons:
        1) to permit cxxparse to parse these files
        2) to rearrange file inclusions to move closer to correctness

        * Field/Field.h: Replace inclusion of FieldOffset.h by declaration
        of FieldOffset and FieldOffsetList.
        * Field/FieldOffset.h: Include "Field.h" since Field is used in
        the file.
        (accumulate): Change return type to 'T'.  This is a syntactic, not
        semantic, change.
        (sum): Likewise.
        (av): Likewise.
        (min): Likewise.
        (max): Likewise.
        * Field/NearestNeighbors.h: Include 'FieldOffset.h'.
        (manhattanDistance): Syntactic, not semantic, change in template
        parameter declaration.
        * Pooma/Fields.h: Include FieldOffset.h.

Tested on       sequential Linux using gcc3.1 by compiling Pooma library and some executables
Applied to      mainline
Approved by     Stephen Smith

Thanks,
Jeffrey D. Oldham
oldham@xxxxxxxxxxxxxxxx
Index: Field/Field.h
===================================================================
RCS file: /home/pooma/Repository/r2/src/Field/Field.h,v
retrieving revision 1.74
diff -c -p -r1.74 Field.h
*** Field/Field.h	2001/09/26 17:19:46	1.74
--- Field/Field.h	2001/10/05 02:53:43
***************
*** 67,73 ****
  #include "Field/VectorFieldOperators.h"
  #include "Field/FieldCreateLeaf.h"
  #include "Field/FieldCentering.h"
- #include "Field/FieldOffset.h"
  #include "Field/NearestNeighbors.h"
  
  #include "Field/PrintField.h"
--- 67,72 ----
*************** template<class Subject, class Domain, bo
*** 97,102 ****
--- 96,107 ----
  struct View1Implementation;
  
  class RelationListItem;
+ 
+ template <int Dim>
+ class FieldOffset;
+ 
+ template <int Dim>
+ class FieldOffsetList;
  
  //-----------------------------------------------------------------------------
  // Prototypes for the assign function used to assign an expression to a Field.
Index: Field/FieldOffset.h
===================================================================
RCS file: /home/pooma/Repository/r2/src/Field/FieldOffset.h,v
retrieving revision 1.1
diff -c -p -r1.1 FieldOffset.h
*** Field/FieldOffset.h	2001/08/30 01:15:06	1.1
--- Field/FieldOffset.h	2001/10/05 02:53:43
***************
*** 65,72 ****
  #include "Domain/Loc.h"
  #include <iostream>
  #include <vector>
  
- 
  //-----------------------------------------------------------------------------
  // Forward declarations:
  //-----------------------------------------------------------------------------
--- 65,72 ----
  #include "Domain/Loc.h"
  #include <iostream>
  #include <vector>
+ #include "Field/Field.h"
  
  //-----------------------------------------------------------------------------
  // Forward declarations:
  //-----------------------------------------------------------------------------
*************** std::ostream &operator<<(std::ostream &o
*** 356,362 ****
  template<class GeometryTag, class T, class Expr, int Dim,
           class BinaryFunction>
  inline
! typename Field<GeometryTag, T, Expr>::T_t
  accumulate(BinaryFunction binary_op,
  	   const Field<GeometryTag, T, Expr>& field, 
  	   const FieldOffsetList<Dim> &lst, 
--- 356,362 ----
  template<class GeometryTag, class T, class Expr, int Dim,
           class BinaryFunction>
  inline
! T
  accumulate(BinaryFunction binary_op,
  	   const Field<GeometryTag, T, Expr>& field, 
  	   const FieldOffsetList<Dim> &lst, 
*************** accumulate(BinaryFunction binary_op,
*** 379,385 ****
  
  template<class GeometryTag, class T, class Expr, int Dim>
  inline
! typename Field<GeometryTag, T, Expr>::T_t
  sum(const Field<GeometryTag, T, Expr>& field, 
      const FieldOffsetList<Dim> &lst, 
      const Loc<Dim> &loc)
--- 379,385 ----
  
  template<class GeometryTag, class T, class Expr, int Dim>
  inline
! T
  sum(const Field<GeometryTag, T, Expr>& field, 
      const FieldOffsetList<Dim> &lst, 
      const Loc<Dim> &loc)
*************** sum(const Field<GeometryTag, T, Expr>& f
*** 396,402 ****
  
  template<class GeometryTag, class T, class Expr, int Dim>
  inline
! typename Field<GeometryTag, T, Expr>::T_t
  av(const Field<GeometryTag, T, Expr>& field, 
     const FieldOffsetList<Dim> &lst, 
     const Loc<Dim> &loc)
--- 396,402 ----
  
  template<class GeometryTag, class T, class Expr, int Dim>
  inline
! T
  av(const Field<GeometryTag, T, Expr>& field, 
     const FieldOffsetList<Dim> &lst, 
     const Loc<Dim> &loc)
*************** struct fomin : public std::binary_functi
*** 419,425 ****
  
  template<class GeometryTag, class T, class Expr, int Dim>
  inline
! typename Field<GeometryTag, T, Expr>::T_t
  min(const Field<GeometryTag, T, Expr>& field, 
      const FieldOffsetList<Dim> &lst, 
      const Loc<Dim> &loc)
--- 419,425 ----
  
  template<class GeometryTag, class T, class Expr, int Dim>
  inline
! T
  min(const Field<GeometryTag, T, Expr>& field, 
      const FieldOffsetList<Dim> &lst, 
      const Loc<Dim> &loc)
*************** struct fomax : public std::binary_functi
*** 442,448 ****
  
  template<class GeometryTag, class T, class Expr, int Dim>
  inline
! typename Field<GeometryTag, T, Expr>::T_t
  max(const Field<GeometryTag, T, Expr>& field, 
      const FieldOffsetList<Dim> &lst, 
      const Loc<Dim> &loc)
--- 442,448 ----
  
  template<class GeometryTag, class T, class Expr, int Dim>
  inline
! T
  max(const Field<GeometryTag, T, Expr>& field, 
      const FieldOffsetList<Dim> &lst, 
      const Loc<Dim> &loc)
Index: Field/NearestNeighbors.h
===================================================================
RCS file: /home/pooma/Repository/r2/src/Field/NearestNeighbors.h,v
retrieving revision 1.1
diff -c -p -r1.1 NearestNeighbors.h
*** Field/NearestNeighbors.h	2001/08/30 01:15:06	1.1
--- Field/NearestNeighbors.h	2001/10/05 02:53:48
***************
*** 51,56 ****
--- 51,57 ----
  
  #include "Domain/Loc.h"
  #include "Field/FieldCentering.h"
+ #include "Field/FieldOffset.h"
  #include <vector>
  #include <numeric>
  #include <utility>
*************** private:
*** 293,299 ****
      }
    };
  
!   template <typename Distance>
    inline static
    double manhattanDistance(const Position &difference)
    {
--- 294,300 ----
      }
    };
  
!   template <class Distance>
    inline static
    double manhattanDistance(const Position &difference)
    {
Index: Pooma/Fields.h
===================================================================
RCS file: /home/pooma/Repository/r2/src/Pooma/Fields.h,v
retrieving revision 1.12
diff -c -p -r1.12 Fields.h
*** Pooma/Fields.h	2001/10/04 22:09:13	1.12
--- Pooma/Fields.h	2001/10/05 02:53:48
***************
*** 74,79 ****
--- 74,80 ----
  
  // Field offsets:
  
+ #include "Field/FieldOffset.h"
  #include "Field/DiffOps/FieldShiftEngine.h"
  #include "Field/DiffOps/FieldOffsetReduction.h"