[cig-commits] r14052 - in short/3D/PyLith/branches/pylith-swig/unittests/libtests: bc topology

brad at geodynamics.org brad at geodynamics.org
Sat Feb 14 15:42:30 PST 2009


Author: brad
Date: 2009-02-14 15:42:29 -0800 (Sat, 14 Feb 2009)
New Revision: 14052

Removed:
   short/3D/PyLith/branches/pylith-swig/unittests/libtests/topology/TestFieldBase.cc
   short/3D/PyLith/branches/pylith-swig/unittests/libtests/topology/TestFieldBase.hh
Modified:
   short/3D/PyLith/branches/pylith-swig/unittests/libtests/bc/Makefile.am
   short/3D/PyLith/branches/pylith-swig/unittests/libtests/bc/TestNeumann.cc
   short/3D/PyLith/branches/pylith-swig/unittests/libtests/bc/TestNeumann.hh
   short/3D/PyLith/branches/pylith-swig/unittests/libtests/topology/Makefile.am
   short/3D/PyLith/branches/pylith-swig/unittests/libtests/topology/TestFieldMesh.cc
   short/3D/PyLith/branches/pylith-swig/unittests/libtests/topology/TestFieldSubMesh.cc
   short/3D/PyLith/branches/pylith-swig/unittests/libtests/topology/TestFieldSubMesh.hh
Log:
Updated TestFieldSubMesh.

Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/bc/Makefile.am
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/bc/Makefile.am	2009-02-14 00:55:30 UTC (rev 14051)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/bc/Makefile.am	2009-02-14 23:42:29 UTC (rev 14052)
@@ -37,6 +37,7 @@
 	TestDirichletBoundaryQuad4.cc \
 	TestDirichletBoundaryTet4.cc \
 	TestDirichletBoundaryHex8.cc \
+	TestNeumann.cc \
 	test_bc.cc
 
 
@@ -46,7 +47,6 @@
 #	TestAbsorbingDampersQuad4.cc \
 #	TestAbsorbingDampersTet4.cc \
 #	TestAbsorbingDampersHex8.cc \
-#	TestNeumann.cc \
 #	TestNeumannLine2.cc \
 #	TestNeumannTri3.cc \
 #	TestNeumannQuad4.cc \

Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/bc/TestNeumann.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/bc/TestNeumann.cc	2009-02-14 00:55:30 UTC (rev 14051)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/bc/TestNeumann.cc	2009-02-14 23:42:29 UTC (rev 14052)
@@ -19,9 +19,9 @@
 #include "data/NeumannData.hh" // USES NeumannData
 
 #include "pylith/feassemble/Quadrature.hh" // USES Quadrature
-#include "pylith/topology/FieldsManager.hh" // USES FieldsManager
+#include "pylith/topology/SolutionFields.hh" // USES SolutionFields
 #include "pylith/meshio/MeshIOAscii.hh" // USES MeshIOAscii
-#include "pylith/utils/sievetypes.hh" // USES PETSc Mesh
+#include "pylith/topology/Mesh.hh" // USES PETSc Mesh
 
 #include "spatialdata/geocoords/CSCart.hh" // USES CSCart
 #include "spatialdata/spatialdb/SimpleDB.hh" // USES SimpleDB
