[cig-commits] r6478 - in short/3D/PyLith/trunk: libsrc/feassemble libsrc/topology modulesrc/materials playpen/cohesive/src unittests/libtests/feassemble unittests/pytests/feassemble

knepley at geodynamics.org knepley at geodynamics.org
Fri Mar 30 17:39:07 PDT 2007


Author: knepley
Date: 2007-03-30 17:39:07 -0700 (Fri, 30 Mar 2007)
New Revision: 6478

Modified:
   short/3D/PyLith/trunk/libsrc/feassemble/Integrator.hh
   short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1Din3D.cc
   short/3D/PyLith/trunk/libsrc/topology/Mesh.hh
   short/3D/PyLith/trunk/modulesrc/materials/materials.pyxe.src
   short/3D/PyLith/trunk/playpen/cohesive/src/testcohesive.cc
   short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegrator.cc
   short/3D/PyLith/trunk/unittests/pytests/feassemble/TestQuadrature.cc
Log:
More fixes


Modified: short/3D/PyLith/trunk/libsrc/feassemble/Integrator.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Integrator.hh	2007-03-30 23:59:11 UTC (rev 6477)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Integrator.hh	2007-03-31 00:39:07 UTC (rev 6478)
@@ -44,7 +44,7 @@
 public :
 
   typedef ALE::Field::Mesh        Mesh;
-  typedef ALE::Mesh::point_type   point_type;
+  typedef Mesh::point_type        point_type;
   typedef Mesh::real_section_type real_section_type;
 
 // PUBLIC MEMBERS ///////////////////////////////////////////////////////

Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1Din3D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1Din3D.cc	2007-03-30 23:59:11 UTC (rev 6477)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1Din3D.cc	2007-03-31 00:39:07 UTC (rev 6478)
@@ -55,7 +55,7 @@
   _resetGeometry();
 
   // Get coordinates of cell's vertices
-  const ALE::Mesh::real_section_type::value_type* vertCoords = 
+  const real_section_type::value_type* vertCoords = 
     mesh->restrict(coordinates, cell);
   //assert(3 == coordinates.GetFiberDimensionByDepth(patch,
   //*vertices->begin(), 0));

Modified: short/3D/PyLith/trunk/libsrc/topology/Mesh.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/topology/Mesh.hh	2007-03-30 23:59:11 UTC (rev 6477)
+++ short/3D/PyLith/trunk/libsrc/topology/Mesh.hh	2007-03-31 00:39:07 UTC (rev 6478)
@@ -32,9 +32,8 @@
 public :
 
   typedef ALE::Obj Obj;
-  typedef ALE::Mesh Mesh;
-  typedef Mesh::topology_type topology_type;
-  typedef topology_type::point_type point_type;
+  typedef ALE::Field::Mesh Mesh;
+  typedef Mesh::point_type point_type;
   typedef Mesh::real_section_type real_section_type;
 
 }; // Mesh

Modified: short/3D/PyLith/trunk/modulesrc/materials/materials.pyxe.src
===================================================================
--- short/3D/PyLith/trunk/modulesrc/materials/materials.pyxe.src	2007-03-30 23:59:11 UTC (rev 6477)
+++ short/3D/PyLith/trunk/modulesrc/materials/materials.pyxe.src	2007-03-31 00:39:07 UTC (rev 6478)
@@ -80,7 +80,7 @@
       assert(0 != meshObj);
       assert(0 != csObj);
       assert(0 != qObj);
-      ALE::Obj<ALE::Mesh>* mesh = (ALE::Obj<ALE::Mesh>*) meshObj;
+      ALE::Obj<ALE::Field::Mesh>* mesh = (ALE::Obj<ALE::Field::Mesh>*) meshObj;
       spatialdata::geocoords::CoordSys* cs =
         (spatialdata::geocoords::CoordSys*) csObj;
       pylith::feassemble::Quadrature* quadrature =

