[cig-commits] r18426 - in short/3D/PyLith/branches/multifields: . libsrc/pylith/topology unittests/libtests/topology

brad at geodynamics.org brad at geodynamics.org
Sun May 22 16:27:26 PDT 2011


Author: brad
Date: 2011-05-22 16:27:26 -0700 (Sun, 22 May 2011)
New Revision: 18426

Modified:
   short/3D/PyLith/branches/multifields/TODO
   short/3D/PyLith/branches/multifields/libsrc/pylith/topology/MultiField.cc
   short/3D/PyLith/branches/multifields/libsrc/pylith/topology/MultiField.hh
   short/3D/PyLith/branches/multifields/libsrc/pylith/topology/MultiField.icc
   short/3D/PyLith/branches/multifields/unittests/libtests/topology/TestMultiFieldMesh.hh
   short/3D/PyLith/branches/multifields/unittests/libtests/topology/TestMultiFieldSubMesh.hh
Log:
Started work on MultiField unit tests.

Modified: short/3D/PyLith/branches/multifields/TODO
===================================================================
--- short/3D/PyLith/branches/multifields/TODO	2011-05-22 23:26:34 UTC (rev 18425)
+++ short/3D/PyLith/branches/multifields/TODO	2011-05-22 23:27:26 UTC (rev 18426)
@@ -20,6 +20,15 @@
 
     (a) Add separate objects for each field element
 
+ (5) Field split
+ 
+   + Need to tell solver to split vector fields into pieces.
+
+  ---------------------------------------
+  MultiField
+    unit tests
+
+----------------------------------------------------------------------
 * [STABLE]
   rate and state friction - sliding test
   predictor/corrector scheme?
@@ -43,20 +52,8 @@
   cd examples/3d/hex8
   pylith step03.cfg --mesh_generator.refiner=pylith.topology.RefineUniform --nodes=3
 
-  DARWIN:
+    Runs but mesh connectivity/coordinates are wrong.
 
