[cig-commits] r5085 - in short/3D/PyLith/trunk: . libsrc libsrc/feassemble libsrc/utils

brad at geodynamics.org brad at geodynamics.org
Tue Oct 24 21:58:35 PDT 2006


Author: brad
Date: 2006-10-24 21:58:34 -0700 (Tue, 24 Oct 2006)
New Revision: 5085

Added:
   short/3D/PyLith/trunk/libsrc/feassemble/Integrator.cc
   short/3D/PyLith/trunk/libsrc/feassemble/Integrator.hh
   short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity3D.hh
   short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity3D.icc
   short/3D/PyLith/trunk/libsrc/utils/
   short/3D/PyLith/trunk/libsrc/utils/Makefile.am
   short/3D/PyLith/trunk/libsrc/utils/petscfwd.h
Modified:
   short/3D/PyLith/trunk/configure.ac
   short/3D/PyLith/trunk/libsrc/Makefile.am
   short/3D/PyLith/trunk/libsrc/feassemble/Makefile.am
   short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1Din2D.hh
   short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1Din3D.hh
   short/3D/PyLith/trunk/libsrc/feassemble/Quadrature2D.hh
   short/3D/PyLith/trunk/libsrc/feassemble/Quadrature2Din3D.hh
   short/3D/PyLith/trunk/libsrc/feassemble/Quadrature3D.hh
Log:
Started implementing Integrator objects. Added petscfwd for forward declaration of Petsc objects.

Modified: short/3D/PyLith/trunk/configure.ac
===================================================================
--- short/3D/PyLith/trunk/configure.ac	2006-10-25 00:36:14 UTC (rev 5084)
+++ short/3D/PyLith/trunk/configure.ac	2006-10-25 04:58:34 UTC (rev 5085)
@@ -144,6 +144,7 @@
                 libsrc/Makefile
                 libsrc/feassemble/Makefile
                 libsrc/meshio/Makefile
+		libsrc/utils/Makefile
                 modulesrc/Makefile
                 modulesrc/feassemble/Makefile
                 modulesrc/meshio/Makefile

Modified: short/3D/PyLith/trunk/libsrc/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/libsrc/Makefile.am	2006-10-25 00:36:14 UTC (rev 5084)
+++ short/3D/PyLith/trunk/libsrc/Makefile.am	2006-10-25 04:58:34 UTC (rev 5085)
@@ -11,6 +11,7 @@
 #
 
 SUBDIRS = \
+	utils \
 	feassemble \
 	meshio
 

Added: short/3D/PyLith/trunk/libsrc/feassemble/Integrator.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Integrator.cc	2006-10-25 00:36:14 UTC (rev 5084)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Integrator.cc	2006-10-25 04:58:34 UTC (rev 5085)
@@ -0,0 +1,55 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#include <portinfo>
+
+#include "Integrator.hh" // implementation of class methods
+
+#include "Quadrature.hh" // USES Quadrature
+
+#include <assert.h> // USES assert()
+#include <stdexcept> // USES std::runtime_error
+#include <sstream> // USES std::ostringstream
+
+// ----------------------------------------------------------------------
+// Constructor
+pylith::feassemble::Integrator::Integrator(void) :
+  _quadrature(0)
+{ // constructor
+} // constructor
+
+// ----------------------------------------------------------------------
+// Destructor
+pylith::feassemble::Integrator::~Integrator(void)
+{ // destructor
+  delete _quadrature; _quadrature = 0;
+} // destructor
+  
+// ----------------------------------------------------------------------
+// Copy constructor
+pylith::feassemble::Integrator::Integrator(const Integrator& i) :
+  _quadrature(0)
+{ // copy constructor
+  if (0 != i._quadrature)
+    _quadrature = i._quadrature->clone();
+} // copy constructor
+
+// ----------------------------------------------------------------------
+// Set quadrature for integration.
+void
+pylith::feassemble::Integrator::quadrature(const Quadrature* q)
+{ // quadrature
+  delete _quadrature;
+  _quadrature = (0 != q) ? q->clone() : 0;
+} // quadrature
+
+// End of file 