@@ -63,32 +63,32 @@
 void
 pylith::bc::TestNeumann::testInitialize(void)
 { // testInitialize
-  ALE::Obj<Mesh> mesh;
+  topology::Mesh mesh;
   Neumann bc;
-  topology::FieldsManager fields(mesh);
+  topology::SolutionFields fields(mesh);
   _initialize(&mesh, &bc, &fields);
 
   CPPUNIT_ASSERT(0 != _data);
 
-  const ALE::Obj<SubMesh>& boundaryMesh = bc._boundaryMesh;
+  const topology::SubMesh& boundaryMesh = bc._boundaryMesh;
+  const ALE::Obj<SieveSubMesh>& submesh = boundaryMesh.sieveMesh();
 
   // Check boundary mesh
-  CPPUNIT_ASSERT(!boundaryMesh.isNull());
+  CPPUNIT_ASSERT(!submesh.isNull());
 
-  const int cellDim = boundaryMesh->getDimension();
-  const ALE::Obj<SubMesh::label_sequence>& cells = boundaryMesh->heightStratum(1);
-  const int numBoundaryVertices = boundaryMesh->depthStratum(0)->size();
+  const int cellDim = boundaryMesh.dimension();
+  const ALE::Obj<SubMesh::label_sequence>& cells = submesh->heightStratum(1);
+  const int numBoundaryVertices = submesh->depthStratum(0)->size();
   const int numBoundaryCells = cells->size();
 
   CPPUNIT_ASSERT_EQUAL(_data->cellDim, cellDim);
   CPPUNIT_ASSERT_EQUAL(_data->numBoundaryVertices, numBoundaryVertices);
   CPPUNIT_ASSERT_EQUAL(_data->numBoundaryCells, numBoundaryCells);
 
-  // boundaryMesh->view("BOUNDARY MESH");
-
-  const int boundaryDepth = boundaryMesh->depth()-1; // depth of boundary cells
-  const ALE::Obj<real_section_type>& coordinates =
+  const int boundaryDepth = submesh->depth()-1; // depth of boundary cells
+  const ALE::Obj<RealSection>& coordinates =
     mesh->getRealSection("coordinates");
+  RestrictVisitor coordsVisitor(*coordinates, numCorners*spaceDim);
   // coordinates->view("Mesh coordinates from TestNeumann::testInitialize");
 
   const int spaceDim = _data->spaceDim;
@@ -103,13 +103,14 @@
   for(SubMesh::label_sequence::iterator c_iter = cells->begin();
       c_iter != cells->end();
       ++c_iter) {
-    const int numCorners = boundaryMesh->getNumCellCorners(*c_iter, boundaryDepth);
+    const int numCorners = submesh->getNumCellCorners(*c_iter, boundaryDepth);
     CPPUNIT_ASSERT_EQUAL(_data->numCorners, numCorners);
 
-    boundaryMesh->restrictClosure(coordinates, *c_iter, &cellVertices[0],
-			   cellVertices.size());
+    coordsVisitor.clear(); //??
+    boundaryMesh->restrictClosure(coordinates, coordsVisitor);
     double vert =0.0;
     double vertE =0.0;
+    const double* cellVertices = coordsVisitor.getValues();
     // std::cout << "c_iter " << *c_iter << " vertex coords:" << std::endl;
     for(int iVert = 0; iVert < numCorners; ++iVert) {
       for(int iDim = 0; iDim < spaceDim; ++iDim) {
@@ -131,31 +132,26 @@
   const int fiberDim = numQuadPts * spaceDim;
   double_array tractionsCell(fiberDim);
   int index = 0;
+  const ALE::Obj<RealSection>& tractionSection = bc._tractions->section();
 
   for(SubMesh::label_sequence::iterator c_iter = cells->begin();
       c_iter != cells->end();
       ++c_iter) {
-
-    bc._boundaryMesh->restrictClosure(bc._tractions, *c_iter,
-			       &tractionsCell[0], tractionsCell.size());
-
-    // std::cout << "Tractions at quadrature points: " << std::endl;
-    // std::cout << "Computed    Expected" << std::endl;
-    for (int iQuad=0; iQuad < numQuadPts; ++iQuad) {
+    tractionSection->restrictPoint(*c_iter,
+				   &tractionsCell[0], tractionsCell.size());
+    for (int iQuad=0; iQuad < numQuadPts; ++iQuad)
       for (int iDim =0; iDim < spaceDim; ++iDim) {
 	const double tractionsCellData = _data->tractionsCell[index];
-        // std::cout << "  " << tractionsCell[iQuad*spaceDim+iDim] << "   " << tractionsCellData << std::endl;
 	CPPUNIT_ASSERT_DOUBLES_EQUAL(tractionsCellData,
 				     tractionsCell[iQuad*spaceDim+iDim],
 				     tolerance);
 	++index;
       } // for
-      // std::cout << std::endl;
-    } // for
   } // for
 
 } // testInitialize
 
+#if 0
 // ----------------------------------------------------------------------
 // Test integrateResidual().
 void
@@ -263,6 +259,6 @@
     throw std::runtime_error(err.msg());
   } // catch
 } // _initialize
+#endif
 
-
 // End of file 

Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/bc/TestNeumann.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/bc/TestNeumann.hh	2009-02-14 00:55:30 UTC (rev 14051)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/bc/TestNeumann.hh	2009-02-14 23:42:29 UTC (rev 14052)
@@ -23,24 +23,16 @@
 
 #include <cppunit/extensions/HelperMacros.h>
 
-#include "pylith/utils/sievetypes.hh" // USES PETSc Mesh
+#include "pylith/bc/bcfwd.hh" // forward declarations
+#include "pylith/topology/topologyfwd.hh" // forward declarations
+#include "pylith/topology/feassemblefwd.hh" // forward declarations
 
 /// Namespace for pylith package
 namespace pylith {
   namespace bc {
     class TestNeumann;
-
-    class Neumann; // USES Neumann
     class NeumannData; // HOLDSA NeumannData
   } // bc
-
-  namespace feassemble {
-    class Quadrature; // HOLDSA Quadrature
-  } // feassemble
-
-  namespace topology {
-    class FieldsManager; // USES FieldsManager
-  } // topology
 } // pylith
 
 /// C++ unit testing for Neumann.
@@ -74,7 +66,7 @@
 protected :
 
   NeumannData* _data; ///< Data for testing
-  feassemble::Quadrature* _quadrature; ///< Data used in testing.
+  feassemble::Quadrature<topology::Mesh>* _quadrature; ///< Used in testing.
 
   // PRIVATE METHODS ////////////////////////////////////////////////////
 private :
@@ -85,9 +77,9 @@
    * @param bc Neumann boundary condition to initialize.
    * @param fields Solution fields.
    */
-  void _initialize(ALE::Obj<Mesh>* mesh,
+  void _initialize(topology::Mesh* mesh,
 		   Neumann* const bc,
-		   topology::FieldsManager* fields) const;
+		   topology::SolutionFields* fields) const;
 
 }; // class TestNeumann
 

Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/topology/Makefile.am
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/topology/Makefile.am	2009-02-14 00:55:30 UTC (rev 14051)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/topology/Makefile.am	2009-02-14 23:42:29 UTC (rev 14052)
@@ -22,14 +22,12 @@
 # Primary source files
 testtopology_SOURCES = \
 	TestMesh.cc \
