[cig-commits] r19496 - in short/3D/PyLith/trunk: libsrc/pylith/meshio libsrc/pylith/topology pylith/faults pylith/feassemble pylith/meshio pylith/problems pylith/topology pylith/utils unittests/libtests/faults unittests/libtests/feassemble
brad at geodynamics.org
brad at geodynamics.org
Fri Jan 27 08:51:55 PST 2012
Author: brad
Date: 2012-01-27 08:51:54 -0800 (Fri, 27 Jan 2012)
New Revision: 19496
Modified:
short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5.cc
short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5Ext.cc
short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterVTK.cc
short/3D/PyLith/trunk/libsrc/pylith/topology/Jacobian.cc
short/3D/PyLith/trunk/pylith/faults/Fault.py
short/3D/PyLith/trunk/pylith/faults/FaultCohesiveDyn.py
short/3D/PyLith/trunk/pylith/faults/FaultCohesiveKin.py
short/3D/PyLith/trunk/pylith/feassemble/FIATLagrange.py
short/3D/PyLith/trunk/pylith/feassemble/FIATSimplex.py
short/3D/PyLith/trunk/pylith/feassemble/IntegratorElasticity.py
short/3D/PyLith/trunk/pylith/feassemble/Quadrature.py
short/3D/PyLith/trunk/pylith/meshio/MeshIOObj.py
short/3D/PyLith/trunk/pylith/problems/Explicit.py
short/3D/PyLith/trunk/pylith/problems/ExplicitLumped.py
short/3D/PyLith/trunk/pylith/problems/Formulation.py
short/3D/PyLith/trunk/pylith/problems/Implicit.py
short/3D/PyLith/trunk/pylith/problems/TimeDependent.py
short/3D/PyLith/trunk/pylith/topology/MeshGenerator.py
short/3D/PyLith/trunk/pylith/topology/MeshImporter.py
short/3D/PyLith/trunk/pylith/utils/PetscManager.py
short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc
short/3D/PyLith/trunk/unittests/libtests/feassemble/TestElasticityExplicit.cc
short/3D/PyLith/trunk/unittests/libtests/feassemble/TestElasticityExplicitLgDeform.cc
short/3D/PyLith/trunk/unittests/libtests/feassemble/TestElasticityExplicitTet4.cc
short/3D/PyLith/trunk/unittests/libtests/feassemble/TestElasticityExplicitTri3.cc
short/3D/PyLith/trunk/unittests/libtests/feassemble/TestElasticityImplicit.cc
short/3D/PyLith/trunk/unittests/libtests/feassemble/TestElasticityImplicitLgDeform.cc
Log:
Merge from stable.
Modified: short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5.cc 2012-01-27 16:42:36 UTC (rev 19495)
+++ short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5.cc 2012-01-27 16:51:54 UTC (rev 19496)
@@ -146,7 +146,7 @@
CHECK_PETSC_ERROR(err);
// Account for censored cells
- int cellDepth = sieveMesh->depth();
+ int cellDepth = (sieveMesh->depth() == -1) ? -1 : 1;
err = MPI_Allreduce(&cellDepth, &cellDepth, 1, MPI_INT, MPI_MAX,
sieveMesh->comm());CHECK_PETSC_ERROR(err);
const int depth = (0 == label) ? cellDepth : labelId;
@@ -379,7 +379,7 @@
const ALE::Obj<typename mesh_type::SieveMesh>& sieveMesh =
field.mesh().sieveMesh();
assert(!sieveMesh.isNull());
- int cellDepth = sieveMesh->depth();
+ int cellDepth = (sieveMesh->depth() == -1) ? -1 : 1;
err = MPI_Allreduce(&cellDepth, &cellDepth, 1, MPI_INT, MPI_MAX,
sieveMesh->comm());CHECK_PETSC_ERROR(err);
const int depth = (0 == label) ? cellDepth : labelId;
Modified: short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5Ext.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5Ext.cc 2012-01-27 16:42:36 UTC (rev 19495)
+++ short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5Ext.cc 2012-01-27 16:51:54 UTC (rev 19496)
@@ -162,7 +162,7 @@
// Write cells
// Account for censored cells
- int cellDepth = sieveMesh->depth();
+ int cellDepth = (sieveMesh->depth() == -1) ? -1 : 1;
err = MPI_Allreduce(&cellDepth, &cellDepth, 1, MPI_INT, MPI_MAX,
sieveMesh->comm());CHECK_PETSC_ERROR(err);
const int depth = (0 == label) ? cellDepth : labelId;
@@ -446,7 +446,7 @@
const ALE::Obj<typename mesh_type::SieveMesh>& sieveMesh =
field.mesh().sieveMesh();
assert(!sieveMesh.isNull());
- int cellDepth = sieveMesh->depth();
+ int cellDepth = (sieveMesh->depth() == -1) ? -1 : 1;
err = MPI_Allreduce(&cellDepth, &cellDepth, 1, MPI_INT, MPI_MAX,
sieveMesh->comm());CHECK_PETSC_ERROR(err);
const int depth = (0 == label) ? cellDepth : labelId;
Modified: short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterVTK.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterVTK.cc 2012-01-27 16:42:36 UTC (rev 19495)
+++ short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterVTK.cc 2012-01-27 16:51:54 UTC (rev 19496)
@@ -255,7 +255,7 @@
// Cannot just use mesh->depth() because boundaries report the wrong thing
const ALE::Obj<SieveMesh>& sieveMesh = field.mesh().sieveMesh();
assert(!sieveMesh.isNull());
- int cellDepth = sieveMesh->depth();
+ int cellDepth = (sieveMesh->depth() == -1) ? -1 : 1;
err = MPI_Allreduce(&cellDepth, &cellDepth, 1, MPI_INT, MPI_MAX,
sieveMesh->comm());CHECK_PETSC_ERROR(err);
const int depth = (!label) ? cellDepth : labelId;
Modified: short/3D/PyLith/trunk/libsrc/pylith/topology/Jacobian.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/Jacobian.cc 2012-01-27 16:42:36 UTC (rev 19495)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/Jacobian.cc 2012-01-27 16:51:54 UTC (rev 19496)
@@ -128,10 +128,11 @@
CHECK_PETSC_ERROR(err);
err = MatAssemblyEnd(_matrix, MAT_FINAL_ASSEMBLY);
CHECK_PETSC_ERROR(err);
-#if 0
+
+#if 0 // DEBUGGING
// Check for empty row
const PetscInt *cols;
- PetscInt rStart, rEnd, ncols;
+ PetscInt rStart, rEnd, ncols;
err = MatGetOwnershipRange(_matrix, &rStart, &rEnd);CHECK_PETSC_ERROR(err);
for(PetscInt r = rStart; r < rEnd; ++r) {
@@ -154,6 +155,7 @@
err = MatRestoreRow(_matrix,r, &ncols, &cols, PETSC_NULL);CHECK_PETSC_ERROR(err);
}
#endif
+
} else if (0 == strcmp(mode, "flush_assembly")) {
err = MatAssemblyBegin(_matrix, MAT_FLUSH_ASSEMBLY);
CHECK_PETSC_ERROR(err);
Modified: short/3D/PyLith/trunk/pylith/faults/Fault.py
===================================================================
--- short/3D/PyLith/trunk/pylith/faults/Fault.py 2012-01-27 16:42:36 UTC (rev 19495)
+++ short/3D/PyLith/trunk/pylith/faults/Fault.py 2012-01-27 16:51:54 UTC (rev 19496)
@@ -182,7 +182,11 @@
logEvent = "%swrite" % self._loggingPrefix
self._eventLogger.eventBegin(logEvent)
- self._info.log("Writing fault data.")
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+
+ if 0 == comm.rank:
+ self._info.log("Writing fault data.")
self.output.writeData(t, fields)
self._eventLogger.eventEnd(logEvent)
Modified: short/3D/PyLith/trunk/pylith/faults/FaultCohesiveDyn.py
===================================================================
--- short/3D/PyLith/trunk/pylith/faults/FaultCohesiveDyn.py 2012-01-27 16:42:36 UTC (rev 19495)
+++ short/3D/PyLith/trunk/pylith/faults/FaultCohesiveDyn.py 2012-01-27 16:51:54 UTC (rev 19496)
@@ -100,7 +100,11 @@
"""
Do pre-initialization setup.
"""
- self._info.log("Pre-initializing fault '%s'." % self.label())
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+
+ if 0 == comm.rank:
+ self._info.log("Pre-initializing fault '%s'." % self.label())
FaultCohesive.preinitialize(self, mesh)
Integrator.preinitialize(self, mesh)
@@ -143,8 +147,13 @@
"""
logEvent = "%sinit" % self._loggingPrefix
self._eventLogger.eventBegin(logEvent)
- self._info.log("Initializing fault '%s'." % self.label())
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+
+ if 0 == comm.rank:
+ self._info.log("Initializing fault '%s'." % self.label())
+
Integrator.initialize(self, totalTime, numTimeSteps, normalizer)
FaultCohesive.initialize(self, totalTime, numTimeSteps, normalizer)
Modified: short/3D/PyLith/trunk/pylith/faults/FaultCohesiveKin.py
===================================================================
--- short/3D/PyLith/trunk/pylith/faults/FaultCohesiveKin.py 2012-01-27 16:42:36 UTC (rev 19495)
+++ short/3D/PyLith/trunk/pylith/faults/FaultCohesiveKin.py 2012-01-27 16:51:54 UTC (rev 19496)
@@ -101,7 +101,11 @@
"""
Do pre-initialization setup.
"""
- self._info.log("Pre-initializing fault '%s'." % self.label())
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+
+ if 0 == comm.rank:
+ self._info.log("Pre-initializing fault '%s'." % self.label())
FaultCohesive.preinitialize(self, mesh)
Integrator.preinitialize(self, mesh)
@@ -148,8 +152,13 @@
"""
logEvent = "%sinit" % self._loggingPrefix
self._eventLogger.eventBegin(logEvent)
- self._info.log("Initializing fault '%s'." % self.label())
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+
+ if 0 == comm.rank:
+ self._info.log("Initializing fault '%s'." % self.label())
+
Integrator.initialize(self, totalTime, numTimeSteps, normalizer)
for eqsrc in self.eqsrcs.components():
Modified: short/3D/PyLith/trunk/pylith/feassemble/FIATLagrange.py
===================================================================
--- short/3D/PyLith/trunk/pylith/feassemble/FIATLagrange.py 2012-01-27 16:42:36 UTC (rev 19495)
+++ short/3D/PyLith/trunk/pylith/feassemble/FIATLagrange.py 2012-01-27 16:51:54 UTC (rev 19496)
@@ -389,19 +389,22 @@
self.quadPts = numpy.array([0.0], dtype=numpy.float64)
self.quadWts = numpy.array([1.0], dtype=numpy.float64)
- self._info.line("Cell geometry: ")
- self._info.line(self.geometry)
- self._info.line("Vertices: ")
- self._info.line(self.vertices)
- self._info.line("Quad pts:")
- self._info.line(self.quadPts)
- self._info.line("Quad wts:")
- self._info.line(self.quadWts)
- self._info.line("Basis fns @ quad pts ):")
- self._info.line(self.basis)
- self._info.line("Basis fn derivatives @ quad pts:")
- self._info.line(self.basisDeriv)
- self._info.log()
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+ if 0 == comm.rank:
+ self._info.line("Cell geometry: ")
+ self._info.line(self.geometry)
+ self._info.line("Vertices: ")
+ self._info.line(self.vertices)
+ self._info.line("Quad pts:")
+ self._info.line(self.quadPts)
+ self._info.line("Quad wts:")
+ self._info.line(self.quadWts)
+ self._info.line("Basis fns @ quad pts ):")
+ self._info.line(self.basis)
+ self._info.line("Basis fn derivatives @ quad pts:")
+ self._info.line(self.basisDeriv)
+ self._info.log()
return
Modified: short/3D/PyLith/trunk/pylith/feassemble/FIATSimplex.py
===================================================================
--- short/3D/PyLith/trunk/pylith/feassemble/FIATSimplex.py 2012-01-27 16:42:36 UTC (rev 19495)
+++ short/3D/PyLith/trunk/pylith/feassemble/FIATSimplex.py 2012-01-27 16:51:54 UTC (rev 19496)
@@ -140,19 +140,22 @@
self.quadWts = numpy.array(quadrature.get_weights(), dtype=numpy.float64)
- self._info.line("Cell geometry: ")
- self._info.line(self.geometry)
- self._info.line("Vertices: ")
- self._info.line(self.vertices)
- self._info.line("Quad pts:")
- self._info.line(self.quadPts)
- self._info.line("Quad wts:")
- self._info.line(self.quadWts)
- self._info.line("Basis fns @ quad pts ):")
- self._info.line(self.basis)
- self._info.line("Basis fn derivatives @ quad pts:")
- self._info.line(self.basisDeriv)
- self._info.log()
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+ if 0 == comm.rank:
+ self._info.line("Cell geometry: ")
+ self._info.line(self.geometry)
+ self._info.line("Vertices: ")
+ self._info.line(self.vertices)
+ self._info.line("Quad pts:")
+ self._info.line(self.quadPts)
+ self._info.line("Quad wts:")
+ self._info.line(self.quadWts)
+ self._info.line("Basis fns @ quad pts ):")
+ self._info.line(self.basis)
+ self._info.line("Basis fn derivatives @ quad pts:")
+ self._info.line(self.basisDeriv)
+ self._info.log()
return
Modified: short/3D/PyLith/trunk/pylith/feassemble/IntegratorElasticity.py
===================================================================
--- short/3D/PyLith/trunk/pylith/feassemble/IntegratorElasticity.py 2012-01-27 16:42:36 UTC (rev 19495)
+++ short/3D/PyLith/trunk/pylith/feassemble/IntegratorElasticity.py 2012-01-27 16:51:54 UTC (rev 19496)
@@ -99,8 +99,11 @@
logEvent = "%sinit" % self._loggingPrefix
self._eventLogger.eventBegin(logEvent)
- self._info.log("Initializing integrator for material '%s'." % \
- self.materialObj.label())
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+ if 0 == comm.rank:
+ self._info.log("Initializing integrator for material '%s'." % \
+ self.materialObj.label())
Integrator.initialize(self, totalTime, numTimeSteps, normalizer)
self.materialObj.normalizer(normalizer)
@@ -115,7 +118,10 @@
logEvent = "%swrite" % self._loggingPrefix
self._eventLogger.eventBegin(logEvent)
- self._info.log("Writing material data.")
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+ if 0 == comm.rank:
+ self._info.log("Writing material data.")
self.output.writeData(t, fields)
self._eventLogger.eventEnd(logEvent)
Modified: short/3D/PyLith/trunk/pylith/feassemble/Quadrature.py
===================================================================
--- short/3D/PyLith/trunk/pylith/feassemble/Quadrature.py 2012-01-27 16:42:36 UTC (rev 19495)
+++ short/3D/PyLith/trunk/pylith/feassemble/Quadrature.py 2012-01-27 16:51:54 UTC (rev 19496)
@@ -77,11 +77,15 @@
"""
Setup quadrature object.
"""
- self._info.log("Initializing reference cell.")
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+ if 0 == comm.rank:
+ self._info.log("Initializing reference cell.")
cell = self.cell
cell.initialize(spaceDim)
- self._info.log("Initializing C++ quadrature.")
+ if 0 == comm.rank:
+ self._info.log("Initializing C++ quadrature.")
self._initialize(cell)
self.refGeometry(cell.geometry)
return
Modified: short/3D/PyLith/trunk/pylith/meshio/MeshIOObj.py
===================================================================
--- short/3D/PyLith/trunk/pylith/meshio/MeshIOObj.py 2012-01-27 16:42:36 UTC (rev 19495)
+++ short/3D/PyLith/trunk/pylith/meshio/MeshIOObj.py 2012-01-27 16:51:54 UTC (rev 19496)
@@ -49,7 +49,10 @@
@returns PETSc mesh object containing finite-element mesh
"""
- self._info.log("Reading finite-element mesh")
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+ if 0 == comm.rank:
+ self._info.log("Reading finite-element mesh")
# Set flags
self.debug(debug)
@@ -76,7 +79,10 @@
@param mesh PETSc mesh object containing finite-element mesh
"""
- self._info.log("Writing finite-element mesh")
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+ if 0 == comm.rank:
+ self._info.log("Writing finite-element mesh")
ModuleMeshIO.write(self, mesh)
return
Modified: short/3D/PyLith/trunk/pylith/problems/Explicit.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/Explicit.py 2012-01-27 16:42:36 UTC (rev 19495)
+++ short/3D/PyLith/trunk/pylith/problems/Explicit.py 2012-01-27 16:51:54 UTC (rev 19496)
@@ -97,6 +97,9 @@
logEvent = "%sinit" % self._loggingPrefix
self._eventLogger.eventBegin(logEvent)
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+
self._initialize(dimension, normalizer)
from pylith.utils.petsc import MemoryLogger
@@ -105,7 +108,8 @@
logger.stagePush("Problem")
# Allocate other fields, reusing layout from dispIncr
- self._info.log("Creating other fields.")
+ if 0 == comm.rank:
+ self._info.log("Creating other fields.")
self.fields.add("disp(t-dt)", "displacement")
self.fields.add("velocity(t)", "velocity")
self.fields.add("acceleration(t)", "acceleration")
@@ -136,7 +140,8 @@
self._debug.log(resourceUsageString())
logger.stagePop()
- self._info.log("Creating Jacobian matrix.")
+ if 0 == comm.rank:
+ self._info.log("Creating Jacobian matrix.")
self._setJacobianMatrixType()
from pylith.topology.Jacobian import Jacobian
self.jacobian = Jacobian(self.fields.solution(),
@@ -145,7 +150,8 @@
self._debug.log(resourceUsageString())
logger.stagePush("Problem")
- self._info.log("Initializing solver.")
+ if 0 == comm.rank:
+ self._info.log("Initializing solver.")
self.solver.initialize(self.fields, self.jacobian, self)
self._debug.log(resourceUsageString())
@@ -191,9 +197,13 @@
logEvent = "%sstep" % self._loggingPrefix
self._eventLogger.eventBegin(logEvent)
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+
self._reformResidual(t, dt)
- self._info.log("Solving equations.")
+ if 0 == comm.rank:
+ self._info.log("Solving equations.")
residual = self.fields.get("residual")
dispIncr = self.fields.get("dispIncr(t->t+dt)")
self.solver.solve(dispIncr, self.jacobian, residual)
@@ -209,11 +219,15 @@
logEvent = "%spoststep" % self._loggingPrefix
self._eventLogger.eventBegin(logEvent)
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+
# The velocity and acceleration at time t depends on the
# displacement at time t+dt, we want to output BEFORE updating the
# displacement fields so that the displacement, velocity, and
# acceleration files are all at time t.
- self._info.log("Writing solution fields.")
+ if 0 == comm.rank:
+ self._info.log("Writing solution fields.")
for output in self.output.components():
output.writeData(t, self.fields)
self._writeData(t)
Modified: short/3D/PyLith/trunk/pylith/problems/ExplicitLumped.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/ExplicitLumped.py 2012-01-27 16:42:36 UTC (rev 19495)
+++ short/3D/PyLith/trunk/pylith/problems/ExplicitLumped.py 2012-01-27 16:51:54 UTC (rev 19496)
@@ -90,6 +90,9 @@
logEvent = "%sinit" % self._loggingPrefix
self._eventLogger.eventBegin(logEvent)
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+
self._initialize(dimension, normalizer)
from pylith.utils.petsc import MemoryLogger
@@ -98,7 +101,8 @@
logger.stagePush("Problem")
# Allocate other fields, reusing layout from dispIncr
- self._info.log("Creating other fields.")
+ if 0 == comm.rank:
+ self._info.log("Creating other fields.")
self.fields.add("disp(t-dt)", "displacement")
self.fields.add("velocity(t)", "velocity")
self.fields.add("acceleration(t)", "acceleration")
@@ -129,7 +133,8 @@
self._debug.log(resourceUsageString())
logger.stagePop()
- self._info.log("Creating lumped Jacobian matrix.")
+ if 0 == comm.rank:
+ self._info.log("Creating lumped Jacobian matrix.")
from pylith.topology.topology import MeshField
jacobian = MeshField(self.mesh)
jacobian.newSection(jacobian.VERTICES_FIELD, dimension)
@@ -140,7 +145,8 @@
self._debug.log(resourceUsageString())
logger.stagePush("Problem")
- self._info.log("Initializing solver.")
+ if 0 == comm.rank:
+ self._info.log("Initializing solver.")
self.solver.initialize(self.fields, self.jacobian, self)
self._debug.log(resourceUsageString())
@@ -171,7 +177,11 @@
"""
Reform residual vector for operator.
"""
- self._info.log("Integrating residual term in operator.")
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+
+ if 0 == comm.rank:
+ self._info.log("Integrating residual term in operator.")
self._eventLogger.stagePush("Reform Residual")
self.updateSettings(self.jacobian, self.fields, t, dt)
@@ -186,8 +196,12 @@
"""
Reform Jacobian matrix for operator.
"""
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+
self._debug.log(resourceUsageString())
- self._info.log("Integrating Jacobian operator.")
+ if 0 == comm.rank:
+ self._info.log("Integrating Jacobian operator.")
self._eventLogger.stagePush("Reform Jacobian")
self.updateSettings(self.jacobian, self.fields, t, dt)
Modified: short/3D/PyLith/trunk/pylith/problems/Formulation.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/Formulation.py 2012-01-27 16:42:36 UTC (rev 19495)
+++ short/3D/PyLith/trunk/pylith/problems/Formulation.py 2012-01-27 16:51:54 UTC (rev 19496)
@@ -160,6 +160,9 @@
logEvent = "%spreinit" % self._loggingPrefix
self._eventLogger.eventBegin(logEvent)
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+
self.timeStep.preinitialize()
self.mesh = mesh
@@ -172,8 +175,9 @@
self._setupMaterials(materials)
self._setupBC(boundaryConditions)
self._setupInterfaces(interfaceConditions)
-
- self._info.log("Pre-initializing output.")
+
+ if 0 == comm.rank:
+ self._info.log("Pre-initializing output.")
for output in self.output.components():
output.preinitialize()
@@ -281,7 +285,11 @@
logEvent = "%sfinalize" % self._loggingPrefix
self._eventLogger.eventBegin(logEvent)
- self._info.log("Formulation finalize.")
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+
+ if 0 == comm.rank:
+ self._info.log("Formulation finalize.")
self._debug.log(resourceUsageString())
for integrator in self.integratorsMesh + self.integratorsSubMesh:
integrator.finalize()
@@ -366,7 +374,11 @@
"""
from pylith.feassemble.Integrator import implementsIntegrator
- self._info.log("Pre-initializing materials.")
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+
+ if 0 == comm.rank:
+ self._info.log("Pre-initializing materials.")
self._debug.log(resourceUsageString())
for material in materials.components():
integrator = self.elasticityIntegrator()
@@ -378,8 +390,9 @@
self.integratorsMesh.append(integrator)
self._debug.log(resourceUsageString())
- self._info.log("Added elasticity integrator for material '%s'." % \
- material.label())
+ if 0 == comm.rank:
+ self._info.log("Added elasticity integrator for material '%s'." % \
+ material.label())
return
@@ -391,7 +404,11 @@
from pylith.feassemble.Constraint import implementsConstraint
from pylith.bc.PointForce import PointForce
- self._info.log("Pre-initializing boundary conditions.")
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+
+ if 0 == comm.rank:
+ self._info.log("Pre-initializing boundary conditions.")
self._debug.log(resourceUsageString())
for bc in boundaryConditions.components():
bc.preinitialize(self.mesh)
@@ -402,13 +419,15 @@
self.integratorsSubMesh.append(bc)
else:
self.integratorsMesh.append(bc)
- self._info.log("Added boundary condition '%s' as an integrator." % \
- bc.label())
+ if 0 == comm.rank:
+ self._info.log("Added boundary condition '%s' as an integrator." % \
+ bc.label())
if implementsConstraint(bc):
foundType = True
self.constraints.append(bc)
- self._info.log("Added boundary condition '%s' as a constraint." % \
- bc.label())
+ if 0 == comm.rank:
+ self._info.log("Added boundary condition '%s' as a constraint." % \
+ bc.label())
if not foundType:
raise TypeError, \
"Could not determine whether boundary condition '%s' is an " \
@@ -424,20 +443,26 @@
from pylith.feassemble.Integrator import implementsIntegrator
from pylith.feassemble.Constraint import implementsConstraint
- self._info.log("Pre-initializing interior interfaces.")
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+
+ if 0 == comm.rank:
+ self._info.log("Pre-initializing interior interfaces.")
for ic in interfaceConditions.components():
ic.preinitialize(self.mesh)
foundType = False
if implementsIntegrator(ic):
foundType = True
self.integratorsSubMesh.append(ic)
- self._info.log("Added interface condition '%s' as an integrator." % \
- ic.label())
+ if 0 == comm.rank:
+ self._info.log("Added interface condition '%s' as an integrator." % \
+ ic.label())
if implementsConstraint(ic):
foundType = True
self.constraints.append(ic)
- self._info.log("Added interface condition '%s' as a constraint." % \
- ic.label())
+ if 0 == comm.rank:
+ self._info.log("Added interface condition '%s' as a constraint." % \
+ ic.label())
if not foundType:
raise TypeError, \
"Could not determine whether interface condition '%s' is an " \
@@ -450,6 +475,9 @@
"""
Create integrators for each element family.
"""
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+
self.timeStep.initialize(normalizer)
numTimeSteps = self.timeStep.numTimeSteps()
@@ -459,7 +487,8 @@
self.fields = SolutionFields(self.mesh)
self._debug.log(resourceUsageString())
- self._info.log("Initializing integrators.")
+ if 0 == comm.rank:
+ self._info.log("Initializing integrators.")
for integrator in self.integratorsMesh + self.integratorsSubMesh:
if not self.gravityField is None:
integrator.gravityField(self.gravityField)
@@ -468,12 +497,14 @@
ModuleFormulation.submeshIntegrators(self, self.integratorsSubMesh)
self._debug.log(resourceUsageString())
- self._info.log("Initializing constraints.")
+ if 0 == comm.rank:
+ self._info.log("Initializing constraints.")
for constraint in self.constraints:
constraint.initialize(totalTime, numTimeSteps, normalizer)
self._debug.log(resourceUsageString())
- self._info.log("Setting up solution output.")
+ if 0 == comm.rank:
+ self._info.log("Setting up solution output.")
for output in self.output.components():
output.initialize(self.mesh, normalizer)
output.writeInfo()
@@ -481,7 +512,8 @@
self._debug.log(resourceUsageString())
# Setup fields
- self._info.log("Creating solution field.")
+ if 0 == comm.rank:
+ self._info.log("Creating solution field.")
from pylith.utils.petsc import MemoryLogger
memoryLogger = MemoryLogger.singleton()
memoryLogger.setDebug(0)
@@ -533,8 +565,12 @@
"""
Reform Jacobian matrix for operator.
"""
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+
self._debug.log(resourceUsageString())
- self._info.log("Integrating Jacobian operator.")
+ if 0 == comm.rank:
+ self._info.log("Integrating Jacobian operator.")
self._eventLogger.stagePush("Reform Jacobian")
self.updateSettings(self.jacobian, self.fields, t, dt)
@@ -555,7 +591,11 @@
"""
Reform residual vector for operator.
"""
- self._info.log("Integrating residual term in operator.")
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+
+ if 0 == comm.rank:
+ self._info.log("Integrating residual term in operator.")
self._eventLogger.stagePush("Reform Residual")
self.updateSettings(self.jacobian, self.fields, t, dt)
Modified: short/3D/PyLith/trunk/pylith/problems/Implicit.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/Implicit.py 2012-01-27 16:42:36 UTC (rev 19495)
+++ short/3D/PyLith/trunk/pylith/problems/Implicit.py 2012-01-27 16:51:54 UTC (rev 19496)
@@ -122,6 +122,9 @@
logEvent = "%sinit" % self._loggingPrefix
self._eventLogger.eventBegin(logEvent)
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+
self._initialize(dimension, normalizer)
from pylith.utils.petsc import MemoryLogger
@@ -130,7 +133,8 @@
memoryLogger.stagePush("Problem")
# Allocate other fields, reusing layout from dispIncr
- self._info.log("Creating other fields.")
+ if 0 == comm.rank:
+ self._info.log("Creating other fields.")
self.fields.add("velocity(t)", "velocity")
self.fields.copyLayout("dispIncr(t->t+dt)")
@@ -152,7 +156,8 @@
memoryLogger.stagePop()
# Allocates memory for nonzero pattern and Jacobian
- self._info.log("Creating Jacobian matrix.")
+ if 0 == comm.rank:
+ self._info.log("Creating Jacobian matrix.")
self._setJacobianMatrixType()
from pylith.topology.Jacobian import Jacobian
self.jacobian = Jacobian(self.fields.solution(),
@@ -161,7 +166,8 @@
self._debug.log(resourceUsageString())
memoryLogger.stagePush("Problem")
- self._info.log("Initializing solver.")
+ if 0 == comm.rank:
+ self._info.log("Initializing solver.")
self.solver.initialize(self.fields, self.jacobian, self)
self._debug.log(resourceUsageString())
@@ -190,20 +196,24 @@
"""
Hook for doing stuff before advancing time step.
"""
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
# If finishing first time step, then switch from solving for total
# displacements to solving for incremental displacements
needNewJacobian = False
if 1 == self._stepCount:
- self._info.log("Switching from total field solution to incremental " \
- "field solution.")
+ if 0 == comm.rank:
+ self._info.log("Switching from total field solution to incremental " \
+ "field solution.")
for constraint in self.constraints:
constraint.useSolnIncr(True)
for integrator in self.integratorsMesh + self.integratorsSubMesh:
integrator.useSolnIncr(True)
needNewJacobian = True
- self._info.log("Setting constraints.")
+ if 0 == comm.rank:
+ self._info.log("Setting constraints.")
dispIncr = self.fields.get("dispIncr(t->t+dt)")
dispIncr.zero()
if 0 == self._stepCount:
@@ -227,11 +237,15 @@
"""
Advance to next time step.
"""
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+
dispIncr = self.fields.get("dispIncr(t->t+dt)")
self._reformResidual(t+dt, dt)
- self._info.log("Solving equations.")
+ if 0 == comm.rank:
+ self._info.log("Solving equations.")
residual = self.fields.get("residual")
self._eventLogger.stagePush("Solve")
#self.jacobian.view() # TEMPORARY
@@ -251,6 +265,9 @@
"""
Hook for doing stuff after advancing time step.
"""
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+
# Update displacement field from time t to time t+dt.
dispIncr = self.fields.get("dispIncr(t->t+dt)")
disp = self.fields.get("disp(t)")
@@ -262,7 +279,8 @@
# Write data. Velocity at time t will be based upon displacement
# at time t-dt and t.
- self._info.log("Writing solution fields.")
+ if 0 == comm.rank:
+ self._info.log("Writing solution fields.")
for output in self.output.components():
output.writeData(t+dt, self.fields)
self._writeData(t+dt)
Modified: short/3D/PyLith/trunk/pylith/problems/TimeDependent.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/TimeDependent.py 2012-01-27 16:42:36 UTC (rev 19495)
+++ short/3D/PyLith/trunk/pylith/problems/TimeDependent.py 2012-01-27 16:51:54 UTC (rev 19496)
@@ -82,8 +82,11 @@
bc/quadrature, etc.).
"""
self._setupLogging()
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
- self._info.log("Pre-initializing problem.")
+ if 0 == comm.rank:
+ self._info.log("Pre-initializing problem.")
self.mesh = mesh
self.formulation.preinitialize(mesh, self.materials, self.bc,
self.interfaces, self.gravityField)
@@ -104,7 +107,11 @@
Setup integrators for each element family (material/quadrature,
bc/quadrature, etc.).
"""
- self._info.log("Initializing problem.")
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+
+ if 0 == comm.rank:
+ self._info.log("Initializing problem.")
self.checkpointTimer.initialize(self.normalizer)
self.formulation.initialize(self.dimension, self.normalizer)
return
@@ -114,7 +121,11 @@
"""
Solve time dependent problem.
"""
- self._info.log("Solving problem.")
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+
+ if 0 == comm.rank:
+ self._info.log("Solving problem.")
self.checkpointTimer.toplevel = app # Set handle for saving state
t = self.formulation.getStartTime()
@@ -122,7 +133,8 @@
while t < self.formulation.getTotalTime():
self._eventLogger.stagePush("Prestep")
tsec = self.normalizer.dimensionalize(t, timeScale)
- self._info.log("Main time loop, current time is t=%s" % tsec)
+ if 0 == comm.rank:
+ self._info.log("Main time loop, current time is t=%s" % tsec)
# Checkpoint if necessary
self.checkpointTimer.update(t)
@@ -131,19 +143,22 @@
dt = self.formulation.getTimeStep()
dtsec = self.normalizer.dimensionalize(dt, timeScale)
- self._info.log("Preparing to advance solution from time t=%s to t=%s." %\
- (tsec, tsec+dtsec))
+ if 0 == comm.rank:
+ self._info.log("Preparing to advance solution from time t=%s to t=%s." %\
+ (tsec, tsec+dtsec))
self.formulation.prestep(t, dt)
self._eventLogger.stagePop()
- self._info.log("Advancing solution from t=%s to t=%s." % \
- (tsec, tsec+dtsec))
+ if 0 == comm.rank:
+ self._info.log("Advancing solution from t=%s to t=%s." % \
+ (tsec, tsec+dtsec))
self._eventLogger.stagePush("Step")
self.formulation.step(t, dt)
self._eventLogger.stagePop()
- self._info.log("Finishing advancing solution from t=%s to t=%s." % \
- (tsec, tsec+dtsec))
+ if 0 == comm.rank:
+ self._info.log("Finishing advancing solution from t=%s to t=%s." % \
+ (tsec, tsec+dtsec))
self._eventLogger.stagePush("Poststep")
self.formulation.poststep(t, dt)
self._eventLogger.stagePop()
Modified: short/3D/PyLith/trunk/pylith/topology/MeshGenerator.py
===================================================================
--- short/3D/PyLith/trunk/pylith/topology/MeshGenerator.py 2012-01-27 16:42:36 UTC (rev 19495)
+++ short/3D/PyLith/trunk/pylith/topology/MeshGenerator.py 2012-01-27 16:51:54 UTC (rev 19496)
@@ -100,6 +100,9 @@
logEvent = "%sadjTopo" % self._loggingPrefix
self._eventLogger.eventBegin(logEvent)
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+
#self._info.activate()
#mesh.view("===== MESH BEFORE ADJUSTING TOPOLOGY =====")
@@ -108,7 +111,8 @@
firstLagrangeVertex = 0
firstFaultCell = 0
for interface in interfaces:
- self._info.log("Counting vertices for fault '%s'." % interface.label())
+ if 0 == comm.rank:
+ self._info.log("Counting vertices for fault '%s'." % interface.label())
nvertices = interface.numVertices(mesh)
firstLagrangeVertex += nvertices
firstFaultCell += nvertices
@@ -116,8 +120,9 @@
firstFaultCell += nvertices
for interface in interfaces:
nvertices = interface.numVertices(mesh)
- self._info.log("Adjusting topology for fault '%s' with %d vertices." % \
- (interface.label(), nvertices))
+ if 0 == comm.rank:
+ self._info.log("Adjusting topology for fault '%s' with %d vertices." % \
+ (interface.label(), nvertices))
firstFaultVertex, firstLagrangeVertex, firstFaultCell = \
interface.adjustTopology(mesh, firstFaultVertex, firstLagrangeVertex, firstFaultCell)
Modified: short/3D/PyLith/trunk/pylith/topology/MeshImporter.py
===================================================================
--- short/3D/PyLith/trunk/pylith/topology/MeshImporter.py 2012-01-27 16:42:36 UTC (rev 19495)
+++ short/3D/PyLith/trunk/pylith/topology/MeshImporter.py 2012-01-27 16:51:54 UTC (rev 19496)
@@ -89,6 +89,8 @@
Hook for creating mesh.
"""
from pylith.utils.profiling import resourceUsageString
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
self._setupLogging()
logEvent = "%screate" % self._loggingPrefix
@@ -104,7 +106,8 @@
logEvent2 = "%sreorder" % self._loggingPrefix
self._eventLogger.eventBegin(logEvent2)
self._debug.log(resourceUsageString())
- self._info.log("Reordering cells and vertices.")
+ if 0 == comm.rank:
+ self._info.log("Reordering cells and vertices.")
from pylith.topology.ReverseCuthillMcKee import ReverseCuthillMcKee
ordering = ReverseCuthillMcKee()
ordering.reorder(mesh)
@@ -112,12 +115,14 @@
# Adjust topology
self._debug.log(resourceUsageString())
- self._info.log("Adjusting topology.")
+ if 0 == comm.rank:
+ self._info.log("Adjusting topology.")
self._adjustTopology(mesh, faults)
# Distribute mesh
if mesh.getComm().size > 1:
- self._info.log("Distributing mesh.")
+ if 0 == comm.rank:
+ self._info.log("Distributing mesh.")
mesh = self.distributor.distribute(mesh, normalizer)
if self.debug:
mesh.view("Distributed mesh.")
Modified: short/3D/PyLith/trunk/pylith/utils/PetscManager.py
===================================================================
--- short/3D/PyLith/trunk/pylith/utils/PetscManager.py 2012-01-27 16:42:36 UTC (rev 19495)
+++ short/3D/PyLith/trunk/pylith/utils/PetscManager.py 2012-01-27 16:51:54 UTC (rev 19496)
@@ -51,7 +51,6 @@
"""
Initialize PETSc.
"""
- self._info.log("Initializing PETSc.")
import sys
args = [sys.executable]
options = self._getOptions()
@@ -59,6 +58,10 @@
for arg in options:
args.append(arg)
petsc.initialize(args)
+ from pylith.mpi.Communicator import petsc_comm_world
+ comm = petsc_comm_world()
+ if 0 == comm.rank:
+ self._info.log("Initialized PETSc.")
return
@@ -66,7 +69,10 @@
"""
Finalize PETSc.
"""
- self._info.log("Finalizing PETSc.")
+ from pylith.mpi.Communicator import petsc_comm_world
+ comm = petsc_comm_world()
+ if 0 == comm.rank:
+ self._info.log("Finalizing PETSc.")
petsc.finalize()
return
Modified: short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc 2012-01-27 16:42:36 UTC (rev 19495)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc 2012-01-27 16:51:54 UTC (rev 19496)
@@ -399,9 +399,7 @@
CPPUNIT_ASSERT_EQUAL(ncolsE, ncols);
PetscMat jDense;
- PetscMat jSparseAIJ;
- MatConvert(jacobianMat, MATSEQAIJ, MAT_INITIAL_MATRIX, &jSparseAIJ);
- MatConvert(jSparseAIJ, MATSEQDENSE, MAT_INITIAL_MATRIX, &jDense);
+ MatConvert(jacobianMat, MATSEQDENSE, MAT_INITIAL_MATRIX, &jDense);
scalar_array vals(nrows*ncols);
int_array rows(nrows);
@@ -429,7 +427,6 @@
CPPUNIT_ASSERT_DOUBLES_EQUAL(valE, vals[index], tolerance);
} // for
MatDestroy(&jDense);
- MatDestroy(&jSparseAIJ);
CPPUNIT_ASSERT_EQUAL(false, fault.needNewJacobian());
} // testIntegrateJacobian
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/TestElasticityExplicit.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/TestElasticityExplicit.cc 2012-01-27 16:42:36 UTC (rev 19495)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/TestElasticityExplicit.cc 2012-01-27 16:51:54 UTC (rev 19496)
@@ -290,9 +290,7 @@
CPPUNIT_ASSERT_EQUAL(ncolsE, ncols);
PetscMat jDense;
- PetscMat jSparseAIJ;
- MatConvert(jacobianMat, MATSEQAIJ, MAT_INITIAL_MATRIX, &jSparseAIJ);
- MatConvert(jSparseAIJ, MATSEQDENSE, MAT_INITIAL_MATRIX, &jDense);
+ MatConvert(jacobianMat, MATSEQDENSE, MAT_INITIAL_MATRIX, &jDense);
scalar_array vals(nrows*ncols);
int_array rows(nrows);
@@ -312,7 +310,6 @@
CPPUNIT_ASSERT_DOUBLES_EQUAL(valsE[index], vals[index], tolerance);
} // for
MatDestroy(&jDense);
- MatDestroy(&jSparseAIJ);
} // testIntegrateJacobian
// ----------------------------------------------------------------------
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/TestElasticityExplicitLgDeform.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/TestElasticityExplicitLgDeform.cc 2012-01-27 16:42:36 UTC (rev 19495)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/TestElasticityExplicitLgDeform.cc 2012-01-27 16:51:54 UTC (rev 19496)
@@ -202,9 +202,7 @@
CPPUNIT_ASSERT_EQUAL(ncolsE, ncols);
PetscMat jDense;
- PetscMat jSparseAIJ;
- MatConvert(jacobianMat, MATSEQAIJ, MAT_INITIAL_MATRIX, &jSparseAIJ);
- MatConvert(jSparseAIJ, MATSEQDENSE, MAT_INITIAL_MATRIX, &jDense);
+ MatConvert(jacobianMat, MATSEQDENSE, MAT_INITIAL_MATRIX, &jDense);
scalar_array vals(nrows*ncols);
int_array rows(nrows);
@@ -224,7 +222,6 @@
CPPUNIT_ASSERT_DOUBLES_EQUAL(valsE[index], vals[index], tolerance);
} // for
MatDestroy(&jDense);
- MatDestroy(&jSparseAIJ);
} // testIntegrateJacobian
// ----------------------------------------------------------------------
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/TestElasticityExplicitTet4.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/TestElasticityExplicitTet4.cc 2012-01-27 16:42:36 UTC (rev 19495)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/TestElasticityExplicitTet4.cc 2012-01-27 16:51:54 UTC (rev 19496)
@@ -285,9 +285,7 @@
CPPUNIT_ASSERT_EQUAL(ncolsE, ncols);
PetscMat jDense;
- PetscMat jSparseAIJ;
- MatConvert(jacobianMat, MATSEQAIJ, MAT_INITIAL_MATRIX, &jSparseAIJ);
- MatConvert(jSparseAIJ, MATSEQDENSE, MAT_INITIAL_MATRIX, &jDense);
+ MatConvert(jacobianMat, MATSEQDENSE, MAT_INITIAL_MATRIX, &jDense);
scalar_array vals(nrows*ncols);
int_array rows(nrows);
@@ -307,7 +305,6 @@
CPPUNIT_ASSERT_DOUBLES_EQUAL(valsE[index], vals[index], tolerance);
} // for
MatDestroy(&jDense);
- MatDestroy(&jSparseAIJ);
} // testIntegrateJacobian
// ----------------------------------------------------------------------
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/TestElasticityExplicitTri3.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/TestElasticityExplicitTri3.cc 2012-01-27 16:42:36 UTC (rev 19495)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/TestElasticityExplicitTri3.cc 2012-01-27 16:51:54 UTC (rev 19496)
@@ -285,9 +285,7 @@
CPPUNIT_ASSERT_EQUAL(ncolsE, ncols);
PetscMat jDense;
- PetscMat jSparseAIJ;
- MatConvert(jacobianMat, MATSEQAIJ, MAT_INITIAL_MATRIX, &jSparseAIJ);
- MatConvert(jSparseAIJ, MATSEQDENSE, MAT_INITIAL_MATRIX, &jDense);
+ MatConvert(jacobianMat, MATSEQDENSE, MAT_INITIAL_MATRIX, &jDense);
scalar_array vals(nrows*ncols);
int_array rows(nrows);
@@ -307,7 +305,6 @@
CPPUNIT_ASSERT_DOUBLES_EQUAL(valsE[index], vals[index], tolerance);
} // for
MatDestroy(&jDense);
- MatDestroy(&jSparseAIJ);
} // testIntegrateJacobian
// ----------------------------------------------------------------------
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/TestElasticityImplicit.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/TestElasticityImplicit.cc 2012-01-27 16:42:36 UTC (rev 19495)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/TestElasticityImplicit.cc 2012-01-27 16:51:54 UTC (rev 19496)
@@ -222,9 +222,7 @@
CPPUNIT_ASSERT_EQUAL(ncolsE, ncols);
PetscMat jDense;
- PetscMat jSparseAIJ;
- MatConvert(jacobianMat, MATSEQAIJ, MAT_INITIAL_MATRIX, &jSparseAIJ);
- MatConvert(jSparseAIJ, MATSEQDENSE, MAT_INITIAL_MATRIX, &jDense);
+ MatConvert(jacobianMat, MATSEQDENSE, MAT_INITIAL_MATRIX, &jDense);
scalar_array vals(nrows*ncols);
int_array rows(nrows);
@@ -244,7 +242,6 @@
CPPUNIT_ASSERT_DOUBLES_EQUAL(valsE[index], vals[index], tolerance);
} // for
MatDestroy(&jDense);
- MatDestroy(&jSparseAIJ);
} // testIntegrateJacobian
// ----------------------------------------------------------------------
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/TestElasticityImplicitLgDeform.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/TestElasticityImplicitLgDeform.cc 2012-01-27 16:42:36 UTC (rev 19495)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/TestElasticityImplicitLgDeform.cc 2012-01-27 16:51:54 UTC (rev 19496)
@@ -162,9 +162,7 @@
CPPUNIT_ASSERT_EQUAL(ncolsE, ncols);
PetscMat jDense;
- PetscMat jSparseAIJ;
- MatConvert(jacobianMat, MATSEQAIJ, MAT_INITIAL_MATRIX, &jSparseAIJ);
- MatConvert(jSparseAIJ, MATSEQDENSE, MAT_INITIAL_MATRIX, &jDense);
+ MatConvert(jacobianMat, MATSEQDENSE, MAT_INITIAL_MATRIX, &jDense);
scalar_array vals(nrows*ncols);
int_array rows(nrows);
@@ -187,7 +185,6 @@
CPPUNIT_ASSERT_DOUBLES_EQUAL(valE, vals[index], tolerance);
} // for
MatDestroy(&jDense);
- MatDestroy(&jSparseAIJ);
} // testIntegrateJacobian
// ----------------------------------------------------------------------
More information about the CIG-COMMITS
mailing list