[cig-commits] r7719 - in short/3D/PyLith/trunk: . libsrc libsrc/bc
libsrc/faults libsrc/feassemble modulesrc/feassemble
pylith/feassemble/quadrature unittests/libtests/faults
unittests/libtests/feassemble unittests/libtests/materials
brad at geodynamics.org
brad at geodynamics.org
Thu Jul 19 16:05:01 PDT 2007
Author: brad
Date: 2007-07-19 16:05:00 -0700 (Thu, 19 Jul 2007)
New Revision: 7719
Modified:
short/3D/PyLith/trunk/TODO
short/3D/PyLith/trunk/libsrc/Makefile.am
short/3D/PyLith/trunk/libsrc/bc/AbsorbingDampers.cc
short/3D/PyLith/trunk/libsrc/bc/AbsorbingDampers.hh
short/3D/PyLith/trunk/libsrc/bc/Makefile.am
short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc
short/3D/PyLith/trunk/libsrc/feassemble/CellGeometry.cc
short/3D/PyLith/trunk/libsrc/feassemble/CellGeometry.hh
short/3D/PyLith/trunk/libsrc/feassemble/CellGeometry.icc
short/3D/PyLith/trunk/libsrc/feassemble/GeometryHex3D.cc
short/3D/PyLith/trunk/libsrc/feassemble/GeometryHex3D.hh
short/3D/PyLith/trunk/libsrc/feassemble/GeometryLine1D.cc
short/3D/PyLith/trunk/libsrc/feassemble/GeometryLine1D.hh
short/3D/PyLith/trunk/libsrc/feassemble/GeometryLine2D.cc
short/3D/PyLith/trunk/libsrc/feassemble/GeometryLine2D.hh
short/3D/PyLith/trunk/libsrc/feassemble/GeometryLine3D.cc
short/3D/PyLith/trunk/libsrc/feassemble/GeometryLine3D.hh
short/3D/PyLith/trunk/libsrc/feassemble/GeometryPoint1D.cc
short/3D/PyLith/trunk/libsrc/feassemble/GeometryPoint1D.hh
short/3D/PyLith/trunk/libsrc/feassemble/GeometryPoint2D.cc
short/3D/PyLith/trunk/libsrc/feassemble/GeometryPoint2D.hh
short/3D/PyLith/trunk/libsrc/feassemble/GeometryPoint3D.cc
short/3D/PyLith/trunk/libsrc/feassemble/GeometryPoint3D.hh
short/3D/PyLith/trunk/libsrc/feassemble/GeometryQuad2D.cc
short/3D/PyLith/trunk/libsrc/feassemble/GeometryQuad2D.hh
short/3D/PyLith/trunk/libsrc/feassemble/GeometryQuad3D.cc
short/3D/PyLith/trunk/libsrc/feassemble/GeometryQuad3D.hh
short/3D/PyLith/trunk/libsrc/feassemble/GeometryTet3D.cc
short/3D/PyLith/trunk/libsrc/feassemble/GeometryTet3D.hh
short/3D/PyLith/trunk/libsrc/feassemble/GeometryTri2D.cc
short/3D/PyLith/trunk/libsrc/feassemble/GeometryTri2D.hh
short/3D/PyLith/trunk/libsrc/feassemble/GeometryTri3D.cc
short/3D/PyLith/trunk/libsrc/feassemble/GeometryTri3D.hh
short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.cc
short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.hh
short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.icc
short/3D/PyLith/trunk/modulesrc/feassemble/feassemble.pyxe.src
short/3D/PyLith/trunk/pylith/feassemble/quadrature/Quadrature.py
short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc
short/3D/PyLith/trunk/unittests/libtests/feassemble/TestCellGeometry.cc
short/3D/PyLith/trunk/unittests/libtests/feassemble/TestCellGeometry.hh
short/3D/PyLith/trunk/unittests/libtests/feassemble/TestElasticityExplicit.cc
short/3D/PyLith/trunk/unittests/libtests/feassemble/TestElasticityImplicit.cc
short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegrator.cc
short/3D/PyLith/trunk/unittests/libtests/feassemble/TestQuadrature.cc
short/3D/PyLith/trunk/unittests/libtests/feassemble/TestQuadrature0D.cc
short/3D/PyLith/trunk/unittests/libtests/materials/TestMaterial.cc
Log:
Moved coordinates of vertices in reference cell from Quadrature to CellGeometry. All cell geometry information is now in CellGeometry. Worked on AbsorbingDampers::initialize(). Need to cleanup code that currently uses Quadrature::numBasis() when it should be using CellGeometry::numCorners().
Modified: short/3D/PyLith/trunk/TODO
===================================================================
--- short/3D/PyLith/trunk/TODO 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/TODO 2007-07-19 23:05:00 UTC (rev 7719)
@@ -2,8 +2,6 @@
CURRENT ISSUES
======================================================================
- 0. add shape to Quadrature
-
1. Memory analyzing.
Matt is working on buildTopology(), stratify(), restrict(), and
Modified: short/3D/PyLith/trunk/libsrc/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/libsrc/Makefile.am 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/libsrc/Makefile.am 2007-07-19 23:05:00 UTC (rev 7719)
@@ -22,6 +22,7 @@
lib_LTLIBRARIES = libpylith.la
libpylith_la_SOURCES = \
+ bc/AbsorbingDampers.cc \
bc/BoundaryCondition.cc \
bc/Dirichlet.cc \
faults/BruneSlipFn.cc \
Modified: short/3D/PyLith/trunk/libsrc/bc/AbsorbingDampers.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/bc/AbsorbingDampers.cc 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/libsrc/bc/AbsorbingDampers.cc 2007-07-19 23:05:00 UTC (rev 7719)
@@ -14,9 +14,14 @@
#include "AbsorbingDampers.hh" // implementation of object methods
+#include "pylith/feassemble/Quadrature.hh" // USES Quadrature
+#include "pylith/feassemble/CellGeometry.hh" // USES CellGeometry
+
#include "spatialdata/spatialdb/SpatialDB.hh" // USES SpatialDB
#include "spatialdata/geocoords/CoordSys.hh" // USES CoordSys
+#include <Selection.hh> // USES submesh algorithms
+
#include <assert.h> // USES assert()
#include <stdexcept> // USES std::runtime_error
#include <sstream> // USES std::ostringstream
@@ -39,7 +44,7 @@
void
pylith::bc::AbsorbingDampers::initialize(const ALE::Obj<ALE::Mesh>& mesh,
const spatialdata::geocoords::CoordSys* cs,
- const double_array& upDir);
+ const double_array& upDir)
{ // initialize
assert(0 != _quadrature);
assert(0 != _db);
@@ -60,48 +65,125 @@
throw std::runtime_error(msg.str());
} // if
+ // check compatibility of quadrature and boundary mesh
+ if (_quadrature->cellDim() != boundaryMesh->getDimension()) {
+ std::ostringstream msg;
+ msg << "Quadrature is incompatible with cells for absorbing boundary "
+ << "condition '" << _label << "'.\n"
+ << "Dimension of boundary mesh: " << boundaryMesh->getDimension()
+ << ", dimension of quadrature: " << _quadrature->cellDim()
+ << ".";
+ throw std::runtime_error(msg.str());
+ } // if
+ const int numCorners = _quadrature->numBasis();
+
// Get 'surface' cells (1 dimension lower than top-level cells)
- const ALE::Obj<sieve_type>& sieve = boundaryMesh->getSieve();
- const ALE::Obj<Mesh::label_sequence>& cells = boundaryMesh->heightStratum(1);
+ const ALE::Obj<ALE::Mesh::label_sequence>& cells =
+ boundaryMesh->heightStratum(1);
+ assert(!cells.isNull());
+ const Mesh::label_sequence::iterator cellsBegin = cells->begin();
+ const Mesh::label_sequence::iterator cellsEnd = cells->end();
+ const ALE::Obj<sieve_type>& sieve = mesh->getSieve();
+ assert(!sieve.isNull());
+ for (Mesh::label_sequence::iterator c_iter=cellsBegin;
+ c_iter != cellsEnd;
+ ++c_iter) {
+ const int cellNumCorners = sieve->nCone(*c_iter, mesh->depth())->size();
+ if (numCorners != cellNumCorners) {
+ std::ostringstream msg;
+ msg << "Quadrature is incompatible with cell for absorbing boundary "
+ << "condition '" << _label << "'.\n"
+ << "Cell " << *c_iter << " has " << cellNumCorners
+ << " vertices but quadrature reference cell has "
+ << numCorners << " vertices.";
+ throw std::runtime_error(msg.str());
+ } // if
+ } // for
- // Get damping constants at each quadrature point
+ // Get damping constants at each quadrature point and rotate to
+ // global coordinate frame using orientation information
+ const int cellDim = _quadrature->cellDim();
+ const int numBasis = _quadrature->numBasis();
+ const int numQuadPts = _quadrature->numQuadPts();
const int spaceDim = cs->spaceDim();
- const int numQuadPts = _quadrature->numQuadPts();
const int fiberDim = spaceDim * numQuadPts;
_dampingConsts = new real_section_type(mesh->comm(), mesh->debug());
assert(!_dampingConsts.isNull());
_dampingConsts->setFiberDimension(cells, fiberDim);
- _dampingConsts->allocate();
+ mesh->allocate(_dampingConsts);
- const int numBasis = _quadrature->numBasis();
+ // Containers for orientation information
+ const int orientationSize = spaceDim*spaceDim;
const feassemble::CellGeometry& cellGeometry = _quadrature->refGeometry();
- const double_array& verticesRef = _quadrature->vertices();
const int jacobianSize = (cellDim > 0) ? spaceDim * cellDim : 1;
double_array jacobian(jacobianSize);
double jacobianDet = 0;
+ double_array orientation(orientationSize);
double_array cellVertices(numBasis*spaceDim);
- // Set up orientation information
- const int orientationSize = spaceDim * spaceDim;
- double orientation[orientationSize];
+ // open database with material property information
+ _db->open();
+ int numValues = 0;
+ if (cellDim > 1) {
+ numValues = 3;
+ const char* valueNames[] = { "density", "vp", "vs" };
+ _db->queryVals(valueNames, numValues);
+ } else {
+ numValues = 2;
+ const char* valueNames[] = { "density", "vp" };
+ _db->queryVals(valueNames, numValues);
+ } // else
+
+ // Container for data returned in query of database
+ double_array queryData(numValues);
+ double_array quadPtRef(spaceDim);
+
+ // Container for damping constants for current cell
+ double_array dampingConstsLocal(fiberDim);
+ double_array dampingConstsGlobal(fiberDim);
+
const ALE::Obj<real_section_type>& coordinates =
mesh->getRealSection("coordinates");
- // open database with material property information
- _db->open();
- const char* valuesNames =
- (cellDim > 0) ? { "vp", "vs", "density" } : { "vp", "density" };
- const int numValues = (cellDim > 0) ? 3 : 2;
- _db->queryVals((const char**) valueNames, numValues);
-
- const Mesh::label_sequence::iterator cellsBegin = cells->begin();
- const Mesh::label_sequence::iterator cellsEnd = cells->end();
for(Mesh::label_sequence::iterator c_iter = cells->begin();
c_iter != cells->end();
++c_iter) {
_quadrature->computeGeometry(mesh, coordinates, *c_iter);
- for(int iQuad = 0; iQuad < numQuadPts; ++iQuad) {
+ const double_array& quadPts = _quadrature->quadPts();
+ const double_array& quadPtsRef = _quadrature->quadPtsRef();
+
+ for(int iQuad = 0, index=0; iQuad < numQuadPts; ++iQuad, index+=spaceDim) {
+ // Compute damping constants in normal/tangential coordinates
+ const int err = _db->query(&queryData[0], numValues,
+ &quadPts[index], spaceDim, cs);
+ if (err) {
+ std::ostringstream msg;
+ msg << "Could not find parameters for physical properties at \n"
+ << "(";
+ for (int i=0; i < spaceDim; ++i)
+ msg << " " << quadPts[index+spaceDim];
+ msg << ") for absorbing boundary condition " << _label << "\n"
+ << "using spatial database " << _db->label() << ".";
+ throw std::runtime_error(msg.str());
+ } // if
+ dampingConstsLocal[index ] = queryData[0]*queryData[1];
+ for (int iDim=1; iDim < spaceDim; ++iDim)
+ dampingConstsLocal[index+iDim] = queryData[0]*queryData[2];
+
+ // Compute normal/tangential orientation
+ mesh->restrict(coordinates, *c_iter,
+ &cellVertices[0], cellVertices.size());
+ memcpy(&quadPtRef[0], &quadPtsRef[index], spaceDim*sizeof(double));
+ cellGeometry.jacobian(&jacobian, &jacobianDet, cellVertices, quadPtRef);
+ cellGeometry.orientation(&orientation, jacobian, jacobianDet,
+ upDir);
+ dampingConstsGlobal = 0.0;
+ for (int iDim=0; iDim < spaceDim; ++iDim)
+ for (int jDim=0; jDim < spaceDim; ++jDim)
+ dampingConstsGlobal[iDim] +=
+ dampingConstsLocal[jDim]*orientation[iDim*spaceDim+jDim];
} // for
+ mesh->update(_dampingConsts, *c_iter, &dampingConstsGlobal[0]);
} // for
_db->close();
Modified: short/3D/PyLith/trunk/libsrc/bc/AbsorbingDampers.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/bc/AbsorbingDampers.hh 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/libsrc/bc/AbsorbingDampers.hh 2007-07-19 23:05:00 UTC (rev 7719)
@@ -54,6 +54,7 @@
#include "pylith/feassemble/Integrator.hh" // ISA Integrator
#include "pylith/utils/array.hh" // USES std::vector, double_array, int_array
+#include "pylith/utils/sievetypes.hh" // USES real_section_type
/// Namespace for pylith package
namespace pylith {
@@ -129,6 +130,9 @@
// PRIVATE MEMBERS ////////////////////////////////////////////////////
private :
+ /// Damping constants in global coordinates at integration points.
+ ALE::Obj<real_section_type> _dampingConsts;
+
}; // class AbsorbingDampers
#endif // pylith_bc_absorbingdampers_hh
Modified: short/3D/PyLith/trunk/libsrc/bc/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/libsrc/bc/Makefile.am 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/libsrc/bc/Makefile.am 2007-07-19 23:05:00 UTC (rev 7719)
@@ -14,6 +14,7 @@
include $(top_srcdir)/subpackage.am
subpkginclude_HEADERS = \
+ AbsorbingDampers.hh \
BoundaryCondition.hh \
BoundaryCondition.icc \
Dirichlet.hh \
Modified: short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc 2007-07-19 23:05:00 UTC (rev 7719)
@@ -145,7 +145,7 @@
// Loop over cohesive cells, computing orientation at constraint vertices
const int numBasis = _quadrature->numBasis();
const feassemble::CellGeometry& cellGeometry = _quadrature->refGeometry();
- const double_array& verticesRef = _quadrature->vertices();
+ const double_array& verticesRef = cellGeometry.vertices();
const int jacobianSize = (cohesiveDim > 0) ? spaceDim * cohesiveDim : 1;
double_array jacobian(jacobianSize);
double jacobianDet = 0;
Modified: short/3D/PyLith/trunk/libsrc/feassemble/CellGeometry.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/CellGeometry.cc 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/libsrc/feassemble/CellGeometry.cc 2007-07-19 23:05:00 UTC (rev 7719)
@@ -14,37 +14,35 @@
#include "CellGeometry.hh" // implementation of class methods
-#include "pylith/utils/array.hh" // USES double_array
-
#include <iostream> // USES std::cerr
// ----------------------------------------------------------------------
// Default constructor.
-pylith::feassemble::CellGeometry::CellGeometry(const int cellDim,
- const int spaceDim,
- const int numCorners) :
+pylith::feassemble::CellGeometry::CellGeometry(const ShapeEnum shape,
+ const int spaceDim) :
_orientFn(0),
- _cellDim(cellDim),
_spaceDim(spaceDim),
- _numCorners(numCorners)
+ _shape(shape)
{ // constructor
- switch (cellDim)
+ switch (shape)
{ // switch
- case 0 :
+ case POINT :
+ _orientFn = _orient0D;
+ break;
+ case LINE :
_orientFn = _orient1D;
break;
- case 1 :
+ case TRIANGLE :
+ case QUADRILATERAL :
_orientFn = _orient2D;
break;
- case 2 :
- _orientFn = _orient3D;
+ case TETRAHEDRON :
+ case HEXAHEDRON :
break;
- case 3 :
- break;
default:
std::cerr
- << "Could not find orientation function for cell with dimension "
- << cellDim << ".";
+ << "Could not find orientation function for cell with shape "
+ << shape << ".";
assert(0);
} // switch
} // constructor
@@ -59,33 +57,116 @@
// Copy constructor.
pylith::feassemble::CellGeometry::CellGeometry(const CellGeometry& g) :
_orientFn(g._orientFn),
- _cellDim(g._cellDim),
_spaceDim(g._spaceDim),
- _numCorners(g._numCorners)
+ _shape(g._shape)
{ // copy constructor
} // copy constructor
// ----------------------------------------------------------------------
-// Compute weighted orientation of boundary for 1-D cell.
+// Get dimension of cell.
+int
+pylith::feassemble::CellGeometry::cellDim(void) const
+{ // cellDim
+ int dim = 0;
+ switch (_shape)
+ { // switch
+ case POINT :
+ dim = 0;
+ break;
+ case LINE :
+ dim = 1;
+ break;
+ case TRIANGLE :
+ case QUADRILATERAL :
+ dim = 2;
+ break;
+ case TETRAHEDRON :
+ case HEXAHEDRON :
+ dim = 3;
+ break;
+ default:
+ std::cerr
+ << "Could not find dimension of cell with shape " << _shape << ".";
+ assert(0);
+ } // switch
+ return dim;
+} // cellDim
+
+// ----------------------------------------------------------------------
+// Get number of corners in cell.
+int
+pylith::feassemble::CellGeometry::numCorners(void) const
+{ // numCorners
+ int corners = 0;
+ switch (_shape)
+ { // switch
+ case POINT :
+ corners = 1;
+ break;
+ case LINE :
+ corners = 2;
+ break;
+ case TRIANGLE :
+ corners = 3;
+ break;
+ case QUADRILATERAL :
+ corners = 4;
+ break;
+ case TETRAHEDRON :
+ corners = 4;
+ break;
+ case HEXAHEDRON :
+ corners = 8;
+ break;
+ default:
+ std::cerr
+ << "Could not find number of corners for cell with shape "
+ << _shape << ".";
+ assert(0);
+ } // switch
+ return corners;
+} // numCorners
+
+// ----------------------------------------------------------------------
+// Set coordinates of vertices in reference cell.
void
-pylith::feassemble::CellGeometry::_orient1D(double_array* orientation,
+pylith::feassemble::CellGeometry::_setVertices(const double* vertices,
+ const int numVertices,
+ const int dim)
+{ // _setVertices
+ if (POINT != _shape) {
+ assert(numCorners() == numVertices);
+ assert(cellDim() == dim);
+ } else {
+ assert(1 == numVertices);
+ assert(1 == dim);
+ } // if/else
+ const int nbytes = numVertices*dim*sizeof(double);
+ _vertices.resize(numVertices*dim);
+ memcpy(&_vertices[0], vertices, nbytes);
+} // _setVertices
+
+// ----------------------------------------------------------------------
+// Compute orientation of 0-D cell.
+void
+pylith::feassemble::CellGeometry::_orient0D(double_array* orientation,
const double_array& jacobian,
const double jacobianDet,
const double_array& upDir)
-{ // _orient1D
+{ // _orient0D
assert(0 != orientation);
assert(1 == orientation->size());
(*orientation) = 1.0;
-} // _orient1D
+} // _orient0D
// ----------------------------------------------------------------------
-// Compute weighted orientation of boundary for 2-D cell.
+// Compute orientation of 1-D cell.
void
-pylith::feassemble::CellGeometry::_orient2D(double_array* orientation,
+pylith::feassemble::CellGeometry::_orient1D(double_array* orientation,
const double_array& jacobian,
const double jacobianDet,
const double_array& upDir)
-{ // _orient2D
+{ // _orient1D
const int orientSize = 4;
assert(0 != orientation);
assert(orientSize == orientation->size());
@@ -101,16 +182,16 @@
(*orientation)[1] = j2;
(*orientation)[2] = j2;
(*orientation)[3] = -j1;
-} // _orient2D
+} // _orient1D
// ----------------------------------------------------------------------
-// Compute weighted orientation of boundary for 3-D cell.
+// Compute orientation of 2-D cell.
void
-pylith::feassemble::CellGeometry::_orient3D(double_array* orientation,
+pylith::feassemble::CellGeometry::_orient2D(double_array* orientation,
const double_array& jacobian,
const double jacobianDet,
const double_array& upDir)
-{ // _orient3D
+{ // _orient2D
const int orientSize = 9;
assert(0 != orientation);
assert(orientSize == orientation->size());
@@ -167,7 +248,7 @@
(*orientation)[6] = r0*wt;
(*orientation)[7] = r1*wt;
(*orientation)[8] = r2*wt;
-} // _orient3D
+} // _orient2D
// End of file
Modified: short/3D/PyLith/trunk/libsrc/feassemble/CellGeometry.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/CellGeometry.hh 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/libsrc/feassemble/CellGeometry.hh 2007-07-19 23:05:00 UTC (rev 7719)
@@ -19,7 +19,7 @@
#if !defined(pylith_feassemble_cellgeometry_hh)
#define pylith_feassemble_cellgeometry_hh
-#include "pylith/utils/arrayfwd.hh" // USES double_array
+#include "pylith/utils/array.hh" // HASA double_array
namespace pylith {
namespace feassemble {
@@ -33,18 +33,28 @@
{ // CellGeometry
friend class TestCellGeometry; // unit testing
+// PUBLIC ENUMS /////////////////////////////////////////////////////////
+public :
+
+ enum ShapeEnum {
+ POINT=0, // 0-D point cell
+ LINE=2, // 1-D line cell (2 points)
+ TRIANGLE=4, // 2-D triangular cell (3 edges)
+ QUADRILATERAL=5, // 2-D quadrilateral cell (4 edges)
+ TETRAHEDRON=16, // 3-D tetrahedral cell (4 faces)
+ HEXAHEDRON=17 // 3-D hexahedral cell (6 faces)
+ };
+
// PUBLIC METHODS ///////////////////////////////////////////////////////
public :
/** Default constructor.
*
- * @param cellDim Dimension of cell.
+ * @param shape String identifying shape of cell
* @param spaceDim Dimension of coordinate space.
- * @param numCorners Number of corners in cell.
*/
- CellGeometry(const int cellDim,
- const int spaceDim,
- const int numCorners);
+ CellGeometry(const ShapeEnum shape,
+ const int spaceDim);
/// Default destructor.
virtual
@@ -75,6 +85,12 @@
*/
int numCorners(void) const;
+ /** Get coordinates of vertices in reference cell (dual basis).
+ *
+ * @returns Array of coordinates of vertices in reference cell
+ */
+ const double_array& vertices(void) const;
+
/** Get cell geometry for lower dimension cell.
*
* @returns Pointer to cell geometry object corresponding to next
@@ -123,6 +139,16 @@
*/
CellGeometry(const CellGeometry& g);
+ /** Set coordinates of vertices in reference cell.
+ *
+ * @param vertices Array of coordinates of vertices [#vertices*cellDim]
+ * @param numVertices Number of vertices.
+ * @param dim Dimension of cell
+ */
+ void _setVertices(const double* vertices,
+ const int numVertices,
+ const int dim);
+
// NOT IMPLEMENTED //////////////////////////////////////////////////////
private :
@@ -141,11 +167,12 @@
// PRIVATE METHODS //////////////////////////////////////////////////////
private :
- /** Compute weighted orientation of fault for cohesive cell between
- * 1-D elements. Orientation is either at vertices or quadrature
- * points, depending on whether the arguments have been evaluated at
- * the vertices or quadrature points.
+ /** Compute orientation of 0-D cell. Orientation is either at
+ * vertices or quadrature points, depending on whether the arguments
+ * have been evaluated at the vertices or quadrature points.
*
+ * The orientation of a 0-D cell is always [1.0].
+ *
* The orientation is returned as an array of direction cosines.
*
* size = spaceDim*spaceDim
@@ -159,15 +186,14 @@
* be up-dip direction).
*/
static
- void _orient1D(double_array* orientation,
+ void _orient0D(double_array* orientation,
const double_array& jacobian,
const double jacobianDet,
const double_array& upDir);
- /** Compute weighted orientation of fault for cohesive cell between
- * 2-D elements. Orientation is either at vertices or quadrature
- * points, depending on whether the arguments have been evaluated at
- * the vertices or quadrature points.
+ /** Compute orientation of 1-D cell. Orientation is either at
+ * vertices or quadrature points, depending on whether the arguments
+ * have been evaluated at the vertices or quadrature points.
*
* The orientation is returned as an array of direction cosines.
*
@@ -182,15 +208,14 @@
* be up-dip direction).
*/
static
- void _orient2D(double_array* orientation,
+ void _orient1D(double_array* orientation,
const double_array& jacobian,
const double jacobianDet,
const double_array& upDir);
- /** Compute weighted orientation of fault for cohesive cell between
- * 3-D elements. Orientation is either at vertices or quadrature
- * points, depending on whether the arguments have been evaluated at
- * the vertices or quadrature points.
+ /** Compute orientation of 2-D cell. Orientation is either at
+ * vertices or quadrature points, depending on whether the arguments
+ * have been evaluated at the vertices or quadrature points.
*
* The orientation is returned as an array of direction cosines.
*
@@ -205,7 +230,7 @@
* be up-dip direction).
*/
static
- void _orient3D(double_array* orientation,
+ void _orient2D(double_array* orientation,
const double_array& jacobian,
const double jacobianDet,
const double_array& upDir);
@@ -213,10 +238,21 @@
// PRIVATE MEMBERS //////////////////////////////////////////////////////
private :
- orient_fn_type _orientFn; ///< Function for computing orientation of cell
- int _cellDim; ///< Dimension of cell.
+ /** Array of coordinates of vertices in reference cell (dual basis).
+ *
+ * Reference coordinates: (p,q,r)
+ *
+ * v0p, v0q, v0r
+ * v1p, v1q, v1r
+ *
+ * size = numBasis * cellDim
+ * index = iBasis*cellDim + iDim
+ */
+ double_array _vertices;
+
+ orient_fn_type _orientFn; ///< Function for computing orientation of cell
int _spaceDim; ///< Dimension of coordinate space.
- int _numCorners; ///< Number of corners in cell.
+ ShapeEnum _shape; ///< Shape of cell
}; // CellGeometry
Modified: short/3D/PyLith/trunk/libsrc/feassemble/CellGeometry.icc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/CellGeometry.icc 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/libsrc/feassemble/CellGeometry.icc 2007-07-19 23:05:00 UTC (rev 7719)
@@ -16,13 +16,6 @@
#include <assert.h> // USES assert()
-// Get dimension of cell.
-inline
-int
-pylith::feassemble::CellGeometry::cellDim(void) const {
- return _cellDim;
-} // cellDim
-
// Get dimension of coordinate space.
inline
int
@@ -30,12 +23,12 @@
return _spaceDim;
} // spaceDim
-// Get number of corners in cell.
+// Get coordinates of vertices in reference cell (dual basis).
inline
-int
-pylith::feassemble::CellGeometry::numCorners(void) const {
- return _numCorners;
-} // numCorners
+const pylith::double_array&
+pylith::feassemble::CellGeometry::vertices(void) const {
+ return _vertices;
+}
// Compute orientation of cell at location.
inline
Modified: short/3D/PyLith/trunk/libsrc/feassemble/GeometryHex3D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/GeometryHex3D.cc 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/libsrc/feassemble/GeometryHex3D.cc 2007-07-19 23:05:00 UTC (rev 7719)
@@ -23,8 +23,19 @@
// ----------------------------------------------------------------------
// Default constructor.
pylith::feassemble::GeometryHex3D::GeometryHex3D(void) :
- CellGeometry(3, 3, 8)
+ CellGeometry(HEXAHEDRON, 3)
{ // constructor
+ const double vertices[] = {
+ -1.0, -1.0, -1.0,
+ +1.0, -1.0, -1.0,
+ +1.0, +1.0, -1.0,
+ -1.0, +1.0, -1.0,
+ -1.0, -1.0, +1.0,
+ +1.0, -1.0, +1.0,
+ +1.0, +1.0, +1.0,
+ -1.0, +1.0, +1.0,
+ };
+ _setVertices(vertices, 8, 3);
} // constructor
// ----------------------------------------------------------------------
Modified: short/3D/PyLith/trunk/libsrc/feassemble/GeometryHex3D.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/GeometryHex3D.hh 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/libsrc/feassemble/GeometryHex3D.hh 2007-07-19 23:05:00 UTC (rev 7719)
@@ -77,6 +77,12 @@
const double_array& vertices,
const double_array& location) const;
+ // NOT IMPLEMENTED ////////////////////////////////////////////////////
+private :
+
+ GeometryHex3D(const GeometryHex3D&); ///< Not implemented
+ const GeometryHex3D& operator=(const GeometryHex3D&); ///< Not implemented
+
}; // GeometryHex3D
#endif // pylith_feassemble_geometryhex3d_hh
Modified: short/3D/PyLith/trunk/libsrc/feassemble/GeometryLine1D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/GeometryLine1D.cc 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/libsrc/feassemble/GeometryLine1D.cc 2007-07-19 23:05:00 UTC (rev 7719)
@@ -23,8 +23,13 @@
// ----------------------------------------------------------------------
// Default constructor.
pylith::feassemble::GeometryLine1D::GeometryLine1D(void) :
- CellGeometry(1, 1, 2)
+ CellGeometry(LINE, 1)
{ // constructor
+ const double vertices[] = {
+ -1.0,
+ +1.0,
+ };
+ _setVertices(vertices, 2, 1);
} // constructor
// ----------------------------------------------------------------------
Modified: short/3D/PyLith/trunk/libsrc/feassemble/GeometryLine1D.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/GeometryLine1D.hh 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/libsrc/feassemble/GeometryLine1D.hh 2007-07-19 23:05:00 UTC (rev 7719)
@@ -65,6 +65,12 @@
const double_array& vertices,
const double_array& location) const;
+ // NOT IMPLEMENTED ////////////////////////////////////////////////////
+private :
+
+ GeometryLine1D(const GeometryLine1D&); ///< Not implemented
+ const GeometryLine1D& operator=(const GeometryLine1D&); ///< Not implemented
+
}; // GeometryLine1D
#endif // pylith_feassemble_geometryline1d_hh
Modified: short/3D/PyLith/trunk/libsrc/feassemble/GeometryLine2D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/GeometryLine2D.cc 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/libsrc/feassemble/GeometryLine2D.cc 2007-07-19 23:05:00 UTC (rev 7719)
@@ -23,8 +23,13 @@
// ----------------------------------------------------------------------
// Default constructor.
pylith::feassemble::GeometryLine2D::GeometryLine2D(void) :
- CellGeometry(1, 2, 2)
+ CellGeometry(LINE, 2)
{ // constructor
+ const double vertices[] = {
+ -1.0,
+ +1.0,
+ };
+ _setVertices(vertices, 2, 1);
} // constructor
// ----------------------------------------------------------------------
Modified: short/3D/PyLith/trunk/libsrc/feassemble/GeometryLine2D.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/GeometryLine2D.hh 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/libsrc/feassemble/GeometryLine2D.hh 2007-07-19 23:05:00 UTC (rev 7719)
@@ -65,6 +65,12 @@
const double_array& vertices,
const double_array& location) const;
+ // NOT IMPLEMENTED ////////////////////////////////////////////////////
+private :
+
+ GeometryLine2D(const GeometryLine2D&); ///< Not implemented
+ const GeometryLine2D& operator=(const GeometryLine2D&); ///< Not implemented
+
}; // GeometryLine2D
#endif // pylith_feassemble_geometryline2d_hh
Modified: short/3D/PyLith/trunk/libsrc/feassemble/GeometryLine3D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/GeometryLine3D.cc 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/libsrc/feassemble/GeometryLine3D.cc 2007-07-19 23:05:00 UTC (rev 7719)
@@ -23,8 +23,13 @@
// ----------------------------------------------------------------------
// Default constructor.
pylith::feassemble::GeometryLine3D::GeometryLine3D(void) :
- CellGeometry(1, 3, 2)
+ CellGeometry(LINE, 3)
{ // constructor
+ const double vertices[] = {
+ -1.0,
+ +1.0,
+ };
+ _setVertices(vertices, 2, 1);
} // constructor
// ----------------------------------------------------------------------
Modified: short/3D/PyLith/trunk/libsrc/feassemble/GeometryLine3D.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/GeometryLine3D.hh 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/libsrc/feassemble/GeometryLine3D.hh 2007-07-19 23:05:00 UTC (rev 7719)
@@ -65,6 +65,12 @@
const double_array& vertices,
const double_array& location) const;
+ // NOT IMPLEMENTED ////////////////////////////////////////////////////
+private :
+
+ GeometryLine3D(const GeometryLine3D&); ///< Not implemented
+ const GeometryLine3D& operator=(const GeometryLine3D&); ///< Not implemented
+
}; // GeometryLine3D
#endif // pylith_feassemble_geometryline3d_hh
Modified: short/3D/PyLith/trunk/libsrc/feassemble/GeometryPoint1D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/GeometryPoint1D.cc 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/libsrc/feassemble/GeometryPoint1D.cc 2007-07-19 23:05:00 UTC (rev 7719)
@@ -21,8 +21,10 @@
// ----------------------------------------------------------------------
// Default constructor.
pylith::feassemble::GeometryPoint1D::GeometryPoint1D(void) :
- CellGeometry(0, 1, 1)
+ CellGeometry(POINT, 1)
{ // constructor
+ const double vertices[] = { 0.0 };
+ _setVertices(vertices, 1, 1);
} // constructor
// ----------------------------------------------------------------------
@@ -32,18 +34,11 @@
} // destructor
// ----------------------------------------------------------------------
-// Copy constructor.
-pylith::feassemble::GeometryPoint1D::GeometryPoint1D(const GeometryPoint1D& g) :
- CellGeometry(0, 1, 1)
-{ // constructor
-} // constructor
-
-// ----------------------------------------------------------------------
// Create a copy of geometry.
pylith::feassemble::CellGeometry*
pylith::feassemble::GeometryPoint1D::clone(void) const
{ // clone
- return new GeometryPoint1D(*this);
+ return new GeometryPoint1D();
} // clone
// ----------------------------------------------------------------------
Modified: short/3D/PyLith/trunk/libsrc/feassemble/GeometryPoint1D.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/GeometryPoint1D.hh 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/libsrc/feassemble/GeometryPoint1D.hh 2007-07-19 23:05:00 UTC (rev 7719)
@@ -65,14 +65,11 @@
const double_array& vertices,
const double_array& location) const;
-// PROTECTED ////////////////////////////////////////////////////////////
-protected :
+ // NOT IMPLEMENTED ////////////////////////////////////////////////////
+private :
- /** Copy constructor.
- *
- * @param g Geometry to copy.
- */
- GeometryPoint1D(const GeometryPoint1D& g);
+ GeometryPoint1D(const GeometryPoint1D&); ///< Not implemented
+ const GeometryPoint1D& operator=(const GeometryPoint1D&); ///< Not implemented
}; // GeometryPoint1D
Modified: short/3D/PyLith/trunk/libsrc/feassemble/GeometryPoint2D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/GeometryPoint2D.cc 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/libsrc/feassemble/GeometryPoint2D.cc 2007-07-19 23:05:00 UTC (rev 7719)
@@ -21,8 +21,10 @@
// ----------------------------------------------------------------------
// Default constructor.
pylith::feassemble::GeometryPoint2D::GeometryPoint2D(void) :
- CellGeometry(0, 2, 1)
+ CellGeometry(POINT, 2)
{ // constructor
+ const double vertices[] = { 0.0 };
+ _setVertices(vertices, 1, 1);
} // constructor
// ----------------------------------------------------------------------
@@ -32,18 +34,11 @@
} // destructor
// ----------------------------------------------------------------------
-// Copy constructor.
-pylith::feassemble::GeometryPoint2D::GeometryPoint2D(const GeometryPoint2D& g) :
- CellGeometry(0, 2, 1)
-{ // constructor
-} // constructor
-
-// ----------------------------------------------------------------------
// Create a copy of geometry.
pylith::feassemble::CellGeometry*
pylith::feassemble::GeometryPoint2D::clone(void) const
{ // clone
- return new GeometryPoint2D(*this);
+ return new GeometryPoint2D();
} // clone
// ----------------------------------------------------------------------
Modified: short/3D/PyLith/trunk/libsrc/feassemble/GeometryPoint2D.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/GeometryPoint2D.hh 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/libsrc/feassemble/GeometryPoint2D.hh 2007-07-19 23:05:00 UTC (rev 7719)
@@ -65,14 +65,11 @@
const double_array& vertices,
const double_array& location) const;
-// PROTECTED ////////////////////////////////////////////////////////////
-protected :
+ // NOT IMPLEMENTED ////////////////////////////////////////////////////
+private :
- /** Copy constructor.
- *
- * @param g Geometry to copy.
- */
- GeometryPoint2D(const GeometryPoint2D& g);
+ GeometryPoint2D(const GeometryPoint2D&); ///< Not implemented
+ const GeometryPoint2D& operator=(const GeometryPoint2D&); ///< Not implemented
}; // GeometryPoint2D
Modified: short/3D/PyLith/trunk/libsrc/feassemble/GeometryPoint3D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/GeometryPoint3D.cc 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/libsrc/feassemble/GeometryPoint3D.cc 2007-07-19 23:05:00 UTC (rev 7719)
@@ -21,8 +21,10 @@
// ----------------------------------------------------------------------
// Default constructor.
pylith::feassemble::GeometryPoint3D::GeometryPoint3D(void) :
- CellGeometry(0, 3, 1)
+ CellGeometry(POINT, 3)
{ // constructor
+ const double vertices[] = { 0.0 };
+ _setVertices(vertices, 1, 1);
} // constructor
// ----------------------------------------------------------------------
@@ -32,18 +34,11 @@
} // destructor
// ----------------------------------------------------------------------
-// Copy constructor.
-pylith::feassemble::GeometryPoint3D::GeometryPoint3D(const GeometryPoint3D& g) :
- CellGeometry(0, 3, 1)
-{ // constructor
-} // constructor
-
-// ----------------------------------------------------------------------
// Create a copy of geometry.
pylith::feassemble::CellGeometry*
pylith::feassemble::GeometryPoint3D::clone(void) const
{ // clone
- return new GeometryPoint3D(*this);
+ return new GeometryPoint3D();
} // clone
// ----------------------------------------------------------------------
Modified: short/3D/PyLith/trunk/libsrc/feassemble/GeometryPoint3D.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/GeometryPoint3D.hh 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/libsrc/feassemble/GeometryPoint3D.hh 2007-07-19 23:05:00 UTC (rev 7719)
@@ -65,14 +65,11 @@
const double_array& vertices,
const double_array& location) const;
-// PROTECTED ////////////////////////////////////////////////////////////
-protected :
+ // NOT IMPLEMENTED ////////////////////////////////////////////////////
+private :
- /** Copy constructor.
- *
- * @param g Geometry to copy.
- */
- GeometryPoint3D(const GeometryPoint3D& g);
+ GeometryPoint3D(const GeometryPoint3D&); ///< Not implemented
+ const GeometryPoint3D& operator=(const GeometryPoint3D&); ///< Not implemented
}; // GeometryPoint3D
Modified: short/3D/PyLith/trunk/libsrc/feassemble/GeometryQuad2D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/GeometryQuad2D.cc 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/libsrc/feassemble/GeometryQuad2D.cc 2007-07-19 23:05:00 UTC (rev 7719)
@@ -23,8 +23,15 @@
// ----------------------------------------------------------------------
// Default constructor.
pylith::feassemble::GeometryQuad2D::GeometryQuad2D(void) :
- CellGeometry(2, 2, 4)
+ CellGeometry(QUADRILATERAL, 2)
{ // constructor
+ const double vertices[] = {
+ -1.0, -1.0,
+ +1.0, -1.0,
+ +1.0, +1.0,
+ -1.0, +1.0,
+ };
+ _setVertices(vertices, 4, 2);
} // constructor
// ----------------------------------------------------------------------
@@ -34,18 +41,11 @@
} // destructor
// ----------------------------------------------------------------------
-// Copy constructor.
-pylith::feassemble::GeometryQuad2D::GeometryQuad2D(const GeometryQuad2D& g) :
- CellGeometry(2, 2, 4)
-{ // constructor
-} // constructor
-
-// ----------------------------------------------------------------------
// Create a copy of geometry.
pylith::feassemble::CellGeometry*
pylith::feassemble::GeometryQuad2D::clone(void) const
{ // clone
- return new GeometryQuad2D(*this);
+ return new GeometryQuad2D();
} // clone
// ----------------------------------------------------------------------
Modified: short/3D/PyLith/trunk/libsrc/feassemble/GeometryQuad2D.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/GeometryQuad2D.hh 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/libsrc/feassemble/GeometryQuad2D.hh 2007-07-19 23:05:00 UTC (rev 7719)
@@ -78,14 +78,11 @@
const double_array& vertices,
const double_array& location) const;
-// PROTECTED ////////////////////////////////////////////////////////////
-protected :
+ // NOT IMPLEMENTED ////////////////////////////////////////////////////
+private :
- /** Copy constructor.
- *
- * @param g Geometry to copy.
- */
- GeometryQuad2D(const GeometryQuad2D& g);
+ GeometryQuad2D(const GeometryQuad2D&); ///< Not implemented
+ const GeometryQuad2D& operator=(const GeometryQuad2D&); ///< Not implemented
}; // GeometryQuad2D
Modified: short/3D/PyLith/trunk/libsrc/feassemble/GeometryQuad3D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/GeometryQuad3D.cc 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/libsrc/feassemble/GeometryQuad3D.cc 2007-07-19 23:05:00 UTC (rev 7719)
@@ -23,8 +23,15 @@
// ----------------------------------------------------------------------
// Default constructor.
pylith::feassemble::GeometryQuad3D::GeometryQuad3D(void) :
- CellGeometry(2, 3, 4)
+ CellGeometry(QUADRILATERAL, 3)
{ // constructor
+ const double vertices[] = {
+ -1.0, -1.0,
+ +1.0, -1.0,
+ +1.0, +1.0,
+ -1.0, +1.0,
+ };
+ _setVertices(vertices, 4, 2);
} // constructor
// ----------------------------------------------------------------------
@@ -34,18 +41,11 @@
} // destructor
// ----------------------------------------------------------------------
-// Copy constructor.
-pylith::feassemble::GeometryQuad3D::GeometryQuad3D(const GeometryQuad3D& g) :
- CellGeometry(2, 3, 4)
-{ // constructor
-} // constructor
-
-// ----------------------------------------------------------------------
// Create a copy of geometry.
pylith::feassemble::CellGeometry*
pylith::feassemble::GeometryQuad3D::clone(void) const
{ // clone
- return new GeometryQuad3D(*this);
+ return new GeometryQuad3D();
} // clone
// ----------------------------------------------------------------------
Modified: short/3D/PyLith/trunk/libsrc/feassemble/GeometryQuad3D.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/GeometryQuad3D.hh 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/libsrc/feassemble/GeometryQuad3D.hh 2007-07-19 23:05:00 UTC (rev 7719)
@@ -78,14 +78,11 @@
const double_array& vertices,
const double_array& location) const;
-// PROTECTED ////////////////////////////////////////////////////////////
-protected :
+ // NOT IMPLEMENTED ////////////////////////////////////////////////////
+private :
- /** Copy constructor.
- *
- * @param g Geometry to copy.
- */
- GeometryQuad3D(const GeometryQuad3D& g);
+ GeometryQuad3D(const GeometryQuad3D&); ///< Not implemented
+ const GeometryQuad3D& operator=(const GeometryQuad3D&); ///< Not implemented
}; // GeometryQuad3D
Modified: short/3D/PyLith/trunk/libsrc/feassemble/GeometryTet3D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/GeometryTet3D.cc 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/libsrc/feassemble/GeometryTet3D.cc 2007-07-19 23:05:00 UTC (rev 7719)
@@ -23,8 +23,15 @@
// ----------------------------------------------------------------------
// Default constructor.
pylith::feassemble::GeometryTet3D::GeometryTet3D(void) :
- CellGeometry(3, 3, 4)
+ CellGeometry(TETRAHEDRON, 3)
{ // constructor
+ const double vertices[] = {
+ -1.0, -1.0, -1.0,
+ +1.0, -1.0, -1.0,
+ -1.0, +1.0, -1.0,
+ -1.0, -1.0, +1.0,
+ };
+ _setVertices(vertices, 4, 3);
} // constructor
// ----------------------------------------------------------------------
@@ -34,18 +41,11 @@
} // destructor
// ----------------------------------------------------------------------
-// Copy constructor.
-pylith::feassemble::GeometryTet3D::GeometryTet3D(const GeometryTet3D& g) :
- CellGeometry(3, 3, 4)
-{ // constructor
-} // constructor
-
-// ----------------------------------------------------------------------
// Create a copy of geometry.
pylith::feassemble::CellGeometry*
pylith::feassemble::GeometryTet3D::clone(void) const
{ // clone
- return new GeometryTet3D(*this);
+ return new GeometryTet3D();
} // clone
// ----------------------------------------------------------------------
Modified: short/3D/PyLith/trunk/libsrc/feassemble/GeometryTet3D.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/GeometryTet3D.hh 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/libsrc/feassemble/GeometryTet3D.hh 2007-07-19 23:05:00 UTC (rev 7719)
@@ -73,14 +73,11 @@
const double_array& vertices,
const double_array& location) const;
-// PROTECTED ////////////////////////////////////////////////////////////
-protected :
+ // NOT IMPLEMENTED ////////////////////////////////////////////////////
+private :
- /** Copy constructor.
- *
- * @param g Geometry to copy.
- */
- GeometryTet3D(const GeometryTet3D& g);
+ GeometryTet3D(const GeometryTet3D&); ///< Not implemented
+ const GeometryTet3D& operator=(const GeometryTet3D&); ///< Not implemented
}; // GeometryTet3D
Modified: short/3D/PyLith/trunk/libsrc/feassemble/GeometryTri2D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/GeometryTri2D.cc 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/libsrc/feassemble/GeometryTri2D.cc 2007-07-19 23:05:00 UTC (rev 7719)
@@ -23,8 +23,14 @@
// ----------------------------------------------------------------------
// Default constructor.
pylith::feassemble::GeometryTri2D::GeometryTri2D(void) :
- CellGeometry(2, 2, 3)
+ CellGeometry(TRIANGLE, 2)
{ // constructor
+ const double vertices[] = {
+ -1.0, -1.0,
+ +1.0, -1.0,
+ -1.0, +1.0,
+ };
+ _setVertices(vertices, 3, 2);
} // constructor
// ----------------------------------------------------------------------
@@ -34,18 +40,11 @@
} // destructor
// ----------------------------------------------------------------------
-// Copy constructor.
-pylith::feassemble::GeometryTri2D::GeometryTri2D(const GeometryTri2D& g) :
- CellGeometry(2, 2, 3)
-{ // constructor
-} // constructor
-
-// ----------------------------------------------------------------------
// Create a copy of geometry.
pylith::feassemble::CellGeometry*
pylith::feassemble::GeometryTri2D::clone(void) const
{ // clone
- return new GeometryTri2D(*this);
+ return new GeometryTri2D();
} // clone
// ----------------------------------------------------------------------
Modified: short/3D/PyLith/trunk/libsrc/feassemble/GeometryTri2D.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/GeometryTri2D.hh 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/libsrc/feassemble/GeometryTri2D.hh 2007-07-19 23:05:00 UTC (rev 7719)
@@ -72,14 +72,11 @@
const double_array& vertices,
const double_array& location) const;
-// PROTECTED ////////////////////////////////////////////////////////////
-protected :
+ // NOT IMPLEMENTED ////////////////////////////////////////////////////
+private :
- /** Copy constructor.
- *
- * @param g Geometry to copy.
- */
- GeometryTri2D(const GeometryTri2D& g);
+ GeometryTri2D(const GeometryTri2D&); ///< Not implemented
+ const GeometryTri2D& operator=(const GeometryTri2D&); ///< Not implemented
}; // GeometryTri2D
Modified: short/3D/PyLith/trunk/libsrc/feassemble/GeometryTri3D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/GeometryTri3D.cc 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/libsrc/feassemble/GeometryTri3D.cc 2007-07-19 23:05:00 UTC (rev 7719)
@@ -23,8 +23,14 @@
// ----------------------------------------------------------------------
// Default constructor.
pylith::feassemble::GeometryTri3D::GeometryTri3D(void) :
- CellGeometry(2, 3, 3)
+ CellGeometry(TRIANGLE, 3)
{ // constructor
+ const double vertices[] = {
+ -1.0, -1.0,
+ +1.0, -1.0,
+ -1.0, +1.0,
+ };
+ _setVertices(vertices, 3, 2);
} // constructor
// ----------------------------------------------------------------------
@@ -34,18 +40,11 @@
} // destructor
// ----------------------------------------------------------------------
-// Copy constructor.
-pylith::feassemble::GeometryTri3D::GeometryTri3D(const GeometryTri3D& g) :
- CellGeometry(2, 3, 3)
-{ // constructor
-} // constructor
-
-// ----------------------------------------------------------------------
// Create a copy of geometry.
pylith::feassemble::CellGeometry*
pylith::feassemble::GeometryTri3D::clone(void) const
{ // clone
- return new GeometryTri3D(*this);
+ return new GeometryTri3D();
} // clone
// ----------------------------------------------------------------------
Modified: short/3D/PyLith/trunk/libsrc/feassemble/GeometryTri3D.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/GeometryTri3D.hh 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/libsrc/feassemble/GeometryTri3D.hh 2007-07-19 23:05:00 UTC (rev 7719)
@@ -72,14 +72,11 @@
const double_array& vertices,
const double_array& location) const;
-// PROTECTED ////////////////////////////////////////////////////////////
-protected :
+ // NOT IMPLEMENTED ////////////////////////////////////////////////////
+private :
- /** Copy constructor.
- *
- * @param g Geometry to copy.
- */
- GeometryTri3D(const GeometryTri3D& g);
+ GeometryTri3D(const GeometryTri3D&); ///< Not implemented
+ const GeometryTri3D& operator=(const GeometryTri3D&); ///< Not implemented
}; // GeometryTri3D
Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.cc 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.cc 2007-07-19 23:05:00 UTC (rev 7719)
@@ -44,7 +44,6 @@
// Copy constructor
pylith::feassemble::Quadrature::Quadrature(const Quadrature& q) :
_minJacobian(q._minJacobian),
- _vertices(q._vertices),
_quadPtsRef(q._quadPtsRef),
_quadPts(q._quadPts),
_quadWts(q._quadWts),
@@ -68,8 +67,7 @@
// Set basis functions and their derivatives and coordinates and
// weights of the quadrature points.
void
-pylith::feassemble::Quadrature::initialize(const double* vertices,
- const double* basis,
+pylith::feassemble::Quadrature::initialize(const double* basis,
const double* basisDerivRef,
const double* quadPtsRef,
const double* quadWts,
@@ -78,8 +76,7 @@
const int numQuadPts,
const int spaceDim)
{ // initialize
- if (0 == vertices ||
- 0 == basis ||
+ if (0 == basis ||
0 == basisDerivRef ||
0 == quadPtsRef ||
0 == quadWts ||
@@ -92,25 +89,19 @@
<< "their derivatives, and coordinates and weights of quadrature\n"
<< "points must all be specified.\n"
<< "Values:\n"
- << " vertices pointer: " << vertices << "\n"
<< " basis pointer: " << basis << "\n"
<< " basis derivatites pointer: " << basisDerivRef << "\n"
<< " quadrature points pointer: " << quadPtsRef << "\n"
<< " quadrature weights pointer: " << quadWts << "\n"
<< " space dimension: " << spaceDim << "\n"
- << " # vertices per cell: " << numBasis << "\n"
+ << " # basis functions: " << numBasis << "\n"
<< " # quadrature points: " << numQuadPts << "\n"
<< " dimension of coordinate space: " << spaceDim << "\n";
throw std::runtime_error(msg.str());
} // if
if (cellDim > 0) {
- int size = numBasis * cellDim; assert(size > 0);
- _vertices.resize(size);
- for (int i=0; i < size; ++i)
- _vertices[i] = vertices[i];
-
- size = numBasis * numQuadPts; assert(size > 0);
+ int size = numBasis * numQuadPts; assert(size > 0);
_basis.resize(size);
for (int i=0; i < size; ++i)
_basis[i] = basis[i];
@@ -161,17 +152,12 @@
<< "Values:\n"
<< " cell dimension: " << cellDim << "\n"
<< " spatial dimension: " << spaceDim << "\n"
- << " # vertices per cell: " << numBasis << "\n"
+ << " # basis functions: " << numBasis << "\n"
<< " # quadrature points: " << numQuadPts << "\n";
throw std::runtime_error(msg.str());
} // if
int size = 1;
- _vertices.resize(size);
- for (int i=0; i < size; ++i)
- _vertices[i] = vertices[i];
-
- size = 1;
_basis.resize(size);
for (int i=0; i < size; ++i)
_basis[i] = basis[i];
Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.hh 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.hh 2007-07-19 23:05:00 UTC (rev 7719)
@@ -61,17 +61,9 @@
virtual
Quadrature* clone(void) const = 0;
- /** Set vertices (dual basis), basis functions and their
- * derivatives, and coordinates and weights of the quadrature
- * points.
+ /** Set basis functions and their derivatives, and coordinates and
+ * weights of the quadrature points.
*
- * @param vertices Array of coordinates of vertices (dual basis).
- * v0x, v0y, v0z
- * v1x, v1y, v1z
- * ...
- * size = numBasis * cellDim
- * index = iBasis*cellDim + iDim
- *
* @param basis Array of basis functions evaluated at quadrature pts
* N0Qp0, N1Qp0, ...
* N0Qp1, N1Qp1, ...
@@ -100,12 +92,11 @@
* index = iQuadPt
*
* @param cellDim Number of dimensions in reference cell
- * @param numBasis Number of basis functions (and vertices) for a cell
+ * @param numBasis Number of basis functions for a cell
* @param numQuadPts Number of quadrature points
* @param spaceDim Number of dimensions in coordinates of cell vertices
*/
- void initialize(const double* vertices,
- const double* basis,
+ void initialize(const double* basis,
const double* basisDerivRef,
const double* quadPtsRef,
const double* quadWts,
@@ -138,11 +129,11 @@
*/
double minJacobian(void);
- /** Get coordinates of vertices in reference cell (dual basis).
+ /** Get coordinates of quadrature points in reference cell.
*
- * @returns Array of coordinates of vertices in reference cell
+ * @returns Array of coordinates of quadrature points in reference cell.
*/
- const double_array& vertices(void) const;
+ const double_array& quadPtsRef(void) const;
/** Get coordinates of quadrature points in cell (NOT reference cell).
*
@@ -252,18 +243,6 @@
double _minJacobian; ///< Minium allowable Jacobian determinant
- /** Array of coordinates of vertices in reference cell (dual basis).
- *
- * Reference coordinates: (p,q,r)
- *
- * v0p, v0q, v0r
- * v1p, v1q, v1r
- *
- * size = numBasis * cellDim
- * index = iBasis*cellDim + iDim
- */
- double_array _vertices;
-
/** Array of coordinates of quadrature points in reference cell.
*
* Reference coordinates: (p,q,r)
Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.icc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.icc 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.icc 2007-07-19 23:05:00 UTC (rev 7719)
@@ -28,11 +28,11 @@
_minJacobian = min;
}
-// Get coordinates of vertices in reference cell (dual basis).
+// Get coordinates of quadrature points in reference cell.
inline
const pylith::double_array&
-pylith::feassemble::Quadrature::vertices(void) const {
- return _vertices;
+pylith::feassemble::Quadrature::quadPtsRef(void) const {
+ return _quadPtsRef;
}
// Get coordinates of quadrature points in cell (NOT reference cell).
Modified: short/3D/PyLith/trunk/modulesrc/feassemble/feassemble.pyxe.src
===================================================================
--- short/3D/PyLith/trunk/modulesrc/feassemble/feassemble.pyxe.src 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/modulesrc/feassemble/feassemble.pyxe.src 2007-07-19 23:05:00 UTC (rev 7719)
@@ -517,7 +517,6 @@
def initialize(self,
- vertices,
basis, basisDeriv,
quadPts, quadWts,
cellDim, numBasis, numQuadPts, spaceDim):
@@ -525,21 +524,19 @@
Set basis functions and their derivatives, and coordinates and
weights of quadrature points.
- @param vertices Vertices in reference cell (dual basis).
@param basis Basis functions evaluated at the quadrature points
@param basisDeriv Basis function derivatives evaluated at quad pts
@param quadPts Coordinates of quadrature points in reference cell
@param quadWts Weights of quadrature points
@param cellDim Dimension of reference cell
- @param numBasis Number of vertices in reference cell
+ @param numBasis Number of basis functions
@param numQuadPts Number of quadrature points
@param spaceDim Number of dimensions associated with cell vertices
"""
# create shim for method 'initialize'
- #embed{ void Quadrature_initialize(void* objVptr, double* vertices, double* basis, double* basisDeriv, double* quadPts, double* quadWts, int cellDim, int numBasis, int numQuadPts, int spaceDim)
+ #embed{ void Quadrature_initialize(void* objVptr, double* basis, double* basisDeriv, double* quadPts, double* quadWts, int cellDim, int numBasis, int numQuadPts, int spaceDim)
try {
((pylith::feassemble::Quadrature*) objVptr)->initialize(
- vertices,
basis, basisDeriv,
quadPts, quadWts,
cellDim, numBasis,
@@ -558,24 +555,6 @@
import spatialdata.utils.simplearray
- numVertices = numBasis
-
- # vertices
- vertices = spatialdata.utils.simplearray.objAsSimpleArray(vertices)
- if not vertices.isCompatible(nd=2, simpletype="double",
- contiguous=True, notswapped=True):
- raise TypeError, \
- "Argument 'vertices' must be a contiguous, 2-D array " \
- "of type double."
- if cellDim > 0:
- if numBasis != vertices.shape[0] or cellDim != vertices.shape[1]:
- raise TypeError, \
- "Shape of argument 'vertices' must be (numBasis, cellDim)."
- else:
- if 1 != vertices.shape[0] or 1 != vertices.shape[1]:
- raise TypeError, \
- "Shape of argument 'vertices' must be (1, 1) for 0-D cell."
-
# basis
basis = spatialdata.utils.simplearray.objAsSimpleArray(basis)
if not basis.isCompatible(nd=2, simpletype="double",
@@ -635,19 +614,16 @@
raise TypeError, \
"Shape of argument 'quadWts' must be (numQuadPts)."
- cdef double* verticesCpp
cdef double* basisCpp
cdef double* basisDerivCpp
cdef double* quadPtsCpp
cdef double* quadWtsCpp
- verticesCpp = <double*> PyCObject_AsVoidPtr(vertices.data)
basisCpp = <double*> PyCObject_AsVoidPtr(basis.data)
basisDerivCpp = <double*> PyCObject_AsVoidPtr(basisDeriv.data)
quadPtsCpp = <double*> PyCObject_AsVoidPtr(quadPts.data)
quadWtsCpp = <double*> PyCObject_AsVoidPtr(quadWts.data)
Quadrature_initialize(self.thisptr,
- verticesCpp,
basisCpp, basisDerivCpp,
quadPtsCpp, quadWtsCpp,
cellDim, numBasis,
Modified: short/3D/PyLith/trunk/pylith/feassemble/quadrature/Quadrature.py
===================================================================
--- short/3D/PyLith/trunk/pylith/feassemble/quadrature/Quadrature.py 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/pylith/feassemble/quadrature/Quadrature.py 2007-07-19 23:05:00 UTC (rev 7719)
@@ -86,8 +86,7 @@
self._info.log("Initializing C++ quadrature.")
- self.cppHandle.initialize(cell.vertices,
- cell.basis, cell.basisDeriv,
+ self.cppHandle.initialize(cell.basis, cell.basisDeriv,
cell.quadPts, cell.quadWts,
cell.cellDim, cell.numCorners, cell.numQuadPts,
self.spaceDim)
Modified: short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc 2007-07-19 23:05:00 UTC (rev 7719)
@@ -374,8 +374,7 @@
cs.setSpaceDim((*mesh)->getDimension());
cs.initialize();
- _quadrature->initialize(_data->verticesRef,
- _data->basis, _data->basisDeriv, _data->quadPts,
+ _quadrature->initialize(_data->basis, _data->basisDeriv, _data->quadPts,
_data->quadWts, _data->cellDim, _data->numBasis,
_data->numQuadPts, _data->spaceDim);
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/TestCellGeometry.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/TestCellGeometry.cc 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/TestCellGeometry.cc 2007-07-19 23:05:00 UTC (rev 7719)
@@ -41,29 +41,29 @@
} // tearDown
// ----------------------------------------------------------------------
-// Test _orient1D().
+// Test _orient0D().
void
-pylith::feassemble::TestCellGeometry::testOrient1D(void)
-{ // testOrient1D
+pylith::feassemble::TestCellGeometry::testOrient0D(void)
+{ // testOrient0D
double_array jacobian;
double jacobianDet;
double_array upDir;
double_array orientation(1);
- CellGeometry::_orient1D(&orientation, jacobian, jacobianDet, upDir);
+ CellGeometry::_orient0D(&orientation, jacobian, jacobianDet, upDir);
const int size = orientation.size();
CPPUNIT_ASSERT_EQUAL(1, size);
const double tolerance = 1.0e-6;
for (int i=0; i < size; ++i)
CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, orientation[i], tolerance);
-} // testOrient1D
+} // testOrient0D
// ----------------------------------------------------------------------
-// Test _orient2D().
+// Test _orient1D().
void
-pylith::feassemble::TestCellGeometry::testOrient2D(void)
-{ // testOrient2D
+pylith::feassemble::TestCellGeometry::testOrient1D(void)
+{ // testOrient1D
const int numLocs = 2;
const int spaceDim = 2;
const int orientSize = 4;
@@ -84,7 +84,7 @@
double_array upDir;
double_array orientation(orientSize);
- CellGeometry::_orient2D(&orientation, jacobian, jacobianDet, upDir);
+ CellGeometry::_orient1D(&orientation, jacobian, jacobianDet, upDir);
const int size = orientation.size();
CPPUNIT_ASSERT_EQUAL(orientSize, size);
@@ -93,13 +93,13 @@
CPPUNIT_ASSERT_DOUBLES_EQUAL(orientationE[iLoc*orientSize+i],
orientation[i], tolerance);
} // for
-} // testOrient2D
+} // testOrient1D
// ----------------------------------------------------------------------
-// Test _orient3D().
+// Test _orient2D().
void
-pylith::feassemble::TestCellGeometry::testOrient3D(void)
-{ // testOrient3D
+pylith::feassemble::TestCellGeometry::testOrient2D(void)
+{ // testOrient2D
const int numLocs = 2;
const int spaceDim = 3;
const int orientSize = 9;
@@ -134,7 +134,7 @@
double jacobianDet = jacobianDetVals[iLoc];
double_array orientation(orientSize);
- CellGeometry::_orient3D(&orientation, jacobian, jacobianDet, upDir);
+ CellGeometry::_orient2D(&orientation, jacobian, jacobianDet, upDir);
const int size = orientation.size();
CPPUNIT_ASSERT_EQUAL(orientSize, size);
@@ -143,7 +143,7 @@
CPPUNIT_ASSERT_DOUBLES_EQUAL(orientationE[iLoc*orientSize+i],
orientation[i], tolerance);
} // for
-} // testOrient3D
+} // testOrient2D
// ----------------------------------------------------------------------
// Test clone()
@@ -197,13 +197,13 @@
switch (_data->cellDim)
{ // switch
case 0 :
- CPPUNIT_ASSERT(CellGeometry::_orient1D == _object->_orientFn);
+ CPPUNIT_ASSERT(CellGeometry::_orient0D == _object->_orientFn);
break;
case 1 :
- CPPUNIT_ASSERT(CellGeometry::_orient2D == _object->_orientFn);
+ CPPUNIT_ASSERT(CellGeometry::_orient1D == _object->_orientFn);
break;
case 2 :
- CPPUNIT_ASSERT(CellGeometry::_orient3D == _object->_orientFn);
+ CPPUNIT_ASSERT(CellGeometry::_orient2D == _object->_orientFn);
break;
case 3 :
CPPUNIT_ASSERT(0 == _object->_orientFn);
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/TestCellGeometry.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/TestCellGeometry.hh 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/TestCellGeometry.hh 2007-07-19 23:05:00 UTC (rev 7719)
@@ -40,9 +40,9 @@
// CPPUNIT TEST SUITE /////////////////////////////////////////////////
CPPUNIT_TEST_SUITE( TestCellGeometry );
+ CPPUNIT_TEST( testOrient0D );
CPPUNIT_TEST( testOrient1D );
CPPUNIT_TEST( testOrient2D );
- CPPUNIT_TEST( testOrient3D );
CPPUNIT_TEST_SUITE_END();
@@ -55,15 +55,15 @@
/// Tear down data.
void tearDown(void);
+ /// Test _orient0D().
+ void testOrient0D(void);
+
/// Test _orient1D().
void testOrient1D(void);
/// Test _orient2D().
void testOrient2D(void);
- /// Test _orient3D().
- void testOrient3D(void);
-
/// Test clone().
void testClone(void);
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/TestElasticityExplicit.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/TestElasticityExplicit.cc 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/TestElasticityExplicit.cc 2007-07-19 23:05:00 UTC (rev 7719)
@@ -293,8 +293,7 @@
(*mesh)->getFactory()->clear(); // clear numberings
// Setup quadrature
- _quadrature->initialize(_data->verticesRef,
- _data->basis, _data->basisDerivRef, _data->quadPts,
+ _quadrature->initialize(_data->basis, _data->basisDerivRef, _data->quadPts,
_data->quadWts, _data->cellDim, _data->numBasis,
_data->numQuadPts, _data->spaceDim);
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/TestElasticityImplicit.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/TestElasticityImplicit.cc 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/TestElasticityImplicit.cc 2007-07-19 23:05:00 UTC (rev 7719)
@@ -294,8 +294,7 @@
(*mesh)->getFactory()->clear(); // clear numberings
// Setup quadrature
- _quadrature->initialize(_data->verticesRef,
- _data->basis, _data->basisDerivRef, _data->quadPts,
+ _quadrature->initialize(_data->basis, _data->basisDerivRef, _data->quadPts,
_data->quadWts, _data->cellDim, _data->numBasis,
_data->numQuadPts, _data->spaceDim);
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegrator.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegrator.cc 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegrator.cc 2007-07-19 23:05:00 UTC (rev 7719)
@@ -140,14 +140,13 @@
const int numBasis = 2;
const int numQuadPts = 1;
const int spaceDim = 1;
- const double vertices[] = { -1.0, 1.0 };
const double basis[] = { 0.5, 0.5 };
const double basisDeriv[] = { -0.5, 0.5 };
const double quadPtsRef[] = { 0.0 };
const double quadWts[] = { 2.0 };
const double minJacobian = 1.0;
- quadrature->initialize(vertices, basis, basisDeriv, quadPtsRef, quadWts,
+ quadrature->initialize(basis, basisDeriv, quadPtsRef, quadWts,
cellDim, numBasis, numQuadPts, spaceDim);
} // _initQuadrature
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/TestQuadrature.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/TestQuadrature.cc 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/TestQuadrature.cc 2007-07-19 23:05:00 UTC (rev 7719)
@@ -33,7 +33,6 @@
const int numBasisE = 2;
const int numQuadPtsE = 1;
const int spaceDimE = 1;
- const double verticesE[] = { 0.12, 0.42 };
const double basisE[] = { 0.2, 0.4 };
const double basisDerivE[] = { 0.8, 1.6 };
const double quadPtsRefE[] = { 3.2 };
@@ -53,10 +52,6 @@
qOrig._spaceDim = spaceDimE;
size_t size = 2;
- qOrig._vertices.resize(size);
- memcpy(&qOrig._vertices[0], verticesE, size*sizeof(double));
-
- size = 2;
qOrig._basis.resize(size);
memcpy(&qOrig._basis[0], basisE, size*sizeof(double));
@@ -102,12 +97,6 @@
CPPUNIT_ASSERT_EQUAL(numQuadPtsE, qCopy->numQuadPts());
CPPUNIT_ASSERT_EQUAL(spaceDimE, qCopy->spaceDim());
- const double_array& vertices = qCopy->vertices();
- size = numBasisE * cellDimE;
- CPPUNIT_ASSERT_EQUAL(size, vertices.size());
- for (int i=0; i < size; ++i)
- CPPUNIT_ASSERT_EQUAL(verticesE[i], vertices[i]);
-
const double_array& basis = qCopy->basis();
size = numBasisE * numQuadPtsE;
CPPUNIT_ASSERT_EQUAL(size, basis.size());
@@ -200,7 +189,6 @@
const int numBasis = 2;
const int numQuadPts = 1;
const int spaceDim = 1;
- const double vertices[] = { -1.0, 1.0 };
const double basis[] = { 0.5, 0.5 };
const double basisDerivRef[] = { -0.5, 0.5 };
const double quadPtsRef[] = { 0.0 };
@@ -208,7 +196,7 @@
const double minJacobian = 1.0;
Quadrature1D q;
- q.initialize(vertices, basis, basisDerivRef, quadPtsRef, quadWts,
+ q.initialize(basis, basisDerivRef, quadPtsRef, quadWts,
cellDim, numBasis, numQuadPts, spaceDim);
CPPUNIT_ASSERT_EQUAL(cellDim, q._cellDim);
@@ -216,12 +204,8 @@
CPPUNIT_ASSERT_EQUAL(numQuadPts, q._numQuadPts);
CPPUNIT_ASSERT_EQUAL(spaceDim, q._spaceDim);
- size_t size = numBasis * cellDim;
+ size_t size = numBasis * numQuadPts;
for (int i=0; i < size; ++i)
- CPPUNIT_ASSERT_EQUAL(vertices[i], q._vertices[i]);
-
- size = numBasis * numQuadPts;
- for (int i=0; i < size; ++i)
CPPUNIT_ASSERT_EQUAL(basis[i], q._basis[i]);
size = numBasis * numQuadPts * spaceDim;
@@ -260,7 +244,6 @@
const int numBasis = data.numBasis;
const int numQuadPts = data.numQuadPts;
const int spaceDim = data.spaceDim;
- const double* verticesRef = data.verticesRef;
const double* basis = data.basis;
const double* basisDerivRef = data.basisDerivRef;
const double* basisDeriv = data.basisDeriv;
@@ -279,7 +262,7 @@
const double minJacobian = 1.0e-06;
pQuad->minJacobian(minJacobian);
- pQuad->initialize(verticesRef, basis, basisDerivRef, quadPtsRef, quadWts,
+ pQuad->initialize(basis, basisDerivRef, quadPtsRef, quadWts,
cellDim, numBasis, numQuadPts, spaceDim);
// Create mesh with test cell
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/TestQuadrature0D.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/TestQuadrature0D.cc 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/TestQuadrature0D.cc 2007-07-19 23:05:00 UTC (rev 7719)
@@ -36,7 +36,6 @@
const int numBasis = 1;
const int numQuadPts = 1;
const int spaceDim = 1;
- const double verticesRef[] = { 0.0 };
const double basis[] = { 1.0 };
const double basisDeriv[] = { 1.0 };
const double quadPtsRef[] = { 0.0 };
@@ -56,8 +55,8 @@
Quadrature0D quadrature;
quadrature.minJacobian(minJacobian);
- quadrature.initialize(verticesRef, basis, basisDeriv, quadPtsRef, quadWts,
- cellDim, numBasis, numQuadPts, spaceDim);
+ quadrature.initialize(basis, basisDeriv, quadPtsRef, quadWts,
+ cellDim, numBasis, numQuadPts, spaceDim);
// Create mesh with test cell
ALE::Obj<Mesh> mesh = new Mesh(PETSC_COMM_WORLD, cellDim);
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/TestMaterial.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/TestMaterial.cc 2007-07-19 22:27:02 UTC (rev 7718)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/TestMaterial.cc 2007-07-19 23:05:00 UTC (rev 7719)
@@ -150,12 +150,11 @@
const int numCorners = 3;
const int numQuadPts = 2;
const int spaceDim = 1;
- const double verticesRef[] = { -1.0, 1.0, 0.0 };
const double basis[] = { 0.455, 0.667, -0.122, -0.122, 0.667, 0.455 };
const double basisDeriv[] = { -1.077, 1.155, -0.077, 0.077, -1.155, 1.077 };
const double quadPtsRef[] = { -0.577350269, 0.577350269 };
const double quadWts[] = { 1.0, 1.0 };
- quadrature.initialize(verticesRef, basis, basisDeriv, quadPtsRef, quadWts,
+ quadrature.initialize(basis, basisDeriv, quadPtsRef, quadWts,
cellDim, numCorners, numQuadPts, spaceDim);
spatialdata::spatialdb::SimpleDB db;
More information about the cig-commits
mailing list