[cig-commits] r15149 - in short/3D/PyLith/trunk: . libsrc/bc libsrc/feassemble libsrc/materials modulesrc/feassemble modulesrc/materials pylith/perf

brad at geodynamics.org brad at geodynamics.org
Mon Jun 8 17:09:37 PDT 2009


Author: brad
Date: 2009-06-08 17:09:36 -0700 (Mon, 08 Jun 2009)
New Revision: 15149

Modified:
   short/3D/PyLith/trunk/README
   short/3D/PyLith/trunk/TODO
   short/3D/PyLith/trunk/libsrc/bc/BoundaryConditionPoints.cc
   short/3D/PyLith/trunk/libsrc/bc/BoundaryConditionPoints.hh
   short/3D/PyLith/trunk/libsrc/bc/DirichletBoundary.cc
   short/3D/PyLith/trunk/libsrc/bc/DirichletBoundary.hh
   short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.hh
   short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.icc
   short/3D/PyLith/trunk/libsrc/materials/Material.cc
   short/3D/PyLith/trunk/libsrc/materials/Material.hh
   short/3D/PyLith/trunk/modulesrc/feassemble/Quadrature.i
   short/3D/PyLith/trunk/modulesrc/materials/Material.i
   short/3D/PyLith/trunk/pylith/perf/MemoryLogger.py
Log:
Cleaned up a few field accessors (protect against dereferencing a NULL pointer).

Modified: short/3D/PyLith/trunk/README
===================================================================
--- short/3D/PyLith/trunk/README	2009-06-08 23:57:07 UTC (rev 15148)
+++ short/3D/PyLith/trunk/README	2009-06-09 00:09:36 UTC (rev 15149)
@@ -67,6 +67,10 @@
 (7) Nondimensionalization of the problem eliminates the need to
 condition the fault constraints. The "mat_db" facility was removed.
 
+(8) The Dirichlet and Neumann boundary conditions now follow a more
+general time dependence. The names of the facilities and the names of
+the values in the spatial databses are, in most cases, different.
+
 ======================================================================
 MIGRATING FROM VERSION 1.2 TO 1.3
 ======================================================================

Modified: short/3D/PyLith/trunk/TODO
===================================================================
--- short/3D/PyLith/trunk/TODO	2009-06-08 23:57:07 UTC (rev 15148)
+++ short/3D/PyLith/trunk/TODO	2009-06-09 00:09:36 UTC (rev 15149)
@@ -4,9 +4,27 @@
 
 Matt
   Memory model
+    C++ Objects with fields
+      DirichletBC (BoundarayConditionPoints::_parameters) ACCESSOR DONE
+      DirichletBoundary (_outputFields)
+      PointForce (BoundarayConditionPoints::_parameters) ACCESSOR DONE
+      AbsorbingDampers (_parameters)
+      Neumann (_parameters)
+      SlipTimeFn (_parameters)
+      FaultCohesiveKin (_fields)
+      Quadrature (_geometryFields) [should be NULL]
+      IntegratorElasticity (_outputFields)
+      ElasticMaterial (_initialFields, _properties, _stateVars)
+      OutputManager (_fields)
+      CellFilterAvg (_fieldAvg)
+      VertexFilterVecNorm (_fieldVecNorm)
+      
+      
   field split
 
 Brad
+  Update Neumann
+  ArbitratySlipFn
   field split (setup fields)
   symmetric matrix (use in examples, testing)
   full-scale testing
@@ -127,6 +145,9 @@
       Mesh::coneSize()
       Mesh::numVertices()
       Mesh::numCells()
+      TimeDependentPoints::parameterFields()
+      Material::propertiesField()
+      Material::stateVarsField()
 
       MeshOps::numMaterialCells()
 

Modified: short/3D/PyLith/trunk/libsrc/bc/BoundaryConditionPoints.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/bc/BoundaryConditionPoints.cc	2009-06-08 23:57:07 UTC (rev 15148)
+++ short/3D/PyLith/trunk/libsrc/bc/BoundaryConditionPoints.cc	2009-06-09 00:09:36 UTC (rev 15149)
@@ -38,6 +38,14 @@
 } // destructor
 
 // ----------------------------------------------------------------------
