[cig-commits] r17275 - in short/3D/PyLith/trunk: . libsrc/topology unittests/libtests/topology unittests/libtests/topology/data
brad at geodynamics.org
brad at geodynamics.org
Thu Oct 14 15:39:34 PDT 2010
Author: brad
Date: 2010-10-14 15:39:34 -0700 (Thu, 14 Oct 2010)
New Revision: 17275
Added:
short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level2.cc
short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level2.hh
short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level2Fault1.cc
short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level2Fault1.hh
short/3D/PyLith/trunk/unittests/libtests/topology/data/fourquad4.mesh
Modified:
short/3D/PyLith/trunk/TODO
short/3D/PyLith/trunk/libsrc/topology/CellRefinerQuad4.cc
short/3D/PyLith/trunk/libsrc/topology/Field.cc
short/3D/PyLith/trunk/libsrc/topology/RefineEdges2.cc
short/3D/PyLith/trunk/libsrc/topology/RefineFace4Edges2.cc
short/3D/PyLith/trunk/libsrc/topology/RefineFace4Edges2.hh
short/3D/PyLith/trunk/libsrc/topology/RefineUniform.cc
short/3D/PyLith/trunk/unittests/libtests/topology/Makefile.am
short/3D/PyLith/trunk/unittests/libtests/topology/TestRefineUniform.cc
short/3D/PyLith/trunk/unittests/libtests/topology/TestRefineUniform.hh
short/3D/PyLith/trunk/unittests/libtests/topology/data/Makefile.am
short/3D/PyLith/trunk/unittests/libtests/topology/data/fourtri3.mesh
Log:
Serial implementation of global uniform refinement for quad4 cells.
Modified: short/3D/PyLith/trunk/TODO
===================================================================
--- short/3D/PyLith/trunk/TODO 2010-10-14 21:04:13 UTC (rev 17274)
+++ short/3D/PyLith/trunk/TODO 2010-10-14 22:39:34 UTC (rev 17275)
@@ -5,7 +5,7 @@
* Unform global refinement
tri3 and tet4, level 2 work in serial, sometimes crash in parallel
- quad4, level 2
+ quad4, level 2 (add face vertices for overlap)
hex8, level 2
tet4, level 4
tri3, level 4
Modified: short/3D/PyLith/trunk/libsrc/topology/CellRefinerQuad4.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/topology/CellRefinerQuad4.cc 2010-10-14 21:04:13 UTC (rev 17274)
+++ short/3D/PyLith/trunk/libsrc/topology/CellRefinerQuad4.cc 2010-10-14 22:39:34 UTC (rev 17275)
@@ -361,7 +361,7 @@
// new cell 3
quadCells[3*4+0] = cone[2] + coneVertexOffset;
- quadCells[3*4+1] = newVertices[3];
+ quadCells[3*4+1] = newVertices[2];
quadCells[3*4+2] = newVertices[4];
quadCells[3*4+3] = newVertices[1];
Modified: short/3D/PyLith/trunk/libsrc/topology/Field.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/topology/Field.cc 2010-10-14 21:04:13 UTC (rev 17274)
+++ short/3D/PyLith/trunk/libsrc/topology/Field.cc 2010-10-14 22:39:34 UTC (rev 17275)
@@ -700,6 +700,7 @@
CHECK_PETSC_ERROR(err);
} // if
assert(_section->sizeWithBC() > 0);
+ assert(_section->restrictSpace());
err = VecCreateSeqWithArray(PETSC_COMM_SELF,
_section->sizeWithBC(), _section->restrictSpace(),
&_scatterVec); CHECK_PETSC_ERROR(err);
Modified: short/3D/PyLith/trunk/libsrc/topology/RefineEdges2.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/topology/RefineEdges2.cc 2010-10-14 21:04:13 UTC (rev 17274)
+++ short/3D/PyLith/trunk/libsrc/topology/RefineEdges2.cc 2010-10-14 22:39:34 UTC (rev 17275)
@@ -106,14 +106,11 @@
const edge_map_type::const_iterator edgesEnd = _edgeToVertex.end();
for (edge_map_type::const_iterator e_iter = _edgeToVertex.begin(); e_iter != edgesEnd; ++e_iter) {
const point_type newVertex = e_iter->second;
- const point_type edgeVertexA = e_iter->first.first;
- const point_type edgeVertexB = e_iter->first.second;
+ const point_type edgeVertex = e_iter->first.first;
- if (oldGroup->getFiberDimension(edgeVertexA) && oldGroup->getFiberDimension(edgeVertexB)) {
- if (oldGroup->restrictPoint(edgeVertexA)[0] == oldGroup->restrictPoint(edgeVertexB)[0]) {
- newGroup->updatePoint(newVertex, oldGroup->restrictPoint(edgeVertexA));
- std::cout << "Adding new vertex: " << newVertex << " based on old vertices " << edgeVertexA << " and " << edgeVertexB << std::endl;
- } // if
+ if (1 == newGroup->getFiberDimension(newVertex)) {
+ newGroup->updatePoint(newVertex, oldGroup->restrictPoint(edgeVertex));
+ std::cout << "Adding new vertex: " << newVertex << " based on edge " << e_iter->first << std::endl;
} // if
} // for
} // groupSetNewVertices
Modified: short/3D/PyLith/trunk/libsrc/topology/RefineFace4Edges2.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/topology/RefineFace4Edges2.cc 2010-10-14 21:04:13 UTC (rev 17274)
+++ short/3D/PyLith/trunk/libsrc/topology/RefineFace4Edges2.cc 2010-10-14 22:39:34 UTC (rev 17275)
@@ -69,6 +69,24 @@
newCoordsSection->updatePoint(newVertex, coordinatesVertex);
} // for
+
+ const face_map_type::const_iterator facesEnd = _faceToVertex.end();
+ for (face_map_type::const_iterator f_iter = _faceToVertex.begin(); f_iter != facesEnd; ++f_iter) {
+ const point_type newVertex = f_iter->second;
+
+ assert(spaceDim == newCoordsSection->getFiberDimension(newVertex));
+ for (int iDim=0; iDim < spaceDim; ++iDim)
+ coordinatesVertex[iDim] = 0.0;
+ for (int iVertex=0; iVertex < 4; ++iVertex) {
+ const point_type faceVertex = f_iter->first.points[iVertex];
+ assert(spaceDim == oldCoordsSection->getFiberDimension(faceVertex));
+
+ const mesh_type::real_section_type::value_type* coords = oldCoordsSection->restrictPoint(faceVertex);
+ for (int iDim=0; iDim < spaceDim; ++iDim)
+ coordinatesVertex[iDim] += 0.25*coords[iDim];
+ } // for
+ newCoordsSection->updatePoint(newVertex, coordinatesVertex);
+ } // for
} // setCoordsNewVertices
// ----------------------------------------------------------------------
@@ -92,6 +110,23 @@
} // if
} // if
} // for
+
+ const face_map_type::const_iterator facesEnd = _faceToVertex.end();
+ for (face_map_type::const_iterator f_iter = _faceToVertex.begin(); f_iter != facesEnd; ++f_iter) {
+ const point_type newVertex = f_iter->second;
+
+ bool hasFace = true;
+ for (int iVertex=0; iVertex < 4; ++iVertex) {
+ const point_type faceVertex = f_iter->first.points[iVertex];
+ if (!oldGroup->getFiberDimension(faceVertex)) {
+ hasFace = false;
+ break;
+ } // if
+ } // for
+ if (hasFace) {
+ newGroup->setFiberDimension(newVertex, 1);
+ } // if
+ } // for
} // groupAddNewVertices
// ----------------------------------------------------------------------
@@ -106,16 +141,24 @@
const edge_map_type::const_iterator edgesEnd = _edgeToVertex.end();
for (edge_map_type::const_iterator e_iter = _edgeToVertex.begin(); e_iter != edgesEnd; ++e_iter) {
const point_type newVertex = e_iter->second;
- const point_type edgeVertexA = e_iter->first.first;
- const point_type edgeVertexB = e_iter->first.second;
+ const point_type edgeVertex = e_iter->first.first;
- if (oldGroup->getFiberDimension(edgeVertexA) && oldGroup->getFiberDimension(edgeVertexB)) {
- if (oldGroup->restrictPoint(edgeVertexA)[0] == oldGroup->restrictPoint(edgeVertexB)[0]) {
- newGroup->updatePoint(newVertex, oldGroup->restrictPoint(edgeVertexA));
- std::cout << "Adding new vertex: " << newVertex << " based on old vertices " << edgeVertexA << " and " << edgeVertexB << std::endl;
- } // if
+ if (1 == newGroup->getFiberDimension(newVertex)) {
+ newGroup->updatePoint(newVertex, oldGroup->restrictPoint(edgeVertex));
+ std::cout << "Adding new vertex: " << newVertex << " based on edge " << e_iter->first << std::endl;
} // if
} // for
+
+ const face_map_type::const_iterator facesEnd = _faceToVertex.end();
+ for (face_map_type::const_iterator f_iter = _faceToVertex.begin(); f_iter != facesEnd; ++f_iter) {
+ const point_type newVertex = f_iter->second;
+ const point_type faceVertex = f_iter->first.points[0];
+
+ if (1 == newGroup->getFiberDimension(newVertex)) {
+ newGroup->updatePoint(newVertex, oldGroup->restrictPoint(faceVertex));
+ std::cout << "Adding new vertex: " << newVertex << " based on face " << f_iter->first << std::endl;
+ } // if
+ } // for
} // groupSetNewVertices
// ----------------------------------------------------------------------
@@ -151,6 +194,28 @@
newMesh->setValue(newLabel, newVertex, valueA);
} // if
} // for
+
+ const face_map_type::const_iterator facesEnd = _faceToVertex.end();
+ for (face_map_type::const_iterator f_iter = _faceToVertex.begin(); f_iter != facesEnd; ++f_iter) {
+ const point_type newVertex = f_iter->second;
+ const point_type faceVertex = f_iter->first.points[0];
+ const int value = oldMesh->getValue(oldLabel, faceVertex, defaultValue);
+
+ if (value != defaultValue) {
+ bool hasFace = true;
+ for (int iVertex=1; iVertex < 4; ++iVertex) {
+ const point_type faceVertex2 = f_iter->first.points[iVertex];
+ const int value2 = oldMesh->getValue(oldLabel, faceVertex2, defaultValue);
+ if (value2 != value) {
+ hasFace = false;
+ break;
+ } // if
+ } // for
+ if (hasFace) {
+ newMesh->setValue(newLabel, newVertex, value);
+ } // if
+ } // if
+ } // for
} // labelAddNewVertices
// ----------------------------------------------------------------------
@@ -164,6 +229,8 @@
assert(!newMesh.isNull());
assert(!oldMesh.isNull());
+ // :TODO: Add face vertices
+
Obj<mesh_type::send_overlap_type> newSendOverlap = newMesh->getSendOverlap();
assert(!newSendOverlap.isNull());
Obj<mesh_type::recv_overlap_type> newRecvOverlap = newMesh->getRecvOverlap();
Modified: short/3D/PyLith/trunk/libsrc/topology/RefineFace4Edges2.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/topology/RefineFace4Edges2.hh 2010-10-14 21:04:13 UTC (rev 17274)
+++ short/3D/PyLith/trunk/libsrc/topology/RefineFace4Edges2.hh 2010-10-14 22:39:34 UTC (rev 17275)
@@ -121,40 +121,40 @@
public:
Face(void) {};
Face(const Point p) {
- _points[0] = p;
- _points[1] = p;
- _points[2] = p;
- _points[3] = p;
+ points[0] = p;
+ points[1] = p;
+ points[2] = p;
+ points[3] = p;
};
Face(const Point p0,
const Point p1,
const Point p2,
const Point p3) {
- _points[0] = p0;
- _points[1] = p1;
- _points[2] = p2;
- _points[3] = p3;
+ points[0] = p0;
+ points[1] = p1;
+ points[2] = p2;
+ points[3] = p3;
};
~Face(void) {};
friend bool operator==(const Face& a, const Face& b) {
const bool result =
- a._points[0] == b._points[0] &&
- a._points[1] == b._points[1] &&
- a._points[2] == b._points[2] &&
- a._points[3] == b._points[3];
+ a.points[0] == b.points[0] &&
+ a.points[1] == b.points[1] &&
+ a.points[2] == b.points[2] &&
+ a.points[3] == b.points[3];
return result;
};
friend bool operator<(const Face& a, const Face& b) {
- if (a._points[0] < b._points[0]) {
+ if (a.points[0] < b.points[0]) {
return true;
- } else if (a._points[0] == b._points[0]) {
- if (a._points[1] < b._points[1]) {
+ } else if (a.points[0] == b.points[0]) {
+ if (a.points[1] < b.points[1]) {
return true;
- } else if (a._points[1] == b._points[1]) {
- if (a._points[2] < b._points[2]) {
+ } else if (a.points[1] == b.points[1]) {
+ if (a.points[2] < b.points[2]) {
return true;
- } else if (a._points[2] == b._points[2]) {
- if (a._points[3] < b._points[3]) {
+ } else if (a.points[2] == b.points[2]) {
+ if (a.points[3] < b.points[3]) {
return true;
} // if
} // if/else
@@ -164,15 +164,15 @@
return false;
};
friend std::ostream& operator<<(std::ostream& stream, const Face& face) {
- stream << "(" << face._points[0]
- << ", " << face._points[1]
- << ", " << face._points[2]
- << ", " << face._points[3]
+ stream << "(" << face.points[0]
+ << ", " << face.points[1]
+ << ", " << face.points[2]
+ << ", " << face.points[3]
<< ")";
return stream;
};
- private:
- Point _points[4];
+ public:
+ int points[4];
};
typedef Face<point_type> FaceType;
typedef std::map<FaceType, point_type> face_map_type;
Modified: short/3D/PyLith/trunk/libsrc/topology/RefineUniform.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/topology/RefineUniform.cc 2010-10-14 21:04:13 UTC (rev 17274)
+++ short/3D/PyLith/trunk/libsrc/topology/RefineUniform.cc 2010-10-14 22:39:34 UTC (rev 17275)
@@ -24,6 +24,7 @@
#include "CellRefinerTri3.hh" // USES CellRefinerTri3
#include "CellRefinerTet4.hh" // USES CellRefinerTet4
+#include "CellRefinerQuad4.hh" // USES CellRefinerQuad4
#include "MeshRefiner.hh" // USES MeshRefiner
#include <stdexcept> // USES std::runtime_error
@@ -86,7 +87,9 @@
break;
} // case 3
case 4: {
- throw std::logic_error("Not implemented.");
+ ALE::CellRefinerQuad4 cellSplitter(*sieveMesh);
+ ALE::MeshRefiner<ALE::CellRefinerQuad4> refinement;
+ refinement.refine(newSieveMesh, sieveMesh, cellSplitter);
break;
} // case 4
default :
Modified: short/3D/PyLith/trunk/unittests/libtests/topology/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/Makefile.am 2010-10-14 21:04:13 UTC (rev 17274)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/Makefile.am 2010-10-14 22:39:34 UTC (rev 17275)
@@ -61,14 +61,18 @@
data/MeshDataCohesiveTri3Level2.cc \
data/MeshDataCohesiveTri3Level2Fault1.cc \
data/MeshDataCohesiveTet4Level2.cc \
- data/MeshDataCohesiveTet4Level2Fault1.cc
+ data/MeshDataCohesiveTet4Level2Fault1.cc \
+ data/MeshDataCohesiveQuad4Level2.cc \
+ data/MeshDataCohesiveQuad4Level2Fault1.cc
noinst_HEADERS += \
data/MeshDataCohesive.hh \
data/MeshDataCohesiveTri3Level2.hh \
data/MeshDataCohesiveTri3Level2Fault1.hh \
data/MeshDataCohesiveTet4Level2.hh \
- data/MeshDataCohesiveTet4Level2Fault1.hh
+ data/MeshDataCohesiveTet4Level2Fault1.hh \
+ data/MeshDataCohesiveQuad4Level2.hh \
+ data/MeshDataCohesiveQuad4Level2Fault1.hh
AM_CPPFLAGS = \
$(PETSC_SIEVE_FLAGS) $(PETSC_INCLUDE) \
Modified: short/3D/PyLith/trunk/unittests/libtests/topology/TestRefineUniform.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/TestRefineUniform.cc 2010-10-14 21:04:13 UTC (rev 17274)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/TestRefineUniform.cc 2010-10-14 22:39:34 UTC (rev 17275)
@@ -32,6 +32,8 @@
#include "data/MeshDataCohesiveTri3Level2Fault1.hh"
#include "data/MeshDataCohesiveTet4Level2.hh"
#include "data/MeshDataCohesiveTet4Level2Fault1.hh"
+#include "data/MeshDataCohesiveQuad4Level2.hh"
+#include "data/MeshDataCohesiveQuad4Level2Fault1.hh"
#include <strings.h> // USES strcasecmp()
#include <stdexcept> // USES std::logic_error
@@ -88,7 +90,25 @@
} // testRefineTet4Level2Fault1
// ----------------------------------------------------------------------
+// Test refine() with level 2, quad4 cells, and no fault.
void
+pylith::topology::TestRefineUniform::testRefineQuad4Level2(void)
+{ // testRefineQuad4Level2
+ MeshDataCohesiveQuad4Level2 data;
+ _testRefine(data);
+} // testRefineQuad4Level2
+
+// ----------------------------------------------------------------------
+// Test refine() with level 2, quad4 cells, and one fault.
+void
+pylith::topology::TestRefineUniform::testRefineQuad4Level2Fault1(void)
+{ // testRefineQuad4Level2Fault1
+ MeshDataCohesiveQuad4Level2Fault1 data;
+ _testRefine(data);
+} // testRefineQuad4Level2Fault1
+
+// ----------------------------------------------------------------------
+void
pylith::topology::TestRefineUniform::_setupMesh(Mesh* const mesh,
const MeshDataCohesive& data)
{ // _setupMesh
Modified: short/3D/PyLith/trunk/unittests/libtests/topology/TestRefineUniform.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/TestRefineUniform.hh 2010-10-14 21:04:13 UTC (rev 17274)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/TestRefineUniform.hh 2010-10-14 22:39:34 UTC (rev 17275)
@@ -53,9 +53,13 @@
CPPUNIT_TEST( testRefineTri3Level2 );
CPPUNIT_TEST( testRefineTri3Level2Fault1 );
+
CPPUNIT_TEST( testRefineTet4Level2 );
CPPUNIT_TEST( testRefineTet4Level2Fault1 );
+ CPPUNIT_TEST( testRefineQuad4Level2 );
+ CPPUNIT_TEST( testRefineQuad4Level2Fault1 );
+
CPPUNIT_TEST_SUITE_END();
// PUBLIC METHODS /////////////////////////////////////////////////////
@@ -76,6 +80,12 @@
/// Test refine() with level 2, tet4 cells, and one fault.
void testRefineTet4Level2Fault1(void);
+ /// Test refine() with level 2, quad4 cells, and no fault.
+ void testRefineQuad4Level2(void);
+
+ /// Test refine() with level 2, quad4 cells, and one fault.
+ void testRefineQuad4Level2Fault1(void);
+
// PRIVATE METHODS //////////////////////////////////////////////////////
private :
Modified: short/3D/PyLith/trunk/unittests/libtests/topology/data/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/Makefile.am 2010-10-14 21:04:13 UTC (rev 17274)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/Makefile.am 2010-10-14 22:39:34 UTC (rev 17275)
@@ -19,6 +19,7 @@
dist_noinst_DATA = \
tri3.mesh \
fourtri3.mesh \
+ fourquad4.mesh \
twotet4.mesh
noinst_TMP =
Added: short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level2.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level2.cc (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level2.cc 2010-10-14 22:39:34 UTC (rev 17275)
@@ -0,0 +1,148 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard, U.S. Geological Survey
+// Charles A. Williams, GNS Science
+// Matthew G. Knepley, University of Chicago
+//
+// This code was developed as part of the Computational Infrastructure
+// for Geodynamics (http://geodynamics.org).
+//
+// Copyright (c) 2010 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#include "MeshDataCohesiveQuad4Level2.hh"
+
+const char* pylith::topology::MeshDataCohesiveQuad4Level2::_filename =
+ "data/fourquad4.mesh";
+
+const int pylith::topology::MeshDataCohesiveQuad4Level2::_refineLevel = 2;
+const char* pylith::topology::MeshDataCohesiveQuad4Level2::_faultA = 0;
+const char* pylith::topology::MeshDataCohesiveQuad4Level2::_faultB = 0;
+
+const int pylith::topology::MeshDataCohesiveQuad4Level2::_numVertices = 25;
+
+const int pylith::topology::MeshDataCohesiveQuad4Level2::_spaceDim = 2;
+
+const int pylith::topology::MeshDataCohesiveQuad4Level2::_numCells = 16;
+
+const int pylith::topology::MeshDataCohesiveQuad4Level2::_numCellsCohesive = 0;
+
+const int pylith::topology::MeshDataCohesiveQuad4Level2::_cellDim = 2;
+
+const int pylith::topology::MeshDataCohesiveQuad4Level2::_numCorners = 4;
+
+const int pylith::topology::MeshDataCohesiveQuad4Level2::_numCornersCohesive = 6;
+
+const double pylith::topology::MeshDataCohesiveQuad4Level2::_vertices[] = {
+ -1.0, -1.0,
+ -1.0, 0.0,
+ -1.0, 1.0,
+ 0.0, -1.0,
+ 0.0, 0.0,
+ 0.0, 1.0,
+ 1.0, -1.0,
+ 1.0, 0.0,
+ 1.0, 1.0,
+ -0.5, -1.0,
+ 0.0, -0.5,
+ -0.5, 0.0,
+ -1.0, -0.5,
+ -0.5, -0.5,
+ 1.0, -0.5,
+ 0.5, 0.0,
+ 0.5, -1.0,
+ 0.5, -0.5,
+ -1.0, 0.5,
+ 0.0, 0.5,
+ -0.5, 1.0,
+ -0.5, 0.5,
+ 0.5, 1.0,
+ 1.0, 0.5,
+ 0.5, 0.5,
+};
+
+const int pylith::topology::MeshDataCohesiveQuad4Level2::_cells[] = {
+ 16, 25, 29, 28,
+ 19, 26, 29, 25,
+ 17, 28, 29, 27,
+ 20, 27, 29, 26,
+ 22, 30, 33, 32,
+ 23, 31, 33, 30,
+ 19, 32, 33, 26,
+ 20, 26, 33, 31,
+ 18, 34, 37, 36,
+ 17, 27, 37, 34,
+ 21, 36, 37, 35,
+ 20, 35, 37, 27,
+ 24, 38, 40, 39,
+ 21, 35, 40, 38,
+ 23, 39, 40, 31,
+ 20, 31, 40, 35,
+};
+const int pylith::topology::MeshDataCohesiveQuad4Level2::_cellsCohesive[] = {
+};
+const int pylith::topology::MeshDataCohesiveQuad4Level2::_materialIds[] = {
+ 1, 1, 1, 1, 2, 2, 2, 2,
+ 1, 1, 1, 1, 2, 2, 2, 2,
+};
+
+const int pylith::topology::MeshDataCohesiveQuad4Level2::_numGroups = 3;
+
+const int pylith::topology::MeshDataCohesiveQuad4Level2::_groupSizes[] = {
+ 5, 5, 5,
+};
+
+const int pylith::topology::MeshDataCohesiveQuad4Level2::_groups[] = {
+ 16, 19, 22, 25, 32,
+ 16, 17, 18, 28, 34,
+ 19, 20, 21, 26, 35,
+};
+
+const char* pylith::topology::MeshDataCohesiveQuad4Level2::_groupNames[] = {
+ "edge 1",
+ "end points",
+ "fault",
+};
+
+const char* pylith::topology::MeshDataCohesiveQuad4Level2::_groupTypes[] = {
+ "vertex",
+ "vertex",
+ "vertex",
+};
+
+pylith::topology::MeshDataCohesiveQuad4Level2::MeshDataCohesiveQuad4Level2(void)
+{ // constructor
+ filename = const_cast<char*>(_filename);
+ refineLevel = _refineLevel;
+ faultA = const_cast<char*>(_faultA);
+ faultB = const_cast<char*>(_faultB);
+
+ numVertices = _numVertices;
+ spaceDim = _spaceDim;
+ cellDim = _cellDim;
+ numCells = _numCells;
+ numCorners = _numCorners;
+ numCellsCohesive = _numCellsCohesive;
+ numCornersCohesive = _numCornersCohesive;
+ vertices = const_cast<double*>(_vertices);
+ cells = const_cast<int*>(_cells);
+ cellsCohesive = const_cast<int*>(_cellsCohesive);
+ materialIds = const_cast<int*>(_materialIds);
+ groups = const_cast<int*>(_groups);
+ groupSizes = const_cast<int*>(_groupSizes);
+ groupNames = const_cast<char**>(_groupNames);
+ groupTypes = const_cast<char**>(_groupTypes);
+ numGroups = _numGroups;
+} // constructor
+
+pylith::topology::MeshDataCohesiveQuad4Level2::~MeshDataCohesiveQuad4Level2(void)
+{}
+
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level2.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level2.hh (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level2.hh 2010-10-14 22:39:34 UTC (rev 17275)
@@ -0,0 +1,73 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard, U.S. Geological Survey
+// Charles A. Williams, GNS Science
+// Matthew G. Knepley, University of Chicago
+//
+// This code was developed as part of the Computational Infrastructure
+// for Geodynamics (http://geodynamics.org).
+//
+// Copyright (c) 2010 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#if !defined(pylith_topology_meshdatacohesivequad4level2_hh)
+#define pylith_topology_meshdatacohesivequad4level2_hh
+
+#include "MeshDataCohesive.hh"
+
+namespace pylith {
+ namespace topology {
+ class MeshDataCohesiveQuad4Level2;
+ } // pylith
+} // topology
+
+class pylith::topology::MeshDataCohesiveQuad4Level2 : public MeshDataCohesive
+{ // MeshDataCohesiveQuad4Level2
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public:
+
+ /// Constructor
+ MeshDataCohesiveQuad4Level2(void);
+
+ /// Destructor
+ ~MeshDataCohesiveQuad4Level2(void);
+
+// PRIVATE MEMBERS //////////////////////////////////////////////////////
+private:
+
+ static const char* _filename; ///< Filename of mesh file.
+ static const int _refineLevel; ///< Refinement level.
+ static const char* _faultA; ///< Vertex group associated with fault A (0 if no fault).
+ static const char* _faultB; ///< Vertex group associated with fault B (0 if no fault).
+
+ static const int _numVertices; ///< Number of vertices
+ static const int _spaceDim; ///< Number of dimensions in vertex coordinates
+ static const int _cellDim; ///< Number of dimensions associated with cell
+ static const int _numCells; ///< Number of cells
+ static const int _numCorners; ///< Number of vertices in cell
+ static const int _numCellsCohesive; ///< Number of cohesive cells.
+ static const int _numCornersCohesive; ///< Number of vertices in cohesive cell.
+
+ static const double _vertices[]; ///< Pointer to coordinates of vertices
+ static const int _cells[]; ///< Pointer to indices of vertices in cells
+ static const int _cellsCohesive[]; ///< Pointer to indices of vertices in cohseive cells
+ static const int _materialIds[]; ///< Pointer to cell material identifiers
+
+ static const int _groups[]; ///< Groups of points
+ static const int _groupSizes[]; ///< Sizes of groups
+ static const char* _groupNames[]; ///< Array of group names
+ static const char* _groupTypes[]; ///< Array of group types
+ static const int _numGroups; ///< Number of groups
+
+}; // MeshDataCohesiveQuad4Level2
+
+#endif // pylith_topology_meshdatacohesivequad4level2_hh
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level2Fault1.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level2Fault1.cc (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level2Fault1.cc 2010-10-14 22:39:34 UTC (rev 17275)
@@ -0,0 +1,163 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard, U.S. Geological Survey
+// Charles A. Williams, GNS Science
+// Matthew G. Knepley, University of Chicago
+//
+// This code was developed as part of the Computational Infrastructure
+// for Geodynamics (http://geodynamics.org).
+//
+// Copyright (c) 2010 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#include "MeshDataCohesiveQuad4Level2Fault1.hh"
+
+const char* pylith::topology::MeshDataCohesiveQuad4Level2Fault1::_filename =
+ "data/fourquad4.mesh";
+
+const int pylith::topology::MeshDataCohesiveQuad4Level2Fault1::_refineLevel = 2;
+const char* pylith::topology::MeshDataCohesiveQuad4Level2Fault1::_faultA = "fault";
+const char* pylith::topology::MeshDataCohesiveQuad4Level2Fault1::_faultB = 0;
+
+const int pylith::topology::MeshDataCohesiveQuad4Level2Fault1::_numVertices = 35;
+
+const int pylith::topology::MeshDataCohesiveQuad4Level2Fault1::_spaceDim = 2;
+
+const int pylith::topology::MeshDataCohesiveQuad4Level2Fault1::_numCells = 16;
+
+const int pylith::topology::MeshDataCohesiveQuad4Level2Fault1::_numCellsCohesive = 4;
+
+const int pylith::topology::MeshDataCohesiveQuad4Level2Fault1::_cellDim = 2;
+
+const int pylith::topology::MeshDataCohesiveQuad4Level2Fault1::_numCorners = 4;
+
+const int pylith::topology::MeshDataCohesiveQuad4Level2Fault1::_numCornersCohesive = 6;
+
+const double pylith::topology::MeshDataCohesiveQuad4Level2Fault1::_vertices[] = {
+ -1.0, -1.0,
+ -1.0, 0.0,
+ -1.0, 1.0,
+ 0.0, -1.0,
+ 0.0, 0.0,
+ 0.0, 1.0,
+ 1.0, -1.0,
+ 1.0, 0.0,
+ 1.0, 1.0,
+ 0.0, -1.0,
+ 0.0, 0.0,
+ 0.0, 1.0,
+ -0.5, -1.0,
+ 0.0, -0.5,
+ -0.5, 0.0,
+ -1.0, -0.5,
+ -0.5, -0.5,
+ 1.0, -0.5,
+ 0.5, 0.0,
+ 0.0, -0.5,
+ 0.5, -1.0,
+ 0.5, -0.5,
+ -1.0, 0.5,
+ 0.0, 0.5,
+ -0.5, 1.0,
+ -0.5, 0.5,
+ 0.5, 1.0,
+ 0.0, 0.5,
+ 1.0, 0.5,
+ 0.5, 0.5,
+ 0.0, -1.0,
+ 0.0, 0.0,
+ 0.0, 1.0,
+ 0.0, -0.5,
+ 0.0, 0.5,
+};
+
+const int pylith::topology::MeshDataCohesiveQuad4Level2Fault1::_cells[] = {
+ 16, 28, 32, 31,
+ 19, 29, 32, 28,
+ 17, 31, 32, 30,
+ 20, 30, 32, 29,
+ 22, 33, 37, 36,
+ 23, 34, 37, 33,
+ 25, 36, 37, 35,
+ 26, 35, 37, 34,
+ 18, 38, 41, 40,
+ 17, 30, 41, 38,
+ 21, 40, 41, 39,
+ 20, 39, 41, 30,
+ 24, 42, 45, 44,
+ 27, 43, 45, 42,
+ 23, 44, 45, 34,
+ 26, 34, 45, 43,
+};
+const int pylith::topology::MeshDataCohesiveQuad4Level2Fault1::_cellsCohesive[] = {
+ 19, 29, 25, 35, 46, 49,
+ 29, 20, 35, 26, 49, 47,
+ 20, 39, 26, 43, 47, 50,
+ 39, 21, 43, 27, 50, 48,
+};
+const int pylith::topology::MeshDataCohesiveQuad4Level2Fault1::_materialIds[] = {
+ 1, 1, 1, 1, 2, 2, 2, 2,
+ 1, 1, 1, 1, 2, 2, 2, 2,
+ 100, 100, 100, 100,
+};
+
+const int pylith::topology::MeshDataCohesiveQuad4Level2Fault1::_numGroups = 3;
+
+const int pylith::topology::MeshDataCohesiveQuad4Level2Fault1::_groupSizes[] = {
+ 6, 5, 15,
+};
+
+const int pylith::topology::MeshDataCohesiveQuad4Level2Fault1::_groups[] = {
+ 16, 19, 22, 25, 28, 36,
+ 16, 17, 18, 31, 38,
+ 19, 20, 21, 25, 26, 27, 29, 35, 39, 43, 46, 47, 48, 49, 50,
+};
+
+const char* pylith::topology::MeshDataCohesiveQuad4Level2Fault1::_groupNames[] = {
+ "edge 1",
+ "end points",
+ "fault",
+};
+
+const char* pylith::topology::MeshDataCohesiveQuad4Level2Fault1::_groupTypes[] = {
+ "vertex",
+ "vertex",
+ "vertex",
+};
+
+pylith::topology::MeshDataCohesiveQuad4Level2Fault1::MeshDataCohesiveQuad4Level2Fault1(void)
+{ // constructor
+ filename = const_cast<char*>(_filename);
+ refineLevel = _refineLevel;
+ faultA = const_cast<char*>(_faultA);
+ faultB = const_cast<char*>(_faultB);
+
+ numVertices = _numVertices;
+ spaceDim = _spaceDim;
+ cellDim = _cellDim;
+ numCells = _numCells;
+ numCorners = _numCorners;
+ numCellsCohesive = _numCellsCohesive;
+ numCornersCohesive = _numCornersCohesive;
+ vertices = const_cast<double*>(_vertices);
+ cells = const_cast<int*>(_cells);
+ cellsCohesive = const_cast<int*>(_cellsCohesive);
+ materialIds = const_cast<int*>(_materialIds);
+ groups = const_cast<int*>(_groups);
+ groupSizes = const_cast<int*>(_groupSizes);
+ groupNames = const_cast<char**>(_groupNames);
+ groupTypes = const_cast<char**>(_groupTypes);
+ numGroups = _numGroups;
+} // constructor
+
+pylith::topology::MeshDataCohesiveQuad4Level2Fault1::~MeshDataCohesiveQuad4Level2Fault1(void)
+{}
+
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level2Fault1.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level2Fault1.hh (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level2Fault1.hh 2010-10-14 22:39:34 UTC (rev 17275)
@@ -0,0 +1,73 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard, U.S. Geological Survey
+// Charles A. Williams, GNS Science
+// Matthew G. Knepley, University of Chicago
+//
+// This code was developed as part of the Computational Infrastructure
+// for Geodynamics (http://geodynamics.org).
+//
+// Copyright (c) 2010 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#if !defined(pylith_topology_meshdatacohesivequad4level2fault1_hh)
+#define pylith_topology_meshdatacohesivequad4level2fault1_hh
+
+#include "MeshDataCohesive.hh"
+
+namespace pylith {
+ namespace topology {
+ class MeshDataCohesiveQuad4Level2Fault1;
+ } // pylith
+} // topology
+
+class pylith::topology::MeshDataCohesiveQuad4Level2Fault1 : public MeshDataCohesive
+{ // MeshDataCohesiveQuad4Level2Fault1
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public:
+
+ /// Constructor
+ MeshDataCohesiveQuad4Level2Fault1(void);
+
+ /// Destructor
+ ~MeshDataCohesiveQuad4Level2Fault1(void);
+
+// PRIVATE MEMBERS //////////////////////////////////////////////////////
+private:
+
+ static const char* _filename; ///< Filename of mesh file.
+ static const int _refineLevel; ///< Refinement level.
+ static const char* _faultA; ///< Vertex group associated with fault A (0 if no fault).
+ static const char* _faultB; ///< Vertex group associated with fault B (0 if no fault).
+
+ static const int _numVertices; ///< Number of vertices
+ static const int _spaceDim; ///< Number of dimensions in vertex coordinates
+ static const int _cellDim; ///< Number of dimensions associated with cell
+ static const int _numCells; ///< Number of cells
+ static const int _numCorners; ///< Number of vertices in cell
+ static const int _numCellsCohesive; ///< Number of cohesive cells.
+ static const int _numCornersCohesive; ///< Number of vertices in cohesive cell.
+
+ static const double _vertices[]; ///< Pointer to coordinates of vertices
+ static const int _cells[]; ///< Pointer to indices of vertices in cells
+ static const int _cellsCohesive[]; ///< Pointer to indices of vertices in cohseive cells
+ static const int _materialIds[]; ///< Pointer to cell material identifiers
+
+ static const int _groups[]; ///< Groups of points
+ static const int _groupSizes[]; ///< Sizes of groups
+ static const char* _groupNames[]; ///< Array of group names
+ static const char* _groupTypes[]; ///< Array of group types
+ static const int _numGroups; ///< Number of groups
+
+}; // MeshDataCohesiveQuad4Level2Fault1
+
+#endif // pylith_topology_meshdatacohesivequad4level2fault1_hh
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/topology/data/fourquad4.mesh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/fourquad4.mesh (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/fourquad4.mesh 2010-10-14 22:39:34 UTC (rev 17275)
@@ -0,0 +1,71 @@
+mesh = {
+ dimension = 2
+ use-index-zero = true
+ vertices = {
+ dimension = 2
+ count = 9
+ coordinates = {
+ 0 -1.0 -1.0
+ 1 -1.0 0.0
+ 2 -1.0 1.0
+ 3 0.0 -1.0
+ 4 0.0 0.0
+ 5 0.0 1.0
+ 6 1.0 -1.0
+ 7 1.0 0.0
+ 8 1.0 1.0
+ }
+ }
+
+ cells = {
+ count = 4
+ num-corners = 4
+ simplices = {
+ 0 0 3 4 1
+ 1 6 7 4 3
+ 2 2 1 4 5
+ 3 8 5 4 7
+ }
+
+ material-ids = {
+ 0 1
+ 1 2
+ 2 1
+ 3 2
+ }
+ }
+
+ group = {
+ name = fault
+ type = vertices
+ count = 3
+ indices = {
+ 3
+ 4
+ 5
+ }
+ }
+
+ group = {
+ name = end points
+ type = vertices
+ count = 3
+ indices = {
+ 0
+ 1
+ 2
+ }
+ }
+
+ group = {
+ name = edge 1
+ type = vertices
+ count = 3
+ indices = {
+ 0
+ 3
+ 6
+ }
+ }
+
+}
Modified: short/3D/PyLith/trunk/unittests/libtests/topology/data/fourtri3.mesh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/fourtri3.mesh 2010-10-14 21:04:13 UTC (rev 17274)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/fourtri3.mesh 2010-10-14 22:39:34 UTC (rev 17275)
@@ -26,8 +26,8 @@
material-ids = {
0 1
1 1
- 1 2
- 1 2
+ 2 2
+ 3 2
}
}
More information about the CIG-COMMITS
mailing list