+	TestMeshOps.cc \
 	TestSubMesh.cc \
 	TestFieldMesh.cc \
+	TestFieldSubMesh.cc \
 	test_topology.cc
 
-#	TestMeshOps.cc \
-#	TestFieldBase.cc \
-#	TestField.cc \
-#	TestFieldSubMesh.cc \
 #	TestFieldsMesh.cc \
 #	TestFieldsSubMesh.cc
 
@@ -37,7 +35,6 @@
 	TestMesh.hh \
 	TestSubMesh.hh \
 	TestMeshOps.hh \
-	TestFieldBase.hh \
 	TestFieldMesh.hh \
 	TestFieldSubMesh.hh \
 	TestFieldsMesh.hh \

Deleted: short/3D/PyLith/branches/pylith-swig/unittests/libtests/topology/TestFieldBase.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/topology/TestFieldBase.cc	2009-02-14 00:55:30 UTC (rev 14051)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/topology/TestFieldBase.cc	2009-02-14 23:42:29 UTC (rev 14052)
@@ -1,88 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-//                           Brad T. Aagaard
-//                        U.S. Geological Survey
-//
-// {LicenseText}
-//
-// ----------------------------------------------------------------------
-//
-
-#include <portinfo>
-
-#include "TestFieldBase.hh" // Implementation of class methods
-#include "pylith/topology/FieldBase.hh" // USES Field
-
-
-#include "spatialdata/geocoords/CSCart.hh" // USES CSCart
-
-// ----------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_REGISTRATION( pylith::topology::TestFieldBase );
-
-// ----------------------------------------------------------------------
-// Test constructor.
-void
-pylith::topology::TestFieldBase::testConstructor(void)
-{ // testConstructor
-  FieldBase field;
-} // testConstructor
-
-// ----------------------------------------------------------------------
-// Test name().
-void 
-pylith::topology::TestFieldBase::testName(void)
-{ // testName
-  FieldBase field;
-
-  CPPUNIT_ASSERT_EQUAL(std::string("unknown"), std::string(field.name()));
-
-  const std::string& name = "field A";
-  field.name(name.c_str());
-  CPPUNIT_ASSERT_EQUAL(name, std::string(field.name()));
-} // testName
-
-// ----------------------------------------------------------------------
-// Test vectorFieldType().
-void
-pylith::topology::TestFieldBase::testVectorFieldType(void)
-{ // testVectorFieldType
-  FieldBase field;
-
-  CPPUNIT_ASSERT_EQUAL(FieldBase::OTHER, field.vectorFieldType());
-
-  const FieldBase::VectorFieldEnum ftype = FieldBase::TENSOR;
-  field.vectorFieldType(ftype);
-  CPPUNIT_ASSERT_EQUAL(ftype, field.vectorFieldType());
-} // testVectorFieldType
-
-// ----------------------------------------------------------------------
-// Test scale().
-void
-pylith::topology::TestFieldBase::testScale(void)
-{ // testScale
-  FieldBase field;
-
-  CPPUNIT_ASSERT_EQUAL(1.0, field.scale());
-
-  const double scale = 4.0;
-  field.scale(scale);
-  CPPUNIT_ASSERT_EQUAL(scale, field.scale());
-} // testScale
-
-// ----------------------------------------------------------------------
-// Test addDimensionOkay().
-void
-pylith::topology::TestFieldBase::testAddDimensionOkay(void)
-{ // testAddDimensionOkay
-  FieldBase field;
-
-  CPPUNIT_ASSERT_EQUAL(false, field.addDimensionOkay());
-
-  field.addDimensionOkay(true);
-  CPPUNIT_ASSERT_EQUAL(true, field.addDimensionOkay());
-} // testAddDimensionOkay
-
-
-// End of file 