+// Get parameter fields.
+const pylith::topology::Fields<pylith::topology::Field<pylith::topology::Mesh> >*
+pylith::bc::BoundaryConditionPoints::parameterFields(void) const
+{ // parameterFields
+  return _parameters;
+} // paramegetFields
+
+// ----------------------------------------------------------------------
 // Get mesh labels for points associated with boundary condition.
 void
 pylith::bc::BoundaryConditionPoints::_getPoints(const topology::Mesh& mesh)

Modified: short/3D/PyLith/trunk/libsrc/bc/BoundaryConditionPoints.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/bc/BoundaryConditionPoints.hh	2009-06-08 23:57:07 UTC (rev 15148)
+++ short/3D/PyLith/trunk/libsrc/bc/BoundaryConditionPoints.hh	2009-06-09 00:09:36 UTC (rev 15149)
@@ -40,6 +40,13 @@
   /// Destructor.
   virtual
   ~BoundaryConditionPoints(void);
+  
+  /** Get parameter fields.
+   *
+   * @returns Parameter fields.
+   */
+  const topology::Fields<topology::Field<topology::Mesh> >*
+  parameterFields(void) const;
 
   // PROTECTED METHODS //////////////////////////////////////////////////
 protected :

Modified: short/3D/PyLith/trunk/libsrc/bc/DirichletBoundary.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/bc/DirichletBoundary.cc	2009-06-08 23:57:07 UTC (rev 15148)
+++ short/3D/PyLith/trunk/libsrc/bc/DirichletBoundary.cc	2009-06-09 00:09:36 UTC (rev 15149)
@@ -30,7 +30,7 @@
 // Default constructor.
 pylith::bc::DirichletBoundary::DirichletBoundary(void) :
   _boundaryMesh(0),
-  _fields(0)
+  _outputFields(0)
 { // constructor
 } // constructor
 
@@ -39,7 +39,7 @@
 pylith::bc::DirichletBoundary::~DirichletBoundary(void)
 { // destructor
   delete _boundaryMesh; _boundaryMesh = 0;
-  delete _fields; _fields = 0;
+  delete _outputFields; _outputFields = 0;
 } // destructor
 
 // ----------------------------------------------------------------------
@@ -84,7 +84,7 @@
   } // else
 
   // Satisfy return value (should never reach here)
-  return _fields->get("null");
+  return _outputFields->get("null");
 } // getVertexField
 
 // ----------------------------------------------------------------------
@@ -107,10 +107,10 @@
     throw std::runtime_error(msg.str());
   } // if
   
-  if (0 == _fields)
-    _fields = 
+  if (0 == _outputFields)
+    _outputFields = 
       new topology::Fields<topology::Field<topology::SubMesh> >(*_boundaryMesh);
-  assert(0 != _fields);
+  assert(0 != _outputFields);
   
   const ALE::Obj<SieveMesh>& sieveMesh = _boundaryMesh->sieveMesh();
   assert(!sieveMesh.isNull());
@@ -123,15 +123,15 @@
   const int numFixedDOF = _bcDOF.size();
 
   double_array bufferVertex(fiberDim);
-  if (!_fields->hasField("buffer (vector)")) {
-    _fields->add("buffer (vector)", "buffer");
+  if (!_outputFields->hasField("buffer (vector)")) {
+    _outputFields->add("buffer (vector)", "buffer");
     topology::Field<topology::SubMesh>& buffer =
-      _fields->get("buffer (vector)");  
+      _outputFields->get("buffer (vector)");  
     buffer.newSection(topology::FieldBase::VERTICES_FIELD, fiberDim);
     buffer.allocate();
   } // if
   topology::Field<topology::SubMesh>& buffer =
-    _fields->get("buffer (vector)");  
+    _outputFields->get("buffer (vector)");  
   buffer.label(label);
   buffer.scale(scale);
   buffer.vectorFieldType(topology::FieldBase::VECTOR);
@@ -180,10 +180,10 @@
     throw std::runtime_error(msg.str());
   } // if
   
-  if (0 == _fields)
-    _fields = 
+  if (0 == _outputFields)
+    _outputFields = 
       new topology::Fields<topology::Field<topology::SubMesh> >(*_boundaryMesh);
-  assert(0 != _fields);
+  assert(0 != _outputFields);
   
   const ALE::Obj<SieveMesh>& sieveMesh = _boundaryMesh->sieveMesh();
   assert(!sieveMesh.isNull());
