[newfield_revision] Patch: Remove NewField/FieldInitializer.h

Jeffrey Oldham oldham at codesourcery.com
Fri Aug 3 19:02:02 UTC 2001


Stephen Smith recently incorporated the new centerings into the
newfield_revision branch of the src/NewField directory.  This patch
removes the old centering implementation.
 
2001-08-03  Jeffrey D. Oldham  <oldham at codesourcery.com>
 
        * NewField/FieldInitializers.h: Remove this old centering
        implementation.
        * NewField/DiffOps/Div.UR.h: Remove inclusion of
        NewField/FieldInitializers.h.
        * NewField/DiffOps/Div.h: Likewise.
        * NewField/DiffOps/FieldStencil.h: Update comments to use new
        centering.
        * Pooma/NewFields.h: Remove inclusion of
        NewField/FieldInitializers.h.

Tested on       sequential Linux using gcc 3.0 by compiling Pooma library and NewField tests
Approved by     Scott Haney
Branch          newfield_revision

Thanks,
Jeffrey D. Oldham
oldham at codesourcery.com
-------------- next part --------------
Index: NewField/FieldInitializers.h
===================================================================
RCS file: FieldInitializers.h
diff -N FieldInitializers.h
*** /tmp/cvsGkL82N	Fri Aug  3 12:21:47 2001
--- /dev/null	Tue May  5 14:32:27 1998
***************
*** 1,204 ****
- // -*- C++ -*-
- // ACL:license
- // ----------------------------------------------------------------------
- // This software and ancillary information (herein called "SOFTWARE")
- // called POOMA (Parallel Object-Oriented Methods and Applications) is
- // made available under the terms described here.  The SOFTWARE has been
- // approved for release with associated LA-CC Number LA-CC-98-65.
- // 
- // Unless otherwise indicated, this SOFTWARE has been authored by an
- // employee or employees of the University of California, operator of the
- // Los Alamos National Laboratory under Contract No. W-7405-ENG-36 with
- // the U.S. Department of Energy.  The U.S. Government has rights to use,
- // reproduce, and distribute this SOFTWARE. The public may copy, distribute,
- // prepare derivative works and publicly display this SOFTWARE without 
- // charge, provided that this Notice and any statement of authorship are 
- // reproduced on all copies.  Neither the Government nor the University 
- // makes any warranty, express or implied, or assumes any liability or 
- // responsibility for the use of this SOFTWARE.
- // 
- // If SOFTWARE is modified to produce derivative works, such modified
- // SOFTWARE should be clearly marked, so as not to confuse it with the
- // version available from LANL.
- // 
- // For more information about POOMA, send e-mail to pooma at acl.lanl.gov,
- // or visit the POOMA web page at http://www.acl.lanl.gov/pooma/.
- // ----------------------------------------------------------------------
- // ACL:license
- 
- //-----------------------------------------------------------------------------
- // Classes: 
- //   Cell
- //   Vert
- //   Edge
- //   Face
- //   DistributeSubFields
- //   ReplicateSubFields
- //-----------------------------------------------------------------------------
- 
- #ifndef POOMA_NEWFIELD_FIELDINITIALIZERS_H
- #define POOMA_NEWFIELD_FIELDINITIALIZERS_H
- 
- //-----------------------------------------------------------------------------
- // Overview: 
- // 
- // POOMA supports a hierarchy of multiple centering points per 
- // cell. The centering information, managed by the FieldEngineBase
- // class, is initialized using a flexible set of functors. Below are some
- // pre-defined functors that set up some common centerings along with some
- // versions for building multi-material and multi-centered fields.
- //-----------------------------------------------------------------------------
- 
- //-----------------------------------------------------------------------------
- // Includes:
- //-----------------------------------------------------------------------------
- 
- #include "Domain/Loc.h"
- #include "Utilities/PAssert.h"
- 
- #include <iostream>
- 
- //-----------------------------------------------------------------------------
- // Forward declarations:
- //-----------------------------------------------------------------------------
- 
- /* None for now */
- 
- // ----------------------------------------------------------------------------
- // Full description:
- //
- // Initialization functors for the Field class:
- //   o Cell:                 cell-centered in every direction
- //   o Vert:                 vertex-centered in every direction
- //   o Edge                  cell-centered in specified direction, 
- //                           vertex-centered otherwise
- //   o Face:                 vertex-centered in specified direction, 
- //                           cell-centered otherwise
- //   o DistributeSubFields: distributes a centering along orientations
- //                           corresponding to coordinate directions
- //                           Example: AllEdge..edge-centered in every direction
- //                           Example: AllFace..face-centered in every direction
- //   o ReplicateSubFields:  replicates a centering N times
- //                           Example: multi-material fields
- //
- // Usage Examples:
- //
- //  Interval<3> I(10, 10, 10), J(5, 5, 5);
- //  FieldEngineBase<3, double, Brick> 
- //    c1(Cell(), I),
- //    c2(Edge(1), I),                             
- //    c3(DistributeSubFields<Face>(), I),      
- //    c4(ReplicateSubFields<DistributeSubFields<Face> >
- //      (DistributeSubFields<Face>(), 5), I); 
- //
- // Declares a cell-centering, an edge-centering aligned with the Y axis, an
- // all-face centering, and a replicated all-face centering.
- // ----------------------------------------------------------------------------
- 
- class Cell {
- public:
- 
-   inline Cell() { }
-   
-   template<class Subject, class Initializer>
-   inline void initialize(Subject &s, const Initializer &init) const
-     {
-       Loc<Subject::dimensions> l(0);
-       s.initialize(l, init);
-     }
- };
- 
- class Vert {
- public:
- 
-   inline Vert() { }
-   
-   template<class Subject, class Initializer>
-   inline void initialize(Subject &s, const Initializer &init) const
-     {
-       Loc<Subject::dimensions> l(1);
-       s.initialize(l, init);
-     }
- };
- 
- class Edge {
- public:
- 
-   Edge(int orientation) : orientation_m(orientation) { }
-   
-   template<class Subject, class Initializer>
-   inline void initialize(Subject &s, const Initializer &init) const
-     {
-       Loc<Subject::dimensions> l(1); l[orientation_m] = Loc<1>(0);
-       s.initialize(l, init);
-     }
- 
- private:
- 
-   int orientation_m;  
- };
- 
- class Face {
- public:
- 
-   Face(int orientation) : orientation_m(orientation) { }
-   
-   template<class Subject, class Initializer>
-   inline void initialize(Subject &s, const Initializer &init) const
-     {
-       Loc<Subject::dimensions> l(0); l[orientation_m] = Loc<1>(1);
-       s.initialize(l, init);
-     }
- 
- private:
- 
-   int orientation_m;  
- };
- 
- template<class S>
- class DistributeSubFields {
- public:
- 
-   DistributeSubFields() { }
-   
-   template<class Subject, class Initializer>
-   inline void initialize(Subject &s, const Initializer &init) const
-     {
-       s.addSubFields(Subject::dimensions);
-       for (int i = 0; i < Subject::dimensions; i++)
-         S(i).initialize(s.subField(i), init);
-     }
- };
- 
- typedef DistributeSubFields<Edge> AllEdge;
- typedef DistributeSubFields<Face> AllFace;
- 
- template<class S>
- class ReplicateSubFields {
- public:
- 
-   explicit ReplicateSubFields(int n) : n_m(n) { }
-   ReplicateSubFields(const S &c, int n) : subField_m(c), n_m(n) { }
-   
-   template<class Subject, class Initializer>
-   inline void initialize(Subject &s, const Initializer &init) const
-     {
-       s.addSubFields(n_m);
-       for (int i = 0; i < n_m; i++)
-         subField_m.initialize(s.subField(i), init);
-     }
-     
- private:
- 
-   S subField_m;
-   int n_m;
- };
- 
- #endif // POOMA_NEWFIELD_FIELDINITIALIZERS_H
- 
- // ACL:rcsinfo
- // ----------------------------------------------------------------------
- // $RCSfile: FieldInitializers.h,v $   $Author: oldham $
- // $Revision: 1.4 $   $Date: 2001/04/11 21:39:27 $
- // ----------------------------------------------------------------------
- // ACL:rcsinfo
--- 0 ----
Index: NewField/DiffOps/Div.UR.h
===================================================================
RCS file: /home/pooma/Repository/r2/src/NewField/DiffOps/Div.UR.h,v
retrieving revision 1.5.2.1
diff -c -p -r1.5.2.1 Div.UR.h
*** NewField/DiffOps/Div.UR.h	2001/08/03 16:07:13	1.5.2.1
--- NewField/DiffOps/Div.UR.h	2001/08/03 18:21:45
***************
*** 55,61 ****
  
  #include "Tiny/Vector.h"
  #include "NewField/DiffOps/FieldStencil.h"