Modified: short/3D/PyLith/trunk/playpen/cohesive/src/testcohesive.cc
===================================================================
--- short/3D/PyLith/trunk/playpen/cohesive/src/testcohesive.cc	2007-03-30 23:59:11 UTC (rev 6477)
+++ short/3D/PyLith/trunk/playpen/cohesive/src/testcohesive.cc	2007-03-31 00:39:07 UTC (rev 6478)
@@ -18,19 +18,19 @@
   } // if
 
   try {
-    ALE::Obj<ALE::Mesh> mesh;
+    typedef ALE::Field::Mesh Mesh;
+    ALE::Obj<Mesh> mesh;
 
     pylith::meshio::MeshIOAscii iohandler;
     iohandler.filename(argv[1]);
     iohandler.read(&mesh);
 
-    const ALE::Mesh::topology_type::patch_type patch = 0;
-    const ALE::Obj<ALE::Mesh::real_section_type>& coords = mesh->getRealSection("coordinates");
+    const ALE::Obj<Mesh::real_section_type>& coords = mesh->getRealSection("coordinates");
 
     mesh->view("Original Mesh");
     // For the tractest mesh, we will split a face on the midplane
     // Elem 2: 17-22-19-(18) Elem 23: 22-19-(25)-17
-    std::set<ALE::Mesh::point_type> faultVertices;
+    std::set<Mesh::point_type> faultVertices;
 
     faultVertices.insert(17+41-1);
     faultVertices.insert(19+41-1);
@@ -43,7 +43,7 @@
     std::cout <<"["<<rank<<"]: " << e << std::endl;
   }
   err = PetscFinalize(); CHKERRQ(err);
-  
+
   return err;
 } // main
 

Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegrator.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegrator.cc	2007-03-30 23:59:11 UTC (rev 6477)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegrator.cc	2007-03-31 00:39:07 UTC (rev 6478)
@@ -76,7 +76,7 @@
    * @param data Integrator data
    */
   static 
-  ALE::Obj<ALE::Mesh>
+  ALE::Obj<ALE::Field::Mesh>
   _setupMesh(const IntegratorData& data);
 }; // _TestIntegrator
 
