[cig-commits] r14309 - in short/3D/PyLith/branches/pylith-swig: modulesrc/bc pylith/bc pylith/feassemble unittests/libtests/bc unittests/libtests/materials unittests/pytests/bc

brad at geodynamics.org brad at geodynamics.org
Thu Mar 12 13:48:26 PDT 2009


Author: brad
Date: 2009-03-12 13:48:25 -0700 (Thu, 12 Mar 2009)
New Revision: 14309

Modified:
   short/3D/PyLith/branches/pylith-swig/modulesrc/bc/AbsorbingDampers.i
   short/3D/PyLith/branches/pylith-swig/modulesrc/bc/Makefile.am
   short/3D/PyLith/branches/pylith-swig/modulesrc/bc/bc.i
   short/3D/PyLith/branches/pylith-swig/pylith/bc/AbsorbingDampers.py
   short/3D/PyLith/branches/pylith-swig/pylith/feassemble/Integrator.py
   short/3D/PyLith/branches/pylith-swig/pylith/feassemble/IntegratorElasticity.py
   short/3D/PyLith/branches/pylith-swig/unittests/libtests/bc/TestAbsorbingDampers.cc
   short/3D/PyLith/branches/pylith-swig/unittests/libtests/bc/TestNeumann.cc
   short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestElasticMaterial.cc
   short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestMaterial.cc
   short/3D/PyLith/branches/pylith-swig/unittests/pytests/bc/TestDirichletBC.py
Log:
Propagated some interface changes.

Modified: short/3D/PyLith/branches/pylith-swig/modulesrc/bc/AbsorbingDampers.i
===================================================================
--- short/3D/PyLith/branches/pylith-swig/modulesrc/bc/AbsorbingDampers.i	2009-03-12 19:40:31 UTC (rev 14308)
+++ short/3D/PyLith/branches/pylith-swig/modulesrc/bc/AbsorbingDampers.i	2009-03-12 20:48:25 UTC (rev 14309)
@@ -15,6 +15,8 @@
  * @brief Python interface to C++ AbsorbingDampers object.
  */
 
