[cig-commits] r11510 - in short/3D/PyLith/trunk: . libsrc/bc libsrc/faults libsrc/feassemble libsrc/meshio modulesrc/bc modulesrc/meshio pylith/bc pylith/faults pylith/feassemble pylith/meshio pylith/problems unittests/pytests/meshio
brad at geodynamics.org
brad at geodynamics.org
Sat Mar 22 20:12:30 PDT 2008
Author: brad
Date: 2008-03-22 20:12:30 -0700 (Sat, 22 Mar 2008)
New Revision: 11510
Modified:
short/3D/PyLith/trunk/TODO
short/3D/PyLith/trunk/libsrc/bc/AbsorbingDampers.cc
short/3D/PyLith/trunk/libsrc/bc/AbsorbingDampers.hh
short/3D/PyLith/trunk/libsrc/bc/BoundaryCondition.cc
short/3D/PyLith/trunk/libsrc/bc/BoundaryCondition.hh
short/3D/PyLith/trunk/libsrc/bc/Neumann.cc
short/3D/PyLith/trunk/libsrc/bc/Neumann.hh
short/3D/PyLith/trunk/libsrc/faults/FaultCohesive.cc
short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDyn.cc
short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDyn.hh
short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc
short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.hh
short/3D/PyLith/trunk/libsrc/feassemble/Integrator.hh
short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity.cc
short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity.hh
short/3D/PyLith/trunk/libsrc/meshio/OutputSolnSubset.cc
short/3D/PyLith/trunk/libsrc/meshio/OutputSolnSubset.hh
short/3D/PyLith/trunk/modulesrc/bc/bc.pyxe.src
short/3D/PyLith/trunk/modulesrc/meshio/meshio.pyxe.src
short/3D/PyLith/trunk/pylith/bc/BoundaryCondition.py
short/3D/PyLith/trunk/pylith/faults/Fault.py
short/3D/PyLith/trunk/pylith/feassemble/IntegratorElasticity.py
short/3D/PyLith/trunk/pylith/meshio/OutputManager.py
short/3D/PyLith/trunk/pylith/meshio/OutputSolnSubset.py
short/3D/PyLith/trunk/pylith/problems/Formulation.py
short/3D/PyLith/trunk/unittests/pytests/meshio/TestOutputManager.py
short/3D/PyLith/trunk/unittests/pytests/meshio/TestOutputSolnSubset.py
Log:
Added error checking verifying that mesh contains groups of vertices for BC, faults, and output subdomain.
Modified: short/3D/PyLith/trunk/TODO
===================================================================
--- short/3D/PyLith/trunk/TODO 2008-03-23 00:43:03 UTC (rev 11509)
+++ short/3D/PyLith/trunk/TODO 2008-03-23 03:12:30 UTC (rev 11510)
@@ -1,21 +1,4 @@
======================================================================
-KNOWN DEFICIENCIES
-======================================================================
-
- Can't use block Jacobi preconditioner when Dirichlet BC overlap with
- fault BC's, because we end up with a DOF associated with a Lagrange
- multiplier that is "free". Not sure if this is okay, when the fault
- is at an angle to the boundary.
-
- Might be able to fix this problem by examining constraints
- relative to orientation and if orientation coincides with
- preexisting constraint, then constrain Lagrange multiplier DOF.
-
- Need better error trapping when using LineParser. State of
- ifstream is insufficient. Need state of istringstream buffer, but it
- is often !good() at eof(). Test of !good() and !eof()?
-
-======================================================================
CURRENT ISSUES
======================================================================
@@ -29,12 +12,6 @@
a. Add check to make sure every material in mesh has a material model.
- b. When importing mesh, add check to make sure all cells have same
- number of vertices (especially CUBIT).
-
- c. Add check to make sure that label in BC, faults, and output
- subset actually exists in mesh (verifyConfiguration()).
-
4. Fix hanging on multiple processors (proc 0 doesn't have a fault?).
Benchmarks
@@ -61,8 +38,7 @@
Manual
- 1. Need to add explanation of output and output parameters
- (especially fault information).
+ 1. Add list of output fields for elastic materials.
2. Add strike-slip benchmarks.
@@ -137,6 +113,23 @@
Orientation , Fault constitutive parameters (diagnostic)
======================================================================
+KNOWN DEFICIENCIES
+======================================================================
+
+ Can't use block Jacobi preconditioner when Dirichlet BC overlap with
+ fault BC's, because we end up with a DOF associated with a Lagrange
+ multiplier that is "free". Not sure if this is okay, when the fault
+ is at an angle to the boundary.
+
+ Might be able to fix this problem by examining constraints
+ relative to orientation and if orientation coincides with
+ preexisting constraint, then constrain Lagrange multiplier DOF.
+
+ Need better error trapping when using LineParser. State of
+ ifstream is insufficient. Need state of istringstream buffer, but it
+ is often !good() at eof(). Test of !good() and !eof()?
+
+======================================================================
MISC PRIORITIES (Brad)
======================================================================
@@ -251,10 +244,6 @@
There is another version that takes an array of maxVolumes, one for each cell in oldMesh.
-5. Throw out cohesive midnodes from censored depth (not easy since they are mixed in with new vertices, maybe change numbering)
-
- I think you can do this by placing them after cohesive cells
-
6. Coarsening for PyLith meshes
7. Time fixes
@@ -270,8 +259,3 @@
Done a. Share memory in precomputation sections
11. For Schur complement directly for mass matrix and Lagrange multiplier problem
-
-======================================================================
-QUESTIONS FOR LEIF
-======================================================================
-
Modified: short/3D/PyLith/trunk/libsrc/bc/AbsorbingDampers.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/bc/AbsorbingDampers.cc 2008-03-23 00:43:03 UTC (rev 11509)
+++ short/3D/PyLith/trunk/libsrc/bc/AbsorbingDampers.cc 2008-03-23 03:12:30 UTC (rev 11510)
@@ -402,8 +402,9 @@
// ----------------------------------------------------------------------
// Verify configuration is acceptable.
void
-pylith::bc::AbsorbingDampers::verifyConfiguration(const ALE::Obj<Mesh>& mesh)
+pylith::bc::AbsorbingDampers::verifyConfiguration(const ALE::Obj<Mesh>& mesh) const
{ // verifyConfiguration
+ BoundaryCondition::verifyConfiguration(mesh);
} // verifyConfiguration
Modified: short/3D/PyLith/trunk/libsrc/bc/AbsorbingDampers.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/bc/AbsorbingDampers.hh 2008-03-23 00:43:03 UTC (rev 11509)
+++ short/3D/PyLith/trunk/libsrc/bc/AbsorbingDampers.hh 2008-03-23 03:12:30 UTC (rev 11510)
@@ -120,7 +120,7 @@
*
* @param mesh Finite-element mesh
*/
- void verifyConfiguration(const ALE::Obj<Mesh>& mesh);
+ void verifyConfiguration(const ALE::Obj<Mesh>& mesh) const;
// NOT IMPLEMENTED ////////////////////////////////////////////////////
private :
Modified: short/3D/PyLith/trunk/libsrc/bc/BoundaryCondition.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/bc/BoundaryCondition.cc 2008-03-23 00:43:03 UTC (rev 11509)
+++ short/3D/PyLith/trunk/libsrc/bc/BoundaryCondition.cc 2008-03-23 03:12:30 UTC (rev 11510)
@@ -29,5 +29,20 @@
_db = 0;
} // destructor
+// ----------------------------------------------------------------------
+// Verify configuration is acceptable.
+void
+pylith::bc::BoundaryCondition::verifyConfiguration(const ALE::Obj<Mesh>& mesh) const
+{ // verifyConfiguration
+ assert(!mesh.isNull());
+ if (!mesh->hasIntSection(_label)) {
+ std::ostringstream msg;
+ msg << "Mesh missing group of vertices '" << _label
+ << " for boundary condition.";
+ throw std::runtime_error(msg.str());
+ } // if
+} // verifyConfiguration
+
+
// End of file
Modified: short/3D/PyLith/trunk/libsrc/bc/BoundaryCondition.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/bc/BoundaryCondition.hh 2008-03-23 00:43:03 UTC (rev 11509)
+++ short/3D/PyLith/trunk/libsrc/bc/BoundaryCondition.hh 2008-03-23 03:12:30 UTC (rev 11510)
@@ -78,13 +78,20 @@
*/
void db(spatialdata::spatialdb::SpatialDB* const db);
+ /** Verify configuration.
+ *
+ * @param mesh PETSc mesh
+ */
+ virtual
+ void verifyConfiguration(const ALE::Obj<Mesh>& mesh) const;
+
/** Initialize boundary condition.
*
* @param mesh PETSc mesh
* @param cs Coordinate system for mesh
*/
virtual
- void initialize(const ALE::Obj<ALE::Mesh>& mesh,
+ void initialize(const ALE::Obj<Mesh>& mesh,
const spatialdata::geocoords::CoordSys* cs,
const double_array& upDir) = 0;
Modified: short/3D/PyLith/trunk/libsrc/bc/Neumann.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/bc/Neumann.cc 2008-03-23 00:43:03 UTC (rev 11509)
+++ short/3D/PyLith/trunk/libsrc/bc/Neumann.cc 2008-03-23 03:12:30 UTC (rev 11510)
@@ -331,8 +331,9 @@
// ----------------------------------------------------------------------
// Verify configuration is acceptable.
void
-pylith::bc::Neumann::verifyConfiguration(const ALE::Obj<Mesh>& mesh)
+pylith::bc::Neumann::verifyConfiguration(const ALE::Obj<Mesh>& mesh) const
{ // verifyConfiguration
+ BoundaryCondition::verifyConfiguration(mesh);
} // verifyConfiguration
// ----------------------------------------------------------------------
Modified: short/3D/PyLith/trunk/libsrc/bc/Neumann.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/bc/Neumann.hh 2008-03-23 00:43:03 UTC (rev 11509)
+++ short/3D/PyLith/trunk/libsrc/bc/Neumann.hh 2008-03-23 03:12:30 UTC (rev 11510)
@@ -90,7 +90,7 @@
*
* @param mesh Finite-element mesh
*/
- void verifyConfiguration(const ALE::Obj<Mesh>& mesh);
+ void verifyConfiguration(const ALE::Obj<Mesh>& mesh) const;
/** Get boundary mesh.
*
Modified: short/3D/PyLith/trunk/libsrc/faults/FaultCohesive.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/FaultCohesive.cc 2008-03-23 00:43:03 UTC (rev 11509)
+++ short/3D/PyLith/trunk/libsrc/faults/FaultCohesive.cc 2008-03-23 03:12:30 UTC (rev 11510)
@@ -20,6 +20,8 @@
#include "pylith/utils/array.hh" // USES double_array
#include <assert.h> // USES assert()
+#include <sstream> // USES std::ostringstream
+#include <stdexcept> // USES std::runtime_error
// ----------------------------------------------------------------------
// Default constructor.
@@ -40,6 +42,13 @@
{ // adjustTopology
assert(std::string("") != label());
+ if (!mesh->hasIntSection(label())) {
+ std::ostringstream msg;
+ msg << "Mesh missing group of vertices '" << label()
+ << " for fault interface condition.";
+ throw std::runtime_error(msg.str());
+ } // if
+
// Get group of vertices associated with fault
const ALE::Obj<int_section_type>& groupField =
mesh->getIntSection(label());
Modified: short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDyn.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDyn.cc 2008-03-23 00:43:03 UTC (rev 11509)
+++ short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDyn.cc 2008-03-23 03:12:30 UTC (rev 11510)
@@ -75,10 +75,17 @@
// Verify configuration is acceptable.
void
pylith::faults::FaultCohesiveDyn::verifyConfiguration(
- const ALE::Obj<Mesh>& mesh)
+ const ALE::Obj<Mesh>& mesh) const
{ // verifyConfiguration
assert(0 != _quadrature);
+ if (!mesh->hasIntSection(label())) {
+ std::ostringstream msg;
+ msg << "Mesh missing group of vertices '" << label()
+ << " for boundary condition.";
+ throw std::runtime_error(msg.str());
+ } // if
+
// check compatibility of mesh and quadrature scheme
const int dimension = mesh->getDimension()-1;
if (_quadrature->cellDim() != dimension) {
Modified: short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDyn.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDyn.hh 2008-03-23 00:43:03 UTC (rev 11509)
+++ short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDyn.hh 2008-03-23 03:12:30 UTC (rev 11510)
@@ -99,7 +99,7 @@
*
* @param mesh Finite-element mesh
*/
- void verifyConfiguration(const ALE::Obj<Mesh>& mesh);
+ void verifyConfiguration(const ALE::Obj<Mesh>& mesh) const;
/** Get vertex field associated with integrator.
*
Modified: short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc 2008-03-23 00:43:03 UTC (rev 11509)
+++ short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc 2008-03-23 03:12:30 UTC (rev 11510)
@@ -363,11 +363,18 @@
// ----------------------------------------------------------------------
// Verify configuration is acceptable.
void
-pylith::faults::FaultCohesiveKin::verifyConfiguration(
- const ALE::Obj<Mesh>& mesh)
+pylith::faults::FaultCohesiveKin::verifyConfiguration(const ALE::Obj<Mesh>& mesh) const
{ // verifyConfiguration
+ assert(!mesh.isNull());
assert(0 != _quadrature);
+ if (!mesh->hasIntSection(label())) {
+ std::ostringstream msg;
+ msg << "Mesh missing group of vertices '" << label()
+ << " for boundary condition.";
+ throw std::runtime_error(msg.str());
+ } // if
+
// check compatibility of mesh and quadrature scheme
const int dimension = mesh->getDimension()-1;
if (_quadrature->cellDim() != dimension) {
Modified: short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.hh 2008-03-23 00:43:03 UTC (rev 11509)
+++ short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.hh 2008-03-23 03:12:30 UTC (rev 11510)
@@ -124,7 +124,7 @@
*
* @param mesh Finite-element mesh
*/
- void verifyConfiguration(const ALE::Obj<Mesh>& mesh);
+ void verifyConfiguration(const ALE::Obj<Mesh>& mesh) const;
/** Get vertex field associated with integrator.
*
Modified: short/3D/PyLith/trunk/libsrc/feassemble/Integrator.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Integrator.hh 2008-03-23 00:43:03 UTC (rev 11509)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Integrator.hh 2008-03-23 03:12:30 UTC (rev 11510)
@@ -135,7 +135,7 @@
* @param mesh Finite-element mesh
*/
virtual
- void verifyConfiguration(const ALE::Obj<Mesh>& mesh) = 0;
+ void verifyConfiguration(const ALE::Obj<Mesh>& mesh) const = 0;
// PROTECTED METHODS ////////////////////////////////////////////////////
protected :
Modified: short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity.cc 2008-03-23 00:43:03 UTC (rev 11509)
+++ short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity.cc 2008-03-23 03:12:30 UTC (rev 11510)
@@ -158,7 +158,7 @@
// Verify configuration is acceptable.
void
pylith::feassemble::IntegratorElasticity::verifyConfiguration(
- const ALE::Obj<Mesh>& mesh)
+ const ALE::Obj<Mesh>& mesh) const
{ // verifyConfiguration
assert(0 != _quadrature);
assert(0 != _material);
Modified: short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity.hh 2008-03-23 00:43:03 UTC (rev 11509)
+++ short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity.hh 2008-03-23 03:12:30 UTC (rev 11510)
@@ -91,7 +91,7 @@
*
* @param mesh Finite-element mesh
*/
- void verifyConfiguration(const ALE::Obj<Mesh>& mesh);
+ void verifyConfiguration(const ALE::Obj<Mesh>& mesh) const;
/** Get cell field associated with integrator.
*
Modified: short/3D/PyLith/trunk/libsrc/meshio/OutputSolnSubset.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/meshio/OutputSolnSubset.cc 2008-03-23 00:43:03 UTC (rev 11509)
+++ short/3D/PyLith/trunk/libsrc/meshio/OutputSolnSubset.cc 2008-03-23 03:12:30 UTC (rev 11510)
@@ -38,6 +38,21 @@
} // label
// ----------------------------------------------------------------------
+// Verify configuration is acceptable.
+void
+pylith::meshio::OutputSolnSubset::verifyConfiguration(const ALE::Obj<Mesh>& mesh) const
+{ // verifyConfiguration
+ assert(!mesh.isNull());
+
+ if (!mesh->hasIntSection(_label)) {
+ std::ostringstream msg;
+ msg << "Mesh missing group of vertices '" << _label
+ << " for subdomain output.";
+ throw std::runtime_error(msg.str());
+ } // if
+} // verifyConfiguration
+
+// ----------------------------------------------------------------------
// Get mesh associated with subdomain.
const ALE::Obj<pylith::Mesh>&
pylith::meshio::OutputSolnSubset::subdomainMesh(const ALE::Obj<Mesh>& mesh)
Modified: short/3D/PyLith/trunk/libsrc/meshio/OutputSolnSubset.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/meshio/OutputSolnSubset.hh 2008-03-23 00:43:03 UTC (rev 11509)
+++ short/3D/PyLith/trunk/libsrc/meshio/OutputSolnSubset.hh 2008-03-23 03:12:30 UTC (rev 11510)
@@ -52,6 +52,12 @@
*/
void label(const char* value);
+ /** Verify configuration.
+ *
+ * @param mesh PETSc mesh
+ */
+ void verifyConfiguration(const ALE::Obj<Mesh>& mesh) const;
+
/** Get mesh associated with subdomain.
*
* @returns Mesh associated with subdomain.
Modified: short/3D/PyLith/trunk/modulesrc/bc/bc.pyxe.src
===================================================================
--- short/3D/PyLith/trunk/modulesrc/bc/bc.pyxe.src 2008-03-23 00:43:03 UTC (rev 11509)
+++ short/3D/PyLith/trunk/modulesrc/bc/bc.pyxe.src 2008-03-23 03:12:30 UTC (rev 11510)
@@ -70,6 +70,37 @@
return
+ def verifyConfiguration(self, mesh):
+ """
+ Verify compatibility of configuration settings.
+ """
+ # create shim for method 'verifyConfiguration'
+ #embed{ void BoundaryCondition_verifyConfiguration(void* objVptr, void* meshVptr)
+ try {
+ assert(0 != objVptr);
+ assert(0 != meshVptr);
+ ALE::Obj<ALE::Mesh>* mesh = (ALE::Obj<ALE::Mesh>*) meshVptr;
+ ((pylith::bc::BoundaryCondition*) objVptr)->verifyConfiguration(*mesh);
+ } catch (const std::exception& err) {
+ PyErr_SetString(PyExc_RuntimeError,
+ const_cast<char*>(err.what()));
+ } catch (const ALE::Exception& err) {
+ PyErr_SetString(PyExc_RuntimeError,
+ const_cast<char*>(err.msg().c_str()));
+ } catch (...) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "Caught unknown C++ exception.");
+ } // try/catch
+ #}embed
+
+ if not mesh.name == "pylith_topology_Mesh":
+ raise TypeError, \
+ "Argument must be extension module type " \
+ "'pylith::topology::Mesh'."
+ BoundaryCondition_verifyConfiguration(self.thisptr, ptrFromHandle(mesh))
+ return
+
+
def initialize(self, mesh, cs, upDir):
"""
Initialize boundary condition.
@@ -858,37 +889,6 @@
return
- def verifyConfiguration(self, mesh):
- """
- Verify compatibility of configuration settings.
- """
- # create shim for method 'verifyConfiguration'
- #embed{ void AbsorbingDampers_verifyConfiguration(void* objVptr, void* meshVptr)
- try {
- assert(0 != objVptr);
- assert(0 != meshVptr);
- ALE::Obj<ALE::Mesh>* mesh =
- (ALE::Obj<ALE::Mesh>*) meshVptr;
- ((pylith::bc::AbsorbingDampers*) objVptr)->verifyConfiguration(*mesh);
- } catch (const std::exception& err) {
- PyErr_SetString(PyExc_RuntimeError,
- const_cast<char*>(err.what()));
- } catch (const ALE::Exception& err) {
- PyErr_SetString(PyExc_RuntimeError,
- const_cast<char*>(err.msg().c_str()));
- } catch (...) {
- PyErr_SetString(PyExc_RuntimeError,
- "Caught unknown C++ exception.");
- } // try/catch
- #}embed
- if mesh.name != "pylith_topology_Mesh":
- raise TypeError, \
- "Argument 'mesh' must be extension module type 'Mesh'."
- AbsorbingDampers_verifyConfiguration(self.thisptr,
- ptrFromHandle(mesh))
- return
-
-
def _createHandle(self):
"""
Wrap pointer to C++ object in PyCObject.
@@ -1183,37 +1183,6 @@
return
- def verifyConfiguration(self, mesh):
- """
- Verify compatibility of configuration settings.
- """
- # create shim for method 'verifyConfiguration'
- #embed{ void Neumann_verifyConfiguration(void* objVptr, void* meshVptr)
- try {
- assert(0 != objVptr);
- assert(0 != meshVptr);
- ALE::Obj<ALE::Mesh>* mesh =
- (ALE::Obj<ALE::Mesh>*) meshVptr;
- ((pylith::bc::Neumann*) objVptr)->verifyConfiguration(*mesh);
- } catch (const std::exception& err) {
- PyErr_SetString(PyExc_RuntimeError,
- const_cast<char*>(err.what()));
- } catch (const ALE::Exception& err) {
- PyErr_SetString(PyExc_RuntimeError,
- const_cast<char*>(err.msg().c_str()));
- } catch (...) {
- PyErr_SetString(PyExc_RuntimeError,
- "Caught unknown C++ exception.");
- } // try/catch
- #}embed
- if mesh.name != "pylith_topology_Mesh":
- raise TypeError, \
- "Argument 'mesh' must be extension module type 'Mesh'."
- Neumann_verifyConfiguration(self.thisptr,
- ptrFromHandle(mesh))
- return
-
-
def boundaryMesh(self, mesh):
"""
Get mesh associated with fields over boundary.
Modified: short/3D/PyLith/trunk/modulesrc/meshio/meshio.pyxe.src
===================================================================
--- short/3D/PyLith/trunk/modulesrc/meshio/meshio.pyxe.src 2008-03-23 00:43:03 UTC (rev 11509)
+++ short/3D/PyLith/trunk/modulesrc/meshio/meshio.pyxe.src 2008-03-23 03:12:30 UTC (rev 11510)
@@ -1050,6 +1050,37 @@
return
+ def verifyConfiguration(self, mesh):
+ """
+ Verify compatibility of configuration settings.
+ """
+ # create shim for method 'verifyConfiguration'
+ #embed{ void OutputSolnSubset_verifyConfiguration(void* objVptr, void* meshVptr)
+ try {
+ assert(0 != objVptr);
+ assert(0 != meshVptr);
+ ALE::Obj<ALE::Mesh>* mesh = (ALE::Obj<ALE::Mesh>*) meshVptr;
+ ((pylith::meshio::OutputSolnSubset*) objVptr)->verifyConfiguration(*mesh);
+ } catch (const std::exception& err) {
+ PyErr_SetString(PyExc_RuntimeError,
+ const_cast<char*>(err.what()));
+ } catch (const ALE::Exception& err) {
+ PyErr_SetString(PyExc_RuntimeError,
+ const_cast<char*>(err.msg().c_str()));
+ } catch (...) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "Caught unknown C++ exception.");
+ } // try/catch
+ #}embed
+
+ if not mesh.name == "pylith_topology_Mesh":
+ raise TypeError, \
+ "Argument must be extension module type " \
+ "'pylith::topology::Mesh'."
+ OutputSolnSubset_verifyConfiguration(self.thisptr, ptrFromHandle(mesh))
+ return
+
+
def mesh(self, submesh, mesh):
"""
Get mesh associated with subdomain.
Modified: short/3D/PyLith/trunk/pylith/bc/BoundaryCondition.py
===================================================================
--- short/3D/PyLith/trunk/pylith/bc/BoundaryCondition.py 2008-03-23 00:43:03 UTC (rev 11509)
+++ short/3D/PyLith/trunk/pylith/bc/BoundaryCondition.py 2008-03-23 03:12:30 UTC (rev 11510)
@@ -111,7 +111,8 @@
"""
Verify compatibility of configuration.
"""
- # :TODO: Make sure mesh contains group with label.
+ assert(None != self.cppHandle)
+ self.cppHandle.verifyConfiguration(self.mesh.cppHandle)
return
Modified: short/3D/PyLith/trunk/pylith/faults/Fault.py
===================================================================
--- short/3D/PyLith/trunk/pylith/faults/Fault.py 2008-03-23 00:43:03 UTC (rev 11509)
+++ short/3D/PyLith/trunk/pylith/faults/Fault.py 2008-03-23 03:12:30 UTC (rev 11510)
@@ -166,10 +166,11 @@
"Dimensions for quadrature: %d, dimensions of fault: %d" % \
(self.quadrature.cell.cellDim, faultDim)
- # :TODO: Make sure mesh has group of vertices with label.
+ assert(None != self.cppHandle)
+ self.cppHandle.verifyConfiguration(self.mesh.cppHandle)
if None != self.output:
- self.output.verifyConfiguration()
+ self.output.verifyConfiguration(self.mesh)
self._logger.eventEnd(logEvent)
return
Modified: short/3D/PyLith/trunk/pylith/feassemble/IntegratorElasticity.py
===================================================================
--- short/3D/PyLith/trunk/pylith/feassemble/IntegratorElasticity.py 2008-03-23 00:43:03 UTC (rev 11509)
+++ short/3D/PyLith/trunk/pylith/feassemble/IntegratorElasticity.py 2008-03-23 03:12:30 UTC (rev 11510)
@@ -72,7 +72,7 @@
Integrator.verifyConfiguration(self)
self.material.verifyConfiguration()
- self.output.verifyConfiguration()
+ self.output.verifyConfiguration(self.mesh)
self._logger.eventEnd(logEvent)
Modified: short/3D/PyLith/trunk/pylith/meshio/OutputManager.py
===================================================================
--- short/3D/PyLith/trunk/pylith/meshio/OutputManager.py 2008-03-23 00:43:03 UTC (rev 11509)
+++ short/3D/PyLith/trunk/pylith/meshio/OutputManager.py 2008-03-23 03:12:30 UTC (rev 11510)
@@ -117,7 +117,7 @@
return
- def verifyConfiguration(self):
+ def verifyConfiguration(self, mesh):
"""
Verify compatibility of configuration.
"""
Modified: short/3D/PyLith/trunk/pylith/meshio/OutputSolnSubset.py
===================================================================
--- short/3D/PyLith/trunk/pylith/meshio/OutputSolnSubset.py 2008-03-23 00:43:03 UTC (rev 11509)
+++ short/3D/PyLith/trunk/pylith/meshio/OutputSolnSubset.py 2008-03-23 03:12:30 UTC (rev 11510)
@@ -84,6 +84,16 @@
return
+ def verifyConfiguration(self, mesh):
+ """
+ Verify compatibility of configuration.
+ """
+ OutputManager.verifyConfiguration(self, mesh)
+ assert(None != self.cppHandle);
+ self.cppHandle.verifyConfiguration(mesh.cppHandle)
+ return
+
+
def initialize(self, mesh):
"""
Initialize output manager.
Modified: short/3D/PyLith/trunk/pylith/problems/Formulation.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/Formulation.py 2008-03-23 00:43:03 UTC (rev 11509)
+++ short/3D/PyLith/trunk/pylith/problems/Formulation.py 2008-03-23 03:12:30 UTC (rev 11510)
@@ -132,7 +132,7 @@
for constraint in self.constraints:
constraint.verifyConfiguration()
for output in self.output.components():
- output.verifyConfiguration()
+ output.verifyConfiguration(self.mesh)
self._logger.eventEnd(logEvent)
return
Modified: short/3D/PyLith/trunk/unittests/pytests/meshio/TestOutputManager.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/meshio/TestOutputManager.py 2008-03-23 00:43:03 UTC (rev 11509)
+++ short/3D/PyLith/trunk/unittests/pytests/meshio/TestOutputManager.py 2008-03-23 03:12:30 UTC (rev 11510)
@@ -154,7 +154,7 @@
output.vertexDataFields = ["vertex data 2"]
output.cellInfoFields = []
output.cellDataFields = ["cell data"]
- output.verifyConfiguration()
+ output.verifyConfiguration(dataProvider.getDataMesh())
return
Modified: short/3D/PyLith/trunk/unittests/pytests/meshio/TestOutputSolnSubset.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/meshio/TestOutputSolnSubset.py 2008-03-23 00:43:03 UTC (rev 11509)
+++ short/3D/PyLith/trunk/unittests/pytests/meshio/TestOutputSolnSubset.py 2008-03-23 03:12:30 UTC (rev 11510)
@@ -77,11 +77,11 @@
"""
output = OutputSolnSubset()
output._configure()
- output.label = "label"
+ output.label = "2"
output.preinitialize()
output.vertexDataFields = ["displacements"]
- output.verifyConfiguration()
+ output.verifyConfiguration(self.mesh)
return
More information about the cig-commits
mailing list