Deleted: short/3D/PyLith/branches/pylith-swig/unittests/libtests/topology/TestFieldBase.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/topology/TestFieldBase.hh	2009-02-14 00:55:30 UTC (rev 14051)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/topology/TestFieldBase.hh	2009-02-14 23:42:29 UTC (rev 14052)
@@ -1,74 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-//                           Brad T. Aagaard
-//                        U.S. Geological Survey
-//
-// {LicenseText}
-//
-// ----------------------------------------------------------------------
-//
-
-/**
- * @file unittests/libtests/topology/TestFieldBase.hh
- *
- * @brief C++ unit testing for FieldBase.
- */
-
-#if !defined(pylith_topology_testfieldbase_hh)
-#define pylith_topology_testfieldbase_hh
-
-// Include directives ---------------------------------------------------
-#include <cppunit/extensions/HelperMacros.h>
-
-// Forward declarations -------------------------------------------------
-/// Namespace for pylith package
-namespace pylith {
-  namespace topology {
-    class TestFieldBase;
-
-    class FieldBase;
-  } // topology
-} // pylith
-
-// TestFieldBase -------------------------------------------------------------
-/// C++ unit testing for FieldBase.
-class pylith::topology::TestFieldBase : public CppUnit::TestFixture
-{ // class TestFieldBase
-
-  // CPPUNIT TEST SUITE /////////////////////////////////////////////////
-  CPPUNIT_TEST_SUITE( TestFieldBase );
-
-  CPPUNIT_TEST( testConstructor );
-  CPPUNIT_TEST( testName );
-  CPPUNIT_TEST( testVectorFieldType );
-  CPPUNIT_TEST( testScale );
-  CPPUNIT_TEST( testAddDimensionOkay );
-
-  CPPUNIT_TEST_SUITE_END();
-
-  // PUBLIC METHODS /////////////////////////////////////////////////////
-public :
-
-  /// Test constructor.
-  void testConstructor(void);
-
-  /// Test name().
-  void testName(void);
-
-  /// Test vectorFieldType().
-  void testVectorFieldType(void);
-
-  /// Test scale().
-  void testScale(void);
-
-  /// Test addDimensionOkay().
-  void testAddDimensionOkay(void);
-
-}; // class TestFieldBase
-
-#endif // pylith_topology_testfieldbase_hh
-
-
-// End of file 

Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/topology/TestFieldMesh.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/topology/TestFieldMesh.cc	2009-02-14 00:55:30 UTC (rev 14051)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/topology/TestFieldMesh.cc	2009-02-14 23:42:29 UTC (rev 14052)
@@ -13,6 +13,7 @@
 #include <portinfo>
 
 #include "TestFieldMesh.hh" // Implementation of class methods
