Change Tiny Tests to Use New Field Abstractions

Jeffrey Oldham oldham at codesourcery.com
Wed Sep 5 21:42:42 UTC 2001


We revise the tests to use the new field abstractions.

2001-09-05  Jeffrey D. Oldham  <oldham at codesourcery.com>

        * TestDet.cpp (testDet): Replace use of DiscreteGeometry and Cell
        with new field centering and creation functions.
        * TestSymmetrize.cpp (testSymmetrize): Likewise.
        * TestTrace.cpp (testTrace): Likewise.
        * TestTranspose.cpp (testTranspose): Likewise.

Tested on       sequential Linux using gcc 3.0.1 by compiling and running the executables and also by Linux KCC
Approved by     Stephen Smith
Applied to      mainline

Thanks,
Jeffrey D. Oldham
oldham at codesourcery.com
-------------- next part --------------
Index: TestDet.cpp
===================================================================
RCS file: /home/pooma/Repository/r2/src/Tiny/tests/TestDet.cpp,v
retrieving revision 1.2
diff -c -p -r1.2 TestDet.cpp
*** TestDet.cpp	2000/03/07 13:18:17	1.2
--- TestDet.cpp	2001/09/05 19:01:02
*************** void testDet(Pooma::Tester &tester)
*** 76,94 ****
    // Create the (uniform, logically rectilinear) mesh.
    Vector<Dim> origin(0.0), spacings(0.2);
    typedef UniformRectilinearMesh<Dim> Mesh_t;
!   Mesh_t mesh(vertexDomain, origin, spacings);
  
-   // Create geometry object:
-   typedef DiscreteGeometry<Cell, Mesh_t> Geometry_t;
-   Geometry_t geom(mesh);
- 
    // Create the Fields:
  
    // Full, Antisymmetric, Symmetric, Diagonal Tensor Fields:
!   Field<Geometry_t,Tensor<Dim,double,Full> > tff(geom);
!   Field<Geometry_t,Tensor<Dim,double,Symmetric> > tfs(geom);
!   Field<Geometry_t,Tensor<Dim,double,Antisymmetric> > tfa(geom);
!   Field<Geometry_t,Tensor<Dim,double,Diagonal> > tfd(geom);
  
    // Assign values:
    Tensor<Dim,double,Full> tf(0.0);
--- 76,94 ----
    // Create the (uniform, logically rectilinear) mesh.
    Vector<Dim> origin(0.0), spacings(0.2);
    typedef UniformRectilinearMesh<Dim> Mesh_t;
!   DomainLayout<Dim> layout(vertexDomain, GuardLayers<Dim>(0));
  
    // Create the Fields:
+   Centering<Dim> cell = canonicalCentering<Dim>(CellType, Continuous);
  
    // Full, Antisymmetric, Symmetric, Diagonal Tensor Fields:
!   Field<Mesh_t,Tensor<Dim,double,Full> > tff(cell, layout, origin, spacings);
!   Field<Mesh_t,Tensor<Dim,double,Antisymmetric> >
!     tfa(cell, layout, origin, spacings);
!   Field<Mesh_t,Tensor<Dim,double,Symmetric> >
!     tfs(cell, layout, origin, spacings);
!   Field<Mesh_t,Tensor<Dim,double,Diagonal> >
!     tfd(cell, layout, origin, spacings);
  
    // Assign values:
    Tensor<Dim,double,Full> tf(0.0);