@@ -191,15 +191,15 @@
   const int numPoints = _points.size();
   const int fiberDim = 1;
 
-  if (!_fields->hasField("buffer (scalar)")) {
-    _fields->add("buffer (scalar)", "buffer");
+  if (!_outputFields->hasField("buffer (scalar)")) {
+    _outputFields->add("buffer (scalar)", "buffer");
     topology::Field<topology::SubMesh>& buffer =
-      _fields->get("buffer (scalar)");  
+      _outputFields->get("buffer (scalar)");  
     buffer.newSection(topology::FieldBase::VERTICES_FIELD, fiberDim);
     buffer.allocate();
   } // if
   topology::Field<topology::SubMesh>& buffer =
-    _fields->get("buffer (scalar)");  
+    _outputFields->get("buffer (scalar)");  
   buffer.label(label);
   buffer.scale(scale);
   buffer.vectorFieldType(topology::FieldBase::SCALAR);

Modified: short/3D/PyLith/trunk/libsrc/bc/DirichletBoundary.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/bc/DirichletBoundary.hh	2009-06-08 23:57:07 UTC (rev 15148)
+++ short/3D/PyLith/trunk/libsrc/bc/DirichletBoundary.hh	2009-06-09 00:09:36 UTC (rev 15149)
@@ -96,7 +96,7 @@
   topology::SubMesh* _boundaryMesh; ///< Boundary mesh.
 
   /// Fields manager (holds temporary field for output).
-  topology::Fields<topology::Field<topology::SubMesh> >* _fields;
+  topology::Fields<topology::Field<topology::SubMesh> >* _outputFields;
 
   // NOT IMPLEMENTED ////////////////////////////////////////////////////
 private :

Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.hh	2009-06-08 23:57:07 UTC (rev 15148)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.hh	2009-06-09 00:09:36 UTC (rev 15149)
@@ -97,11 +97,11 @@
    */
   const double_array& jacobianDet(void) const;
 
-  /** Get precomputed determinants of Jacobian evaluated at quadrature points.
+  /** Get precomputed geometry fields.
    *
-   * @returns Array of determinants of Jacobian evaluated at quadrature pts
+   * @returns Geometry fields.
    */
-  const topology::Fields<topology::Field<mesh_type> >&
+  const topology::Fields<topology::Field<mesh_type> >*
   geometryFields(void) const;
 
   /** Compute geometric quantities for each cell.

Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.icc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.icc	2009-06-08 23:57:07 UTC (rev 15148)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.icc	2009-06-09 00:09:36 UTC (rev 15149)
@@ -72,10 +72,9 @@
 // Get precomputed geometry fields.
 template<typename mesh_type>
 inline
-const pylith::topology::Fields<pylith::topology::Field<mesh_type> >&
+const pylith::topology::Fields<pylith::topology::Field<mesh_type> >*
 pylith::feassemble::Quadrature<mesh_type>::geometryFields(void) const {
-  assert(0 != _geometryFields);
-  return *_geometryFields;
+  return _geometryFields;
 }
 
 // Precompute geometric quantities for each cell.

Modified: short/3D/PyLith/trunk/libsrc/materials/Material.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/Material.cc	2009-06-08 23:57:07 UTC (rev 15148)
+++ short/3D/PyLith/trunk/libsrc/materials/Material.cc	2009-06-09 00:09:36 UTC (rev 15149)
@@ -266,20 +266,20 @@
 } // initialize
 
 // ----------------------------------------------------------------------
-// Get properties
-const pylith::topology::Field<pylith::topology::Mesh>&
-pylith::materials::Material::getProperties() const
-{ // getProperties
-  return *_properties;
-} // getProperties
+// Get the properties field.
+const pylith::topology::Field<pylith::topology::Mesh>*
+pylith::materials::Material::propertiesField() const
+{ // propertiesField
+  return _properties;
+} // propertiesField
 
 // ----------------------------------------------------------------------
-// Get state variables
-const pylith::topology::Field<pylith::topology::Mesh>&
-pylith::materials::Material::getStateVars() const
-{ // getStateVars
-  return *_stateVars;
-} // getStateVars
+// Get the state variables field.
+const pylith::topology::Field<pylith::topology::Mesh>*
+pylith::materials::Material::stateVarsField() const
+{ // stateVarsField
+  return _stateVars;
+} // stateVarsField
 
 // ----------------------------------------------------------------------
 // Get physical property or state variable field.

Modified: short/3D/PyLith/trunk/libsrc/materials/Material.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/Material.hh	2009-06-08 23:57:07 UTC (rev 15148)
+++ short/3D/PyLith/trunk/libsrc/materials/Material.hh	2009-06-09 00:09:36 UTC (rev 15149)
@@ -155,17 +155,17 @@
    */
   void getField(topology::Field<topology::Mesh> *field, const char* name) const;
 
-  /** Get the properties.
+  /** Get the properties field.
    *
-   * @returns the properties
+   * @returns Properties field.
    */
-  const topology::Field<topology::Mesh>& getProperties() const;
+  const topology::Field<topology::Mesh>* propertiesField() const;
 
-  /** Get the state variables.
+  /** Get the state variables field.
    *
-   * @returns the state variables
+   * @returns State variables field.
    */
-  const topology::Field<topology::Mesh>& getStateVars() const;
+  const topology::Field<topology::Mesh>* stateVarsField() const;
 
   // PROTECTED METHODS //////////////////////////////////////////////////
 protected :

Modified: short/3D/PyLith/trunk/modulesrc/feassemble/Quadrature.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/feassemble/Quadrature.i	2009-06-08 23:57:07 UTC (rev 15148)
+++ short/3D/PyLith/trunk/modulesrc/feassemble/Quadrature.i	2009-06-09 00:09:36 UTC (rev 15149)
@@ -55,11 +55,11 @@
       /// Deallocate temporary storage.
       void clear(void);
 
-      /** Get precomputed coordinates of quadrature points
+      /** Get precomputed geometry fields.
        *
-       * @returns Array of coordinates of quadrature points in cell
+       * @returns Geometry fields.
        */
-      const pylith::topology::Fields<pylith::topology::Field<mesh_type> >& geometryFields(void) const;
+      const pylith::topology::Fields<pylith::topology::Field<mesh_type> >* geometryFields(void) const;
 
     }; // Quadrature
 