+
 #include "pylith/topology/Mesh.hh" // USES Mesh
 #include "pylith/topology/Field.hh" // USES Field
 

Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/topology/TestFieldSubMesh.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/topology/TestFieldSubMesh.cc	2009-02-14 00:55:30 UTC (rev 14051)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/topology/TestFieldSubMesh.cc	2009-02-14 23:42:29 UTC (rev 14052)
@@ -13,10 +13,10 @@
 #include <portinfo>
 
 #include "TestFieldSubMesh.hh" // Implementation of class methods
-#include "pylith/topology/FieldSubMesh.hh" // USES FieldSubMesh
 
-#include "pylith/topology/Mesh.hh" // USES Mesh
 #include "pylith/topology/SubMesh.hh" // USES SubMesh
+#include "pylith/topology/Field.hh" // USES Field
+
 #include "pylith/utils/array.hh" // USES double_array
 
 #include "spatialdata/geocoords/CSCart.hh" // USES CSCart
@@ -25,6 +25,9 @@
 CPPUNIT_TEST_SUITE_REGISTRATION( pylith::topology::TestFieldSubMesh );
 
 // ----------------------------------------------------------------------
+typedef pylith::topology::SubMesh::SieveMesh SieveMesh;
+
+// ----------------------------------------------------------------------
 namespace pylith {
   namespace topology {
     namespace _TestFieldSubMesh {
@@ -62,7 +65,7 @@
   Mesh mesh;
   SubMesh submesh;
   _buildMesh(&mesh, &submesh);
-  FieldSubMesh field(submesh);
+  Field<SubMesh> field(submesh);
 } // testConstructor
 
 // ----------------------------------------------------------------------
@@ -73,10 +76,9 @@
   Mesh mesh;
   SubMesh submesh;
   _buildMesh(&mesh, &submesh);
-  FieldSubMesh field(submesh);
+  Field<SubMesh> field(submesh);
 
-  mesh.createSieveMesh();
-  const ALE::Obj<SieveMesh::real_section_type>& section = field.section();
+  const ALE::Obj<SubMesh::RealSection>& section = field.section();
   CPPUNIT_ASSERT(section.isNull());
 } // testSection
 
@@ -88,7 +90,7 @@
   Mesh mesh;
   SubMesh submesh;
   _buildMesh(&mesh, &submesh);
-  FieldSubMesh field(submesh);
+  Field<SubMesh> field(submesh);
 
   const SubMesh& mesh2 = field.mesh();
   CPPUNIT_ASSERT_EQUAL(_TestFieldSubMesh::cellDim-1, mesh2.dimension());  
@@ -102,7 +104,7 @@
   Mesh mesh;
   SubMesh submesh;
   _buildMesh(&mesh, &submesh);
-  FieldSubMesh field(submesh);
+  Field<SubMesh> field(submesh);
 
   CPPUNIT_ASSERT_EQUAL(_TestFieldSubMesh::cellDim, field.spaceDim());
 } // testSpaceDim
@@ -115,10 +117,10 @@
   Mesh mesh;
   SubMesh submesh;
   _buildMesh(&mesh, &submesh);
-  FieldSubMesh field(submesh);
+  Field<SubMesh> field(submesh);
 
   field.newSection();
-  const ALE::Obj<SieveMesh::real_section_type>& section = field.section();
+  const ALE::Obj<SubMesh::RealSection>& section = field.section();
   CPPUNIT_ASSERT(!section.isNull());
 } // testNewSection
 
@@ -132,13 +134,13 @@
   Mesh mesh;
   SubMesh submesh;
   _buildMesh(&mesh, &submesh);
-  const ALE::Obj<SieveMesh>& sieveMesh = submesh.sieveMesh();
+  const ALE::Obj<SubMesh::SieveMesh>& sieveMesh = submesh.sieveMesh();
 
-  FieldSubMesh field(submesh);
+  Field<SubMesh> field(submesh);
   const ALE::Obj<SieveMesh::label_sequence>& vertices = 
     sieveMesh->depthStratum(0);
   field.newSection(vertices, fiberDim);
-  const ALE::Obj<SieveMesh::real_section_type>& section = field.section();
+  const ALE::Obj<SubMesh::RealSection>& section = field.section();
   CPPUNIT_ASSERT(!section.isNull());
 
   CPPUNIT_ASSERT(!vertices.isNull());