- #include "NewField/FieldInitializers.h"
  #include "NewField/FieldEngine/FieldEngine.UR.h"
  
  //-----------------------------------------------------------------------------
--- 55,60 ----
Index: NewField/DiffOps/Div.h
===================================================================
RCS file: /home/pooma/Repository/r2/src/NewField/DiffOps/Div.h,v
retrieving revision 1.3.2.1
diff -c -p -r1.3.2.1 Div.h
*** NewField/DiffOps/Div.h	2001/08/03 16:07:13	1.3.2.1
--- NewField/DiffOps/Div.h	2001/08/03 18:21:45
***************
*** 64,70 ****
  
  #include "NewField/Field.h"
  #include "NewField/FieldCentering.h"
- #include "NewField/FieldInitializers.h"
  #include "NewField/DiffOps/FieldStencil.h"
  
  //-----------------------------------------------------------------------------
--- 64,69 ----
Index: NewField/DiffOps/FieldStencil.h
===================================================================
RCS file: /home/pooma/Repository/r2/src/NewField/DiffOps/FieldStencil.h,v
retrieving revision 1.5.2.1
diff -c -p -r1.5.2.1 FieldStencil.h
*** NewField/DiffOps/FieldStencil.h	2001/08/03 16:07:13	1.5.2.1
--- NewField/DiffOps/FieldStencil.h	2001/08/03 18:21:47
*************** struct FieldStencilSimple
*** 466,487 ****
  // new number of guard layers.
  //
  // To create a stencil, users must create a class similar to the one below,
