[cig-commits] r4537 - in short/3D/PyLith/trunk/playpen: . integrate
integrate/src meshio/src
knepley at geodynamics.org
knepley at geodynamics.org
Thu Sep 14 15:13:11 PDT 2006
Author: knepley
Date: 2006-09-14 15:13:11 -0700 (Thu, 14 Sep 2006)
New Revision: 4537
Added:
short/3D/PyLith/trunk/playpen/integrate/
short/3D/PyLith/trunk/playpen/integrate/Makefile.am
short/3D/PyLith/trunk/playpen/integrate/configure.ac
short/3D/PyLith/trunk/playpen/integrate/src/
short/3D/PyLith/trunk/playpen/integrate/src/Makefile.am
short/3D/PyLith/trunk/playpen/integrate/src/testintegrate.cc
Modified:
short/3D/PyLith/trunk/playpen/meshio/src/MeshIO.hh
short/3D/PyLith/trunk/playpen/meshio/src/MeshIOAscii.cc
short/3D/PyLith/trunk/playpen/meshio/src/MeshIOAscii.hh
Log:
Added an integration play test
Some fixes to MeshIO
Added: short/3D/PyLith/trunk/playpen/integrate/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/playpen/integrate/Makefile.am 2006-09-14 21:27:54 UTC (rev 4536)
+++ short/3D/PyLith/trunk/playpen/integrate/Makefile.am 2006-09-14 22:13:11 UTC (rev 4537)
@@ -0,0 +1,20 @@
+# -*- Makefile -*-
+#
+# ----------------------------------------------------------------------
+#
+# Brad T. Aagaard
+# U.S. Geological Survey
+#
+# <LicenseText>
+#
+# ----------------------------------------------------------------------
+#
+
+ACLOCAL_AMFLAGS = -I ./m4
+
+SUBDIRS = src
+
+# version
+# $Id$
+
+# End of file
Added: short/3D/PyLith/trunk/playpen/integrate/configure.ac
===================================================================
--- short/3D/PyLith/trunk/playpen/integrate/configure.ac 2006-09-14 21:27:54 UTC (rev 4536)
+++ short/3D/PyLith/trunk/playpen/integrate/configure.ac 2006-09-14 22:13:11 UTC (rev 4537)
@@ -0,0 +1,45 @@
+# -*- autoconf -*-
+#
+# ----------------------------------------------------------------------
+#
+# Brad T. Aagaard
+# U.S. Geological Survey
+#
+# <LicenseText>
+#
+# ----------------------------------------------------------------------
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ(2.59)
+AC_INIT([testsieve], [0.0], [])
+AC_CONFIG_AUX_DIR([./aux-config])
+AC_CONFIG_HEADER([portinfo])
+AC_CONFIG_MACRO_DIR([m4])
+AM_INIT_AUTOMAKE([foreign])
+
+# ----------------------------------------------------------------------
+# C/C++/libtool/install
+AC_PROG_CXX
+AC_PROG_LIBTOOL
+AC_PROG_INSTALL
+
+# PYTHON
+#AM_PATH_PYTHON([2.3])
+#CIT_PYTHON_SYSCONFIG
+
+# MPI
+AC_LANG(C++)
+#CIT_HEADER_MPI
+#CIT_CHECK_LIB_MPI
+
+# PETSC
+CIT_PATH_PETSC([2.3])
+CIT_HEADER_PETSC
+CIT_CHECK_LIB_PETSC
+
+# ----------------------------------------------------------------------
+AC_CONFIG_FILES([Makefile
+ src/Makefile])
+AC_OUTPUT
+
+dnl end of configure.ac
Added: short/3D/PyLith/trunk/playpen/integrate/src/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/playpen/integrate/src/Makefile.am 2006-09-14 21:27:54 UTC (rev 4536)
+++ short/3D/PyLith/trunk/playpen/integrate/src/Makefile.am 2006-09-14 22:13:11 UTC (rev 4537)
@@ -0,0 +1,31 @@
+# -*- Makefile -*-
+#
+# ----------------------------------------------------------------------
+#
+# Brad T. Aagaard
+# U.S. Geological Survey
+#
+# <LicenseText>
+#
+# ----------------------------------------------------------------------
+#
+MESHIO_INCLUDE = -I../../meshio/src
+MESHIO_LIB = ../../meshio/src/MeshIO.o ../../meshio/src/MeshIOAscii.o
+
+bin_PROGRAMS = testintegrate
+
+testintegrate_SOURCES = \
+ elemVector.cc \
+ testintegrate.cc
+
+noinst_HEADERS = \
+ elemVector.hh
+
+testintegrate_LDADD = $(MESHIO_LIB) $(PETSC_LIB)
+
+INCLUDES = $(PETSC_INCLUDE) $(MESHIO_INCLUDE)
+
+# version
+# $Id$
+
+# End of file
Added: short/3D/PyLith/trunk/playpen/integrate/src/testintegrate.cc
===================================================================
--- short/3D/PyLith/trunk/playpen/integrate/src/testintegrate.cc 2006-09-14 21:27:54 UTC (rev 4536)
+++ short/3D/PyLith/trunk/playpen/integrate/src/testintegrate.cc 2006-09-14 22:13:11 UTC (rev 4537)
@@ -0,0 +1,68 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#include "MeshIOAscii.hh"
+#include "elemVector.hh"
+#include <iostream> // USES std::cerr
+
+#include "Integration.hh"
+
+// ----------------------------------------------------------------------
+ALE::Mesh::section_type::value_type f(ALE::Mesh::section_type::value_type coords[])
+{
+ return 1.0;
+}
+
+int
+main(int argc,
+ char** argv)
+{ // main
+ PetscErrorCode err;
+
+ PetscInitialize(&argc, &argv, 0, 0);
+
+ if (argc < 2) {
+ std::cerr << "usage: testintegrate MESHIN [options]" << std::endl;
+ return -1;
+ } // if
+
+ try {
+ ALE::Obj<ALE::Mesh> mesh;
+
+ pylith::meshIO::MeshIOAscii iohandler;
+ iohandler.filename(argv[1]);
+ iohandler.read(mesh, false);
+
+ const ALE::Mesh::topology_type::patch_type patch = 0;
+ const Obj<ALE::Mesh::section_type>& field = mesh->getSection("field");
+ pylith::feassemble::Integrator integrator(mesh->getDimension(),
+ NUM_QUADRATURE_POINTS, points, weights,
+ NUM_BASIS_FUNCTIONS, Basis);
+
+ field->setFiberDimensionByDepth(patch, 0, 1);
+ field->allocate();
+ integrator.integrateFunction(field, mesh->getSection("coordinates"), f);
+ field->view("Weak form of f");
+ } catch(ALE::Exception e) {
+ int rank;
+ MPI_Comm_rank(PETSC_COMM_WORLD, &rank);
+ std::cout <<"["<<rank<<"]: " << e << std::endl;
+ }
+ err = PetscFinalize(); CHKERRQ(err);
+
+ return err;
+} // main
+
+// version
+// $Id$
+
+// End of file
Modified: short/3D/PyLith/trunk/playpen/meshio/src/MeshIO.hh
===================================================================
--- short/3D/PyLith/trunk/playpen/meshio/src/MeshIO.hh 2006-09-14 21:27:54 UTC (rev 4536)
+++ short/3D/PyLith/trunk/playpen/meshio/src/MeshIO.hh 2006-09-14 22:13:11 UTC (rev 4537)
@@ -37,7 +37,7 @@
*
* @param pMesh Pointer to PETSc mesh object
*/
- virtual void read(ALE::Obj<ALE::Mesh>& pMesh) = 0;
+ virtual void read(ALE::Obj<ALE::Mesh>& pMesh, const bool interpolate) = 0;
/** Write mesh to file.
*
Modified: short/3D/PyLith/trunk/playpen/meshio/src/MeshIOAscii.cc
===================================================================
--- short/3D/PyLith/trunk/playpen/meshio/src/MeshIOAscii.cc 2006-09-14 21:27:54 UTC (rev 4536)
+++ short/3D/PyLith/trunk/playpen/meshio/src/MeshIOAscii.cc 2006-09-14 22:13:11 UTC (rev 4537)
@@ -35,7 +35,7 @@
// ----------------------------------------------------------------------
// Unpickle mesh
void
-pylith::meshIO::MeshIOAscii::read(Obj<Mesh>& mesh)
+pylith::meshIO::MeshIOAscii::read(Obj<Mesh>& mesh, const bool interpolate)
{ // read
int meshDim = 0;
int numDims = 0;
@@ -106,7 +106,6 @@
// Can now build topology
mesh = Mesh(PETSC_COMM_WORLD, meshDim);
mesh->debug = true;
- bool interpolate = false;
// allow mesh to have different dimension than coordinates
Obj<sieve_type> sieve = new sieve_type(mesh->comm(), mesh->debug);
Modified: short/3D/PyLith/trunk/playpen/meshio/src/MeshIOAscii.hh
===================================================================
--- short/3D/PyLith/trunk/playpen/meshio/src/MeshIOAscii.hh 2006-09-14 21:27:54 UTC (rev 4536)
+++ short/3D/PyLith/trunk/playpen/meshio/src/MeshIOAscii.hh 2006-09-14 22:13:11 UTC (rev 4537)
@@ -57,7 +57,7 @@
*
* @param pMesh Pointer to PETSc mesh object
*/
- void read(Obj<Mesh>& mesh);
+ void read(Obj<Mesh>& mesh, const bool interpolate = false);
/** Write mesh to file.
*
More information about the cig-commits
mailing list