@@ -160,10 +162,10 @@
   _buildMesh(&mesh, &submesh);
   const ALE::Obj<SieveMesh>& sieveMesh = submesh.sieveMesh();
 
-  FieldSubMesh field(submesh);
-  field.newSection(FieldSubMesh::VERTICES_FIELD, fiberDim);
+  Field<SubMesh> field(submesh);
+  field.newSection(Field<SubMesh>::VERTICES_FIELD, fiberDim);
 
-  const ALE::Obj<SieveMesh::real_section_type>& section = field.section();
+  const ALE::Obj<SubMesh::RealSection>& section = field.section();
   CPPUNIT_ASSERT(!section.isNull());
   const ALE::Obj<SieveMesh::label_sequence>& vertices = 
     sieveMesh->depthStratum(0);
@@ -194,15 +196,15 @@
   const ALE::Obj<SieveMesh>& sieveMesh = submesh.sieveMesh();
 
   // Create field with atlas to use to create new field
-  FieldSubMesh fieldSrc(submesh);
-  fieldSrc.newSection(FieldSubMesh::VERTICES_FIELD, fiberDim);
-  const ALE::Obj<MeshRealSection>& sectionSrc = fieldSrc.section();
+  Field<SubMesh> fieldSrc(submesh);
+  fieldSrc.newSection(Field<SubMesh>::VERTICES_FIELD, fiberDim);
+  const ALE::Obj<SubMesh::RealSection>& sectionSrc = fieldSrc.section();
   CPPUNIT_ASSERT(!sectionSrc.isNull());
-  const MeshRealSection::chart_type& chart = sectionSrc->getChart();
+  const SubMesh::RealSection::chart_type& chart = sectionSrc->getChart();
 
-  FieldSubMesh field(submesh);
+  Field<SubMesh> field(submesh);
   field.newSection(chart, fiberDim);
-  const ALE::Obj<MeshRealSection>& section = field.section();
+  const ALE::Obj<SubMesh::RealSection>& section = field.section();
   const ALE::Obj<SieveMesh::label_sequence>& vertices = 
     sieveMesh->depthStratum(0);
   CPPUNIT_ASSERT(!vertices.isNull());
@@ -236,10 +238,10 @@
   CPPUNIT_ASSERT(!vertices.isNull());
 
   // Create field with atlas to use to create new field
-  FieldSubMesh fieldSrc(submesh);
+  Field<SubMesh> fieldSrc(submesh);
   { // Setup source field
-    fieldSrc.newSection(FieldSubMesh::VERTICES_FIELD, fiberDim);
-    const ALE::Obj<MeshRealSection>& section = fieldSrc.section();
+    fieldSrc.newSection(Field<SubMesh>::VERTICES_FIELD, fiberDim);
+    const ALE::Obj<SubMesh::RealSection>& section = fieldSrc.section();
     int iV=0;
 
     CPPUNIT_ASSERT(!vertices.isNull());
@@ -251,9 +253,9 @@
   } // Setup source field
 
 
-  FieldSubMesh field(submesh);
+  Field<SubMesh> field(submesh);
   field.newSection(fieldSrc);
-  const ALE::Obj<MeshRealSection>& section = field.section();
+  const ALE::Obj<SubMesh::RealSection>& section = field.section();
   int iV = 0;
   for (SieveMesh::label_sequence::iterator v_iter=vertices->begin();
        v_iter != vertices->end();
@@ -272,16 +274,16 @@
   Mesh mesh;
   SubMesh submesh;
   _buildMesh(&mesh, &submesh);
-  FieldSubMesh field(submesh);
+  Field<SubMesh> field(submesh);
 
   field.scale(2.0);
-  field.vectorFieldType(FieldSubMesh::TENSOR);
+  field.vectorFieldType(Field<SubMesh>::TENSOR);
   field.addDimensionOkay(true);
   
   field.clear();
 
   CPPUNIT_ASSERT_EQUAL(1.0, field._scale);
-  CPPUNIT_ASSERT_EQUAL(FieldSubMesh::OTHER, field._vecFieldType);
+  CPPUNIT_ASSERT_EQUAL(Field<SubMesh>::OTHER, field._vecFieldType);
   CPPUNIT_ASSERT_EQUAL(false, field._dimensionsOkay);
 } // testClear
 
@@ -305,10 +307,10 @@
   const ALE::Obj<SieveMesh::label_sequence>& vertices = 
     sieveMesh->depthStratum(0);
 
