[cig-commits] r6202 - in short/3D/PyLith/trunk/playpen: . cohesive
cohesive/src cohesive/tests
knepley at geodynamics.org
knepley at geodynamics.org
Thu Mar 8 12:48:43 PST 2007
Author: knepley
Date: 2007-03-08 12:48:42 -0800 (Thu, 08 Mar 2007)
New Revision: 6202
Added:
short/3D/PyLith/trunk/playpen/cohesive/
short/3D/PyLith/trunk/playpen/cohesive/Makefile.am
short/3D/PyLith/trunk/playpen/cohesive/configure.ac
short/3D/PyLith/trunk/playpen/cohesive/src/
short/3D/PyLith/trunk/playpen/cohesive/src/Makefile.am
short/3D/PyLith/trunk/playpen/cohesive/src/testcohesive.cc
short/3D/PyLith/trunk/playpen/cohesive/tests/
short/3D/PyLith/trunk/playpen/cohesive/tests/tractest.mesh
Log:
Added cohesive element test
Added: short/3D/PyLith/trunk/playpen/cohesive/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/playpen/cohesive/Makefile.am 2007-03-08 20:36:54 UTC (rev 6201)
+++ short/3D/PyLith/trunk/playpen/cohesive/Makefile.am 2007-03-08 20:48:42 UTC (rev 6202)
@@ -0,0 +1,11 @@
+# -*- Makefile -*-
+#
+
+ACLOCAL_AMFLAGS = -I ./m4
+
+SUBDIRS = src
+
+# version
+# $Id$
+
+# End of file
Added: short/3D/PyLith/trunk/playpen/cohesive/configure.ac
===================================================================
--- short/3D/PyLith/trunk/playpen/cohesive/configure.ac 2007-03-08 20:36:54 UTC (rev 6201)
+++ short/3D/PyLith/trunk/playpen/cohesive/configure.ac 2007-03-08 20:48:42 UTC (rev 6202)
@@ -0,0 +1,36 @@
+# -*- autoconf -*-
+# 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/cohesive/src/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/playpen/cohesive/src/Makefile.am 2007-03-08 20:36:54 UTC (rev 6201)
+++ short/3D/PyLith/trunk/playpen/cohesive/src/Makefile.am 2007-03-08 20:48:42 UTC (rev 6202)
@@ -0,0 +1,21 @@
+# -*- Makefile -*-
+#
+CIG_INCLUDE = -I/PETSc3/cig/pylith3d/include
+CIG_LIB = -L/PETSc3/cig/pylith3d/lib -lpylith
+
+bin_PROGRAMS = testcohesive
+
+testcohesive_SOURCES = \
+ testcohesive.cc
+
+#noinst_HEADERS = \
+# elemVector.hh
+
+testcohesive_LDADD = $(CIG_LIB) $(PETSC_LIB)
+
+INCLUDES = $(CIG_INCLUDE) $(PETSC_INCLUDE)
+
+# version
+# $Id$
+
+# End of file
Added: short/3D/PyLith/trunk/playpen/cohesive/src/testcohesive.cc
===================================================================
--- short/3D/PyLith/trunk/playpen/cohesive/src/testcohesive.cc 2007-03-08 20:36:54 UTC (rev 6201)
+++ short/3D/PyLith/trunk/playpen/cohesive/src/testcohesive.cc 2007-03-08 20:48:42 UTC (rev 6202)
@@ -0,0 +1,53 @@
+// -*- C++ -*-
+#include "pylith/meshio/MeshIOAscii.hh"
+#include <iostream> // USES std::cerr
+
+#include "src/dm/mesh/meshpylith.h"
+
+int
+main(int argc,
+ char** argv)
+{ // main
+ PetscErrorCode err;
+
+ PetscInitialize(&argc, &argv, 0, 0);
+
+ if (argc < 2) {
+ std::cerr << "usage: testcohesive MESHIN [options]" << std::endl;
+ return -1;
+ } // if
+
+ try {
+ ALE::Obj<ALE::Mesh> mesh;
+
+ pylith::meshio::MeshIOAscii iohandler;
+ iohandler.filename(argv[1]);
+ iohandler.read(&mesh);
+
+ const ALE::Mesh::topology_type::patch_type patch = 0;
+ const ALE::Obj<ALE::Mesh::real_section_type>& coords = mesh->getRealSection("coordinates");
+
+ mesh->view("Original Mesh");
+ // For the tractest mesh, we will split a face on the midplane
+ // Elem 2: 17-22-19-(18) Elem 23: 22-19-(25)-17
+ std::set<ALE::Mesh::point_type> faultVertices;
+
+ faultVertices.insert(17+41-1);
+ faultVertices.insert(19+41-1);
+ faultVertices.insert(22+41-1);
+ ALE::PyLith::Builder::createCohesiveElements(mesh, faultVertices);
+ mesh->view("New Mesh with Cohesive Elements");
+ } 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
Added: short/3D/PyLith/trunk/playpen/cohesive/tests/tractest.mesh
===================================================================
--- short/3D/PyLith/trunk/playpen/cohesive/tests/tractest.mesh 2007-03-08 20:36:54 UTC (rev 6201)
+++ short/3D/PyLith/trunk/playpen/cohesive/tests/tractest.mesh 2007-03-08 20:48:42 UTC (rev 6202)
@@ -0,0 +1,125 @@
+mesh = {
+ dimension = 3
+ use-index-zero = 0
+ vertices = {
+ dimension = 3
+ count = 25
+ coordinates = {
+ 5.00000000E+02 0.00000000E+00 0.00000000E+00
+ 1.00000000E+03 0.00000000E+00 0.00000000E+00
+ 0.00000000E+00 1.00000000E+03 1.00000000E+03
+ 0.00000000E+00 5.00000000E+02 1.00000000E+03
+ 0.00000000E+00 0.00000000E+00 1.00000000E+03
+ 0.00000000E+00 0.00000000E+00 5.00000000E+02
+ 0.00000000E+00 0.00000000E+00 0.00000000E+00
+ 5.00000000E+02 0.00000000E+00 1.00000000E+03
+ 0.00000000E+00 1.00000000E+03 0.00000000E+00
+ 0.00000000E+00 5.00000000E+02 0.00000000E+00
+ 5.00000000E+02 1.00000000E+03 1.00000000E+03
+ 0.00000000E+00 1.00000000E+03 5.00000000E+02
+ 5.00000000E+02 1.00000000E+03 0.00000000E+00
+ 1.00000000E+03 1.00000000E+03 1.00000000E+03
+ 1.00000000E+03 5.00000000E+02 1.00000000E+03
+ 1.00000000E+03 0.00000000E+00 1.00000000E+03
+ 5.00000000E+02 1.00000000E+03 5.00000000E+02
+ 1.00000000E+03 0.00000000E+00 5.00000000E+02
+ 5.00000000E+02 0.00000000E+00 5.00000000E+02
+ 1.00000000E+03 1.00000000E+03 0.00000000E+00
+ 1.00000000E+03 5.00000000E+02 0.00000000E+00
+ 5.00000000E+02 5.00000000E+02 1.00000000E+03
+ 1.00000000E+03 1.00000000E+03 5.00000000E+02
+ 5.00000000E+02 5.00000000E+02 0.00000000E+00
+ 2.50275000E+02 3.73858000E+02 5.00000000E+02
+ }
+ }
+ cells = {
+ num-corners = 4
+ count = 41
+ simplices = {
+ 19 22 8 18
+ 17 22 19 18
+ 18 19 24 2
+ 18 2 24 21
+ 13 21 17 24
+ 23 14 17 15
+ 23 15 17 18
+ 18 21 24 17
+ 23 17 21 18
+ 21 13 17 23
+ 17 24 25 10
+ 11 22 17 14
+ 21 13 23 20
+ 17 22 15 14
+ 18 22 8 15
+ 2 1 19 24
+ 7 24 25 19
+ 15 16 8 18
+ 18 17 24 19
+ 17 4 10 25
+ 15 22 17 18
+ 6 22 4 5
+ 22 19 25 17
+ 6 25 22 19
+ 17 11 4 22
+ 4 17 10 12
+ 17 22 4 25
+ 12 17 10 9
+ 7 19 25 6
+ 8 22 19 6
+ 25 6 4 10
+ 8 22 6 5
+ 25 6 22 4
+ 7 6 25 10
+ 24 1 19 7
+ 17 12 4 11
+ 17 13 10 9
+ 10 13 17 24
+ 12 3 4 11
+ 7 10 25 24
+ 17 19 25 24
+ }
+ material-ids = {
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 2
+ 1
+ 1
+ 1
+ 1
+ 1
+ 2
+ 1
+ 1
+ 2
+ 1
+ 2
+ 2
+ 2
+ 2
+ 2
+ 2
+ 2
+ 2
+ 2
+ 2
+ 2
+ 2
+ 2
+ 2
+ 2
+ 2
+ 2
+ 2
+ 2
+ 2
+ }
+ }
+}
More information about the cig-commits
mailing list