Added: short/3D/PyLith/trunk/libsrc/feassemble/Integrator.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Integrator.hh	2006-10-25 00:36:14 UTC (rev 5084)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Integrator.hh	2006-10-25 04:58:34 UTC (rev 5085)
@@ -0,0 +1,106 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+/**
+ * @file pylith/feassemble/Integrator.hh
+ *
+ * @brief Abstract base class for integration of finite-element actions.
+ */
+
+#if !defined(pylith_feassemble_integrator_hh)
+#define pylith_feassemble_integrator_hh
+
+#include <Mesh.hh>
+#include "pylith/utils/petscfwd.h" // USES PetscMat
+
+namespace pylith {
+  namespace feassemble {
+    class Integrator;
+    class TestIntegrator;
+
+    class Quadrature; // HOLDSA Quadrature
+  } // feassemble
+} // pylith
+
+class pylith::feassemble::Integrator
+{ // Integrator
+  friend class TestIntegrator; // unit testing
+
+// PUBLIC MEMBERS ///////////////////////////////////////////////////////
+public :
+
+  /// Constructor
+  Integrator(void);
+
+  /// Destructor
+  virtual
+  ~Integrator(void);
+
+  /// Create a copy of this object.
+  virtual
+  Integrator* clone(void) const = 0;
+
+  /** Set quadrature for integration.
+   *
+   * @param q Quadrature object
+   */
+  void quadrature(const Quadrature* q);
+
+  /** Integrate elasticity term for 3-D finite elements.
+   *
+   * @param fieldOut Output field
+   * @param fieldIn Input field
+   * @param coordinates Field of cell vertex coordinates
+   */
+  virtual 
+  void integrateAction(const ALE::Obj<ALE::Mesh::real_section_type>& fieldOut,
+		       const ALE::Obj<ALE::Mesh::real_section_type>& fieldIn,
+		       const ALE::Obj<ALE::Mesh::real_section_type>& coordinates) = 0;
+
+  /** Compute tangent stiffness matrix.
+   *
+   * @param mat Sparse matrix
+   * @param fieldOut Output field
+   * @param fieldIn Input field
+   * @param coordinates Field of cell vertex coordinates
+   */
+  virtual 
+  void integrate(PetscMat* mat,
+		 const ALE::Obj<ALE::Mesh::real_section_type>& A,
+		 const ALE::Obj<ALE::Mesh::real_section_type>& F,
+		 const ALE::Obj<ALE::Mesh::real_section_type>& coordinates) = 0;
+
+// PROTECTED METHODS ////////////////////////////////////////////////////
+protected :
+
+  /** Copy constructor.
+   *
+   * @param i Integrator to copy
+   */
+  Integrator(const Integrator& i);
+
+// PRIVATE METHODS //////////////////////////////////////////////////////
+private :
+
+  /// Not implemented
+  const Integrator& operator=(const Integrator&);
+
+// PRIVATE MEMBERS //////////////////////////////////////////////////////
+private :
+
+  Quadrature* _quadrature; ///< Pointer to quadrature for integration
+
+}; // Integrator
+
+#endif // pylith_feassemble_integrator_hh
+
+// End of file 