-  FieldSubMesh field(submesh);
-  field.newSection(FieldSubMesh::VERTICES_FIELD, fiberDim);
+  Field<SubMesh> field(submesh);
+  field.newSection(Field<SubMesh>::VERTICES_FIELD, fiberDim);
   field.allocate();
-  const ALE::Obj<MeshRealSection>& section = field.section();
+  const ALE::Obj<SubMesh::RealSection>& section = field.section();
 
   double_array values(fiberDim);
   int i = 0;
@@ -352,10 +354,10 @@
   const ALE::Obj<SieveMesh::label_sequence>& vertices = 
     sieveMesh->depthStratum(0);
 
-  FieldSubMesh field(submesh);
-  field.newSection(FieldSubMesh::VERTICES_FIELD, fiberDim);
+  Field<SubMesh> field(submesh);
+  field.newSection(Field<SubMesh>::VERTICES_FIELD, fiberDim);
   field.allocate();
-  const ALE::Obj<MeshRealSection>& section = field.section();
+  const ALE::Obj<SubMesh::RealSection>& section = field.section();
 
   double_array values(fiberDim);
   int i = 0;
@@ -400,10 +402,10 @@
   const ALE::Obj<SieveMesh::label_sequence>& vertices = 
     sieveMesh->depthStratum(0);
 
-  FieldSubMesh field(submesh);
-  field.newSection(FieldSubMesh::VERTICES_FIELD, fiberDim);
+  Field<SubMesh> field(submesh);
+  field.newSection(Field<SubMesh>::VERTICES_FIELD, fiberDim);
   field.allocate();
-  const ALE::Obj<MeshRealSection>& section = field.section();
+  const ALE::Obj<SubMesh::RealSection>& section = field.section();
 
   double_array values(fiberDim);
   int i = 0;
@@ -450,11 +452,11 @@
   const ALE::Obj<SieveMesh::label_sequence>& vertices = 
     sieveMesh->depthStratum(0);
 
-  FieldSubMesh fieldSrc(submesh);
+  Field<SubMesh> fieldSrc(submesh);
   { // Setup source field
-    fieldSrc.newSection(FieldSubMesh::VERTICES_FIELD, fiberDim);
+    fieldSrc.newSection(Field<SubMesh>::VERTICES_FIELD, fiberDim);
     fieldSrc.allocate();
-    const ALE::Obj<MeshRealSection>& section = fieldSrc.section();
+    const ALE::Obj<SubMesh::RealSection>& section = fieldSrc.section();
     
     double_array values(fiberDim);
     int i = 0;
@@ -467,10 +469,10 @@
     } // for
   } // Setup source field
 
-  FieldSubMesh field(submesh);
-  field.newSection(FieldSubMesh::VERTICES_FIELD, fiberDim);
+  Field<SubMesh> field(submesh);
+  field.newSection(Field<SubMesh>::VERTICES_FIELD, fiberDim);
   field.allocate();
-  const ALE::Obj<MeshRealSection>& section = field.section();
+  const ALE::Obj<SubMesh::RealSection>& section = field.section();
 
   field.copy(fieldSrc);
 
@@ -512,11 +514,11 @@
   const ALE::Obj<SieveMesh::label_sequence>& vertices = 
     sieveMesh->depthStratum(0);
 
-  FieldSubMesh fieldSrc(submesh);
+  Field<SubMesh> fieldSrc(submesh);
   { // Setup source field
-    fieldSrc.newSection(FieldSubMesh::VERTICES_FIELD, fiberDim);
+    fieldSrc.newSection(Field<SubMesh>::VERTICES_FIELD, fiberDim);
     fieldSrc.allocate();
-    const ALE::Obj<MeshRealSection>& section = fieldSrc.section();
+    const ALE::Obj<SubMesh::RealSection>& section = fieldSrc.section();
     
     double_array values(fiberDim);
     int i = 0;
@@ -529,10 +531,10 @@
     } // for
   } // Setup source field
 
-  FieldSubMesh field(submesh);
-  field.newSection(FieldSubMesh::VERTICES_FIELD, fiberDim);
+  Field<SubMesh> field(submesh);
+  field.newSection(Field<SubMesh>::VERTICES_FIELD, fiberDim);
   field.allocate();