! // which computes a central difference divergence of a Vert-centered Field
! // and maps it to a Cell-centered Field:
  //
  // template<class OutputCentering, class Geometry, class T>
  // class Div { };
  //  
! // template<int Dim, class T1, class T2>
! // class Div<Cell,
! //   DiscreteGeometry<Vert, UniformRectilinear<Dim, Cartesian<Dim>, T1> >, 
! //   Vector<Dim, T2> >
  // {
  // public:
  // 
- //   typedef Cell OutputCentering_t;
  //   typedef T2 OutputElement_t;
  // 
  //   int lowerExtent(int) const
  //     {
  //       return 1;
--- 466,489 ----
  // new number of guard layers.
  //
  // To create a stencil, users must create a class similar to the one below,
! // which computes a central difference divergence of a vertex-centered Field
! // and maps it to a cell-centered Field:
  //
  // template<class OutputCentering, class Geometry, class T>
  // class Div { };
  //  
! // template<class T2, int Dim, class TM, class CS>
! // class DivVertToCell<Vector<Dim, T2>, UniformRectilinear<Dim, TM, CS> >
  // {
  // public:
  // 
  //   typedef T2 OutputElement_t;
  // 
+ //   Centering<Dim> outputCentering() const
+ //   {
+ //     return canonicalCentering<Dim>(CellType, Continuous);
+ //   }
+ //
  //   int lowerExtent(int) const
  //     {
  //       return 1;
Index: Pooma/NewFields.h
===================================================================
RCS file: /home/pooma/Repository/r2/src/Pooma/NewFields.h,v
retrieving revision 1.5
diff -c -p -r1.5 NewFields.h
*** Pooma/NewFields.h	2001/03/01 15:48:12	1.5
--- Pooma/NewFields.h	2001/08/03 18:21:47
***************
*** 59,65 ****
  
  // Other stuff:
  
- #include "NewField/FieldInitializers.h"
  #include "NewField/FieldReductions.h"
  #include "NewField/PrintField.h"
  #include "NewField/FieldOperatorSpecializations.h"
--- 59,64 ----


More information about the pooma-dev mailing list