-  The initial problem is solved, but now with 3 procs we have this problem:
-
-    cd examples/3d/hex8
-    pylith step01.cfg --mesh_generator.refiner=pylith.topology.RefineUniform --nodes=3
-
-    mpinemesis: /home/brad/src/cig/pylith/libsrc/topology/RefineVol8Face4Edges2.cc:520: void ALE::RefineVol8Face4Edges2::overlapAddNewVertices(const ALE::Obj<ALE::IMesh<int, double, ALE::LabelSifter<int, int, ALE::malloc_allocator<ALE::NewSifterDef::Arrow<int, int> > > >, ALE::malloc_allocator<ALE::IMesh<int, double, ALE::LabelSifter<int, int, ALE::malloc_allocator<ALE::NewSifterDef::Arrow<int, int> > > > > >&, const ALE::MeshOrder&, const ALE::Obj<ALE::IMesh<int, double, ALE::LabelSifter<int, int, ALE::malloc_allocator<ALE::NewSifterDef::Arrow<int, int> > > >, ALE::malloc_allocator<ALE::IMesh<int, double, ALE::LabelSifter<int, int, ALE::malloc_allocator<ALE::NewSifterDef::Arrow<int, int> > > > > >&, const ALE::MeshOrder&): Assertion `k == 3' failed.
-
-  That was solved, but now
-
-    RuntimeError: Error while preparing for writing data to VTK file output/step03-lower_crust.vtk at time 0.
-    [1]Multiple indices for local point 977 remote point 666 from 0 with index 314
-
 * Output to HDF5 files. [BRAD and MATT]
 
   (2) Add time dataset to vertex_fields and cell_fields. [BRAD]
@@ -67,6 +64,9 @@
 
   Need to add the ability to add null space (subduction/step03).
 
+    Add flag to material [default is false] for creating null vector
+    When setting up solver, create null vector, and pass it to KSP
+
   Need to check performance of custom fault preconditioner.
 
 

Modified: short/3D/PyLith/branches/multifields/libsrc/pylith/topology/MultiField.cc
===================================================================
--- short/3D/PyLith/branches/multifields/libsrc/pylith/topology/MultiField.cc	2011-05-22 23:26:34 UTC (rev 18425)
+++ short/3D/PyLith/branches/multifields/libsrc/pylith/topology/MultiField.cc	2011-05-22 23:27:26 UTC (rev 18426)
@@ -36,26 +36,9 @@
 pylith::topology::MultiField<mesh_type, section_type>::MultiField(const mesh_type& mesh) :
   _mesh(mesh)
 { // constructor
-  _metadata.label = "unknown";
-  _metadata.vectorFieldType = OTHER;
-  _metadata.scale = 1.0;
-  _metadata.dimsOkay = false;
 } // constructor
 
 // ----------------------------------------------------------------------
-// Constructor with mesh, section, and metadata.
-template<typename mesh_type, typename section_type>
-pylith::topology::MultiField<mesh_type, section_type>::MultiField(const mesh_type& mesh,
-					  const ALE::Obj<section_type>& section,
-					  const Metadata& metadata) :
-  _metadata(metadata),
-  _mesh(mesh),
-  _section(section)
-{ // constructor
-  assert(!section.isNull());
-} // constructor
-
-// ----------------------------------------------------------------------
 // Destructor.
 template<typename mesh_type, typename section_type>
 pylith::topology::MultiField<mesh_type, section_type>::~MultiField(void)
@@ -71,6 +54,9 @@
 { // deallocate
   PetscErrorCode err = 0;
   
+  if (!_section.isNull())
+    _section->clear();
+
   const typename scatter_map_type::const_iterator scattersEnd = _scatters.end();
   for (typename scatter_map_type::iterator s_iter=_scatters.begin();
        s_iter != scattersEnd;
@@ -87,42 +73,20 @@
       err = VecDestroy(&s_iter->second.scatterVec);CHECK_PETSC_ERROR(err);
     } // if
   } // for
+  _scatters.clear();
 } // deallocate
 
 // ----------------------------------------------------------------------
-// Set label for field.
+// Set label of section.
 template<typename mesh_type, typename section_type>
 void
 pylith::topology::MultiField<mesh_type, section_type>::label(const char* value)
 { // label
-  _metadata.label = value;
-  if (!_section.isNull()) {
-    _section->setName(value);
-  } // if
-
-  const typename scatter_map_type::const_iterator scattersEnd = _scatters.end();
-  for (typename scatter_map_type::const_iterator s_iter=_scatters.begin();
-       s_iter != scattersEnd;
-       ++s_iter) {
-    if (s_iter->second.vector) {
-      PetscErrorCode err =
-	PetscObjectSetName((PetscObject)s_iter->second.vector, value);
-      CHECK_PETSC_ERROR(err);    
-    } // if
-  } // for
+  assert(!_section.isNull());
+  _section->setName(value);
 } // label
 
 // ----------------------------------------------------------------------
-// Get spatial dimension of domain.
-template<typename mesh_type, typename section_type>
-int
-pylith::topology::MultiField<mesh_type, section_type>::spaceDim(void) const
-{ // spaceDim
-  const spatialdata::geocoords::CoordSys* cs = _mesh.coordsys();
-  return (cs) ? cs->spaceDim() : 0;
-} // spaceDim
-
-// ----------------------------------------------------------------------
 // Get the chart size.
 template<typename mesh_type, typename section_type>
 int
@@ -141,157 +105,175 @@
 } // sectionSize
 
 // ----------------------------------------------------------------------
-// Create seive section.
+// Add field.
 template<typename mesh_type, typename section_type>
 void
-pylith::topology::MultiField<mesh_type, section_type>::newSection(void)
-{ // newSection
-  ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
-  logger.stagePush("Field");
+pylith::topology::MultiFields<mesh_type>::add(const char* name,
+					      const char* label,
+					      const FieldBase::VectorFieldEnum vectorFieldType,
+					      const double scale,
+					      const bool dimsOkay)
+{ // add
+  if (hasField(name)) {
+    std::ostringstream msg;
+    msg << "Could not add field '" << name
+	<< "' to multiple fields object, because it already exists.";
+    throw std::runtime_error(msg.str());
+  } // if
 
-  _section = new section_type(_mesh.comm(), _mesh.debug());  
-  assert(!_section.isNull());
-  _section->setName(_metadata.label);
+  // Set metadata
+  FieldInfo info;
+  info.metadata.label = label;
+  info.metadata.vectorFieldType = vectorFieldType;
+  info.metadata.scale = scale;
+  info.metadata.dimsOkay = dimsOkay;
+  
+  // Set field index.
+  info.fieldIndex = _fields.size();
+  info.field = 0;
 
-  logger.stagePop();
-} // newSection
+  _fields[name] = info;
+} // add
 
 // ----------------------------------------------------------------------
-// Create sieve section and set chart and fiber dimesion for a
-// sequence of points.
+// Get field.
 template<typename mesh_type, typename section_type>
-void
-pylith::topology::MultiField<mesh_type, section_type>::newSection(
-				       const ALE::Obj<label_sequence>& points,
-				       const int fiberDim)
-{ // newSection
-  typedef typename mesh_type::SieveMesh::point_type point_type;
-
-  ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
-  logger.stagePush("Field");
-  if (fiberDim < 0) {
+pylith::topology::Field<mesh_type>&
+pylith::topology::MultiFields<mesh_type>::get(const char* name)
+{ // get
+  typename map_type::iterator f_iter = _fields.find(name);
+  if (f_iter == _fields.end()) {
     std::ostringstream msg;
-    msg << "Fiber dimension (" << fiberDim << ") for field '" << _metadata.label
-	<< "' must be nonnegative.";
+    msg << "Could not find field '" << name
+	<< "' in multiple fields object for retrieval.";
     throw std::runtime_error(msg.str());
   } // if
+  const int fibration = f_iter->second.fibration;
+  assert(fibration >= 0 && fibration < _fields.size());
 
-  _section = new section_type(_mesh.comm(), _mesh.debug());
-  assert(!_section.isNull());
-  _section->setName(_metadata.label);
+  if (!f_iter->second.field) {
+    delete f_iter->second.field; f_iter->second.field = 0;
+    assert(!_section.isNull());
+    f_iter->second.field = 
+      new Field<mesh_type>(_mesh, _section->getFibration(fibration), 
+			   f_iter->second.metadata);
+    assert(0 != f_iter->second.field);
+  } // if
 
-  if (points->size() > 0) {
-    const point_type pointMin = 
-      *std::min_element(points->begin(), points->end());
-    const point_type pointMax = 
-      *std::max_element(points->begin(), points->end());
-    _section->setChart(chart_type(pointMin, pointMax+1));
-    _section->setFiberDimension(points, fiberDim);  
-  } else // Create empty chart
-    _section->setChart(chart_type(0, 0));
+  return *f_iter->second.field;
+} // get
 
-  logger.stagePop();
-} // newSection
-
 // ----------------------------------------------------------------------
-// Create sieve section and set chart and fiber dimesion for a list of
-// points.
+// Get index of field in collection of fields.
 template<typename mesh_type, typename section_type>
-void
-pylith::topology::MultiField<mesh_type, section_type>::newSection(const int_array& points,
-					       const int fiberDim)
-{ // newSection
-  typedef typename mesh_type::SieveMesh::point_type point_type;
-
-  ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
-  logger.stagePush("Field");
-  if (fiberDim < 0) {
+int
+pylith::topology::MultiFields<mesh_type>::fieldIndex(const char* name) const
+{ // fieldIndex
+  const typename map_type::const_iterator iterTarget = _fields.find(name);
+  if (iterTarget == _fields.end()) {
     std::ostringstream msg;
-    msg << "Fiber dimension (" << fiberDim << ") for field '" << _metadata.label
-	<< "' must be nonnegative.";
+    msg << "Could not find field '" << name
+	<< "' in multiple fields object for retrieval of field index.";
     throw std::runtime_error(msg.str());
   } // if
+
+  assert(f_iter);
+  const int index = f_iter->second.fibration;
+  assert(index >= 0);
+
+  return sindex;
+} // fieldIndex
+
+// ----------------------------------------------------------------------
+// Get index of first value of field in field.
+template<typename mesh_type, typename section_type>
+int
+pylith::topology::MultiFields<mesh_type>::fieldStartIndex(const int fieldIndex,
+							  const point_type point) const
+{ // fieldStartIndex
+  assert(_section.numSpaces() > 0);
+  assert(fieldIndex >= 0 && fieldIndex < _section.numSpaces());
   
-  _section = new section_type(_mesh.comm(), _mesh.debug());
-  assert(!_section.isNull());
-  _section->setName(_metadata.label);
+  int sindex = 0;
+  for (int i=0; i < fieldIndex; ++i) {
+    const ALE::Obj<RealSection>& subsection =
+      _section->getFibration(i);
+    sindex += subsection->getFiberDimension(point);
+  } // for
 
-  const int npts = points.size();
-  if (npts > 0) {
-    const point_type pointMin = points.min();
-    const point_type pointMax = points.max();
-    _section->setChart(chart_type(pointMin, pointMax+1));
-    for (int i=0; i < npts; ++i)
-      _section->setFiberDimension(points[i], fiberDim);
-  } else  // create empty chart
-    _section->setChart(chart_type(0, 0));
+  return sindex;
+} // fieldStartIndex
 
-  logger.stagePop();
-} // newSection
+// ----------------------------------------------------------------------
+// Get fiber dimension of field in section.
+template<typename mesh_type, typename section_type>
+int
+pylith::topology::MultiFields<mesh_type>::fieldFiberDim(const int fieldIndex,
+							const point_type point) const
+{ // fieldFiberDim
+  assert(_section.numSpaces() > 0);
+  assert(fieldIndex >= 0 && fieldIndex < _section.numSpaces());
 
+  const ALE::Obj<RealSection>& subsection =
+    _section->getFibration(fieldIndex);
+  const int fiberDim = subsection->getFiberDimension(point);
+
+  return fiberDim;
+} // fieldFiberDim
+
 // ----------------------------------------------------------------------
-// Create sieve section and set chart and fiber dimesion.
+// Compute total fiber dimension for section.
 template<typename mesh_type, typename section_type>
-void
-pylith::topology::MultiField<mesh_type, section_type>::newSection(const DomainEnum domain,
-					       const int fiberDim,
-					       const int stratum)
-{ // newSection
-  const ALE::Obj<SieveMesh>& sieveMesh = _mesh.sieveMesh();
-  assert(!sieveMesh.isNull());
+int
+pylith::topology::MultiFields<mesh_type>::fiberDim(void) const
+{ // fiberDim
+  const int numSpaces = _section.numSpaces();
+  assert(numSpaces > 0);
 
-  ALE::Obj<label_sequence> points;
-  if (VERTICES_FIELD == domain)
-    points = sieveMesh->depthStratum(stratum);
-  else if (CELLS_FIELD == domain)
-    points = sieveMesh->heightStratum(stratum);
-  else {
-    std::cerr << "Unknown value for DomainEnum: " << domain << std::endl;
-    assert(0);
-    throw std::logic_error("Bad domain enum in MultiField.");
-  } // else
+  int fiberDim = 0;
+  for (int i=0; i < numSpaces; ++i) {
+    const ALE::Obj<RealSection>& subsection =
+      _section->getFibration(i);
+    fiberDim += subsection->getFiberDimension(point);
+  } // for
 
-  newSection(points, fiberDim);
-} // newSection
+  return fiberDim;
+} // fiberDim
 
 // ----------------------------------------------------------------------
-// Create section given chart.
+// Clear variables associated with section.
 template<typename mesh_type, typename section_type>
 void
-pylith::topology::MultiField<mesh_type, section_type>::newSection(const MultiField& src,
-					       const int fiberDim)
-{ // newSection
+pylith::topology::MultiField<mesh_type, section_type>::clear(void)
+{ // clear
   ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
   logger.stagePush("Field");
 
-  if (_section.isNull()) {
-    logger.stagePop();
-    newSection();
-    logger.stagePush("Field");
-  } // if
-  if (fiberDim < 0) {
-    std::ostringstream msg;
-    msg << "Fiber dimension (" << fiberDim << ") for field '" << _metadata.label
-	<< "' must be nonnegative.";
-    throw std::runtime_error(msg.str());
-  } // if
+  deallocate();
+  if (!_section.isNull())
+    _section->clear();
+  _fields.clear();
 
-  const ALE::Obj<section_type>& srcSection = src.section();
-  if (!srcSection.isNull()) {
-    _section->setChart(srcSection->getChart());
-    const chart_type& chart = _section->getChart();
-    const typename chart_type::const_iterator chartBegin = chart.begin();
-    const typename chart_type::const_iterator chartEnd = chart.end();
+  logger.stagePop();
+} // clear
 
-    for (typename chart_type::const_iterator c_iter = chartBegin;
-	 c_iter != chartEnd;
-	 ++c_iter) 
-      if (srcSection->getFiberDimension(*c_iter) > 0)
-	_section->setFiberDimension(*c_iter, fiberDim);
-  } // if
+// ----------------------------------------------------------------------
+// Allocate Sieve section.
+template<typename mesh_type, typename section_type>
+void
+pylith::topology::MultiField<mesh_type, section_type>::allocate(void)
+{ // allocate
+  ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
+  logger.stagePush("Field");
 
+  assert(!_section.isNull());
+
+  const ALE::Obj<SieveMesh>& sieveMesh = _mesh.sieveMesh();
+  assert(!sieveMesh.isNull());
+  sieveMesh->allocate(_section);
+
   logger.stagePop();
-} // newSection
+} // allocate
 
 // ----------------------------------------------------------------------
 // Create section with same layout as another section.
@@ -303,18 +285,21 @@
   logger.stagePush("Field");
 
   deallocate();
-  std::string origLabel = _metadata.label;
-  _metadata = src._metadata;
-  label(origLabel.c_str());
 
+  // Copy metadata
+  _fields = src._fields;
+
+  // Section
   const ALE::Obj<section_type>& srcSection = src.section();
   if (!srcSection.isNull() && _section.isNull()) {
     logger.stagePop();
     newSection();
     logger.stagePush("Field");
-  }
+  } // if
 
   if (!_section.isNull()) {
+    // Note: We retain the original label of the section.
+
     if (!srcSection->sharedStorage()) {
       _section->setAtlas(srcSection->getAtlas());
       _section->allocateStorage();
@@ -341,6 +326,7 @@
     
     // Reuse scatters in clone
     PetscErrorCode err = 0;
+    const char* sectionLabel = _section->getName().c_str();
     if (src._scatters.size() > 0) {
       const typename scatter_map_type::const_iterator scattersEnd = src._scatters.end();
       for (typename scatter_map_type::const_iterator s_iter=src._scatters.begin();
@@ -376,7 +362,8 @@
 	err = VecGetSize(s_iter->second.vector, &vecGlobalSize); CHECK_PETSC_ERROR(err);
 
 	err = VecCreate(_mesh.comm(), &sinfo.vector); CHECK_PETSC_ERROR(err);
-	err = PetscObjectSetName((PetscObject)sinfo.vector, _metadata.label.c_str());
+	
+	err = PetscObjectSetName((PetscObject)sinfo.vector, sectionLabel);
 	CHECK_PETSC_ERROR(err);
 	err = VecSetSizes(sinfo.vector, vecLocalSize, vecGlobalSize); 
 	CHECK_PETSC_ERROR(err);
@@ -390,44 +377,26 @@
 } // cloneSection
 
 // ----------------------------------------------------------------------
-// Clear variables associated with section.
+// Complete section by assembling across processors.
 template<typename mesh_type, typename section_type>
 void
-pylith::topology::MultiField<mesh_type, section_type>::clear(void)
-{ // clear
+pylith::topology::MultiField<mesh_type, section_type>::complete(void)
+{ // complete
   ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
-  logger.stagePush("Field");
+  logger.stagePush("Completion");
 
-  deallocate();
+  const ALE::Obj<typename mesh_type::SieveMesh>& sieveMesh = _mesh.sieveMesh();
+  assert(!sieveMesh.isNull());
+
   if (!_section.isNull())
-    _section->clear();
+    ALE::Completion::completeSectionAdd(sieveMesh->getSendOverlap(),
+					sieveMesh->getRecvOverlap(), 
+					_section, _section);
 
-  _metadata.scale = 1.0;
-  _metadata.vectorFieldType = OTHER;
-  _metadata.dimsOkay = false;
-
   logger.stagePop();
-} // clear
+} // complete
 
 // ----------------------------------------------------------------------
-// Allocate Sieve section.
-template<typename mesh_type, typename section_type>
-void
-pylith::topology::MultiField<mesh_type, section_type>::allocate(void)
-{ // allocate
-  ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
-  logger.stagePush("Field");
-
-  assert(!_section.isNull());
-
-  const ALE::Obj<SieveMesh>& sieveMesh = _mesh.sieveMesh();
-  assert(!sieveMesh.isNull());
-  sieveMesh->allocate(_section);
-
-  logger.stagePop();
-} // allocate
-
-// ----------------------------------------------------------------------
 // Zero section values (excluding constrained DOF).
 template<typename mesh_type, typename section_type>
 void
@@ -466,52 +435,36 @@
 } // zeroAll
 
 // ----------------------------------------------------------------------
-// Complete section by assembling across processors.
-template<typename mesh_type, typename section_type>
-void
-pylith::topology::MultiField<mesh_type, section_type>::complete(void)
-{ // complete
-  ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
-  logger.stagePush("Completion");
-
-  const ALE::Obj<SieveMesh>& sieveMesh = _mesh.sieveMesh();
-  assert(!sieveMesh.isNull());
-
-  if (!_section.isNull())
-    ALE::Completion::completeSectionAdd(sieveMesh->getSendOverlap(),
-					sieveMesh->getRecvOverlap(), 
-					_section, _section);
-
-  logger.stagePop();
-} // complete
-
-// ----------------------------------------------------------------------
 // Copy field values and metadata.
 template<typename mesh_type, typename section_type>
 void
 pylith::topology::MultiField<mesh_type, section_type>::copy(const MultiField& field)
 { // copy
   // Check compatibility of sections
-  const int srcSize = field.chartSize();
-  const int dstSize = chartSize();
-  if (field.spaceDim() != spaceDim() ||
-      field._metadata.vectorFieldType != _metadata.vectorFieldType ||
-      srcSize != dstSize) {
+  const int srcChartSize = field.chartSize();
+  const int dstChartSize = chartSize();
+  const int srcSectionSize = field.sectionSize();
+  const int dstSectionSize = sectionSize();
+  if (srcChartSize != dstChartSize ||
+      srcSectionSize != dstSectionSize) {
     std::ostringstream msg;
 
-    msg << "Cannot copy values from section '" << field._metadata.label 
-	<< "' to section '" << _metadata.label
-	<< "'. Sections are incompatible.\n"
+    if (field._section.isNull())
+      msg << "Cannot copy values from null field to ";
+    else
+      msg << "Cannot copy values from field '" << field._section->getName()
+	  << "' to ";
+    if (_section.isNull())
+      msg << "null section.";
+    else
+      msg << "section '" << _section->getName() << "'.";
+    msg << " Sections are incompatible.\n"
 	<< "  Source section:\n"
-	<< "    space dim: " << field.spaceDim() << "\n"
-	<< "    vector field type: " << field._metadata.vectorFieldType << "\n"
-	<< "    scale: " << field._metadata.scale << "\n"
-	<< "    size: " << srcSize << "\n"
+	<< "    chart size: " << srcChartSize << "\n"
+	<< "    section size: " << srcSectionSize << "\n"
 	<< "  Destination section:\n"
-	<< "    space dim: " << spaceDim() << "\n"
-	<< "    vector field type: " << _metadata.vectorFieldType << "\n"
-	<< "    scale: " << _metadata.scale << "\n"
-	<< "    size: " << dstSize;
+	<< "    chart size: " << dstChartSize << "\n"
+	<< "    section size: " << dstSectionSize << "\n";
     throw std::runtime_error(msg.str());
   } // if
   assert( (_section.isNull() && field._section.isNull()) ||
@@ -545,24 +498,37 @@
 pylith::topology::MultiField<mesh_type, section_type>::copy(const ALE::Obj<section_type>& osection)
 { // copy
   // Check compatibility of sections
-  const int srcSize = osection->getChart().size();
-  const int dstSize = chartSize();
-  if (srcSize != dstSize) {
+  const int srcChartSize = 
+    (!osection.isNull()) ? osection->getChart().size() : 0;
+  const int srcSectionSize = 
+    (!osection.isNull()) ? osection->size() : 0;
+
+  const int dstChartSize = chartSize();
+  const int dstSectionSize = sectionSize();
+  if (srcChartSize != dstChartSize ||
+      srcSectionSize != dstSectionSize) {
     std::ostringstream msg;
 
-    msg << "Cannot copy values from Sieve section "
-	<< _metadata.label << "'. Sections are incompatible.\n"
+    if (field._section.isNull())
+      msg << "Cannot copy values from null section to ";
+    else
+      msg << "Cannot copy values from section '" << field._section->getName()
+	  << "' to ";
+    if (_section.isNull())
+      msg << "null section.";
+    else
+      msg << "section '" << _section->getName() << "'.";
+    msg << " Sections are incompatible.\n"
 	<< "  Source section:\n"
-	<< "    size: " << srcSize << "\n"
+	<< "    chart size: " << srcChartSize << "\n"
+	<< "    section size: " << srcSectionSize << "\n"
 	<< "  Destination section:\n"
-	<< "    space dim: " << spaceDim() << "\n"
-	<< "    vector field type: " << _metadata.vectorFieldType << "\n"
-	<< "    scale: " << _metadata.scale << "\n"
-	<< "    size: " << dstSize;
+	<< "    chart size: " << dstChartSize << "\n"
+	<< "    section size: " << dstSectionSize << "\n";
     throw std::runtime_error(msg.str());
   } // if
-  assert( (_section.isNull() && osection.isNull()) ||
-	  (!_section.isNull() && !osection.isNull()) );
+  assert( (_section.isNull() && field._section.isNull()) ||
+	  (!_section.isNull() && !field._section.isNull()) );
 
   if (!_section.isNull()) {
     // Copy values from field
@@ -587,27 +553,30 @@
 pylith::topology::MultiField<mesh_type, section_type>::operator+=(const MultiField& field)
 { // operator+=
   // Check compatibility of sections
-  const int srcSize = field.chartSize();
-  const int dstSize = chartSize();
-  if (field.spaceDim() != spaceDim() ||
-      field._metadata.vectorFieldType != _metadata.vectorFieldType ||
-      field._metadata.scale != _metadata.scale ||
-      srcSize != dstSize) {
+  const int srcChartSize = field.chartSize();
+  const int dstChartSize = chartSize();
+  const int srcSectionSize = field.sectionSize();
+  const int dstSectionSize = sectionSize();
+  if (srcChartSize != dstChartSize ||
+      srcSectionSize != dstSectionSize) {
     std::ostringstream msg;
 
-    msg << "Cannot add values from section '" << field._metadata.label 
-	<< "' to section '" << _metadata.label
-	<< "'. Sections are incompatible.\n"
+    if (field._section.isNull())
+      msg << "Cannot add values from null field to ";
+    else
+      msg << "Cannot add values from field '" << field._section->getName()
+	  << "' to ";
+    if (_section.isNull())
+      msg << "null section.";
+    else
+      msg << "section '" << _section->getName() << "'.";
+    msg << " Sections are incompatible.\n"
 	<< "  Source section:\n"
-	<< "    space dim: " << field.spaceDim() << "\n"
-	<< "    vector field type: " << field._metadata.vectorFieldType << "\n"
-	<< "    scale: " << field._metadata.scale << "\n"
-	<< "    size: " << srcSize << "\n"
+	<< "    chart size: " << srcChartSize << "\n"
+	<< "    section size: " << srcSectionSize << "\n"
 	<< "  Destination section:\n"
-	<< "    space dim: " << spaceDim() << "\n"
-	<< "    vector field type: " << _metadata.vectorFieldType << "\n"
-	<< "    scale: " << _metadata.scale << "\n"
-	<< "    size: " << dstSize;
+	<< "    chart size: " << dstChartSize << "\n"
+	<< "    section size: " << dstSectionSize << "\n";
     throw std::runtime_error(msg.str());
   } // if
   assert( (_section.isNull() && field._section.isNull()) ||
@@ -619,19 +588,16 @@
     const typename chart_type::const_iterator chartBegin = chart.begin();
     const typename chart_type::const_iterator chartEnd = chart.end();
 
-    // Assume fiber dimension is uniform
-    const int fiberDim = (chart.size() > 0) ? 
-      _section->getFiberDimension(*chartBegin) : 0;
-    double_array values(fiberDim);
-
     for (typename chart_type::const_iterator c_iter = chartBegin;
 	 c_iter != chartEnd;
 	 ++c_iter) {
+      assert(osection->getFiberDimension(*c_iter) ==
+	     _section->getFiberDimension(*c_iter));
       if (field._section->getFiberDimension(*c_iter) > 0) {
 	assert(fiberDim == field._section->getFiberDimension(*c_iter));
 	assert(fiberDim == _section->getFiberDimension(*c_iter));
-	field._section->restrictPoint(*c_iter, &values[0], values.size());
-	_section->updatePointAllAdd(*c_iter, &values[0]);
+	_section->updatePointAllAdd(*c_iter, 
+				    field._section->restrictPoint(*c_iter));
       } // if
     } // for
   } // if
@@ -658,6 +624,7 @@
     const typename chart_type::const_iterator chartEnd = chart.end();
 
     // Assume fiber dimension is uniform
+    // :FIX THIS:
     const int fiberDim = (chart.size() > 0) ? 
       _section->getFiberDimension(*chart.begin()) : 0;
     double_array values(fiberDim);
@@ -683,46 +650,60 @@
 void
 pylith::topology::MultiField<mesh_type, section_type>::view(const char* label) const
 { // view
-  std::string vecFieldString;
-  switch(_metadata.vectorFieldType)
-    { // switch
-    case SCALAR:
-      vecFieldString = "scalar";
-      break;
-    case VECTOR:
-      vecFieldString = "vector";
-      break;
-    case TENSOR:
-      vecFieldString = "tensor";
-      break;
-    case OTHER:
-      vecFieldString = "other";
-      break;
-    case MULTI_SCALAR:
-      vecFieldString = "multiple scalars";
-      break;
-    case MULTI_VECTOR:
-      vecFieldString = "multiple vectors";
-      break;
-    case MULTI_TENSOR:
-      vecFieldString = "multiple tensors";
-      break;
-    case MULTI_OTHER:
-      vecFieldString = "multiple other values";
-      break;
-    default :
-      std::cerr << "Unknown vector field value '" << _metadata.vectorFieldType
-		<< "'." << std::endl;
-      assert(0);
-      throw std::logic_error("Bad vector field type in MultiField.");
-    } // switch
+  if (_section.isNull())
+    std::cout << "Fields in collection of fields '" << _section->getName()
+	      << "':\n";
+  else
+    std::cout << "Fields in unknown collection of fields:\n";
 
-  std::cout << "Viewing field '" << _metadata.label << "' "<< label << ".\n"
-	    << "  vector field type: " << vecFieldString << "\n"
-	    << "  scale: " << _metadata.scale << "\n"
-	    << "  dimensionalize flag: " << _metadata.dimsOkay << std::endl;
-  if (!_section.isNull())
-    _section->view(label);
+  std::string vecFieldString = "";
+  const typename map_type::const_iterator fieldsEnd = _fields.end();
+  for (typename map_type::const_iterator f_iter = _fields.begin();
+       f_iter != fieldsEnd;
+       ++f_iter) {
+    std::cout << "  Field: " << f_iter->first
+	      << ", index: " << f_iter->second.fieldIndex;
+    
+    const FieldBase::Metadata& metadata = f_iter->second.metadata;
+    switch(metadata.vectorFieldType)
+      { // switch
+      case SCALAR:
+	vecFieldString = "scalar";
+	break;
+      case VECTOR:
+	vecFieldString = "vector";
+	break;
+      case TENSOR:
+	vecFieldString = "tensor";
+	break;
+      case OTHER:
+	vecFieldString = "other";
+	break;
+      case MULTI_SCALAR:
+	vecFieldString = "multiple scalars";
+	break;
+      case MULTI_VECTOR:
+	vecFieldString = "multiple vectors";
+	break;
+      case MULTI_TENSOR:
+	vecFieldString = "multiple tensors";
+	break;
+      case MULTI_OTHER:
+	vecFieldString = "multiple other values";
+	break;
+      default :
+	std::cerr << "Unknown vector field value '" 
+		  << metadata.vectorFieldType
+		  << "'." << std::endl;
+	assert(0);
+	throw std::logic_error("Bad vector field type in MultiField.");
+      } // switch
+
+    std::cout << ",  vector field type: " << vecFieldString
+	      << ", scale: " << metadata.scale
+	      << ", dimensionalize flag: " << metadata.dimsOkay
+	      << std::endl;
+  _section->view("Section");
 } // view
 
 // ----------------------------------------------------------------------
@@ -1112,6 +1093,7 @@
 void 
 pylith::topology::MultiField<mesh_type, section_type>::splitDefault(void)
 { // splitDefault
+#if 0
   assert(!_section.isNull());
   const int spaceDim = _mesh.dimension();
   for (int iDim=0; iDim < spaceDim; ++iDim)
@@ -1128,6 +1110,10 @@
       assert(spaceDim == _section->getFiberDimension(*c_iter));
       _section->setFiberDimension(*c_iter, 1, fibration);
     } // for
+#else
+  // :TODO: tell solver to split vector fields into pieces
+  throw std::logic_error("MultiField::splitDefault() needs updating.");
+#endif
 } // splitDefault
 
 // ----------------------------------------------------------------------

Modified: short/3D/PyLith/branches/multifields/libsrc/pylith/topology/MultiField.hh
===================================================================
--- short/3D/PyLith/branches/multifields/libsrc/pylith/topology/MultiField.hh	2011-05-22 23:26:34 UTC (rev 18425)
+++ short/3D/PyLith/branches/multifields/libsrc/pylith/topology/MultiField.hh	2011-05-22 23:27:26 UTC (rev 18426)
@@ -67,6 +67,7 @@
   typedef typename mesh_type::SieveMesh SieveMesh;
   typedef typename SieveMesh::label_sequence label_sequence;
   typedef typename section_type::chart_type chart_type;
+  typedef typename mesh_type::SieveMesh::point_type point_type;
 
 // PUBLIC MEMBERS ///////////////////////////////////////////////////////
 public :
@@ -77,137 +78,106 @@
    */
   MultiField(const mesh_type& mesh);
 
-  /** Constructor with mesh, section, and metadata.
-   *
-   * @param mesh Finite-element mesh.
-   */
-  MultiField(const mesh_type& mesh,
-	const ALE::Obj<section_type>& section,
-	const Metadata& metadata);
-
   /// Destructor.
   ~MultiField(void);
 
   /// Deallocate PETSc and local data structures.
   void deallocate(void);
   
-  /** Get Sieve section.
-   *
-   * @returns Sieve section.
-   */
-  const ALE::Obj<section_type>& section(void) const;
-
   /** Get mesh associated with field.
    *
    * @returns Finite-element mesh.
    */
   const mesh_type& mesh(void) const;
 
-  /** Set label for field.
+  /** Get Sieve section.
    *
-   * @param value Label for field.
+   * @returns Sieve section.
    */
-  void label(const char* value);
+  const ALE::Obj<section_type>& section(void) const;
 
-  /** Get label for field.
+  /** Set label of section.
    *
-   * @returns Label for field.
+   * @param value Label of section.
    */
-  const char* label(void) const;
+  void label(const char* value);
 
-  /** Set vector field type
+  /** Get the number of sieve points in the chart.
    *
-   * @param value Type of vector field.
+   * @returns the chart size.
    */
-  void vectorFieldType(const VectorFieldEnum value);
+  int chartSize(void) const;
 
-  /** Get vector field type
+  /** Get the number of degrees of freedom.
    *
-   * @returns Type of vector field.
+   * @returns the number of degrees of freedom.
    */
-  VectorFieldEnum vectorFieldType(void) const;
+  int sectionSize(void) const;
 
-  /** Set scale for dimensionalizing field.
+  /** Check if fields contains a given field.
    *
-   * @param value Scale associated with field.
+   * @param name Name of field.
+   * @return True if fields contains field, false otherwise.
    */
-  void scale(const double value);
+  bool hasField(const char* name) const;
 
-  /** Get scale for dimensionalizing field.
+  /** Add field.
    *
-   * @returns Scale associated with field.
+   * @param name Name of field.
+   * @param label Label for field.
+   * @param fiberDim Fiber dimension for field.
    */
-  double scale(void) const;
+  void add(const char* name,
+	   const char* label,
+	   FieldBase::VectorFieldEnum vectorFieldType =FieldBase::OTHER,
+	   const double scale =1.0,
+	   const bool dimsOkay =false);
 
-  /** Set flag indicating whether it is okay to dimensionalize field.
+  /** Get field.
    *
-   * @param value True if it is okay to dimensionalize field.
+   * @param name Name of field.
+   * @returns Field.
    */
-  void addDimensionOkay(const bool value);
-
-  /** Set flag indicating whether it is okay to dimensionalize field.
+  Field<mesh_type>& get(const char* name);
+	   
+  /** Get index of field in collection of fields.
    *
-   * @param value True if it is okay to dimensionalize field.
+   * @param name Name of field.
+   * @returns Index of field in collection of fields.
    */
-  bool addDimensionOkay(void) const;
+  int fieldIndex(const char* name) const;
 
-  /** Get spatial dimension of domain.
+  /** Get index of first value of field in field.
    *
-   * @returns Spatial dimension of domain.
+   * @param fieldIndex Index of field in collection.
+   * @param point Point in finite-element mesh.
+   * @returns Index of first value of field in section.
    */
-  int spaceDim(void) const;
+  int fieldStartIndex(const int fieldIndex,
+		      const point_type point) const;
 
-  /** Get the number of sieve points in the chart.
+  /** Get fiber dimension of field in section.
    *
-   * @returns the chart size.
+   * @param fieldIndex Index of field in collection.
+   * @param point Point in finite-element mesh.
+   * @returns Fiber dimension of field in section.
    */
-  int chartSize(void) const;
+  int fieldFiberDim(const int fieldIndex,
+		    const point_type point) const;
 
-  /** Get the number of degrees of freedom.
+  /** Compute total fiber dimension for section.
    *
-   * @returns the number of degrees of freedom.
+   * @param point Point in finite-element mesh.
+   * @returns Fiber dimension.
    */
-  int sectionSize(void) const;
+  int fiberDim(const point_type point) const;
 
-  /// Create sieve section.
-  void newSection(void);
+  /// Clear variables associated with section.
+  void clear(void);
 
-  /** Create sieve section and set chart and fiber dimesion for
-   * sequence of points.
-   *
-   * @param points Points over which to define section.
-   * @param dim Fiber dimension for section.
-   */
-  void newSection(const ALE::Obj<label_sequence>& points,
-		  const int fiberDim);
+  /// Allocate field.
+  void allocate(void);
 
-  /** Create sieve section and set chart and fiber dimesion for a list
-   * of points.
-   *
-   * @param points Points over which to define section.
-   * @param dim Fiber dimension for section.
-   */
-  void newSection(const int_array& points,
-		  const int fiberDim);
-
-  /** Create sieve section and set chart and fiber dimesion.
-   *
-   * @param domain Type of points over which to define section.
-   * @param dim Fiber dimension for section.
-   * @param stratum Stratum depth (for vertices) and height (for cells).
-   */
-  void newSection(const DomainEnum domain,
-		  const int fiberDim,
-		  const int stratum =0);
-
-  /** Create section using src field as template with given fiber dimension.
-   *
-   * @param sec MultiField defining layout.
-   * @param fiberDim Fiber dimension.
-   */
-  void newSection(const MultiField& src,
-		  const int fiberDim);
-
   /** Create section with same layout (fiber dimension and
    * constraints) as another section. This allows the layout data
    * structures to be reused across multiple fields, reducing memory
@@ -217,21 +187,15 @@
    */
   void cloneSection(const MultiField& src);
 
-  /// Clear variables associated with section.
-  void clear(void);
+  /// Complete section by assembling across processors.
+  void complete(void);
 
-  /// Allocate field.
-  void allocate(void);
-
   /// Zero section values (does not zero constrained values).
   void zero(void);
 
   /// Zero section values (including constrained values).
   void zeroAll(void);
 
-  /// Complete section by assembling across processors.
-  void complete(void);
-
   /** Copy field values and metadata.
    *
    * @param field MultiField to copy.
@@ -271,7 +235,6 @@
    */
   void createScatter(const char* context ="");
 
-
   /** Create PETSc vector scatter for field. This is used to transfer
    * information from the "global" PETSc vector view to the "local"
    * Sieve section view. The PETSc vector does not contain constrained
@@ -294,7 +257,6 @@
    */
   void createScatterWithBC(const char* context ="");
 
-
   /** Create PETSc vector scatter for field. This is used to transfer
    * information from the "global" PETSc vector view to the "local"
    * Sieve section view. The PETSc vector includes constrained
@@ -351,6 +313,12 @@
 // PRIVATE STRUCTS //////////////////////////////////////////////////////
 private :
 
+  struct FieldInfo {
+    FieldBase::Metadata metadata; ///< Metadata for field.
+    int fieldIndex;  ///< Index associated with field.
+    Field<mesh_type>* field; ///< Single field.
+  }; // FieldInfo
+
   /// Data structures used in scattering to/from PETSc Vecs.
   struct ScatterInfo {
     PetscVec vector; ///< PETSc vector associated with field.
@@ -361,6 +329,7 @@
 // PRIVATE TYPEDEFS /////////////////////////////////////////////////////
 private :
 
+  typedef std::map<std::string, FieldInfo> metadata_map_type;
   typedef std::map<std::string, ScatterInfo> scatter_map_type;
 
 
@@ -386,9 +355,9 @@
 // PRIVATE MEMBERS //////////////////////////////////////////////////////
 private :
 
-  Metadata _metadata;
   const mesh_type& _mesh; ///< Mesh associated with section.
   ALE::Obj<section_type> _section; ///< Real section with data.
+  metadata_map_type _fields; ///< Metadata for fields in section.
   scatter_map_type _scatters; ///< Collection of scatters.
 
 

Modified: short/3D/PyLith/branches/multifields/libsrc/pylith/topology/MultiField.icc
===================================================================
--- short/3D/PyLith/branches/multifields/libsrc/pylith/topology/MultiField.icc	2011-05-22 23:26:34 UTC (rev 18425)
+++ short/3D/PyLith/branches/multifields/libsrc/pylith/topology/MultiField.icc	2011-05-22 23:27:26 UTC (rev 18426)
@@ -22,14 +22,7 @@
 
 #include "pylith/utils/petscerror.h" // USES CHECK_PETSC_ERROR
 
-// Get Sieve section.
-template<typename mesh_type, typename section_type>
-inline
-const ALE::Obj<section_type>&
-pylith::topology::MultiField<mesh_type, section_type>::section(void) const {
-  return _section;
-}
-
+// ----------------------------------------------------------------------
 // Get mesh associated with field.
 template<typename mesh_type, typename section_type>
 inline
@@ -39,62 +32,27 @@
   return _mesh;
 }
 
-// Get label for field.
+// ----------------------------------------------------------------------
+// Get Sieve section.
 template<typename mesh_type, typename section_type>
 inline
-const char*
-pylith::topology::MultiField<mesh_type, section_type>::label(void) const {
-  return _metadata.label.c_str();
+const ALE::Obj<section_type>&
+pylith::topology::MultiField<mesh_type, section_type>::section(void) const {
+  return _section;
 }
 
-// Set vector field type
-template<typename mesh_type, typename section_type>
+// ----------------------------------------------------------------------
+// Check if fields contains a given field.
+template<typename mesh_type>
 inline
-void
-pylith::topology::MultiField<mesh_type, section_type>::vectorFieldType(const VectorFieldEnum value) {
-  _metadata.vectorFieldType = value;
-}
-
-// Get vector field type
-template<typename mesh_type, typename section_type>
-inline
-typename pylith::topology::MultiField<mesh_type, section_type>::VectorFieldEnum
-pylith::topology::MultiField<mesh_type, section_type>::vectorFieldType(void) const {
-  return _metadata.vectorFieldType;
-}
-
-// Set scale for dimensionalizing field.
-template<typename mesh_type, typename section_type>
-inline
-void
-pylith::topology::MultiField<mesh_type, section_type>::scale(const double value) {
-  _metadata.scale = value;
-}
-
-// Get scale for dimensionalizing field.
-template<typename mesh_type, typename section_type>
-inline
-double
-pylith::topology::MultiField<mesh_type, section_type>::scale(void) const {
-  return _metadata.scale;
-}
-
-// Set flag indicating whether it is okay to dimensionalize field.
-template<typename mesh_type, typename section_type>
-inline
-void
-pylith::topology::MultiField<mesh_type, section_type>::addDimensionOkay(const bool value) {
-  _metadata.dimsOkay = value;
-}
-
-// Set flag indicating whether it is okay to dimensionalize field.
-template<typename mesh_type, typename section_type>
-inline
 bool
-pylith::topology::MultiField<mesh_type, section_type>::addDimensionOkay(void) const {
-  return _metadata.dimsOkay;
-}
+pylith::topology::PackedFields<mesh_type>::hasField(const char* name) const
+{ // hasField
+  typename map_type::const_iterator iter = _fields.find(name);
+  return iter != _fields.end();
+} // hasField
 
+
 #endif
 
 

Modified: short/3D/PyLith/branches/multifields/unittests/libtests/topology/TestMultiFieldMesh.hh
===================================================================
--- short/3D/PyLith/branches/multifields/unittests/libtests/topology/TestMultiFieldMesh.hh	2011-05-22 23:26:34 UTC (rev 18425)
+++ short/3D/PyLith/branches/multifields/unittests/libtests/topology/TestMultiFieldMesh.hh	2011-05-22 23:27:26 UTC (rev 18426)
@@ -47,27 +47,35 @@
   CPPUNIT_TEST_SUITE( TestMultiFieldMesh );
 
   CPPUNIT_TEST( testConstructor );
+  CPPUNIT_TEST( testDeallocate );
+
   CPPUNIT_TEST( testMesh );
+  CPPUNIT_TEST( testSection );
   CPPUNIT_TEST( testLabel );
-  CPPUNIT_TEST( testVectorFieldType );
-  CPPUNIT_TEST( testScale );
-  CPPUNIT_TEST( testAddDimensionsOkay );
-  CPPUNIT_TEST( testSpaceDim );
-  CPPUNIT_TEST( testNewSection );
-  CPPUNIT_TEST( testNewSectionPoints );
-  CPPUNIT_TEST( testNewSectionPointsArray );
-  CPPUNIT_TEST( testNewSectionDomain );
-  CPPUNIT_TEST( testNewSectionField );
-  CPPUNIT_TEST( testCloneSection );
+  CPPUNIT_TEST( testChartSize );
+  CPPUNIT_TEST( testSectionSize );
+
+  CPPUNIT_TEST( testHasField );
+  CPPUNIT_TEST( testAdd );
+  CPPUNIT_TEST( testGet );
+
+  CPPUNIT_TEST( testFieldIndex );
+  CPPUNIT_TEST( testFieldStartIndex );
+  CPPUNIT_TEST( testFieldFiberDim );
+  CPPUNIT_TEST( testFiberDim );
+
   CPPUNIT_TEST( testClear );
   CPPUNIT_TEST( testAllocate );
+  CPPUNIT_TEST( testCloneSection );
+  CPPUNIT_TEST( testComplete );
+
   CPPUNIT_TEST( testZero );
   CPPUNIT_TEST( testZeroAll );
-  CPPUNIT_TEST( testComplete );
   CPPUNIT_TEST( testCopy );
   CPPUNIT_TEST( testOperatorAdd );
   CPPUNIT_TEST( testDimensionalize );
   CPPUNIT_TEST( testView );
+
   CPPUNIT_TEST( testCreateScatter );
   CPPUNIT_TEST( testCreateScatterWithBC );
   CPPUNIT_TEST( testVector );
@@ -84,60 +92,63 @@
   /// Test constructor.
   void testConstructor(void);
 
-  /// Test section().
-  void testSection(void);
+  /// Test deallocate().
+  void testDeallocate(void);
 
   /// Test mesh().
   void testMesh(void);
 
+  /// Test section().
+  void testSection(void);
+
   /// Test label().
   void testLabel(void);
 
-  /// Test vectorFieldType().
-  void testVectorFieldType(void);
+  /// Test chartSize().
+  void testChartSize(void);
 
-  /// Test scale().
-  void testScale(void);
+  /// Test sectionSize().
+  void testSectionSize(void);
 
-  /// Test addDimensionsOkay().
-  void testAddDimensionsOkay(void);
+  /// Test hasField().
+  void testHadField(void);
 
-  /// Test spaceDim().
-  void testSpaceDim(void);
+  /// Test add().
+  void testAdd(void);
 
-  /// Test newSection().
-  void testNewSection(void);
+  /// Test get().
+  void testGet(void);
 
-  /// Test newSection(points).
-  void testNewSectionPoints(void);
+  /// Test fieldIndex().
+  void testFieldIndex(void);
 
-  /// Test newSection(int_array).
-  void testNewSectionPointsArray(void);
+  /// Test fieldStartIndex().
+  void testFieldStartIndex(void);
 
-  /// Test newSection(domain).
-  void testNewSectionDomain(void);
+  /// Test fieldFiberDim().
+  void testFieldFiberDim(void);
 
-  /// Test newSection(field).
-  void testNewSectionField(void);
+  /// Test fiberDim().
+  void testFiberDim(void);
 
-  /// Test cloneSection().
-  void testCloneSection(void);
-
   /// Test clear().
   void testClear(void);
 
   /// Test allocate().
   void testAllocate(void);
 
+  /// Test cloneSection().
+  void testCloneSection(void);
+
+  /// Test complete().
+  void testComplete(void);
+
   /// Test zero().
   void testZero(void);
 
   /// Test zeroAll().
   void testZeroAll(void);
 
-  /// Test complete().
-  void testComplete(void);
-
   /// Test copy().
   void testCopy(void);
 

Modified: short/3D/PyLith/branches/multifields/unittests/libtests/topology/TestMultiFieldSubMesh.hh
===================================================================
--- short/3D/PyLith/branches/multifields/unittests/libtests/topology/TestMultiFieldSubMesh.hh	2011-05-22 23:26:34 UTC (rev 18425)
+++ short/3D/PyLith/branches/multifields/unittests/libtests/topology/TestMultiFieldSubMesh.hh	2011-05-22 23:27:26 UTC (rev 18426)
@@ -47,22 +47,22 @@
   CPPUNIT_TEST_SUITE( TestMultiFieldSubMesh );
 
   CPPUNIT_TEST( testConstructor );
-  CPPUNIT_TEST( testSection );
+  CPPUNIT_TEST( testDeallocate );
+
   CPPUNIT_TEST( testMesh );
-  CPPUNIT_TEST( testSpaceDim );
-  CPPUNIT_TEST( testNewSection );
-  CPPUNIT_TEST( testNewSectionPoints );
-  CPPUNIT_TEST( testNewSectionDomain );
-  CPPUNIT_TEST( testNewSectionField );
-  CPPUNIT_TEST( testCloneSection );
+  CPPUNIT_TEST( testSection );
+
   CPPUNIT_TEST( testClear );
   CPPUNIT_TEST( testAllocate );
-  CPPUNIT_TEST( testZero );
+  CPPUNIT_TEST( testCloneSection );
   CPPUNIT_TEST( testComplete );
+
+  CPPUNIT_TEST( testZero );
   CPPUNIT_TEST( testCopy );
   CPPUNIT_TEST( testOperatorAdd );
   CPPUNIT_TEST( testDimensionalize );
   CPPUNIT_TEST( testView );
+
   CPPUNIT_TEST( testCreateScatter );
   CPPUNIT_TEST( testCreateScatterWithBC );
   CPPUNIT_TEST( testVector );
@@ -77,42 +77,30 @@
   /// Test constructor.
   void testConstructor(void);
 
-  /// Test section().
-  void testSection(void);
+  /// Test deallocate().
+  void testDeallocate(void);
 
   /// Test mesh().
   void testMesh(void);
 
-  /// Test spaceDim().
-  void testSpaceDim(void);
+  /// Test section().
+  void testSection(void);
 
-  /// Test newSection().
-  void testNewSection(void);
-
-  /// Test newSection(points).
-  void testNewSectionPoints(void);
-
-  /// Test newSection(domain).
-  void testNewSectionDomain(void);
-
-  /// Test newSection(field).
-  void testNewSectionField(void);
-
-  /// Test cloneSection().
-  void testCloneSection(void);
-
   /// Test clear().
   void testClear(void);
 
   /// Test allocate().
   void testAllocate(void);
 
-  /// Test zero().
-  void testZero(void);
+  /// Test cloneSection().
+  void testCloneSection(void);
 
   /// Test complete().
   void testComplete(void);
 
+  /// Test zero().
+  void testZero(void);
+
   /// Test copy().
   void testCopy(void);
 



More information about the CIG-COMMITS mailing list