+%template(SubMeshIntegrator) pylith::feassemble::Integrator<pylith::feassemble::Quadrature<pylith::topology::SubMesh> >;
+
 namespace pylith {
   namespace bc {
 

Modified: short/3D/PyLith/branches/pylith-swig/modulesrc/bc/Makefile.am
===================================================================
--- short/3D/PyLith/branches/pylith-swig/modulesrc/bc/Makefile.am	2009-03-12 19:40:31 UTC (rev 14308)
+++ short/3D/PyLith/branches/pylith-swig/modulesrc/bc/Makefile.am	2009-03-12 20:48:25 UTC (rev 14309)
@@ -22,7 +22,10 @@
 	BoundaryCondition.i \
 	DirichletBC.i \
 	DirichletBoundary.i \
-	../feassemble/Constraint.i
+	AbsorbingDampers.i \
+	../feassemble/Constraint.i \
+	../feassemble/Quadrature.i \
+	../feassemble/Integrator.i
 
 swig_generated = \
 	bc_wrap.cxx \

Modified: short/3D/PyLith/branches/pylith-swig/modulesrc/bc/bc.i
===================================================================
--- short/3D/PyLith/branches/pylith-swig/modulesrc/bc/bc.i	2009-03-12 19:40:31 UTC (rev 14308)
+++ short/3D/PyLith/branches/pylith-swig/modulesrc/bc/bc.i	2009-03-12 20:48:25 UTC (rev 14309)
@@ -18,8 +18,7 @@
 #include "pylith/bc/BoundaryCondition.hh"
 #include "pylith/bc/DirichletBC.hh"
 #include "pylith/bc/DirichletBoundary.hh"
-
-#include "pylith/utils/arrayfwd.hh"
+#include "pylith/bc/AbsorbingDampers.hh"
 %}
 
 %include "exception.i"

Modified: short/3D/PyLith/branches/pylith-swig/pylith/bc/AbsorbingDampers.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/pylith/bc/AbsorbingDampers.py	2009-03-12 19:40:31 UTC (rev 14308)
+++ short/3D/PyLith/branches/pylith-swig/pylith/bc/AbsorbingDampers.py	2009-03-12 20:48:25 UTC (rev 14309)
@@ -61,6 +61,7 @@
     """
     BoundaryCondition.__init__(self, name)
     Integrator.__init__(self)
+    ModuleAbssorbingDampers.__init__(self)
     self._loggingPrefix = "AbBC "
     return
 
@@ -71,7 +72,8 @@
     """
     BoundaryCondition.preinitialize(self, mesh)
     Integrator.preinitialize(self, mesh)
-    self.quadrature.preinitialize()
+    self.bcQuadrature.preinitialize(mesh.coordsys().spaceDim())
+    self.quadrature(self.bcQuadrature)
     return
 
 
@@ -84,12 +86,12 @@
 
     BoundaryCondition.verifyConfiguration(self)
     Integrator.verifyConfiguration(self)
-    if self.quadrature.cellDim != self.mesh.dimension()-1:
+    if self.bcQuadrature.cellDim() != self.mesh.dimension()-1:
         raise ValueError, \
               "Quadrature scheme and mesh are incompatible.\n" \
               "Dimension for quadrature: %d\n" \
               "Dimension of mesh boundary '%s': %d" % \
-              (self.quadrature.cellDim,
+              (self.bcQuadrature.cellDim,
                self.label, self.mesh.dimension()-1)    
 
     self._logger.eventEnd(logEvent)
@@ -103,7 +105,6 @@
     logEvent = "%sinit" % self._loggingPrefix
     self._logger.eventBegin(logEvent)
 
-    ModuleAbsorbingDampers.quadrature(self.quadrature)
     Integrator.initialize(self, totalTime, numTimeSteps, normalizer)    
     BoundaryCondition.initialize(self, totalTime, numTimeSteps, normalizer)
 
@@ -118,19 +119,10 @@
     Setup members using inventory.
     """
     BoundaryCondition._configure(self)
-    self.quadrature = self.inventory.quadrature
+    self.bcQuadrature = self.inventory.quadrature
     return
 
 
-  def _createModuleObj(self):
-    """
-    Create handle to corresponding C++ object.
-    """
-    if None == self.cppHandle:
-      ModuleAbsorbingDampers.__init__(self)
-    return
-  
-
 # FACTORIES ////////////////////////////////////////////////////////////
 
 def boundary_condition():

Modified: short/3D/PyLith/branches/pylith-swig/pylith/feassemble/Integrator.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/pylith/feassemble/Integrator.py	2009-03-12 19:40:31 UTC (rev 14308)
+++ short/3D/PyLith/branches/pylith-swig/pylith/feassemble/Integrator.py	2009-03-12 20:48:25 UTC (rev 14309)
@@ -57,8 +57,8 @@
     """
     Constructor.
     """
+    self.mesh = None
     self.gravityField = None
-    self.mesh = None
     return
 
 

Modified: short/3D/PyLith/branches/pylith-swig/pylith/feassemble/IntegratorElasticity.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/pylith/feassemble/IntegratorElasticity.py	2009-03-12 19:40:31 UTC (rev 14308)
+++ short/3D/PyLith/branches/pylith-swig/pylith/feassemble/IntegratorElasticity.py	2009-03-12 20:48:25 UTC (rev 14309)
@@ -46,9 +46,11 @@
     self.mesh = mesh
     self.output = material.output
     self.availableFields = material.availableFields
-    self.quadrature(material.quadrature)
+    self.matQuadrature = material.quadrature
     self.material(material)
 
+    ModuleElasticity
+
     Integrator.preinitialize(self, mesh)
     material.preinitialize()
     self.output.preinitialize(self)
@@ -82,7 +84,7 @@
 
     Integrator.initialize(self, totalTime, numTimeSteps, normalizer)
 
-    self.output.initialize(normalizer, self.quadrature)
+    self.output.initialize(normalizer, self.matQuadrature)
     self.output.writeInfo()
     self.output.open(totalTime, numTimeSteps)
 

Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/bc/TestAbsorbingDampers.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/bc/TestAbsorbingDampers.cc	2009-03-12 19:40:31 UTC (rev 14308)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/bc/TestAbsorbingDampers.cc	2009-03-12 20:48:25 UTC (rev 14309)
@@ -291,9 +291,12 @@
     mesh->coordsys(&cs);
 
     // Set up quadrature
-    _quadrature->initialize(_data->basis, _data->basisDerivRef, _data->quadPts,
-			    _data->quadWts, _data->cellDim, _data->numBasis,
-			    _data->numQuadPts, _data->spaceDim);
+    _quadrature->initialize(_data->basis, _data->numQuadPts, _data->numBasis,
+			    _data->basisDerivRef, _data->numQuadPts, 
+			    _data->numBasis, _data->cellDim,
+			    _data->quadPts, _data->numQuadPts, _data->cellDim,
+			    _data->quadWts, _data->numQuadPts,
+			    _data->spaceDim);
 
     // Set up database
     spatialdata::spatialdb::SimpleDB db("TestAbsorbingDampers");

Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/bc/TestNeumann.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/bc/TestNeumann.cc	2009-03-12 19:40:31 UTC (rev 14308)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/bc/TestNeumann.cc	2009-03-12 20:48:25 UTC (rev 14309)
@@ -229,9 +229,12 @@
     mesh->coordsys(&cs);
 
     // Set up quadrature
-    _quadrature->initialize(_data->basis, _data->basisDerivRef, _data->quadPts,
-			    _data->quadWts, _data->cellDim, _data->numBasis,
-			    _data->numQuadPts, _data->spaceDim);
+    _quadrature->initialize(_data->basis, _data->numQuadPts, _data->numBasis,
+			    _data->basisDerivRef, _data->numQuadPts, 
+			    _data->numBasis, _data->cellDim,
+			    _data->quadPts, _data->numQuadPts, _data->cellDim,
+			    _data->quadWts, _data->numQuadPts,
+			    _data->spaceDim);
 
     // Set up database
     spatialdata::spatialdb::SimpleDB db("TestNeumann");

Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestElasticMaterial.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestElasticMaterial.cc	2009-03-12 19:40:31 UTC (rev 14308)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestElasticMaterial.cc	2009-03-12 20:48:25 UTC (rev 14309)
@@ -699,8 +699,11 @@
   };
   const double quadPtsRef[] = { -0.577350269, 0.577350269 };
   const double quadWts[] = { 1.0, 1.0  };
-  quadrature.initialize(basis, basisDeriv, quadPtsRef, quadWts,
-			cellDim, numCorners, numQuadPts, spaceDim);
+  quadrature.initialize(basis, numQuadPts, numCorners,
+			basisDeriv, numQuadPts, numCorners, cellDim,
+			quadPtsRef, numQuadPts, cellDim,
+			quadWts, numQuadPts,
+			spaceDim);
 
 
   // Get cells associated with material

Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestMaterial.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestMaterial.cc	2009-03-12 19:40:31 UTC (rev 14308)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestMaterial.cc	2009-03-12 20:48:25 UTC (rev 14309)
@@ -178,8 +178,11 @@
   };
   const double quadPtsRef[] = { -0.577350269, 0.577350269 };
   const double quadWts[] = { 1.0, 1.0  };
-  quadrature.initialize(basis, basisDeriv, quadPtsRef, quadWts,
-			cellDim, numCorners, numQuadPts, spaceDim);
+  quadrature.initialize(basis, numQuadPts, numCorners,
+			basisDeriv, numQuadPts, numCorners, cellDim,
+			quadPtsRef, numQuadPts, cellDim,
+			quadWts, numQuadPts,
+			spaceDim);
 
 
   // Get cells associated with material

Modified: short/3D/PyLith/branches/pylith-swig/unittests/pytests/bc/TestDirichletBC.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/pytests/bc/TestDirichletBC.py	2009-03-12 19:40:31 UTC (rev 14308)
+++ short/3D/PyLith/branches/pylith-swig/unittests/pytests/bc/TestDirichletBC.py	2009-03-12 20:48:25 UTC (rev 14309)
@@ -175,9 +175,9 @@
     bc.initialize(totalTime=0.0, numTimeSteps=1, normalizer=normalizer)
 
     # Setup field
-    from pylith.topology.Field import Field
-    field = Field(mesh)
-    field.newSection(Field.VERTICES_FIELD, cs.spaceDim())
+    from pylith.topology.Field import MeshField
+    field = MeshField(mesh)
+    field.newSection(field.VERTICES_FIELD, cs.spaceDim())
     field.allocate()
 
     field.zero()



More information about the CIG-COMMITS mailing list