Added: short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity3D.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity3D.hh	2006-10-25 00:36:14 UTC (rev 5084)
+++ short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity3D.hh	2006-10-25 04:58:34 UTC (rev 5085)
@@ -0,0 +1,85 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+/**
+ * @file pylith/feassemble/IntegratorElasticity3D.hh
+ *
+ * @brief Integrate elasticity term for 3-D finite elements.
+ */
+
+#if !defined(pylith_feassemble_integratorelasticity3d_hh)
+#define pylith_feassemble_integratorelasticity3d_hh
+
+#include "Integrator.hh"
+
+namespace pylith {
+  namespace feassemble {
+    class IntegratorElasticity3D;
+    class TestIntegratorElasticity3D;
+  } // feassemble
+} // pylith
+
+class pylith::feassemble::IntegratorElasticity3D : public Integrator
+{ // Integrator1D
+  friend class TestIntegratorElasticity3D; // unit testing
+
+// PUBLIC MEMBERS ///////////////////////////////////////////////////////
+public :
+
+  /// Constructor
+  IntegratorElasticity3D(void);
+
+  /// Destructor
+  ~IntegratorElasticity3D(void);
+
+  /// Create a copy of this object.
+  Integrator* clone(void) const;
+
+  /** Integrate elasticity term for 3-D finite elements.
+   *
+   * @param 
+   */
+  void integrateAction(const ALE::Mesh::Obj<section_type>& A,
+		       const ALE::Mesh::Obj<section_type>& F,
+		       const ALE::Mesh::Obj<section_type>& coordinates);
+
+  /** Compute tangent stiffness matrix.
+   *
+   * @param
+   */
+  void integrate(PetscMat& mat,
+		 const ALE::Mesh::Obj<section_type>& A,
+		 const ALE::Mesh::Obj<section_type>& F,
+		 const ALE::Mesh::Obj<section_type>& coordinates);
+
+// PROTECTED METHODS ////////////////////////////////////////////////////
+protected :
+
+  /** Copy constructor.
+   *
+   * @param i Integrator to copy
+   */
+  IntegratorElasticity3D(const IntegratorElasticity3D& i);
+
+// PRIVATE METHODS //////////////////////////////////////////////////////
+private :
+
+  /// Not implemented
+  const IntegratorElasticity3D& operator=(const IntegratorElasticity3D&);
+
+}; // IntegratorElasticity3D
+
+#include "IntegratorElasticity3D.icc" // inline methods
+
+#endif // pylith_feassemble_quadrature3d_hh
+
+// End of file 

Added: short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity3D.icc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity3D.icc	2006-10-25 00:36:14 UTC (rev 5084)
+++ short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity3D.icc	2006-10-25 04:58:34 UTC (rev 5085)
@@ -0,0 +1,26 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#if !defined(pylith_feassemble_integratorelasticity3d_hh)
+#error "IntegratorElasticity3D.icc must be included only from IntegratorElasticity3D.hh"
+#else
+
+// Create a copy of this object.
+inline
+pylith::feassemble::Integrator*
+pylith::feassemble::IntegratorElasticity3D::clone(void) const {
+  return new IntegratorElasticity3D(*this);
+} // clone
+
+#endif
+
+// End of file

Modified: short/3D/PyLith/trunk/libsrc/feassemble/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Makefile.am	2006-10-25 00:36:14 UTC (rev 5084)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Makefile.am	2006-10-25 04:58:34 UTC (rev 5085)
@@ -16,6 +16,7 @@
 lib_LTLIBRARIES = libpylithfeassemble.la
 
 libpylithfeassemble_la_SOURCES = \
+	Integrator.cc \
 	Quadrature.cc \
 	Quadrature1D.cc \
 	Quadrature1Din2D.cc \
@@ -25,6 +26,7 @@
 	Quadrature3D.cc
 
 subpkginclude_HEADERS = \
+	Integrator.hh \
 	Quadrature.hh \
 	Quadrature.icc \
 	Quadrature1D.hh \

Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1Din2D.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1Din2D.hh	2006-10-25 00:36:14 UTC (rev 5084)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1Din2D.hh	2006-10-25 04:58:34 UTC (rev 5085)
@@ -29,7 +29,7 @@
 } // pylith
 
 class pylith::feassemble::Quadrature1Din2D : public Quadrature