@@ -89,11 +89,10 @@
 { // _testIntegrateAction
   CPPUNIT_ASSERT(false);
 
-  typedef ALE::Mesh::real_section_type real_section_type;
-  typedef ALE::Mesh::topology_type topology_type;
+  typedef ALE::Field::Mesh        Mesh;
+  typedef Mesh::real_section_type real_section_type;
 
-  ALE::Obj<ALE::Mesh> mesh = _TestIntegrator::_setupMesh(data);
-  const ALE::Mesh::int_section_type::patch_type patch = 0;
+  ALE::Obj<Mesh> mesh = _TestIntegrator::_setupMesh(data);
 
   // Fiber dimension (number of values in field per vertex) for fields
   const int fiberDim = data.fiberDim;
@@ -102,24 +101,22 @@
   const ALE::Obj<real_section_type>& fieldIn =
     mesh->getRealSection("fieldIn");
   fieldIn->setName("fieldIn");
-  fieldIn->setFiberDimensionByDepth(patch, 0, fiberDim);
-  fieldIn->allocate();
+  fieldIn->setFiberDimension(mesh->depthStratum(0), fiberDim);
+  mesh->allocate(fieldIn);
   int iVertex = 0;
-  const ALE::Obj<topology_type::label_sequence>& vertices = 
-    mesh->getTopology()->depthStratum(patch, 0);
-  const topology_type::label_sequence::iterator verticesEnd =
-    vertices->end();
-  for (topology_type::label_sequence::iterator vIter=vertices->begin();
+  const ALE::Obj<Mesh::label_sequence>& vertices = mesh->depthStratum(0);
+  const Mesh::label_sequence::iterator verticesEnd = vertices->end();
+  for (Mesh::label_sequence::iterator vIter=vertices->begin();
        vIter != verticesEnd;
        ++vIter, ++iVertex)
-    fieldIn->update(patch, *vIter, &data.fieldIn[iVertex*fiberDim]);
+    fieldIn->updatePoint(*vIter, &data.fieldIn[iVertex*fiberDim]);
 
   // Setup field for action result
   const ALE::Obj<real_section_type>& fieldOut =
     mesh->getRealSection("fieldOut");
   fieldOut->setName("fieldOut");
-  fieldOut->setFiberDimensionByDepth(patch, 0, fiberDim);
-  fieldOut->allocate();
+  fieldOut->setFiberDimension(mesh->depthStratum(0), fiberDim);
+  mesh->allocate(fieldOut);
 
   // Integrate action
   const ALE::Obj<real_section_type>& coordinates = 
@@ -130,13 +127,13 @@
   // Check values in output field
   iVertex = 0;
   const double tolerance = 1.0e-06;
-  for (topology_type::label_sequence::iterator vIter=vertices->begin();
+  for (Mesh::label_sequence::iterator vIter=vertices->begin();
        vIter != verticesEnd;
        ++vIter, ++iVertex) {
     const real_section_type::value_type* vals = 
-      fieldOut->restrict(patch, *vIter);
+      fieldOut->restrictPoint(*vIter);
     const double* valsE = &data.valsAction[iVertex*fiberDim];
-    const int dim = fieldOut->getFiberDimension(patch, *vIter);
+    const int dim = fieldOut->getFiberDimension(*vIter);
     CPPUNIT_ASSERT_EQUAL(fiberDim, dim);
     for (int iDim=0; iDim < fiberDim; ++iDim)
       CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, vals[iDim]/valsE[iDim], tolerance);
@@ -151,14 +148,13 @@
 { // _testIntegrate
   CPPUNIT_ASSERT(false);
 
-  typedef ALE::Mesh::real_section_type real_section_type;
-  typedef ALE::Mesh::topology_type topology_type;
+  typedef ALE::Field::Mesh        Mesh;
+  typedef Mesh::real_section_type real_section_type;
 
   journal::debug_t debug("TestIntegrator");
 
   try {
-    ALE::Obj<ALE::Mesh> mesh = _TestIntegrator::_setupMesh(data);
-    const ALE::Mesh::int_section_type::patch_type patch = 0;
+    ALE::Obj<Mesh> mesh = _TestIntegrator::_setupMesh(data);
 
     // Fiber dimension (number of values in field per vertex) for fields
     const int fiberDim = data.fiberDim;
@@ -167,17 +163,15 @@
     const ALE::Obj<real_section_type>& fieldIn =
       mesh->getRealSection("fieldIn");
     fieldIn->setName("fieldIn");
-    fieldIn->setFiberDimensionByDepth(patch, 0, fiberDim);
-    fieldIn->allocate();
+    fieldIn->setFiberDimension(mesh->depthStratum(0), fiberDim);
+    mesh->allocate(fieldIn);
     int iVertex = 0;
-    const ALE::Obj<topology_type::label_sequence>& vertices = 
-      mesh->getTopology()->depthStratum(patch, 0);
-    const topology_type::label_sequence::iterator verticesEnd =
-      vertices->end();
+    const ALE::Obj<Mesh::label_sequence>& vertices = mesh->depthStratum(0);
+    const Mesh::label_sequence::iterator verticesEnd = vertices->end();
     for (topology_type::label_sequence::iterator vIter=vertices->begin();
 	 vIter != verticesEnd;
 	 ++vIter, ++iVertex)
-      fieldIn->update(patch, *vIter, &data.fieldIn[iVertex*fiberDim]);
+      fieldIn->updatePoint(*vIter, &data.fieldIn[iVertex*fiberDim]);
     
     // Integrate
     PetscMat mat;
@@ -261,8 +255,8 @@
 ALE::Obj<ALE::Mesh>
 pylith::feassemble::_TestIntegrator::_setupMesh(const IntegratorData& data)
 { // _setupMesh
-  typedef ALE::Mesh::topology_type topology_type;
-  typedef topology_type::sieve_type sieve_type;
+  typedef ALE::Field::Mesh Mesh;
+  typedef Meh::sieve_type  sieve_type;
 
   const int cellDim = data.cellDim;
   const int numCorners = data.numCorners;
@@ -274,19 +268,15 @@
   CPPUNIT_ASSERT(0 != vertCoords);
   CPPUNIT_ASSERT(0 != cells);
 
-  ALE::Obj<ALE::Mesh> mesh = new ALE::Mesh(PETSC_COMM_WORLD, cellDim);
+  ALE::Obj<Mesh> mesh = new Mesh(PETSC_COMM_WORLD, cellDim);
   ALE::Obj<sieve_type> sieve = new sieve_type(mesh->comm());
-  ALE::Obj<topology_type> topology = new topology_type(mesh->comm());
 
   const bool interpolate = false;
-  ALE::New::SieveBuilder<sieve_type>::buildTopology(sieve, cellDim, numCells,
+  ALE::New::SieveBuilder<Mesh>::buildTopology(sieve, cellDim, numCells,
 	       const_cast<int*>(cells), numVertices, interpolate, numCorners);
-  sieve->stratify();
-  topology->setPatch(0, sieve);
-  topology->stratify();
-  mesh->setTopology(topology);
-  ALE::New::SieveBuilder<sieve_type>::buildCoordinates(
-		    mesh->getRealSection("coordinates"), spaceDim, vertCoords);
+  mesh->setSieve(sieve);
+  mesh->stratify();
+  ALE::New::SieveBuilder<Mesh>::buildCoordinatesNew(mesh, spaceDim, vertCoords);
 
   return mesh;
 } // _setupMesh

Modified: short/3D/PyLith/trunk/unittests/pytests/feassemble/TestQuadrature.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/feassemble/TestQuadrature.cc	2007-03-30 23:59:11 UTC (rev 6477)
+++ short/3D/PyLith/trunk/unittests/pytests/feassemble/TestQuadrature.cc	2007-03-31 00:39:07 UTC (rev 6478)
@@ -224,28 +224,22 @@
 		    cellDim, numCorners, numQuadPts, spaceDim);
 
   // Create mesh with test cell
-  typedef ALE::Mesh::topology_type topology_type;
-  typedef topology_type::sieve_type sieve_type;
-  ALE::Obj<ALE::Mesh> mesh = new ALE::Mesh(PETSC_COMM_WORLD, cellDim);
+  typedef ALE::Field::Mesh mesh;
+  typedef Mesh::sieve_type sieve_type;
+  ALE::Obj<Mesh> mesh = new Mesh(PETSC_COMM_WORLD, cellDim);
   ALE::Obj<sieve_type> sieve = new sieve_type(mesh->comm());
-  ALE::Obj<topology_type> topology = new topology_type(mesh->comm());
 
   const bool interpolate = false;
-  ALE::New::SieveBuilder<sieve_type>::buildTopology(sieve, cellDim, numCells,
+  ALE::New::SieveBuilder<Mesh>::buildTopology(sieve, cellDim, numCells,
 		     (int*) cells, numVertices, interpolate, numCorners);
-  sieve->stratify();
-  topology->setPatch(0, sieve);
-  topology->stratify();
-  mesh->setTopology(topology);
-  ALE::New::SieveBuilder<sieve_type>::buildCoordinates(
-		    mesh->getRealSection("coordinates"), spaceDim, vertCoords);
+  mesh->setSieve(sieve);
+  mesh->stratify();
+  ALE::New::SieveBuilder<Mesh>::buildCoordinatesNew(mesh, spaceDim, vertCoords);
   
   // Check values from _computeGeometry()
-  const ALE::Mesh::topology_type::patch_type patch = 0;
-  const ALE::Obj<topology_type::label_sequence>& elements = 
-    topology->heightStratum(patch, 0);
-  const topology_type::label_sequence::iterator e_iter = elements->begin(); 
-  const ALE::Obj<ALE::Mesh::real_section_type>& coordinates = 
+  const ALE::Obj<Mesh::label_sequence>& elements = mesh->heightStratum(0);
+  const Mesh::label_sequence::iterator e_iter = elements->begin(); 
+  const ALE::Obj<Mesh::real_section_type>& coordinates = 
     mesh->getRealSection("coordinates");
   pQuad->_computeGeometry(coordinates, *e_iter);
 



More information about the cig-commits mailing list