-  const ALE::Obj<MeshRealSection>& section = field.section();
+  const ALE::Obj<SubMesh::RealSection>& section = field.section();
   { // Setup destination field
 
     double_array values(fiberDim);
@@ -581,10 +583,10 @@
   _buildMesh(&mesh, &submesh);
   const ALE::Obj<SieveMesh>& sieveMesh = submesh.sieveMesh();
 
-  FieldSubMesh field(submesh);
-  field.newSection(FieldSubMesh::VERTICES_FIELD, fiberDim);
+  Field<SubMesh> field(submesh);
+  field.newSection(Field<SubMesh>::VERTICES_FIELD, fiberDim);
   field.allocate();
-  const ALE::Obj<MeshRealSection>& section = field.section();
+  const ALE::Obj<SubMesh::RealSection>& section = field.section();
   const ALE::Obj<SieveMesh::label_sequence>& vertices = 
     sieveMesh->depthStratum(0);
 
@@ -633,10 +635,10 @@
   SubMesh submesh;
   _buildMesh(&mesh, &submesh);
   const ALE::Obj<SieveMesh>& sieveMesh = submesh.sieveMesh();
-  FieldSubMesh field(submesh);
-  field.newSection(FieldSubMesh::VERTICES_FIELD, fiberDim);
+  Field<SubMesh> field(submesh);
+  field.newSection(Field<SubMesh>::VERTICES_FIELD, fiberDim);
   field.allocate();
-  const ALE::Obj<MeshRealSection>& section = field.section();
+  const ALE::Obj<SubMesh::RealSection>& section = field.section();
   const ALE::Obj<SieveMesh::label_sequence>& vertices = 
     sieveMesh->depthStratum(0);
 
@@ -662,10 +664,10 @@
   assert(0 != submesh);
 
   mesh->createSieveMesh(_TestFieldSubMesh::cellDim);
-  const ALE::Obj<SieveMesh>& sieveMesh = mesh->sieveMesh();
+  const ALE::Obj<Mesh::SieveMesh>& sieveMesh = mesh->sieveMesh();
 
-  ALE::Obj<SieveMesh::sieve_type> sieve = 
-    new SieveMesh::sieve_type(sieveMesh->comm());
+  ALE::Obj<Mesh::SieveMesh::sieve_type> sieve = 
+    new Mesh::SieveMesh::sieve_type(sieveMesh->comm());
   CPPUNIT_ASSERT(!sieve.isNull());
 
   ALE::Obj<ALE::Mesh::sieve_type> s = 
@@ -682,14 +684,14 @@
   ALE::SieveBuilder<ALE::Mesh>::buildTopology(s, cellDim, ncells, (int*) cells,
 					      nvertices, interpolate, 
 					      ncorners);
-  std::map<SieveMesh::point_type,SieveMesh::point_type> renumbering;
+  std::map<Mesh::SieveMesh::point_type,Mesh::SieveMesh::point_type> renumbering;
   ALE::ISieveConverter::convertSieve(*s, *sieve, renumbering);
   sieveMesh->setSieve(sieve);
   sieveMesh->stratify();
   ALE::SieveBuilder<SieveMesh>::buildCoordinates(sieveMesh, spaceDim, 
 						 coordinates);
 
-  typedef SieveMesh::int_section_type::chart_type chart_type;
+  typedef Mesh::SieveMesh::int_section_type::chart_type chart_type;
   const ALE::Obj<SieveMesh::int_section_type>& groupField = 
     sieveMesh->getIntSection(_TestFieldSubMesh::label);
   assert(!groupField.isNull());

Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/topology/TestFieldSubMesh.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/topology/TestFieldSubMesh.hh	2009-02-14 00:55:30 UTC (rev 14051)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/topology/TestFieldSubMesh.hh	2009-02-14 23:42:29 UTC (rev 14052)
@@ -22,14 +22,13 @@
 // Include directives ---------------------------------------------------
 #include <cppunit/extensions/HelperMacros.h>
 
+#include "pylith/topology/topologyfwd.hh" // forward declarations
+
 // Forward declarations -------------------------------------------------
 /// Namespace for pylith package
 namespace pylith {
   namespace topology {
     class TestFieldSubMesh;
-
-    class Mesh;
-    class SubMesh;
   } // topology
 } // pylith
 



More information about the CIG-COMMITS mailing list