[cig-commits] r22685 - in short/3D/PyLith/trunk: libsrc/pylith libsrc/pylith/topology modulesrc/topology pylith/topology unittests/libtests/topology unittests/libtests/topology/data unittests/pytests/topology
brad at geodynamics.org
brad at geodynamics.org
Fri Jul 26 15:13:25 PDT 2013
Author: brad
Date: 2013-07-26 15:13:24 -0700 (Fri, 26 Jul 2013)
New Revision: 22685
Added:
short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveHex8Level1.cc
short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveHex8Level1.hh
short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveHex8Level1Fault1.cc
short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveHex8Level1Fault1.hh
short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level1.cc
short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level1.hh
short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level1Fault1.cc
short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level1Fault1.hh
short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTet4Level1.cc
short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTet4Level1.hh
short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTet4Level1Fault1.cc
short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTet4Level1Fault1.hh
short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTri3Level1.cc
short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTri3Level1.hh
short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTri3Level1Fault1.cc
short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTri3Level1Fault1.hh
Removed:
short/3D/PyLith/trunk/libsrc/pylith/topology/CellRefinerHex8.cc
short/3D/PyLith/trunk/libsrc/pylith/topology/CellRefinerHex8.hh
short/3D/PyLith/trunk/libsrc/pylith/topology/CellRefinerQuad4.cc
short/3D/PyLith/trunk/libsrc/pylith/topology/CellRefinerQuad4.hh
short/3D/PyLith/trunk/libsrc/pylith/topology/CellRefinerTet4.cc
short/3D/PyLith/trunk/libsrc/pylith/topology/CellRefinerTet4.hh
short/3D/PyLith/trunk/libsrc/pylith/topology/CellRefinerTri3.cc
short/3D/PyLith/trunk/libsrc/pylith/topology/CellRefinerTri3.hh
short/3D/PyLith/trunk/libsrc/pylith/topology/MeshOrder.cc
short/3D/PyLith/trunk/libsrc/pylith/topology/MeshOrder.hh
short/3D/PyLith/trunk/libsrc/pylith/topology/MeshOrder.icc
short/3D/PyLith/trunk/libsrc/pylith/topology/MeshRefiner.cc
short/3D/PyLith/trunk/libsrc/pylith/topology/MeshRefiner.hh
short/3D/PyLith/trunk/libsrc/pylith/topology/RefineEdges2.cc
short/3D/PyLith/trunk/libsrc/pylith/topology/RefineEdges2.hh
short/3D/PyLith/trunk/libsrc/pylith/topology/RefineFace4Edges2.cc
short/3D/PyLith/trunk/libsrc/pylith/topology/RefineFace4Edges2.hh
short/3D/PyLith/trunk/libsrc/pylith/topology/RefineVol8Face4Edges2.cc
short/3D/PyLith/trunk/libsrc/pylith/topology/RefineVol8Face4Edges2.hh
short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveHex8Level2.cc
short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveHex8Level2.hh
short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveHex8Level2Fault1.cc
short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveHex8Level2Fault1.hh
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/MeshDataCohesiveTet4Level2.cc
short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTet4Level2.hh
short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTet4Level2Fault1.cc
short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTet4Level2Fault1.hh
short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTri3Level2.cc
short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTri3Level2.hh
short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTri3Level2Fault1.cc
short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTri3Level2Fault1.hh
Modified:
short/3D/PyLith/trunk/libsrc/pylith/Makefile.am
short/3D/PyLith/trunk/libsrc/pylith/topology/Makefile.am
short/3D/PyLith/trunk/libsrc/pylith/topology/RefineUniform.cc
short/3D/PyLith/trunk/libsrc/pylith/topology/RefineUniform.hh
short/3D/PyLith/trunk/libsrc/pylith/topology/topologyfwd.hh
short/3D/PyLith/trunk/modulesrc/topology/topology.i
short/3D/PyLith/trunk/pylith/topology/RefineUniform.py
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/test_topology.cc
short/3D/PyLith/trunk/unittests/pytests/topology/TestRefineUniform.py
short/3D/PyLith/trunk/unittests/pytests/topology/testtopology.py
Log:
Re-enabled refinement. Tests currently fail because mesh interpolation is not turned on.
Modified: short/3D/PyLith/trunk/libsrc/pylith/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/Makefile.am 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/libsrc/pylith/Makefile.am 2013-07-26 22:13:24 UTC (rev 22685)
@@ -164,23 +164,11 @@
topology/SolutionFields.cc \
topology/Distributor.cc \
topology/ReverseCuthillMcKee.cc \
+ topology/RefineUniform.cc \
utils/EventLogger.cc \
utils/TestArray.cc
-# TEMPORARY
-#libpylith_la_SOURCES += \
-# topology/RefineUniform.cc
-# topology/RefineEdges2.cc \
-# topology/CellRefinerTri3.cc \
-# topology/CellRefinerTet4.cc \
-# topology/RefineFace4Edges2.cc \
-# topology/CellRefinerQuad4.cc \
-# topology/RefineVol8Face4Edges2.cc \
-# topology/CellRefinerHex8.cc \
-# topology/MeshOrder.cc
-
-
libpylith_la_LDFLAGS = $(AM_LDFLAGS) $(PYTHON_LA_LDFLAGS)
libpylith_la_LIBADD = \
-lspatialdata \
Deleted: short/3D/PyLith/trunk/libsrc/pylith/topology/CellRefinerHex8.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/CellRefinerHex8.cc 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/CellRefinerHex8.cc 2013-07-26 22:13:24 UTC (rev 22685)
@@ -1,1243 +0,0 @@
-// -*- 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-2013 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ======================================================================
-//
-
-#include <portinfo>
-
-#include "CellRefinerHex8.hh" // implementation of class methods
-
-#include "MeshOrder.hh" // USES MeshOrder
-
-#include <cassert> // USES assert()
-
-#include <iostream> // TEMPORARY
-// ----------------------------------------------------------------------
-// These must match the sizes of the buffers in the header file.
-const int ALE::CellRefinerHex8::_edgesSize = 12;
-const int ALE::CellRefinerHex8::_facesSize = 6;
-const int ALE::CellRefinerHex8::_volumesSize = 1;
-const int ALE::CellRefinerHex8::_cellsSize = 64;
-
-// ----------------------------------------------------------------------
-// Constructor
-ALE::CellRefinerHex8::CellRefinerHex8(const mesh_type& mesh) :
- RefineVol8Face4Edges2(mesh)
-{ // constructor
- assert(3 == mesh.getDimension());
-} // constructor
-
-// ----------------------------------------------------------------------
-// Destructor
-ALE::CellRefinerHex8::~CellRefinerHex8(void)
-{ // destructor
-} // destructor
-
-// ----------------------------------------------------------------------
-// Get number of refined cells for each original cell.
-int
-ALE::CellRefinerHex8::numNewCells(const point_type cell)
-{ // numNewCells
- switch (_cellType(cell)) {
- case HEXAHEDRON:
- return 8;
- case QUAD_COHESIVE_LAGRANGE:
- return 4;
- default:
- assert(0);
- throw ALE::Exception("Unknown cell type.");
- } // switch
-} // numNewCells
-
-// ----------------------------------------------------------------------
-// Split cell into smaller cells of same type.
-void
-ALE::CellRefinerHex8::splitCell(const point_type cell,
- const point_type cone[],
- const int coneSize,
- point_type* curNewVertex)
-{ // splitCell
- assert(curNewVertex);
-
- int numEdges = 0;
- const EdgeType* edges;
-
- int numFaces = 0;
- const FaceType* faces;
-
- int numVolumes = 0;
- const VolumeType* volumes;
-
-#if 0
- // Debugging for the solvertest benchmark
- bool hasA = false, hasB = false;
- bool hasC = false, hasD = false;
- for(int i = 0; i < coneSize; ++i) {
- if (cone[i] == 5708) {hasA = true;}
- else if (cone[i] == 8187) {hasB = true;}
- else if (cone[i] == 4262) {hasC = true;}
- else if (cone[i] == 8246) {hasD = true;}
- }
- if ((hasA && hasB) || (hasC && hasD)) {
- const char *rankname = hasC && hasD ? "[1]" : "[0]";
- const char *typeName = _cellType(cell) == HEXAHEDRON ? "hex" : "quadLag";
-
- std::cout << rankname<<"Refined cell " << cell << " of type " << typeName << " with cone:" << std::endl;
- for(int i = 0; i < coneSize; ++i) {
- std::cout << " " << cone[i];
- }
- std::cout << std::endl;
- }
-#endif
-
- switch (_cellType(cell)) {
- case HEXAHEDRON:
- _edges_HEXAHEDRON(&edges, &numEdges, cone, coneSize);
- _faces_HEXAHEDRON(&faces, &numFaces, cone, coneSize);
- _volumes_HEXAHEDRON(&volumes, &numVolumes, cone, coneSize);
- break;
- case QUAD_COHESIVE_LAGRANGE:
- _edges_QUAD_COHESIVE_LAGRANGE(&edges, &numEdges, cone, coneSize);
- _faces_QUAD_COHESIVE_LAGRANGE(&faces, &numFaces, cone, coneSize);
- break;
- default:
- assert(0);
- throw ALE::Exception("Unknown cell type.");
- } // switch
-
- for(int iEdge=0; iEdge < numEdges; ++iEdge) {
- if (_edgeToVertex.find(edges[iEdge]) == _edgeToVertex.end()) {
-#if 0
- // Debugging for the solvertest benchmark
- point_type min = std::min(edges[iEdge].first, edges[iEdge].second);
- point_type max = std::max(edges[iEdge].first, edges[iEdge].second);
-
- if (min == 5708 && max == 8187) {
- std::cout << "Refined cell " << cell << " with cone:" << std::endl;
- for(int i = 0; i < coneSize; ++i) {
- std::cout << " " << cone[i];
- }
- std::cout << std::endl;
- std::cout << " edge " << edges[iEdge] << " new vertex " << *curNewVertex << std::endl;
- }
-#endif
- // if vertex does not exist
- _edgeToVertex[edges[iEdge]] = *curNewVertex;
- ++(*curNewVertex);
- } // if
- } // for
-
- for(int iFace=0; iFace < numFaces; ++iFace) {
- if (_faceToVertex.find(faces[iFace]) == _faceToVertex.end()) {
- // if vertex does not exist
- //std::cout << "Face: " << faces[iFace] << ", new vertex: " << *curNewVertex << std::endl;
- _faceToVertex[faces[iFace]] = *curNewVertex;
- ++(*curNewVertex);
- } // if
- } // for
-
- for(int iVolume=0; iVolume < numVolumes; ++iVolume) {
- if (_volumeToVertex.find(volumes[iVolume]) == _volumeToVertex.end()) {
- // if vertex does not exist
- //std::cout << "Volume: " << volumes[iVolume] << ", new vertex: " << *curNewVertex << std::endl;
- _volumeToVertex[volumes[iVolume]] = *curNewVertex;
- ++(*curNewVertex);
- } // if
- } // for
-} // splitCell
-
-// ----------------------------------------------------------------------
-// Split cell into smaller cells of same type.
-void
-ALE::CellRefinerHex8::splitCellUncensored(const point_type cell,
- const point_type cone[],
- const int coneSize,
- point_type* curNewVertex)
-{ // splitCellUncensored
- assert(curNewVertex);
-
- int numEdges = 0;
- const EdgeType* edges;
-
- int numFaces = 0;
- const FaceType* faces;
-
- const bool uncensored = true;
-
- switch (_cellType(cell)) {
- case HEXAHEDRON:
- // No censored vertices on normal cell.
- break;
- case QUAD_COHESIVE_LAGRANGE:
- _edges_QUAD_COHESIVE_LAGRANGE(&edges, &numEdges, cone, coneSize, uncensored);
- _faces_QUAD_COHESIVE_LAGRANGE(&faces, &numFaces, cone, coneSize, uncensored);
- break;
- default:
- assert(0);
- throw ALE::Exception("Unknown cell type.");
- } // switch
-
- for(int iEdge=0; iEdge < numEdges; ++iEdge) {
- if (_edgeToVertex.find(edges[iEdge]) == _edgeToVertex.end()) {
- // if vertex does not exist
- //std::cout << "Edge: " << edges[iEdge] << ", new vertex: " << *curNewVertex << std::endl;
- _edgeToVertex[edges[iEdge]] = *curNewVertex;
- ++(*curNewVertex);
- } // if
- } // for
-
- for(int iFace=0; iFace < numFaces; ++iFace) {
- if (_faceToVertex.find(faces[iFace]) == _faceToVertex.end()) {
- // if vertex does not exist
- //std::cout << "Face: " << faces[iFace] << ", new vertex: " << *curNewVertex << std::endl;
- _faceToVertex[faces[iFace]] = *curNewVertex;
- ++(*curNewVertex);
- } // if
- } // for
-
-} // splitCellUncensored
-
-// ----------------------------------------------------------------------
-// Get refined cells.
-void
-ALE::CellRefinerHex8::getNewCells(const point_type** cells,
- int* numCells,
- const point_type cell,
- const point_type cone[],
- const int coneSize,
- const MeshOrder& orderOldMesh,
- const MeshOrder& orderNewMesh)
-{ // getNewCells
- assert(cells);
- assert(numCells);
-
- switch (_cellType(cell)) {
- case HEXAHEDRON: {
- const int coneVertexOffset = orderNewMesh.verticesNormal().min() - orderOldMesh.verticesNormal().min();
- _newCells_HEXAHEDRON(cells, numCells, cone, coneSize, coneVertexOffset);
- break;
- } // HEXAHEDRON
- case QUAD_COHESIVE_LAGRANGE: {
- const int coneVertexOffsetNormal = orderNewMesh.verticesNormal().min() - orderOldMesh.verticesNormal().min();
- const int coneVertexOffsetCensored = orderNewMesh.verticesCensored().min() - orderOldMesh.verticesCensored().min();
- _newCells_QUAD_COHESIVE_LAGRANGE(cells, numCells, cone, coneSize, coneVertexOffsetNormal, coneVertexOffsetCensored);
- break;
- } // QUAD_COHESIVE_LAGRANGE
- default:
- assert(0);
- throw ALE::Exception("Unknown cell type.");
- } // switch
-} // getNewCells
-
-// ----------------------------------------------------------------------
-// Get cell type.
-ALE::CellRefinerHex8::CellEnum
-ALE::CellRefinerHex8::_cellType(const point_type cell)
-{ // _cellType
- assert(!_mesh.getSieve().isNull());
-
- switch (_mesh.getSieve()->getConeSize(cell)) {
- case 8:
- return HEXAHEDRON;
- case 12:
- return QUAD_COHESIVE_LAGRANGE;
- case 0: {
- std::ostringstream msg;
- std::cerr << "Internal error. Cone size for mesh point " << cell << " is zero. May be a vertex.";
- assert(0);
- throw ALE::Exception("Could not determine cell type during uniform global refinement.");
- } // case 0
- default : {
- std::ostringstream msg;
- std::cerr << "Internal error. Unknown cone size for mesh point " << cell << ". Unknown cell type.";
- assert(0);
- throw ALE::Exception("Could not determine cell type during uniform global refinement.");
- } // default
- } // switch
-} // _cellType
-
-// ----------------------------------------------------------------------
-// Get edges of hexahedral cell.
-void
-ALE::CellRefinerHex8::_edges_HEXAHEDRON(const EdgeType** edges,
- int* numEdges,
- const point_type cone[],
- const int coneSize)
-{ // _edges_HEXAHEDRON
- assert(_edgesSize >= 12);
-
- assert(coneSize == 8);
- _edges[0] = EdgeType(std::min(cone[0], cone[1]), std::max(cone[0], cone[1]));
- _edges[1] = EdgeType(std::min(cone[1], cone[2]), std::max(cone[1], cone[2]));
- _edges[2] = EdgeType(std::min(cone[2], cone[3]), std::max(cone[2], cone[3]));
- _edges[3] = EdgeType(std::min(cone[3], cone[0]), std::max(cone[3], cone[0]));
-
- _edges[4] = EdgeType(std::min(cone[4], cone[5]), std::max(cone[4], cone[5]));
- _edges[5] = EdgeType(std::min(cone[5], cone[6]), std::max(cone[5], cone[6]));
- _edges[6] = EdgeType(std::min(cone[6], cone[7]), std::max(cone[6], cone[7]));
- _edges[7] = EdgeType(std::min(cone[7], cone[4]), std::max(cone[7], cone[4]));
-
- _edges[8] = EdgeType(std::min(cone[0], cone[4]), std::max(cone[0], cone[4]));
- _edges[9] = EdgeType(std::min(cone[1], cone[5]), std::max(cone[1], cone[5]));
- _edges[10] = EdgeType(std::min(cone[2], cone[6]), std::max(cone[2], cone[6]));
- _edges[11] = EdgeType(std::min(cone[3], cone[7]), std::max(cone[3], cone[7]));
-
- *numEdges = 12;
- *edges = _edges;
-} // _edges_HEXAHEDRON
-
-// ----------------------------------------------------------------------
-// Get edges of quadrilateral cohesive cell with Lagrange multipler
-// vertices.
-void
-ALE::CellRefinerHex8::_edges_QUAD_COHESIVE_LAGRANGE(const EdgeType** edges,
- int* numEdges,
- const point_type cone[],
- const int coneSize,
- const bool uncensored)
-{ // _edges_QUAD_COHESIVE_LAGRANGE
- if (uncensored) {
- // Include all edges
- assert(_edgesSize >= 12);
-
- assert(coneSize == 12);
- _edges[0] = EdgeType(std::min(cone[0], cone[1]),
- std::max(cone[0], cone[1]));
- _edges[1] = EdgeType(std::min(cone[1], cone[2]),
- std::max(cone[1], cone[2]));
- _edges[2] = EdgeType(std::min(cone[2], cone[3]),
- std::max(cone[2], cone[3]));
- _edges[3] = EdgeType(std::min(cone[3], cone[0]),
- std::max(cone[3], cone[0]));
-
- _edges[4] = EdgeType(std::min(cone[4], cone[5]),
- std::max(cone[4], cone[5]));
- _edges[5] = EdgeType(std::min(cone[5], cone[6]),
- std::max(cone[5], cone[6]));
- _edges[6] = EdgeType(std::min(cone[6], cone[7]),
- std::max(cone[6], cone[7]));
- _edges[7] = EdgeType(std::min(cone[7], cone[4]),
- std::max(cone[7], cone[4]));
-
- _edges[8] = EdgeType(std::min(cone[8], cone[9]),
- std::max(cone[8], cone[9]));
- _edges[9] = EdgeType(std::min(cone[9], cone[10]),
- std::max(cone[9], cone[10]));
- _edges[10] = EdgeType(std::min(cone[10], cone[11]),
- std::max(cone[10], cone[11]));
- _edges[11] = EdgeType(std::min(cone[11], cone[8]),
- std::max(cone[11], cone[8]));
-
- *numEdges = 12;
- *edges = _edges;
- } else {
- // Omit edges with censored (Lagrange multiplier) vertices.
- assert(_edgesSize >= 8);
-
- assert(coneSize == 12);
- _edges[0] = EdgeType(std::min(cone[0], cone[1]),
- std::max(cone[0], cone[1]));
- _edges[1] = EdgeType(std::min(cone[1], cone[2]),
- std::max(cone[1], cone[2]));
- _edges[2] = EdgeType(std::min(cone[2], cone[3]),
- std::max(cone[2], cone[3]));
- _edges[3] = EdgeType(std::min(cone[3], cone[0]),
- std::max(cone[3], cone[0]));
-
- _edges[4] = EdgeType(std::min(cone[4], cone[5]),
- std::max(cone[4], cone[5]));
- _edges[5] = EdgeType(std::min(cone[5], cone[6]),
- std::max(cone[5], cone[6]));
- _edges[6] = EdgeType(std::min(cone[6], cone[7]),
- std::max(cone[6], cone[7]));
- _edges[7] = EdgeType(std::min(cone[7], cone[4]),
- std::max(cone[7], cone[4]));
-
- *numEdges = 8;
- *edges = _edges;
- } // if/else
-} // _edges_QUAD_COHESIVE_LAGRANGE
-
-// ----------------------------------------------------------------------
-// Get faces of hexahedral cell.
-void
-ALE::CellRefinerHex8::_faces_HEXAHEDRON(const FaceType** faces,
- int* numFaces,
- const point_type cone[],
- const int coneSize)
-{ // _faces_HEXAHEDRON
- assert(_facesSize >= 6);
-
- assert(coneSize == 8);
-
- // Face 0, Vertices 0, 1, 5, 4
- if (cone[0] < cone[1] &&
- cone[0] < cone[4] &&
- cone[0] < cone[5]) {
- if (cone[1] < cone[4]) {
- _faces[0] = FaceType(cone[0], cone[1], cone[5], cone[4]);
- } else {
- _faces[0] = FaceType(cone[0], cone[4], cone[5], cone[1]);
- } // if/else
-
- } else if (cone[1] < cone[0] &&
- cone[1] < cone[4] &&
- cone[1] < cone[5]) {
- if (cone[0] < cone[5]) {
- _faces[0] = FaceType(cone[1], cone[0], cone[4], cone[5]);
- } else {
- _faces[0] = FaceType(cone[1], cone[5], cone[4], cone[0]);
- } // if/else
-
- } else if (cone[4] < cone[0] &&
- cone[4] < cone[1] &&
- cone[4] < cone[5]) {
- if (cone[0] < cone[5]) {
- _faces[0] = FaceType(cone[4], cone[0], cone[1], cone[5]);
- } else {
- _faces[0] = FaceType(cone[4], cone[5], cone[1], cone[0]);
- } // if/else
-
- } else if (cone[5] < cone[0] &&
- cone[5] < cone[1] &&
- cone[5] < cone[4]) {
- if (cone[1] < cone[4]) {
- _faces[0] = FaceType(cone[5], cone[1], cone[0], cone[4]);
- } else {
- _faces[0] = FaceType(cone[5], cone[4], cone[0], cone[1]);
- } // if/else
- } else {
- assert(0);
- throw ALE::Exception("Could not determine quad face orientation during uniform global refinement.");
- } // if/else
-
- // Face 1, Vertices 1, 2, 6, 5
- if (cone[1] < cone[2] &&
- cone[1] < cone[5] &&
- cone[1] < cone[6]) {
- if (cone[2] < cone[5]) {
- _faces[1] = FaceType(cone[1], cone[2], cone[6], cone[5]);
- } else {
- _faces[1] = FaceType(cone[1], cone[5], cone[6], cone[2]);
- } // if/else
-
- } else if (cone[2] < cone[1] &&
- cone[2] < cone[5] &&
- cone[2] < cone[6]) {
- if (cone[1] < cone[6]) {
- _faces[1] = FaceType(cone[2], cone[1], cone[5], cone[6]);
- } else {
- _faces[1] = FaceType(cone[2], cone[6], cone[5], cone[1]);
- } // if/else
-
- } else if (cone[5] < cone[1] &&
- cone[5] < cone[2] &&
- cone[5] < cone[6]) {
- if (cone[1] < cone[6]) {
- _faces[1] = FaceType(cone[5], cone[1], cone[2], cone[6]);
- } else {
- _faces[1] = FaceType(cone[5], cone[6], cone[2], cone[1]);
- } // if/else
-
- } else if (cone[6] < cone[1] &&
- cone[6] < cone[2] &&
- cone[6] < cone[5]) {
- if (cone[2] < cone[5]) {
- _faces[1] = FaceType(cone[6], cone[2], cone[1], cone[5]);
- } else {
- _faces[1] = FaceType(cone[6], cone[5], cone[1], cone[2]);
- } // if/else
- } else {
- assert(0);
- throw ALE::Exception("Could not determine quad face orientation during uniform global refinement.");
- } // if/else
-
- // Face 2, Vertices 2, 3, 7, 6
- if (cone[2] < cone[3] &&
- cone[2] < cone[6] &&
- cone[2] < cone[7]) {
- if (cone[3] < cone[6]) {
- _faces[2] = FaceType(cone[2], cone[3], cone[7], cone[6]);
- } else {
- _faces[2] = FaceType(cone[2], cone[6], cone[7], cone[3]);
- } // if/else
-
- } else if (cone[3] < cone[2] &&
- cone[3] < cone[6] &&
- cone[3] < cone[7]) {
- if (cone[2] < cone[7]) {
- _faces[2] = FaceType(cone[3], cone[2], cone[6], cone[7]);
- } else {
- _faces[2] = FaceType(cone[3], cone[7], cone[6], cone[2]);
- } // if/else
-
- } else if (cone[6] < cone[2] &&
- cone[6] < cone[3] &&
- cone[6] < cone[7]) {
- if (cone[2] < cone[7]) {
- _faces[2] = FaceType(cone[6], cone[2], cone[3], cone[7]);
- } else {
- _faces[2] = FaceType(cone[6], cone[7], cone[3], cone[2]);
- } // if/else
-
- } else if (cone[7] < cone[2] &&
- cone[7] < cone[3] &&
- cone[7] < cone[6]) {
- if (cone[3] < cone[6]) {
- _faces[2] = FaceType(cone[7], cone[3], cone[2], cone[6]);
- } else {
- _faces[2] = FaceType(cone[7], cone[6], cone[2], cone[3]);
- } // if/else
- } else {
- assert(0);
- throw ALE::Exception("Could not determine quad face orientation during uniform global refinement.");
- } // if/else
-
- // Face 3, Vertices 0, 3, 7, 4
- if (cone[0] < cone[3] &&
- cone[0] < cone[4] &&
- cone[0] < cone[7]) {
- if (cone[3] < cone[4]) {
- _faces[3] = FaceType(cone[0], cone[3], cone[7], cone[4]);
- } else {
- _faces[3] = FaceType(cone[0], cone[4], cone[7], cone[3]);
- } // if/else
-
- } else if (cone[3] < cone[0] &&
- cone[3] < cone[4] &&
- cone[3] < cone[7]) {
- if (cone[0] < cone[7]) {
- _faces[3] = FaceType(cone[3], cone[0], cone[4], cone[7]);
- } else {
- _faces[3] = FaceType(cone[3], cone[7], cone[4], cone[0]);
- } // if/else
-
- } else if (cone[4] < cone[0] &&
- cone[4] < cone[3] &&
- cone[4] < cone[7]) {
- if (cone[0] < cone[7]) {
- _faces[3] = FaceType(cone[4], cone[0], cone[3], cone[7]);
- } else {
- _faces[3] = FaceType(cone[4], cone[7], cone[3], cone[0]);
- } // if/else
-
- } else if (cone[7] < cone[0] &&
- cone[7] < cone[3] &&
- cone[7] < cone[4]) {
- if (cone[3] < cone[4]) {
- _faces[3] = FaceType(cone[7], cone[3], cone[0], cone[4]);
- } else {
- _faces[3] = FaceType(cone[7], cone[4], cone[0], cone[3]);
- } // if/else
- } else {
- assert(0);
- throw ALE::Exception("Could not determine quad face orientation during uniform global refinement.");
- } // if/else
-
- // Face 4: Vertices 0, 1, 2, 3
- if (cone[0] < cone[1] &&
- cone[0] < cone[2] &&
- cone[0] < cone[3]) {
- if (cone[1] < cone[3]) {
- _faces[4] = FaceType(cone[0], cone[1], cone[2], cone[3]);
- } else {
- _faces[4] = FaceType(cone[0], cone[3], cone[2], cone[1]);
- } // if/else
-
- } else if (cone[1] < cone[0] &&
- cone[1] < cone[2] &&
- cone[1] < cone[3]) {
- if (cone[0] < cone[2]) {
- _faces[4] = FaceType(cone[1], cone[0], cone[3], cone[2]);
- } else {
- _faces[4] = FaceType(cone[1], cone[2], cone[3], cone[0]);
- } // if/else
-
- } else if (cone[2] < cone[0] &&
- cone[2] < cone[1] &&
- cone[2] < cone[3]) {
- if (cone[1] < cone[3]) {
- _faces[4] = FaceType(cone[2], cone[1], cone[0], cone[3]);
- } else {
- _faces[4] = FaceType(cone[2], cone[3], cone[0], cone[1]);
- } // if/else
-
- } else if (cone[3] < cone[0] &&
- cone[3] < cone[1] &&
- cone[3] < cone[2]) {
- if (cone[0] < cone[2]) {
- _faces[4] = FaceType(cone[3], cone[0], cone[1], cone[2]);
- } else {
- _faces[4] = FaceType(cone[3], cone[2], cone[1], cone[0]);
- } // if/else
- } else {
- assert(0);
- throw ALE::Exception("Could not determine quad face orientation during uniform global refinement.");
- } // if/else
-
- // Face 5: Vertices 4, 5, 6, 7
- if (cone[4] < cone[5] &&
- cone[4] < cone[6] &&
- cone[4] < cone[7]) {
- if (cone[5] < cone[7]) {
- _faces[5] = FaceType(cone[4], cone[5], cone[6], cone[7]);
- } else {
- _faces[5] = FaceType(cone[4], cone[7], cone[6], cone[5]);
- } // if/else
-
- } else if (cone[5] < cone[4] &&
- cone[5] < cone[6] &&
- cone[5] < cone[7]) {
- if (cone[4] < cone[6]) {
- _faces[5] = FaceType(cone[5], cone[4], cone[7], cone[6]);
- } else {
- _faces[5] = FaceType(cone[5], cone[6], cone[7], cone[4]);
- } // if/else
-
- } else if (cone[6] < cone[4] &&
- cone[6] < cone[5] &&
- cone[6] < cone[7]) {
- if (cone[5] < cone[7]) {
- _faces[5] = FaceType(cone[6], cone[5], cone[4], cone[7]);
- } else {
- _faces[5] = FaceType(cone[6], cone[7], cone[4], cone[5]);
- } // if/else
-
- } else if (cone[7] < cone[4] &&
- cone[7] < cone[5] &&
- cone[7] < cone[6]) {
- if (cone[4] < cone[6]) {
- _faces[5] = FaceType(cone[7], cone[4], cone[5], cone[6]);
- } else {
- _faces[5] = FaceType(cone[7], cone[6], cone[5], cone[4]);
- } // if/else
- } else {
- assert(0);
- throw ALE::Exception("Could not determine quad face orientation during uniform global refinement.");
- } // if/else
-
- *numFaces = 6;
- *faces = _faces;
-} // _faces_HEXAHEDRON
-
-// ----------------------------------------------------------------------
-// Get faces of quadrilateral cohesive cell with Lagrange multipler
-// vertices.
-void
-ALE::CellRefinerHex8::_faces_QUAD_COHESIVE_LAGRANGE(const FaceType** faces,
- int* numFaces,
- const point_type cone[],
- const int coneSize,
- const bool uncensored)
-{ // _faces_QUAD_COHESIVE_LAGRANGE
- if (uncensored) {
- // Include all faces
- assert(_facesSize >= 3);
-
- assert(coneSize == 12);
-
- // Face 0, Vertices 0, 1, 2, 3
- if (cone[0] < cone[1] &&
- cone[0] < cone[2] &&
- cone[0] < cone[3]) {
- if (cone[1] < cone[3]) {
- _faces[0] = FaceType(cone[0], cone[1], cone[2], cone[3]);
- } else {
- _faces[0] = FaceType(cone[0], cone[3], cone[2], cone[1]);
- } // if/else
-
- } else if (cone[1] < cone[0] &&
- cone[1] < cone[2] &&
- cone[1] < cone[3]) {
- if (cone[0] < cone[2]) {
- _faces[0] = FaceType(cone[1], cone[0], cone[3], cone[2]);
- } else {
- _faces[0] = FaceType(cone[1], cone[2], cone[3], cone[0]);
- } // if/else
-
- } else if (cone[2] < cone[0] &&
- cone[2] < cone[1] &&
- cone[2] < cone[3]) {
- if (cone[1] < cone[3]) {
- _faces[0] = FaceType(cone[2], cone[1], cone[0], cone[3]);
- } else {
- _faces[0] = FaceType(cone[2], cone[3], cone[0], cone[1]);
- } // if/else
-
- } else if (cone[3] < cone[0] &&
- cone[3] < cone[1] &&
- cone[3] < cone[2]) {
- if (cone[0] < cone[2]) {
- _faces[0] = FaceType(cone[3], cone[0], cone[1], cone[2]);
- } else {
- _faces[0] = FaceType(cone[3], cone[2], cone[1], cone[0]);
- } // if/else
- } else {
- assert(0);
- throw ALE::Exception("Could not determine quad face orientation during uniform global refinement.");
- } // if/else
-
- // Face 1: Vertices 4, 5, 6, 7
- if (cone[4] < cone[5] &&
- cone[4] < cone[6] &&
- cone[4] < cone[7]) {
- if (cone[5] < cone[7]) {
- _faces[1] = FaceType(cone[4], cone[5], cone[6], cone[7]);
- } else {
- _faces[1] = FaceType(cone[4], cone[7], cone[6], cone[5]);
- } // if/else
-
- } else if (cone[5] < cone[4] &&
- cone[5] < cone[6] &&
- cone[5] < cone[7]) {
- if (cone[4] < cone[6]) {
- _faces[1] = FaceType(cone[5], cone[4], cone[7], cone[6]);
- } else {
- _faces[1] = FaceType(cone[5], cone[6], cone[7], cone[4]);
- } // if/else
-
- } else if (cone[6] < cone[4] &&
- cone[6] < cone[5] &&
- cone[6] < cone[7]) {
- if (cone[5] < cone[7]) {
- _faces[1] = FaceType(cone[6], cone[5], cone[4], cone[7]);
- } else {
- _faces[1] = FaceType(cone[6], cone[7], cone[4], cone[5]);
- } // if/else
-
- } else if (cone[7] < cone[4] &&
- cone[7] < cone[5] &&
- cone[7] < cone[6]) {
- if (cone[4] < cone[6]) {
- _faces[1] = FaceType(cone[7], cone[4], cone[5], cone[6]);
- } else {
- _faces[1] = FaceType(cone[7], cone[6], cone[5], cone[4]);
- } // if/else
- } else {
- assert(0);
- throw ALE::Exception("Could not determine quad face orientation during uniform global refinement.");
- } // if/else
-
- // Face 2: Vertices 8, 9, 10, 11
- if (cone[8] < cone[9] &&
- cone[8] < cone[10] &&
- cone[8] < cone[11]) {
- if (cone[9] < cone[11]) {
- _faces[2] = FaceType(cone[8], cone[9], cone[10], cone[11]);
- } else {
- _faces[2] = FaceType(cone[8], cone[11], cone[10], cone[9]);
- } // if/else
-
- } else if (cone[9] < cone[8] &&
- cone[9] < cone[10] &&
- cone[9] < cone[11]) {
- if (cone[8] < cone[10]) {
- _faces[2] = FaceType(cone[9], cone[8], cone[11], cone[10]);
- } else {
- _faces[2] = FaceType(cone[9], cone[10], cone[11], cone[8]);
- } // if/else
-
- } else if (cone[10] < cone[8] &&
- cone[10] < cone[9] &&
- cone[10] < cone[11]) {
- if (cone[9] < cone[11]) {
- _faces[2] = FaceType(cone[10], cone[9], cone[8], cone[11]);
- } else {
- _faces[2] = FaceType(cone[10], cone[11], cone[8], cone[9]);
- } // if/else
-
- } else if (cone[11] < cone[8] &&
- cone[11] < cone[9] &&
- cone[11] < cone[10]) {
- if (cone[8] < cone[10]) {
- _faces[2] = FaceType(cone[11], cone[8], cone[9], cone[10]);
- } else {
- _faces[2] = FaceType(cone[11], cone[10], cone[9], cone[8]);
- } // if/else
- } else {
- assert(0);
- throw ALE::Exception("Could not determine quad face orientation during uniform global refinement.");
- } // if/else
-
- *numFaces = 3;
- *faces = _faces;
- } else {
- // Omit faces with censored (Lagrange multiplier) vertices.
- assert(_facesSize >= 2);
-
- assert(coneSize == 12);
-
- // Face 0, Vertices 0, 1, 2, 3
- if (cone[0] < cone[1] &&
- cone[0] < cone[2] &&
- cone[0] < cone[3]) {
- if (cone[1] < cone[3]) {
- _faces[0] = FaceType(cone[0], cone[1], cone[2], cone[3]);
- } else {
- _faces[0] = FaceType(cone[0], cone[3], cone[2], cone[1]);
- } // if/else
-
- } else if (cone[1] < cone[0] &&
- cone[1] < cone[2] &&
- cone[1] < cone[3]) {
- if (cone[0] < cone[2]) {
- _faces[0] = FaceType(cone[1], cone[0], cone[3], cone[2]);
- } else {
- _faces[0] = FaceType(cone[1], cone[2], cone[3], cone[0]);
- } // if/else
-
- } else if (cone[2] < cone[0] &&
- cone[2] < cone[1] &&
- cone[2] < cone[3]) {
- if (cone[1] < cone[3]) {
- _faces[0] = FaceType(cone[2], cone[1], cone[0], cone[3]);
- } else {
- _faces[0] = FaceType(cone[2], cone[3], cone[0], cone[1]);
- } // if/else
-
- } else if (cone[3] < cone[0] &&
- cone[3] < cone[1] &&
- cone[3] < cone[2]) {
- if (cone[0] < cone[2]) {
- _faces[0] = FaceType(cone[3], cone[0], cone[1], cone[2]);
- } else {
- _faces[0] = FaceType(cone[3], cone[2], cone[1], cone[0]);
- } // if/else
- } else {
- assert(0);
- throw ALE::Exception("Could not determine quad face orientation during uniform global refinement.");
- } // if/else
-
- // Face 1: Vertices 4, 5, 6, 7
- if (cone[4] < cone[5] &&
- cone[4] < cone[6] &&
- cone[4] < cone[7]) {
- if (cone[5] < cone[7]) {
- _faces[1] = FaceType(cone[4], cone[5], cone[6], cone[7]);
- } else {
- _faces[1] = FaceType(cone[4], cone[7], cone[6], cone[5]);
- } // if/else
-
- } else if (cone[5] < cone[4] &&
- cone[5] < cone[6] &&
- cone[5] < cone[7]) {
- if (cone[4] < cone[6]) {
- _faces[1] = FaceType(cone[5], cone[4], cone[7], cone[6]);
- } else {
- _faces[1] = FaceType(cone[5], cone[6], cone[7], cone[4]);
- } // if/else
-
- } else if (cone[6] < cone[4] &&
- cone[6] < cone[5] &&
- cone[6] < cone[7]) {
- if (cone[5] < cone[7]) {
- _faces[1] = FaceType(cone[6], cone[5], cone[4], cone[7]);
- } else {
- _faces[1] = FaceType(cone[6], cone[7], cone[4], cone[5]);
- } // if/else
-
- } else if (cone[7] < cone[4] &&
- cone[7] < cone[5] &&
- cone[7] < cone[6]) {
- if (cone[4] < cone[6]) {
- _faces[1] = FaceType(cone[7], cone[4], cone[5], cone[6]);
- } else {
- _faces[1] = FaceType(cone[7], cone[6], cone[5], cone[4]);
- } // if/else
- } else {
- assert(0);
- throw ALE::Exception("Could not determine quad face orientation during uniform global refinement.");
- } // if/else
-
- *numFaces = 2;
- *faces = _faces;
- } // if/else
-} // _faces_QUAD_COHESIVE_LAGRANGE
-
-// ----------------------------------------------------------------------
-// Get volumes of hexahedral cell.
-void
-ALE::CellRefinerHex8::_volumes_HEXAHEDRON(const VolumeType** volumes,
- int* numVolumes,
- const point_type cone[],
- const int coneSize)
-{ // _volumes_HEXAHEDRON
- assert(_volumesSize >= 1);
-
- assert(coneSize == 8);
-
- int sortedCone[8];
- for (int i=0; i < 8; ++i)
- sortedCone[i] = cone[i];
- std::sort(sortedCone, sortedCone+coneSize);
-
- if (sortedCone[0] == cone[0]) {
- if (cone[1] < cone[3] &&
- cone[1] < cone[4]) {
- _volumes[0] = VolumeType(cone[0], cone[1], cone[2], cone[3],
- cone[4], cone[5], cone[6], cone[7]);
- } else if (cone[3] < cone[4]) {
- _volumes[0] = VolumeType(cone[0], cone[3], cone[7], cone[4],
- cone[1], cone[2], cone[6], cone[5]);
- } else {
- _volumes[0] = VolumeType(cone[0], cone[4], cone[5], cone[1],
- cone[3], cone[7], cone[6], cone[2]);
- } // if/else
-
- } else if (sortedCone[0] == cone[1]) {
- if (cone[0] < cone[2] &&
- cone[0] < cone[5]) {
- _volumes[0] = VolumeType(cone[1], cone[0], cone[4], cone[5],
- cone[2], cone[3], cone[7], cone[6]);
- } else if (cone[2] < cone[5]) {
- _volumes[0] = VolumeType(cone[1], cone[2], cone[3], cone[0],
- cone[5], cone[6], cone[7], cone[4]);
- } else {
- _volumes[0] = VolumeType(cone[1], cone[5], cone[6], cone[2],
- cone[0], cone[4], cone[7], cone[3]);
- } // if/else
-
- } else if (sortedCone[0] == cone[2]) {
- if (cone[1] < cone[3] &&
- cone[1] < cone[6]) {
- _volumes[0] = VolumeType(cone[2], cone[1], cone[5], cone[6],
- cone[3], cone[0], cone[4], cone[7]);
- } else if (cone[3] < cone[6]) {
- _volumes[0] = VolumeType(cone[2], cone[3], cone[0], cone[1],
- cone[6], cone[7], cone[4], cone[5]);
- } else {
- _volumes[0] = VolumeType(cone[2], cone[6], cone[7], cone[3],
- cone[1], cone[5], cone[4], cone[0]);
- } // if/else
-
- } else if (sortedCone[0] == cone[3]) {
- if (cone[0] < cone[2] &&
- cone[0] < cone[7]) {
- _volumes[0] = VolumeType(cone[3], cone[0], cone[1], cone[2],
- cone[7], cone[4], cone[5], cone[6]);
- } else if (cone[2] < cone[7]) {
- _volumes[0] = VolumeType(cone[3], cone[2], cone[6], cone[7],
- cone[0], cone[1], cone[5], cone[4]);
- } else {
- _volumes[0] = VolumeType(cone[3], cone[7], cone[4], cone[0],
- cone[2], cone[6], cone[5], cone[1]);
- } // if/else
-
- } else if (sortedCone[0] == cone[4]) {
- if (cone[0] < cone[5] &&
- cone[0] < cone[7]) {
- _volumes[0] = VolumeType(cone[4], cone[0], cone[3], cone[7],
- cone[5], cone[1], cone[2], cone[6]);
- } else if (cone[5] < cone[7]) {
- _volumes[0] = VolumeType(cone[4], cone[5], cone[1], cone[0],
- cone[7], cone[6], cone[2], cone[3]);
- } else {
- _volumes[0] = VolumeType(cone[4], cone[7], cone[6], cone[5],
- cone[0], cone[3], cone[2], cone[1]);
- } // if/else
-
- } else if (sortedCone[0] == cone[5]) {
- if (cone[1] < cone[4] &&
- cone[1] < cone[6]) {
- _volumes[0] = VolumeType(cone[5], cone[1], cone[0], cone[4],
- cone[6], cone[2], cone[3], cone[7]);
- } else if (cone[4] < cone[6]) {
- _volumes[0] = VolumeType(cone[5], cone[4], cone[7], cone[6],
- cone[1], cone[0], cone[3], cone[2]);
- } else {
- _volumes[0] = VolumeType(cone[5], cone[6], cone[2], cone[1],
- cone[4], cone[7], cone[3], cone[0]);
- } // if/else
-
-
- } else if (sortedCone[0] == cone[6]) {
- if (cone[2] < cone[5] &&
- cone[2] < cone[7]) {
- _volumes[0] = VolumeType(cone[6], cone[2], cone[1], cone[5],
- cone[7], cone[3], cone[0], cone[4]);
- } else if (cone[5] < cone[7]) {
- _volumes[0] = VolumeType(cone[6], cone[5], cone[4], cone[7],
- cone[2], cone[1], cone[0], cone[3]);
- } else {
- _volumes[0] = VolumeType(cone[6], cone[7], cone[3], cone[2],
- cone[5], cone[4], cone[0], cone[1]);
- } // if/else
-
-
- } else if (sortedCone[0] == cone[7]) {
- if (cone[3] < cone[4] &&
- cone[3] < cone[6]) {
- _volumes[0] = VolumeType(cone[7], cone[3], cone[2], cone[6],
- cone[4], cone[0], cone[1], cone[5]);
- } else if (cone[4] < cone[6]) {
- _volumes[0] = VolumeType(cone[7], cone[4], cone[0], cone[3],
- cone[6], cone[5], cone[1], cone[2]);
- } else {
- _volumes[0] = VolumeType(cone[7], cone[6], cone[5], cone[4],
- cone[3], cone[2], cone[1], cone[0]);
- } // if/else
-
- } else {
- assert(0);
- throw ALE::Exception("Could not determine quad face orientation during uniform global refinement.");
- } // if/else
- *numVolumes = 1;
- *volumes = _volumes;
-} // _volumes_HEXAHEDRON
-
-// ----------------------------------------------------------------------
-// Get new cells from refinement of a hexahedral cell.
-void
-ALE::CellRefinerHex8::_newCells_HEXAHEDRON(const point_type** cells,
- int *numCells,
- const point_type cone[],
- const int coneSize,
- const int coneVertexOffset)
-{ // _newCells_HEXAHEDRON
- const int coneSizeHex8 = 8;
- const int numEdgesHex8 = 12;
- const int numFacesHex8 = 6;
- const int numVolumesHex8 = 1;
- const int numNewCells = 8;
- const int numNewVertices = 19;
-
- int numEdges = 0;
- const EdgeType* edges;
- _edges_HEXAHEDRON(&edges, &numEdges, cone, coneSize);
- assert(numEdgesHex8 == numEdges);
-
- int numFaces = 0;
- const FaceType* faces;
- _faces_HEXAHEDRON(&faces, &numFaces, cone, coneSize);
- assert(numFacesHex8 == numFaces);
-
- int numVolumes = 0;
- const VolumeType* volumes;
- _volumes_HEXAHEDRON(&volumes, &numVolumes, cone, coneSize);
- assert(numVolumesHex8 == numVolumes);
-
- assert(_cellsSize >= numNewCells*coneSizeHex8);
- point_type newVertices[numNewVertices];
- int iNewVertex = 0;
- for(int iEdge=0; iEdge < numEdgesHex8; ++iEdge) {
- if (_edgeToVertex.find(edges[iEdge]) == _edgeToVertex.end()) {
- throw ALE::Exception("Missing edge in refined mesh");
- } // if
- newVertices[iNewVertex++] = _edgeToVertex[edges[iEdge]];
- } // for
- for(int iFace=0; iFace < numFacesHex8; ++iFace) {
- if (_faceToVertex.find(faces[iFace]) == _faceToVertex.end()) {
- throw ALE::Exception("Missing face in refined mesh");
- } // if
- newVertices[iNewVertex++] = _faceToVertex[faces[iFace]];
- } // for
- for(int iVolume=0; iVolume < numVolumesHex8; ++iVolume) {
- if (_volumeToVertex.find(volumes[iVolume]) == _volumeToVertex.end()) {
- throw ALE::Exception("Missing volume in refined mesh");
- } // if
- newVertices[iNewVertex++] = _volumeToVertex[volumes[iVolume]];
- } // for
-
- // new cell 0
- _cells[0*8+0] = cone[0] + coneVertexOffset;
- _cells[0*8+1] = newVertices[ 0];
- _cells[0*8+2] = newVertices[16];
- _cells[0*8+3] = newVertices[ 3];
- _cells[0*8+4] = newVertices[ 8];
- _cells[0*8+5] = newVertices[12];
- _cells[0*8+6] = newVertices[18];
- _cells[0*8+7] = newVertices[15];
-
- // new cell 1
- _cells[1*8+0] = cone[1] + coneVertexOffset;
- _cells[1*8+1] = newVertices[ 1];
- _cells[1*8+2] = newVertices[16];
- _cells[1*8+3] = newVertices[ 0];
- _cells[1*8+4] = newVertices[ 9];
- _cells[1*8+5] = newVertices[13];
- _cells[1*8+6] = newVertices[18];
- _cells[1*8+7] = newVertices[12];
-
- // new cell 2
- _cells[2*8+0] = cone[2] + coneVertexOffset;
- _cells[2*8+1] = newVertices[ 2];
- _cells[2*8+2] = newVertices[16];
- _cells[2*8+3] = newVertices[ 1];
- _cells[2*8+4] = newVertices[10];
- _cells[2*8+5] = newVertices[14];
- _cells[2*8+6] = newVertices[18];
- _cells[2*8+7] = newVertices[13];
-
- // new cell 3
- _cells[3*8+0] = cone[3] + coneVertexOffset;
- _cells[3*8+1] = newVertices[ 3];
- _cells[3*8+2] = newVertices[16];
- _cells[3*8+3] = newVertices[ 2];
- _cells[3*8+4] = newVertices[11];
- _cells[3*8+5] = newVertices[15];
- _cells[3*8+6] = newVertices[18];
- _cells[3*8+7] = newVertices[14];
-
- // new cell 4
- _cells[4*8+0] = newVertices[ 8];
- _cells[4*8+1] = newVertices[12];
- _cells[4*8+2] = newVertices[18];
- _cells[4*8+3] = newVertices[15];
- _cells[4*8+4] = cone[4] + coneVertexOffset;
- _cells[4*8+5] = newVertices[ 4];
- _cells[4*8+6] = newVertices[17];
- _cells[4*8+7] = newVertices[ 7];
-
- // new cell 5
- _cells[5*8+0] = newVertices[ 9];
- _cells[5*8+1] = newVertices[13];
- _cells[5*8+2] = newVertices[18];
- _cells[5*8+3] = newVertices[12];
- _cells[5*8+4] = cone[5] + coneVertexOffset;
- _cells[5*8+5] = newVertices[ 5];
- _cells[5*8+6] = newVertices[17];
- _cells[5*8+7] = newVertices[ 4];
-
- // new cell 6
- _cells[6*8+0] = newVertices[10];
- _cells[6*8+1] = newVertices[14];
- _cells[6*8+2] = newVertices[18];
- _cells[6*8+3] = newVertices[13];
- _cells[6*8+4] = cone[6] + coneVertexOffset;
- _cells[6*8+5] = newVertices[ 6];
- _cells[6*8+6] = newVertices[17];
- _cells[6*8+7] = newVertices[ 5];
-
- // new cell 7
- _cells[7*8+0] = newVertices[11];
- _cells[7*8+1] = newVertices[15];
- _cells[7*8+2] = newVertices[18];
- _cells[7*8+3] = newVertices[14];
- _cells[7*8+4] = cone[7] + coneVertexOffset;
- _cells[7*8+5] = newVertices[ 7];
- _cells[7*8+6] = newVertices[17];
- _cells[7*8+7] = newVertices[ 6];
-
- *numCells = numNewCells;
- *cells = _cells;
-} // _newCells_QUADRILATERAL
-
-// ----------------------------------------------------------------------
-// Get new cells from refinement of a quad cohseive cell with Lagrange
-// multiplier vertices.
-void
-ALE::CellRefinerHex8::_newCells_QUAD_COHESIVE_LAGRANGE(const point_type** cells,
- int *numCells,
- const point_type cone[],
- const int coneSize,
- const int coneVertexOffsetNormal,
- const int coneVertexOffsetCensored)
-{ // _newCells_QUAD_COHESIVE_LAGRANGE
- const int coneSizeQuad12 = 12;
- const int numEdgesQuad12 = 12;
- const int numFacesQuad12 = 3;
- const int numNewCells = 4;
- const int numNewVertices = 15;
-
- int numEdges = 0;
- const EdgeType *edges;
- _edges_QUAD_COHESIVE_LAGRANGE(&edges, &numEdges, cone, coneSize, true);
- assert(numEdgesQuad12 == numEdges);
-
- int numFaces = 0;
- const FaceType *faces;
- _faces_QUAD_COHESIVE_LAGRANGE(&faces, &numFaces, cone, coneSize, true);
- assert(numFacesQuad12 == numFaces);
-
- assert(_cellsSize >= numNewCells*coneSizeQuad12);
- point_type newVertices[numNewVertices];
- int iNewVertex = 0;
- for(int iEdge=0; iEdge < numEdgesQuad12; ++iEdge) {
- if (_edgeToVertex.find(edges[iEdge]) == _edgeToVertex.end()) {
- throw ALE::Exception("Missing edge in refined mesh");
- } // if
- newVertices[iNewVertex++] = _edgeToVertex[edges[iEdge]];
- } // for
- for(int iFace=0; iFace < numFacesQuad12; ++iFace) {
- if (_faceToVertex.find(faces[iFace]) == _faceToVertex.end()) {
- throw ALE::Exception("Missing face in refined mesh");
- } // if
- newVertices[iNewVertex++] = _faceToVertex[faces[iFace]];
- } // for
- assert(numNewVertices == iNewVertex);
-
- // new cell 0
- _cells[0*12+ 0] = cone[0] + coneVertexOffsetNormal;
- _cells[0*12+ 1] = newVertices[ 0];
- _cells[0*12+ 2] = newVertices[12];
- _cells[0*12+ 3] = newVertices[ 3];
- _cells[0*12+ 4] = cone[4] + coneVertexOffsetNormal;
- _cells[0*12+ 5] = newVertices[ 4];
- _cells[0*12+ 6] = newVertices[13];
- _cells[0*12+ 7] = newVertices[ 7];
- _cells[0*12+ 8] = cone[8] + coneVertexOffsetCensored;
- _cells[0*12+ 9] = newVertices[ 8];
- _cells[0*12+10] = newVertices[14];
- _cells[0*12+11] = newVertices[11];
-
- // new cell 1
- _cells[1*12+ 0] = cone[1] + coneVertexOffsetNormal;
- _cells[1*12+ 1] = newVertices[ 1];
- _cells[1*12+ 2] = newVertices[12];
- _cells[1*12+ 3] = newVertices[ 0];
- _cells[1*12+ 4] = cone[5] + coneVertexOffsetNormal;
- _cells[1*12+ 5] = newVertices[ 5];
- _cells[1*12+ 6] = newVertices[13];
- _cells[1*12+ 7] = newVertices[ 4];
- _cells[1*12+ 8] = cone[9] + coneVertexOffsetCensored;
- _cells[1*12+ 9] = newVertices[ 9];
- _cells[1*12+10] = newVertices[14];
- _cells[1*12+11] = newVertices[ 8];
-
- // new cell 2
- _cells[2*12+ 0] = cone[2] + coneVertexOffsetNormal;
- _cells[2*12+ 1] = newVertices[ 2];
- _cells[2*12+ 2] = newVertices[12];
- _cells[2*12+ 3] = newVertices[ 1];
- _cells[2*12+ 4] = cone[6] + coneVertexOffsetNormal;
- _cells[2*12+ 5] = newVertices[ 6];
- _cells[2*12+ 6] = newVertices[13];
- _cells[2*12+ 7] = newVertices[ 5];
- _cells[2*12+ 8] = cone[10] + coneVertexOffsetCensored;
- _cells[2*12+ 9] = newVertices[10];
- _cells[2*12+10] = newVertices[14];
- _cells[2*12+11] = newVertices[ 9];
-
- // new cell 3
- _cells[3*12+ 0] = cone[3] + coneVertexOffsetNormal;
- _cells[3*12+ 1] = newVertices[ 3];
- _cells[3*12+ 2] = newVertices[12];
- _cells[3*12+ 3] = newVertices[ 2];
- _cells[3*12+ 4] = cone[7] + coneVertexOffsetNormal;
- _cells[3*12+ 5] = newVertices[ 7];
- _cells[3*12+ 6] = newVertices[13];
- _cells[3*12+ 7] = newVertices[ 6];
- _cells[3*12+ 8] = cone[11] + coneVertexOffsetCensored;
- _cells[3*12+ 9] = newVertices[11];
- _cells[3*12+10] = newVertices[14];
- _cells[3*12+11] = newVertices[10];
-
- *numCells = 4;
- *cells = _cells;
-} // _newCells_QUAD_COHESIVE_LAGRANGE
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/libsrc/pylith/topology/CellRefinerHex8.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/CellRefinerHex8.hh 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/CellRefinerHex8.hh 2013-07-26 22:13:24 UTC (rev 22685)
@@ -1,237 +0,0 @@
-// -*- 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-2013 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ======================================================================
-//
-
-/**
- * @file libsrc/topology/CellRefinerHex8.hh
- *
- * @brief Object for hex8 refinement of cells.
- */
-
-#if !defined(pylith_topology_cellrefinerhex8_hh)
-#define pylith_topology_cellrefinerhex8_hh
-
-// Include directives ---------------------------------------------------
-#include "RefineVol8Face4Edges2.hh" // ISA RefineVol8Face4Edges2
-
-// CellRefinerHex8 ------------------------------------------------------
-/// Object for hex8 refinement of cells.
-class ALE::CellRefinerHex8 : public RefineVol8Face4Edges2
-{ // CellRefinerHex8
-// PUBLIC MEMBERS ///////////////////////////////////////////////////////
-public :
-
- /** Constructor
- *
- * @param mesh Finite-element mesh.
- */
- CellRefinerHex8(const mesh_type& mesh);
-
- /// Destructor
- ~CellRefinerHex8(void);
-
- /** Get number of refined cells for each original cell.
- *
- * @param cell Original cell.
- *
- * @returns Number of refined cells.
- */
- int numNewCells(const point_type cell);
-
- /** Split cell into smaller cells of same type. Do not create
- * censored vertices on censored cells.
- *
- * @param cell Original cell.
- * @param cone Vertices in cell (original mesh).
- * @param coneSize Number of vertices in cell.
- * @param curNewVertex Value for next new vertex.
- */
- void splitCell(const point_type cell,
- const point_type cone[],
- const int coneSize,
- point_type* curNewVertex);
-
- /** Split cell into smaller cells of same type. Create only censored
- * vertices on censored cells.
- *
- * @param cell Original cell.
- * @param cone Vertices in cell (original mesh).
- * @param coneSize Number of vertices in cell.
- * @param curNewVertex Value for next new vertex.
- */
- void splitCellUncensored(const point_type cell,
- const point_type cone[],
- const int coneSize,
- point_type* curNewVertex);
-
- /** Get refined cells.
- *
- * @param cells Vertices in refined cells (refined mesh).
- * @param numCells Number of refined cells.
- * @param cone Vertices in cell (original mesh).
- * @param coneSize Number of vertices in cell.
- * @param orderOldMesh Order in old mesh.
- * @param orderNewMesh Order in new mesh.
- */
- void getNewCells(const point_type** cells,
- int* numCells,
- const point_type cell,
- const point_type cone[],
- const int coneSize,
- const MeshOrder& orderOldMesh,
- const MeshOrder& orderNewMesh);
-
-// PRIVATE ENUMS ////////////////////////////////////////////////////////
-private :
-
- enum CellEnum {
- HEXAHEDRON, // Normal hexahedral cell
- QUAD_COHESIVE_LAGRANGE, // Cohesive cell with Lagrange multiplier vertices
- };
-
-// PRIVATE METHODS //////////////////////////////////////////////////////
-private :
-
- /** Get cell type.
- *
- * @param cell Cell in original mesh.
- * @returns Cell type.
- */
- CellEnum _cellType(const point_type cell);
-
- /** Get edges of hexahedral cell.
- *
- * @param edges Edges of cell.
- * @param numEdges Number of edges.
- * @param cone Vertices in cell (original mesh).
- * @param coneSize Number of vertices in cell.
- */
- void _edges_HEXAHEDRON(const EdgeType** edges,
- int* numEdges,
- const point_type cone[],
- const int coneSize);
-
- /** Get edges of quadrilateral cohesive cell with Lagrange multipler
- * vertices.
- *
- * @param edges Edges of cell.
- * @param numEdges Number of edges.
- * @param cone Vertices in cell (original mesh).
- * @param coneSize Number of vertices in cell.
- * @param uncensored True if including edges with censored vertices.
- */
- void _edges_QUAD_COHESIVE_LAGRANGE(const EdgeType** edges,
- int* numEdges,
- const point_type cone[],
- const int coneSize,
- const bool uncensored =false);
-
- /** Get faces of hexahedral cell.
- *
- * @param faces Faces of cell.
- * @param numFaces Number of faces.
- * @param cone Vertices in cell (original mesh).
- * @param coneSize Number of vertices in cell.
- */
- void _faces_HEXAHEDRON(const FaceType** faces,
- int* numFaces,
- const point_type cone[],
- const int coneSize);
-
- /** Get faces of quadrilateral cohesive cell with Lagrange multipler
- * vertices.
- *
- * @param faces Faces of cell.
- * @param numFaces Number of faces.
- * @param cone Vertices in cell (original mesh).
- * @param coneSize Number of vertices in cell.
- * @param uncensored True if including faces with censored vertices.
- */
- void _faces_QUAD_COHESIVE_LAGRANGE(const FaceType** faces,
- int* numFaces,
- const point_type cone[],
- const int coneSize,
- const bool uncensored =false);
-
- /** Get volumes of hexahedral cell.
- *
- * @param volumes Volumes of cell.
- * @param numFaces Number of faces.
- * @param cone Vertices in cell (original mesh).
- * @param coneSize Number of vertices in cell.
- */
- void _volumes_HEXAHEDRON(const VolumeType** volumes,
- int* numVoplumes,
- const point_type cone[],
- const int coneSize);
-
- /** Get new cells from refinement of a hexahedral cell.
- *
- * @param cells Vertices in refined cells (refined mesh).
- * @param numCells Number of refined cells.
- * @param cone Vertices in cell (original mesh).
- * @param coneSize Number of vertices in cell.
- * @param coneVertexOffset Offset for cone vertices.
- */
- void _newCells_HEXAHEDRON(const point_type** cells,
- int *numCells,
- const point_type cone[],
- const int coneSize,
- const int coneVertexOffset);
-
- /** Get new cells from refinement of a quadrilateral cohseive cell
- * with Lagrange multiplier vertices.
- *
- * @param cells Vertices in refined cells (refined mesh).
- * @param numCells Number of refined cells.
- * @param cone Vertices in cell (original mesh).
- * @param coneSize Number of vertices in cell.
- * @param coneVertexOffsetNormal Offset for normal cone vertices.
- * @param coneVertexOffset Offset for censored cone vertices.
- */
- void _newCells_QUAD_COHESIVE_LAGRANGE(const point_type** cells,
- int *numCells,
- const point_type cone[],
- const int coneSize,
- const int coneVertexOffsetNormal,
- const int coneVertexOffsetCensored);
-
-// PRIVATE MEMBERS //////////////////////////////////////////////////////
-private :
-
- static const int _edgesSize;
- static const int _facesSize;
- static const int _volumesSize;
- static const int _cellsSize;
- EdgeType _edges[12]; ///< Buffer for edges
- FaceType _faces[6]; ///< Buffer for faces
- VolumeType _volumes[1]; ///< Buffer for volumes
- point_type _cells[64]; ///< Buffer for cells
-
-
-// NOT IMPLEMENTED //////////////////////////////////////////////////////
-private :
-
- CellRefinerHex8(const CellRefinerHex8&); ///< Not implemented
- const CellRefinerHex8& operator=(const CellRefinerHex8&); ///< Not implemented
-
-}; // CellRefinerHex8
-
-#endif // pylith_topology_cellrefinerhex8_hh
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/libsrc/pylith/topology/CellRefinerQuad4.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/CellRefinerQuad4.cc 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/CellRefinerQuad4.cc 2013-07-26 22:13:24 UTC (rev 22685)
@@ -1,428 +0,0 @@
-// -*- 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-2013 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ======================================================================
-//
-
-#include <portinfo>
-
-#include "CellRefinerQuad4.hh" // implementation of class methods
-
-#include "MeshOrder.hh" // USES MeshOrder
-
-#include <cassert> // USES assert()
-
-#include <iostream> // TEMPORARY
-// ----------------------------------------------------------------------
-// These must match the sizes of the buffers in the header file.
-const int ALE::CellRefinerQuad4::_edgesSize = 4;
-const int ALE::CellRefinerQuad4::_facesSize = 1;
-const int ALE::CellRefinerQuad4::_cellsSize = 16;
-
-// ----------------------------------------------------------------------
-// Constructor
-ALE::CellRefinerQuad4::CellRefinerQuad4(const mesh_type& mesh) :
- RefineFace4Edges2(mesh)
-{ // constructor
- assert(2 == mesh.getDimension());
-} // constructor
-
-// ----------------------------------------------------------------------
-// Destructor
-ALE::CellRefinerQuad4::~CellRefinerQuad4(void)
-{ // destructor
-} // destructor
-
-// ----------------------------------------------------------------------
-// Get number of refined cells for each original cell.
-int
-ALE::CellRefinerQuad4::numNewCells(const point_type cell)
-{ // numNewCells
- switch (_cellType(cell)) {
- case QUADRILATERAL:
- return 4;
- case LINE_COHESIVE_LAGRANGE:
- return 2;
- default:
- assert(0);
- throw ALE::Exception("Unknown cell type.");
- } // switch
-} // numNewCells
-
-// ----------------------------------------------------------------------
-// Split cell into smaller cells of same type.
-void
-ALE::CellRefinerQuad4::splitCell(const point_type cell,
- const point_type cone[],
- const int coneSize,
- point_type* curNewVertex)
-{ // splitCell
- assert(curNewVertex);
-
- int numEdges = 0;
- const EdgeType* edges;
-
- int numFaces = 0;
- const FaceType* faces;
-
- switch (_cellType(cell)) {
- case QUADRILATERAL:
- _edges_QUADRILATERAL(&edges, &numEdges, cone, coneSize);
- _faces_QUADRILATERAL(&faces, &numFaces, cone, coneSize);
- break;
- case LINE_COHESIVE_LAGRANGE:
- _edges_LINE_COHESIVE_LAGRANGE(&edges, &numEdges, cone, coneSize);
- break;
- default:
- throw ALE::Exception("Unknown cell type.");
- } // switch
-
- for(int iEdge=0; iEdge < numEdges; ++iEdge) {
- if (_edgeToVertex.find(edges[iEdge]) == _edgeToVertex.end()) {
- // if vertex does not exist
- //std::cout << "Edge: " << edges[iEdge] << ", new vertex: " << *curNewVertex << std::endl;
- _edgeToVertex[edges[iEdge]] = *curNewVertex;
- ++(*curNewVertex);
- } // if
- } // for
-
- for(int iFace=0; iFace < numFaces; ++iFace) {
- if (_faceToVertex.find(faces[iFace]) == _faceToVertex.end()) {
- // if vertex does not exist
- //std::cout << "Face: " << faces[iFace] << ", new vertex: " << *curNewVertex << std::endl;
- _faceToVertex[faces[iFace]] = *curNewVertex;
- ++(*curNewVertex);
- } // if
- } // for
-} // splitCell
-
-// ----------------------------------------------------------------------
-// Split cell into smaller cells of same type.
-void
-ALE::CellRefinerQuad4::splitCellUncensored(const point_type cell,
- const point_type cone[],
- const int coneSize,
- point_type* curNewVertex)
-{ // splitCellUncensored
- assert(curNewVertex);
-
- int numEdges = 0;
- const EdgeType* edges;
-
- const bool uncensored = true;
-
- switch (_cellType(cell)) {
- case QUADRILATERAL:
- // No censored vertices on normal cell.
- break;
- case LINE_COHESIVE_LAGRANGE:
- _edges_LINE_COHESIVE_LAGRANGE(&edges, &numEdges, cone, coneSize, uncensored);
- break;
- default:
- throw ALE::Exception("Unknown cell type.");
- } // switch
-
- for(int iEdge=0; iEdge < numEdges; ++iEdge) {
- if (_edgeToVertex.find(edges[iEdge]) == _edgeToVertex.end()) {
- // if vertex does not exist
- //std::cout << "Edge: " << edges[iEdge] << ", new vertex: " << *curNewVertex << std::endl;
- _edgeToVertex[edges[iEdge]] = *curNewVertex;
- ++(*curNewVertex);
- } // if
- } // for
-
-} // splitCellUncensored
-
-// ----------------------------------------------------------------------
-// Get refined cells.
-void
-ALE::CellRefinerQuad4::getNewCells(const point_type** cells,
- int* numCells,
- const point_type cell,
- const point_type cone[],
- const int coneSize,
- const MeshOrder& orderOldMesh,
- const MeshOrder& orderNewMesh)
-{ // getNewCells
- assert(cells);
- assert(numCells);
-
- switch (_cellType(cell)) {
- case QUADRILATERAL: {
- const int coneVertexOffset = orderNewMesh.verticesNormal().min() - orderOldMesh.verticesNormal().min();
- _newCells_QUADRILATERAL(cells, numCells, cone, coneSize, coneVertexOffset);
- break;
- } // QUADRILATERAL
- case LINE_COHESIVE_LAGRANGE: {
- const int coneVertexOffsetNormal = orderNewMesh.verticesNormal().min() - orderOldMesh.verticesNormal().min();
- const int coneVertexOffsetCensored = orderNewMesh.verticesCensored().min() - orderOldMesh.verticesCensored().min();
- _newCells_LINE_COHESIVE_LAGRANGE(cells, numCells, cone, coneSize, coneVertexOffsetNormal, coneVertexOffsetCensored);
- break;
- } // LINE_COHESIVE_LAGRANGE
- default:
- throw ALE::Exception("Unknown cell type.");
- } // switch
-} // getNewCells
-
-// ----------------------------------------------------------------------
-// Get cell type.
-ALE::CellRefinerQuad4::CellEnum
-ALE::CellRefinerQuad4::_cellType(const point_type cell)
-{ // _cellType
- assert(!_mesh.getSieve().isNull());
-
- switch (_mesh.getSieve()->getConeSize(cell)) {
- case 4:
- return QUADRILATERAL;
- case 6:
- return LINE_COHESIVE_LAGRANGE;
- case 0: {
- std::ostringstream msg;
- std::cerr << "Internal error. Cone size for mesh point " << cell << " is zero. May be a vertex.";
- assert(0);
- throw ALE::Exception("Could not determine cell type during uniform global refinement.");
- } // case 0
- default : {
- std::ostringstream msg;
- std::cerr << "Internal error. Unknown cone size for mesh point " << cell << ". Unknown cell type.";
- assert(0);
- throw ALE::Exception("Could not determine cell type during uniform global refinement.");
- } // default
- } // switch
-} // _cellType
-
-// ----------------------------------------------------------------------
-// Get edges of quadrilateral cell.
-void
-ALE::CellRefinerQuad4::_edges_QUADRILATERAL(const EdgeType** edges,
- int* numEdges,
- const point_type cone[],
- const int coneSize)
-{ // _edges_QUADRILATERAL
- assert(_edgesSize >= 4);
-
- assert(coneSize == 4);
- _edges[0] = EdgeType(std::min(cone[0], cone[1]), std::max(cone[0], cone[1]));
- _edges[1] = EdgeType(std::min(cone[1], cone[2]), std::max(cone[1], cone[2]));
- _edges[2] = EdgeType(std::min(cone[2], cone[3]), std::max(cone[2], cone[3]));
- _edges[3] = EdgeType(std::min(cone[3], cone[0]), std::max(cone[3], cone[0]));
- *numEdges = 4;
- *edges = _edges;
-} // _edges_QUADRILATERAL
-
-// ----------------------------------------------------------------------
-// Get edges of line cohesive cell with Lagrange multipler vertices.
-void
-ALE::CellRefinerQuad4::_edges_LINE_COHESIVE_LAGRANGE(const EdgeType** edges,
- int* numEdges,
- const point_type cone[],
- const int coneSize,
- const bool uncensored)
-{ // _edges_LINE_COHESIVE_LAGRANGE
- if (uncensored) {
- // Include all edges
- assert(_edgesSize >= 3);
-
- assert(coneSize == 6);
- _edges[0] = EdgeType(std::min(cone[0], cone[1]), std::max(cone[0], cone[1]));
- _edges[1] = EdgeType(std::min(cone[2], cone[3]), std::max(cone[2], cone[3]));
- _edges[2] = EdgeType(std::min(cone[4], cone[5]), std::max(cone[4], cone[5]));
- *numEdges = 3;
- *edges = _edges;
- } else {
- // Omit edges with censored (Lagrange multiplier) vertices.
- assert(_edgesSize >= 2);
-
- assert(coneSize == 6);
- _edges[0] = EdgeType(std::min(cone[0], cone[1]), std::max(cone[0], cone[1]));
- _edges[1] = EdgeType(std::min(cone[2], cone[3]), std::max(cone[2], cone[3]));
- *numEdges = 2;
- *edges = _edges;
- } // if/else
-} // _edges_LINE_COHESIVE_LAGRANGE
-
-// ----------------------------------------------------------------------
-// Get faces of quadrilateral cell.
-void
-ALE::CellRefinerQuad4::_faces_QUADRILATERAL(const FaceType** faces,
- int* numFaces,
- const point_type cone[],
- const int coneSize)
-{ // _faces_QUADRILATERAL
- assert(_facesSize >= 1);
-
- assert(coneSize == 4);
-
- int sortedCone[4];
- for (int i=0; i < 4; ++i)
- sortedCone[i] = cone[i];
- std::sort(sortedCone, sortedCone+coneSize);
-
- if (sortedCone[0] == cone[0]) {
- if (cone[1] < cone[3]) {
- _faces[0] = FaceType(cone[0], cone[1], cone[2], cone[3]);
- } else {
- _faces[0] = FaceType(cone[0], cone[3], cone[2], cone[1]);
- } // if/else
-
- } else if (sortedCone[0] == cone[1]) {
- if (cone[2] < cone[0]) {
- _faces[0] = FaceType(cone[1], cone[2], cone[3], cone[0]);
- } else {
- _faces[0] = FaceType(cone[1], cone[0], cone[3], cone[2]);
- } // if/else
-
- } else if (sortedCone[0] == cone[2]) {
- if (cone[3] < cone[1]) {
- _faces[0] = FaceType(cone[2], cone[3], cone[0], cone[1]);
- } else {
- _faces[0] = FaceType(cone[2], cone[1], cone[3], cone[0]);
- } // if/else
-
- } else if (sortedCone[0] == cone[3]) {
- if (cone[0] < cone[2]) {
- _faces[0] = FaceType(cone[3], cone[0], cone[1], cone[2]);
- } else {
- _faces[0] = FaceType(cone[3], cone[2], cone[1], cone[0]);
- } // if/else
- } else {
- assert(0);
- throw ALE::Exception("Could not determine quad face orientation during uniform global refinement.");
- } // if/else
- *numFaces = 1;
- *faces = _faces;
-} // _faces_QUADRILATERAL
-
-// ----------------------------------------------------------------------
-// Get new cells from refinement of a triangular cell.
-void
- ALE::CellRefinerQuad4::_newCells_QUADRILATERAL(const point_type** cells,
- int *numCells,
- const point_type cone[],
- const int coneSize,
- const int coneVertexOffset)
-{ // _newCells_QUADRILATERAL
- const int coneSizeQuad4 = 4;
- const int numEdgesQuad4 = 4;
- const int numFacesQuad4 = 1;
- const int numNewCells = 4;
- const int numNewVertices = 5;
-
- int numEdges = 0;
- const EdgeType* edges;
- _edges_QUADRILATERAL(&edges, &numEdges, cone, coneSize);
- assert(numEdgesQuad4 == numEdges);
-
- int numFaces = 0;
- const FaceType* faces;
- _faces_QUADRILATERAL(&faces, &numFaces, cone, coneSize);
- assert(numFacesQuad4 == numFaces);
-
- assert(_cellsSize >= numNewCells*coneSizeQuad4);
- point_type newVertices[numNewVertices];
- int iNewVertex = 0;
- for(int iEdge=0; iEdge < numEdgesQuad4; ++iEdge) {
- if (_edgeToVertex.find(edges[iEdge]) == _edgeToVertex.end()) {
- throw ALE::Exception("Missing edge in refined mesh");
- } // if
- newVertices[iNewVertex++] = _edgeToVertex[edges[iEdge]];
- } // for
- for(int iFace=0; iFace < numFacesQuad4; ++iFace) {
- if (_faceToVertex.find(faces[iFace]) == _faceToVertex.end()) {
- throw ALE::Exception("Missing face in refined mesh");
- } // if
- newVertices[iNewVertex++] = _faceToVertex[faces[iFace]];
- } // for
-
- // new cell 0
- _cells[0*4+0] = cone[0] + coneVertexOffset;
- _cells[0*4+1] = newVertices[0];
- _cells[0*4+2] = newVertices[4];
- _cells[0*4+3] = newVertices[3];
-
- // new cell 1
- _cells[1*4+0] = cone[1] + coneVertexOffset;
- _cells[1*4+1] = newVertices[1];
- _cells[1*4+2] = newVertices[4];
- _cells[1*4+3] = newVertices[0];
-
- // new cell 2
- _cells[2*4+0] = cone[3] + coneVertexOffset;
- _cells[2*4+1] = newVertices[3];
- _cells[2*4+2] = newVertices[4];
- _cells[2*4+3] = newVertices[2];
-
- // new cell 3
- _cells[3*4+0] = cone[2] + coneVertexOffset;
- _cells[3*4+1] = newVertices[2];
- _cells[3*4+2] = newVertices[4];
- _cells[3*4+3] = newVertices[1];
-
- *numCells = numNewCells;
- *cells = _cells;
-} // _newCells_QUADRILATERAL
-
-// ----------------------------------------------------------------------
-// Get new cells from refinement of a line cohseive cell with Lagrange
-// multiplier vertices.
-void
-ALE::CellRefinerQuad4::_newCells_LINE_COHESIVE_LAGRANGE(const point_type** cells,
- int *numCells,
- const point_type cone[],
- const int coneSize,
- const int coneVertexOffsetNormal,
- const int coneVertexOffsetCensored)
-{ // _newCells_LINE_COHESIVE_LAGRANGE
- const int coneSizeLine6 = 6;
- const int numEdgesLine6 = 3;
- const int numNewCells = 2;
- const int numNewVertices = 3;
-
- int numEdges = 0;
- const EdgeType *edges;
- _edges_LINE_COHESIVE_LAGRANGE(&edges, &numEdges, cone, coneSize, true);
- assert(numEdgesLine6 == numEdges);
-
- assert(_cellsSize >= numNewCells*coneSizeLine6);
- point_type newVertices[numNewVertices];
- for(int iEdge=0, iNewVertex=0; iEdge < numEdgesLine6; ++iEdge) {
- if (_edgeToVertex.find(edges[iEdge]) == _edgeToVertex.end()) {
- throw ALE::Exception("Missing edge in refined mesh");
- } // if
- newVertices[iNewVertex++] = _edgeToVertex[edges[iEdge]];
- } // for
-
- // new cell 0
- _cells[0*6+0] = cone[0] + coneVertexOffsetNormal;
- _cells[0*6+1] = newVertices[0];
- _cells[0*6+2] = cone[2] + coneVertexOffsetNormal;
- _cells[0*6+3] = newVertices[1];
- _cells[0*6+4] = cone[4] + coneVertexOffsetCensored;
- _cells[0*6+5] = newVertices[2];
-
- // new cell 1
- _cells[1*6+0] = newVertices[0];
- _cells[1*6+1] = cone[1] + coneVertexOffsetNormal;
- _cells[1*6+2] = newVertices[1];
- _cells[1*6+3] = cone[3] + coneVertexOffsetNormal;
- _cells[1*6+4] = newVertices[2];
- _cells[1*6+5] = cone[5] + coneVertexOffsetCensored;
-
- *numCells = 2;
- *cells = _cells;
-} // _newCells_LINE_COHESIVE_LAGRANGE
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/libsrc/pylith/topology/CellRefinerQuad4.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/CellRefinerQuad4.hh 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/CellRefinerQuad4.hh 2013-07-26 22:13:24 UTC (rev 22685)
@@ -1,207 +0,0 @@
-// -*- 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-2013 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ======================================================================
-//
-
-/**
- * @file libsrc/topology/CellRefinerQuad4.hh
- *
- * @brief Object for quad4 refinement of cells.
- */
-
-#if !defined(pylith_topology_cellrefinerquad4_hh)
-#define pylith_topology_cellrefinerquad4_hh
-
-// Include directives ---------------------------------------------------
-#include "RefineFace4Edges2.hh" // ISA RefineFace4Edges2
-
-// CellRefinerQuad4 ------------------------------------------------------
-/// Object for quad4 refinement of cells.
-class ALE::CellRefinerQuad4 : public RefineFace4Edges2
-{ // CellRefinerQuad4
-// PUBLIC MEMBERS ///////////////////////////////////////////////////////
-public :
-
- /** Constructor
- *
- * @param mesh Finite-element mesh.
- */
- CellRefinerQuad4(const mesh_type& mesh);
-
- /// Destructor
- ~CellRefinerQuad4(void);
-
- /** Get number of refined cells for each original cell.
- *
- * @param cell Original cell.
- *
- * @returns Number of refined cells.
- */
- int numNewCells(const point_type cell);
-
- /** Split cell into smaller cells of same type. Do not create
- * censored vertices on censored cells.
- *
- * @param cell Original cell.
- * @param cone Vertices in cell (original mesh).
- * @param coneSize Number of vertices in cell.
- * @param curNewVertex Value for next new vertex.
- */
- void splitCell(const point_type cell,
- const point_type cone[],
- const int coneSize,
- point_type* curNewVertex);
-
- /** Split cell into smaller cells of same type. Create only censored
- * vertices on censored cells.
- *
- * @param cell Original cell.
- * @param cone Vertices in cell (original mesh).
- * @param coneSize Number of vertices in cell.
- * @param curNewVertex Value for next new vertex.
- */
- void splitCellUncensored(const point_type cell,
- const point_type cone[],
- const int coneSize,
- point_type* curNewVertex);
-
- /** Get refined cells.
- *
- * @param cells Vertices in refined cells (refined mesh).
- * @param numCells Number of refined cells.
- * @param cone Vertices in cell (original mesh).
- * @param coneSize Number of vertices in cell.
- * @param orderOldMesh Order in old mesh.
- * @param orderNewMesh Order in new mesh.
- */
- void getNewCells(const point_type** cells,
- int* numCells,
- const point_type cell,
- const point_type cone[],
- const int coneSize,
- const MeshOrder& orderOldMesh,
- const MeshOrder& orderNewMesh);
-
-// PRIVATE ENUMS ////////////////////////////////////////////////////////
-private :
-
- enum CellEnum {
- QUADRILATERAL, // Normal quadrilateral cell
- LINE_COHESIVE_LAGRANGE, // Cohesive cell with Lagrange multiplier vertices
- };
-
-// PRIVATE METHODS //////////////////////////////////////////////////////
-private :
-
- /** Get cell type.
- *
- * @param cell Cell in original mesh.
- * @returns Cell type.
- */
- CellEnum _cellType(const point_type cell);
-
- /** Get edges of quadrilateral cell.
- *
- * @param edges Edges of cell.
- * @param numEdges Number of edges.
- * @param cone Vertices in cell (original mesh).
- * @param coneSize Number of vertices in cell.
- */
- void _edges_QUADRILATERAL(const EdgeType** edges,
- int* numEdges,
- const point_type cone[],
- const int coneSize);
-
- /** Get edges of line cohesive cell with Lagrange multipler vertices.
- *
- * @param edges Edges of cell.
- * @param numEdges Number of edges.
- * @param cone Vertices in cell (original mesh).
- * @param coneSize Number of vertices in cell.
- * @param uncensored True if including edges with censored vertices.
- */
- void _edges_LINE_COHESIVE_LAGRANGE(const EdgeType** edges,
- int* numEdges,
- const point_type cone[],
- const int coneSize,
- const bool uncensored =false);
-
- /** Get faces of quadrilateral cell.
- *
- * @param faces Faces of cell.
- * @param numFaces Number of faces.
- * @param cone Vertices in cell (original mesh).
- * @param coneSize Number of vertices in cell.
- */
- void _faces_QUADRILATERAL(const FaceType** faces,
- int* numFaces,
- const point_type cone[],
- const int coneSize);
-
- /** Get new cells from refinement of a quadrilateral cell.
- *
- * @param cells Vertices in refined cells (refined mesh).
- * @param numCells Number of refined cells.
- * @param cone Vertices in cell (original mesh).
- * @param coneSize Number of vertices in cell.
- * @param coneVertexOffset Offset for cone vertices.
- */
- void _newCells_QUADRILATERAL(const point_type** cells,
- int *numCells,
- const point_type cone[],
- const int coneSize,
- const int coneVertexOffset);
-
- /** Get new cells from refinement of a line cohseive cell with
- * Lagrange multiplier vertices.
- *
- * @param cells Vertices in refined cells (refined mesh).
- * @param numCells Number of refined cells.
- * @param cone Vertices in cell (original mesh).
- * @param coneSize Number of vertices in cell.
- * @param coneVertexOffsetNormal Offset for normal cone vertices.
- * @param coneVertexOffset Offset for censored cone vertices.
- */
- void _newCells_LINE_COHESIVE_LAGRANGE(const point_type** cells,
- int *numCells,
- const point_type cone[],
- const int coneSize,
- const int coneVertexOffsetNormal,
- const int coneVertexOffsetCensored);
-
-// PRIVATE MEMBERS //////////////////////////////////////////////////////
-private :
-
- static const int _edgesSize;
- static const int _facesSize;
- static const int _cellsSize;
- EdgeType _edges[4]; ///< Buffer for edges
- FaceType _faces[1]; ///< Buffer for faces
- point_type _cells[16]; ///< Buffer for cells
-
-
-// NOT IMPLEMENTED //////////////////////////////////////////////////////
-private :
-
- CellRefinerQuad4(const CellRefinerQuad4&); ///< Not implemented
- const CellRefinerQuad4& operator=(const CellRefinerQuad4&); ///< Not implemented
-
-}; // CellRefinerQuad4
-
-#endif // pylith_topology_cellrefinerquad4_hh
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/libsrc/pylith/topology/CellRefinerTet4.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/CellRefinerTet4.cc 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/CellRefinerTet4.cc 2013-07-26 22:13:24 UTC (rev 22685)
@@ -1,408 +0,0 @@
-// -*- 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-2013 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ======================================================================
-//
-
-#include <portinfo>
-
-#include "CellRefinerTet4.hh" // implementation of class methods
-
-#include "MeshOrder.hh" // USES MeshOrder
-
-#include <cassert> // USES assert()
-
-#include <iostream> // TEMPORARY
-// ----------------------------------------------------------------------
-// These must match the sizes of the buffers in the header file.
-const int ALE::CellRefinerTet4::_edgesSize = 9;
-const int ALE::CellRefinerTet4::_cellsSize = 36;
-
-// ----------------------------------------------------------------------
-// Constructor
-ALE::CellRefinerTet4::CellRefinerTet4(const mesh_type& mesh) :
- RefineEdges2(mesh)
-{ // constructor
- assert(3 == mesh.getDimension());
-} // constructor
-
-// ----------------------------------------------------------------------
-// Destructor
-ALE::CellRefinerTet4::~CellRefinerTet4(void)
-{ // destructor
-} // destructor
-
-// ----------------------------------------------------------------------
-// Get number of refined cells for each original cell.
-int
-ALE::CellRefinerTet4::numNewCells(const point_type cell)
-{ // numNewCells
- switch (_cellType(cell)) {
- case TETRAHEDRON:
- return 8;
- case TRIANGLE_COHESIVE_LAGRANGE:
- return 4;
- default:
- assert(0);
- throw ALE::Exception("Unknown cell type.");
- } // switch
-} // numNewCells
-
-// ----------------------------------------------------------------------
-// Split cell into smaller cells of same type.
-void
-ALE::CellRefinerTet4::splitCell(const point_type cell,
- const point_type cone[],
- const int coneSize,
- point_type* curNewVertex)
-{ // splitCell
- assert(curNewVertex);
-
- int numEdges = 0;
- const EdgeType* edges;
-
- switch (_cellType(cell)) {
- case TETRAHEDRON:
- _edges_TETRAHEDRON(&edges, &numEdges, cone, coneSize);
- break;
- case TRIANGLE_COHESIVE_LAGRANGE:
- _edges_TRIANGLE_COHESIVE_LAGRANGE(&edges, &numEdges, cone, coneSize);
- break;
- default:
- throw ALE::Exception("Unknown cell type.");
- } // switch
-
- for(int iEdge=0; iEdge < numEdges; ++iEdge) {
- if (_edgeToVertex.find(edges[iEdge]) == _edgeToVertex.end()) {
- // if vertex does not exist
- //std::cout << "Edge: " << edges[iEdge] << ", new vertex: " << *curNewVertex << std::endl;
- _edgeToVertex[edges[iEdge]] = *curNewVertex;
- ++(*curNewVertex);
- } // if
- } // for
-} // splitCell
-
-// ----------------------------------------------------------------------
-// Split cell into smaller cells of same type.
-void
-ALE::CellRefinerTet4::splitCellUncensored(const point_type cell,
- const point_type cone[],
- const int coneSize,
- point_type* curNewVertex)
-{ // splitCellUncensored
- assert(curNewVertex);
-
- int numEdges = 0;
- const EdgeType* edges;
-
- const bool uncensored = true;
-
- switch (_cellType(cell)) {
- case TETRAHEDRON:
- // No censored vertices on normal cell.
- break;
- case TRIANGLE_COHESIVE_LAGRANGE:
- _edges_TRIANGLE_COHESIVE_LAGRANGE(&edges, &numEdges, cone, coneSize, uncensored);
- break;
- default:
- throw ALE::Exception("Unknown cell type.");
- } // switch
-
- for(int iEdge=0; iEdge < numEdges; ++iEdge) {
- if (_edgeToVertex.find(edges[iEdge]) == _edgeToVertex.end()) {
- // if vertex does not exist
- //std::cout << "Edge: " << edges[iEdge] << ", new vertex: " << *curNewVertex << std::endl;
- _edgeToVertex[edges[iEdge]] = *curNewVertex;
- ++(*curNewVertex);
- } // if
- } // for
-} // splitCellUncensored
-
-// ----------------------------------------------------------------------
-// Get refined cells.
-void
-ALE::CellRefinerTet4::getNewCells(const point_type** cells,
- int* numCells,
- const point_type cell,
- const point_type cone[],
- const int coneSize,
- const MeshOrder& orderOldMesh,
- const MeshOrder& orderNewMesh)
-{ // getNewCells
- assert(cells);
- assert(numCells);
-
- switch (_cellType(cell)) {
- case TETRAHEDRON: {
- const int coneVertexOffset = orderNewMesh.verticesNormal().min() - orderOldMesh.verticesNormal().min();
- _newCells_TETRAHEDRON(cells, numCells, cone, coneSize, coneVertexOffset);
- break;
- } // TETRAHEDRON
- case TRIANGLE_COHESIVE_LAGRANGE: {
- const int coneVertexOffsetNormal = orderNewMesh.verticesNormal().min() - orderOldMesh.verticesNormal().min();
- const int coneVertexOffsetCensored = orderNewMesh.verticesCensored().min() - orderOldMesh.verticesCensored().min();
- _newCells_TRIANGLE_COHESIVE_LAGRANGE(cells, numCells, cone, coneSize, coneVertexOffsetNormal, coneVertexOffsetCensored);
- break;
- } // TRIANGLE_COHESIVE_LAGRANGE
- default:
- throw ALE::Exception("Unknown cell type.");
- } // switch
-} // getNewCells
-
-// ----------------------------------------------------------------------
-// Get cell type.
-ALE::CellRefinerTet4::CellEnum
-ALE::CellRefinerTet4::_cellType(const point_type cell)
-{ // _cellType
- assert(!_mesh.getSieve().isNull());
-
- switch (_mesh.getSieve()->getConeSize(cell)) {
- case 4:
- return TETRAHEDRON;
- case 9:
- return TRIANGLE_COHESIVE_LAGRANGE;
- case 0: {
- std::ostringstream msg;
- std::cerr << "Internal error. Cone size for mesh point " << cell << " is zero. May be a vertex.";
- assert(0);
- throw ALE::Exception("Could not determine cell type during uniform global refinement.");
- } // case 0
- default : {
- std::ostringstream msg;
- std::cerr << "Internal error. Unknown cone size for mesh point " << cell << ". Unknown cell type.";
- assert(0);
- throw ALE::Exception("Could not determine cell type during uniform global refinement.");
- } // default
- } // switch
-} // _cellType
-
-// ----------------------------------------------------------------------
-// Get edges of triangular cell.
-void
-ALE::CellRefinerTet4::_edges_TETRAHEDRON(const EdgeType** edges,
- int* numEdges,
- const point_type cone[],
- const int coneSize)
-{ // _edges_TETRAHEDRON
- assert(_edgesSize >= 6);
-
- assert(coneSize == 4);
- _edges[0] = EdgeType(std::min(cone[0], cone[1]), std::max(cone[0], cone[1]));
- _edges[1] = EdgeType(std::min(cone[1], cone[2]), std::max(cone[1], cone[2]));
- _edges[2] = EdgeType(std::min(cone[2], cone[0]), std::max(cone[2], cone[0]));
- _edges[3] = EdgeType(std::min(cone[0], cone[3]), std::max(cone[0], cone[3]));
- _edges[4] = EdgeType(std::min(cone[1], cone[3]), std::max(cone[1], cone[3]));
- _edges[5] = EdgeType(std::min(cone[2], cone[3]), std::max(cone[2], cone[3]));
- *numEdges = 6;
- *edges = _edges;
-} // _edges_TETRAHEDRON
-
-// ----------------------------------------------------------------------
-// Get edges of line cohesive cell with Lagrange multipler vertices.
-void
-ALE::CellRefinerTet4::_edges_TRIANGLE_COHESIVE_LAGRANGE(const EdgeType** edges,
- int* numEdges,
- const point_type cone[],
- const int coneSize,
- const bool uncensored)
-{ // _edges_TRIANGLE_COHESIVE_LAGRANGE
- if (uncensored) {
- // Use all vertices
- assert(_edgesSize >= 9);
-
- assert(coneSize == 9);
- _edges[0] = EdgeType(std::min(cone[0], cone[1]), std::max(cone[0], cone[1]));
- _edges[1] = EdgeType(std::min(cone[1], cone[2]), std::max(cone[1], cone[2]));
- _edges[2] = EdgeType(std::min(cone[2], cone[0]), std::max(cone[2], cone[0]));
- _edges[3] = EdgeType(std::min(cone[3], cone[4]), std::max(cone[3], cone[4]));
- _edges[4] = EdgeType(std::min(cone[4], cone[5]), std::max(cone[4], cone[5]));
- _edges[5] = EdgeType(std::min(cone[5], cone[3]), std::max(cone[5], cone[3]));
- _edges[6] = EdgeType(std::min(cone[6], cone[7]), std::max(cone[6], cone[7]));
- _edges[7] = EdgeType(std::min(cone[7], cone[8]), std::max(cone[7], cone[8]));
- _edges[8] = EdgeType(std::min(cone[8], cone[6]), std::max(cone[8], cone[6]));
- *numEdges = 9;
- *edges = _edges;
- } else {
- // Omit edges with censored (Lagrange multipler) vertices.
- assert(_edgesSize >= 6);
-
- assert(coneSize == 9);
- _edges[0] = EdgeType(std::min(cone[0], cone[1]), std::max(cone[0], cone[1]));
- _edges[1] = EdgeType(std::min(cone[1], cone[2]), std::max(cone[1], cone[2]));
- _edges[2] = EdgeType(std::min(cone[2], cone[0]), std::max(cone[2], cone[0]));
- _edges[3] = EdgeType(std::min(cone[3], cone[4]), std::max(cone[3], cone[4]));
- _edges[4] = EdgeType(std::min(cone[4], cone[5]), std::max(cone[4], cone[5]));
- _edges[5] = EdgeType(std::min(cone[5], cone[3]), std::max(cone[5], cone[3]));
- *numEdges = 6;
- *edges = _edges;
- } // if/else
-} // _edges_TRIANGLE_COHESIVE_LAGRANGE
-
-// ----------------------------------------------------------------------
-// Get new cells from refinement of a triangular cell.
-void
-ALE::CellRefinerTet4::_newCells_TETRAHEDRON(const point_type** cells,
- int *numCells,
- const point_type cone[],
- const int coneSize,
- const int coneVertexOffset)
-{ // _newCells_TETRAHEDRON
- const int coneSizeTet4 = 4;
- const int numEdgesTet4 = 6;
- const int numNewCells = 8;
- const int numNewVertices = 6;
-
- int numEdges = 0;
- const EdgeType* edges;
- _edges_TETRAHEDRON(&edges, &numEdges, cone, coneSize);
- assert(numEdgesTet4 == numEdges);
-
- assert(_cellsSize >= numNewCells*coneSizeTet4);
- point_type newVertices[numNewVertices];
- for(int iEdge=0, iNewVertex=0; iEdge < numEdgesTet4; ++iEdge) {
- if (_edgeToVertex.find(edges[iEdge]) == _edgeToVertex.end()) {
- throw ALE::Exception("Missing edge in refined mesh");
- } // if
- newVertices[iNewVertex++] = _edgeToVertex[edges[iEdge]];
- } // for
-
- // new cell 0
- _cells[0*4+0] = cone[0]+coneVertexOffset;
- _cells[0*4+1] = newVertices[3];
- _cells[0*4+2] = newVertices[0];
- _cells[0*4+3] = newVertices[2];
-
- // new cell 1
- _cells[1*4+0] = newVertices[0];
- _cells[1*4+1] = newVertices[1];
- _cells[1*4+2] = newVertices[2];
- _cells[1*4+3] = newVertices[3];
-
- // new cell 2
- _cells[2*4+0] = newVertices[0];
- _cells[2*4+1] = newVertices[3];
- _cells[2*4+2] = newVertices[4];
- _cells[2*4+3] = newVertices[1];
-
- // new cell 3
- _cells[3*4+0] = cone[1]+coneVertexOffset;
- _cells[3*4+1] = newVertices[4];
- _cells[3*4+2] = newVertices[1];
- _cells[3*4+3] = newVertices[0];
-
- // new cell 4
- _cells[4*4+0] = newVertices[2];
- _cells[4*4+1] = newVertices[5];
- _cells[4*4+2] = newVertices[3];
- _cells[4*4+3] = newVertices[1];
-
- // new cell 5
- _cells[5*4+0] = cone[2]+coneVertexOffset;
- _cells[5*4+1] = newVertices[5];
- _cells[5*4+2] = newVertices[2];
- _cells[5*4+3] = newVertices[1];
-
- // new cell 6
- _cells[6*4+0] = newVertices[1];
- _cells[6*4+1] = newVertices[4];
- _cells[6*4+2] = newVertices[5];
- _cells[6*4+3] = newVertices[3];
-
- // new cell 7
- _cells[7*4+0] = cone[3]+coneVertexOffset;
- _cells[7*4+1] = newVertices[3];
- _cells[7*4+2] = newVertices[5];
- _cells[7*4+3] = newVertices[4];
-
- *numCells = numNewCells;
- *cells = _cells;
-} // _newCells_TETRAHEDRON
-
-// ----------------------------------------------------------------------
-// Get new cells from refinement of a line cohseive cell with Lagrange
-// multiplier vertices.
-void
-ALE::CellRefinerTet4::_newCells_TRIANGLE_COHESIVE_LAGRANGE(const point_type** cells,
- int *numCells,
- const point_type cone[],
- const int coneSize,
- const int coneVertexOffsetNormal,
- const int coneVertexOffsetCensored)
-{ // _newCells_TRIANGLE_COHESIVE_LAGRANGE
- const int coneSizeTriPrism9 = 9;
- const int numEdgesTriPrism9 = 9;
- const int numNewCells = 4;
- const int numNewVertices = 9;
-
- int numEdges = 0;
- const EdgeType *edges;
- _edges_TRIANGLE_COHESIVE_LAGRANGE(&edges, &numEdges, cone, coneSize, true);
- assert(numEdgesTriPrism9 == numEdges);
-
- assert(_cellsSize >= numNewCells*coneSizeTriPrism9);
- point_type newVertices[numNewVertices];
- for(int iEdge=0, iNewVertex=0; iEdge < numEdgesTriPrism9; ++iEdge) {
- if (_edgeToVertex.find(edges[iEdge]) == _edgeToVertex.end()) {
- throw ALE::Exception("Missing edge in refined mesh");
- } // if
- newVertices[iNewVertex++] = _edgeToVertex[edges[iEdge]];
- } // for
-
- _cells[0*9+0] = cone[0]+coneVertexOffsetNormal; // New cell 0
- _cells[0*9+1] = newVertices[0];
- _cells[0*9+2] = newVertices[2];
- _cells[0*9+3] = cone[3]+coneVertexOffsetNormal;
- _cells[0*9+4] = newVertices[3];
- _cells[0*9+5] = newVertices[5];
- _cells[0*9+6] = cone[6]+coneVertexOffsetCensored;
- _cells[0*9+7] = newVertices[6];
- _cells[0*9+8] = newVertices[8];
-
- _cells[1*9+0] = newVertices[0]; // New cell 1
- _cells[1*9+1] = newVertices[1];
- _cells[1*9+2] = newVertices[2];
- _cells[1*9+3] = newVertices[3];
- _cells[1*9+4] = newVertices[4];
- _cells[1*9+5] = newVertices[5];
- _cells[1*9+6] = newVertices[6];
- _cells[1*9+7] = newVertices[7];
- _cells[1*9+8] = newVertices[8];
-
- _cells[2*9+0] = cone[1]+coneVertexOffsetNormal; // New cell 2
- _cells[2*9+1] = newVertices[1];
- _cells[2*9+2] = newVertices[0];
- _cells[2*9+3] = cone[4]+coneVertexOffsetNormal;
- _cells[2*9+4] = newVertices[4];
- _cells[2*9+5] = newVertices[3];
- _cells[2*9+6] = cone[7]+coneVertexOffsetCensored;
- _cells[2*9+7] = newVertices[7];
- _cells[2*9+8] = newVertices[6];
-
- _cells[3*9+0] = cone[2]+coneVertexOffsetNormal; // New cell 3
- _cells[3*9+1] = newVertices[2];
- _cells[3*9+2] = newVertices[1];
- _cells[3*9+3] = cone[5]+coneVertexOffsetNormal;
- _cells[3*9+4] = newVertices[5];
- _cells[3*9+5] = newVertices[4];
- _cells[3*9+6] = cone[8]+coneVertexOffsetCensored;
- _cells[3*9+7] = newVertices[8];
- _cells[3*9+8] = newVertices[7];
-
- *numCells = numNewCells;
- *cells = _cells;
-} // _newCells_TRIANGLE_COHESIVE_LAGRANGE
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/libsrc/pylith/topology/CellRefinerTet4.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/CellRefinerTet4.hh 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/CellRefinerTet4.hh 2013-07-26 22:13:24 UTC (rev 22685)
@@ -1,193 +0,0 @@
-// -*- 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-2013 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ======================================================================
-//
-
-/**
- * @file libsrc/topology/CellRefinerTet4.hh
- *
- * @brief Object for tet4 refinement of cells.
- */
-
-#if !defined(pylith_topology_cellrefinertet4_hh)
-#define pylith_topology_cellrefinertet4_hh
-
-// Include directives ---------------------------------------------------
-#include "RefineEdges2.hh" // ISA RefineEdges2
-
-// CellRefinerTet4 ------------------------------------------------------
-/// Object for tet4 refinement of cells.
-class ALE::CellRefinerTet4 : public RefineEdges2
-{ // CellRefinerTet4
-// PUBLIC MEMBERS ///////////////////////////////////////////////////////
-public :
-
- /** Constructor
- *
- * @param mesh Finite-element mesh.
- */
- CellRefinerTet4(const mesh_type& mesh);
-
- /// Destructor
- ~CellRefinerTet4(void);
-
- /** Get number of refined cells for each original cell.
- *
- * @param cell Original cell.
- *
- * @returns Number of refined cells.
- */
- int numNewCells(const point_type cell);
-
- /** Split cell into smaller cells of same type. Do not create
- * censored vertices on censored cells.
- *
- * @param cell Original cell.
- * @param cone Vertices in cell (original mesh).
- * @param coneSize Number of vertices in cell.
- * @param curNewVertex Value for next new vertex.
- */
- void splitCell(const point_type cell,
- const point_type cone[],
- const int coneSize,
- point_type* curNewVertex);
-
- /** Split cell into smaller cells of same type. Create only censored
- * vertices on censored cells.
- *
- * @param cell Original cell.
- * @param cone Vertices in cell (original mesh).
- * @param coneSize Number of vertices in cell.
- * @param curNewVertex Value for next new vertex.
- */
- void splitCellUncensored(const point_type cell,
- const point_type cone[],
- const int coneSize,
- point_type* curNewVertex);
-
- /** Get refined cells.
- *
- * @param cells Vertices in refined cells (refined mesh).
- * @param numCells Number of refined cells.
- * @param cone Vertices in cell (original mesh).
- * @param coneSize Number of vertices in cell.
- * @param orderOldMesh Order in old mesh.
- * @param orderNewMesh Order in new mesh.
- */
- void getNewCells(const point_type** cells,
- int* numCells,
- const point_type cell,
- const point_type cone[],
- const int coneSize,
- const MeshOrder& orderOldMesh,
- const MeshOrder& orderNewMesh);
-
-// PRIVATE ENUMS ////////////////////////////////////////////////////////
-private :
-
- enum CellEnum {
- TETRAHEDRON, // Normal tetrahedral cell
- TRIANGLE_COHESIVE_LAGRANGE, // Cohesive cell with Lagrange multiplier vertices
- };
-
-// PRIVATE METHODS //////////////////////////////////////////////////////
-private :
-
- /** Get cell type.
- *
- * @param cell Cell in original mesh.
- * @returns Cell type.
- */
- CellEnum _cellType(const point_type cell);
-
- /** Get edges of triangular cell.
- *
- * @param edges Edges of cell.
- * @param numEdges Number of edges.
- * @param cone Vertices in cell (original mesh).
- * @param coneSize Number of vertices in cell.
- */
- void _edges_TETRAHEDRON(const EdgeType** edges,
- int* numEdges,
- const point_type cone[],
- const int coneSize);
-
- /** Get edges of line cohesive cell with Lagrange multipler vertices.
- *
- * @param edges Edges of cell.
- * @param numEdges Number of edges.
- * @param cone Vertices in cell (original mesh).
- * @param coneSize Number of vertices in cell.
- * @param uncensored True if including edges with censored vertices.
- */
- void _edges_TRIANGLE_COHESIVE_LAGRANGE(const EdgeType** edges,
- int* numEdges,
- const point_type cone[],
- const int coneSize,
- const bool uncensored =false);
-
- /** Get new cells from refinement of a triangular cell.
- *
- * @param cells Vertices in refined cells (refined mesh).
- * @param numCells Number of refined cells.
- * @param cone Vertices in cell (original mesh).
- * @param coneSize Number of vertices in cell.
- * @param coneVertexOffset Offset for cone vertices.
- */
- void _newCells_TETRAHEDRON(const point_type** cells,
- int *numCells,
- const point_type cone[],
- const int coneSize,
- const int coneVertexOffset);
-
- /** Get new cells from refinement of a line cohseive cell with
- * Lagrange multiplier vertices.
- *
- * @param cells Vertices in refined cells (refined mesh).
- * @param numCells Number of refined cells.
- * @param cone Vertices in cell (original mesh).
- * @param coneSize Number of vertices in cell.
- * @param coneVertexOffsetNormal Offset for normal cone vertices.
- * @param coneVertexOffset Offset for censored cone vertices.
- */
- void _newCells_TRIANGLE_COHESIVE_LAGRANGE(const point_type** cells,
- int *numCells,
- const point_type cone[],
- const int coneSize,
- const int coneVertexOffsetNormal,
- const int coneVertexOffsetCensored);
-
-// PRIVATE MEMBERS //////////////////////////////////////////////////////
-private :
-
- static const int _edgesSize;
- static const int _cellsSize;
- EdgeType _edges[9]; ///< Buffer for edges
- point_type _cells[36]; ///< Buffer for cells
-
-
-// NOT IMPLEMENTED //////////////////////////////////////////////////////
-private :
-
- CellRefinerTet4(const CellRefinerTet4&); ///< Not implemented
- const CellRefinerTet4& operator=(const CellRefinerTet4&); ///< Not implemented
-
-}; // CellRefinerTet4
-
-#endif // pylith_topology_cellrefinertet4_hh
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/libsrc/pylith/topology/CellRefinerTri3.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/CellRefinerTri3.cc 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/CellRefinerTri3.cc 2013-07-26 22:13:24 UTC (rev 22685)
@@ -1,343 +0,0 @@
-// -*- 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-2013 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ======================================================================
-//
-
-#include <portinfo>
-
-#include "CellRefinerTri3.hh" // implementation of class methods
-
-#include "MeshOrder.hh" // USES MeshOrder
-
-#include <cassert> // USES assert()
-
-#include <iostream> // TEMPORARY
-// ----------------------------------------------------------------------
-// These must match the sizes of the buffers in the header file.
-const int ALE::CellRefinerTri3::_edgesSize = 3;
-const int ALE::CellRefinerTri3::_cellsSize = 12;
-
-// ----------------------------------------------------------------------
-// Constructor
-ALE::CellRefinerTri3::CellRefinerTri3(const mesh_type& mesh) :
- RefineEdges2(mesh)
-{ // constructor
- assert(2 == mesh.getDimension());
-} // constructor
-
-// ----------------------------------------------------------------------
-// Destructor
-ALE::CellRefinerTri3::~CellRefinerTri3(void)
-{ // destructor
-} // destructor
-
-// ----------------------------------------------------------------------
-// Get number of refined cells for each original cell.
-int
-ALE::CellRefinerTri3::numNewCells(const point_type cell)
-{ // numNewCells
- switch (_cellType(cell)) {
- case TRIANGLE:
- return 4;
- case LINE_COHESIVE_LAGRANGE:
- return 2;
- default:
- assert(0);
- throw ALE::Exception("Unknown cell type.");
- } // switch
-} // numNewCells
-
-// ----------------------------------------------------------------------
-// Split cell into smaller cells of same type.
-void
-ALE::CellRefinerTri3::splitCell(const point_type cell,
- const point_type cone[],
- const int coneSize,
- point_type* curNewVertex)
-{ // splitCell
- assert(curNewVertex);
-
- int numEdges = 0;
- const EdgeType* edges;
-
- switch (_cellType(cell)) {
- case TRIANGLE:
- _edges_TRIANGLE(&edges, &numEdges, cone, coneSize);
- break;
- case LINE_COHESIVE_LAGRANGE:
- _edges_LINE_COHESIVE_LAGRANGE(&edges, &numEdges, cone, coneSize);
- break;
- default:
- throw ALE::Exception("Unknown cell type.");
- } // switch
-
- for(int iEdge=0; iEdge < numEdges; ++iEdge) {
- if (_edgeToVertex.find(edges[iEdge]) == _edgeToVertex.end()) {
- // if vertex does not exist
- //std::cout << "Edge: " << edges[iEdge] << ", new vertex: " << *curNewVertex << std::endl;
- _edgeToVertex[edges[iEdge]] = *curNewVertex;
- ++(*curNewVertex);
- } // if
- } // for
-} // splitCell
-
-// ----------------------------------------------------------------------
-// Split cell into smaller cells of same type.
-void
-ALE::CellRefinerTri3::splitCellUncensored(const point_type cell,
- const point_type cone[],
- const int coneSize,
- point_type* curNewVertex)
-{ // splitCellUncensored
- assert(curNewVertex);
-
- int numEdges = 0;
- const EdgeType* edges;
-
- const bool uncensored = true;
-
- switch (_cellType(cell)) {
- case TRIANGLE:
- // No censored vertices on normal cell.
- break;
- case LINE_COHESIVE_LAGRANGE:
- _edges_LINE_COHESIVE_LAGRANGE(&edges, &numEdges, cone, coneSize, uncensored);
- break;
- default:
- throw ALE::Exception("Unknown cell type.");
- } // switch
-
- for(int iEdge=0; iEdge < numEdges; ++iEdge) {
- if (_edgeToVertex.find(edges[iEdge]) == _edgeToVertex.end()) {
- // if vertex does not exist
- //std::cout << "Edge: " << edges[iEdge] << ", new vertex: " << *curNewVertex << std::endl;
- _edgeToVertex[edges[iEdge]] = *curNewVertex;
- ++(*curNewVertex);
- } // if
- } // for
-} // splitCellUncensored
-
-// ----------------------------------------------------------------------
-// Get refined cells.
-void
-ALE::CellRefinerTri3::getNewCells(const point_type** cells,
- int* numCells,
- const point_type cell,
- const point_type cone[],
- const int coneSize,
- const MeshOrder& orderOldMesh,
- const MeshOrder& orderNewMesh)
-{ // getNewCells
- assert(cells);
- assert(numCells);
-
- switch (_cellType(cell)) {
- case TRIANGLE: {
- const int coneVertexOffset = orderNewMesh.verticesNormal().min() - orderOldMesh.verticesNormal().min();
- _newCells_TRIANGLE(cells, numCells, cone, coneSize, coneVertexOffset);
- break;
- } // TRIANGLE
- case LINE_COHESIVE_LAGRANGE: {
- const int coneVertexOffsetNormal = orderNewMesh.verticesNormal().min() - orderOldMesh.verticesNormal().min();
- const int coneVertexOffsetCensored = orderNewMesh.verticesCensored().min() - orderOldMesh.verticesCensored().min();
- _newCells_LINE_COHESIVE_LAGRANGE(cells, numCells, cone, coneSize, coneVertexOffsetNormal, coneVertexOffsetCensored);
- break;
- } // LINE_COHESIVE_LAGRANGE
- default:
- throw ALE::Exception("Unknown cell type.");
- } // switch
-} // getNewCells
-
-// ----------------------------------------------------------------------
-// Get cell type.
-ALE::CellRefinerTri3::CellEnum
-ALE::CellRefinerTri3::_cellType(const point_type cell)
-{ // _cellType
- assert(!_mesh.getSieve().isNull());
-
- switch (_mesh.getSieve()->getConeSize(cell)) {
- case 3:
- return TRIANGLE;
- case 6:
- return LINE_COHESIVE_LAGRANGE;
- case 0: {
- std::ostringstream msg;
- std::cerr << "Internal error. Cone size for mesh point " << cell << " is zero. May be a vertex.";
- assert(0);
- throw ALE::Exception("Could not determine cell type during uniform global refinement.");
- } // case 0
- default : {
- std::ostringstream msg;
- std::cerr << "Internal error. Unknown cone size for mesh point " << cell << ". Unknown cell type.";
- assert(0);
- throw ALE::Exception("Could not determine cell type during uniform global refinement.");
- } // default
- } // switch
-} // _cellType
-
-// ----------------------------------------------------------------------
-// Get edges of triangular cell.
-void
-ALE::CellRefinerTri3::_edges_TRIANGLE(const EdgeType** edges,
- int* numEdges,
- const point_type cone[],
- const int coneSize)
-{ // _edges_TRIANGLE
- assert(_edgesSize >= 3);
-
- assert(coneSize == 3);
- _edges[0] = EdgeType(std::min(cone[0], cone[1]), std::max(cone[0], cone[1]));
- _edges[1] = EdgeType(std::min(cone[1], cone[2]), std::max(cone[1], cone[2]));
- _edges[2] = EdgeType(std::min(cone[2], cone[0]), std::max(cone[2], cone[0]));
- *numEdges = 3;
- *edges = _edges;
-} // _edges_TRIANGLE
-
-// ----------------------------------------------------------------------
-// Get edges of line cohesive cell with Lagrange multipler vertices.
-void
-ALE::CellRefinerTri3::_edges_LINE_COHESIVE_LAGRANGE(const EdgeType** edges,
- int* numEdges,
- const point_type cone[],
- const int coneSize,
- const bool uncensored)
-{ // _edges_LINE_COHESIVE_LAGRANGE
- if (uncensored) {
- // Include all edges
- assert(_edgesSize >= 3);
-
- assert(coneSize == 6);
- _edges[0] = EdgeType(std::min(cone[0], cone[1]), std::max(cone[0], cone[1]));
- _edges[1] = EdgeType(std::min(cone[2], cone[3]), std::max(cone[2], cone[3]));
- _edges[2] = EdgeType(std::min(cone[4], cone[5]), std::max(cone[4], cone[5]));
- *numEdges = 3;
- *edges = _edges;
- } else {
- // Omit edges with censored (Lagrange multiplier) vertices.
- assert(_edgesSize >= 2);
-
- assert(coneSize == 6);
- _edges[0] = EdgeType(std::min(cone[0], cone[1]), std::max(cone[0], cone[1]));
- _edges[1] = EdgeType(std::min(cone[2], cone[3]), std::max(cone[2], cone[3]));
- *numEdges = 2;
- *edges = _edges;
- } // if/else
-} // _edges_LINE_COHESIVE_LAGRANGE
-
-// ----------------------------------------------------------------------
-// Get new cells from refinement of a triangular cell.
-void
-ALE::CellRefinerTri3::_newCells_TRIANGLE(const point_type** cells,
- int *numCells,
- const point_type cone[],
- const int coneSize,
- const int coneVertexOffset)
-{ // _newCells_TRIANGLE
- const int coneSizeTri3 = 3;
- const int numEdgesTri3 = 3;
- const int numNewCells = 4;
- const int numNewVertices = 3;
-
- int numEdges = 0;
- const EdgeType* edges;
- _edges_TRIANGLE(&edges, &numEdges, cone, coneSize);
- assert(numEdgesTri3 == numEdges);
-
- assert(_cellsSize >= numNewCells*coneSizeTri3);
- point_type newVertices[numNewVertices];
- for(int iEdge=0, iNewVertex=0; iEdge < numEdgesTri3; ++iEdge) {
- if (_edgeToVertex.find(edges[iEdge]) == _edgeToVertex.end()) {
- throw ALE::Exception("Missing edge in refined mesh");
- } // if
- newVertices[iNewVertex++] = _edgeToVertex[edges[iEdge]];
- } // for
-
- // new cell 0
- _cells[0*3+0] = cone[0] + coneVertexOffset;
- _cells[0*3+1] = newVertices[0];
- _cells[0*3+2] = newVertices[2];
-
- // new cell 1
- _cells[1*3+0] = newVertices[0];
- _cells[1*3+1] = newVertices[1];
- _cells[1*3+2] = newVertices[2];
-
- // new cell 2
- _cells[2*3+0] = cone[1] + coneVertexOffset;
- _cells[2*3+1] = newVertices[1];
- _cells[2*3+2] = newVertices[0];
-
- // new cell 3
- _cells[3*3+0] = cone[2] + coneVertexOffset;
- _cells[3*3+1] = newVertices[2];
- _cells[3*3+2] = newVertices[1];
-
- *numCells = numNewCells;
- *cells = _cells;
-} // _newCells_TRIANGLE
-
-// ----------------------------------------------------------------------
-// Get new cells from refinement of a line cohseive cell with Lagrange
-// multiplier vertices.
-void
-ALE::CellRefinerTri3::_newCells_LINE_COHESIVE_LAGRANGE(const point_type** cells,
- int *numCells,
- const point_type cone[],
- const int coneSize,
- const int coneVertexOffsetNormal,
- const int coneVertexOffsetCensored)
-{ // _newCells_LINE_COHESIVE_LAGRANGE
- const int coneSizeLine6 = 6;
- const int numEdgesLine6 = 3;
- const int numNewCells = 2;
- const int numNewVertices = 3;
-
- int numEdges = 0;
- const EdgeType* edges;
- _edges_LINE_COHESIVE_LAGRANGE(&edges, &numEdges, cone, coneSize, true);
- assert(numEdgesLine6 == numEdges);
-
- assert(_cellsSize >= numNewCells*coneSizeLine6);
- point_type newVertices[numNewVertices];
- for(int iEdge=0, iNewVertex=0; iEdge < numEdgesLine6; ++iEdge) {
- if (_edgeToVertex.find(edges[iEdge]) == _edgeToVertex.end()) {
- throw ALE::Exception("Missing edge in refined mesh");
- } // if
- newVertices[iNewVertex++] = _edgeToVertex[edges[iEdge]];
- } // for
-
- // new cell 0
- _cells[0*6+0] = cone[0] + coneVertexOffsetNormal;
- _cells[0*6+1] = newVertices[0];
- _cells[0*6+2] = cone[2] + coneVertexOffsetNormal;
- _cells[0*6+3] = newVertices[1];
- _cells[0*6+4] = cone[4] + coneVertexOffsetCensored;
- _cells[0*6+5] = newVertices[2];
-
- // new cell 1
- _cells[1*6+0] = newVertices[0];
- _cells[1*6+1] = cone[1] + coneVertexOffsetNormal;
- _cells[1*6+2] = newVertices[1];
- _cells[1*6+3] = cone[3] + coneVertexOffsetNormal;
- _cells[1*6+4] = newVertices[2];
- _cells[1*6+5] = cone[5] + coneVertexOffsetCensored;
-
- *numCells = 2;
- *cells = _cells;
-} // _newCells_LINE_COHESIVE_LAGRANGE
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/libsrc/pylith/topology/CellRefinerTri3.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/CellRefinerTri3.hh 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/CellRefinerTri3.hh 2013-07-26 22:13:24 UTC (rev 22685)
@@ -1,193 +0,0 @@
-// -*- 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-2013 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ======================================================================
-//
-
-/**
- * @file libsrc/topology/CellRefinerTri3.hh
- *
- * @brief Object for tri3 refinement of cells.
- */
-
-#if !defined(pylith_topology_cellrefinertri3_hh)
-#define pylith_topology_cellrefinertri3_hh
-
-// Include directives ---------------------------------------------------
-#include "RefineEdges2.hh" // ISA RefineEdges2
-
-// CellRefinerTri3 ------------------------------------------------------
-/// Object for tri3 refinement of cells.
-class ALE::CellRefinerTri3 : public RefineEdges2
-{ // CellRefinerTri3
-// PUBLIC MEMBERS ///////////////////////////////////////////////////////
-public :
-
- /** Constructor
- *
- * @param mesh Finite-element mesh.
- */
- CellRefinerTri3(const mesh_type& mesh);
-
- /// Destructor
- ~CellRefinerTri3(void);
-
- /** Get number of refined cells for each original cell.
- *
- * @param cell Original cell.
- *
- * @returns Number of refined cells.
- */
- int numNewCells(const point_type cell);
-
- /** Split cell into smaller cells of same type. Do not create
- * censored vertices on censored cells.
- *
- * @param cell Original cell.
- * @param cone Vertices in cell (original mesh).
- * @param coneSize Number of vertices in cell.
- * @param curNewVertex Value for next new vertex.
- */
- void splitCell(const point_type cell,
- const point_type cone[],
- const int coneSize,
- point_type* curNewVertex);
-
- /** Split cell into smaller cells of same type. Create only censored
- * vertices on censored cells.
- *
- * @param cell Original cell.
- * @param cone Vertices in cell (original mesh).
- * @param coneSize Number of vertices in cell.
- * @param curNewVertex Value for next new vertex.
- */
- void splitCellUncensored(const point_type cell,
- const point_type cone[],
- const int coneSize,
- point_type* curNewVertex);
-
- /** Get refined cells.
- *
- * @param cells Vertices in refined cells (refined mesh).
- * @param numCells Number of refined cells.
- * @param cone Vertices in cell (original mesh).
- * @param coneSize Number of vertices in cell.
- * @param orderOldMesh Order in old mesh.
- * @param orderNewMesh Order in new mesh.
- */
- void getNewCells(const point_type** cells,
- int* numCells,
- const point_type cell,
- const point_type cone[],
- const int coneSize,
- const MeshOrder& orderOldMesh,
- const MeshOrder& orderNewMesh);
-
-// PRIVATE ENUMS ////////////////////////////////////////////////////////
-private :
-
- enum CellEnum {
- TRIANGLE, // Normal triangular cell
- LINE_COHESIVE_LAGRANGE, // Cohesive cell with Lagrange multiplier vertices
- };
-
-// PRIVATE METHODS //////////////////////////////////////////////////////
-private :
-
- /** Get cell type.
- *
- * @param cell Cell in original mesh.
- * @returns Cell type.
- */
- CellEnum _cellType(const point_type cell);
-
- /** Get edges of triangular cell.
- *
- * @param edges Edges of cell.
- * @param numEdges Number of edges.
- * @param cone Vertices in cell (original mesh).
- * @param coneSize Number of vertices in cell.
- */
- void _edges_TRIANGLE(const EdgeType** edges,
- int* numEdges,
- const point_type cone[],
- const int coneSize);
-
- /** Get edges of line cohesive cell with Lagrange multipler vertices.
- *
- * @param edges Edges of cell.
- * @param numEdges Number of edges.
- * @param cone Vertices in cell (original mesh).
- * @param coneSize Number of vertices in cell.
- * @param uncensored True if including edges with censored vertices.
- */
- void _edges_LINE_COHESIVE_LAGRANGE(const EdgeType** edges,
- int* numEdges,
- const point_type cone[],
- const int coneSize,
- const bool uncensored =false);
-
- /** Get new cells from refinement of a triangular cell.
- *
- * @param cells Vertices in refined cells (refined mesh).
- * @param numCells Number of refined cells.
- * @param cone Vertices in cell (original mesh).
- * @param coneSize Number of vertices in cell.
- * @param coneVertexOffset Offset for cone vertices.
- */
- void _newCells_TRIANGLE(const point_type** cells,
- int *numCells,
- const point_type cone[],
- const int coneSize,
- const int coneVertexOffset);
-
- /** Get new cells from refinement of a line cohseive cell with
- * Lagrange multiplier vertices.
- *
- * @param cells Vertices in refined cells (refined mesh).
- * @param numCells Number of refined cells.
- * @param cone Vertices in cell (original mesh).
- * @param coneSize Number of vertices in cell.
- * @param coneVertexOffsetNormal Offset for normal cone vertices.
- * @param coneVertexOffset Offset for censored cone vertices.
- */
- void _newCells_LINE_COHESIVE_LAGRANGE(const point_type** cells,
- int *numCells,
- const point_type cone[],
- const int coneSize,
- const int coneVertexOffsetNormal,
- const int coneVertexOffsetCensored);
-
-// PRIVATE MEMBERS //////////////////////////////////////////////////////
-private :
-
- static const int _edgesSize;
- static const int _cellsSize;
- EdgeType _edges[3]; ///< Buffer for edges
- point_type _cells[12]; ///< Buffer for cells
-
-
-// NOT IMPLEMENTED //////////////////////////////////////////////////////
-private :
-
- CellRefinerTri3(const CellRefinerTri3&); ///< Not implemented
- const CellRefinerTri3& operator=(const CellRefinerTri3&); ///< Not implemented
-
-}; // CellRefinerTri3
-
-#endif // pylith_topology_cellrefinertri3_hh
-
-
-// End of file
Modified: short/3D/PyLith/trunk/libsrc/pylith/topology/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/Makefile.am 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/Makefile.am 2013-07-26 22:13:24 UTC (rev 22685)
@@ -39,24 +39,10 @@
VisitorMesh.icc \
VisitorSubMesh.hh \
VisitorSubMesh.icc \
+ RefineUniform.hh \
topologyfwd.hh
noinst_HEADERS =
-# TEMPORARY
-#noinst_HEADERS += \
-# RefineUniform.hh
-# MeshRefiner.hh \
-# MeshRefiner.cc \
-# RefineEdges2.hh \
-# CellRefinerTri3.hh \
-# CellRefinerTet4.hh \
-# RefineFace4Edges2.hh \
-# CellRefinerQuad4.hh \
-# RefineVol8Face4Edges2.hh \
-# CellRefinerHex8.hh \
-# MeshOrder.hh
-
-
# End of file
Deleted: short/3D/PyLith/trunk/libsrc/pylith/topology/MeshOrder.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/MeshOrder.cc 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/MeshOrder.cc 2013-07-26 22:13:24 UTC (rev 22685)
@@ -1,150 +0,0 @@
-// -*- 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-2013 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ======================================================================
-//
-
-#include <portinfo>
-
-#include "MeshOrder.hh" // implementation of class methods
-
-#include <cassert> // USES assert()
-
-// ----------------------------------------------------------------------
-// Constructor
-ALE::MeshOrder::MeshOrder(void)
-{ // constructor
-} // constructor
-
-// ----------------------------------------------------------------------
-// Destructor
-ALE::MeshOrder::~MeshOrder(void)
-{ // destructor
-} // destructor
-
-// ----------------------------------------------------------------------
-// Determine order from pre-existing mesh.
-void
-ALE::MeshOrder::initialize(const ALE::Obj<mesh_type>& mesh)
-{ // initialize
- assert(!mesh.isNull());
-
- const ALE::Obj<mesh_type::label_sequence>& cells = mesh->heightStratum(0);
- assert(!cells.isNull());
-
- const Obj<mesh_type::label_sequence>& vertices = mesh->depthStratum(0);
- assert(!vertices.isNull());
-
- if (mesh->hasLabel("censored depth")) {
- // Count number of cells in censored depth (normal cells).
- const Obj<mesh_type::label_sequence>& cellsNormal = mesh->getLabelStratum("censored depth", mesh->depth());
- assert(!cellsNormal.isNull());
- const mesh_type::label_sequence::iterator cellsNormalEnd = cellsNormal->end();
- const int numCellsNormal = cellsNormal->size();
-
- // Count number of remaining cells (censored cells).
- const int numCellsCensored = cells->size() - numCellsNormal;
-
- // Get number of normal vertices.
- assert(!mesh->getFactory().isNull());
- Obj<mesh_type::numbering_type> vNumbering = mesh->getFactory()->getNumbering(mesh, "censored depth", 0);
- assert(!vNumbering.isNull());
- const int numVerticesNormal = vNumbering->size();
-
- // Count number of remaining vertices (censored vertices).
- const int numVerticesCensored = vertices->size() - numVerticesNormal;
-
- _cellsNormal = ALE::Interval<point_type>(0, numCellsNormal);
- _verticesNormal = ALE::Interval<point_type>(numCellsNormal, numCellsNormal+numVerticesNormal);
- _verticesCensored = ALE::Interval<point_type>(numCellsNormal+numVerticesNormal, numCellsNormal+numVerticesNormal+numVerticesCensored);
- _cellsCensored = ALE::Interval<point_type>(numCellsNormal+numVerticesNormal+numVerticesCensored,
- numCellsNormal+numVerticesNormal+numVerticesCensored+numCellsCensored);
- } else {
- const int numCells = cells->size();
- const int numVertices = vertices->size();
-
- _cellsNormal = ALE::Interval<point_type>(0, numCells);
- _verticesNormal = ALE::Interval<point_type>(numCells, numCells+numVertices);
- _verticesCensored = ALE::Interval<point_type>(numCells+numVertices, numCells+numVertices);
- _cellsCensored = ALE::Interval<point_type>(numCells+numVertices, numCells+numVertices);
- } // if/else
-} // initialize
-
-// ----------------------------------------------------------------------
-// Set range for normal cells.
-void
-ALE::MeshOrder::cellsNormal(const point_type min, const point_type max)
-{ // cellsNormal
- _cellsNormal = ALE::Interval<point_type>(min, max);
-} // cellsNormal
-
-// ----------------------------------------------------------------------
-// Get range for normal cells.
-const ALE::Interval<ALE::MeshOrder::point_type>&
-ALE::MeshOrder::cellsNormal(void) const
-{ // cellsNormal
- return _cellsNormal;
-} // cellsNormal
-
-// ----------------------------------------------------------------------
-// Set range for normal vertices.
-void
-ALE::MeshOrder::verticesNormal(const point_type min, const point_type max)
-{ // verticesNormal
- _verticesNormal = ALE::Interval<point_type>(min, max);
-} // verticesNormal
-
-// ----------------------------------------------------------------------
-// Get range for normal vertices.
-const ALE::Interval<ALE::MeshOrder::point_type>&
-ALE::MeshOrder::verticesNormal(void) const
-{ // verticesNormal
- return _verticesNormal;
-} // verticesNormal
-
-// ----------------------------------------------------------------------
-// Set range for censored cells.
-void
-ALE::MeshOrder::cellsCensored(const point_type min, const point_type max)
-{ // cellsCensored
- _cellsCensored = ALE::Interval<point_type>(min, max);
-} // cellsCensored
-
-// ----------------------------------------------------------------------
-// Get range for censored cells.
-const ALE::Interval<ALE::MeshOrder::point_type>&
-ALE::MeshOrder::cellsCensored(void) const
-{ // cellsCensored
- return _cellsCensored;
-} // cellsCensored
-
-// ----------------------------------------------------------------------
-// Set range for censored vertices.
-void
-ALE::MeshOrder::verticesCensored(const point_type min, const point_type max)
-{ // verticesCensored
- _verticesCensored = ALE::Interval<point_type>(min, max);
-} // verticesCensored
-
-// ----------------------------------------------------------------------
-// Get range for censored vertices.
-const ALE::Interval<ALE::MeshOrder::point_type>&
-ALE::MeshOrder::verticesCensored(void) const
-{ // verticesCensored
- return _verticesCensored;
-} // verticesCensored
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/libsrc/pylith/topology/MeshOrder.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/MeshOrder.hh 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/MeshOrder.hh 2013-07-26 22:13:24 UTC (rev 22685)
@@ -1,127 +0,0 @@
-// -*- 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-2013 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ======================================================================
-//
-
-/**
- * @file libsrc/topology/MeshOrder.hh
- *
- * @brief Object for managing order of mesh entities.
- *
- * Entities are stored in contiguous ranges.
- */
-
-#if !defined(pylith_topology_meshorder_hh)
-#define pylith_topology_meshorder_hh
-
-// Include directives ---------------------------------------------------
-#include "topologyfwd.hh" // forward declarations
-
-// MeshOrder ------------------------------------------------------------
-/// Object for managing order of mesh entities.
-class ALE::MeshOrder
-{ // MeshOrder
- typedef int point_type;
- typedef ALE::IMesh<PylithInt,PylithScalar> mesh_type;
-
-// PUBLIC MEMBERS ///////////////////////////////////////////////////////
-public :
-
- /// Constructor
- MeshOrder(void);
-
- /// Destructor
- ~MeshOrder(void);
-
- /** Determine order from pre-existing mesh.
- *
- * @param mesh Finite-element mesh.
- */
- void initialize(const ALE::Obj<mesh_type>& mesh);
-
- /** Set range for normal cells.
- *
- * @param min Minimum cell label.
- * @param max Maximum cell label.
- */
- void cellsNormal(const point_type min, const point_type max);
-
- /** Get range for normal cells.
- *
- * @returns Interval with range of normal cells.
- */
- const ALE::Interval<point_type>& cellsNormal(void) const;
-
- /** Set range for normal vertices.
- *
- * @param min Minimum vertex label.
- * @param max Maximum vertex label.
- */
- void verticesNormal(const point_type min, const point_type max);
-
- /** Get range for normal vertices.
- *
- * @returns Interval with range of normal vertices.
- */
- const ALE::Interval<point_type>& verticesNormal(void) const;
-
- /** Set range for censored cells.
- *
- * @param min Minimum cell label.
- * @param max Maximum cell label.
- */
- void cellsCensored(const point_type min, const point_type max);
-
- /** Get range for censored cells.
- *
- * @returns Interval with range of censored cells.
- */
- const ALE::Interval<point_type>& cellsCensored(void) const;
-
- /** Set range for censored vertices.
- *
- * @param min Minimum vertex label.
- * @param max Maximum vertex label.
- */
- void verticesCensored(const point_type min, const point_type max);
-
- /** Get range for censored vertices.
- *
- * @returns Interval with range of censored vertices.
- */
- const ALE::Interval<point_type>& verticesCensored(void) const;
-
-
-// PRIVATE MEMBERS //////////////////////////////////////////////////////
-private :
-
- ALE::Interval<point_type> _cellsNormal;
- ALE::Interval<point_type> _verticesNormal;
- ALE::Interval<point_type> _verticesCensored;
- ALE::Interval<point_type> _cellsCensored;
-
-// NOT IMPLEMENTED //////////////////////////////////////////////////////
-private :
-
- MeshOrder(const MeshOrder&); ///< Not implemented
- const MeshOrder& operator=(const MeshOrder&); ///< Not implemented
-
-}; // MeshOrder
-
-#endif // pylith_topology_meshorder_hh
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/libsrc/pylith/topology/MeshOrder.icc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/MeshOrder.icc 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/MeshOrder.icc 2013-07-26 22:13:24 UTC (rev 22685)
@@ -1,26 +0,0 @@
-// -*- 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-2013 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ======================================================================
-//
-
-#if !defined(pylith_topology_meshorder_hh)
-#error "MeshOrder.icc must be included only from MeshOrder.hh"
-#else
-
-#endif
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/libsrc/pylith/topology/MeshRefiner.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/MeshRefiner.cc 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/MeshRefiner.cc 2013-07-26 22:13:24 UTC (rev 22685)
@@ -1,883 +0,0 @@
-// -*- 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-2013 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ======================================================================
-//
-
-#include <portinfo>
-
-#include "MeshRefiner.hh" // implementation of class methods
-
-#include "MeshOrder.hh" // USES MeshOrder
-
-#include "pylith/utils/error.h" // USES PYLITH_CHECK_ERROR
-
-#include <cassert> // USES assert()
-
-// ----------------------------------------------------------------------
-// Constructor
-template<typename cellrefiner_type>
-ALE::MeshRefiner<cellrefiner_type>::MeshRefiner(void) :
- _orderOldMesh(new MeshOrder),
- _orderNewMesh(new MeshOrder)
-{ // constructor
-} // constructor
-
-// ----------------------------------------------------------------------
-// Destructor
-template<typename cellrefiner_type>
-ALE::MeshRefiner<cellrefiner_type>::~MeshRefiner(void)
-{ // destructor
- delete _orderOldMesh; _orderOldMesh = PETSC_NULL;
- delete _orderNewMesh; _orderNewMesh = PETSC_NULL;
-} // destructor
-
-// ----------------------------------------------------------------------
-// Refine mesh.
-template<typename cellrefiner_type>
-void
-ALE::MeshRefiner<cellrefiner_type>::refine(const Obj<mesh_type>& newMesh,
- const Obj<mesh_type>& mesh,
- cellrefiner_type& refiner)
-{ // refine
- assert(!mesh.isNull());
-
- ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
- //logger.setDebug(1);
- logger.stagePush("RefinedMesh");
-
- if (mesh->hasLabel("censored depth")) {
- _refineCensored(newMesh, mesh, refiner);
- } else {
- _refine(newMesh, mesh, refiner);
- } // if/else
-
- logger.stagePush("RefinedMeshStratification");
- _stratify(newMesh);
- logger.stagePop();
-
- logger.stagePush("RefinedMeshOverlap");
- _calcNewOverlap(newMesh, mesh, refiner);
- logger.stagePop();
-
- logger.stagePush("RefinedMeshIntSections");
- _createIntSections(newMesh, mesh, refiner);
- logger.stagePop();
-
- logger.stagePush("RefinedMeshLabels");
- _createLabels(newMesh, mesh, refiner);
- logger.stagePop();
-
- logger.stagePop(); // RefinedMesh
-} // refine
-
-// ----------------------------------------------------------------------
-// Refine mesh.
-template<typename cellrefiner_type>
-void
-ALE::MeshRefiner<cellrefiner_type>::_refine(const Obj<mesh_type>& newMesh,
- const Obj<mesh_type>& mesh,
- cellrefiner_type& refiner)
-{ // _refine
- typedef Interval<point_type> interval_type;
-
- assert(_orderOldMesh);
- assert(_orderNewMesh);
-
- ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
- //logger.setDebug(1);
- logger.stagePush("RefinedMeshCreation");
-
- // Calculate order in old mesh.
- _orderOldMesh->initialize(mesh);
-
- assert(!mesh.isNull());
- assert(!newMesh.isNull());
-
- // Get original mesh stuff.
- const Obj<mesh_type::label_sequence>& cells = mesh->heightStratum(0);
- assert(!cells.isNull());
- const mesh_type::label_sequence::iterator cellsEnd = cells->end();
-
- const Obj<mesh_type::label_sequence>& vertices = mesh->depthStratum(0);
- assert(!vertices.isNull());
-
- const Obj<mesh_type::sieve_type>& sieve = mesh->getSieve();
- assert(!sieve.isNull());
- ALE::ISieveVisitor::PointRetriever<mesh_type::sieve_type> cV(std::max(1, sieve->getMaxConeSize()));
-
- // Count number of cells.
- int newNumCells = 0;
- for (mesh_type::label_sequence::iterator c_iter = cells->begin(); c_iter != cellsEnd; ++c_iter) {
- newNumCells += refiner.numNewCells(*c_iter);
- } // for
-
- // Count number of vertices.
- const int oldNumVertices = vertices->size();
- int counterBegin = newNumCells + oldNumVertices;
- point_type curNewVertex = counterBegin;
- for(mesh_type::label_sequence::iterator c_iter = cells->begin(); c_iter != cellsEnd; ++c_iter) {
- cV.clear();
- sieve->cone(*c_iter, cV);
- refiner.splitCell(*c_iter, cV.getPoints(), cV.getSize(), &curNewVertex);
- } // for
- const int newNumVertices = oldNumVertices + curNewVertex - counterBegin;
-
- _orderNewMesh->cellsNormal(0, newNumCells);
- _orderNewMesh->verticesNormal(newNumCells, newNumCells+newNumVertices);
- _orderNewMesh->verticesCensored(newNumCells+newNumVertices, newNumCells+newNumVertices);
- _orderNewMesh->cellsCensored(newNumCells+newNumVertices, newNumCells+newNumVertices);
-
- // Allocate chart for new sieve.
- const Obj<mesh_type::sieve_type>& newSieve = newMesh->getSieve();
- assert(!newSieve.isNull());
- newSieve->setChart(mesh_type::sieve_type::chart_type(0, _orderNewMesh->cellsCensored().max()));
-
- // Create new sieve with correct sizes for refined cells
- point_type curNewCell = _orderNewMesh->cellsNormal().min();
- const interval_type::const_iterator oldCellsEnd = _orderOldMesh->cellsNormal().end();
- for (interval_type::const_iterator c_iter=_orderOldMesh->cellsNormal().begin(); c_iter != oldCellsEnd; ++c_iter) {
- // Set new cone and support sizes
- cV.clear();
- sieve->cone(*c_iter, cV);
- const point_type* cone = cV.getPoints();
- const int coneSize = cV.getSize();
-
- const point_type* newCells;
- int numNewCells = 0;
- refiner.getNewCells(&newCells, &numNewCells, *c_iter, cone, coneSize, *_orderOldMesh, *_orderNewMesh);
-
- for(int iCell=0; iCell < numNewCells; ++iCell, ++curNewCell) {
- newSieve->setConeSize(curNewCell, coneSize);
- for(int iVertex=0; iVertex < coneSize; ++iVertex) {
- newSieve->addSupportSize(newCells[iCell*coneSize+iVertex], 1);
- } // for
- } // for
-
- } // for
- newSieve->allocate();
-
- // Create refined cells in new sieve.
- curNewCell = _orderNewMesh->cellsNormal().min();
- for (interval_type::const_iterator c_iter=_orderOldMesh->cellsNormal().begin(); c_iter != oldCellsEnd; ++c_iter) {
- cV.clear();
- sieve->cone(*c_iter, cV);
- const point_type *cone = cV.getPoints();
- const int coneSize = cV.getSize();
-
- const point_type* newCells;
- int numNewCells = 0;
- refiner.getNewCells(&newCells, &numNewCells, *c_iter, cone, coneSize, *_orderOldMesh, *_orderNewMesh);
-
- for(int iCell=0; iCell < numNewCells; ++iCell, ++curNewCell) {
- newSieve->setCone(&newCells[iCell*coneSize], curNewCell);
- } // for
- } // for
- newSieve->symmetrize();
-
-
- logger.stagePop();
- //logger.setDebug(0);
- logger.stagePush("RefinedMeshCoordinates");
-
- // Set coordinates in refined mesh.
- const Obj<mesh_type::real_section_type>& coordinates = mesh->getRealSection("coordinates");
- assert(!coordinates.isNull());
- const Obj<mesh_type::real_section_type>& newCoordinates = newMesh->getRealSection("coordinates");
- assert(!newCoordinates.isNull());
-
- const mesh_type::label_sequence::const_iterator verticesEnd = vertices->end();
- assert(vertices->size() > 0);
- const int spaceDim = coordinates->getFiberDimension(*vertices->begin());
- assert(spaceDim > 0);
- newCoordinates->setChart(mesh_type::sieve_type::chart_type(_orderNewMesh->verticesNormal().min(), _orderNewMesh->verticesCensored().max()));
-
- interval_type::const_iterator newVerticesEnd = _orderNewMesh->verticesCensored().end();
- for (interval_type::const_iterator v_iter=_orderNewMesh->verticesNormal().begin(); v_iter != newVerticesEnd; ++v_iter) {
- newCoordinates->setFiberDimension(*v_iter, spaceDim);
- } // for
- newCoordinates->allocatePoint();
-
- const interval_type::const_iterator oldVerticesEnd = _orderOldMesh->verticesCensored().end();
- for (interval_type::const_iterator vOld_iter=_orderOldMesh->verticesNormal().begin(), vNew_iter=_orderNewMesh->verticesNormal().begin(); vOld_iter != oldVerticesEnd; ++vOld_iter, ++vNew_iter) {
- //std::cout << "Copy coordinates from old vertex " << *vOld_iter << " to new vertex " << *vNew_iter << std::endl;
- newCoordinates->updatePoint(*vNew_iter, coordinates->restrictPoint(*vOld_iter));
- } // for
-
- refiner.setCoordsNewVertices(newCoordinates, coordinates);
-
- logger.stagePop();
-} // _refine
-
-// ----------------------------------------------------------------------
-// Refine mesh with a censored depth.
-template<typename cellrefiner_type>
-void
-ALE::MeshRefiner<cellrefiner_type>::_refineCensored(const Obj<mesh_type>& newMesh,
- const Obj<mesh_type>& mesh,
- cellrefiner_type& refiner)
-{ // _refineCensored
- typedef Interval<point_type> interval_type;
-
- assert(_orderOldMesh);
- assert(_orderNewMesh);
-
- // Calculate order in old mesh.
- _orderOldMesh->initialize(mesh);
-
- assert(!mesh.isNull());
- assert(!newMesh.isNull());
-
- // Get original mesh stuff.
- const Obj<mesh_type::label_sequence>& cells = mesh->heightStratum(0);
- assert(!cells.isNull());
- const mesh_type::label_sequence::iterator cellsEnd = cells->end();
-
- const Obj<mesh_type::label_sequence>& vertices = mesh->depthStratum(0);
- assert(!vertices.isNull());
-
- const Obj<mesh_type::sieve_type>& sieve = mesh->getSieve();
- assert(!sieve.isNull());
- ALE::ISieveVisitor::PointRetriever<mesh_type::sieve_type> cV(std::max(1, sieve->getMaxConeSize()));
-
- // Count number of cells in censored depth (normal cells).
- const Obj<mesh_type::label_sequence>& cellsNormal = mesh->getLabelStratum("censored depth", mesh->depth());
- assert(!cellsNormal.isNull());
- const mesh_type::label_sequence::iterator cellsNormalEnd = cellsNormal->end();
- int newNumCellsNormal = 0;
- for(mesh_type::label_sequence::iterator c_iter = cellsNormal->begin(); c_iter != cellsNormalEnd; ++c_iter)
- newNumCellsNormal += refiner.numNewCells(*c_iter);
-
- // Count number of remaining cells (other cells).
- const int numSkip = cellsNormal->size();
- mesh_type::label_sequence::const_iterator c_iter = cells->begin();
- for (int i=0; i < numSkip; ++i)
- ++c_iter;
- const mesh_type::label_sequence::const_iterator cellsCensoredBegin = c_iter;
- int newNumCellsCensored = 0;
- for (; c_iter != cellsEnd; ++c_iter)
- newNumCellsCensored += refiner.numNewCells(*c_iter);
-
- // Count number of normal vertices.
- assert(!mesh->getFactory().isNull());
- Obj<mesh_type::numbering_type> vNumbering = mesh->getFactory()->getNumbering(mesh, "censored depth", 0);
- assert(!vNumbering.isNull());
- const int oldNumVerticesNormal = vNumbering->size();
-
- int counterBegin = newNumCellsNormal + oldNumVerticesNormal;
- point_type curNewVertex = counterBegin;
- for(mesh_type::label_sequence::iterator c_iter = cellsNormal->begin(); c_iter != cellsNormalEnd; ++c_iter) {
- cV.clear();
- sieve->cone(*c_iter, cV);
- refiner.splitCell(*c_iter, cV.getPoints(), cV.getSize(), &curNewVertex);
- } // for
- for(mesh_type::label_sequence::iterator c_iter = cellsCensoredBegin; c_iter != cellsEnd; ++c_iter) {
- cV.clear();
- sieve->cone(*c_iter, cV);
- refiner.splitCell(*c_iter, cV.getPoints(), cV.getSize(), &curNewVertex);
- } // for
- const int newNumVerticesNormal = curNewVertex - counterBegin + oldNumVerticesNormal;
-
- // Count number of remaining vertices (other vertices).
- const int oldNumVerticesCensored = vertices->size() - oldNumVerticesNormal;
- counterBegin = newNumCellsNormal + newNumVerticesNormal + oldNumVerticesCensored;
- curNewVertex = counterBegin;
- for(mesh_type::label_sequence::iterator c_iter = cellsCensoredBegin; c_iter != cellsEnd; ++c_iter) {
- cV.clear();
- sieve->cone(*c_iter, cV);
- refiner.splitCellUncensored(*c_iter, cV.getPoints(), cV.getSize(), &curNewVertex);
- } // for
- const int newNumVerticesCensored = curNewVertex - counterBegin + oldNumVerticesCensored;
-
- _orderNewMesh->cellsNormal(0, newNumCellsNormal);
- _orderNewMesh->verticesNormal(newNumCellsNormal, newNumCellsNormal+newNumVerticesNormal);
- _orderNewMesh->verticesCensored(newNumCellsNormal+newNumVerticesNormal, newNumCellsNormal+newNumVerticesNormal+newNumVerticesCensored);
- _orderNewMesh->cellsCensored(newNumCellsNormal+newNumVerticesNormal+newNumVerticesCensored,
- newNumCellsNormal+newNumVerticesNormal+newNumVerticesCensored+newNumCellsCensored);
-#if 0
- PetscErrorCode err;
- int oldNumCellsNormal = _orderOldMesh->cellsNormal().max();
- int oldNumCellsCensored = _orderOldMesh->cellsCensored().max() - _orderOldMesh->cellsCensored().min();
- err = PetscSynchronizedPrintf(mesh->comm(), "[%d]Old normal cells [%d, %d)\n", mesh->commRank(), 0, oldNumCellsNormal);
- err = PetscSynchronizedPrintf(mesh->comm(), "[%d]Old fault cells [%d, %d)\n", mesh->commRank(), oldNumCellsNormal+oldNumVerticesNormal+oldNumVerticesCensored, oldNumCellsNormal+oldNumVerticesNormal+oldNumVerticesCensored+oldNumCellsCensored);
- err = PetscSynchronizedPrintf(mesh->comm(), "[%d]Old normal vertices [%d, %d)\n", mesh->commRank(), oldNumCellsNormal, oldNumCellsNormal+oldNumVerticesNormal);
- err = PetscSynchronizedPrintf(mesh->comm(), "[%d]Old fault vertices [%d, %d)\n", mesh->commRank(), oldNumCellsNormal+oldNumVerticesNormal, oldNumCellsNormal+oldNumVerticesNormal+oldNumVerticesCensored);
- err = PetscSynchronizedPrintf(mesh->comm(), "[%d]New normal cells [%d, %d)\n", mesh->commRank(), 0, newNumCellsNormal);
- err = PetscSynchronizedPrintf(mesh->comm(), "[%d]New fault cells [%d, %d)\n", mesh->commRank(), newNumCellsNormal+newNumVerticesNormal+newNumVerticesCensored, newNumCellsNormal+newNumVerticesNormal+newNumVerticesCensored+newNumCellsCensored);
- err = PetscSynchronizedPrintf(mesh->comm(), "[%d]New normal vertices [%d, %d)\n", mesh->commRank(), newNumCellsNormal, newNumCellsNormal+newNumVerticesNormal);
- err = PetscSynchronizedPrintf(mesh->comm(), "[%d]New fault vertices [%d, %d)\n", mesh->commRank(), newNumCellsNormal+newNumVerticesNormal, newNumCellsNormal+newNumVerticesNormal+newNumVerticesCensored);
- err = PetscSynchronizedFlush(mesh->comm());
-#endif
- // Allocate chart for new sieve.
- const Obj<mesh_type::sieve_type>& newSieve = newMesh->getSieve();
- assert(!newSieve.isNull());
- newSieve->setChart(mesh_type::sieve_type::chart_type(0, _orderNewMesh->cellsCensored().max()));
-
- // Create new sieve with correct sizes for refined cells
- point_type curNewCell = _orderNewMesh->cellsNormal().min();
- interval_type::const_iterator oldCellsEnd = _orderOldMesh->cellsNormal().end();
- for (interval_type::const_iterator c_iter=_orderOldMesh->cellsNormal().begin(); c_iter != oldCellsEnd; ++c_iter) {
- // Set new cone and support sizes
- cV.clear();
- sieve->cone(*c_iter, cV);
- const point_type* cone = cV.getPoints();
- const int coneSize = cV.getSize();
-
- const point_type* newCells;
- int numNewCells = 0;
- refiner.getNewCells(&newCells, &numNewCells, *c_iter, cone, coneSize, *_orderOldMesh, *_orderNewMesh);
-
- for(int iCell=0; iCell < numNewCells; ++iCell, ++curNewCell) {
- newSieve->setConeSize(curNewCell, coneSize);
- for(int iVertex=0; iVertex < coneSize; ++iVertex) {
- newSieve->addSupportSize(newCells[iCell*coneSize+iVertex], 1);
- } // for
- } // for
- } // for
- // Reset current new cell value and loop over censored cells.
- curNewCell = _orderNewMesh->cellsCensored().min();
- oldCellsEnd = _orderOldMesh->cellsCensored().end();
- for (interval_type::const_iterator c_iter=_orderOldMesh->cellsCensored().begin(); c_iter != oldCellsEnd; ++c_iter) {
- // Set new cone and support sizes
- cV.clear();
- sieve->cone(*c_iter, cV);
- const point_type* cone = cV.getPoints();
- const int coneSize = cV.getSize();
-
- const point_type* newCells;
- int numNewCells = 0;
- refiner.getNewCells(&newCells, &numNewCells, *c_iter, cone, coneSize, *_orderOldMesh, *_orderNewMesh);
-
- for(int iCell=0; iCell < numNewCells; ++iCell, ++curNewCell) {
- newSieve->setConeSize(curNewCell, coneSize);
- for(int iVertex=0; iVertex < coneSize; ++iVertex) {
- newSieve->addSupportSize(newCells[iCell*coneSize+iVertex], 1);
- } // for
- } // for
- } // for
- newSieve->allocate();
-
- // Create refined cells in new sieve.
- curNewCell = _orderNewMesh->cellsNormal().min();
- oldCellsEnd = _orderOldMesh->cellsNormal().end();
- for (interval_type::const_iterator c_iter=_orderOldMesh->cellsNormal().begin(); c_iter != oldCellsEnd; ++c_iter) {
- cV.clear();
- sieve->cone(*c_iter, cV);
- const point_type *cone = cV.getPoints();
- const int coneSize = cV.getSize();
-
- const point_type* newCells;
- int numNewCells = 0;
- refiner.getNewCells(&newCells, &numNewCells, *c_iter, cone, coneSize, *_orderOldMesh, *_orderNewMesh);
-
- for(int iCell=0; iCell < numNewCells; ++iCell, ++curNewCell) {
- newSieve->setCone(&newCells[iCell*coneSize], curNewCell);
- } // for
- } // for
- curNewCell = _orderNewMesh->cellsCensored().min();
- oldCellsEnd = _orderOldMesh->cellsCensored().end();
- for (interval_type::const_iterator c_iter=_orderOldMesh->cellsCensored().begin(); c_iter != oldCellsEnd; ++c_iter) {
- cV.clear();
- sieve->cone(*c_iter, cV);
- const point_type *cone = cV.getPoints();
- const int coneSize = cV.getSize();
-
- const point_type* newCells;
- int numNewCells = 0;
- refiner.getNewCells(&newCells, &numNewCells, *c_iter, cone, coneSize, *_orderOldMesh, *_orderNewMesh);
-
- for(int iCell=0; iCell < numNewCells; ++iCell, ++curNewCell) {
- newSieve->setCone(&newCells[iCell*coneSize], curNewCell);
- } // for
- } // for
- newSieve->symmetrize();
-
- // Set coordinates in refined mesh.
- const Obj<mesh_type::real_section_type>& coordinates = mesh->getRealSection("coordinates");
- assert(!coordinates.isNull());
- const Obj<mesh_type::real_section_type>& newCoordinates = newMesh->getRealSection("coordinates");
- assert(!newCoordinates.isNull());
-
- const mesh_type::label_sequence::const_iterator verticesEnd = vertices->end();
- assert(vertices->size() > 0);
- const int spaceDim = coordinates->getFiberDimension(*vertices->begin());
- assert(spaceDim > 0);
- newCoordinates->setChart(mesh_type::sieve_type::chart_type(_orderNewMesh->verticesNormal().min(), _orderNewMesh->verticesCensored().max()));
-
- const interval_type::const_iterator newVerticesEnd = _orderNewMesh->verticesCensored().end();
- for (interval_type::const_iterator v_iter=_orderNewMesh->verticesNormal().begin(); v_iter != newVerticesEnd; ++v_iter) {
- newCoordinates->setFiberDimension(*v_iter, spaceDim);
- } // for
- newCoordinates->allocatePoint();
-
- interval_type::const_iterator oldVerticesEnd = _orderOldMesh->verticesNormal().end();
- for (interval_type::const_iterator vOld_iter=_orderOldMesh->verticesNormal().begin(), vNew_iter=_orderNewMesh->verticesNormal().begin(); vOld_iter != oldVerticesEnd; ++vOld_iter, ++vNew_iter) {
- //std::cout << "Copy coordinates from old vertex " << *vOld_iter << " to new vertex " << *vNew_iter << std::endl;
- newCoordinates->updatePoint(*vNew_iter, coordinates->restrictPoint(*vOld_iter));
- } // for
- oldVerticesEnd = _orderOldMesh->verticesCensored().end();
- for (interval_type::const_iterator vOld_iter=_orderOldMesh->verticesCensored().begin(), vNew_iter=_orderNewMesh->verticesCensored().begin(); vOld_iter != oldVerticesEnd; ++vOld_iter, ++vNew_iter) {
- //std::cout << "Copy coordinates from old vertex " << *vOld_iter << " to new vertex " << *vNew_iter << std::endl;
- newCoordinates->updatePoint(*vNew_iter, coordinates->restrictPoint(*vOld_iter));
- } // for
-
- refiner.setCoordsNewVertices(newCoordinates, coordinates);
-
- // Create sensored depth
- const ALE::Obj<SieveFlexMesh::label_type>& censoredLabel = newMesh->createLabel("censored depth");
- assert(!censoredLabel.isNull());
-
- mesh_type::DepthVisitor depthVisitor(*newSieve, _orderNewMesh->verticesCensored().min(), *censoredLabel);
-
- newSieve->roots(depthVisitor);
- while(depthVisitor.isModified()) {
- // FIX: Avoid the copy here somehow by fixing the traversal
- std::vector<mesh_type::point_type> modifiedPoints(depthVisitor.getModifiedPoints().begin(), depthVisitor.getModifiedPoints().end());
-
- depthVisitor.clear();
- newSieve->support(modifiedPoints, depthVisitor);
- } // while
-} // _refineCensored
-
-// ----------------------------------------------------------------------
-// Stratify mesh.
-template<typename cellrefiner_type>
-void
-ALE::MeshRefiner<cellrefiner_type>::_stratify(const Obj<mesh_type>& mesh)
-{ // _stratify
- typedef Interval<point_type> interval_type;
-
- assert(_orderNewMesh);
- assert(_orderOldMesh);
-
- // Fast stratification
- const Obj<mesh_type::label_type>& height = mesh->createLabel("height");
- const Obj<mesh_type::label_type>& depth = mesh->createLabel("depth");
-
- // Set height/depth of cells
- interval_type::const_iterator cellsEnd = _orderNewMesh->cellsNormal().end();
- for (interval_type::const_iterator c_iter = _orderNewMesh->cellsNormal().begin(); c_iter != cellsEnd; ++c_iter) {
- height->setCone(0, *c_iter);
- depth->setCone(1, *c_iter);
- } // for
- cellsEnd = _orderNewMesh->cellsCensored().end();
- for (interval_type::const_iterator c_iter = _orderNewMesh->cellsCensored().begin(); c_iter != cellsEnd; ++c_iter) {
- height->setCone(0, *c_iter);
- depth->setCone(1, *c_iter);
- } // for
-
- // Set height/depth of vertices
- interval_type::const_iterator verticesEnd = _orderNewMesh->verticesNormal().end();
- for (interval_type::const_iterator v_iter = _orderNewMesh->verticesNormal().begin(); v_iter != verticesEnd; ++v_iter) {
- height->setCone(1, *v_iter);
- depth->setCone(0, *v_iter);
- } // for
- verticesEnd = _orderNewMesh->verticesCensored().end();
- for (interval_type::const_iterator v_iter = _orderNewMesh->verticesCensored().begin(); v_iter != verticesEnd; ++v_iter) {
- height->setCone(1, *v_iter);
- depth->setCone(0, *v_iter);
- } // for
-
- mesh->setHeight(1);
- mesh->setDepth(1);
-} // _stratify
-
-// ----------------------------------------------------------------------
-// Create integer sections in new mesh.
-template<typename cellrefiner_type>
-void
-ALE::MeshRefiner<cellrefiner_type>::_createIntSections(const Obj<mesh_type>& newMesh,
- const Obj<mesh_type>& mesh,
- cellrefiner_type& refiner)
-{ // _createIntSections
- assert(!newMesh.isNull());
- assert(!mesh.isNull());
-
- const ALE::Obj<std::set<std::string> >& sectionNames =
- mesh->getIntSections();
- const std::set<std::string>::const_iterator namesBegin =
- sectionNames->begin();
- const std::set<std::string>::const_iterator namesEnd =
- sectionNames->end();
- for (std::set<std::string>::const_iterator name=namesBegin;
- name != namesEnd;
- ++name) {
- const ALE::Obj<mesh_type::int_section_type>& group = mesh->getIntSection(*name);
- const ALE::Obj<mesh_type::int_section_type>& newGroup = newMesh->getIntSection(*name);
- const mesh_type::int_section_type::chart_type& chart = group->getChart();
-
- // :WARNING: Only implemented for integer sections containing vertices.
-
- const point_type oldVerticesStart = _orderOldMesh->verticesNormal().min();
- const point_type oldVerticesCensoredStart = _orderOldMesh->verticesCensored().min();
- const point_type oldVerticesEnd = _orderOldMesh->verticesCensored().max();
-
- const point_type newVerticesStart = _orderNewMesh->verticesNormal().min();
- const point_type newVerticesCensoredStart = _orderNewMesh->verticesCensored().min();
- const point_type newVerticesEnd = _orderNewMesh->verticesCensored().max();
-
- newGroup->setChart(mesh_type::int_section_type::chart_type(newVerticesStart, newVerticesEnd));
- const mesh_type::int_section_type::chart_type& newChart = newGroup->getChart();
-
- //std::cout << "VERTICES start: " << newVerticesStart << ", end: " << newVerticesEnd << std::endl;
-
- const point_type chartMax = chart.max();
- for (point_type pOld=chart.min(); pOld < chartMax; ++pOld) {
- if (group->getFiberDimension(pOld)) {
- if (_orderOldMesh->verticesNormal().hasPoint(pOld)) {
- const point_type pNew = newVerticesStart + pOld - oldVerticesStart;
- newGroup->setFiberDimension(pNew, 1);
- } else if (_orderOldMesh->verticesCensored().hasPoint(pOld)) {
- const point_type pNew = newVerticesCensoredStart + pOld - oldVerticesCensoredStart;
- newGroup->setFiberDimension(pNew, 1);
- } else {
- throw ALE::Exception("Creating integer sections during refinement containing entities other than vertices not implemented.");
- } // if/else
- } // if
- } // for
- refiner.groupAddNewVertices(newGroup, group);
-
- newGroup->allocatePoint();
- for (point_type pOld=chart.min(); pOld < chartMax; ++pOld) {
- if (group->getFiberDimension(pOld)) {
- if (_orderOldMesh->verticesNormal().hasPoint(pOld)) {
- const point_type pNew = newVerticesStart + pOld - oldVerticesStart;
- newGroup->updatePoint(pNew, group->restrictPoint(pOld));
- } else if (_orderOldMesh->verticesCensored().hasPoint(pOld)) {
- const point_type pNew = newVerticesCensoredStart + pOld - oldVerticesCensoredStart;
- newGroup->updatePoint(pNew, group->restrictPoint(pOld));
- } else {
- throw ALE::Exception("Creating integer sections during refinement containing entities other than vertices not implemented.");
- } // if/else
- } // if
- } // for
- refiner.groupSetNewVertices(newGroup, group);
- } // for
-} // _createIntSections
-
-// ----------------------------------------------------------------------
-// Create labels in new mesh.
-template<typename cellrefiner_type>
-void
-ALE::MeshRefiner<cellrefiner_type>::_createLabels(const Obj<mesh_type>& newMesh,
- const Obj<mesh_type>& mesh,
- cellrefiner_type& refiner)
-{ // _createLabels
- assert(!newMesh.isNull());
- assert(!mesh.isNull());
- assert(_orderOldMesh);
- assert(_orderNewMesh);
-
- typedef ALE::Interval<point_type> interval_type;
-
- const mesh_type::labels_type labels = mesh->getLabels();
- const mesh_type::labels_type::const_iterator labelsEnd = labels.end();
- for (mesh_type::labels_type::const_iterator l_iter=labels.begin(); l_iter != labelsEnd; ++l_iter) {
- // Handle censored depth separately.
- if ("censored depth" == l_iter->first || "depth" == l_iter->first || "height" == l_iter->first) {
- continue;
- } // if
-
- const Obj<mesh_type::label_type>& oldLabel = l_iter->second;
- assert(!oldLabel.isNull());
- const Obj<mesh_type::label_type>& newLabel = newMesh->createLabel(l_iter->first);
- assert(!newLabel.isNull());
-
- const int defaultValue = -999;
-
- // Update cells
- // Normal cells
- interval_type::const_iterator pointsEnd = _orderOldMesh->cellsNormal().end();
- for (interval_type::const_iterator p_iter = _orderOldMesh->cellsNormal().begin(); p_iter != pointsEnd; ++p_iter) {
- const int value = mesh->getValue(oldLabel, *p_iter, defaultValue);
- if (defaultValue == value)
- continue;
-
- const int numNewCellsPerCell = refiner.numNewCells(*p_iter);
- mesh_type::point_type pNew = _orderNewMesh->cellsNormal().min() + (*p_iter - _orderOldMesh->cellsNormal().min())*numNewCellsPerCell;
- for(int i=0; i < numNewCellsPerCell; ++i, ++pNew)
- newMesh->setValue(newLabel, pNew, value);
- } // for
-
- // Censored cells
- pointsEnd = _orderOldMesh->cellsCensored().end();
- for (interval_type::const_iterator p_iter = _orderOldMesh->cellsCensored().begin(); p_iter != pointsEnd; ++p_iter) {
- const int value = mesh->getValue(oldLabel, *p_iter, defaultValue);
- if (defaultValue == value)
- continue;
-
- const int numNewCellsPerCell = refiner.numNewCells(*p_iter);
- mesh_type::point_type pNew = _orderNewMesh->cellsCensored().min() + (*p_iter - _orderOldMesh->cellsCensored().min())*numNewCellsPerCell;
- for(int i=0; i < numNewCellsPerCell; ++i, ++pNew)
- newMesh->setValue(newLabel, pNew, value);
- } // for
-
- // Normal vertices
- pointsEnd = _orderOldMesh->verticesNormal().end();
- for (interval_type::const_iterator p_iter = _orderOldMesh->verticesNormal().begin(); p_iter != pointsEnd; ++p_iter) {
- const int value = mesh->getValue(oldLabel, *p_iter, defaultValue);
- if (defaultValue == value)
- continue;
-
- const mesh_type::point_type pNew = _orderNewMesh->verticesNormal().min() + (*p_iter - _orderOldMesh->verticesNormal().min());
- newMesh->setValue(newLabel, pNew, value);
- } // for
-
- // Censored vertices
- pointsEnd = _orderOldMesh->verticesCensored().end();
- for (interval_type::const_iterator p_iter = _orderOldMesh->verticesCensored().begin(); p_iter != pointsEnd; ++p_iter) {
- const int value = mesh->getValue(oldLabel, *p_iter, defaultValue);
- if (defaultValue == value)
- continue;
-
- const mesh_type::point_type pNew = _orderNewMesh->verticesCensored().min() + (*p_iter - _orderOldMesh->verticesCensored().min());
- newMesh->setValue(newLabel, pNew, value);
- } // for
-
- refiner.labelAddNewVertices(newMesh, mesh, l_iter->first.c_str());
- } // for
-} // _createLabels
-
-// ----------------------------------------------------------------------
-// Calculate new overlap.
-template<typename cellrefiner_type>
-void
-ALE::MeshRefiner<cellrefiner_type>::_calcNewOverlap(const Obj<mesh_type>& newMesh,
- const Obj<mesh_type>& mesh,
- cellrefiner_type& refiner)
-{ // _calcNewOverlap
- assert(!newMesh.isNull());
- assert(!mesh.isNull());
-
- // Exchange new boundary vertices
- // We can convert endpoints, and then just match to new vertex on this side
- // 1) Create the overlap of edges which are vertex pairs (do not need for interpolated meshes)
- // 2) Create a section of overlap edge --> new vertex (this will generalize to other split points in interpolated meshes)
- // 3) Copy across new overlap
- // 4) Fuse matches new vertex pairs and inserts them into the old overlap
-
- // Create the parallel overlap
-
- // Get offsets for points across processors and add points in overlap from original mesh to new overlap
- int* oldVerticesStartNormalP = (mesh->commSize() > 0) ? new int[mesh->commSize()] : 0;
- int* oldVerticesStartFaultP = (mesh->commSize() > 0) ? new int[mesh->commSize()] : 0;
- int* newVerticesStartNormalP = (newMesh->commSize() > 0) ? new int[newMesh->commSize()] : 0;
- int* newVerticesStartFaultP = (newMesh->commSize() > 0) ? new int[newMesh->commSize()] : 0;
- int ierr = 0;
-
- const int oldVerticesStartNormal = _orderOldMesh->verticesNormal().min();
- const int oldVerticesStartFault = _orderOldMesh->verticesCensored().min();
- const int newVerticesStartNormal = _orderNewMesh->verticesNormal().min();
- const int newVerticesStartFault = _orderNewMesh->verticesCensored().min();
-
- ierr = MPI_Allgather((void *) &oldVerticesStartNormal, 1, MPI_INT, oldVerticesStartNormalP, 1, MPI_INT, mesh->comm());CHKERRXX(ierr);
- ierr = MPI_Allgather((void *) &oldVerticesStartFault, 1, MPI_INT, oldVerticesStartFaultP, 1, MPI_INT, mesh->comm());CHKERRXX(ierr);
- ierr = MPI_Allgather((void *) &newVerticesStartNormal, 1, MPI_INT, newVerticesStartNormalP, 1, MPI_INT, newMesh->comm());CHKERRXX(ierr);
- ierr = MPI_Allgather((void *) &newVerticesStartFault, 1, MPI_INT, newVerticesStartFaultP, 1, MPI_INT, newMesh->comm());CHKERRXX(ierr);
- Obj<mesh_type::send_overlap_type> newSendOverlap = newMesh->getSendOverlap();
- Obj<mesh_type::recv_overlap_type> newRecvOverlap = newMesh->getRecvOverlap();
- const Obj<mesh_type::send_overlap_type>& sendOverlap = mesh->getSendOverlap();
- const Obj<mesh_type::recv_overlap_type>& recvOverlap = mesh->getRecvOverlap();
- const mesh_type::send_overlap_type::source_type localOffsetNormal = newVerticesStartNormal - oldVerticesStartNormal;
- const mesh_type::send_overlap_type::source_type localOffsetFault = newVerticesStartFault - oldVerticesStartFault;
-#if 0
- Obj<mesh_type::send_overlap_type::traits::capSequence> sendPoints = sendOverlap->cap();
-
- for(mesh_type::send_overlap_type::traits::capSequence::iterator p_iter = sendPoints->begin(); p_iter != sendPoints->end(); ++p_iter) {
- const Obj<mesh_type::send_overlap_type::traits::supportSequence>& ranks = sendOverlap->support(*p_iter);
- const mesh_type::send_overlap_type::source_type& localPoint = *p_iter;
-
- for(mesh_type::send_overlap_type::traits::supportSequence::iterator r_iter = ranks->begin(); r_iter != ranks->end(); ++r_iter) {
- const int rank = *r_iter;
- const mesh_type::send_overlap_type::source_type& remotePoint = r_iter.color();
- const mesh_type::send_overlap_type::source_type remoteOffsetNormal = newVerticesStartNormalP[rank] - oldVerticesStartNormalP[rank];
- const mesh_type::send_overlap_type::source_type remoteOffsetFault = newVerticesStartFaultP[rank] - oldVerticesStartFaultP[rank];
-
- if (localPoint >= oldVerticesStartNormal && localPoint < oldVerticesStartFault) {
- assert(remotePoint >= oldVerticesStartNormalP[rank] && remotePoint < oldVerticesStartFaultP[rank]);
- assert(remotePoint+remoteOffsetNormal >= 0);
- newSendOverlap->addArrow(localPoint+localOffsetNormal, rank, remotePoint+remoteOffsetNormal);
- } else {
- assert(localPoint >= oldVerticesStartFault);
- assert(remotePoint >= oldVerticesStartFaultP[rank]);
- assert(remotePoint+remoteOffsetFault >= 0);
- newSendOverlap->addArrow(localPoint+localOffsetFault, rank, remotePoint+remoteOffsetFault);
- }
- } // for
- } // for
- Obj<mesh_type::recv_overlap_type::traits::baseSequence> recvPoints = recvOverlap->base();
-
- for(mesh_type::recv_overlap_type::traits::baseSequence::iterator p_iter = recvPoints->begin(); p_iter != recvPoints->end(); ++p_iter) {
- const Obj<mesh_type::recv_overlap_type::traits::coneSequence>& ranks = recvOverlap->cone(*p_iter);
- const mesh_type::recv_overlap_type::target_type& localPoint = *p_iter;
-
- for(mesh_type::recv_overlap_type::traits::coneSequence::iterator r_iter = ranks->begin(); r_iter != ranks->end(); ++r_iter) {
- const int rank = *r_iter;
- const mesh_type::recv_overlap_type::target_type& remotePoint = r_iter.color();
- const mesh_type::send_overlap_type::source_type remoteOffsetNormal = newVerticesStartNormalP[rank] - oldVerticesStartNormalP[rank];
- const mesh_type::send_overlap_type::source_type remoteOffsetFault = newVerticesStartFaultP[rank] - oldVerticesStartFaultP[rank];
-
- if (localPoint >= oldVerticesStartNormal && localPoint < oldVerticesStartFault) {
- assert(remotePoint >= oldVerticesStartNormalP[rank] && remotePoint < oldVerticesStartFaultP[rank]);
- newRecvOverlap->addArrow(rank, localPoint+localOffsetNormal, remotePoint+remoteOffsetNormal);
- } else {
- assert(localPoint >= oldVerticesStartFault);
- assert(remotePoint >= oldVerticesStartFaultP[rank]);
- newRecvOverlap->addArrow(rank, localPoint+localOffsetFault, remotePoint+remoteOffsetFault);
- }
- } // for
- } // for
-#else
- mesh_type::send_overlap_type::baseSequence::iterator sendRanksBegin = sendOverlap->baseBegin();
- mesh_type::send_overlap_type::baseSequence::iterator sendRanksEnd = sendOverlap->baseEnd();
-
- for(mesh_type::send_overlap_type::baseSequence::iterator r_iter = sendRanksBegin; r_iter != sendRanksEnd; ++r_iter) {
- const int rank = *r_iter;
- const mesh_type::send_overlap_type::source_type remoteOffsetNormal = newVerticesStartNormalP[rank] - oldVerticesStartNormalP[rank];
- const mesh_type::send_overlap_type::source_type remoteOffsetFault = newVerticesStartFaultP[rank] - oldVerticesStartFaultP[rank];
- const mesh_type::send_overlap_type::coneSequence::iterator pointsBegin = sendOverlap->coneBegin(rank);
- const mesh_type::send_overlap_type::coneSequence::iterator pointsEnd = sendOverlap->coneEnd(rank);
-
- for(mesh_type::send_overlap_type::coneSequence::iterator p_iter = pointsBegin; p_iter != pointsEnd; ++p_iter) {
- const mesh_type::send_overlap_type::source_type& localPoint = *p_iter;
- const mesh_type::send_overlap_type::source_type& remotePoint = p_iter.color();
-
- if (localPoint >= oldVerticesStartNormal && localPoint < oldVerticesStartFault) {
- assert(remotePoint >= oldVerticesStartNormalP[rank] && remotePoint < oldVerticesStartFaultP[rank]);
- assert(remotePoint+remoteOffsetNormal >= 0);
- newSendOverlap->addArrow(localPoint+localOffsetNormal, rank, remotePoint+remoteOffsetNormal);
- } else {
- assert(localPoint >= oldVerticesStartFault);
- assert(remotePoint >= oldVerticesStartFaultP[rank]);
- assert(remotePoint+remoteOffsetFault >= 0);
- newSendOverlap->addArrow(localPoint+localOffsetFault, rank, remotePoint+remoteOffsetFault);
- }
- }
- }
- mesh_type::recv_overlap_type::capSequence::iterator recvRanksBegin = recvOverlap->capBegin();
- mesh_type::recv_overlap_type::capSequence::iterator recvRanksEnd = recvOverlap->capEnd();
-
- for(mesh_type::recv_overlap_type::capSequence::iterator r_iter = recvRanksBegin; r_iter != recvRanksEnd; ++r_iter) {
- const int rank = *r_iter;
- const mesh_type::send_overlap_type::source_type remoteOffsetNormal = newVerticesStartNormalP[rank] - oldVerticesStartNormalP[rank];
- const mesh_type::send_overlap_type::source_type remoteOffsetFault = newVerticesStartFaultP[rank] - oldVerticesStartFaultP[rank];
- const mesh_type::recv_overlap_type::supportSequence::iterator pointsBegin = recvOverlap->supportBegin(rank);
- const mesh_type::recv_overlap_type::supportSequence::iterator pointsEnd = recvOverlap->supportEnd(rank);
-
- for(mesh_type::recv_overlap_type::supportSequence::iterator p_iter = pointsBegin; p_iter != pointsEnd; ++p_iter) {
- const mesh_type::send_overlap_type::source_type& localPoint = *p_iter;
- const mesh_type::send_overlap_type::source_type& remotePoint = p_iter.color();
-
- if (localPoint >= oldVerticesStartNormal && localPoint < oldVerticesStartFault) {
- assert(remotePoint >= oldVerticesStartNormalP[rank] && remotePoint < oldVerticesStartFaultP[rank]);
- newRecvOverlap->addArrow(rank, localPoint+localOffsetNormal, remotePoint+remoteOffsetNormal);
- } else {
- assert(localPoint >= oldVerticesStartFault);
- assert(remotePoint >= oldVerticesStartFaultP[rank]);
- newRecvOverlap->addArrow(rank, localPoint+localOffsetFault, remotePoint+remoteOffsetFault);
- }
- }
- }
-#endif
- newMesh->setCalculatedOverlap(true);
- delete [] oldVerticesStartNormalP; oldVerticesStartNormalP = PETSC_NULL;
- delete [] oldVerticesStartFaultP; oldVerticesStartFaultP = PETSC_NULL;
- delete [] newVerticesStartNormalP; newVerticesStartNormalP = PETSC_NULL;
- delete [] newVerticesStartFaultP; newVerticesStartFaultP = PETSC_NULL;
-
- refiner.overlapAddNewVertices(newMesh, *_orderNewMesh, mesh, *_orderOldMesh);
- // We have to do flexible assembly since we add the new vertices separately
- newSendOverlap->assemble();
- newRecvOverlap->assemble();
-
- // Clear out renumbering
- newMesh->getRenumbering().clear();
-
- // Verify size of new send/recv overlaps are at least as big as the
- // original ones.
- PetscErrorCode err = 0;
- if (newSendOverlap->getNumRanks() != sendOverlap->getNumRanks() ||
- newRecvOverlap->getNumRanks() != recvOverlap->getNumRanks() ||
- newSendOverlap->getNumRanks() != newRecvOverlap->getNumRanks()) {
-
- throw std::logic_error("Error in constructing new overlaps during mesh "
- "refinement.\nMismatch in number of ranks.");
- } // if
-
- const int numRanks = newSendOverlap->getNumRanks();
- for (int isend=0; isend < numRanks; ++isend) {
- int rank = 0;
- err = newSendOverlap->getRank(isend, &rank); PYLITH_CHECK_ERROR(err);
- int irecv = 0;
- err = newRecvOverlap->getRankIndex(rank, &irecv);
-
- int sendRank = 0;
- int recvRank = 0;
- err = sendOverlap->getRank(isend, &sendRank); PYLITH_CHECK_ERROR(err);
- err = recvOverlap->getRank(irecv, &recvRank); PYLITH_CHECK_ERROR(err);
- if (rank != sendRank || rank != recvRank) {
- throw std::logic_error("Error in constructing new overlaps during mesh "
- "refinement.\nMismatch in ranks.");
- } // if
-
- int newSendNumPoints = 0;
- int oldSendNumPoints = 0;
- int newRecvNumPoints = 0;
- int oldRecvNumPoints = 0;
- err = sendOverlap->getNumPointsByRank(rank, &oldSendNumPoints); PYLITH_CHECK_ERROR(err);
- err = newSendOverlap->getNumPointsByRank(rank, &newSendNumPoints); PYLITH_CHECK_ERROR(err);
- err = recvOverlap->getNumPointsByRank(rank, &oldRecvNumPoints); PYLITH_CHECK_ERROR(err);
- err = newRecvOverlap->getNumPointsByRank(rank, &newRecvNumPoints); PYLITH_CHECK_ERROR(err);
- if (newSendNumPoints < oldSendNumPoints || newRecvNumPoints < oldRecvNumPoints) {
- throw std::logic_error("Error in constructing new overlaps during mesh "
- "refinement.\nInvalid size for new overlaps.");
- } // if
- } // for
-
- if (mesh->debug()) {
- sendOverlap->view("OLD SEND OVERLAP");
- recvOverlap->view("OLD RECV OVERLAP");
- newSendOverlap->view("NEW SEND OVERLAP");
- newRecvOverlap->view("NEW RECV OVERLAP");
-
- int rank = 0;
- int nprocs = 0;
- MPI_Comm_rank(mesh->comm(), &rank);
- MPI_Comm_size(mesh->comm(), &nprocs);
- MPI_Barrier(mesh->comm());
- for (int i=0; i < nprocs; ++i) {
- if (rank == i) {
- int numNeighbors = newSendOverlap->getNumRanks();
- assert(numNeighbors == newRecvOverlap->getNumRanks());
- for (int j=0; j < numNeighbors; ++j) {
- int sendRank = 0;
- int recvRank = 0;
- err = newSendOverlap->getRank(j, &sendRank);PYLITH_CHECK_ERROR(err);
- err = newRecvOverlap->getRank(j, &recvRank);PYLITH_CHECK_ERROR(err);
- std::cout << "["<<rank<<"]: "
- << "send: " << sendRank
- << ", npts: " << newSendOverlap->getNumPoints(j)
- << "; recv: " << recvRank
- << ", npts: " << newRecvOverlap->getNumPoints(j)
- << std::endl;
- } // for
- } // if
- MPI_Barrier(mesh->comm());
- } // for
- } // if
-} // _calcNewOverlap
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/libsrc/pylith/topology/MeshRefiner.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/MeshRefiner.hh 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/MeshRefiner.hh 2013-07-26 22:13:24 UTC (rev 22685)
@@ -1,146 +0,0 @@
-// -*- 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-2013 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ======================================================================
-//
-
-/**
- * @file libsrc/topology/MeshRefiner.hh
- *
- * @brief Object for refinement of cells.
- */
-
-#if !defined(pylith_topology_meshrefiner_hh)
-#define pylith_topology_meshrefiner_hh
-
-// Include directives ---------------------------------------------------
-#include "topologyfwd.hh" // forward declarations
-
-#include "pylith/utils/sievetypes.hh" // USE Obj
-
-// RefineTri3 --------------------------------------------------------
-/// Object for refinement of cells.
-template<typename cellrefiner_type>
-class ALE::MeshRefiner
-{ // MeshRefiner
- typedef IMesh<PetscInt,PetscScalar> mesh_type;
- typedef mesh_type::point_type point_type;
- typedef pylith::SieveFlexMesh SieveFlexMesh;
-
-// PUBLIC MEMBERS ///////////////////////////////////////////////////////
-public :
-
- /** Constructor
- *
- * @param mesh Finite-element mesh.
- */
- MeshRefiner(void);
-
- /// Destructor
- ~MeshRefiner(void);
-
- /** Refine mesh.
- *
- * @param newMesh New mesh.
- * @param mesh Current mesh.
- * @param refiner Cell refiner.
- */
- void refine(const Obj<mesh_type>& newMesh,
- const Obj<mesh_type>& mesh,
- cellrefiner_type& refiner);
-
-// PRIVATE METHODS //////////////////////////////////////////////////////
-private :
-
- /** Refine mesh.
- *
- * @param newMesh New mesh.
- * @param mesh Current mesh.
- * @param refiner Cell refiner.
- */
- void _refine(const Obj<mesh_type>& newMesh,
- const Obj<mesh_type>& mesh,
- cellrefiner_type& refiner);
-
- /** Refine mesh with a censored depth.
- *
- * @param newMesh New mesh.
- * @param mesh Current mesh.
- * @param refiner Cell refiner.
- */
- void _refineCensored(const Obj<mesh_type>& newMesh,
- const Obj<mesh_type>& mesh,
- cellrefiner_type& refiner);
-
- /** Stratify mesh.
- *
- * @param mesh Mesh to stratify.
- */
- void _stratify(const Obj<mesh_type>& mesh);
-
- /** Create integer sections in new mesh.
- *
- * :WARNING: Only implemented for integer sections containing vertices.
- *
- * @param newMesh New (refined) mesh.
- * @param mesh Current (unrefined) mesh with integer sections.
- * @param refiner Cell refiner.
- */
- void _createIntSections(const Obj<mesh_type>& newMesh,
- const Obj<mesh_type>& mesh,
- cellrefiner_type& refiner);
-
- /** Create labels in new mesh.
- *
- * :WARNING: Only implemented for integer sections containing vertices.
- *
- * @param newMesh New (refined) mesh.
- * @param mesh Current (unrefined) mesh with integer sections.
- * @param refiner Cell refiner.
- */
- void _createLabels(const Obj<mesh_type>& newMesh,
- const Obj<mesh_type>& mesh,
- cellrefiner_type& refiner);
-
- /** Calculate new overlap.
- *
- * @param newMesh New (refined) mesh.
- * @param mesh Current (unrefined) mesh with overlap.
- * @param refiner Cell refiner.
- */
- void _calcNewOverlap(const Obj<mesh_type>& newMesh,
- const Obj<mesh_type>& mesh,
- cellrefiner_type& refiner);
-
-// PRIVATE MEMBERS //////////////////////////////////////////////////////
-private :
-
- MeshOrder* _orderOldMesh; ///< Order of entities in old mesh.
- MeshOrder* _orderNewMesh; ///< Order of entities in new mesh.
-
-// NOT IMPLEMENTED //////////////////////////////////////////////////////
-private :
-
- MeshRefiner(const MeshRefiner&); ///< Not implemented
- const MeshRefiner& operator=(const MeshRefiner&); ///< Not implemented
-
-}; // MeshRefiner
-
-#include "MeshRefiner.cc"
-
-#endif // pylith_topology_meshrefiner_hh
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/libsrc/pylith/topology/RefineEdges2.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/RefineEdges2.cc 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/RefineEdges2.cc 2013-07-26 22:13:24 UTC (rev 22685)
@@ -1,312 +0,0 @@
-// -*- 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-2013 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ======================================================================
-//
-
-#include <portinfo>
-
-#include "RefineEdges2.hh" // implementation of class methods
-
-#include "MeshOrder.hh" // USES MeshOrder
-
-#include <cassert> // USES assert()
-
-// ----------------------------------------------------------------------
-// Constructor
-ALE::RefineEdges2::RefineEdges2(const mesh_type& mesh) :
- _mesh(mesh)
-{ // constructor
-} // constructor
-
-// ----------------------------------------------------------------------
-// Destructor
-ALE::RefineEdges2::~RefineEdges2(void)
-{ // destructor
-} // destructor
-
-// ----------------------------------------------------------------------
-// Set coordinates of new vertices.
-void
-ALE::RefineEdges2::setCoordsNewVertices(const ALE::Obj<mesh_type::real_section_type>& newCoordsSection,
- const ALE::Obj<mesh_type::real_section_type>& oldCoordsSection)
-{ // setCoordsNewVertices
- assert(!newCoordsSection.isNull());
- assert(!oldCoordsSection.isNull());
-
- PylithScalar coordinatesVertex[3];
-
- assert(_edgeToVertex.size() > 0);
- const int spaceDim = newCoordsSection->getFiberDimension(_edgeToVertex.begin()->second);
- assert(spaceDim > 0 && spaceDim <= 3);
-
- 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;
-
- assert(spaceDim == oldCoordsSection->getFiberDimension(edgeVertexA));
- assert(spaceDim == oldCoordsSection->getFiberDimension(edgeVertexB));
- assert(spaceDim == newCoordsSection->getFiberDimension(newVertex));
-
- const mesh_type::real_section_type::value_type* coordsA = oldCoordsSection->restrictPoint(edgeVertexA);
- const mesh_type::real_section_type::value_type* coordsB = oldCoordsSection->restrictPoint(edgeVertexB);
- for (int i=0; i < spaceDim; ++i)
- coordinatesVertex[i] = 0.5*(coordsA[i] + coordsB[i]);
-
- newCoordsSection->updatePoint(newVertex, coordinatesVertex);
- } // for
-} // setCoordsNewVertices
-
-// ----------------------------------------------------------------------
-// Add space for new vertices in group.
-void
-ALE::RefineEdges2::groupAddNewVertices(const ALE::Obj<mesh_type::int_section_type>& newGroup,
- const ALE::Obj<mesh_type::int_section_type>& oldGroup)
-{ // groupAddNewVertices
- assert(!newGroup.isNull());
- assert(!oldGroup.isNull());
-
- 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;
-
- if (oldGroup->getFiberDimension(edgeVertexA) && oldGroup->getFiberDimension(edgeVertexB)) {
- if (oldGroup->restrictPoint(edgeVertexA)[0] == oldGroup->restrictPoint(edgeVertexB)[0]) {
- newGroup->setFiberDimension(newVertex, 1);
- } // if
- } // if
- } // for
-} // groupAddNewVertices
-
-// ----------------------------------------------------------------------
-// Set new vertices in group.
-void
-ALE::RefineEdges2::groupSetNewVertices(const ALE::Obj<mesh_type::int_section_type>& newGroup,
- const ALE::Obj<mesh_type::int_section_type>& oldGroup)
-{ // groupSetNewVertices
- assert(!newGroup.isNull());
- assert(!oldGroup.isNull());
-
- 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 edgeVertex = e_iter->first.first;
-
- 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
-
-// ----------------------------------------------------------------------
-// Add new vertices to label.
-void
-ALE::RefineEdges2::labelAddNewVertices(const ALE::Obj<mesh_type>& newMesh,
- const ALE::Obj<mesh_type>& oldMesh,
- const char* labelName)
-{ // labelAddNewVertices
- assert(!newMesh.isNull());
- assert(!oldMesh.isNull());
-
- const Obj<mesh_type::label_sequence>& oldLabelVertices = oldMesh->getLabelStratum(labelName, 0);
- assert(!oldLabelVertices.isNull());
-
- const Obj<mesh_type::label_type>& oldLabel = oldMesh->getLabel(labelName);
- assert(!oldLabel.isNull());
- const Obj<mesh_type::label_type>& newLabel = newMesh->getLabel(labelName);
- assert(!newLabel.isNull());
-
- const int defaultValue = -999;
-
- 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 int valueA = oldMesh->getValue(oldLabel, edgeVertexA, defaultValue);
- const int valueB = oldMesh->getValue(oldLabel, edgeVertexB, defaultValue);
-
- if (valueA != defaultValue && valueA == valueB) {
- newMesh->setValue(newLabel, newVertex, valueA);
- } // if
- } // for
-} // labelAddNewVertices
-
-// ----------------------------------------------------------------------
-// Calculate new overlap.
-void
-ALE::RefineEdges2::overlapAddNewVertices(const Obj<mesh_type>& newMesh,
- const MeshOrder& orderNewMesh,
- const Obj<mesh_type>& oldMesh,
- const MeshOrder& orderOldMesh)
-{ // overlapAddNewVertices
- assert(!newMesh.isNull());
- assert(!oldMesh.isNull());
-
- Obj<mesh_type::send_overlap_type> newSendOverlap = newMesh->getSendOverlap();
- assert(!newSendOverlap.isNull());
- Obj<mesh_type::recv_overlap_type> newRecvOverlap = newMesh->getRecvOverlap();
- assert(!newRecvOverlap.isNull());
- const Obj<mesh_type::send_overlap_type>& oldSendOverlap = oldMesh->getSendOverlap();
- assert(!oldSendOverlap.isNull());
- const Obj<mesh_type::recv_overlap_type>& oldRecvOverlap = oldMesh->getRecvOverlap();
- assert(!oldRecvOverlap.isNull());
-
- const int commRank = oldMesh->commRank();
-
- // Check edges in edgeToVertex for both endpoints sent to same process
- // Put it in section with point being the lowest numbered vertex and value (other endpoint, new vertex)
- Obj<ALE::Section<point_type, EdgeType> > newVerticesSection = new ALE::Section<point_type, EdgeType>(oldMesh->comm());
- assert(!newVerticesSection.isNull());
- std::map<EdgeType, std::vector<int> > bndryEdgeToRank; // Ranks of processes sharing the edge (both vertices)
-
- const int localNormalOffset = orderNewMesh.verticesNormal().min() - orderOldMesh.verticesNormal().min();
- const int localCensoredOffset = orderNewMesh.verticesCensored().min() - orderOldMesh.verticesCensored().min();
-
- for(std::map<EdgeType, point_type>::const_iterator e_iter = _edgeToVertex.begin(); e_iter != _edgeToVertex.end(); ++e_iter) {
- const point_type left = e_iter->first.first;
- const point_type right = e_iter->first.second;
-
- if (oldSendOverlap->capContains(left) && oldSendOverlap->capContains(right)) {
- const Obj<mesh_type::send_overlap_type::supportSequence>& leftRanksSeq = oldSendOverlap->support(left);
- assert(!leftRanksSeq.isNull());
- std::set<int> leftRanks(leftRanksSeq->begin(), leftRanksSeq->end());
- const Obj<mesh_type::send_overlap_type::supportSequence>& rightRanksSeq = oldSendOverlap->support(right);
- assert(!rightRanksSeq.isNull());
- std::set<int> rightRanks(rightRanksSeq->begin(), rightRanksSeq->end());
- std::set<int> ranks;
- std::set_intersection(leftRanks.begin(), leftRanks.end(), rightRanks.begin(), rightRanks.end(),
- std::insert_iterator<std::set<int> >(ranks, ranks.begin()));
-
-#if 0 // DEBUGGING
- std::cout << "[" << commRank << "] Checking edge " << e_iter->first << std::endl;
- for(std::set<int>::const_iterator r_iter = leftRanks.begin(); r_iter != leftRanks.end(); ++r_iter) {
- std::cout << "[" << commRank << "] left rank " << *r_iter << std::endl;
- }
- for(std::set<int>::const_iterator r_iter = rightRanks.begin(); r_iter != rightRanks.end(); ++r_iter) {
- std::cout << "[" << commRank << "] right rank " << *r_iter << std::endl;
- }
-#endif
- if (ranks.size()) {
- const point_type edgeMin = std::min(e_iter->first.first, e_iter->first.second);
- const int localMinOffset = (orderOldMesh.verticesNormal().hasPoint(edgeMin)) ? localNormalOffset : localCensoredOffset;
- newVerticesSection->addFiberDimension(edgeMin+localMinOffset, 1);
- for(std::set<int>::const_iterator r_iter = ranks.begin(); r_iter != ranks.end(); ++r_iter) {
- bndryEdgeToRank[e_iter->first].push_back(*r_iter);
-#if 0 // DEBUGGING
- const point_type edgeMax = std::max(e_iter->first.first, e_iter->first.second);
- const int localMaxOffset = (orderOldMesh.verticesNormal().hasPoint(edgeMax)) ? localNormalOffset : localCensoredOffset;
- std::cout << "[" << commRank << "] Added edge " << e_iter->first << " now (" << edgeMin+localMinOffset << ", " << edgeMax+localMaxOffset << ") with rank " << *r_iter << std::endl;
-#endif
- } // for
- } // if
- } // if
- } // for
- newVerticesSection->allocatePoint();
- const ALE::Section<point_type, EdgeType>::chart_type& chart = newVerticesSection->getChart();
-
- for(ALE::Section<point_type, EdgeType>::chart_type::const_iterator c_iter = chart.begin(); c_iter != chart.end(); ++c_iter) {
- typedef ALE::Section<point_type, EdgeType>::value_type value_type;
- const point_type p = *c_iter;
- const int dim = newVerticesSection->getFiberDimension(p);
- int v = 0;
- value_type* values = (dim > 0) ? new value_type[dim] : 0;
-
- for(std::map<EdgeType, std::vector<int> >::const_iterator e_iter = bndryEdgeToRank.begin(); e_iter != bndryEdgeToRank.end() && v < dim; ++e_iter) {
- const point_type edgeMin = std::min(e_iter->first.first, e_iter->first.second);
- const int localMinOffset = (orderOldMesh.verticesNormal().hasPoint(edgeMin)) ? localNormalOffset : localCensoredOffset;
- const point_type edgeMax = std::max(e_iter->first.first, e_iter->first.second);
- const int localMaxOffset = (orderOldMesh.verticesNormal().hasPoint(edgeMax)) ? localNormalOffset : localCensoredOffset;
-
- if (edgeMin+localMinOffset == p) {
- values[v++] = EdgeType(edgeMax+localMaxOffset, _edgeToVertex[e_iter->first]);
- } // if
- } // for
- newVerticesSection->updatePoint(p, values);
- delete [] values;
- } // for
- // Copy across overlap
- typedef ALE::Pair<int, point_type> overlap_point_type;
- Obj<ALE::Section<overlap_point_type, EdgeType> > overlapVertices = new ALE::Section<overlap_point_type, EdgeType>(oldMesh->comm());
-
- ALE::Pullback::SimpleCopy::copy(newSendOverlap, newRecvOverlap, newVerticesSection, overlapVertices);
-#if 0 // DEBUGGING
- newVerticesSection->view("NEW VERTICES");
- overlapVertices->view("OVERLAP VERTICES");
-#endif
-
- // Merge by translating edge to local points, finding edge in _edgeToVertex, and adding (local new vetex, remote new vertex) to overlap
- for(std::map<EdgeType, std::vector<int> >::const_iterator e_iter = bndryEdgeToRank.begin(); e_iter != bndryEdgeToRank.end(); ++e_iter) {
- const point_type newLocalPoint = _edgeToVertex[e_iter->first];
-
- for(std::vector<int>::const_iterator r_iter = e_iter->second.begin(); r_iter != e_iter->second.end(); ++r_iter) {
- point_type remoteLeft = -1, remoteRight = -1;
- const int rank = *r_iter;
-
- const int localFirstOffset = (orderOldMesh.verticesNormal().hasPoint(e_iter->first.first)) ? localNormalOffset : localCensoredOffset;
- const Obj<mesh_type::send_overlap_type::supportSequence>& leftRanks = newSendOverlap->support(e_iter->first.first+localFirstOffset);
- for(mesh_type::send_overlap_type::supportSequence::iterator lr_iter = leftRanks->begin(); lr_iter != leftRanks->end(); ++lr_iter) {
- if (rank == *lr_iter) {
- remoteLeft = lr_iter.color();
- break;
- } // if
- } // for
- const int localSecondOffset = (orderOldMesh.verticesNormal().hasPoint(e_iter->first.second)) ? localNormalOffset : localCensoredOffset;
- const Obj<mesh_type::send_overlap_type::supportSequence>& rightRanks = newSendOverlap->support(e_iter->first.second+localSecondOffset);
- for(mesh_type::send_overlap_type::supportSequence::iterator rr_iter = rightRanks->begin(); rr_iter != rightRanks->end(); ++rr_iter) {
- if (rank == *rr_iter) {
- remoteRight = rr_iter.color();
- break;
- } // if
- } // for
- const point_type remoteMin = std::min(remoteLeft, remoteRight);
- const point_type remoteMax = std::max(remoteLeft, remoteRight);
- const int remoteSize = overlapVertices->getFiberDimension(overlap_point_type(rank, remoteMin));
- const EdgeType *remoteVals = overlapVertices->restrictPoint(overlap_point_type(rank, remoteMin));
- point_type newRemotePoint = -1;
-
- for(int d = 0; d < remoteSize; ++d) {
- if (remoteVals[d].first == remoteMax) {
- newRemotePoint = remoteVals[d].second;
- break;
- } // if
- } // for
-#if 0 // DEBUGGING
- if (-1 == newRemotePoint) {
- std::cout << "["<< commRank << "] DISMISSING newLocalPoint: " << newLocalPoint
- << ", remoteLeft: " << remoteLeft
- << ", remoteRight: " << remoteRight
- << ", rank: " << rank
- << ", remoteSize: " << remoteSize
- << std::endl;
- } // if
-#endif
- //assert(-1 != newRemotePoint);
- if (-1 != newRemotePoint) {
- newSendOverlap->addArrow(newLocalPoint, rank, newRemotePoint);
- newRecvOverlap->addArrow(rank, newLocalPoint, newRemotePoint);
- } // if
- } // for
- } // for
-} // overlapAddNewVertces
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/libsrc/pylith/topology/RefineEdges2.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/RefineEdges2.hh 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/RefineEdges2.hh 2013-07-26 22:13:24 UTC (rev 22685)
@@ -1,137 +0,0 @@
-// -*- 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-2013 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ======================================================================
-//
-
-/**
- * @file libsrc/topology/RefineEdges2.hh
- *
- * @brief Object for refinement of cells via refinement of edges
- * comprised of two vertices.
- */
-
-#if !defined(pylith_topology_refineedges2_hh)
-#define pylith_topology_refineedges2_hh
-
-// Include directives ---------------------------------------------------
-#include "topologyfwd.hh" // forward declarations
-
-#include <list> // USES std::pair
-
-// RefineEdges2 ------------------------------------------------------
-/// Object for tri3 refinement of cells.
-class ALE::RefineEdges2
-{ // RefineEdges2
-protected:
-
- typedef ALE::IMesh<PetscInt,PetscScalar> mesh_type;
- typedef mesh_type::point_type point_type;
-
-// PUBLIC MEMBERS ///////////////////////////////////////////////////////
-public :
-
- /** Constructor
- *
- * @param mesh Finite-element mesh.
- */
- RefineEdges2(const mesh_type& mesh);
-
- /// Destructor
- ~RefineEdges2(void);
-
- /** Set coordinates of new vertices.
- *
- * @param newCoordsSection Coordinates of vertices in new mesh.
- * @param oldCoordsSection Coordinates of vertices in original mesh.
- */
- void setCoordsNewVertices(const ALE::Obj<mesh_type::real_section_type>& newCoordsSection,
- const ALE::Obj<mesh_type::real_section_type>& oldCoordsSection);
-
- /** Add space for new vertices in group.
- *
- * @param newGroup Group in refine mesh.
- * @param oldGroup Group in original mesh.
- */
- void groupAddNewVertices(const ALE::Obj<mesh_type::int_section_type>& newGroup,
- const ALE::Obj<mesh_type::int_section_type>& oldGroup);
-
- /** Set new vertices in group.
- *
- * @param newGroup Group in refine mesh.
- * @param oldGroup Group in original mesh.
- */
- void groupSetNewVertices(const ALE::Obj<mesh_type::int_section_type>& newGroup,
- const ALE::Obj<mesh_type::int_section_type>& oldGroup);
-
- /** Add new vertices to label.
- *
- * @param newMesh Mesh with refined cells.
- * @param oldMesh Original mesh.
- * @param labelName Name of label.
- */
- void labelAddNewVertices(const ALE::Obj<mesh_type>& newMesh,
- const ALE::Obj<mesh_type>& oldMesh,
- const char* labelName);
-
- /** Calculate new overlap.
- *
- * @param newMesh New (refined) mesh.
- * @param orderNewMesh Order in new mesh.
- * @param oldMesh Current (unrefined) mesh with overlap.
- * @param orderOldMesh Order in old mesh.
- */
- void overlapAddNewVertices(const Obj<mesh_type>& newMesh,
- const MeshOrder& orderNewMesh,
- const Obj<mesh_type>& oldMesh,
- const MeshOrder& orderOldMesh);
-
-// PROTECTED TYPEDEFS ///////////////////////////////////////////////////
-protected :
-
- template<typename Point>
- class Edge : public std::pair<Point, Point> {
- public:
- Edge() : std::pair<Point, Point>() {};
- Edge(const Point l) : std::pair<Point, Point>(l, l) {};
- Edge(const Point l, const Point r) : std::pair<Point, Point>(l, r) {};
- ~Edge() {};
- friend std::ostream& operator<<(std::ostream& stream, const Edge& edge) {
- stream << "(" << edge.first << ", " << edge.second << ")";
- return stream;
- };
- };
-
- typedef Edge<point_type> EdgeType;
- typedef std::map<EdgeType, point_type> edge_map_type;
-
-// PROTECTED MEMBERS ////////////////////////////////////////////////////
-protected :
-
- const mesh_type& _mesh;
- edge_map_type _edgeToVertex;
-
-// NOT IMPLEMENTED //////////////////////////////////////////////////////
-private :
-
- RefineEdges2(const RefineEdges2&); ///< Not implemented
- const RefineEdges2& operator=(const RefineEdges2&); ///< Not implemented
-
-}; // RefineEdges2
-
-#endif // pylith_topology_refineedges2_hh
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/libsrc/pylith/topology/RefineFace4Edges2.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/RefineFace4Edges2.cc 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/RefineFace4Edges2.cc 2013-07-26 22:13:24 UTC (rev 22685)
@@ -1,351 +0,0 @@
-// -*- 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-2013 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ======================================================================
-//
-
-#include <portinfo>
-
-#include "RefineFace4Edges2.hh" // implementation of class methods
-
-#include "MeshOrder.hh" // USES MeshOrder
-
-#include <cassert> // USES assert()
-
-// ----------------------------------------------------------------------
-// Constructor
-ALE::RefineFace4Edges2::RefineFace4Edges2(const mesh_type& mesh) :
- _mesh(mesh)
-{ // constructor
-} // constructor
-
-// ----------------------------------------------------------------------
-// Destructor
-ALE::RefineFace4Edges2::~RefineFace4Edges2(void)
-{ // destructor
-} // destructor
-
-// ----------------------------------------------------------------------
-// Set coordinates of new vertices.
-void
-ALE::RefineFace4Edges2::setCoordsNewVertices(const ALE::Obj<mesh_type::real_section_type>& newCoordsSection,
- const ALE::Obj<mesh_type::real_section_type>& oldCoordsSection)
-{ // setCoordsNewVertices
- assert(!newCoordsSection.isNull());
- assert(!oldCoordsSection.isNull());
-
- PylithScalar coordinatesVertex[3];
-
- assert(_edgeToVertex.size() > 0);
- const int spaceDim = newCoordsSection->getFiberDimension(_edgeToVertex.begin()->second);
- assert(spaceDim > 0 && spaceDim <= 3);
-
- 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;
-
- assert(spaceDim == oldCoordsSection->getFiberDimension(edgeVertexA));
- assert(spaceDim == oldCoordsSection->getFiberDimension(edgeVertexB));
- assert(spaceDim == newCoordsSection->getFiberDimension(newVertex));
-
- const mesh_type::real_section_type::value_type* coordsA = oldCoordsSection->restrictPoint(edgeVertexA);
- const mesh_type::real_section_type::value_type* coordsB = oldCoordsSection->restrictPoint(edgeVertexB);
- for (int i=0; i < spaceDim; ++i)
- coordinatesVertex[i] = 0.5*(coordsA[i] + coordsB[i]);
-
- 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
-
-// ----------------------------------------------------------------------
-// Add space for new vertices in group.
-void
-ALE::RefineFace4Edges2::groupAddNewVertices(const ALE::Obj<mesh_type::int_section_type>& newGroup,
- const ALE::Obj<mesh_type::int_section_type>& oldGroup)
-{ // groupAddNewVertices
- assert(!newGroup.isNull());
- assert(!oldGroup.isNull());
-
- 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;
-
- if (oldGroup->getFiberDimension(edgeVertexA) && oldGroup->getFiberDimension(edgeVertexB)) {
- if (oldGroup->restrictPoint(edgeVertexA)[0] == oldGroup->restrictPoint(edgeVertexB)[0]) {
- newGroup->setFiberDimension(newVertex, 1);
- } // 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
-
-// ----------------------------------------------------------------------
-// Set new vertices in group.
-void
-ALE::RefineFace4Edges2::groupSetNewVertices(const ALE::Obj<mesh_type::int_section_type>& newGroup,
- const ALE::Obj<mesh_type::int_section_type>& oldGroup)
-{ // groupSetNewVertices
- assert(!newGroup.isNull());
- assert(!oldGroup.isNull());
-
- 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 edgeVertex = e_iter->first.first;
-
- 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
-
-// ----------------------------------------------------------------------
-// Add new vertices to label.
-void
-ALE::RefineFace4Edges2::labelAddNewVertices(const ALE::Obj<mesh_type>& newMesh,
- const ALE::Obj<mesh_type>& oldMesh,
- const char* labelName)
-{ // labelAddNewVertices
- assert(!newMesh.isNull());
- assert(!oldMesh.isNull());
-
- const Obj<mesh_type::label_sequence>& oldLabelVertices = oldMesh->getLabelStratum(labelName, 0);
- assert(!oldLabelVertices.isNull());
-
- const Obj<mesh_type::label_type>& oldLabel = oldMesh->getLabel(labelName);
- assert(!oldLabel.isNull());
- const Obj<mesh_type::label_type>& newLabel = newMesh->getLabel(labelName);
- assert(!newLabel.isNull());
-
- const int defaultValue = -999;
-
- 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 int valueA = oldMesh->getValue(oldLabel, edgeVertexA, defaultValue);
- const int valueB = oldMesh->getValue(oldLabel, edgeVertexB, defaultValue);
-
- if (valueA != defaultValue && valueA == valueB) {
- 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
-
-// ----------------------------------------------------------------------
-// Calculate new overlap.
-void
-ALE::RefineFace4Edges2::overlapAddNewVertices(const Obj<mesh_type>& newMesh,
- const MeshOrder& orderNewMesh,
- const Obj<mesh_type>& oldMesh,
- const MeshOrder& orderOldMesh)
-{ // overlapAddNewVertices
- 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();
- assert(!newRecvOverlap.isNull());
- const Obj<mesh_type::send_overlap_type>& oldSendOverlap = oldMesh->getSendOverlap();
- assert(!oldSendOverlap.isNull());
- const Obj<mesh_type::recv_overlap_type>& oldRecvOverlap = oldMesh->getRecvOverlap();
- assert(!oldRecvOverlap.isNull());
-
- // Offset used when converting from old mesh numbering to new
- const int localNormalOffset = orderNewMesh.verticesNormal().min() - orderOldMesh.verticesNormal().min();
- const int localCensoredOffset = orderNewMesh.verticesCensored().min() - orderOldMesh.verticesCensored().min();
-
- // Check edges in edgeToVertex for both endpoints sent to same process
- // Put it in section with point being the lowest numbered vertex and value (other endpoint, new vertex)
- Obj<ALE::Section<point_type, EdgeType> > newVerticesSection = new ALE::Section<point_type, EdgeType>(oldMesh->comm());
- assert(!newVerticesSection.isNull());
- std::map<EdgeType, std::vector<int> > bndryEdgeToRank;
-
- for(std::map<EdgeType, point_type>::const_iterator e_iter = _edgeToVertex.begin(); e_iter != _edgeToVertex.end(); ++e_iter) {
- const point_type left = e_iter->first.first;
- const point_type right = e_iter->first.second;
-
- if (oldSendOverlap->capContains(left) && oldSendOverlap->capContains(right)) {
- const Obj<mesh_type::send_overlap_type::supportSequence>& leftRanksSeq = oldSendOverlap->support(left);
- assert(!leftRanksSeq.isNull());
- std::set<int> leftRanks(leftRanksSeq->begin(), leftRanksSeq->end());
- const Obj<mesh_type::send_overlap_type::supportSequence>& rightRanksSeq = oldSendOverlap->support(right);
- assert(!rightRanksSeq.isNull());
- std::set<int> rightRanks(rightRanksSeq->begin(), rightRanksSeq->end());
- std::set<int> ranks;
- std::set_intersection(leftRanks.begin(), leftRanks.end(), rightRanks.begin(), rightRanks.end(),
- std::insert_iterator<std::set<int> >(ranks, ranks.begin()));
-
- if(ranks.size()) {
- const int localOffset = orderOldMesh.verticesNormal().hasPoint(e_iter->first.first) ? localNormalOffset : localCensoredOffset;
-
- assert(orderOldMesh.verticesNormal().hasPoint(e_iter->first.first) == orderOldMesh.verticesNormal().hasPoint(e_iter->first.second));
- newVerticesSection->addFiberDimension(std::min(e_iter->first.first, e_iter->first.second)+localOffset, 1);
- for(std::set<int>::const_iterator r_iter = ranks.begin(); r_iter != ranks.end(); ++r_iter) {
- bndryEdgeToRank[e_iter->first].push_back(*r_iter);
- } // fora
- } // if
- } // if
- } // for
- newVerticesSection->allocatePoint();
- const ALE::Section<point_type, EdgeType>::chart_type& chart = newVerticesSection->getChart();
-
- for(ALE::Section<point_type, EdgeType>::chart_type::const_iterator c_iter = chart.begin(); c_iter != chart.end(); ++c_iter) {
- typedef ALE::Section<point_type, EdgeType>::value_type value_type;
- const point_type p = *c_iter;
- const int dim = newVerticesSection->getFiberDimension(p);
- int v = 0;
- value_type* values = (dim > 0) ? new value_type[dim] : 0;
-
- for(std::map<EdgeType, std::vector<int> >::const_iterator e_iter = bndryEdgeToRank.begin(); e_iter != bndryEdgeToRank.end() && v < dim; ++e_iter) {
- const int localOffset = orderOldMesh.verticesNormal().hasPoint(e_iter->first.first) ? localNormalOffset : localCensoredOffset;
-
- assert(orderOldMesh.verticesNormal().hasPoint(e_iter->first.first) == orderOldMesh.verticesNormal().hasPoint(e_iter->first.second));
- if (std::min(e_iter->first.first, e_iter->first.second)+localOffset == p) {
- values[v++] = EdgeType(std::max(e_iter->first.first, e_iter->first.second)+localOffset, _edgeToVertex[e_iter->first]);
- } // if
- } // for
- newVerticesSection->updatePoint(p, values);
- delete [] values;
- } // for
- // Copy across overlap
- typedef ALE::Pair<int, point_type> overlap_point_type;
- Obj<ALE::Section<overlap_point_type, EdgeType> > overlapVertices = new ALE::Section<overlap_point_type, EdgeType>(oldMesh->comm());
-
- ALE::Pullback::SimpleCopy::copy(newSendOverlap, newRecvOverlap, newVerticesSection, overlapVertices);
- // Merge by translating edge to local points, finding edge in _edgeToVertex, and adding (local new vetex, remote new vertex) to overlap
- for(std::map<EdgeType, std::vector<int> >::const_iterator e_iter = bndryEdgeToRank.begin(); e_iter != bndryEdgeToRank.end(); ++e_iter) {
- const point_type localPoint = _edgeToVertex[e_iter->first];
-
- for(std::vector<int>::const_iterator r_iter = e_iter->second.begin(); r_iter != e_iter->second.end(); ++r_iter) {
- point_type remoteLeft = -1, remoteRight = -1;
- const int rank = *r_iter;
- const int localOffsetL = orderOldMesh.verticesNormal().hasPoint(e_iter->first.first) ? localNormalOffset : localCensoredOffset;
-
- const Obj<mesh_type::send_overlap_type::supportSequence>& leftRanks = newSendOverlap->support(e_iter->first.first+localOffsetL);
- for(mesh_type::send_overlap_type::supportSequence::iterator lr_iter = leftRanks->begin(); lr_iter != leftRanks->end(); ++lr_iter) {
- if (rank == *lr_iter) {
- remoteLeft = lr_iter.color();
- break;
- } // if
- } // for
- const int localOffsetR = orderOldMesh.verticesNormal().hasPoint(e_iter->first.second) ? localNormalOffset : localCensoredOffset;
- const Obj<mesh_type::send_overlap_type::supportSequence>& rightRanks = newSendOverlap->support(e_iter->first.second+localOffsetR);
- for(mesh_type::send_overlap_type::supportSequence::iterator rr_iter = rightRanks->begin(); rr_iter != rightRanks->end(); ++rr_iter) {
- if (rank == *rr_iter) {
- remoteRight = rr_iter.color();
- break;
- } // if
- } // for
- const point_type remoteMin = std::min(remoteLeft, remoteRight);
- const point_type remoteMax = std::max(remoteLeft, remoteRight);
- const int remoteSize = overlapVertices->getFiberDimension(overlap_point_type(rank, remoteMin));
- const EdgeType *remoteVals = overlapVertices->restrictPoint(overlap_point_type(rank, remoteMin));
- point_type remotePoint = -1;
-
- for(int d = 0; d < remoteSize; ++d) {
- if (remoteVals[d].first == remoteMax) {
- remotePoint = remoteVals[d].second;
- break;
- } // if
- } // for
- // TODO: Remove this when we fix refinement along fault boundaries
- if (remotePoint >= 0) {
- newSendOverlap->addArrow(localPoint, rank, remotePoint);
- newRecvOverlap->addArrow(rank, localPoint, remotePoint);
- }
- } // for
- } // for
-} // overlapAddNewVertces
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/libsrc/pylith/topology/RefineFace4Edges2.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/RefineFace4Edges2.hh 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/RefineFace4Edges2.hh 2013-07-26 22:13:24 UTC (rev 22685)
@@ -1,225 +0,0 @@
-// -*- 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-2013 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ======================================================================
-//
-
-/**
- * @file libsrc/topology/RefineFace4Edges2.hh
- *
- * @brief Object for refinement of cells via refinement of edges
- * comprised of two vertices.
- */
-
-#if !defined(pylith_topology_refineface4edges2_hh)
-#define pylith_topology_refineface4edges2_hh
-
-// Include directives ---------------------------------------------------
-#include "topologyfwd.hh" // forward declarations
-
-#include <list> // USES std::pair
-
-// RefineFace4Edges2 ------------------------------------------------------
-/// Object for tri3 refinement of cells.
-class ALE::RefineFace4Edges2
-{ // RefineFace4Edges2
-protected:
-
- typedef IMesh<PetscInt,PetscScalar> mesh_type;
- typedef mesh_type::point_type point_type;
-
-// PUBLIC MEMBERS ///////////////////////////////////////////////////////
-public :
-
- /** Constructor
- *
- * @param mesh Finite-element mesh.
- */
- RefineFace4Edges2(const mesh_type& mesh);
-
- /// Destructor
- ~RefineFace4Edges2(void);
-
- /** Set coordinates of new vertices.
- *
- * @param newCoordsSection Coordinates of vertices in new mesh.
- * @param oldCoordsSection Coordinates of vertices in original mesh.
- */
- void setCoordsNewVertices(const ALE::Obj<mesh_type::real_section_type>& newCoordsSection,
- const ALE::Obj<mesh_type::real_section_type>& oldCoordsSection);
-
- /** Add space for new vertices in group.
- *
- * @param newGroup Group in refine mesh.
- * @param oldGroup Group in original mesh.
- */
- void groupAddNewVertices(const ALE::Obj<mesh_type::int_section_type>& newGroup,
- const ALE::Obj<mesh_type::int_section_type>& oldGroup);
-
- /** Set new vertices in group.
- *
- * @param newGroup Group in refine mesh.
- * @param oldGroup Group in original mesh.
- */
- void groupSetNewVertices(const ALE::Obj<mesh_type::int_section_type>& newGroup,
- const ALE::Obj<mesh_type::int_section_type>& oldGroup);
-
- /** Add new vertices to label.
- *
- * @param newMesh Mesh with refined cells.
- * @param oldMesh Original mesh.
- * @param labelName Name of label.
- */
- void labelAddNewVertices(const ALE::Obj<mesh_type>& newMesh,
- const ALE::Obj<mesh_type>& oldMesh,
- const char* labelName);
-
- /** Calculate new overlap.
- *
- * @param newMesh New (refined) mesh.
- * @param orderNewMesh Order in new mesh.
- * @param oldMesh Current (unrefined) mesh with overlap.
- * @param orderOldMesh Order in old mesh.
- */
- void overlapAddNewVertices(const Obj<mesh_type>& newMesh,
- const MeshOrder& orderNewMesh,
- const Obj<mesh_type>& oldMesh,
- const MeshOrder& orderOldMesh);
-
-// PROTECTED TYPEDEFS ///////////////////////////////////////////////////
-protected :
-
- template<typename Point>
- class Edge : public std::pair<Point, Point> {
- public:
- Edge(void) : std::pair<Point, Point>() {};
- Edge(const Point l) : std::pair<Point, Point>(l, l) {};
- Edge(const Point l, const Point r) : std::pair<Point, Point>(l, r) {};
- ~Edge(void) {};
- friend std::ostream& operator<<(std::ostream& stream, const Edge& edge) {
- stream << "(" << edge.first << ", " << edge.second << ")";
- return stream;
- };
- };
- typedef Edge<point_type> EdgeType;
- typedef std::map<EdgeType, point_type> edge_map_type;
-
- template<typename Point>
- class Face {
- public:
- Face(void) {};
- Face(const Point 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;
- };
- ~Face(void) {};
- friend bool operator==(const Face<Point>& a,
- const Face<Point>& 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];
- return result;
- };
- friend bool operator<(const Face<Point>& a,
- const Face<Point>& b) {
- if (a.points[0] < b.points[0]) {
- return true;
- } 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]) {
- return true;
- } else if (a.points[2] == b.points[2]) {
- if (a.points[3] < b.points[3]) {
- return true;
- } // if
- } // if/else
- } // if/else
- } // if/else
-
- return false;
- };
- friend std::ostream& operator<<(std::ostream& stream,
- const Face<Point>& face) {
- stream << "(" << face.points[0]
- << ", " << face.points[1]
- << ", " << face.points[2]
- << ", " << face.points[3]
- << ")";
- return stream;
- };
- public:
- int points[4];
- };
- template<typename Point>
- class FaceCmp { // for compatibility with gcc 3.4.6
- public :
- bool operator() (const Face<Point>& a,
- const Face<Point>& b) const {
- if (a.points[0] < b.points[0]) {
- return true;
- } 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]) {
- return true;
- } else if (a.points[2] == b.points[2]) {
- if (a.points[3] < b.points[3]) {
- return true;
- } // if
- } // if/else
- } // if/else
- } // if/else
-
- return false;
- };
- };
- typedef Face<point_type> FaceType;
- typedef std::map<FaceType, point_type, FaceCmp<point_type> > face_map_type;
-
-// PROTECTED MEMBERS ////////////////////////////////////////////////////
-protected :
-
- const mesh_type& _mesh;
- edge_map_type _edgeToVertex;
- face_map_type _faceToVertex;
-
-// NOT IMPLEMENTED //////////////////////////////////////////////////////
-private :
-
- RefineFace4Edges2(const RefineFace4Edges2&); ///< Not implemented
- const RefineFace4Edges2& operator=(const RefineFace4Edges2&); ///< Not implemented
-
-}; // RefineFace4Edges2
-
-#endif // pylith_topology_refineface4edges2_hh
-
-
-// End of file
Modified: short/3D/PyLith/trunk/libsrc/pylith/topology/RefineUniform.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/RefineUniform.cc 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/RefineUniform.cc 2013-07-26 22:13:24 UTC (rev 22685)
@@ -22,20 +22,11 @@
#include "Mesh.hh" // USES Mesh
-#include "CellRefinerTri3.hh" // USES CellRefinerTri3
-#include "CellRefinerQuad4.hh" // USES CellRefinerQuad4
-#include "CellRefinerTet4.hh" // USES CellRefinerTet4
-#include "CellRefinerHex8.hh" // USES CellRefinerHex8
-#include "MeshRefiner.hh" // USES MeshRefiner
-
-#include <stdexcept> // USES std::runtime_error
-#include <sstream> // USES std::ostringstream
#include <cassert> // USES assert()
+#include <sstream> // USES std::ostringstream
+#include <stdexcept> // USES std::runtime_error
// ----------------------------------------------------------------------
-typedef pylith::topology::Mesh::SieveMesh SieveMesh;
-
-// ----------------------------------------------------------------------
// Constructor
pylith::topology::RefineUniform::RefineUniform(void)
{ // constructor
@@ -62,75 +53,30 @@
const Mesh& mesh,
const int levels)
{ // refine
- assert(0 != newMesh);
+ assert(newMesh);
- typedef SieveMesh::point_type point_type;
+ PetscErrorCode err;
- const ALE::Obj<SieveMesh>& sieveMesh = mesh.sieveMesh();
- assert(!sieveMesh.isNull());
- const ALE::Obj<SieveMesh>& newSieveMesh = newMesh->sieveMesh();
- assert(!newSieveMesh.isNull());
- ALE::Obj<SieveMesh::sieve_type> newSieve =
- new SieveMesh::sieve_type(mesh.comm(), mesh.debug());
- newSieveMesh->setSieve(newSieve);
+ PetscDM dmNew = newMesh->dmMesh();
+ PetscDM dmOrig = mesh.dmMesh();
+
+ PetscInt meshDepth = 0;
+ err = DMPlexGetDepth(dmOrig, &meshDepth);
- const Obj<SieveMesh::label_sequence>& cells = sieveMesh->heightStratum(0);
- assert(!cells.isNull());
- assert(cells->size() > 0);
+ const int meshDim = mesh.dimension();
+ if (meshDim > 0 && meshDepth != meshDim) {
+ std::ostringstream msg;
+ msg << "Mesh refinement for uninterpolated meshes not supported.\n"
+ << "Turn on interpolated meshes using 'interpolate' mesh generator property.";
+ throw std::runtime_error(msg.str());
+ } // if
- const int numCorners = sieveMesh->getNumCellCorners();
- const int dim = mesh.dimension();
+ err = DMPlexSetRefinementUniform(dmOrig, PETSC_TRUE);PYLITH_CHECK_ERROR(err);
- switch (dim) {
- case 0:
- case 1:
- throw std::runtime_error("Uniform refinement not implemented.");
- break;
+ for (int i=0; i < levels; ++i) {
+ err = DMRefine(dmOrig, mesh.comm(), &dmNew);PYLITH_CHECK_ERROR(err);
+ } // for
- case 2:
- switch (numCorners) {
- case 3: {
- ALE::CellRefinerTri3 cellSplitter(*sieveMesh);
- ALE::MeshRefiner<ALE::CellRefinerTri3> refinement;
- refinement.refine(newSieveMesh, sieveMesh, cellSplitter);
- break;
- } // case 3
- case 4: {
- ALE::CellRefinerQuad4 cellSplitter(*sieveMesh);
- ALE::MeshRefiner<ALE::CellRefinerQuad4> refinement;
- refinement.refine(newSieveMesh, sieveMesh, cellSplitter);
- break;
- } // case 4
- default :
- throw std::runtime_error("Unknown number of corners for cells.");
- } // switch
- break;
-
- case 3:
- switch (numCorners) {
- case 4: {
- ALE::CellRefinerTet4 cellSplitter(*sieveMesh);
- ALE::MeshRefiner<ALE::CellRefinerTet4> refinement;
- refinement.refine(newSieveMesh, sieveMesh, cellSplitter);
- break;
- } // case 4
- case 8: {
- ALE::CellRefinerHex8 cellSplitter(*sieveMesh);
- ALE::MeshRefiner<ALE::CellRefinerHex8> refinement;
- refinement.refine(newSieveMesh, sieveMesh, cellSplitter);
- break;
- } // case 8
- default :
- assert(0);
- throw std::runtime_error("Unknown number of corners for cells.");
- } // switch
- break;
-
- default :
- assert(0);
- throw std::logic_error("Unknown dimension.");
- } // switch
-
// newMesh->view("REFINED MESH");
} // refine
Modified: short/3D/PyLith/trunk/libsrc/pylith/topology/RefineUniform.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/RefineUniform.hh 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/RefineUniform.hh 2013-07-26 22:13:24 UTC (rev 22685)
@@ -54,7 +54,7 @@
*/
void refine(Mesh* const newMesh,
const Mesh& mesh,
- const int levels =2);
+ const int levels =1);
// NOT IMPLEMENTED //////////////////////////////////////////////////////
private :
Deleted: short/3D/PyLith/trunk/libsrc/pylith/topology/RefineVol8Face4Edges2.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/RefineVol8Face4Edges2.cc 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/RefineVol8Face4Edges2.cc 2013-07-26 22:13:24 UTC (rev 22685)
@@ -1,603 +0,0 @@
-// -*- 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-2013 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ======================================================================
-//
-
-#include <portinfo>
-
-#include "RefineVol8Face4Edges2.hh" // implementation of class methods
-
-#include "MeshOrder.hh" // USES MeshOrder
-
-#include <cassert> // USES assert()
-
-// ----------------------------------------------------------------------
-// Constructor
-ALE::RefineVol8Face4Edges2::RefineVol8Face4Edges2(const mesh_type& mesh) :
- _mesh(mesh)
-{ // constructor
-} // constructor
-
-// ----------------------------------------------------------------------
-// Destructor
-ALE::RefineVol8Face4Edges2::~RefineVol8Face4Edges2(void)
-{ // destructor
-} // destructor
-
-// ----------------------------------------------------------------------
-// Set coordinates of new vertices.
-void
-ALE::RefineVol8Face4Edges2::setCoordsNewVertices(const ALE::Obj<mesh_type::real_section_type>& newCoordsSection,
- const ALE::Obj<mesh_type::real_section_type>& oldCoordsSection)
-{ // setCoordsNewVertices
- assert(!newCoordsSection.isNull());
- assert(!oldCoordsSection.isNull());
-
- PylithScalar coordinatesVertex[3];
-
- assert(_edgeToVertex.size() > 0);
- const int spaceDim = newCoordsSection->getFiberDimension(_edgeToVertex.begin()->second);
- assert(spaceDim > 0 && spaceDim <= 3);
-
- 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;
-
- assert(spaceDim == oldCoordsSection->getFiberDimension(edgeVertexA));
- assert(spaceDim == oldCoordsSection->getFiberDimension(edgeVertexB));
- assert(spaceDim == newCoordsSection->getFiberDimension(newVertex));
-
- const mesh_type::real_section_type::value_type* coordsA = oldCoordsSection->restrictPoint(edgeVertexA);
- const mesh_type::real_section_type::value_type* coordsB = oldCoordsSection->restrictPoint(edgeVertexB);
- for (int i=0; i < spaceDim; ++i)
- coordinatesVertex[i] = 0.5*(coordsA[i] + coordsB[i]);
-
- 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
-
- const volume_map_type::const_iterator volumesEnd = _volumeToVertex.end();
- for (volume_map_type::const_iterator v_iter = _volumeToVertex.begin(); v_iter != volumesEnd; ++v_iter) {
- const point_type newVertex = v_iter->second;
-
- assert(spaceDim == newCoordsSection->getFiberDimension(newVertex));
- for (int iDim=0; iDim < spaceDim; ++iDim)
- coordinatesVertex[iDim] = 0.0;
- for (int iVertex=0; iVertex < 8; ++iVertex) {
- const point_type volumeVertex = v_iter->first.points[iVertex];
- assert(spaceDim == oldCoordsSection->getFiberDimension(volumeVertex));
-
- const mesh_type::real_section_type::value_type* coords = oldCoordsSection->restrictPoint(volumeVertex);
- for (int iDim=0; iDim < spaceDim; ++iDim)
- coordinatesVertex[iDim] += 0.125*coords[iDim];
- } // for
- newCoordsSection->updatePoint(newVertex, coordinatesVertex);
- } // for
-} // setCoordsNewVertices
-
-// ----------------------------------------------------------------------
-// Add space for new vertices in group.
-void
-ALE::RefineVol8Face4Edges2::groupAddNewVertices(const ALE::Obj<mesh_type::int_section_type>& newGroup,
- const ALE::Obj<mesh_type::int_section_type>& oldGroup)
-{ // groupAddNewVertices
- assert(!newGroup.isNull());
- assert(!oldGroup.isNull());
-
- 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;
-
- if (oldGroup->getFiberDimension(edgeVertexA) && oldGroup->getFiberDimension(edgeVertexB)) {
- if (oldGroup->restrictPoint(edgeVertexA)[0] == oldGroup->restrictPoint(edgeVertexB)[0]) {
- newGroup->setFiberDimension(newVertex, 1);
- } // 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
-
- const volume_map_type::const_iterator volumesEnd = _volumeToVertex.end();
- for (volume_map_type::const_iterator v_iter = _volumeToVertex.begin(); v_iter != volumesEnd; ++v_iter) {
- const point_type newVertex = v_iter->second;
-
- bool hasVolume = true;
- for (int iVertex=0; iVertex < 8; ++iVertex) {
- const point_type volumeVertex = v_iter->first.points[iVertex];
- if (!oldGroup->getFiberDimension(volumeVertex)) {
- hasVolume = false;
- break;
- } // if
- } // for
- if (hasVolume) {
- newGroup->setFiberDimension(newVertex, 1);
- } // if
- } // for
-} // groupAddNewVertices
-
-// ----------------------------------------------------------------------
-// Set new vertices in group.
-void
-ALE::RefineVol8Face4Edges2::groupSetNewVertices(const ALE::Obj<mesh_type::int_section_type>& newGroup,
- const ALE::Obj<mesh_type::int_section_type>& oldGroup)
-{ // groupSetNewVertices
- assert(!newGroup.isNull());
- assert(!oldGroup.isNull());
-
- 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 edgeVertex = e_iter->first.first;
-
- 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
-
- const volume_map_type::const_iterator volumesEnd = _volumeToVertex.end();
- for (volume_map_type::const_iterator v_iter = _volumeToVertex.begin(); v_iter != volumesEnd; ++v_iter) {
- const point_type newVertex = v_iter->second;
- const point_type volumeVertex = v_iter->first.points[0];
-
- if (1 == newGroup->getFiberDimension(newVertex)) {
- newGroup->updatePoint(newVertex, oldGroup->restrictPoint(volumeVertex));
- //std::cout << "Adding new vertex: " << newVertex << " based on volume " << v_iter->first << std::endl;
- } // if
- } // for
-} // groupSetNewVertices
-
-// ----------------------------------------------------------------------
-// Add new vertices to label.
-void
-ALE::RefineVol8Face4Edges2::labelAddNewVertices(const ALE::Obj<mesh_type>& newMesh,
- const ALE::Obj<mesh_type>& oldMesh,
- const char* labelName)
-{ // labelAddNewVertices
- assert(!newMesh.isNull());
- assert(!oldMesh.isNull());
-
- const Obj<mesh_type::label_sequence>& oldLabelVertices = oldMesh->getLabelStratum(labelName, 0);
- assert(!oldLabelVertices.isNull());
-
- const Obj<mesh_type::label_type>& oldLabel = oldMesh->getLabel(labelName);
- assert(!oldLabel.isNull());
- const Obj<mesh_type::label_type>& newLabel = newMesh->getLabel(labelName);
- assert(!newLabel.isNull());
-
- const int defaultValue = -999;
-
- 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 int valueA = oldMesh->getValue(oldLabel, edgeVertexA, defaultValue);
- const int valueB = oldMesh->getValue(oldLabel, edgeVertexB, defaultValue);
-
- if (valueA != defaultValue && valueA == valueB) {
- 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
-
- const volume_map_type::const_iterator volumesEnd = _volumeToVertex.end();
- for (volume_map_type::const_iterator v_iter = _volumeToVertex.begin(); v_iter != volumesEnd; ++v_iter) {
- const point_type newVertex = v_iter->second;
- const point_type volumeVertex = v_iter->first.points[0];
- const int value = oldMesh->getValue(oldLabel, volumeVertex, defaultValue);
-
- if (value != defaultValue) {
- bool hasVolume = true;
- for (int iVertex=1; iVertex < 8; ++iVertex) {
- const point_type volumeVertex2 = v_iter->first.points[iVertex];
- const int value2 = oldMesh->getValue(oldLabel, volumeVertex2, defaultValue);
- if (value2 != value) {
- hasVolume = false;
- break;
- } // if
- } // for
- if (hasVolume) {
- newMesh->setValue(newLabel, newVertex, value);
- } // if
- } // if
- } // for
-} // labelAddNewVertices
-
-// ----------------------------------------------------------------------
-// Calculate new overlap.
-void
-ALE::RefineVol8Face4Edges2::overlapAddNewVertices(const Obj<mesh_type>& newMesh,
- const MeshOrder& orderNewMesh,
- const Obj<mesh_type>& oldMesh,
- const MeshOrder& orderOldMesh)
-{ // overlapAddNewVertices
- 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();
- assert(!newRecvOverlap.isNull());
- const Obj<mesh_type::send_overlap_type>& oldSendOverlap = oldMesh->getSendOverlap();
- assert(!oldSendOverlap.isNull());
- const Obj<mesh_type::recv_overlap_type>& oldRecvOverlap = oldMesh->getRecvOverlap();
- assert(!oldRecvOverlap.isNull());
-
- // Check edges in edgeToVertex for both endpoints sent to same process
- // Put it in section with point being the lowest numbered vertex and value (other endpoint, new vertex)
- // Notice that points are converted to the new numbering with refined cells
- Obj<ALE::Section<point_type, EdgeType> > newVerticesSection = new ALE::Section<point_type, EdgeType>(oldMesh->comm());
- assert(!newVerticesSection.isNull());
- std::map<EdgeType, std::vector<int> > bndryEdgeToRank; // Maps an edge to a set of ranks who share it
-
- const int localNormalOffset = orderNewMesh.verticesNormal().min() - orderOldMesh.verticesNormal().min();
- const int localCensoredOffset = orderNewMesh.verticesCensored().min() - orderOldMesh.verticesCensored().min();
-
- for(std::map<EdgeType, point_type>::const_iterator e_iter = _edgeToVertex.begin(); e_iter != _edgeToVertex.end(); ++e_iter) {
- const point_type left = e_iter->first.first;
- const point_type right = e_iter->first.second;
-
- if (oldSendOverlap->capContains(left) && oldSendOverlap->capContains(right)) {
- const Obj<mesh_type::send_overlap_type::supportSequence>& leftRanksSeq = oldSendOverlap->support(left);
- assert(!leftRanksSeq.isNull());
- std::set<int> leftRanks(leftRanksSeq->begin(), leftRanksSeq->end());
- const Obj<mesh_type::send_overlap_type::supportSequence>& rightRanksSeq = oldSendOverlap->support(right);
- assert(!rightRanksSeq.isNull());
- std::set<int> rightRanks(rightRanksSeq->begin(), rightRanksSeq->end());
- std::set<int> ranks;
- std::set_intersection(leftRanks.begin(), leftRanks.end(), rightRanks.begin(), rightRanks.end(),
- std::insert_iterator<std::set<int> >(ranks, ranks.begin()));
-
- if(ranks.size()) {
- const int localOffset = orderOldMesh.verticesNormal().hasPoint(e_iter->first.first) ? localNormalOffset : localCensoredOffset;
-
- assert(orderOldMesh.verticesNormal().hasPoint(e_iter->first.first) == orderOldMesh.verticesNormal().hasPoint(e_iter->first.second));
- newVerticesSection->addFiberDimension(std::min(e_iter->first.first, e_iter->first.second)+localOffset, 1);
- for(std::set<int>::const_iterator r_iter = ranks.begin(); r_iter != ranks.end(); ++r_iter) {
- bndryEdgeToRank[e_iter->first].push_back(*r_iter);
- } // for
- } // if
- } // if
- } // for
- newVerticesSection->allocatePoint();
- const ALE::Section<point_type, EdgeType>::chart_type& edgeChart = newVerticesSection->getChart();
-
- for(ALE::Section<point_type, EdgeType>::chart_type::const_iterator c_iter = edgeChart.begin(); c_iter != edgeChart.end(); ++c_iter) {
- typedef ALE::Section<point_type, EdgeType>::value_type value_type;
- const point_type p = *c_iter;
- const int dim = newVerticesSection->getFiberDimension(p);
- int v = 0;
- value_type* values = (dim > 0) ? new value_type[dim] : 0;
-
- for(std::map<EdgeType, std::vector<int> >::const_iterator e_iter = bndryEdgeToRank.begin(); e_iter != bndryEdgeToRank.end() && v < dim; ++e_iter) {
- const int localOffset = orderOldMesh.verticesNormal().hasPoint(e_iter->first.first) ? localNormalOffset : localCensoredOffset;
-
- assert(orderOldMesh.verticesNormal().hasPoint(e_iter->first.first) == orderOldMesh.verticesNormal().hasPoint(e_iter->first.second));
- if (std::min(e_iter->first.first, e_iter->first.second)+localOffset == p) {
- values[v++] = EdgeType(std::max(e_iter->first.first, e_iter->first.second)+localOffset, _edgeToVertex[e_iter->first]);
- } // if
- } // for
- newVerticesSection->updatePoint(p, values);
- delete [] values;
- } // for
-
- // Check faces in faceToVertex for all corners sent to same process
- // Put it in section with point being the lowest numbered vertex and value (other endpoints, new vertex)
- // Notice that points are converted to the new numbering with refined cells
- Obj<ALE::Section<point_type, FaceType> > newFaceVerticesSection = new ALE::Section<point_type, FaceType>(oldMesh->comm());
- assert(!newFaceVerticesSection.isNull());
- std::map<FaceType, std::vector<int>, FaceCmp<point_type> > bndryFaceToRank;
-
- for(std::map<FaceType, point_type>::const_iterator f_iter = _faceToVertex.begin(); f_iter != _faceToVertex.end(); ++f_iter) {
- bool isRemote = true;
-
- for(int i = 0; i < 4; ++i) {
- if (!oldSendOverlap->capContains(f_iter->first.points[i])) {
- isRemote = false;
- break;
- }
- }
- if (isRemote) {
- const point_type first = f_iter->first.points[0];
- point_type minVertex = first;
-
- const Obj<mesh_type::send_overlap_type::supportSequence>& firstRanksSeq = oldSendOverlap->support(first);
- assert(!firstRanksSeq.isNull());
- std::set<int> firstRanks(firstRanksSeq->begin(), firstRanksSeq->end());
- std::set<int> ranks, curRanks;
-
- curRanks = firstRanks;
- for(int i = 1; i < 4; ++i) {
- const point_type nextVertex = f_iter->first.points[i];
-
- const Obj<mesh_type::send_overlap_type::supportSequence>& nextRanksSeq = oldSendOverlap->support(nextVertex);
- assert(!nextRanksSeq.isNull());
- std::set<int> nextRanks(nextRanksSeq->begin(), nextRanksSeq->end());
-
- ranks.clear();
- std::set_intersection(curRanks.begin(), curRanks.end(), nextRanks.begin(), nextRanks.end(),
- std::insert_iterator<std::set<int> >(ranks, ranks.begin()));
- curRanks = ranks;
- minVertex = std::min(nextVertex, minVertex);
- }
- if (ranks.size()) {
- const int localOffset = orderOldMesh.verticesNormal().hasPoint(minVertex) ? localNormalOffset : localCensoredOffset;
-
- assert(orderNewMesh.verticesNormal().hasPoint(f_iter->second));
- newFaceVerticesSection->addFiberDimension(minVertex+localOffset, 1);
- for(std::set<int>::const_iterator r_iter = ranks.begin(); r_iter != ranks.end(); ++r_iter) {
- bndryFaceToRank[f_iter->first].push_back(*r_iter);
- }
- }
- }
- }
- newFaceVerticesSection->allocatePoint();
- const ALE::Section<point_type, FaceType>::chart_type& faceChart = newFaceVerticesSection->getChart();
-
- for(ALE::Section<point_type, FaceType>::chart_type::const_iterator c_iter = faceChart.begin(); c_iter != faceChart.end(); ++c_iter) {
- typedef ALE::Section<point_type, FaceType>::value_type value_type;
- const point_type p = *c_iter;
- const int dim = newFaceVerticesSection->getFiberDimension(p);
- int v = 0;
- value_type* values = (dim > 0) ? new value_type[dim] : 0;
-
- for(std::map<FaceType, std::vector<int> >::const_iterator f_iter = bndryFaceToRank.begin(); f_iter != bndryFaceToRank.end() && v < dim; ++f_iter) {
- const point_type first = f_iter->first.points[0];
- point_type minVertex = first;
- int localOffset;
-
- for(int i = 1; i < 4; ++i) {
- const point_type nextVertex = f_iter->first.points[i];
- minVertex = std::min(nextVertex, minVertex);
- }
- localOffset = orderOldMesh.verticesNormal().hasPoint(minVertex) ? localNormalOffset : localCensoredOffset;
-
- if (minVertex+localOffset == p) {
- FaceType face;
- int k = 0;
-
- for(int i = 0; i < 4; ++i) {
- if (f_iter->first.points[i] != minVertex) {
- localOffset = orderOldMesh.verticesNormal().hasPoint(f_iter->first.points[i]) ? localNormalOffset : localCensoredOffset;
-
- face.points[k++] = f_iter->first.points[i]+localOffset;
- }
- }
- assert(k == 3);
- std::sort(&face.points[0], &face.points[3]);
- face.points[3] = _faceToVertex[f_iter->first];
- values[v++] = face;
- } // if
- } // for
- assert(v == dim);
- newFaceVerticesSection->updatePoint(p, values);
- delete [] values;
- } // for
-
- // Copy across overlap
- typedef ALE::Pair<int, point_type> overlap_point_type;
- // This maps (remote rank, remote min point) --> (remote max point, new remote vertex)
- Obj<ALE::Section<overlap_point_type, EdgeType> > overlapVertices = new ALE::Section<overlap_point_type, EdgeType>(oldMesh->comm());
- // This maps (remote rank, remote min point) --> (other remote points..., new remote vertex)
- Obj<ALE::Section<overlap_point_type, FaceType> > overlapFaceVertices = new ALE::Section<overlap_point_type, FaceType>(oldMesh->comm());
-
- ALE::Pullback::SimpleCopy::copy(newSendOverlap, newRecvOverlap, newVerticesSection, overlapVertices);
- ALE::Pullback::SimpleCopy::copy(newSendOverlap, newRecvOverlap, newFaceVerticesSection, overlapFaceVertices);
- // Merge by translating edge to local points, finding edge in _edgeToVertex, and adding (local new vetex, remote new vertex) to overlap
- // Loop over all shared edges
- for(std::map<EdgeType, std::vector<int> >::const_iterator e_iter = bndryEdgeToRank.begin(); e_iter != bndryEdgeToRank.end(); ++e_iter) {
- // Point added on this edge by refinement
- const point_type localPoint = _edgeToVertex[e_iter->first];
-
- // Loop over all ranks which share this edge
- for(std::vector<int>::const_iterator r_iter = e_iter->second.begin(); r_iter != e_iter->second.end(); ++r_iter) {
- point_type remoteLeft = -1, remoteRight = -1;
- const int rank = *r_iter;
- // Offset for left edge point in the new mesh (check whether edge is between Lagrange vertices)
- const int localOffsetL = orderOldMesh.verticesNormal().hasPoint(e_iter->first.first) ? localNormalOffset : localCensoredOffset;
-
- // Find the rank which owns the left edge point, and return the remotePoint in the new mesh
- const Obj<mesh_type::send_overlap_type::supportSequence>& leftRanks = newSendOverlap->support(e_iter->first.first+localOffsetL);
- for(mesh_type::send_overlap_type::supportSequence::iterator lr_iter = leftRanks->begin(); lr_iter != leftRanks->end(); ++lr_iter) {
- if (rank == *lr_iter) {
- remoteLeft = lr_iter.color();
- break;
- } // if
- } // for
- // Offset for right edge point in the new mesh (check whether edge is between Lagrange vertices)
- const int localOffsetR = orderOldMesh.verticesNormal().hasPoint(e_iter->first.second) ? localNormalOffset : localCensoredOffset;
-
- // Find the rank which owns the right edge point, and return the remotePoint in the new mesh
- const Obj<mesh_type::send_overlap_type::supportSequence>& rightRanks = newSendOverlap->support(e_iter->first.second+localOffsetR);
- for(mesh_type::send_overlap_type::supportSequence::iterator rr_iter = rightRanks->begin(); rr_iter != rightRanks->end(); ++rr_iter) {
- if (rank == *rr_iter) {
- remoteRight = rr_iter.color();
- break;
- } // if
- } // for
- const point_type remoteMin = std::min(remoteLeft, remoteRight);
- const point_type remoteMax = std::max(remoteLeft, remoteRight);
- const int remoteSize = overlapVertices->getFiberDimension(overlap_point_type(rank, remoteMin));
- const EdgeType *remoteVals = overlapVertices->restrictPoint(overlap_point_type(rank, remoteMin));
- point_type remotePoint = -1;
-
- // Loop over all shared edges from rank with endpoint remoteMin
- for(int d = 0; d < remoteSize; ++d) {
- if (remoteVals[d].first == remoteMax) {
- remotePoint = remoteVals[d].second;
- break;
- } // if
- } // for
-#if 0
- // Debugging for fault edge problem
- if (remotePoint < 0) {
- std::cout << "["<<oldMesh->commRank()<<"]Failed to find remote partner for edge " << e_iter->first << " from rank " << rank << std::endl;
- std::cout << "["<<oldMesh->commRank()<<"] remote edge ("<<remoteLeft<<","<<remoteRight<<") had remoteSize " << remoteSize << std::endl;
- for(int d = 0; d < remoteSize; ++d) {
- std::cout << "["<<oldMesh->commRank()<<"] remote val " << remoteVals[d] << std::endl;
- }
- const Obj<mesh_type::send_overlap_type::supportSequence>& leftRanks2 = oldSendOverlap->support(e_iter->first.first);
- for(mesh_type::send_overlap_type::supportSequence::iterator lr_iter = leftRanks2->begin(); lr_iter != leftRanks2->end(); ++lr_iter) {
- if (rank == *lr_iter) {
- std::cout << "["<<oldMesh->commRank()<<"] left match: old vertex " << lr_iter.color() << std::endl;
- break;
- }
- }
- const Obj<mesh_type::send_overlap_type::supportSequence>& rightRanks2 = oldSendOverlap->support(e_iter->first.second);
- for(mesh_type::send_overlap_type::supportSequence::iterator rr_iter = rightRanks2->begin(); rr_iter != rightRanks2->end(); ++rr_iter) {
- if (rank == *rr_iter) {
- std::cout << "["<<oldMesh->commRank()<<"] right match: old vertex " << rr_iter.color() << std::endl;
- break;
- }
- }
- }
- assert(remotePoint >= 0);
-#endif
- if (remotePoint >= 0) {
- newSendOverlap->addArrow(localPoint, rank, remotePoint);
- newRecvOverlap->addArrow(rank, localPoint, remotePoint);
- }
- } // for
- } // for
- // Merge by translating face to local points, finding face in _faceToVertex, and adding (local new vetex, remote new vertex) to overlap
- for(std::map<FaceType, std::vector<int> >::const_iterator f_iter = bndryFaceToRank.begin(); f_iter != bndryFaceToRank.end(); ++f_iter) {
- const point_type localPoint = _faceToVertex[f_iter->first];
-
- for(std::vector<int>::const_iterator r_iter = f_iter->second.begin(); r_iter != f_iter->second.end(); ++r_iter) {
- FaceType remoteVertices(-1); // These are the remote vertices on process 'rank' for this face
- const int rank = *r_iter;
-
- for(int i = 0; i < 4; ++i) {
- const int localOffset = orderOldMesh.verticesNormal().hasPoint(f_iter->first.points[i]) ? localNormalOffset : localCensoredOffset;
- const Obj<mesh_type::send_overlap_type::supportSequence>& faceRanks = newSendOverlap->support(f_iter->first.points[i]+localOffset);
- for(mesh_type::send_overlap_type::supportSequence::iterator fr_iter = faceRanks->begin(); fr_iter != faceRanks->end(); ++fr_iter) {
- if (rank == *fr_iter) {
- remoteVertices.points[i] = fr_iter.color();
- break;
- } // if
- } // for
- assert(remoteVertices.points[i] >= 0);
- }
- const point_type remoteMin = std::min(std::min(std::min(remoteVertices.points[0], remoteVertices.points[1]), remoteVertices.points[2]), remoteVertices.points[3]);
- const int remoteSize = overlapFaceVertices->getFiberDimension(overlap_point_type(rank, remoteMin));
- const FaceType *remoteVals = overlapFaceVertices->restrictPoint(overlap_point_type(rank, remoteMin));
- point_type remotePoint = -1;
- int k = 0;
- FaceType remoteMax;
-
- for(int i = 0; i < 4; ++i) {
- if (remoteVertices.points[i] == remoteMin) continue;
- remoteMax.points[k++] = remoteVertices.points[i];
- }
- assert(k == 3);
- std::sort(&remoteMax.points[0], &remoteMax.points[3]);
- for(int d = 0; d < remoteSize; ++d) {
- int i = 0;
-
- for(i = 0; i < 3; ++i) {
- if (remoteVals[d].points[i] != remoteMax.points[i]) break;
- }
- if (i == 3) {
- remotePoint = remoteVals[d].points[3];
- break;
- } // if
- } // for
- assert(localPoint >= orderNewMesh.verticesNormal().min() && localPoint < orderNewMesh.verticesNormal().max());
-#if 0 // Debugging for fault edge problem
- assert(remotePoint >= 0);
-#endif
- if (remotePoint >= 0) {
- newSendOverlap->addArrow(localPoint, rank, remotePoint);
- newRecvOverlap->addArrow(rank, localPoint, remotePoint);
- }
- } // for
- } // for
-} // overlapAddNewVertces
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/libsrc/pylith/topology/RefineVol8Face4Edges2.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/RefineVol8Face4Edges2.hh 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/RefineVol8Face4Edges2.hh 2013-07-26 22:13:24 UTC (rev 22685)
@@ -1,359 +0,0 @@
-// -*- 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-2013 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ======================================================================
-//
-
-/**
- * @file libsrc/topology/RefineVol8Face4Edges2.hh
- *
- * @brief Object for refinement of cells via refinement of volumes
- * with 8 vertices, faces with 4 vertices, and edges with two
- * vertices.
- */
-
-#if !defined(pylith_topology_refinevol8face4edges2_hh)
-#define pylith_topology_refinevol8face4edges2_hh
-
-// Include directives ---------------------------------------------------
-#include "topologyfwd.hh" // forward declarations
-
-#include <list> // USES std::pair
-
-// RefineVol8Face4Edges2 ------------------------------------------------------
-/// Object for tri3 refinement of cells.
-class ALE::RefineVol8Face4Edges2
-{ // RefineVol8Face4Edges2
-protected:
-
- typedef IMesh<PetscInt,PetscScalar> mesh_type;
- typedef mesh_type::point_type point_type;
-
-// PUBLIC MEMBERS ///////////////////////////////////////////////////////
-public :
-
- /** Constructor
- *
- * @param mesh Finite-element mesh.
- */
- RefineVol8Face4Edges2(const mesh_type& mesh);
-
- /// Destructor
- ~RefineVol8Face4Edges2(void);
-
- /** Set coordinates of new vertices.
- *
- * @param newCoordsSection Coordinates of vertices in new mesh.
- * @param oldCoordsSection Coordinates of vertices in original mesh.
- */
- void setCoordsNewVertices(const ALE::Obj<mesh_type::real_section_type>& newCoordsSection,
- const ALE::Obj<mesh_type::real_section_type>& oldCoordsSection);
-
- /** Add space for new vertices in group.
- *
- * @param newGroup Group in refine mesh.
- * @param oldGroup Group in original mesh.
- */
- void groupAddNewVertices(const ALE::Obj<mesh_type::int_section_type>& newGroup,
- const ALE::Obj<mesh_type::int_section_type>& oldGroup);
-
- /** Set new vertices in group.
- *
- * @param newGroup Group in refine mesh.
- * @param oldGroup Group in original mesh.
- */
- void groupSetNewVertices(const ALE::Obj<mesh_type::int_section_type>& newGroup,
- const ALE::Obj<mesh_type::int_section_type>& oldGroup);
-
- /** Add new vertices to label.
- *
- * @param newMesh Mesh with refined cells.
- * @param oldMesh Original mesh.
- * @param labelName Name of label.
- */
- void labelAddNewVertices(const ALE::Obj<mesh_type>& newMesh,
- const ALE::Obj<mesh_type>& oldMesh,
- const char* labelName);
-
- /** Calculate new overlap.
- *
- * @param newMesh New (refined) mesh.
- * @param orderNewMesh Order in new mesh.
- * @param oldMesh Current (unrefined) mesh with overlap.
- * @param orderOldMesh Order in old mesh.
- */
- void overlapAddNewVertices(const Obj<mesh_type>& newMesh,
- const MeshOrder& orderNewMesh,
- const Obj<mesh_type>& oldMesh,
- const MeshOrder& orderOldMesh);
-
-// PROTECTED TYPEDEFS ///////////////////////////////////////////////////
-protected :
-
- template<typename Point>
- class Edge : public std::pair<Point, Point> {
- public:
- Edge(void) : std::pair<Point, Point>() {};
- Edge(const Point l) : std::pair<Point, Point>(l, l) {};
- Edge(const Point l, const Point r) : std::pair<Point, Point>(l, r) {};
- ~Edge(void) {};
- friend std::ostream& operator<<(std::ostream& stream, const Edge& edge) {
- stream << "(" << edge.first << ", " << edge.second << ")";
- return stream;
- };
- };
- typedef Edge<point_type> EdgeType;
- typedef std::map<EdgeType, point_type> edge_map_type;
-
- template<typename Point>
- class Face {
- public:
- Face(void) {};
- Face(const Point 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;
- };
- ~Face(void) {};
- friend bool operator==(const Face<Point>& a,
- const Face<Point>& 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];
- return result;
- };
- friend bool operator<(const Face<Point>& a,
- const Face<Point>& b) {
- if (a.points[0] < b.points[0]) {
- return true;
- } 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]) {
- return true;
- } else if (a.points[2] == b.points[2]) {
- if (a.points[3] < b.points[3]) {
- return true;
- } // if
- } // if/else
- } // if/else
- } // if/else
-
- return false;
- };
- friend std::ostream& operator<<(std::ostream& stream,
- const Face<Point>& face) {
- stream << "(" << face.points[0]
- << ", " << face.points[1]
- << ", " << face.points[2]
- << ", " << face.points[3]
- << ")";
- return stream;
- };
- public:
- int points[4];
- };
- template<typename Point>
- class FaceCmp { // for compatibility with gcc 3.4.6
- public :
- bool operator() (const Face<Point>& a,
- const Face<Point>& b) const {
- if (a.points[0] < b.points[0]) {
- return true;
- } 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]) {
- return true;
- } else if (a.points[2] == b.points[2]) {
- if (a.points[3] < b.points[3]) {
- return true;
- } // if
- } // if/else
- } // if/else
- } // if/else
-
- return false;
- };
- };
- typedef Face<point_type> FaceType;
- typedef std::map<FaceType, point_type, FaceCmp<point_type> > face_map_type;
-
- template<typename Point>
- class Volume {
- public:
- Volume(void) {};
- Volume(const Point p) {
- points[0] = p;
- points[1] = p;
- points[2] = p;
- points[3] = p;
- points[4] = p;
- points[5] = p;
- points[6] = p;
- points[7] = p;
- };
- Volume(const Point p0,
- const Point p1,
- const Point p2,
- const Point p3,
- const Point p4,
- const Point p5,
- const Point p6,
- const Point p7) {
- points[0] = p0;
- points[1] = p1;
- points[2] = p2;
- points[3] = p3;
- points[4] = p4;
- points[5] = p5;
- points[6] = p6;
- points[7] = p7;
- };
- ~Volume(void) {};
- friend bool operator==(const Volume<Point>& a,
- const Volume<Point>& 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[4] == b.points[4] &&
- a.points[5] == b.points[5] &&
- a.points[6] == b.points[6] &&
- a.points[7] == b.points[7];
- return result;
- };
- friend bool operator<(const Volume<Point>& a,
- const Volume<Point>& b) {
- if (a.points[0] < b.points[0]) {
- return true;
- } 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]) {
- return true;
- } else if (a.points[2] == b.points[2]) {
- if (a.points[3] < b.points[3]) {
- return true;
- } else if (a.points[3] == b.points[3]) {
- if (a.points[4] < b.points[4]) {
- return true;
- } else if (a.points[4] == b.points[4]) {
- if (a.points[5] < b.points[5]) {
- return true;
- } else if (a.points[6] == b.points[6]) {
- if (a.points[7] < b.points[7]) {
- return true;
- } // if
- } // if/else
- } // if/else
- } // if/else
- } // if/else
- } // if/else
- } // if/else
-
- return false;
- };
- friend std::ostream& operator<<(std::ostream& stream,
- const Volume<Point>& v) {
- stream << "(" << v.points[0]
- << ", " << v.points[1]
- << ", " << v.points[2]
- << ", " << v.points[3]
- << ", " << v.points[4]
- << ", " << v.points[5]
- << ", " << v.points[6]
- << ", " << v.points[7]
- << ")";
- return stream;
- };
- public:
- int points[8];
- };
- template<typename Point>
- class VolumeCmp { // for compatibility with gcc 3.4.6
- public :
- bool operator() (const Volume<Point>& a,
- const Volume<Point>& b) {
- if (a.points[0] < b.points[0]) {
- return true;
- } 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]) {
- return true;
- } else if (a.points[2] == b.points[2]) {
- if (a.points[3] < b.points[3]) {
- return true;
- } else if (a.points[3] == b.points[3]) {
- if (a.points[4] < b.points[4]) {
- return true;
- } else if (a.points[4] == b.points[4]) {
- if (a.points[5] < b.points[5]) {
- return true;
- } else if (a.points[6] == b.points[6]) {
- if (a.points[7] < b.points[7]) {
- return true;
- } // if
- } // if/else
- } // if/else
- } // if/else
- } // if/else
- } // if/else
- } // if/else
-
- return false;
- };
- };
- typedef Volume<point_type> VolumeType;
- typedef std::map<VolumeType, point_type, VolumeCmp<point_type> > volume_map_type;
-
-// PROTECTED MEMBERS ////////////////////////////////////////////////////
-protected :
-
- const mesh_type& _mesh;
- edge_map_type _edgeToVertex;
- face_map_type _faceToVertex;
- volume_map_type _volumeToVertex;
-
-// NOT IMPLEMENTED //////////////////////////////////////////////////////
-private :
-
- RefineVol8Face4Edges2(const RefineVol8Face4Edges2&); ///< Not implemented
- const RefineVol8Face4Edges2& operator=(const RefineVol8Face4Edges2&); ///< Not implemented
-
-}; // RefineVol8Face4Edges2
-
-#endif // pylith_topology_refinevol8face4edges2_hh
-
-
-// End of file
Modified: short/3D/PyLith/trunk/libsrc/pylith/topology/topologyfwd.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/topologyfwd.hh 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/topologyfwd.hh 2013-07-26 22:13:24 UTC (rev 22685)
@@ -29,23 +29,6 @@
#include "pylith/utils/types.hh"
-#if 0 // :TODO: Update this for PETSc DM.
-namespace ALE {
- template<typename cellrefiner_type> class MeshRefiner;
- class RefineEdges2;
- class CellRefinerTri3;
- class CellRefinerTet4;
-
- class RefineFace4Edges2;
- class CellRefinerQuad4;
-
- class RefineVol8Face4Edges2;
- class CellRefinerHex8;
-
- class MeshOrder;
-} // ALE
-#endif
-
namespace pylith {
namespace topology {
Modified: short/3D/PyLith/trunk/modulesrc/topology/topology.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/topology/topology.i 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/modulesrc/topology/topology.i 2013-07-26 22:13:24 UTC (rev 22685)
@@ -29,7 +29,7 @@
#include "pylith/topology/SolutionFields.hh"
#include "pylith/topology/Jacobian.hh"
#include "pylith/topology/Distributor.hh"
-//#include "pylith/topology/RefineUniform.hh" // Not yet updated
+#include "pylith/topology/RefineUniform.hh"
#include "pylith/topology/ReverseCuthillMcKee.hh"
%}
@@ -64,7 +64,7 @@
%include "SolutionFields.i"
%include "Jacobian.i"
%include "Distributor.i"
-//%include "RefineUniform.i" // not yet updated
+%include "RefineUniform.i"
%include "ReverseCuthillMcKee.i"
// End of file
Modified: short/3D/PyLith/trunk/pylith/topology/RefineUniform.py
===================================================================
--- short/3D/PyLith/trunk/pylith/topology/RefineUniform.py 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/pylith/topology/RefineUniform.py 2013-07-26 22:13:24 UTC (rev 22685)
@@ -24,11 +24,10 @@
## Factory: mesh_refiner.
from MeshRefiner import MeshRefiner
-#from topology import RefineUniform as ModuleRefineUniform # TEMPORARY
+from topology import RefineUniform as ModuleRefineUniform
# RefineUniform class
-#class RefineUniform(MeshRefiner, ModuleRefineUniform): # TEMPORARY
-class RefineUniform(MeshRefiner):
+class RefineUniform(MeshRefiner, ModuleRefineUniform):
"""
Python manager for uniform global refinement of mesh in parallel.
@@ -39,8 +38,7 @@
import pyre.inventory
- levels = pyre.inventory.int("levels", default=2,
- validator=pyre.inventory.choice([2, 4]))
+ levels = pyre.inventory.int("levels", default=1, validator=pyre.inventory.greaterEqual(1))
levels.meta['tip'] = "Number of refinement levels."
@@ -63,20 +61,19 @@
logEvent = "%srefine" % self._loggingPrefix
self._eventLogger.eventBegin(logEvent)
- print "WARNING: RefineUniform not yet implemented in v2.0.0."
newMesh = mesh
- #from Mesh import Mesh
- #newMesh = Mesh(dim=mesh.dimension(), comm=mesh.comm())
- #newMesh.debug(mesh.debug())
- #newMesh.coordsys(mesh.coordsys())
- #ModuleRefineUniform.refine(self, newMesh, mesh, self.levels)
- #if not newMesh == mesh:
- # #from pylith.utils.petsc import MemoryLogger
- # #memoryLogger = MemoryLogger.singleton()
- #
- # #memoryLogger.stagePush(mesh.memLoggingStage)
- # mesh.cleanup()
- # #memoryLogger.stagePop()
+ from Mesh import Mesh
+ newMesh = Mesh(dim=mesh.dimension(), comm=mesh.comm())
+ newMesh.debug(mesh.debug())
+ newMesh.coordsys(mesh.coordsys())
+ ModuleRefineUniform.refine(self, newMesh, mesh, self.levels)
+ if not newMesh == mesh:
+ #from pylith.utils.petsc import MemoryLogger
+ #memoryLogger = MemoryLogger.singleton()
+
+ #memoryLogger.stagePush(mesh.memLoggingStage)
+ mesh.cleanup()
+ #memoryLogger.stagePop()
self._eventLogger.eventEnd(logEvent)
return newMesh
@@ -97,7 +94,7 @@
"""
Create handle to C++ object.
"""
- #ModuleRefineUniform.__init__(self) # TEMPORARY
+ ModuleRefineUniform.__init__(self)
return
Modified: short/3D/PyLith/trunk/unittests/libtests/topology/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/Makefile.am 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/Makefile.am 2013-07-26 22:13:24 UTC (rev 22685)
@@ -37,9 +37,9 @@
TestFieldsSubMesh.cc \
TestSolutionFields.cc \
TestJacobian.cc \
+ TestRefineUniform.cc \
test_topology.cc
-# TestRefineUniform.cc
noinst_HEADERS = \
@@ -52,33 +52,33 @@
TestFieldsMesh.hh \
TestFieldsSubMesh.hh \
TestSolutionFields.hh \
+ TestRefineUniform.hh \
TestJacobian.hh
-# TestRefineUniform.hh
# Source files associated with testing data
testtopology_SOURCES += \
data/MeshDataCohesive.cc \
- data/MeshDataCohesiveTri3Level2.cc \
- data/MeshDataCohesiveTri3Level2Fault1.cc \
- data/MeshDataCohesiveQuad4Level2.cc \
- data/MeshDataCohesiveQuad4Level2Fault1.cc \
- data/MeshDataCohesiveTet4Level2.cc \
- data/MeshDataCohesiveTet4Level2Fault1.cc \
- data/MeshDataCohesiveHex8Level2.cc \
- data/MeshDataCohesiveHex8Level2Fault1.cc
+ data/MeshDataCohesiveTri3Level1.cc \
+ data/MeshDataCohesiveTri3Level1Fault1.cc \
+ data/MeshDataCohesiveQuad4Level1.cc \
+ data/MeshDataCohesiveQuad4Level1Fault1.cc \
+ data/MeshDataCohesiveTet4Level1.cc \
+ data/MeshDataCohesiveTet4Level1Fault1.cc \
+ data/MeshDataCohesiveHex8Level1.cc \
+ data/MeshDataCohesiveHex8Level1Fault1.cc
noinst_HEADERS += \
data/MeshDataCohesive.hh \
- data/MeshDataCohesiveTri3Level2.hh \
- data/MeshDataCohesiveTri3Level2Fault1.hh \
- data/MeshDataCohesiveQuad4Level2.hh \
- data/MeshDataCohesiveQuad4Level2Fault1.hh \
- data/MeshDataCohesiveTet4Level2.hh \
- data/MeshDataCohesiveTet4Level2Fault1.hh \
- data/MeshDataCohesiveHex8Level2.hh \
- data/MeshDataCohesiveHex8Level2Fault1.hh
+ data/MeshDataCohesiveTri3Level1.hh \
+ data/MeshDataCohesiveTri3Level1Fault1.hh \
+ data/MeshDataCohesiveQuad4Level1.hh \
+ data/MeshDataCohesiveQuad4Level1Fault1.hh \
+ data/MeshDataCohesiveTet4Level1.hh \
+ data/MeshDataCohesiveTet4Level1Fault1.hh \
+ data/MeshDataCohesiveHex8Level1.hh \
+ data/MeshDataCohesiveHex8Level1Fault1.hh
AM_CPPFLAGS = \
$(PETSC_SIEVE_FLAGS) $(PETSC_CC_INCLUDES) \
Modified: short/3D/PyLith/trunk/unittests/libtests/topology/TestRefineUniform.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/TestRefineUniform.cc 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/TestRefineUniform.cc 2013-07-26 22:13:24 UTC (rev 22685)
@@ -23,28 +23,26 @@
#include "pylith/topology/RefineUniform.hh" // USES RefineUniform
#include "pylith/topology/Mesh.hh" // USES Mesh
+#include "pylith/topology/Stratum.hh" // USES Stratum
+#include "pylith/topology/CoordsVisitor.hh" // USES CoordsVisitor
#include "pylith/meshio/MeshIOAscii.hh" // USES MeshIOAscii
#include "pylith/faults/FaultCohesiveKin.hh" // USES FaultCohesiveKin
#include "pylith/utils/array.hh" // USES int_array
-#include "data/MeshDataCohesiveTri3Level2.hh"
-#include "data/MeshDataCohesiveTri3Level2Fault1.hh"
-#include "data/MeshDataCohesiveQuad4Level2.hh"
-#include "data/MeshDataCohesiveQuad4Level2Fault1.hh"
-#include "data/MeshDataCohesiveTet4Level2.hh"
-#include "data/MeshDataCohesiveTet4Level2Fault1.hh"
-#include "data/MeshDataCohesiveHex8Level2.hh"
-#include "data/MeshDataCohesiveHex8Level2Fault1.hh"
+#include "data/MeshDataCohesiveTri3Level1.hh"
+#include "data/MeshDataCohesiveTri3Level1Fault1.hh"
+#include "data/MeshDataCohesiveQuad4Level1.hh"
+#include "data/MeshDataCohesiveQuad4Level1Fault1.hh"
+#include "data/MeshDataCohesiveTet4Level1.hh"
+#include "data/MeshDataCohesiveTet4Level1Fault1.hh"
+#include "data/MeshDataCohesiveHex8Level1.hh"
+#include "data/MeshDataCohesiveHex8Level1Fault1.hh"
#include <strings.h> // USES strcasecmp()
#include <stdexcept> // USES std::logic_error
// ----------------------------------------------------------------------
-typedef pylith::topology::Mesh::SieveMesh SieveMesh;
-typedef pylith::topology::Mesh::RealSection RealSection;
-
-// ----------------------------------------------------------------------
CPPUNIT_TEST_SUITE_REGISTRATION( pylith::topology::TestRefineUniform );
// ----------------------------------------------------------------------
@@ -58,74 +56,74 @@
// ----------------------------------------------------------------------
// Test refine() with level 2, tri3 cells, and no fault.
void
-pylith::topology::TestRefineUniform::testRefineTri3Level2(void)
-{ // testRefineTri3Level2
- MeshDataCohesiveTri3Level2 data;
+pylith::topology::TestRefineUniform::testRefineTri3Level1(void)
+{ // testRefineTri3Level1
+ MeshDataCohesiveTri3Level1 data;
_testRefine(data);
-} // testRefineTri3Level2
+} // testRefineTri3Level1
// ----------------------------------------------------------------------
// Test refine() with level 2, tri3 cells, and one fault.
void
-pylith::topology::TestRefineUniform::testRefineTri3Level2Fault1(void)
-{ // testRefineTri3Level2Fault1
- MeshDataCohesiveTri3Level2Fault1 data;
+pylith::topology::TestRefineUniform::testRefineTri3Level1Fault1(void)
+{ // testRefineTri3Level1Fault1
+ MeshDataCohesiveTri3Level1Fault1 data;
_testRefine(data);
-} // testRefineTri3Level2Fault1
+} // testRefineTri3Level1Fault1
// ----------------------------------------------------------------------
// Test refine() with level 2, quad4 cells, and no fault.
void
-pylith::topology::TestRefineUniform::testRefineQuad4Level2(void)
-{ // testRefineQuad4Level2
- MeshDataCohesiveQuad4Level2 data;
+pylith::topology::TestRefineUniform::testRefineQuad4Level1(void)
+{ // testRefineQuad4Level1
+ MeshDataCohesiveQuad4Level1 data;
_testRefine(data);
-} // testRefineQuad4Level2
+} // testRefineQuad4Level1
// ----------------------------------------------------------------------
// Test refine() with level 2, quad4 cells, and one fault.
void
-pylith::topology::TestRefineUniform::testRefineQuad4Level2Fault1(void)
-{ // testRefineQuad4Level2Fault1
- MeshDataCohesiveQuad4Level2Fault1 data;
+pylith::topology::TestRefineUniform::testRefineQuad4Level1Fault1(void)
+{ // testRefineQuad4Level1Fault1
+ MeshDataCohesiveQuad4Level1Fault1 data;
_testRefine(data);
-} // testRefineQuad4Level2Fault1
+} // testRefineQuad4Level1Fault1
// ----------------------------------------------------------------------
// Test refine() with level 2, tet4 cells, and no fault.
void
-pylith::topology::TestRefineUniform::testRefineTet4Level2(void)
-{ // testRefineTet4Level2
- MeshDataCohesiveTet4Level2 data;
+pylith::topology::TestRefineUniform::testRefineTet4Level1(void)
+{ // testRefineTet4Level1
+ MeshDataCohesiveTet4Level1 data;
_testRefine(data);
-} // testRefineTet4Level2
+} // testRefineTet4Level1
// ----------------------------------------------------------------------
// Test refine() with level 2, tet4 cells, and one fault.
void
-pylith::topology::TestRefineUniform::testRefineTet4Level2Fault1(void)
-{ // testRefineTet4Level2Fault1
- MeshDataCohesiveTet4Level2Fault1 data;
+pylith::topology::TestRefineUniform::testRefineTet4Level1Fault1(void)
+{ // testRefineTet4Level1Fault1
+ MeshDataCohesiveTet4Level1Fault1 data;
_testRefine(data);
-} // testRefineTet4Level2Fault1
+} // testRefineTet4Level1Fault1
// ----------------------------------------------------------------------
// Test refine() with level 2, hex8 cells, and no fault.
void
-pylith::topology::TestRefineUniform::testRefineHex8Level2(void)
-{ // testRefineHex8Level2
- MeshDataCohesiveHex8Level2 data;
+pylith::topology::TestRefineUniform::testRefineHex8Level1(void)
+{ // testRefineHex8Level1
+ MeshDataCohesiveHex8Level1 data;
_testRefine(data);
-} // testRefineHex8Level2
+} // testRefineHex8Level1
// ----------------------------------------------------------------------
// Test refine() with level 2, hex8 cells, and one fault.
void
-pylith::topology::TestRefineUniform::testRefineHex8Level2Fault1(void)
-{ // testRefineHex8Level2Fault1
- MeshDataCohesiveHex8Level2Fault1 data;
+pylith::topology::TestRefineUniform::testRefineHex8Level1Fault1(void)
+{ // testRefineHex8Level1Fault1
+ MeshDataCohesiveHex8Level1Fault1 data;
_testRefine(data);
-} // testRefineHex8Level2Fault1
+} // testRefineHex8Level1Fault1
// ----------------------------------------------------------------------
void
@@ -140,13 +138,13 @@
iohandler.read(mesh);
// Adjust topology if necessary.
- if (0 != data.faultA || 0 != data.faultB) {
+ if (data.faultA || data.faultB) {
int firstLagrangeVertex = 0;
int firstFaultCell = 0;
faults::FaultCohesiveKin faultA;
faultA.id(100);
- if (0 != data.faultA) {
+ if (data.faultA) {
faultA.label(data.faultA);
const int nvertices = faultA.numVerticesNoMesh(*mesh);
firstLagrangeVertex += nvertices;
@@ -155,7 +153,7 @@
faults::FaultCohesiveKin faultB;
faultB.id(101);
- if (0 != data.faultB) {
+ if (data.faultB) {
faultA.label(data.faultB);
const int nvertices = faultB.numVerticesNoMesh(*mesh);
firstLagrangeVertex += nvertices;
@@ -163,12 +161,12 @@
} // if
int firstFaultVertex = 0;
- if (0 != data.faultA)
- faultA.adjustTopology(mesh, &firstFaultVertex,
- &firstLagrangeVertex, &firstFaultCell);
- if (0 != data.faultB)
- faultB.adjustTopology(mesh, &firstFaultVertex,
- &firstLagrangeVertex, &firstFaultCell);
+ if (data.faultA) {
+ faultA.adjustTopology(mesh, &firstFaultVertex, &firstLagrangeVertex, &firstFaultCell);
+ } // if
+ if (data.faultB) {
+ faultB.adjustTopology(mesh, &firstFaultVertex, &firstLagrangeVertex, &firstFaultCell);
+ } // if
} // if
} // _setupMesh
@@ -177,7 +175,6 @@
void
pylith::topology::TestRefineUniform::_testRefine(const MeshDataCohesive& data)
{ // _testRefine
- typedef SieveMesh::int_section_type::chart_type chart_type;
Mesh mesh(data.cellDim);
_setupMesh(&mesh, data);
@@ -189,125 +186,130 @@
// Check mesh dimension
CPPUNIT_ASSERT_EQUAL(data.cellDim, newMesh.dimension());
- const ALE::Obj<SieveMesh>& sieveMesh = newMesh.sieveMesh();
- CPPUNIT_ASSERT(!sieveMesh.isNull());
+ const PetscDM& dmMesh = newMesh.dmMesh();CPPUNIT_ASSERT(dmMesh);
// Check vertices
- const ALE::Obj<SieveMesh::label_sequence>& vertices =
- sieveMesh->depthStratum(0);
- const ALE::Obj<RealSection>& coordinates =
- sieveMesh->getRealSection("coordinates");
- const int numVertices = vertices->size();
- CPPUNIT_ASSERT(!vertices.isNull());
- CPPUNIT_ASSERT(!coordinates.isNull());
- CPPUNIT_ASSERT_EQUAL(data.numVertices, numVertices);
- CPPUNIT_ASSERT_EQUAL(data.spaceDim,
- coordinates->getFiberDimension(*vertices->begin()));
- int i = 0;
+ topology::Stratum verticesStratum(dmMesh, topology::Stratum::DEPTH, 0);
+ const PetscInt vStart = verticesStratum.begin();
+ const PetscInt vEnd = verticesStratum.end();
+
+ CPPUNIT_ASSERT_EQUAL(data.numVertices, verticesStratum.size());
+
+ topology::CoordsVisitor coordsVisitor(dmMesh);
+ const PetscScalar* coordsArray = coordsVisitor.localArray();
+ const PylithScalar tolerance = 1.0e-06;
const int spaceDim = data.spaceDim;
- for(SieveMesh::label_sequence::iterator v_iter =
- vertices->begin();
- v_iter != vertices->end();
- ++v_iter) {
- const PylithScalar* vertexCoords = coordinates->restrictPoint(*v_iter);
- CPPUNIT_ASSERT(0 != vertexCoords);
- const PylithScalar tolerance = 1.0e-06;
- for (int iDim=0; iDim < spaceDim; ++iDim)
- if (data.vertices[i] < 1.0) {
- CPPUNIT_ASSERT_DOUBLES_EQUAL(data.vertices[i++], vertexCoords[iDim],
- tolerance);
+ for (PetscInt v = vStart, index = 0; v < vEnd; ++v) {
+ const PetscInt off = coordsVisitor.sectionOffset(v);
+ CPPUNIT_ASSERT_EQUAL(spaceDim, coordsVisitor.sectionDof(v));
+
+ for (int iDim=0; iDim < spaceDim; ++iDim, ++index) {
+ if (data.vertices[index] < 1.0) {
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(data.vertices[index], coordsArray[off+iDim], tolerance);
} else {
- CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, vertexCoords[iDim]/data.vertices[i++],
- tolerance);
- }
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, coordsArray[off+iDim]/data.vertices[index], tolerance);
+ } // if/else
+ } // for
} // for
- // check cells
- const ALE::Obj<SieveMesh::sieve_type>& sieve = sieveMesh->getSieve();
- const ALE::Obj<SieveMesh::label_sequence>& cells =
- sieveMesh->heightStratum(0);
+ // Check cells
+ topology::Stratum cellsStratum(dmMesh, topology::Stratum::HEIGHT, 0);
+ const PetscInt cStart = cellsStratum.begin();
+ const PetscInt cEnd = cellsStratum.end();
+ const PetscInt numCells = cellsStratum.size();
- const int numCells = cells->size();
CPPUNIT_ASSERT_EQUAL(data.numCells+data.numCellsCohesive, numCells);
+ const int offset = numCells;
+ const PetscInt* cone = NULL;
+ PetscInt coneSize = 0;
+ PetscErrorCode err = 0;
// Normal cells
- ALE::ISieveVisitor::PointRetriever<SieveMesh::sieve_type> pV(sieve->getMaxConeSize());
- SieveMesh::label_sequence::iterator c_iter = cells->begin();
- for(int iCell=0, i=0; iCell < data.numCells; ++iCell, ++c_iter) {
- pV.clear();
- sieve->cone(*c_iter, pV);
- const SieveMesh::point_type *cone = pV.getPoints();
- const int coneSize = pV.getSize();
- CPPUNIT_ASSERT_EQUAL(data.numCorners, coneSize);
- for(int p = 0; p < coneSize; ++p, ++i)
- CPPUNIT_ASSERT_EQUAL(data.cells[i], cone[p]);
+ for(PetscInt c = cStart, index = 0; c < data.numCells; ++c) {
+ PetscInt *closure = PETSC_NULL;
+ PetscInt closureSize, numCorners = 0;
+
+ err = DMPlexGetTransitiveClosure(dmMesh, c, PETSC_TRUE, &closureSize, &closure);PYLITH_CHECK_ERROR(err);
+ for(PetscInt p = 0; p < closureSize*2; p += 2) {
+ const PetscInt point = closure[p];
+ if ((point >= vStart) && (point < vEnd)) {
+ closure[numCorners++] = point;
+ } // if
+ } // for
+ err = DMPlexInvertCell(data.cellDim, numCorners, closure);PYLITH_CHECK_ERROR(err);
+ CPPUNIT_ASSERT_EQUAL(data.numCorners, numCorners);
+ for(PetscInt p = 0; p < numCorners; ++p, ++index) {
+ CPPUNIT_ASSERT_EQUAL(data.cells[index], closure[p]-offset);
+ } // for
+ err = DMPlexRestoreTransitiveClosure(dmMesh, c, PETSC_TRUE, &closureSize, &closure);PYLITH_CHECK_ERROR(err);
} // for
+
// Cohesive cells
- for (int iCell=0, i=0; iCell < data.numCellsCohesive; ++iCell, ++c_iter) {
- pV.clear();
- sieve->cone(*c_iter, pV);
- const SieveMesh::point_type *cone = pV.getPoints();
- const int coneSize = pV.getSize();
- CPPUNIT_ASSERT_EQUAL(data.numCornersCohesive, coneSize);
- for(int p = 0; p < coneSize; ++p, ++i)
- CPPUNIT_ASSERT_EQUAL(data.cellsCohesive[i], cone[p]);
+ for(PetscInt c = data.numCells, index = 0; c < cEnd; ++c) {
+ PetscInt *closure = PETSC_NULL;
+ PetscInt closureSize, numCorners = 0;
+
+ err = DMPlexGetTransitiveClosure(dmMesh, c, PETSC_TRUE, &closureSize, &closure);PYLITH_CHECK_ERROR(err);
+ for(PetscInt p = 0; p < closureSize*2; p += 2) {
+ const PetscInt point = closure[p];
+ if ((point >= vStart) && (point < vEnd)) {
+ closure[numCorners++] = point;
+ } // if
+ } // for
+ err = DMPlexInvertCell(data.cellDim, numCorners, closure);PYLITH_CHECK_ERROR(err);
+ CPPUNIT_ASSERT_EQUAL(data.numCornersCohesive, numCorners);
+ for(PetscInt p = 0; p < numCorners; ++p, ++index) {
+ CPPUNIT_ASSERT_EQUAL(data.cellsCohesive[index], closure[p]-offset);
+ } // for
+ err = DMPlexRestoreTransitiveClosure(dmMesh, c, PETSC_TRUE, &closureSize, &closure);PYLITH_CHECK_ERROR(err);
} // for
// check materials
- const ALE::Obj<SieveMesh::label_type>& labelMaterials =
- sieveMesh->getLabel("material-id");
- const int idDefault = -999;
- const int size = numCells;
- i = 0;
- for(SieveMesh::label_sequence::iterator c_iter = cells->begin();
- c_iter != cells->end();
- ++c_iter) {
- const int id = sieveMesh->getValue(labelMaterials, *c_iter, idDefault);
- CPPUNIT_ASSERT_EQUAL(data.materialIds[i++], id);
+ PetscInt matId = 0;
+ for(PetscInt c = cStart; c < cEnd; ++c) {
+ err = DMPlexGetLabelValue(dmMesh, "material-id", c, &matId);PYLITH_CHECK_ERROR(err);
+ CPPUNIT_ASSERT_EQUAL(data.materialIds[c-cStart], matId);
} // for
// Check groups
- const ALE::Obj<std::set<std::string> >& groupNames =
- sieveMesh->getIntSections();
- if (data.numGroups > 0) {
- CPPUNIT_ASSERT(!groupNames.isNull());
- CPPUNIT_ASSERT_EQUAL(data.numGroups, int(groupNames->size()));
- } // if
- int iGroup = 0;
- int index = 0;
- for (std::set<std::string>::const_iterator name=groupNames->begin();
- name != groupNames->end();
- ++name, ++iGroup) {
- const ALE::Obj<SieveMesh::int_section_type>& groupField =
- sieveMesh->getIntSection(*name);
- CPPUNIT_ASSERT(!groupField.isNull());
- const chart_type& chart = groupField->getChart();
- SieveMesh::point_type firstPoint;
- for(chart_type::const_iterator c_iter = chart.begin();
- c_iter != chart.end();
- ++c_iter) {
- if (groupField->getFiberDimension(*c_iter)) {
- firstPoint = *c_iter;
- break;
+ PetscInt numGroups, pStart, pEnd;
+ err = DMPlexGetChart(dmMesh, &pStart, &pEnd);PYLITH_CHECK_ERROR(err);
+ err = DMPlexGetNumLabels(dmMesh, &numGroups);PYLITH_CHECK_ERROR(err);
+ numGroups -= 2; // Remove depth and material labels.
+ CPPUNIT_ASSERT_EQUAL(data.numGroups, numGroups);
+ PetscInt index = 0;
+ for(PetscInt iGroup = 0, iLabel = numGroups-1; iGroup < numGroups; ++iGroup, --iLabel) {
+ const char *name = NULL;
+ PetscInt firstPoint = 0;
+
+ err = DMPlexGetLabelName(dmMesh, iLabel, &name);PYLITH_CHECK_ERROR(err);
+ CPPUNIT_ASSERT_EQUAL(std::string(data.groupNames[iGroup]), std::string(name));
+ for(PetscInt p = pStart; p < pEnd; ++p) {
+ PetscInt val;
+
+ err = DMPlexGetLabelValue(dmMesh, name, p, &val);PYLITH_CHECK_ERROR(err);
+ if (val >= 0) {
+ firstPoint = p;
+ break;
} // if
} // for
- std::string groupType =
- (sieveMesh->height(firstPoint) == 0) ? "cell" : "vertex";
- const int numPoints = groupField->size();
- int_array points(numPoints);
- int i = 0;
- for(chart_type::const_iterator c_iter = chart.begin();
- c_iter != chart.end();
- ++c_iter)
- if (groupField->getFiberDimension(*c_iter))
- points[i++] = *c_iter;
-
- CPPUNIT_ASSERT_EQUAL(std::string(data.groupNames[iGroup]), *name);
+ std::string groupType = (firstPoint >= cStart && firstPoint < cEnd) ? "cell" : "vertex";
CPPUNIT_ASSERT_EQUAL(std::string(data.groupTypes[iGroup]), groupType);
+ PetscInt numPoints;
+ err = DMPlexGetStratumSize(dmMesh, name, 1, &numPoints);PYLITH_CHECK_ERROR(err);
CPPUNIT_ASSERT_EQUAL(data.groupSizes[iGroup], numPoints);
- for (int i=0; i < numPoints; ++i)
- CPPUNIT_ASSERT_EQUAL(data.groups[index++], points[i]);
+ PetscIS pointIS = NULL;
+ const PetscInt *points = NULL;
+ const PetscInt offset = ("vertex" == groupType) ? numCells : 0;
+ err = DMPlexGetStratumIS(dmMesh, name, 1, &pointIS);PYLITH_CHECK_ERROR(err);
+ err = ISGetIndices(pointIS, &points);PYLITH_CHECK_ERROR(err);
+ for(PetscInt p = 0; p < numPoints; ++p) {
+ CPPUNIT_ASSERT_EQUAL(data.groups[index++], points[p]-offset);
+ } // for
+ err = ISRestoreIndices(pointIS, &points);PYLITH_CHECK_ERROR(err);
+ err = ISDestroy(&pointIS);PYLITH_CHECK_ERROR(err);
} // for
+
} // _testRefine
Modified: short/3D/PyLith/trunk/unittests/libtests/topology/TestRefineUniform.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/TestRefineUniform.hh 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/TestRefineUniform.hh 2013-07-26 22:13:24 UTC (rev 22685)
@@ -51,17 +51,17 @@
CPPUNIT_TEST( testConstructor );
- CPPUNIT_TEST( testRefineTri3Level2 );
- CPPUNIT_TEST( testRefineTri3Level2Fault1 );
+ CPPUNIT_TEST( testRefineTri3Level1 );
+ //CPPUNIT_TEST( testRefineTri3Level1Fault1 );
- CPPUNIT_TEST( testRefineQuad4Level2 );
- CPPUNIT_TEST( testRefineQuad4Level2Fault1 );
+ CPPUNIT_TEST( testRefineQuad4Level1 );
+ //CPPUNIT_TEST( testRefineQuad4Level1Fault1 );
- CPPUNIT_TEST( testRefineTet4Level2 );
- CPPUNIT_TEST( testRefineTet4Level2Fault1 );
+ CPPUNIT_TEST( testRefineTet4Level1 );
+ //CPPUNIT_TEST( testRefineTet4Level1Fault1 );
- CPPUNIT_TEST( testRefineHex8Level2 );
- CPPUNIT_TEST( testRefineHex8Level2Fault1 );
+ CPPUNIT_TEST( testRefineHex8Level1 );
+ //CPPUNIT_TEST( testRefineHex8Level1Fault1 );
CPPUNIT_TEST_SUITE_END();
@@ -72,28 +72,28 @@
void testConstructor(void);
/// Test refine() with level 2, tri3 cells, and no fault.
- void testRefineTri3Level2(void);
+ void testRefineTri3Level1(void);
/// Test refine() with level 2, tri3 cells, and one fault.
- void testRefineTri3Level2Fault1(void);
+ void testRefineTri3Level1Fault1(void);
/// Test refine() with level 2, quad4 cells, and no fault.
- void testRefineQuad4Level2(void);
+ void testRefineQuad4Level1(void);
/// Test refine() with level 2, quad4 cells, and one fault.
- void testRefineQuad4Level2Fault1(void);
+ void testRefineQuad4Level1Fault1(void);
/// Test refine() with level 2, tet4 cells, and no fault.
- void testRefineTet4Level2(void);
+ void testRefineTet4Level1(void);
/// Test refine() with level 2, tet4 cells, and one fault.
- void testRefineTet4Level2Fault1(void);
+ void testRefineTet4Level1Fault1(void);
/// Test refine() with level 2, hex8 cells, and no fault.
- void testRefineHex8Level2(void);
+ void testRefineHex8Level1(void);
/// Test refine() with level 2, hex8 cells, and one fault.
- void testRefineHex8Level2Fault1(void);
+ void testRefineHex8Level1Fault1(void);
// PRIVATE METHODS //////////////////////////////////////////////////////
private :
Copied: short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveHex8Level1.cc (from rev 22647, short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveHex8Level2.cc)
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveHex8Level1.cc (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveHex8Level1.cc 2013-07-26 22:13:24 UTC (rev 22685)
@@ -0,0 +1,171 @@
+// -*- 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-2013 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#include "MeshDataCohesiveHex8Level1.hh"
+
+const char* pylith::topology::MeshDataCohesiveHex8Level1::_filename =
+ "data/twohex8.mesh";
+
+const int pylith::topology::MeshDataCohesiveHex8Level1::_refineLevel = 2;
+const char* pylith::topology::MeshDataCohesiveHex8Level1::_faultA = 0;
+const char* pylith::topology::MeshDataCohesiveHex8Level1::_faultB = 0;
+
+const int pylith::topology::MeshDataCohesiveHex8Level1::_numVertices = 45;
+
+const int pylith::topology::MeshDataCohesiveHex8Level1::_spaceDim = 3;
+
+const int pylith::topology::MeshDataCohesiveHex8Level1::_numCells = 16;
+
+const int pylith::topology::MeshDataCohesiveHex8Level1::_numCellsCohesive = 0;
+
+const int pylith::topology::MeshDataCohesiveHex8Level1::_cellDim = 3;
+
+const int pylith::topology::MeshDataCohesiveHex8Level1::_numCorners = 8;
+
+const int pylith::topology::MeshDataCohesiveHex8Level1::_numCornersCohesive = 6;
+
+const PylithScalar pylith::topology::MeshDataCohesiveHex8Level1::_vertices[] = {
+ -2.0, -1.0, -1.0, // 26
+ -2.0, +1.0, -1.0,
+ -2.0, -1.0, +1.0,
+ -2.0, +1.0, +1.0,
+ 0.0, -1.0, -1.0,
+ 0.0, +1.0, -1.0,
+ 0.0, -1.0, +1.0,
+ 0.0, +1.0, +1.0,
+ +2.0, -1.0, -1.0,
+ +2.0, +1.0, -1.0,
+ +2.0, -1.0, +1.0,
+ +2.0, +1.0, +1.0,
+ -1.0, -1.0, -1.0, // 28 (edges)
+ 0.0, 0.0, -1.0,
+ -1.0, +1.0, -1.0,
+ -2.0, 0.0, -1.0,
+ -1.0, -1.0, +1.0, // 32
+ 0.0, 0.0, +1.0,
+ -1.0, +1.0, +1.0,
+ -2.0, 0.0, +1.0,
+ -2.0, -1.0, +0.0, // 36
+ +0.0, -1.0, +0.0,
+ +0.0, +1.0, +0.0,
+ -2.0, +1.0, +0.0,
+ -1.0, -1.0, +0.0, // 40 (faces)
+ +0.0, +0.0, +0.0,
+ -1.0, +1.0, +0.0,
+ -2.0, +0.0, +0.0,
+ -1.0, +0.0, -1.0,
+ -1.0, +0.0, +1.0,
+ -1.0, +0.0, +0.0, // 46 (volume)
+ +2.0, +0.0, -1.0, // 47 (edges)
+ +1.0, +1.0, -1.0,
+ +1.0, -1.0, -1.0,
+ +2.0, +0.0, +1.0, // 50
+ +1.0, +1.0, +1.0,
+ +1.0, -1.0, +1.0,
+ +2.0, -1.0, +0.0, // 53
+ +2.0, +1.0, +0.0,
+ +2.0, +0.0, +0.0, // 55 (faces)
+ +1.0, +1.0, +0.0,
+ +1.0, -1.0, +0.0,
+ +1.0, +0.0, -1.0,
+ +1.0, +0.0, +1.0,
+ +1.0, +0.0, +0.0, // 60 (volume)
+};
+
+const int pylith::topology::MeshDataCohesiveHex8Level1::_cells[] = {
+ 16, 28, 44, 31, 36, 40, 46, 43,
+ 20, 29, 44, 28, 37, 41, 46, 40,
+ 21, 30, 44, 29, 38, 42, 46, 41,
+ 17, 31, 44, 30, 39, 43, 46, 42,
+ 36, 40, 46, 43, 18, 32, 45, 35,
+ 37, 41, 46, 40, 22, 33, 45, 32,
+ 38, 42, 46, 41, 23, 34, 45, 33,
+ 39, 43, 46, 42, 19, 35, 45, 34,
+ 24, 47, 58, 49, 53, 55, 60, 57,
+ 25, 48, 58, 47, 54, 56, 60, 55,
+ 21, 29, 58, 48, 38, 41, 60, 56,
+ 20, 49, 58, 29, 37, 57, 60, 41,
+ 53, 55, 60, 57, 26, 50, 59, 52,
+ 54, 56, 60, 55, 27, 51, 59, 50,
+ 38, 41, 60, 56, 23, 33, 59, 51,
+ 37, 57, 60, 41, 22, 52, 59, 33,
+};
+const int pylith::topology::MeshDataCohesiveHex8Level1::_cellsCohesive[] = {
+};
+const int pylith::topology::MeshDataCohesiveHex8Level1::_materialIds[] = {
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+};
+
+const int pylith::topology::MeshDataCohesiveHex8Level1::_numGroups = 4;
+
+const int pylith::topology::MeshDataCohesiveHex8Level1::_groupSizes[] = {
+ 2, 9, 9, 9,
+};
+
+const int pylith::topology::MeshDataCohesiveHex8Level1::_groups[] = {
+ 16, 24,
+ 16, 17, 18, 19, 31, 35, 36, 39, 43,
+ 20, 22, 24, 26, 37, 49, 52, 53, 57,
+ 20, 21, 22, 23, 29, 33, 37, 38, 41,
+};
+
+const char* pylith::topology::MeshDataCohesiveHex8Level1::_groupNames[] = {
+ "end points",
+ "face 1",
+ "face 2",
+ "fault",
+};
+
+const char* pylith::topology::MeshDataCohesiveHex8Level1::_groupTypes[] = {
+ "vertex",
+ "vertex",
+ "vertex",
+ "vertex",
+};
+
+pylith::topology::MeshDataCohesiveHex8Level1::MeshDataCohesiveHex8Level1(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<PylithScalar*>(_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::MeshDataCohesiveHex8Level1::~MeshDataCohesiveHex8Level1(void)
+{}
+
+
+// End of file
Copied: short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveHex8Level1.hh (from rev 22647, short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveHex8Level2.hh)
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveHex8Level1.hh (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveHex8Level1.hh 2013-07-26 22:13:24 UTC (rev 22685)
@@ -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-2013 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#if !defined(pylith_topology_meshdatacohesivehex8level1_hh)
+#define pylith_topology_meshdatacohesivehex8level1_hh
+
+#include "MeshDataCohesive.hh"
+
+namespace pylith {
+ namespace topology {
+ class MeshDataCohesiveHex8Level1;
+ } // pylith
+} // topology
+
+class pylith::topology::MeshDataCohesiveHex8Level1 : public MeshDataCohesive
+{ // MeshDataCohesiveHex8Level1
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public:
+
+ /// Constructor
+ MeshDataCohesiveHex8Level1(void);
+
+ /// Destructor
+ ~MeshDataCohesiveHex8Level1(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 PylithScalar _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
+
+}; // MeshDataCohesiveHex8Level1
+
+#endif // pylith_topology_meshdatacohesivehex8level1_hh
+
+// End of file
Copied: short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveHex8Level1Fault1.cc (from rev 22647, short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveHex8Level2Fault1.cc)
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveHex8Level1Fault1.cc (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveHex8Level1Fault1.cc 2013-07-26 22:13:24 UTC (rev 22685)
@@ -0,0 +1,196 @@
+// -*- 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-2013 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#include "MeshDataCohesiveHex8Level1Fault1.hh"
+
+const char* pylith::topology::MeshDataCohesiveHex8Level1Fault1::_filename =
+ "data/twohex8.mesh";
+
+const int pylith::topology::MeshDataCohesiveHex8Level1Fault1::_refineLevel = 2;
+const char* pylith::topology::MeshDataCohesiveHex8Level1Fault1::_faultA =
+ "fault";
+const char* pylith::topology::MeshDataCohesiveHex8Level1Fault1::_faultB = 0;
+
+const int pylith::topology::MeshDataCohesiveHex8Level1Fault1::_numVertices = 63;
+
+const int pylith::topology::MeshDataCohesiveHex8Level1Fault1::_spaceDim = 3;
+
+const int pylith::topology::MeshDataCohesiveHex8Level1Fault1::_numCells = 16;
+
+const int pylith::topology::MeshDataCohesiveHex8Level1Fault1::_numCellsCohesive = 4;
+
+const int pylith::topology::MeshDataCohesiveHex8Level1Fault1::_cellDim = 3;
+
+const int pylith::topology::MeshDataCohesiveHex8Level1Fault1::_numCorners = 8;
+
+const int pylith::topology::MeshDataCohesiveHex8Level1Fault1::_numCornersCohesive = 12;
+
+const PylithScalar pylith::topology::MeshDataCohesiveHex8Level1Fault1::_vertices[] = {
+ -2.0, -1.0, -1.0, // 16
+ -2.0, +1.0, -1.0,
+ -2.0, -1.0, +1.0,
+ -2.0, +1.0, +1.0,
+ 0.0, -1.0, -1.0,
+ 0.0, +1.0, -1.0,
+ 0.0, -1.0, +1.0,
+ 0.0, +1.0, +1.0,
+ +2.0, -1.0, -1.0,
+ +2.0, +1.0, -1.0,
+ +2.0, -1.0, +1.0,
+ +2.0, +1.0, +1.0,
+ 0.0, -1.0, -1.0,
+ 0.0, +1.0, -1.0,
+ 0.0, -1.0, +1.0,
+ 0.0, +1.0, +1.0,
+ -1.0, -1.0, -1.0, // 32 (edges)
+ 0.0, 0.0, -1.0,
+ -1.0, +1.0, -1.0,
+ -2.0, 0.0, -1.0,
+ -1.0, -1.0, +1.0, // 36
+ 0.0, 0.0, +1.0,
+ -1.0, +1.0, +1.0,
+ -2.0, 0.0, +1.0,
+ -2.0, -1.0, +0.0, // 40
+ +0.0, -1.0, +0.0,
+ +0.0, +1.0, +0.0,
+ -2.0, +1.0, +0.0,
+ -1.0, -1.0, +0.0, // 44 (faces)
+ +0.0, +0.0, +0.0,
+ -1.0, +1.0, +0.0,
+ -2.0, +0.0, +0.0,
+ -1.0, +0.0, -1.0,
+ -1.0, +0.0, +1.0,
+ -1.0, +0.0, +0.0, // 50 (volume)
+ +2.0, +0.0, -1.0, // 51 (edges)
+ +1.0, +1.0, -1.0,
+ +0.0, 0.0, -1.0,
+ +1.0, -1.0, -1.0,
+ +2.0, +0.0, +1.0, // 55
+ +1.0, +1.0, +1.0,
+ +0.0, 0.0, +1.0,
+ +1.0, -1.0, +1.0,
+ +2.0, -1.0, +0.0, // 59
+ +2.0, +1.0, +0.0,
+ +0.0, +1.0, +0.0,
+ +0.0, -1.0, +0.0,
+ +2.0, +0.0, +0.0, // 63 (faces)
+ +1.0, +1.0, +0.0,
+ 0.0, +0.0, +0.0,
+ +1.0, -1.0, +0.0,
+ +1.0, +0.0, -1.0,
+ +1.0, +0.0, +1.0,
+ +1.0, +0.0, +0.0, // 69 (volume)
+ 0.0, -1.0, -1.0, // 70 (Lagrange vertices)
+ 0.0, +1.0, -1.0,
+ 0.0, -1.0, +1.0,
+ 0.0, +1.0, +1.0,
+ 0.0, 0.0, -1.0, // 74 (edges)
+ 0.0, +1.0, 0.0,
+ 0.0, 0.0, +1.0,
+ 0.0, -1.0, 0.0,
+ 0.0, 0.0, 0.0, // 78 (face)
+};
+
+const int pylith::topology::MeshDataCohesiveHex8Level1Fault1::_cells[] = {
+ 16, 32, 48, 35, 40, 44, 50, 47,
+ 20, 33, 48, 32, 41, 45, 50, 44,
+ 21, 34, 48, 33, 42, 46, 50, 45,
+ 17, 35, 48, 34, 43, 47, 50, 46,
+ 40, 44, 50, 47, 18, 36, 49, 39,
+ 41, 45, 50, 44, 22, 37, 49, 36,
+ 42, 46, 50, 45, 23, 38, 49, 37,
+ 43, 47, 50, 46, 19, 39, 49, 38,
+ 24, 51, 67, 54, 59, 63, 69, 66,
+ 25, 52, 67, 51, 60, 64, 69, 63,
+ 29, 53, 67, 52, 61, 65, 69, 64,
+ 28, 54, 67, 53, 62, 66, 69, 65,
+ 59, 63, 69, 66, 26, 55, 68, 58,
+ 60, 64, 69, 63, 27, 56, 68, 55,
+ 61, 65, 69, 64, 31, 57, 68, 56,
+ 62, 66, 69, 65, 30, 58, 68, 57,
+};
+const int pylith::topology::MeshDataCohesiveHex8Level1Fault1::_cellsCohesive[] = {
+ 20, 33, 45, 41, 28, 53, 65, 62, 70, 74, 78, 77,
+ 21, 42, 45, 33, 29, 61, 65, 53, 71, 75, 78, 74,
+ 23, 37, 45, 42, 31, 57, 65, 61, 73, 76, 78, 75,
+ 22, 41, 45, 37, 30, 62, 65, 57, 72, 77, 78, 76,
+};
+const int pylith::topology::MeshDataCohesiveHex8Level1Fault1::_materialIds[] = {
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 100, 100, 100, 100,
+};
+
+const int pylith::topology::MeshDataCohesiveHex8Level1Fault1::_numGroups = 4;
+
+const int pylith::topology::MeshDataCohesiveHex8Level1Fault1::_groupSizes[] = {
+ 2, 9, 12, 27,
+};
+
+const int pylith::topology::MeshDataCohesiveHex8Level1Fault1::_groups[] = {
+ 16, 24,
+ 16, 17, 18, 19, 35, 39, 40, 43, 47,
+ 20, 22, 24, 26, 28, 30, 41, 54, 58, 59, 62, 66,
+ 20, 21, 22, 23, 28, 29, 30, 31, 33, 37, 41, 42, 45, 53, 57, 61, 62, 65,
+ 70, 71, 72, 73, 74, 75, 76, 77, 78,
+};
+
+const char* pylith::topology::MeshDataCohesiveHex8Level1Fault1::_groupNames[] = {
+ "end points",
+ "face 1",
+ "face 2",
+ "fault",
+};
+
+const char* pylith::topology::MeshDataCohesiveHex8Level1Fault1::_groupTypes[] = {
+ "vertex",
+ "vertex",
+ "vertex",
+ "vertex",
+};
+
+pylith::topology::MeshDataCohesiveHex8Level1Fault1::MeshDataCohesiveHex8Level1Fault1(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<PylithScalar*>(_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::MeshDataCohesiveHex8Level1Fault1::~MeshDataCohesiveHex8Level1Fault1(void)
+{}
+
+
+// End of file
Copied: short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveHex8Level1Fault1.hh (from rev 22647, short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveHex8Level2Fault1.hh)
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveHex8Level1Fault1.hh (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveHex8Level1Fault1.hh 2013-07-26 22:13:24 UTC (rev 22685)
@@ -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-2013 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#if !defined(pylith_topology_meshdatacohesivehex8level1fault1_hh)
+#define pylith_topology_meshdatacohesivehex8level1fault1_hh
+
+#include "MeshDataCohesive.hh"
+
+namespace pylith {
+ namespace topology {
+ class MeshDataCohesiveHex8Level1Fault1;
+ } // pylith
+} // topology
+
+class pylith::topology::MeshDataCohesiveHex8Level1Fault1 : public MeshDataCohesive
+{ // MeshDataCohesiveHex8Level1Fault1
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public:
+
+ /// Constructor
+ MeshDataCohesiveHex8Level1Fault1(void);
+
+ /// Destructor
+ ~MeshDataCohesiveHex8Level1Fault1(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 PylithScalar _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
+
+}; // MeshDataCohesiveHex8Level1Fault1
+
+#endif // pylith_topology_meshdatacohesivehex8level1fault1_hh
+
+// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveHex8Level2.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveHex8Level2.cc 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveHex8Level2.cc 2013-07-26 22:13:24 UTC (rev 22685)
@@ -1,171 +0,0 @@
-// -*- 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-2013 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ======================================================================
-//
-
-#include "MeshDataCohesiveHex8Level2.hh"
-
-const char* pylith::topology::MeshDataCohesiveHex8Level2::_filename =
- "data/twohex8.mesh";
-
-const int pylith::topology::MeshDataCohesiveHex8Level2::_refineLevel = 2;
-const char* pylith::topology::MeshDataCohesiveHex8Level2::_faultA = 0;
-const char* pylith::topology::MeshDataCohesiveHex8Level2::_faultB = 0;
-
-const int pylith::topology::MeshDataCohesiveHex8Level2::_numVertices = 45;
-
-const int pylith::topology::MeshDataCohesiveHex8Level2::_spaceDim = 3;
-
-const int pylith::topology::MeshDataCohesiveHex8Level2::_numCells = 16;
-
-const int pylith::topology::MeshDataCohesiveHex8Level2::_numCellsCohesive = 0;
-
-const int pylith::topology::MeshDataCohesiveHex8Level2::_cellDim = 3;
-
-const int pylith::topology::MeshDataCohesiveHex8Level2::_numCorners = 8;
-
-const int pylith::topology::MeshDataCohesiveHex8Level2::_numCornersCohesive = 6;
-
-const PylithScalar pylith::topology::MeshDataCohesiveHex8Level2::_vertices[] = {
- -2.0, -1.0, -1.0, // 26
- -2.0, +1.0, -1.0,
- -2.0, -1.0, +1.0,
- -2.0, +1.0, +1.0,
- 0.0, -1.0, -1.0,
- 0.0, +1.0, -1.0,
- 0.0, -1.0, +1.0,
- 0.0, +1.0, +1.0,
- +2.0, -1.0, -1.0,
- +2.0, +1.0, -1.0,
- +2.0, -1.0, +1.0,
- +2.0, +1.0, +1.0,
- -1.0, -1.0, -1.0, // 28 (edges)
- 0.0, 0.0, -1.0,
- -1.0, +1.0, -1.0,
- -2.0, 0.0, -1.0,
- -1.0, -1.0, +1.0, // 32
- 0.0, 0.0, +1.0,
- -1.0, +1.0, +1.0,
- -2.0, 0.0, +1.0,
- -2.0, -1.0, +0.0, // 36
- +0.0, -1.0, +0.0,
- +0.0, +1.0, +0.0,
- -2.0, +1.0, +0.0,
- -1.0, -1.0, +0.0, // 40 (faces)
- +0.0, +0.0, +0.0,
- -1.0, +1.0, +0.0,
- -2.0, +0.0, +0.0,
- -1.0, +0.0, -1.0,
- -1.0, +0.0, +1.0,
- -1.0, +0.0, +0.0, // 46 (volume)
- +2.0, +0.0, -1.0, // 47 (edges)
- +1.0, +1.0, -1.0,
- +1.0, -1.0, -1.0,
- +2.0, +0.0, +1.0, // 50
- +1.0, +1.0, +1.0,
- +1.0, -1.0, +1.0,
- +2.0, -1.0, +0.0, // 53
- +2.0, +1.0, +0.0,
- +2.0, +0.0, +0.0, // 55 (faces)
- +1.0, +1.0, +0.0,
- +1.0, -1.0, +0.0,
- +1.0, +0.0, -1.0,
- +1.0, +0.0, +1.0,
- +1.0, +0.0, +0.0, // 60 (volume)
-};
-
-const int pylith::topology::MeshDataCohesiveHex8Level2::_cells[] = {
- 16, 28, 44, 31, 36, 40, 46, 43,
- 20, 29, 44, 28, 37, 41, 46, 40,
- 21, 30, 44, 29, 38, 42, 46, 41,
- 17, 31, 44, 30, 39, 43, 46, 42,
- 36, 40, 46, 43, 18, 32, 45, 35,
- 37, 41, 46, 40, 22, 33, 45, 32,
- 38, 42, 46, 41, 23, 34, 45, 33,
- 39, 43, 46, 42, 19, 35, 45, 34,
- 24, 47, 58, 49, 53, 55, 60, 57,
- 25, 48, 58, 47, 54, 56, 60, 55,
- 21, 29, 58, 48, 38, 41, 60, 56,
- 20, 49, 58, 29, 37, 57, 60, 41,
- 53, 55, 60, 57, 26, 50, 59, 52,
- 54, 56, 60, 55, 27, 51, 59, 50,
- 38, 41, 60, 56, 23, 33, 59, 51,
- 37, 57, 60, 41, 22, 52, 59, 33,
-};
-const int pylith::topology::MeshDataCohesiveHex8Level2::_cellsCohesive[] = {
-};
-const int pylith::topology::MeshDataCohesiveHex8Level2::_materialIds[] = {
- 1, 1, 1, 1, 1, 1, 1, 1,
- 2, 2, 2, 2, 2, 2, 2, 2,
-};
-
-const int pylith::topology::MeshDataCohesiveHex8Level2::_numGroups = 4;
-
-const int pylith::topology::MeshDataCohesiveHex8Level2::_groupSizes[] = {
- 2, 9, 9, 9,
-};
-
-const int pylith::topology::MeshDataCohesiveHex8Level2::_groups[] = {
- 16, 24,
- 16, 17, 18, 19, 31, 35, 36, 39, 43,
- 20, 22, 24, 26, 37, 49, 52, 53, 57,
- 20, 21, 22, 23, 29, 33, 37, 38, 41,
-};
-
-const char* pylith::topology::MeshDataCohesiveHex8Level2::_groupNames[] = {
- "end points",
- "face 1",
- "face 2",
- "fault",
-};
-
-const char* pylith::topology::MeshDataCohesiveHex8Level2::_groupTypes[] = {
- "vertex",
- "vertex",
- "vertex",
- "vertex",
-};
-
-pylith::topology::MeshDataCohesiveHex8Level2::MeshDataCohesiveHex8Level2(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<PylithScalar*>(_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::MeshDataCohesiveHex8Level2::~MeshDataCohesiveHex8Level2(void)
-{}
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveHex8Level2.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveHex8Level2.hh 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveHex8Level2.hh 2013-07-26 22:13:24 UTC (rev 22685)
@@ -1,73 +0,0 @@
-// -*- 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-2013 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ======================================================================
-//
-
-#if !defined(pylith_topology_meshdatacohesivehex8level2_hh)
-#define pylith_topology_meshdatacohesivehex8level2_hh
-
-#include "MeshDataCohesive.hh"
-
-namespace pylith {
- namespace topology {
- class MeshDataCohesiveHex8Level2;
- } // pylith
-} // topology
-
-class pylith::topology::MeshDataCohesiveHex8Level2 : public MeshDataCohesive
-{ // MeshDataCohesiveHex8Level2
-
-// PUBLIC METHODS ///////////////////////////////////////////////////////
-public:
-
- /// Constructor
- MeshDataCohesiveHex8Level2(void);
-
- /// Destructor
- ~MeshDataCohesiveHex8Level2(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 PylithScalar _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
-
-}; // MeshDataCohesiveHex8Level2
-
-#endif // pylith_topology_meshdatacohesivehex8level2_hh
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveHex8Level2Fault1.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveHex8Level2Fault1.cc 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveHex8Level2Fault1.cc 2013-07-26 22:13:24 UTC (rev 22685)
@@ -1,196 +0,0 @@
-// -*- 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-2013 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ======================================================================
-//
-
-#include "MeshDataCohesiveHex8Level2Fault1.hh"
-
-const char* pylith::topology::MeshDataCohesiveHex8Level2Fault1::_filename =
- "data/twohex8.mesh";
-
-const int pylith::topology::MeshDataCohesiveHex8Level2Fault1::_refineLevel = 2;
-const char* pylith::topology::MeshDataCohesiveHex8Level2Fault1::_faultA =
- "fault";
-const char* pylith::topology::MeshDataCohesiveHex8Level2Fault1::_faultB = 0;
-
-const int pylith::topology::MeshDataCohesiveHex8Level2Fault1::_numVertices = 63;
-
-const int pylith::topology::MeshDataCohesiveHex8Level2Fault1::_spaceDim = 3;
-
-const int pylith::topology::MeshDataCohesiveHex8Level2Fault1::_numCells = 16;
-
-const int pylith::topology::MeshDataCohesiveHex8Level2Fault1::_numCellsCohesive = 4;
-
-const int pylith::topology::MeshDataCohesiveHex8Level2Fault1::_cellDim = 3;
-
-const int pylith::topology::MeshDataCohesiveHex8Level2Fault1::_numCorners = 8;
-
-const int pylith::topology::MeshDataCohesiveHex8Level2Fault1::_numCornersCohesive = 12;
-
-const PylithScalar pylith::topology::MeshDataCohesiveHex8Level2Fault1::_vertices[] = {
- -2.0, -1.0, -1.0, // 16
- -2.0, +1.0, -1.0,
- -2.0, -1.0, +1.0,
- -2.0, +1.0, +1.0,
- 0.0, -1.0, -1.0,
- 0.0, +1.0, -1.0,
- 0.0, -1.0, +1.0,
- 0.0, +1.0, +1.0,
- +2.0, -1.0, -1.0,
- +2.0, +1.0, -1.0,
- +2.0, -1.0, +1.0,
- +2.0, +1.0, +1.0,
- 0.0, -1.0, -1.0,
- 0.0, +1.0, -1.0,
- 0.0, -1.0, +1.0,
- 0.0, +1.0, +1.0,
- -1.0, -1.0, -1.0, // 32 (edges)
- 0.0, 0.0, -1.0,
- -1.0, +1.0, -1.0,
- -2.0, 0.0, -1.0,
- -1.0, -1.0, +1.0, // 36
- 0.0, 0.0, +1.0,
- -1.0, +1.0, +1.0,
- -2.0, 0.0, +1.0,
- -2.0, -1.0, +0.0, // 40
- +0.0, -1.0, +0.0,
- +0.0, +1.0, +0.0,
- -2.0, +1.0, +0.0,
- -1.0, -1.0, +0.0, // 44 (faces)
- +0.0, +0.0, +0.0,
- -1.0, +1.0, +0.0,
- -2.0, +0.0, +0.0,
- -1.0, +0.0, -1.0,
- -1.0, +0.0, +1.0,
- -1.0, +0.0, +0.0, // 50 (volume)
- +2.0, +0.0, -1.0, // 51 (edges)
- +1.0, +1.0, -1.0,
- +0.0, 0.0, -1.0,
- +1.0, -1.0, -1.0,
- +2.0, +0.0, +1.0, // 55
- +1.0, +1.0, +1.0,
- +0.0, 0.0, +1.0,
- +1.0, -1.0, +1.0,
- +2.0, -1.0, +0.0, // 59
- +2.0, +1.0, +0.0,
- +0.0, +1.0, +0.0,
- +0.0, -1.0, +0.0,
- +2.0, +0.0, +0.0, // 63 (faces)
- +1.0, +1.0, +0.0,
- 0.0, +0.0, +0.0,
- +1.0, -1.0, +0.0,
- +1.0, +0.0, -1.0,
- +1.0, +0.0, +1.0,
- +1.0, +0.0, +0.0, // 69 (volume)
- 0.0, -1.0, -1.0, // 70 (Lagrange vertices)
- 0.0, +1.0, -1.0,
- 0.0, -1.0, +1.0,
- 0.0, +1.0, +1.0,
- 0.0, 0.0, -1.0, // 74 (edges)
- 0.0, +1.0, 0.0,
- 0.0, 0.0, +1.0,
- 0.0, -1.0, 0.0,
- 0.0, 0.0, 0.0, // 78 (face)
-};
-
-const int pylith::topology::MeshDataCohesiveHex8Level2Fault1::_cells[] = {
- 16, 32, 48, 35, 40, 44, 50, 47,
- 20, 33, 48, 32, 41, 45, 50, 44,
- 21, 34, 48, 33, 42, 46, 50, 45,
- 17, 35, 48, 34, 43, 47, 50, 46,
- 40, 44, 50, 47, 18, 36, 49, 39,
- 41, 45, 50, 44, 22, 37, 49, 36,
- 42, 46, 50, 45, 23, 38, 49, 37,
- 43, 47, 50, 46, 19, 39, 49, 38,
- 24, 51, 67, 54, 59, 63, 69, 66,
- 25, 52, 67, 51, 60, 64, 69, 63,
- 29, 53, 67, 52, 61, 65, 69, 64,
- 28, 54, 67, 53, 62, 66, 69, 65,
- 59, 63, 69, 66, 26, 55, 68, 58,
- 60, 64, 69, 63, 27, 56, 68, 55,
- 61, 65, 69, 64, 31, 57, 68, 56,
- 62, 66, 69, 65, 30, 58, 68, 57,
-};
-const int pylith::topology::MeshDataCohesiveHex8Level2Fault1::_cellsCohesive[] = {
- 20, 33, 45, 41, 28, 53, 65, 62, 70, 74, 78, 77,
- 21, 42, 45, 33, 29, 61, 65, 53, 71, 75, 78, 74,
- 23, 37, 45, 42, 31, 57, 65, 61, 73, 76, 78, 75,
- 22, 41, 45, 37, 30, 62, 65, 57, 72, 77, 78, 76,
-};
-const int pylith::topology::MeshDataCohesiveHex8Level2Fault1::_materialIds[] = {
- 1, 1, 1, 1, 1, 1, 1, 1,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 100, 100, 100, 100,
-};
-
-const int pylith::topology::MeshDataCohesiveHex8Level2Fault1::_numGroups = 4;
-
-const int pylith::topology::MeshDataCohesiveHex8Level2Fault1::_groupSizes[] = {
- 2, 9, 12, 27,
-};
-
-const int pylith::topology::MeshDataCohesiveHex8Level2Fault1::_groups[] = {
- 16, 24,
- 16, 17, 18, 19, 35, 39, 40, 43, 47,
- 20, 22, 24, 26, 28, 30, 41, 54, 58, 59, 62, 66,
- 20, 21, 22, 23, 28, 29, 30, 31, 33, 37, 41, 42, 45, 53, 57, 61, 62, 65,
- 70, 71, 72, 73, 74, 75, 76, 77, 78,
-};
-
-const char* pylith::topology::MeshDataCohesiveHex8Level2Fault1::_groupNames[] = {
- "end points",
- "face 1",
- "face 2",
- "fault",
-};
-
-const char* pylith::topology::MeshDataCohesiveHex8Level2Fault1::_groupTypes[] = {
- "vertex",
- "vertex",
- "vertex",
- "vertex",
-};
-
-pylith::topology::MeshDataCohesiveHex8Level2Fault1::MeshDataCohesiveHex8Level2Fault1(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<PylithScalar*>(_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::MeshDataCohesiveHex8Level2Fault1::~MeshDataCohesiveHex8Level2Fault1(void)
-{}
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveHex8Level2Fault1.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveHex8Level2Fault1.hh 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveHex8Level2Fault1.hh 2013-07-26 22:13:24 UTC (rev 22685)
@@ -1,73 +0,0 @@
-// -*- 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-2013 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ======================================================================
-//
-
-#if !defined(pylith_topology_meshdatacohesivehex8level2fault1_hh)
-#define pylith_topology_meshdatacohesivehex8level2fault1_hh
-
-#include "MeshDataCohesive.hh"
-
-namespace pylith {
- namespace topology {
- class MeshDataCohesiveHex8Level2Fault1;
- } // pylith
-} // topology
-
-class pylith::topology::MeshDataCohesiveHex8Level2Fault1 : public MeshDataCohesive
-{ // MeshDataCohesiveHex8Level2Fault1
-
-// PUBLIC METHODS ///////////////////////////////////////////////////////
-public:
-
- /// Constructor
- MeshDataCohesiveHex8Level2Fault1(void);
-
- /// Destructor
- ~MeshDataCohesiveHex8Level2Fault1(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 PylithScalar _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
-
-}; // MeshDataCohesiveHex8Level2Fault1
-
-#endif // pylith_topology_meshdatacohesivehex8level2fault1_hh
-
-// End of file
Copied: short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level1.cc (from rev 22647, short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level2.cc)
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level1.cc (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level1.cc 2013-07-26 22:13:24 UTC (rev 22685)
@@ -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-2013 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#include "MeshDataCohesiveQuad4Level1.hh"
+
+const char* pylith::topology::MeshDataCohesiveQuad4Level1::_filename =
+ "data/fourquad4.mesh";
+
+const int pylith::topology::MeshDataCohesiveQuad4Level1::_refineLevel = 2;
+const char* pylith::topology::MeshDataCohesiveQuad4Level1::_faultA = 0;
+const char* pylith::topology::MeshDataCohesiveQuad4Level1::_faultB = 0;
+
+const int pylith::topology::MeshDataCohesiveQuad4Level1::_numVertices = 25;
+
+const int pylith::topology::MeshDataCohesiveQuad4Level1::_spaceDim = 2;
+
+const int pylith::topology::MeshDataCohesiveQuad4Level1::_numCells = 16;
+
+const int pylith::topology::MeshDataCohesiveQuad4Level1::_numCellsCohesive = 0;
+
+const int pylith::topology::MeshDataCohesiveQuad4Level1::_cellDim = 2;
+
+const int pylith::topology::MeshDataCohesiveQuad4Level1::_numCorners = 4;
+
+const int pylith::topology::MeshDataCohesiveQuad4Level1::_numCornersCohesive = 6;
+
+const PylithScalar pylith::topology::MeshDataCohesiveQuad4Level1::_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::MeshDataCohesiveQuad4Level1::_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::MeshDataCohesiveQuad4Level1::_cellsCohesive[] = {
+};
+const int pylith::topology::MeshDataCohesiveQuad4Level1::_materialIds[] = {
+ 1, 1, 1, 1, 2, 2, 2, 2,
+ 1, 1, 1, 1, 2, 2, 2, 2,
+};
+
+const int pylith::topology::MeshDataCohesiveQuad4Level1::_numGroups = 3;
+
+const int pylith::topology::MeshDataCohesiveQuad4Level1::_groupSizes[] = {
+ 5, 5, 5,
+};
+
+const int pylith::topology::MeshDataCohesiveQuad4Level1::_groups[] = {
+ 16, 19, 22, 25, 32,
+ 16, 17, 18, 28, 34,
+ 19, 20, 21, 26, 35,
+};
+
+const char* pylith::topology::MeshDataCohesiveQuad4Level1::_groupNames[] = {
+ "edge 1",
+ "end points",
+ "fault",
+};
+
+const char* pylith::topology::MeshDataCohesiveQuad4Level1::_groupTypes[] = {
+ "vertex",
+ "vertex",
+ "vertex",
+};
+
+pylith::topology::MeshDataCohesiveQuad4Level1::MeshDataCohesiveQuad4Level1(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<PylithScalar*>(_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::MeshDataCohesiveQuad4Level1::~MeshDataCohesiveQuad4Level1(void)
+{}
+
+
+// End of file
Copied: short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level1.hh (from rev 22647, short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level2.hh)
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level1.hh (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level1.hh 2013-07-26 22:13:24 UTC (rev 22685)
@@ -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-2013 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#if !defined(pylith_topology_meshdatacohesivequad4level1_hh)
+#define pylith_topology_meshdatacohesivequad4level1_hh
+
+#include "MeshDataCohesive.hh"
+
+namespace pylith {
+ namespace topology {
+ class MeshDataCohesiveQuad4Level1;
+ } // pylith
+} // topology
+
+class pylith::topology::MeshDataCohesiveQuad4Level1 : public MeshDataCohesive
+{ // MeshDataCohesiveQuad4Level1
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public:
+
+ /// Constructor
+ MeshDataCohesiveQuad4Level1(void);
+
+ /// Destructor
+ ~MeshDataCohesiveQuad4Level1(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 PylithScalar _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
+
+}; // MeshDataCohesiveQuad4Level1
+
+#endif // pylith_topology_meshdatacohesivequad4level1_hh
+
+// End of file
Copied: short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level1Fault1.cc (from rev 22647, short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level2Fault1.cc)
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level1Fault1.cc (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level1Fault1.cc 2013-07-26 22:13:24 UTC (rev 22685)
@@ -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-2013 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#include "MeshDataCohesiveQuad4Level1Fault1.hh"
+
+const char* pylith::topology::MeshDataCohesiveQuad4Level1Fault1::_filename =
+ "data/fourquad4.mesh";
+
+const int pylith::topology::MeshDataCohesiveQuad4Level1Fault1::_refineLevel = 2;
+const char* pylith::topology::MeshDataCohesiveQuad4Level1Fault1::_faultA = "fault";
+const char* pylith::topology::MeshDataCohesiveQuad4Level1Fault1::_faultB = 0;
+
+const int pylith::topology::MeshDataCohesiveQuad4Level1Fault1::_numVertices = 35;
+
+const int pylith::topology::MeshDataCohesiveQuad4Level1Fault1::_spaceDim = 2;
+
+const int pylith::topology::MeshDataCohesiveQuad4Level1Fault1::_numCells = 16;
+
+const int pylith::topology::MeshDataCohesiveQuad4Level1Fault1::_numCellsCohesive = 4;
+
+const int pylith::topology::MeshDataCohesiveQuad4Level1Fault1::_cellDim = 2;
+
+const int pylith::topology::MeshDataCohesiveQuad4Level1Fault1::_numCorners = 4;
+
+const int pylith::topology::MeshDataCohesiveQuad4Level1Fault1::_numCornersCohesive = 6;
+
+const PylithScalar pylith::topology::MeshDataCohesiveQuad4Level1Fault1::_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::MeshDataCohesiveQuad4Level1Fault1::_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::MeshDataCohesiveQuad4Level1Fault1::_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::MeshDataCohesiveQuad4Level1Fault1::_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::MeshDataCohesiveQuad4Level1Fault1::_numGroups = 3;
+
+const int pylith::topology::MeshDataCohesiveQuad4Level1Fault1::_groupSizes[] = {
+ 6, 5, 15,
+};
+
+const int pylith::topology::MeshDataCohesiveQuad4Level1Fault1::_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::MeshDataCohesiveQuad4Level1Fault1::_groupNames[] = {
+ "edge 1",
+ "end points",
+ "fault",
+};
+
+const char* pylith::topology::MeshDataCohesiveQuad4Level1Fault1::_groupTypes[] = {
+ "vertex",
+ "vertex",
+ "vertex",
+};
+
+pylith::topology::MeshDataCohesiveQuad4Level1Fault1::MeshDataCohesiveQuad4Level1Fault1(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<PylithScalar*>(_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::MeshDataCohesiveQuad4Level1Fault1::~MeshDataCohesiveQuad4Level1Fault1(void)
+{}
+
+
+// End of file
Copied: short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level1Fault1.hh (from rev 22647, short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level2Fault1.hh)
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level1Fault1.hh (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level1Fault1.hh 2013-07-26 22:13:24 UTC (rev 22685)
@@ -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-2013 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#if !defined(pylith_topology_meshdatacohesivequad4level1fault1_hh)
+#define pylith_topology_meshdatacohesivequad4level1fault1_hh
+
+#include "MeshDataCohesive.hh"
+
+namespace pylith {
+ namespace topology {
+ class MeshDataCohesiveQuad4Level1Fault1;
+ } // pylith
+} // topology
+
+class pylith::topology::MeshDataCohesiveQuad4Level1Fault1 : public MeshDataCohesive
+{ // MeshDataCohesiveQuad4Level1Fault1
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public:
+
+ /// Constructor
+ MeshDataCohesiveQuad4Level1Fault1(void);
+
+ /// Destructor
+ ~MeshDataCohesiveQuad4Level1Fault1(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 PylithScalar _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
+
+}; // MeshDataCohesiveQuad4Level1Fault1
+
+#endif // pylith_topology_meshdatacohesivequad4level1fault1_hh
+
+// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level2.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level2.cc 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level2.cc 2013-07-26 22:13:24 UTC (rev 22685)
@@ -1,148 +0,0 @@
-// -*- 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-2013 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 PylithScalar 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<PylithScalar*>(_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
Deleted: short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level2.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level2.hh 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level2.hh 2013-07-26 22:13:24 UTC (rev 22685)
@@ -1,73 +0,0 @@
-// -*- 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-2013 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 PylithScalar _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
Deleted: short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level2Fault1.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level2Fault1.cc 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level2Fault1.cc 2013-07-26 22:13:24 UTC (rev 22685)
@@ -1,163 +0,0 @@
-// -*- 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-2013 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 PylithScalar 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<PylithScalar*>(_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
Deleted: short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level2Fault1.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level2Fault1.hh 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveQuad4Level2Fault1.hh 2013-07-26 22:13:24 UTC (rev 22685)
@@ -1,73 +0,0 @@
-// -*- 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-2013 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 PylithScalar _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
Copied: short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTet4Level1.cc (from rev 22647, short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTet4Level2.cc)
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTet4Level1.cc (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTet4Level1.cc 2013-07-26 22:13:24 UTC (rev 22685)
@@ -0,0 +1,140 @@
+// -*- 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-2013 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#include "MeshDataCohesiveTet4Level1.hh"
+
+const char* pylith::topology::MeshDataCohesiveTet4Level1::_filename =
+ "data/twotet4.mesh";
+
+const int pylith::topology::MeshDataCohesiveTet4Level1::_refineLevel = 2;
+const char* pylith::topology::MeshDataCohesiveTet4Level1::_faultA = 0;
+const char* pylith::topology::MeshDataCohesiveTet4Level1::_faultB = 0;
+
+const int pylith::topology::MeshDataCohesiveTet4Level1::_numVertices = 14;
+
+const int pylith::topology::MeshDataCohesiveTet4Level1::_spaceDim = 3;
+
+const int pylith::topology::MeshDataCohesiveTet4Level1::_numCells = 16;
+
+const int pylith::topology::MeshDataCohesiveTet4Level1::_numCellsCohesive = 0;
+
+const int pylith::topology::MeshDataCohesiveTet4Level1::_cellDim = 3;
+
+const int pylith::topology::MeshDataCohesiveTet4Level1::_numCorners = 4;
+
+const int pylith::topology::MeshDataCohesiveTet4Level1::_numCornersCohesive = 9;
+
+const PylithScalar pylith::topology::MeshDataCohesiveTet4Level1::_vertices[] = {
+ -1.000000e+00, 0.000000e+00, 0.000000e+00,
+ 0.000000e+00, -1.000000e+00, 0.000000e+00,
+ 0.000000e+00, 0.000000e+00, 1.000000e+00,
+ 0.000000e+00, 1.000000e+00, 0.000000e+00,
+ 1.000000e+00, 0.000000e+00, 0.000000e+00,
+ 0.000000e+00, -5.000000e-01, 5.000000e-01,
+ 0.000000e+00, 5.000000e-01, 5.000000e-01,
+ 0.000000e+00, 0.000000e+00, 0.000000e+00,
+ -5.000000e-01, -5.000000e-01, 0.000000e+00,
+ -5.000000e-01, 0.000000e+00, 5.000000e-01,
+ -5.000000e-01, 5.000000e-01, 0.000000e+00,
+ 5.000000e-01, -5.000000e-01, 0.000000e+00,
+ 5.000000e-01, 5.000000e-01, 0.000000e+00,
+ 5.000000e-01, 0.000000e+00, 5.000000e-01,
+};
+
+const int pylith::topology::MeshDataCohesiveTet4Level1::_cells[] = {
+ 17, 24, 21, 23,
+ 21, 22, 23, 24,
+ 21, 24, 25, 22,
+ 18, 25, 22, 21,
+ 23, 26, 24, 22,
+ 19, 26, 23, 22,
+ 22, 25, 26, 24,
+ 16, 24, 26, 25,
+ 17, 27, 23, 21,
+ 23, 22, 21, 27,
+ 23, 27, 28, 22,
+ 19, 28, 22, 23,
+ 21, 29, 27, 22,
+ 18, 29, 21, 22,
+ 22, 28, 29, 27,
+ 20, 27, 29, 28,
+};
+const int pylith::topology::MeshDataCohesiveTet4Level1::_cellsCohesive[] = {
+};
+const int pylith::topology::MeshDataCohesiveTet4Level1::_materialIds[] = {
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+};
+
+const int pylith::topology::MeshDataCohesiveTet4Level1::_numGroups = 4;
+
+const int pylith::topology::MeshDataCohesiveTet4Level1::_groupSizes[] = {
+ 3, 3, 2, 6,
+};
+
+const int pylith::topology::MeshDataCohesiveTet4Level1::_groups[] = {
+ 16, 17, 24,
+ 18, 20, 29,
+ 16, 20,
+ 17, 18, 19, 21, 22, 23,
+};
+
+const char* pylith::topology::MeshDataCohesiveTet4Level1::_groupNames[] = {
+ "edge 1",
+ "edge 2",
+ "end points",
+ "fault",
+};
+
+const char* pylith::topology::MeshDataCohesiveTet4Level1::_groupTypes[] = {
+ "vertex",
+ "vertex",
+ "vertex",
+ "vertex",
+};
+
+pylith::topology::MeshDataCohesiveTet4Level1::MeshDataCohesiveTet4Level1(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<PylithScalar*>(_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::MeshDataCohesiveTet4Level1::~MeshDataCohesiveTet4Level1(void)
+{}
+
+
+// End of file
Copied: short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTet4Level1.hh (from rev 22647, short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTet4Level2.hh)
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTet4Level1.hh (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTet4Level1.hh 2013-07-26 22:13:24 UTC (rev 22685)
@@ -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-2013 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#if !defined(pylith_topology_meshdatacohesivetet4level1_hh)
+#define pylith_topology_meshdatacohesivetet4level1_hh
+
+#include "MeshDataCohesive.hh"
+
+namespace pylith {
+ namespace topology {
+ class MeshDataCohesiveTet4Level1;
+ } // pylith
+} // topology
+
+class pylith::topology::MeshDataCohesiveTet4Level1 : public MeshDataCohesive
+{ // MeshDataCohesiveTet4Level1
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public:
+
+ /// Constructor
+ MeshDataCohesiveTet4Level1(void);
+
+ /// Destructor
+ ~MeshDataCohesiveTet4Level1(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 PylithScalar _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
+
+}; // MeshDataCohesiveTet4Level1
+
+#endif // pylith_topology_meshdatacohesivetet4level1_hh
+
+// End of file
Copied: short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTet4Level1Fault1.cc (from rev 22647, short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTet4Level2Fault1.cc)
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTet4Level1Fault1.cc (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTet4Level1Fault1.cc 2013-07-26 22:13:24 UTC (rev 22685)
@@ -0,0 +1,158 @@
+// -*- 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-2013 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#include "MeshDataCohesiveTet4Level1Fault1.hh"
+
+const char* pylith::topology::MeshDataCohesiveTet4Level1Fault1::_filename =
+ "data/twotet4.mesh";
+
+const int pylith::topology::MeshDataCohesiveTet4Level1Fault1::_refineLevel = 2;
+const char* pylith::topology::MeshDataCohesiveTet4Level1Fault1::_faultA =
+ "fault";
+const char* pylith::topology::MeshDataCohesiveTet4Level1Fault1::_faultB = 0;
+
+const int pylith::topology::MeshDataCohesiveTet4Level1Fault1::_numVertices = 26;
+
+const int pylith::topology::MeshDataCohesiveTet4Level1Fault1::_spaceDim = 3;
+
+const int pylith::topology::MeshDataCohesiveTet4Level1Fault1::_numCells = 16;
+
+const int pylith::topology::MeshDataCohesiveTet4Level1Fault1::_numCellsCohesive = 4;
+
+const int pylith::topology::MeshDataCohesiveTet4Level1Fault1::_cellDim = 3;
+
+const int pylith::topology::MeshDataCohesiveTet4Level1Fault1::_numCorners = 4;
+
+const int pylith::topology::MeshDataCohesiveTet4Level1Fault1::_numCornersCohesive = 9;
+
+const PylithScalar pylith::topology::MeshDataCohesiveTet4Level1Fault1::_vertices[] = {
+ -1.0, 0.0, 0.0,
+ 0.0, -1.0, 0.0,
+ 0.0, 0.0, 1.0,
+ 0.0, 1.0, 0.0,
+ 1.0, 0.0, 0.0,
+ 0.0, -1.0, 0.0,
+ 0.0, 0.0, 1.0,
+ 0.0, 1.0, 0.0,
+ 0.0, -0.5, 0.5,
+ 0.0, 0.5, 0.5,
+ 0.0, 0.0, 0.0,
+ -0.5, -0.5, 0.0,
+ -0.5, 0.0, 0.5,
+ -0.5, 0.5, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.5, 0.5,
+ 0.0, -0.5, 0.5,
+ 0.5, -0.5, 0.0,
+ 0.5, 0.5, 0.0,
+ 0.5, 0.0, 0.5,
+ 0.0, -1.0, 0.0,
+ 0.0, 0.0, 1.0,
+ 0.0, 1.0, 0.0,
+ 0.0, -0.5, 0.5,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.5, 0.5,
+};
+
+const int pylith::topology::MeshDataCohesiveTet4Level1Fault1::_cells[] = {
+ 17, 27, 24, 26,
+ 24, 25, 26, 27,
+ 24, 27, 28, 25,
+ 18, 28, 25, 24,
+ 26, 29, 27, 25,
+ 19, 29, 26, 25,
+ 25, 28, 29, 27,
+ 16, 27, 29, 28,
+ 21, 33, 30, 32,
+ 30, 31, 32, 33,
+ 30, 33, 34, 31,
+ 23, 34, 31, 30,
+ 32, 35, 33, 31,
+ 22, 35, 32, 31,
+ 31, 34, 35, 33,
+ 20, 33, 35, 34,
+};
+const int pylith::topology::MeshDataCohesiveTet4Level1Fault1::_cellsCohesive[] = {
+ 18, 24, 25, 22, 32, 31, 37, 39, 41,
+ 24, 26, 25, 32, 30, 31, 39, 40, 41,
+ 17, 26, 24, 21, 30, 32, 36, 40, 39,
+ 19, 25, 26, 23, 31, 30, 38, 41, 40,
+};
+const int pylith::topology::MeshDataCohesiveTet4Level1Fault1::_materialIds[] = {
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 100, 100, 100, 100,
+};
+
+const int pylith::topology::MeshDataCohesiveTet4Level1Fault1::_numGroups = 4;
+
+const int pylith::topology::MeshDataCohesiveTet4Level1Fault1::_groupSizes[] = {
+ 4, 4, 2, 18,
+};
+
+const int pylith::topology::MeshDataCohesiveTet4Level1Fault1::_groups[] = {
+ 16, 17, 21, 27,
+ 18, 20, 22, 35,
+ 16, 20,
+ 17, 18, 19, 21, 22, 23, 24, 25, 26, 30, 31, 32, 36, 37, 38, 39, 40, 41,
+};
+
+const char* pylith::topology::MeshDataCohesiveTet4Level1Fault1::_groupNames[] = {
+ "edge 1",
+ "edge 2",
+ "end points",
+ "fault",
+};
+
+const char* pylith::topology::MeshDataCohesiveTet4Level1Fault1::_groupTypes[] = {
+ "vertex",
+ "vertex",
+ "vertex",
+ "vertex",
+};
+
+pylith::topology::MeshDataCohesiveTet4Level1Fault1::MeshDataCohesiveTet4Level1Fault1(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<PylithScalar*>(_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::MeshDataCohesiveTet4Level1Fault1::~MeshDataCohesiveTet4Level1Fault1(void)
+{}
+
+
+// End of file
Copied: short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTet4Level1Fault1.hh (from rev 22647, short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTet4Level2Fault1.hh)
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTet4Level1Fault1.hh (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTet4Level1Fault1.hh 2013-07-26 22:13:24 UTC (rev 22685)
@@ -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-2013 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#if !defined(pylith_topology_meshdatacohesivetet4level1fault1_hh)
+#define pylith_topology_meshdatacohesivetet4level1fault1_hh
+
+#include "MeshDataCohesive.hh"
+
+namespace pylith {
+ namespace topology {
+ class MeshDataCohesiveTet4Level1Fault1;
+ } // pylith
+} // topology
+
+class pylith::topology::MeshDataCohesiveTet4Level1Fault1 : public MeshDataCohesive
+{ // MeshDataCohesiveTet4Level1Fault1
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public:
+
+ /// Constructor
+ MeshDataCohesiveTet4Level1Fault1(void);
+
+ /// Destructor
+ ~MeshDataCohesiveTet4Level1Fault1(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 PylithScalar _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
+
+}; // MeshDataCohesiveTet4Level1Fault1
+
+#endif // pylith_topology_meshdatacohesivetet4level1fault1_hh
+
+// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTet4Level2.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTet4Level2.cc 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTet4Level2.cc 2013-07-26 22:13:24 UTC (rev 22685)
@@ -1,140 +0,0 @@
-// -*- 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-2013 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ======================================================================
-//
-
-#include "MeshDataCohesiveTet4Level2.hh"
-
-const char* pylith::topology::MeshDataCohesiveTet4Level2::_filename =
- "data/twotet4.mesh";
-
-const int pylith::topology::MeshDataCohesiveTet4Level2::_refineLevel = 2;
-const char* pylith::topology::MeshDataCohesiveTet4Level2::_faultA = 0;
-const char* pylith::topology::MeshDataCohesiveTet4Level2::_faultB = 0;
-
-const int pylith::topology::MeshDataCohesiveTet4Level2::_numVertices = 14;
-
-const int pylith::topology::MeshDataCohesiveTet4Level2::_spaceDim = 3;
-
-const int pylith::topology::MeshDataCohesiveTet4Level2::_numCells = 16;
-
-const int pylith::topology::MeshDataCohesiveTet4Level2::_numCellsCohesive = 0;
-
-const int pylith::topology::MeshDataCohesiveTet4Level2::_cellDim = 3;
-
-const int pylith::topology::MeshDataCohesiveTet4Level2::_numCorners = 4;
-
-const int pylith::topology::MeshDataCohesiveTet4Level2::_numCornersCohesive = 9;
-
-const PylithScalar pylith::topology::MeshDataCohesiveTet4Level2::_vertices[] = {
- -1.000000e+00, 0.000000e+00, 0.000000e+00,
- 0.000000e+00, -1.000000e+00, 0.000000e+00,
- 0.000000e+00, 0.000000e+00, 1.000000e+00,
- 0.000000e+00, 1.000000e+00, 0.000000e+00,
- 1.000000e+00, 0.000000e+00, 0.000000e+00,
- 0.000000e+00, -5.000000e-01, 5.000000e-01,
- 0.000000e+00, 5.000000e-01, 5.000000e-01,
- 0.000000e+00, 0.000000e+00, 0.000000e+00,
- -5.000000e-01, -5.000000e-01, 0.000000e+00,
- -5.000000e-01, 0.000000e+00, 5.000000e-01,
- -5.000000e-01, 5.000000e-01, 0.000000e+00,
- 5.000000e-01, -5.000000e-01, 0.000000e+00,
- 5.000000e-01, 5.000000e-01, 0.000000e+00,
- 5.000000e-01, 0.000000e+00, 5.000000e-01,
-};
-
-const int pylith::topology::MeshDataCohesiveTet4Level2::_cells[] = {
- 17, 24, 21, 23,
- 21, 22, 23, 24,
- 21, 24, 25, 22,
- 18, 25, 22, 21,
- 23, 26, 24, 22,
- 19, 26, 23, 22,
- 22, 25, 26, 24,
- 16, 24, 26, 25,
- 17, 27, 23, 21,
- 23, 22, 21, 27,
- 23, 27, 28, 22,
- 19, 28, 22, 23,
- 21, 29, 27, 22,
- 18, 29, 21, 22,
- 22, 28, 29, 27,
- 20, 27, 29, 28,
-};
-const int pylith::topology::MeshDataCohesiveTet4Level2::_cellsCohesive[] = {
-};
-const int pylith::topology::MeshDataCohesiveTet4Level2::_materialIds[] = {
- 1, 1, 1, 1, 1, 1, 1, 1,
- 2, 2, 2, 2, 2, 2, 2, 2,
-};
-
-const int pylith::topology::MeshDataCohesiveTet4Level2::_numGroups = 4;
-
-const int pylith::topology::MeshDataCohesiveTet4Level2::_groupSizes[] = {
- 3, 3, 2, 6,
-};
-
-const int pylith::topology::MeshDataCohesiveTet4Level2::_groups[] = {
- 16, 17, 24,
- 18, 20, 29,
- 16, 20,
- 17, 18, 19, 21, 22, 23,
-};
-
-const char* pylith::topology::MeshDataCohesiveTet4Level2::_groupNames[] = {
- "edge 1",
- "edge 2",
- "end points",
- "fault",
-};
-
-const char* pylith::topology::MeshDataCohesiveTet4Level2::_groupTypes[] = {
- "vertex",
- "vertex",
- "vertex",
- "vertex",
-};
-
-pylith::topology::MeshDataCohesiveTet4Level2::MeshDataCohesiveTet4Level2(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<PylithScalar*>(_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::MeshDataCohesiveTet4Level2::~MeshDataCohesiveTet4Level2(void)
-{}
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTet4Level2.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTet4Level2.hh 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTet4Level2.hh 2013-07-26 22:13:24 UTC (rev 22685)
@@ -1,73 +0,0 @@
-// -*- 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-2013 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ======================================================================
-//
-
-#if !defined(pylith_topology_meshdatacohesivetet4level2_hh)
-#define pylith_topology_meshdatacohesivetet4level2_hh
-
-#include "MeshDataCohesive.hh"
-
-namespace pylith {
- namespace topology {
- class MeshDataCohesiveTet4Level2;
- } // pylith
-} // topology
-
-class pylith::topology::MeshDataCohesiveTet4Level2 : public MeshDataCohesive
-{ // MeshDataCohesiveTet4Level2
-
-// PUBLIC METHODS ///////////////////////////////////////////////////////
-public:
-
- /// Constructor
- MeshDataCohesiveTet4Level2(void);
-
- /// Destructor
- ~MeshDataCohesiveTet4Level2(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 PylithScalar _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
-
-}; // MeshDataCohesiveTet4Level2
-
-#endif // pylith_topology_meshdatacohesivetet4level2_hh
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTet4Level2Fault1.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTet4Level2Fault1.cc 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTet4Level2Fault1.cc 2013-07-26 22:13:24 UTC (rev 22685)
@@ -1,158 +0,0 @@
-// -*- 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-2013 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ======================================================================
-//
-
-#include "MeshDataCohesiveTet4Level2Fault1.hh"
-
-const char* pylith::topology::MeshDataCohesiveTet4Level2Fault1::_filename =
- "data/twotet4.mesh";
-
-const int pylith::topology::MeshDataCohesiveTet4Level2Fault1::_refineLevel = 2;
-const char* pylith::topology::MeshDataCohesiveTet4Level2Fault1::_faultA =
- "fault";
-const char* pylith::topology::MeshDataCohesiveTet4Level2Fault1::_faultB = 0;
-
-const int pylith::topology::MeshDataCohesiveTet4Level2Fault1::_numVertices = 26;
-
-const int pylith::topology::MeshDataCohesiveTet4Level2Fault1::_spaceDim = 3;
-
-const int pylith::topology::MeshDataCohesiveTet4Level2Fault1::_numCells = 16;
-
-const int pylith::topology::MeshDataCohesiveTet4Level2Fault1::_numCellsCohesive = 4;
-
-const int pylith::topology::MeshDataCohesiveTet4Level2Fault1::_cellDim = 3;
-
-const int pylith::topology::MeshDataCohesiveTet4Level2Fault1::_numCorners = 4;
-
-const int pylith::topology::MeshDataCohesiveTet4Level2Fault1::_numCornersCohesive = 9;
-
-const PylithScalar pylith::topology::MeshDataCohesiveTet4Level2Fault1::_vertices[] = {
- -1.0, 0.0, 0.0,
- 0.0, -1.0, 0.0,
- 0.0, 0.0, 1.0,
- 0.0, 1.0, 0.0,
- 1.0, 0.0, 0.0,
- 0.0, -1.0, 0.0,
- 0.0, 0.0, 1.0,
- 0.0, 1.0, 0.0,
- 0.0, -0.5, 0.5,
- 0.0, 0.5, 0.5,
- 0.0, 0.0, 0.0,
- -0.5, -0.5, 0.0,
- -0.5, 0.0, 0.5,
- -0.5, 0.5, 0.0,
- 0.0, 0.0, 0.0,
- 0.0, 0.5, 0.5,
- 0.0, -0.5, 0.5,
- 0.5, -0.5, 0.0,
- 0.5, 0.5, 0.0,
- 0.5, 0.0, 0.5,
- 0.0, -1.0, 0.0,
- 0.0, 0.0, 1.0,
- 0.0, 1.0, 0.0,
- 0.0, -0.5, 0.5,
- 0.0, 0.0, 0.0,
- 0.0, 0.5, 0.5,
-};
-
-const int pylith::topology::MeshDataCohesiveTet4Level2Fault1::_cells[] = {
- 17, 27, 24, 26,
- 24, 25, 26, 27,
- 24, 27, 28, 25,
- 18, 28, 25, 24,
- 26, 29, 27, 25,
- 19, 29, 26, 25,
- 25, 28, 29, 27,
- 16, 27, 29, 28,
- 21, 33, 30, 32,
- 30, 31, 32, 33,
- 30, 33, 34, 31,
- 23, 34, 31, 30,
- 32, 35, 33, 31,
- 22, 35, 32, 31,
- 31, 34, 35, 33,
- 20, 33, 35, 34,
-};
-const int pylith::topology::MeshDataCohesiveTet4Level2Fault1::_cellsCohesive[] = {
- 18, 24, 25, 22, 32, 31, 37, 39, 41,
- 24, 26, 25, 32, 30, 31, 39, 40, 41,
- 17, 26, 24, 21, 30, 32, 36, 40, 39,
- 19, 25, 26, 23, 31, 30, 38, 41, 40,
-};
-const int pylith::topology::MeshDataCohesiveTet4Level2Fault1::_materialIds[] = {
- 1, 1, 1, 1, 1, 1, 1, 1,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 100, 100, 100, 100,
-};
-
-const int pylith::topology::MeshDataCohesiveTet4Level2Fault1::_numGroups = 4;
-
-const int pylith::topology::MeshDataCohesiveTet4Level2Fault1::_groupSizes[] = {
- 4, 4, 2, 18,
-};
-
-const int pylith::topology::MeshDataCohesiveTet4Level2Fault1::_groups[] = {
- 16, 17, 21, 27,
- 18, 20, 22, 35,
- 16, 20,
- 17, 18, 19, 21, 22, 23, 24, 25, 26, 30, 31, 32, 36, 37, 38, 39, 40, 41,
-};
-
-const char* pylith::topology::MeshDataCohesiveTet4Level2Fault1::_groupNames[] = {
- "edge 1",
- "edge 2",
- "end points",
- "fault",
-};
-
-const char* pylith::topology::MeshDataCohesiveTet4Level2Fault1::_groupTypes[] = {
- "vertex",
- "vertex",
- "vertex",
- "vertex",
-};
-
-pylith::topology::MeshDataCohesiveTet4Level2Fault1::MeshDataCohesiveTet4Level2Fault1(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<PylithScalar*>(_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::MeshDataCohesiveTet4Level2Fault1::~MeshDataCohesiveTet4Level2Fault1(void)
-{}
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTet4Level2Fault1.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTet4Level2Fault1.hh 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTet4Level2Fault1.hh 2013-07-26 22:13:24 UTC (rev 22685)
@@ -1,73 +0,0 @@
-// -*- 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-2013 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ======================================================================
-//
-
-#if !defined(pylith_topology_meshdatacohesivetet4level2fault1_hh)
-#define pylith_topology_meshdatacohesivetet4level2fault1_hh
-
-#include "MeshDataCohesive.hh"
-
-namespace pylith {
- namespace topology {
- class MeshDataCohesiveTet4Level2Fault1;
- } // pylith
-} // topology
-
-class pylith::topology::MeshDataCohesiveTet4Level2Fault1 : public MeshDataCohesive
-{ // MeshDataCohesiveTet4Level2Fault1
-
-// PUBLIC METHODS ///////////////////////////////////////////////////////
-public:
-
- /// Constructor
- MeshDataCohesiveTet4Level2Fault1(void);
-
- /// Destructor
- ~MeshDataCohesiveTet4Level2Fault1(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 PylithScalar _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
-
-}; // MeshDataCohesiveTet4Level2Fault1
-
-#endif // pylith_topology_meshdatacohesivetet4level2fault1_hh
-
-// End of file
Copied: short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTri3Level1.cc (from rev 22647, short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTri3Level2.cc)
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTri3Level1.cc (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTri3Level1.cc 2013-07-26 22:13:24 UTC (rev 22685)
@@ -0,0 +1,139 @@
+// -*- 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-2013 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#include "MeshDataCohesiveTri3Level1.hh"
+
+const char* pylith::topology::MeshDataCohesiveTri3Level1::_filename =
+ "data/fourtri3.mesh";
+
+const int pylith::topology::MeshDataCohesiveTri3Level1::_refineLevel = 2;
+const char* pylith::topology::MeshDataCohesiveTri3Level1::_faultA = 0;
+const char* pylith::topology::MeshDataCohesiveTri3Level1::_faultB = 0;
+
+const int pylith::topology::MeshDataCohesiveTri3Level1::_numVertices = 13;
+
+const int pylith::topology::MeshDataCohesiveTri3Level1::_spaceDim = 2;
+
+const int pylith::topology::MeshDataCohesiveTri3Level1::_numCells = 16;
+
+const int pylith::topology::MeshDataCohesiveTri3Level1::_numCellsCohesive = 0;
+
+const int pylith::topology::MeshDataCohesiveTri3Level1::_cellDim = 2;
+
+const int pylith::topology::MeshDataCohesiveTri3Level1::_numCorners = 3;
+
+const int pylith::topology::MeshDataCohesiveTri3Level1::_numCornersCohesive = 6;
+
+const PylithScalar pylith::topology::MeshDataCohesiveTri3Level1::_vertices[] = {
+ -1.0, 0.0,
+ 0.0, -1.0,
+ 0.0, 0.0,
+ 0.0, 1.0,
+ 1.0, 0.0,
+ -0.5, -0.5,
+ 0.0, -0.5,
+ -0.5, 0.0,
+ 0.0, 0.5,
+ -0.5, 0.5,
+ 0.5, -0.5,
+ 0.5, 0.0,
+ 0.5, 0.5,
+};
+
+const int pylith::topology::MeshDataCohesiveTri3Level1::_cells[] = {
+ 16, 21, 23,
+ 21, 22, 23,
+ 17, 22, 21,
+ 18, 23, 22,
+ 18, 24, 23,
+ 24, 25, 23,
+ 19, 25, 24,
+ 16, 23, 25,
+ 18, 22, 27,
+ 22, 26, 27,
+ 17, 26, 22,
+ 20, 27, 26,
+ 18, 27, 24,
+ 27, 28, 24,
+ 20, 28, 27,
+ 19, 24, 28,
+};
+const int pylith::topology::MeshDataCohesiveTri3Level1::_cellsCohesive[] = {
+};
+const int pylith::topology::MeshDataCohesiveTri3Level1::_materialIds[] = {
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+};
+
+const int pylith::topology::MeshDataCohesiveTri3Level1::_numGroups = 4;
+
+const int pylith::topology::MeshDataCohesiveTri3Level1::_groupSizes[] = {
+ 5, 3, 2, 5,
+};
+
+const int pylith::topology::MeshDataCohesiveTri3Level1::_groups[] = {
+ 16, 17, 19, 21, 25,
+ 17, 20, 26,
+ 16, 20,
+ 17, 18, 19, 22, 24,
+};
+
+const char* pylith::topology::MeshDataCohesiveTri3Level1::_groupNames[] = {
+ "edge 1",
+ "edge 2",
+ "end points",
+ "fault",
+};
+
+const char* pylith::topology::MeshDataCohesiveTri3Level1::_groupTypes[] = {
+ "vertex",
+ "vertex",
+ "vertex",
+ "vertex",
+};
+
+pylith::topology::MeshDataCohesiveTri3Level1::MeshDataCohesiveTri3Level1(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<PylithScalar*>(_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::MeshDataCohesiveTri3Level1::~MeshDataCohesiveTri3Level1(void)
+{}
+
+
+// End of file
Copied: short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTri3Level1.hh (from rev 22647, short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTri3Level2.hh)
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTri3Level1.hh (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTri3Level1.hh 2013-07-26 22:13:24 UTC (rev 22685)
@@ -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-2013 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#if !defined(pylith_topology_meshdatacohesivetri3level1_hh)
+#define pylith_topology_meshdatacohesivetri3level1_hh
+
+#include "MeshDataCohesive.hh"
+
+namespace pylith {
+ namespace topology {
+ class MeshDataCohesiveTri3Level1;
+ } // pylith
+} // topology
+
+class pylith::topology::MeshDataCohesiveTri3Level1 : public MeshDataCohesive
+{ // MeshDataCohesiveTri3Level1
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public:
+
+ /// Constructor
+ MeshDataCohesiveTri3Level1(void);
+
+ /// Destructor
+ ~MeshDataCohesiveTri3Level1(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 PylithScalar _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
+
+}; // MeshDataCohesiveTri3Level1
+
+#endif // pylith_topology_meshdatacohesivetri3level1_hh
+
+// End of file
Copied: short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTri3Level1Fault1.cc (from rev 22647, short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTri3Level2Fault1.cc)
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTri3Level1Fault1.cc (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTri3Level1Fault1.cc 2013-07-26 22:13:24 UTC (rev 22685)
@@ -0,0 +1,155 @@
+// -*- 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-2013 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#include "MeshDataCohesiveTri3Level1Fault1.hh"
+
+const char* pylith::topology::MeshDataCohesiveTri3Level1Fault1::_filename =
+ "data/fourtri3.mesh";
+
+const int pylith::topology::MeshDataCohesiveTri3Level1Fault1::_refineLevel = 2;
+const char* pylith::topology::MeshDataCohesiveTri3Level1Fault1::_faultA =
+ "fault";
+const char* pylith::topology::MeshDataCohesiveTri3Level1Fault1::_faultB = 0;
+
+const int pylith::topology::MeshDataCohesiveTri3Level1Fault1::_numVertices = 23;
+
+const int pylith::topology::MeshDataCohesiveTri3Level1Fault1::_spaceDim = 2;
+
+const int pylith::topology::MeshDataCohesiveTri3Level1Fault1::_numCells = 16;
+
+const int pylith::topology::MeshDataCohesiveTri3Level1Fault1::_numCellsCohesive = 4;
+
+const int pylith::topology::MeshDataCohesiveTri3Level1Fault1::_cellDim = 2;
+
+const int pylith::topology::MeshDataCohesiveTri3Level1Fault1::_numCorners = 3;
+
+const int pylith::topology::MeshDataCohesiveTri3Level1Fault1::_numCornersCohesive = 6;
+
+const PylithScalar pylith::topology::MeshDataCohesiveTri3Level1Fault1::_vertices[] = {
+ -1.0, 0.0,
+ 0.0, -1.0,
+ 0.0, 0.0,
+ 0.0, 1.0,
+ 1.0, 0.0,
+ 0.0, -1.0,
+ 0.0, 0.0,
+ 0.0, 1.0,
+ -0.5, -0.5,
+ 0.0, -0.5,
+ -0.5, 0.0,
+ 0.0, 0.5,
+ -0.5, 0.5,
+ 0.0, -0.5,
+ 0.5, -0.5,
+ 0.5, 0.0,
+ 0.5, 0.5,
+ 0.0, 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::MeshDataCohesiveTri3Level1Fault1::_cells[] = {
+ 16, 24, 26,
+ 24, 25, 26,
+ 17, 25, 24,
+ 18, 26, 25,
+ 18, 27, 26,
+ 27, 28, 26,
+ 19, 28, 27,
+ 16, 26, 28,
+ 22, 29, 31,
+ 29, 30, 31,
+ 21, 30, 29,
+ 20, 31, 30,
+ 22, 31, 33,
+ 31, 32, 33,
+ 20, 32, 31,
+ 23, 33, 32,
+};
+const int pylith::topology::MeshDataCohesiveTri3Level1Fault1::_cellsCohesive[] = {
+ 17, 25, 21, 29, 34, 37,
+ 25, 18, 29, 22, 37, 35,
+ 18, 27, 22, 33, 35, 38,
+ 27, 19, 33, 23, 38, 36,
+};
+const int pylith::topology::MeshDataCohesiveTri3Level1Fault1::_materialIds[] = {
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 100, 100, 100, 100,
+};
+
+const int pylith::topology::MeshDataCohesiveTri3Level1Fault1::_numGroups = 4;
+
+const int pylith::topology::MeshDataCohesiveTri3Level1Fault1::_groupSizes[] = {
+ 7, 4, 2, 15,
+};
+
+const int pylith::topology::MeshDataCohesiveTri3Level1Fault1::_groups[] = {
+ 16, 17, 19, 21, 23, 24, 28,
+ 17, 20, 21, 30,
+ 16, 20,
+ 17, 18, 19, 21, 22, 23, 25, 27, 29, 33, 34, 35, 36, 37, 38,
+};
+
+const char* pylith::topology::MeshDataCohesiveTri3Level1Fault1::_groupNames[] = {
+ "edge 1",
+ "edge 2",
+ "end points",
+ "fault",
+};
+
+const char* pylith::topology::MeshDataCohesiveTri3Level1Fault1::_groupTypes[] = {
+ "vertex",
+ "vertex",
+ "vertex",
+ "vertex",
+};
+
+pylith::topology::MeshDataCohesiveTri3Level1Fault1::MeshDataCohesiveTri3Level1Fault1(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<PylithScalar*>(_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::MeshDataCohesiveTri3Level1Fault1::~MeshDataCohesiveTri3Level1Fault1(void)
+{}
+
+
+// End of file
Copied: short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTri3Level1Fault1.hh (from rev 22647, short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTri3Level2Fault1.hh)
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTri3Level1Fault1.hh (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTri3Level1Fault1.hh 2013-07-26 22:13:24 UTC (rev 22685)
@@ -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-2013 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#if !defined(pylith_topology_meshdatacohesivetri3level1fault1_hh)
+#define pylith_topology_meshdatacohesivetri3level1fault1_hh
+
+#include "MeshDataCohesive.hh"
+
+namespace pylith {
+ namespace topology {
+ class MeshDataCohesiveTri3Level1Fault1;
+ } // pylith
+} // topology
+
+class pylith::topology::MeshDataCohesiveTri3Level1Fault1 : public MeshDataCohesive
+{ // MeshDataCohesiveTri3Level1Fault1
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public:
+
+ /// Constructor
+ MeshDataCohesiveTri3Level1Fault1(void);
+
+ /// Destructor
+ ~MeshDataCohesiveTri3Level1Fault1(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 PylithScalar _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
+
+}; // MeshDataCohesiveTri3Level1Fault1
+
+#endif // pylith_topology_meshdatacohesivetri3level1fault1_hh
+
+// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTri3Level2.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTri3Level2.cc 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTri3Level2.cc 2013-07-26 22:13:24 UTC (rev 22685)
@@ -1,139 +0,0 @@
-// -*- 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-2013 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ======================================================================
-//
-
-#include "MeshDataCohesiveTri3Level2.hh"
-
-const char* pylith::topology::MeshDataCohesiveTri3Level2::_filename =
- "data/fourtri3.mesh";
-
-const int pylith::topology::MeshDataCohesiveTri3Level2::_refineLevel = 2;
-const char* pylith::topology::MeshDataCohesiveTri3Level2::_faultA = 0;
-const char* pylith::topology::MeshDataCohesiveTri3Level2::_faultB = 0;
-
-const int pylith::topology::MeshDataCohesiveTri3Level2::_numVertices = 13;
-
-const int pylith::topology::MeshDataCohesiveTri3Level2::_spaceDim = 2;
-
-const int pylith::topology::MeshDataCohesiveTri3Level2::_numCells = 16;
-
-const int pylith::topology::MeshDataCohesiveTri3Level2::_numCellsCohesive = 0;
-
-const int pylith::topology::MeshDataCohesiveTri3Level2::_cellDim = 2;
-
-const int pylith::topology::MeshDataCohesiveTri3Level2::_numCorners = 3;
-
-const int pylith::topology::MeshDataCohesiveTri3Level2::_numCornersCohesive = 6;
-
-const PylithScalar pylith::topology::MeshDataCohesiveTri3Level2::_vertices[] = {
- -1.0, 0.0,
- 0.0, -1.0,
- 0.0, 0.0,
- 0.0, 1.0,
- 1.0, 0.0,
- -0.5, -0.5,
- 0.0, -0.5,
- -0.5, 0.0,
- 0.0, 0.5,
- -0.5, 0.5,
- 0.5, -0.5,
- 0.5, 0.0,
- 0.5, 0.5,
-};
-
-const int pylith::topology::MeshDataCohesiveTri3Level2::_cells[] = {
- 16, 21, 23,
- 21, 22, 23,
- 17, 22, 21,
- 18, 23, 22,
- 18, 24, 23,
- 24, 25, 23,
- 19, 25, 24,
- 16, 23, 25,
- 18, 22, 27,
- 22, 26, 27,
- 17, 26, 22,
- 20, 27, 26,
- 18, 27, 24,
- 27, 28, 24,
- 20, 28, 27,
- 19, 24, 28,
-};
-const int pylith::topology::MeshDataCohesiveTri3Level2::_cellsCohesive[] = {
-};
-const int pylith::topology::MeshDataCohesiveTri3Level2::_materialIds[] = {
- 1, 1, 1, 1, 1, 1, 1, 1,
- 2, 2, 2, 2, 2, 2, 2, 2,
-};
-
-const int pylith::topology::MeshDataCohesiveTri3Level2::_numGroups = 4;
-
-const int pylith::topology::MeshDataCohesiveTri3Level2::_groupSizes[] = {
- 5, 3, 2, 5,
-};
-
-const int pylith::topology::MeshDataCohesiveTri3Level2::_groups[] = {
- 16, 17, 19, 21, 25,
- 17, 20, 26,
- 16, 20,
- 17, 18, 19, 22, 24,
-};
-
-const char* pylith::topology::MeshDataCohesiveTri3Level2::_groupNames[] = {
- "edge 1",
- "edge 2",
- "end points",
- "fault",
-};
-
-const char* pylith::topology::MeshDataCohesiveTri3Level2::_groupTypes[] = {
- "vertex",
- "vertex",
- "vertex",
- "vertex",
-};
-
-pylith::topology::MeshDataCohesiveTri3Level2::MeshDataCohesiveTri3Level2(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<PylithScalar*>(_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::MeshDataCohesiveTri3Level2::~MeshDataCohesiveTri3Level2(void)
-{}
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTri3Level2.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTri3Level2.hh 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTri3Level2.hh 2013-07-26 22:13:24 UTC (rev 22685)
@@ -1,73 +0,0 @@
-// -*- 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-2013 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ======================================================================
-//
-
-#if !defined(pylith_topology_meshdatacohesivetri3level2_hh)
-#define pylith_topology_meshdatacohesivetri3level2_hh
-
-#include "MeshDataCohesive.hh"
-
-namespace pylith {
- namespace topology {
- class MeshDataCohesiveTri3Level2;
- } // pylith
-} // topology
-
-class pylith::topology::MeshDataCohesiveTri3Level2 : public MeshDataCohesive
-{ // MeshDataCohesiveTri3Level2
-
-// PUBLIC METHODS ///////////////////////////////////////////////////////
-public:
-
- /// Constructor
- MeshDataCohesiveTri3Level2(void);
-
- /// Destructor
- ~MeshDataCohesiveTri3Level2(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 PylithScalar _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
-
-}; // MeshDataCohesiveTri3Level2
-
-#endif // pylith_topology_meshdatacohesivetri3level2_hh
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTri3Level2Fault1.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTri3Level2Fault1.cc 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTri3Level2Fault1.cc 2013-07-26 22:13:24 UTC (rev 22685)
@@ -1,155 +0,0 @@
-// -*- 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-2013 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ======================================================================
-//
-
-#include "MeshDataCohesiveTri3Level2Fault1.hh"
-
-const char* pylith::topology::MeshDataCohesiveTri3Level2Fault1::_filename =
- "data/fourtri3.mesh";
-
-const int pylith::topology::MeshDataCohesiveTri3Level2Fault1::_refineLevel = 2;
-const char* pylith::topology::MeshDataCohesiveTri3Level2Fault1::_faultA =
- "fault";
-const char* pylith::topology::MeshDataCohesiveTri3Level2Fault1::_faultB = 0;
-
-const int pylith::topology::MeshDataCohesiveTri3Level2Fault1::_numVertices = 23;
-
-const int pylith::topology::MeshDataCohesiveTri3Level2Fault1::_spaceDim = 2;
-
-const int pylith::topology::MeshDataCohesiveTri3Level2Fault1::_numCells = 16;
-
-const int pylith::topology::MeshDataCohesiveTri3Level2Fault1::_numCellsCohesive = 4;
-
-const int pylith::topology::MeshDataCohesiveTri3Level2Fault1::_cellDim = 2;
-
-const int pylith::topology::MeshDataCohesiveTri3Level2Fault1::_numCorners = 3;
-
-const int pylith::topology::MeshDataCohesiveTri3Level2Fault1::_numCornersCohesive = 6;
-
-const PylithScalar pylith::topology::MeshDataCohesiveTri3Level2Fault1::_vertices[] = {
- -1.0, 0.0,
- 0.0, -1.0,
- 0.0, 0.0,
- 0.0, 1.0,
- 1.0, 0.0,
- 0.0, -1.0,
- 0.0, 0.0,
- 0.0, 1.0,
- -0.5, -0.5,
- 0.0, -0.5,
- -0.5, 0.0,
- 0.0, 0.5,
- -0.5, 0.5,
- 0.0, -0.5,
- 0.5, -0.5,
- 0.5, 0.0,
- 0.5, 0.5,
- 0.0, 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::MeshDataCohesiveTri3Level2Fault1::_cells[] = {
- 16, 24, 26,
- 24, 25, 26,
- 17, 25, 24,
- 18, 26, 25,
- 18, 27, 26,
- 27, 28, 26,
- 19, 28, 27,
- 16, 26, 28,
- 22, 29, 31,
- 29, 30, 31,
- 21, 30, 29,
- 20, 31, 30,
- 22, 31, 33,
- 31, 32, 33,
- 20, 32, 31,
- 23, 33, 32,
-};
-const int pylith::topology::MeshDataCohesiveTri3Level2Fault1::_cellsCohesive[] = {
- 17, 25, 21, 29, 34, 37,
- 25, 18, 29, 22, 37, 35,
- 18, 27, 22, 33, 35, 38,
- 27, 19, 33, 23, 38, 36,
-};
-const int pylith::topology::MeshDataCohesiveTri3Level2Fault1::_materialIds[] = {
- 1, 1, 1, 1, 1, 1, 1, 1,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 100, 100, 100, 100,
-};
-
-const int pylith::topology::MeshDataCohesiveTri3Level2Fault1::_numGroups = 4;
-
-const int pylith::topology::MeshDataCohesiveTri3Level2Fault1::_groupSizes[] = {
- 7, 4, 2, 15,
-};
-
-const int pylith::topology::MeshDataCohesiveTri3Level2Fault1::_groups[] = {
- 16, 17, 19, 21, 23, 24, 28,
- 17, 20, 21, 30,
- 16, 20,
- 17, 18, 19, 21, 22, 23, 25, 27, 29, 33, 34, 35, 36, 37, 38,
-};
-
-const char* pylith::topology::MeshDataCohesiveTri3Level2Fault1::_groupNames[] = {
- "edge 1",
- "edge 2",
- "end points",
- "fault",
-};
-
-const char* pylith::topology::MeshDataCohesiveTri3Level2Fault1::_groupTypes[] = {
- "vertex",
- "vertex",
- "vertex",
- "vertex",
-};
-
-pylith::topology::MeshDataCohesiveTri3Level2Fault1::MeshDataCohesiveTri3Level2Fault1(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<PylithScalar*>(_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::MeshDataCohesiveTri3Level2Fault1::~MeshDataCohesiveTri3Level2Fault1(void)
-{}
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTri3Level2Fault1.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTri3Level2Fault1.hh 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/data/MeshDataCohesiveTri3Level2Fault1.hh 2013-07-26 22:13:24 UTC (rev 22685)
@@ -1,73 +0,0 @@
-// -*- 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-2013 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ======================================================================
-//
-
-#if !defined(pylith_topology_meshdatacohesivetri3level2fault1_hh)
-#define pylith_topology_meshdatacohesivetri3level2fault1_hh
-
-#include "MeshDataCohesive.hh"
-
-namespace pylith {
- namespace topology {
- class MeshDataCohesiveTri3Level2Fault1;
- } // pylith
-} // topology
-
-class pylith::topology::MeshDataCohesiveTri3Level2Fault1 : public MeshDataCohesive
-{ // MeshDataCohesiveTri3Level2Fault1
-
-// PUBLIC METHODS ///////////////////////////////////////////////////////
-public:
-
- /// Constructor
- MeshDataCohesiveTri3Level2Fault1(void);
-
- /// Destructor
- ~MeshDataCohesiveTri3Level2Fault1(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 PylithScalar _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
-
-}; // MeshDataCohesiveTri3Level2Fault1
-
-#endif // pylith_topology_meshdatacohesivetri3level2fault1_hh
-
-// End of file
Modified: short/3D/PyLith/trunk/unittests/libtests/topology/test_topology.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/test_topology.cc 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/test_topology.cc 2013-07-26 22:13:24 UTC (rev 22685)
@@ -32,7 +32,7 @@
#include <stdlib.h> // USES abort()
-#define MALLOC_DUMP
+//#define MALLOC_DUMP
int
main(int argc,
Modified: short/3D/PyLith/trunk/unittests/pytests/topology/TestRefineUniform.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/topology/TestRefineUniform.py 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/unittests/pytests/topology/TestRefineUniform.py 2013-07-26 22:13:24 UTC (rev 22685)
@@ -24,8 +24,6 @@
from pylith.topology.RefineUniform import RefineUniform
-from pylith.topology.RefineUniform import RefineUniform
-
# ----------------------------------------------------------------------
class TestRefineUniform(unittest.TestCase):
"""
Modified: short/3D/PyLith/trunk/unittests/pytests/topology/testtopology.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/topology/testtopology.py 2013-07-26 01:21:51 UTC (rev 22684)
+++ short/3D/PyLith/trunk/unittests/pytests/topology/testtopology.py 2013-07-26 22:13:24 UTC (rev 22685)
@@ -90,9 +90,9 @@
from TestMeshImporter import TestMeshImporter
suite.addTest(unittest.makeSuite(TestMeshImporter))
- print "WARNING: TestRefineUniform NOT IMPLEMENTED"
- #from TestRefineUniform import TestRefineUniform
- #suite.addTest(unittest.makeSuite(TestRefineUniform))
+ #print "WARNING: TestRefineUniform NOT IMPLEMENTED"
+ from TestRefineUniform import TestRefineUniform
+ suite.addTest(unittest.makeSuite(TestRefineUniform))
return suite
More information about the CIG-COMMITS
mailing list