[cig-commits] r14841 - in short/3D/PyLith/branches/pylith-swig: . libsrc/feassemble libsrc/materials libsrc/meshio libsrc/topology

brad at geodynamics.org brad at geodynamics.org
Fri May 1 16:59:34 PDT 2009


Author: brad
Date: 2009-05-01 16:59:34 -0700 (Fri, 01 May 2009)
New Revision: 14841

Modified:
   short/3D/PyLith/branches/pylith-swig/TODO
   short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/IntegratorElasticity.cc
   short/3D/PyLith/branches/pylith-swig/libsrc/materials/Material.cc
   short/3D/PyLith/branches/pylith-swig/libsrc/meshio/DataWriterVTK.cc
   short/3D/PyLith/branches/pylith-swig/libsrc/topology/SubMesh.cc
Log:
Fixed a memory leak. Trivial cleanup.

Modified: short/3D/PyLith/branches/pylith-swig/TODO
===================================================================
--- short/3D/PyLith/branches/pylith-swig/TODO	2009-05-01 22:48:03 UTC (rev 14840)
+++ short/3D/PyLith/branches/pylith-swig/TODO	2009-05-01 23:59:34 UTC (rev 14841)
@@ -55,8 +55,11 @@
     Distribution debug (dump VTK) needs Nondimensional
 
   libsrc/materials
-    Maxwell materials
+    Generalized Maxwell materials
 
+  libtests/materials
+    Cleanup testUpdateStateVars for Maxwell models
+
   libtests/bc/TestDirichletBoundary::testVertexField()
   libtests/bc/TestDirichletBoundary::testBoundaryMesh()
 

Modified: short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/IntegratorElasticity.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/IntegratorElasticity.cc	2009-05-01 22:48:03 UTC (rev 14840)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/IntegratorElasticity.cc	2009-05-01 23:59:34 UTC (rev 14841)
@@ -293,7 +293,7 @@
 { // cellField
   assert(0 != _material);
 
-  // We assume the material stores the total-strain field if
+  // We assume the material stores the total_strain field if
   // hasStateVars() is TRUE.
 
   if (!_material->hasStateVars() &&

Modified: short/3D/PyLith/branches/pylith-swig/libsrc/materials/Material.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/materials/Material.cc	2009-05-01 22:48:03 UTC (rev 14840)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/materials/Material.cc	2009-05-01 23:59:34 UTC (rev 14841)
@@ -284,8 +284,8 @@
 
     // Allocate buffer for property field.
     const ALE::Obj<RealSection>& fieldSection = field->section();
-    if (fieldSection.isNull() ||
-      totalFiberDim != fieldSection->getFiberDimension(*cells->begin())) {
+    if ((fieldSection.isNull() && cells->size() > 0) ||
+	totalFiberDim != fieldSection->getFiberDimension(*cells->begin())) {
       field->newSection(cells, totalFiberDim);
       field->allocate();
     } // if
@@ -316,7 +316,7 @@
     } // for
   } else { // field is a state variable
     assert(stateVarIndex >= 0);
-
+    
     int varOffset = 0;
     const string_vector& stateVars = _metadata.stateVars();
     assert(stateVarIndex < stateVars.size());

Modified: short/3D/PyLith/branches/pylith-swig/libsrc/meshio/DataWriterVTK.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/meshio/DataWriterVTK.cc	2009-05-01 22:48:03 UTC (rev 14840)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/meshio/DataWriterVTK.cc	2009-05-01 23:59:34 UTC (rev 14841)
@@ -157,14 +157,11 @@
   typedef typename field_type::Mesh::RealSection RealSection;
 
   try {
-    const ALE::Obj<SieveMesh>& sieveMesh = field.mesh().sieveMesh();
-    assert(!sieveMesh.isNull());
-    const ALE::Obj<typename SieveMesh::label_sequence>& vertices = 
-      sieveMesh->depthStratum(0);
-    assert(!vertices.isNull());
     int rank = 0;
     MPI_Comm_rank(field.mesh().comm(), &rank);
 
+    const ALE::Obj<SieveMesh>& sieveMesh = field.mesh().sieveMesh();
+    assert(!sieveMesh.isNull());
     const std::string labelName = 
       (sieveMesh->hasLabel("censored depth")) ? "censored depth" : "depth";
     const ALE::Obj<typename SieveMesh::numbering_type>& numbering =

Modified: short/3D/PyLith/branches/pylith-swig/libsrc/topology/SubMesh.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/topology/SubMesh.cc	2009-05-01 22:48:03 UTC (rev 14840)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/topology/SubMesh.cc	2009-05-01 23:59:34 UTC (rev 14841)
@@ -73,12 +73,29 @@
 			meshSieveMesh->getRealSection("coordinates"));
 
   // Create the parallel overlap
+  const ALE::Obj<SieveMesh::sieve_type>& sieve = _mesh->getSieve();
+  assert(!sieve.isNull());
   ALE::Obj<SieveMesh::send_overlap_type> sendParallelMeshOverlap =
     _mesh->getSendOverlap();
   ALE::Obj<SieveMesh::recv_overlap_type> recvParallelMeshOverlap =
     _mesh->getRecvOverlap();
-  DomainSieveMesh::renumbering_type& renumbering = 
+
+  SieveMesh::renumbering_type& renumbering = _mesh->getRenumbering();
+
+  DomainSieveMesh::renumbering_type& oldRenumbering = 
     meshSieveMesh->getRenumbering();
+  const SieveMesh::renumbering_type::const_iterator oldBegin = 
+    oldRenumbering.begin();
+  const SieveMesh::renumbering_type::const_iterator oldEnd = 
+    oldRenumbering.end();
+  for (SieveMesh::renumbering_type::const_iterator r_iter = oldBegin;
+       r_iter != oldEnd;
+       ++r_iter)
+    if (sieve->getChart().hasPoint(r_iter->second) && 
+	(sieve->getConeSize(r_iter->second) || 
+	 sieve->getSupportSize(r_iter->second)))
+      renumbering[r_iter->first] = r_iter->second;
+  
   //   Can I figure this out in a nicer way?
   ALE::SetFromMap<std::map<DomainSieveMesh::point_type,
     DomainSieveMesh::point_type> > globalPoints(renumbering);



More information about the CIG-COMMITS mailing list