Index: TestSymmetrize.cpp
===================================================================
RCS file: /home/pooma/Repository/r2/src/Tiny/tests/TestSymmetrize.cpp,v
retrieving revision 1.5
diff -c -p -r1.5 TestSymmetrize.cpp
*** TestSymmetrize.cpp	2000/03/07 13:18:18	1.5
--- TestSymmetrize.cpp	2001/09/05 19:01:02
*************** void testSymmetrize(Pooma::Tester &teste
*** 148,166 ****
    // Create the (uniform, logically rectilinear) mesh.
    Vector<D> origin(0.0), spacings(0.2);
    typedef UniformRectilinearMesh<D> Mesh_t;
!   Mesh_t mesh(vertexDomain, origin, spacings);
  
-   // Create geometry object:
-   typedef DiscreteGeometry<Cell, Mesh_t> Geometry_t;
-   Geometry_t geom(mesh);
- 
    // Create the Fields:
  
    // Full, Antisymmetric, Symmetric, Diagonal Tensor Fields:
!   Field<Geometry_t,Tensor<D,double,Full> > tff(geom);
!   Field<Geometry_t,Tensor<D,double,Symmetric> > tfs(geom);
!   Field<Geometry_t,Tensor<D,double,Antisymmetric> > tfa(geom);
!   Field<Geometry_t,Tensor<D,double,Diagonal> > tfd(geom);
  
    // Assign to the single-Tensor values:
    tff = tf;
--- 148,165 ----
    // Create the (uniform, logically rectilinear) mesh.
    Vector<D> origin(0.0), spacings(0.2);
    typedef UniformRectilinearMesh<D> Mesh_t;
!   DomainLayout<D> layout(vertexDomain, GuardLayers<D>(0));
  
    // Create the Fields:
+   Centering<D> cell = canonicalCentering<D>(CellType, Continuous);
  
    // Full, Antisymmetric, Symmetric, Diagonal Tensor Fields:
!   Field<Mesh_t,Tensor<D,double,Full> > tff(cell, layout, origin, spacings);
!   Field<Mesh_t,Tensor<D,double,Symmetric> >
!     tfs(cell, layout, origin, spacings);
!   Field<Mesh_t,Tensor<D,double,Antisymmetric> >
!     tfa(cell, layout, origin, spacings);
!   Field<Mesh_t,Tensor<D,double,Diagonal> > tfd(cell, layout, origin, spacings);
  
    // Assign to the single-Tensor values:
    tff = tf;
Index: TestTrace.cpp
===================================================================
RCS file: /home/pooma/Repository/r2/src/Tiny/tests/TestTrace.cpp,v
retrieving revision 1.2
diff -c -p -r1.2 TestTrace.cpp
*** TestTrace.cpp	2000/03/07 13:18:18	1.2
--- TestTrace.cpp	2001/09/05 19:01:02
*************** void testTrace(Pooma::Tester &tester)
*** 76,94 ****
    // Create the (uniform, logically rectilinear) mesh.
    Vector<Dim> origin(0.0), spacings(0.2);
    typedef UniformRectilinearMesh<Dim> Mesh_t;
!   Mesh_t mesh(vertexDomain, origin, spacings);
  
-   // Create geometry object:
-   typedef DiscreteGeometry<Cell, Mesh_t> Geometry_t;
-   Geometry_t geom(mesh);
- 
    // Create the Fields:
  
    // Full, Antisymmetric, Symmetric, Diagonal Tensor Fields:
!   Field<Geometry_t,Tensor<Dim,double,Full> > tff(geom);
!   Field<Geometry_t,Tensor<Dim,double,Antisymmetric> > tfa(geom);
!   Field<Geometry_t,Tensor<Dim,double,Symmetric> > tfs(geom);
!   Field<Geometry_t,Tensor<Dim,double,Diagonal> > tfd(geom);
  
    // Assign values:
    Tensor<Dim,double,Full> tf(0.0);
--- 76,94 ----
    // Create the (uniform, logically rectilinear) mesh.
    Vector<Dim> origin(0.0), spacings(0.2);
    typedef UniformRectilinearMesh<Dim> Mesh_t;
!   DomainLayout<Dim> layout(vertexDomain, GuardLayers<Dim>(0));
  
    // Create the Fields:
+   Centering<Dim> cell = canonicalCentering<Dim>(CellType, Continuous);
  
    // Full, Antisymmetric, Symmetric, Diagonal Tensor Fields:
!   Field<Mesh_t,Tensor<Dim,double,Full> > tff(cell, layout, origin, spacings);
!   Field<Mesh_t,Tensor<Dim,double,Antisymmetric> >
!     tfa(cell, layout, origin, spacings);
!   Field<Mesh_t,Tensor<Dim,double,Symmetric> >
!     tfs(cell, layout, origin, spacings);
!   Field<Mesh_t,Tensor<Dim,double,Diagonal> >
!     tfd(cell, layout, origin, spacings);
  
    // Assign values:
    Tensor<Dim,double,Full> tf(0.0);
Index: TestTranspose.cpp
===================================================================
RCS file: /home/pooma/Repository/r2/src/Tiny/tests/TestTranspose.cpp,v
retrieving revision 1.2
diff -c -p -r1.2 TestTranspose.cpp
*** TestTranspose.cpp	2000/03/07 13:18:19	1.2
--- TestTranspose.cpp	2001/09/05 19:01:02
*************** void testTranspose(Pooma::Tester &tester
*** 76,94 ****
    // Create the (uniform, logically rectilinear) mesh.
    Vector<Dim> origin(0.0), spacings(0.2);
    typedef UniformRectilinearMesh<Dim> Mesh_t;
!   Mesh_t mesh(vertexDomain, origin, spacings);
  
-   // Create geometry object:
-   typedef DiscreteGeometry<Cell, Mesh_t> Geometry_t;
-   Geometry_t geom(mesh);
- 
    // Create the Fields:
  
    // Full, Antisymmetric, Symmetric, Diagonal Tensor Fields:
!   Field<Geometry_t,Tensor<Dim,double,Full> > tff(geom);
!   Field<Geometry_t,Tensor<Dim,double,Symmetric> > tfs(geom);
!   Field<Geometry_t,Tensor<Dim,double,Antisymmetric> > tfa(geom);
!   Field<Geometry_t,Tensor<Dim,double,Diagonal> > tfd(geom);
  
    // Assign values:
    Tensor<Dim,double,Full> tf(0.0), tfTranspose;
--- 76,94 ----
    // Create the (uniform, logically rectilinear) mesh.
    Vector<Dim> origin(0.0), spacings(0.2);
    typedef UniformRectilinearMesh<Dim> Mesh_t;
!   DomainLayout<Dim> layout(vertexDomain, GuardLayers<Dim>(0));
  
    // Create the Fields:
+   Centering<Dim> cell = canonicalCentering<Dim>(CellType, Continuous);
  
    // Full, Antisymmetric, Symmetric, Diagonal Tensor Fields:
!   Field<Mesh_t,Tensor<Dim,double,Full> > tff(cell, layout, origin, spacings);
!   Field<Mesh_t,Tensor<Dim,double,Symmetric> >
!     tfs(cell, layout, origin, spacings);
!   Field<Mesh_t,Tensor<Dim,double,Antisymmetric> >
!     tfa(cell, layout, origin, spacings);
!   Field<Mesh_t,Tensor<Dim,double,Diagonal> >
!     tfd(cell, layout, origin, spacings);
  
    // Assign values:
    Tensor<Dim,double,Full> tf(0.0), tfTranspose;


More information about the pooma-dev mailing list