Modified: short/3D/PyLith/trunk/modulesrc/materials/Material.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/materials/Material.i	2009-06-08 23:57:07 UTC (rev 15148)
+++ short/3D/PyLith/trunk/modulesrc/materials/Material.i	2009-06-09 00:09:36 UTC (rev 15149)
@@ -124,18 +124,18 @@
        */
       void getField(pylith::topology::Field<pylith::topology::Mesh>* field,
 		    const char* name) const;
-
-      /** Get the properties.
+      
+      /** Get the properties field.
        *
-       * @returns the properties
+       * @returns Properties field.
        */
-      const pylith::topology::Field<pylith::topology::Mesh>& getProperties() const;
-
-      /** Get the state variables.
+      const pylith::topology::Field<pylith::topology::Mesh>* propertiesField() const;
+      
+      /** Get the state variables field.
        *
-       * @returns the state variables
+       * @returns State variables field.
        */
-      const pylith::topology::Field<pylith::topology::Mesh>& getStateVars() const;
+      const pylith::topology::Field<pylith::topology::Mesh>* stateVarsField() const;
 
       // PROTECTED METHODS //////////////////////////////////////////////
     protected :

Modified: short/3D/PyLith/trunk/pylith/perf/MemoryLogger.py
===================================================================
--- short/3D/PyLith/trunk/pylith/perf/MemoryLogger.py	2009-06-08 23:57:07 UTC (rev 15148)
+++ short/3D/PyLith/trunk/pylith/perf/MemoryLogger.py	2009-06-09 00:09:36 UTC (rev 15149)
@@ -92,8 +92,8 @@
     materialModel = pylith.perf.Material.Material(material.label(), material.ncells)
     materialModel.tabulate(self.memory[stage])
     print 'Material:',material.label()
-    self.logField(stage, material.getProperties())
-    self.logField(stage, material.getStateVars())
+    self.logField(stage, material.propertiesField())
+    self.logField(stage, material.stateVarsField())
     if self.verbose: self.show()
     return
 



More information about the CIG-COMMITS mailing list