-{ // Quadrature1D
+{ // Quadrature1Din2D
   friend class TestQuadrature1Din2D; // unit testing
 
 // PUBLIC MEMBERS ///////////////////////////////////////////////////////

Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1Din3D.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1Din3D.hh	2006-10-25 00:36:14 UTC (rev 5084)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1Din3D.hh	2006-10-25 04:58:34 UTC (rev 5085)
@@ -29,7 +29,7 @@
 } // pylith
 
 class pylith::feassemble::Quadrature1Din3D : public Quadrature
-{ // Quadrature1D
+{ // Quadrature1Din3D
   friend class TestQuadrature1Din3D; // unit testing
 
 // PUBLIC MEMBERS ///////////////////////////////////////////////////////

Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature2D.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature2D.hh	2006-10-25 00:36:14 UTC (rev 5084)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature2D.hh	2006-10-25 04:58:34 UTC (rev 5085)
@@ -29,7 +29,7 @@
 } // pylith
 
 class pylith::feassemble::Quadrature2D : public Quadrature
-{ // Quadrature1D
+{ // Quadrature2D
   friend class TestQuadrature2D; // unit testing
 
 // PUBLIC MEMBERS ///////////////////////////////////////////////////////

Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature2Din3D.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature2Din3D.hh	2006-10-25 00:36:14 UTC (rev 5084)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature2Din3D.hh	2006-10-25 04:58:34 UTC (rev 5085)
@@ -29,7 +29,7 @@
 } // pylith
 
 class pylith::feassemble::Quadrature2Din3D : public Quadrature
-{ // Quadrature2D
+{ // Quadrature2Din3D
   friend class TestQuadrature2Din3D; // unit testing
 
 // PUBLIC MEMBERS ///////////////////////////////////////////////////////

Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature3D.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature3D.hh	2006-10-25 00:36:14 UTC (rev 5084)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature3D.hh	2006-10-25 04:58:34 UTC (rev 5085)
@@ -29,7 +29,7 @@
 } // pylith
 
 class pylith::feassemble::Quadrature3D : public Quadrature
-{ // Quadrature1D
+{ // Quadrature3D
   friend class TestQuadrature3D; // unit testing
 
 // PUBLIC MEMBERS ///////////////////////////////////////////////////////

Added: short/3D/PyLith/trunk/libsrc/utils/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/libsrc/utils/Makefile.am	2006-10-25 00:36:14 UTC (rev 5084)
+++ short/3D/PyLith/trunk/libsrc/utils/Makefile.am	2006-10-25 04:58:34 UTC (rev 5085)
@@ -0,0 +1,26 @@
+# -*- Makefile -*-
+#
+# ----------------------------------------------------------------------
+#
+#                           Brad T. Aagaard
+#                        U.S. Geological Survey
+#
+# <LicenseText>
+#
+# ----------------------------------------------------------------------
+#
+
+subpackage = utils
+include $(top_srcdir)/subpackage.am
+
+subpkginclude_HEADERS = \
+	petscfwd.h
+
+noinst_HEADERS = 
+
+# export
+clean-local: clean-subpkgincludeHEADERS
+BUILT_SOURCES = export-subpkgincludeHEADERS
+CLEANFILES = export-subpkgincludeHEADERS
+
+# End of file 

Added: short/3D/PyLith/trunk/libsrc/utils/petscfwd.h
===================================================================
--- short/3D/PyLith/trunk/libsrc/utils/petscfwd.h	2006-10-25 00:36:14 UTC (rev 5084)
+++ short/3D/PyLith/trunk/libsrc/utils/petscfwd.h	2006-10-25 04:58:34 UTC (rev 5085)
@@ -0,0 +1,38 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+/**
+ * @file pylith/utils/petscfwd.hh
+ *
+ * @brief Forward declarations for Petsc objects.
+ */
+
+#if !defined(pylith_feassemble_petscfwd_hh)
+#define pylith_feassemble_petscfwd_hh
+
+
+/// forward declaration for PETSc Mat
+typedef struct _p_Mat* PetscMat;
+
+/// forward declaration for PETSc Vec
+typedef struct _p_Vec* PetscVec;
+
+/// forward declaration for PETSc ISLocalToGlobalMapping
+typedef struct _p_ISLocalToGlobalMapping* PetscISLocalToGlobalMapping;
+
+/// forward declaration for PETSc PetscErrorCode
+typedef int PetscErrorCode;
+
+
+#endif
+
+// End of file



More information about the cig-commits mailing list