[cig-commits] r9318 - in short/3D/PyLith/trunk: . libsrc/faults libsrc/feassemble libsrc/materials libsrc/meshio modulesrc/faults modulesrc/feassemble pylith/faults pylith/feassemble pylith/materials pylith/meshio pylith/problems
brad at geodynamics.org
brad at geodynamics.org
Wed Feb 13 13:09:06 PST 2008
Author: brad
Date: 2008-02-13 13:09:06 -0800 (Wed, 13 Feb 2008)
New Revision: 9318
Modified:
short/3D/PyLith/trunk/TODO
short/3D/PyLith/trunk/libsrc/faults/Fault.hh
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/IntegratorElasticity.cc
short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity.hh
short/3D/PyLith/trunk/libsrc/materials/Material.cc
short/3D/PyLith/trunk/libsrc/meshio/DataWriterVTK.cc
short/3D/PyLith/trunk/modulesrc/faults/faults.pyxe.src
short/3D/PyLith/trunk/modulesrc/feassemble/feassemble.pyxe.src
short/3D/PyLith/trunk/pylith/faults/Fault.py
short/3D/PyLith/trunk/pylith/faults/FaultCohesiveKin.py
short/3D/PyLith/trunk/pylith/feassemble/Constraint.py
short/3D/PyLith/trunk/pylith/feassemble/Integrator.py
short/3D/PyLith/trunk/pylith/feassemble/IntegratorElasticity.py
short/3D/PyLith/trunk/pylith/materials/ElasticIsotropic3D.py
short/3D/PyLith/trunk/pylith/materials/ElasticPlaneStrain.py
short/3D/PyLith/trunk/pylith/materials/ElasticPlaneStress.py
short/3D/PyLith/trunk/pylith/materials/ElasticStrain1D.py
short/3D/PyLith/trunk/pylith/materials/ElasticStress1D.py
short/3D/PyLith/trunk/pylith/materials/GenMaxwellIsotropic3D.py
short/3D/PyLith/trunk/pylith/materials/Material.py
short/3D/PyLith/trunk/pylith/materials/MaxwellIsotropic3D.py
short/3D/PyLith/trunk/pylith/meshio/OutputManager.py
short/3D/PyLith/trunk/pylith/meshio/OutputMatElastic.py
short/3D/PyLith/trunk/pylith/problems/Formulation.py
Log:
Adjusted vertex and cell field accessors to include fields manager (for access to solution). Reorganized Python level stuff for state-variable output (material).
Modified: short/3D/PyLith/trunk/TODO
===================================================================
--- short/3D/PyLith/trunk/TODO 2008-02-13 20:36:12 UTC (rev 9317)
+++ short/3D/PyLith/trunk/TODO 2008-02-13 21:09:06 UTC (rev 9318)
@@ -4,8 +4,6 @@
Release 1.1
- 1. Finish Neumann BC [CHARLES]
-
2. Reimplement SolutionIO [BRAD & MATT]
b. Implement output of material information.
i. CellFilterAvg (average data over quadrature points)
Modified: short/3D/PyLith/trunk/libsrc/faults/Fault.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/Fault.hh 2008-02-13 20:36:12 UTC (rev 9317)
+++ short/3D/PyLith/trunk/libsrc/faults/Fault.hh 2008-02-13 21:09:06 UTC (rev 9318)
@@ -32,6 +32,10 @@
class Fault;
class TestFault; // unit testing
} // faults
+
+ namespace topology {
+ class FieldsManager;
+ } // topology
} // pylith
/// Namespace for spatialdata package
@@ -123,26 +127,30 @@
* @param fieldType Type of field.
* @param name Name of vertex field.
* @param mesh PETSc mesh for problem.
+ * @param fields Fields manager.
* @returns Vertex field.
*/
virtual
const ALE::Obj<real_section_type>&
vertexField(VectorFieldEnum* fieldType,
const char* name,
- const ALE::Obj<Mesh>& mesh) = 0;
+ const ALE::Obj<Mesh>& mesh,
+ topology::FieldsManager* const fields) = 0;
/** Get cell field associated with integrator.
*
* @param fieldType Type of field.
* @param name Name of cell field.
* @param mesh PETSc mesh for problem.
+ * @param fields Fields manager.
* @returns Cell field.
*/
virtual
const ALE::Obj<real_section_type>&
cellField(VectorFieldEnum* fieldType,
const char* name,
- const ALE::Obj<Mesh>& mesh) = 0;
+ const ALE::Obj<Mesh>& mesh,
+ topology::FieldsManager* const fields) = 0;
// NOT IMPLEMENTED ////////////////////////////////////////////////////
private :
Modified: short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDyn.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDyn.cc 2008-02-13 20:36:12 UTC (rev 9317)
+++ short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDyn.cc 2008-02-13 21:09:06 UTC (rev 9318)
@@ -118,7 +118,8 @@
const ALE::Obj<pylith::real_section_type>&
pylith::faults::FaultCohesiveDyn::vertexField(VectorFieldEnum* fieldType,
const char* name,
- const ALE::Obj<Mesh>& mesh)
+ const ALE::Obj<Mesh>& mesh,
+ topology::FieldsManager* fields)
{ // vertexField
// Should not reach this point if requested field was found
std::ostringstream msg;
@@ -135,7 +136,8 @@
const ALE::Obj<pylith::real_section_type>&
pylith::faults::FaultCohesiveDyn::cellField(VectorFieldEnum* fieldType,
const char* name,
- const ALE::Obj<Mesh>& mesh)
+ const ALE::Obj<Mesh>& mesh,
+ topology::FieldsManager* fields)
{ // cellField
// Should not reach this point if requested field was found
std::ostringstream msg;
Modified: short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDyn.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDyn.hh 2008-02-13 20:36:12 UTC (rev 9317)
+++ short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDyn.hh 2008-02-13 21:09:06 UTC (rev 9318)
@@ -106,24 +106,30 @@
* @param fieldType Type of field.
* @param name Name of vertex field.
* @param mesh PETSc mesh for problem.
+ * @param fields Fields manager.
+ *
* @returns Vertex field.
*/
const ALE::Obj<real_section_type>&
vertexField(VectorFieldEnum* fieldType,
const char* name,
- const ALE::Obj<Mesh>& mesh);
-
+ const ALE::Obj<Mesh>& mesh,
+ topology::FieldsManager* const fields);
+
/** Get cell field associated with integrator.
*
* @param fieldType Type of field.
* @param name Name of vertex field.
* @param mesh PETSc mesh for problem.
+ * @param fields Fields manager.
+ *
* @returns Cell field.
*/
const ALE::Obj<real_section_type>&
cellField(VectorFieldEnum* fieldType,
const char* name,
- const ALE::Obj<Mesh>& mesh);
+ const ALE::Obj<Mesh>& mesh,
+ topology::FieldsManager* const fields);
// PROTECTED METHODS //////////////////////////////////////////////////
protected :
Modified: short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc 2008-02-13 20:36:12 UTC (rev 9317)
+++ short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc 2008-02-13 21:09:06 UTC (rev 9318)
@@ -666,7 +666,8 @@
pylith::faults::FaultCohesiveKin::vertexField(
VectorFieldEnum* fieldType,
const char* name,
- const ALE::Obj<Mesh>& mesh)
+ const ALE::Obj<Mesh>& mesh,
+ topology::FieldsManager* fields)
{ // vertexField
assert(!_faultMesh.isNull());
assert(!_orientation.isNull());
@@ -675,53 +676,63 @@
const int cohesiveDim = _faultMesh->getDimension();
if (0 == strcasecmp("slip", name)) {
+ _allocateBufferVertexVector();
assert(!_slip.isNull());
- _allocateBufferVertexVector();
_projectCohesiveVertexField(&_bufferVertexVector, _slip, mesh);
*fieldType = VECTOR_FIELD;
return _bufferVertexVector;
+
} else if (cohesiveDim > 0 && 0 == strcasecmp("strike_dir", name)) {
_allocateBufferVertexVector();
const ALE::Obj<real_section_type>& strikeDir =
_orientation->getFibration(0);
+ assert(!strikeDir.isNull());
_projectCohesiveVertexField(&_bufferVertexVector, strikeDir, mesh);
*fieldType = VECTOR_FIELD;
return _bufferVertexVector;
+
} else if (2 == cohesiveDim && 0 == strcasecmp("dip_dir", name)) {
_allocateBufferVertexVector();
const ALE::Obj<real_section_type>& dipDir =
_orientation->getFibration(1);
+ assert(!dipDir.isNull());
_projectCohesiveVertexField(&_bufferVertexVector, dipDir, mesh);
*fieldType = VECTOR_FIELD;
return _bufferVertexVector;
+
} else if (0 == strcasecmp("normal_dir", name)) {
_allocateBufferVertexVector();
const int space =
(0 == cohesiveDim) ? 0 : (1 == cohesiveDim) ? 1 : 2;
const ALE::Obj<real_section_type>& normalDir =
_orientation->getFibration(space);
+ assert(!normalDir.isNull());
_projectCohesiveVertexField(&_bufferVertexVector, normalDir, mesh);
*fieldType = VECTOR_FIELD;
return _bufferVertexVector;
+
} else if (0 == strcasecmp("final_slip", name)) {
_allocateBufferVertexVector();
const ALE::Obj<real_section_type>& finalSlip = _eqsrc->finalSlip();
+ assert(!finalSlip.isNull());
_projectCohesiveVertexField(&_bufferVertexVector, finalSlip, mesh);
*fieldType = VECTOR_FIELD;
return _bufferVertexVector;
+
} else if (0 == strcasecmp("slip_time", name)) {
_allocateBufferVertexScalar();
const ALE::Obj<real_section_type>& slipTime = _eqsrc->slipTime();
+ assert(!slipTime.isNull());
_projectCohesiveVertexField(&_bufferVertexScalar, slipTime, mesh);
*fieldType = SCALAR_FIELD;
return _bufferVertexScalar;
- } // if/else
- // Should not reach this point if requested field was found
- std::ostringstream msg;
- msg << "Request for unknown vertex field '" << name
- << "' for fault '" << label() << "'.";
- throw std::runtime_error(msg.str());
+ } else {
+ std::ostringstream msg;
+ msg << "Request for unknown vertex field '" << name
+ << "' for fault '" << label() << "'.";
+ throw std::runtime_error(msg.str());
+ } // else
// Return generic section to satisfy member function definition.
return _bufferVertexScalar;
@@ -733,7 +744,8 @@
pylith::faults::FaultCohesiveKin::cellField(
VectorFieldEnum* fieldType,
const char* name,
- const ALE::Obj<Mesh>& mesh)
+ const ALE::Obj<Mesh>& mesh,
+ topology::FieldsManager* fields)
{ // cellField
assert(!_faultMesh.isNull());
assert(!_orientation.isNull());
Modified: short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.hh 2008-02-13 20:36:12 UTC (rev 9317)
+++ short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.hh 2008-02-13 21:09:06 UTC (rev 9318)
@@ -128,25 +128,29 @@
*
* @param fieldType Type of field.
* @param name Name of vertex field.
- * @param mesh PETSc mesh for problem.
+ * @param mesh PETSc mesh for problem.
+ * @param fields Fields manager.
* @returns Vertex field.
*/
const ALE::Obj<real_section_type>&
vertexField(VectorFieldEnum* fieldType,
const char* name,
- const ALE::Obj<Mesh>& mesh);
+ const ALE::Obj<Mesh>& mesh,
+ topology::FieldsManager* const fields);
/** Get cell field associated with integrator.
*
* @param fieldType Type of field.
* @param name Name of vertex field.
* @param mesh PETSc mesh for problem.
+ * @param fields Fields manager.
* @returns Cell field.
*/
const ALE::Obj<real_section_type>&
cellField(VectorFieldEnum* fieldType,
const char* name,
- const ALE::Obj<Mesh>& mesh);
+ const ALE::Obj<Mesh>& mesh,
+ topology::FieldsManager* const fields);
// PROTECTED METHODS //////////////////////////////////////////////////
protected :
Modified: short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity.cc 2008-02-13 20:36:12 UTC (rev 9317)
+++ short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity.cc 2008-02-13 21:09:06 UTC (rev 9318)
@@ -202,7 +202,7 @@
// ----------------------------------------------------------------------
// Get cell field associated with integrator.
-const ALE::Obj<pylith::real_section_type>&
+ALE::Obj<pylith::real_section_type>
pylith::feassemble::IntegratorElasticity::cellField(
VectorFieldEnum* fieldType,
const char* name,
@@ -214,40 +214,26 @@
// We assume the material stores the total-strain field if
// usesUpdateProperties() is TRUE.
+ ALE::Obj<real_section_type> field;
+
if (!_material->usesUpdateProperties() &&
(0 == strcasecmp(name, "total-strain") ||
0 == strcasecmp(name, "stress")) ) {
-
+ assert(0 != fields);
_calcStrainStressField(&_bufferCellTensor, name, mesh, fields);
- return _bufferCellTensor;
+ field = _bufferCellTensor;
} else if (0 == strcasecmp(name, "stress")) {
int fiberDim = 0;
const ALE::Obj<real_section_type>& strain =
_material->propertyField(&fiberDim, fieldType, "total-strain");
_calcStressFromStrain(&_bufferCellTensor, mesh, strain);
- return _bufferCellTensor;
+ field = _bufferCellTensor;
} else {
int fiberDim = 0;
- const ALE::Obj<real_section_type>& field =
- _material->propertyField(&fiberDim, fieldType, name);
- switch (*fieldType)
- { // switch
- case SCALAR_FIELD :
- _bufferCellScalar = field;
- return _bufferCellScalar;
- break;
- case TENSOR_FIELD :
- _bufferCellTensor = field;
- return _bufferCellTensor;
- break;
- case OTHER_FIELD :
- default:
- _bufferCellOther = field;
- return _bufferCellOther;
- } // switch
+ field = _material->propertyField(&fiberDim, fieldType, name);
} // else
- return _bufferCellScalar;
+ return field;
} // cellField
// ----------------------------------------------------------------------
Modified: short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity.hh 2008-02-13 20:36:12 UTC (rev 9317)
+++ short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity.hh 2008-02-13 21:09:06 UTC (rev 9318)
@@ -94,7 +94,7 @@
* @param fields Fields manager.
* @returns Cell field.
*/
- const ALE::Obj<real_section_type>&
+ ALE::Obj<real_section_type>
cellField(VectorFieldEnum* fieldType,
const char* name,
const ALE::Obj<Mesh>& mesh,
@@ -224,15 +224,9 @@
/// Elastic material associated with integrator
materials::ElasticMaterial* _material;
- /// Scalar field for output of cell information.
- ALE::Obj<real_section_type> _bufferCellScalar;
-
- /// Tensor field for output of cell information.
+ /// Buffer for storing cell tensor field.
ALE::Obj<real_section_type> _bufferCellTensor;
- /// Other field for output of cell information.
- ALE::Obj<real_section_type> _bufferCellOther;
-
}; // IntegratorElasticity
#endif // pylith_feassemble_integratorelasticity_hh
Modified: short/3D/PyLith/trunk/libsrc/materials/Material.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/Material.cc 2008-02-13 20:36:12 UTC (rev 9317)
+++ short/3D/PyLith/trunk/libsrc/materials/Material.cc 2008-02-13 21:09:06 UTC (rev 9318)
@@ -156,6 +156,8 @@
while (i < _numProperties)
if (0 == strcasecmp(name, _propMetaData[i].name))
break;
+ else
+ ++i;
if (i < _numProperties) {
*fiberDim = _propMetaData[i].fiberDim;
*fieldType = _propMetaData[i].fieldType;
Modified: short/3D/PyLith/trunk/libsrc/meshio/DataWriterVTK.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/meshio/DataWriterVTK.cc 2008-02-13 20:36:12 UTC (rev 9317)
+++ short/3D/PyLith/trunk/libsrc/meshio/DataWriterVTK.cc 2008-02-13 21:09:06 UTC (rev 9318)
@@ -143,14 +143,8 @@
assert(0 != name);
try {
- std::string labelName;
- PetscErrorCode err = 0;
-
- if (mesh->hasLabel("censored depth")) {
- labelName = "censored depth";
- } else {
- labelName = "depth";
- }
+ const std::string labelName =
+ (mesh->hasLabel("censored depth")) ? "censored depth" : "depth";
const ALE::Obj<Mesh::numbering_type>& numbering =
mesh->getFactory()->getNumbering(mesh, labelName, 0);
@@ -159,8 +153,8 @@
const int enforceDim = (fieldType != VECTOR_FIELD) ? fiberDim : 3;
if (!_wroteVertexHeader) {
- err = PetscViewerASCIIPrintf(_viewer, "POINT_DATA %d\n",
- numbering->getGlobalSize());
+ PetscErrorCode err = PetscViewerASCIIPrintf(_viewer, "POINT_DATA %d\n",
+ numbering->getGlobalSize());
if (err)
throw std::runtime_error("Could not write VTK point data header.");
_wroteVertexHeader = true;
Modified: short/3D/PyLith/trunk/modulesrc/faults/faults.pyxe.src
===================================================================
--- short/3D/PyLith/trunk/modulesrc/faults/faults.pyxe.src 2008-02-13 20:36:12 UTC (rev 9317)
+++ short/3D/PyLith/trunk/modulesrc/faults/faults.pyxe.src 2008-02-13 21:09:06 UTC (rev 9318)
@@ -192,12 +192,12 @@
return
- def vertexField(self, name, mesh):
+ def vertexField(self, name, mesh, fields=None):
"""
Get vertex field.
"""
# create shim for method 'vertexField'
- #embed{ void* Fault_vertexField(void* objVptr, int* fieldPtr, char* name, void* meshVptr)
+ #embed{ void* Fault_vertexField(void* objVptr, int* fieldPtr, char* name, void* meshVptr, void* fieldsVptr)
void* result = 0;
try {
assert(0 != objVptr);
@@ -206,9 +206,11 @@
assert(0 != meshVptr);
pylith::faults::Fault* fault = (pylith::faults::Fault*) objVptr;
ALE::Obj<ALE::Mesh>* mesh = (ALE::Obj<ALE::Mesh>*) meshVptr;
+ pylith::topology::FieldsManager* fields =
+ (pylith::topology::FieldsManager*) fieldsVptr;
pylith::VectorFieldEnum fieldType;
const ALE::Obj<pylith::real_section_type>& field =
- fault->vertexField(&fieldType, name, *mesh);
+ fault->vertexField(&fieldType, name, *mesh, fields);
*fieldPtr = fieldType;
result = (void*) &field;
} catch (const std::exception& err) {
@@ -227,18 +229,28 @@
raise TypeError, \
"Argument 'mesh' must be extension module type " \
"'pylith::topology::Mesh'."
+ if None != fields:
+ if not fields.name == "pylith_topology_FieldsManager":
+ raise TypeError, \
+ "Argument 'fields' must be extension module type " \
+ "'pylith::topology::FieldsManager'."
cdef void* ptr
cdef int fieldType
- ptr = Fault_vertexField(self.thisptr, &fieldType, name, ptrFromHandle(mesh))
+ if None != fields:
+ ptr = Fault_vertexField(self.thisptr, &fieldType, name,
+ ptrFromHandle(mesh), ptrFromHandle(fields))
+ else:
+ ptr = Fault_vertexField(self.thisptr, &fieldType, name,
+ ptrFromHandle(mesh), NULL)
return (PyCObject_FromVoidPtr(ptr, NULL), fieldType)
- def cellField(self, name, mesh):
+ def cellField(self, name, mesh, fields=None):
"""
Get cell field.
"""
# create shim for method 'cellField'
- #embed{ void* Fault_cellField(void* objVptr, int* fieldPtr, char* name, void* meshVptr)
+ #embed{ void* Fault_cellField(void* objVptr, int* fieldPtr, char* name, void* meshVptr, void* fieldsVptr)
void* result = 0;
try {
assert(0 != objVptr);
@@ -247,9 +259,11 @@
assert(0 != meshVptr);
pylith::faults::Fault* fault = (pylith::faults::Fault*) objVptr;
ALE::Obj<ALE::Mesh>* mesh = (ALE::Obj<ALE::Mesh>*) meshVptr;
+ pylith::topology::FieldsManager* fields =
+ (pylith::topology::FieldsManager*) fieldsVptr;
pylith::VectorFieldEnum fieldType;
const ALE::Obj<pylith::real_section_type>& field =
- fault->cellField(&fieldType, name, *mesh);
+ fault->cellField(&fieldType, name, *mesh, fields);
*fieldPtr = fieldType;
result = (void*) &field;
} catch (const std::exception& err) {
@@ -268,9 +282,19 @@
raise TypeError, \
"Argument 'mesh' must be extension module type " \
"'pylith::topology::Mesh'."
+ if None != fields:
+ if not fields.name == "pylith_topology_FieldsManager":
+ raise TypeError, \
+ "Argument 'fields' must be extension module type " \
+ "'pylith::topology::FieldsManager'."
cdef void* ptr
cdef int fieldType
- ptr = Fault_cellField(self.thisptr, &fieldType, name, ptrFromHandle(mesh))
+ if None != fields:
+ ptr = Fault_cellField(self.thisptr, &fieldType, name,
+ ptrFromHandle(mesh), ptrFromHandle(fields))
+ else:
+ ptr = Fault_cellField(self.thisptr, &fieldType, name,
+ ptrFromHandle(mesh), NULL)
return (PyCObject_FromVoidPtr(ptr, NULL), fieldType)
Modified: short/3D/PyLith/trunk/modulesrc/feassemble/feassemble.pyxe.src
===================================================================
--- short/3D/PyLith/trunk/modulesrc/feassemble/feassemble.pyxe.src 2008-02-13 20:36:12 UTC (rev 9317)
+++ short/3D/PyLith/trunk/modulesrc/feassemble/feassemble.pyxe.src 2008-02-13 21:09:06 UTC (rev 9318)
@@ -35,6 +35,7 @@
#include "pylith/feassemble/Quadrature3D.hh"
#include "pylith/feassemble/Integrator.hh"
+#include "pylith/feassemble/IntegratorElasticity.hh"
#include "pylith/feassemble/ElasticityExplicit.hh"
#include "pylith/feassemble/ElasticityImplicit.hh"
@@ -61,6 +62,22 @@
void* malloc(size_t size)
void free(void* mem)
+cdef void Section_destructor(void* obj):
+ """
+ Destroy ALE::Obj<real_section_type> object.
+ """
+ # create shim for destructor
+ #embed{ void Section_destructor_cpp(void* objVptr)
+ ALE::Obj<pylith::real_section_type>* field =
+ (ALE::Obj<pylith::real_section_type>*) objVptr;
+ assert(0 != field);
+ assert(!field->isNull());
+ delete *field;
+ #}embed
+ Section_destructor_cpp(obj)
+ return
+
+# ----------------------------------------------------------------------
cdef void CellGeometry_destructor(void* obj):
"""
Destroy CellGeometry object.
@@ -74,48 +91,6 @@
CellGeometry_destructor_cpp(obj)
return
-cdef void Quadrature_destructor(void* obj):
- """
- Destroy Quadrature object.
- """
- # create shim for destructor
- #embed{ void Quadrature_destructor_cpp(void* objVptr)
- pylith::feassemble::Quadrature* pQ =
- (pylith::feassemble::Quadrature*) objVptr;
- delete pQ;
- #}embed
- Quadrature_destructor_cpp(obj)
- return
-
-cdef void Integrator_destructor(void* obj):
- """
- Destroy Integrator object.
- """
- # create shim for destructor
- #embed{ void Integrator_destructor_cpp(void* objVptr)
- pylith::feassemble::Integrator* pQ =
- (pylith::feassemble::Integrator*) objVptr;
- delete pQ;
- #}embed
- Integrator_destructor_cpp(obj)
- return
-
-
-cdef void Constraint_destructor(void* obj):
- """
- Destroy Constraint object.
- """
- # create shim for destructor
- #embed{ void Constraint_destructor_cpp(void* objVptr)
- pylith::feassemble::Constraint* pQ =
- (pylith::feassemble::Constraint*) objVptr;
- delete pQ;
- #}embed
- Constraint_destructor_cpp(obj)
- return
-
-
-# ----------------------------------------------------------------------
cdef class CellGeometry:
cdef void* thisptr # Pointer to C++ object
@@ -498,6 +473,19 @@
# ----------------------------------------------------------------------
+cdef void Quadrature_destructor(void* obj):
+ """
+ Destroy Quadrature object.
+ """
+ # create shim for destructor
+ #embed{ void Quadrature_destructor_cpp(void* objVptr)
+ pylith::feassemble::Quadrature* pQ =
+ (pylith::feassemble::Quadrature*) objVptr;
+ delete pQ;
+ #}embed
+ Quadrature_destructor_cpp(obj)
+ return
+
cdef class Quadrature:
cdef void* thisptr # Pointer to C++ object
@@ -920,6 +908,20 @@
# ----------------------------------------------------------------------
+cdef void Integrator_destructor(void* obj):
+ """
+ Destroy Integrator object.
+ """
+ # create shim for destructor
+ #embed{ void Integrator_destructor_cpp(void* objVptr)
+ pylith::feassemble::Integrator* pQ =
+ (pylith::feassemble::Integrator*) objVptr;
+ delete pQ;
+ #}embed
+ Integrator_destructor_cpp(obj)
+ return
+
+
cdef class Integrator:
cdef void* thisptr # Pointer to C++ object
@@ -1229,19 +1231,38 @@
# ----------------------------------------------------------------------
-cdef class ElasticityExplicit(Integrator):
+cdef class IntegratorElasticity(Integrator):
def __init__(self):
"""
Constructor.
"""
- # create shim for constructor
- #embed{ void* ElasticityExplicit_constructor()
+ Integrator.__init__(self)
+ return
+
+
+ def cellField(self, name, mesh, fields=None):
+ """
+ Get cell field.
+ """
+ # create shim for method 'cellField'
+ #embed{ void* IntegratorElasticity_cellField(void* objVptr, int* fieldPtr, char* name, void* meshVptr, void* fieldsVptr)
void* result = 0;
try {
- result = (void*)(new pylith::feassemble::ElasticityExplicit);
- assert(0 != result);
- } catch (const std::exception& err) {
+ assert(0 != objVptr);
+ assert(0 != fieldPtr);
+ assert(0 != name);
+ assert(0 != meshVptr);
+ pylith::feassemble::IntegratorElasticity* integrator = (pylith::feassemble::IntegratorElasticity*) objVptr;
+ ALE::Obj<ALE::Mesh>* mesh = (ALE::Obj<ALE::Mesh>*) meshVptr;
+ pylith::topology::FieldsManager* fields =
+ (pylith::topology::FieldsManager*) fieldsVptr;
+ pylith::VectorFieldEnum fieldType;
+ const ALE::Obj<pylith::real_section_type>& field =
+ integrator->cellField(&fieldType, name, *mesh, fields);
+ *fieldPtr = fieldType;
+ result = (void*) &field;
+ } catch (const std::exception& err) {
PyErr_SetString(PyExc_RuntimeError,
const_cast<char*>(err.what()));
} catch (const ALE::Exception& err) {
@@ -1253,25 +1274,39 @@
} // try/catch
return result;
#}embed
+ if not mesh.name == "pylith_topology_Mesh":
+ raise TypeError, \
+ "Argument 'mesh' must be extension module type " \
+ "'pylith::topology::Mesh'."
+ if None != fields:
+ if not fields.name == "pylith_topology_FieldsManager":
+ raise TypeError, \
+ "Argument 'fields' must be extension module type " \
+ "'pylith::topology::FieldsManager'."
+ cdef void* ptr
+ cdef int fieldType
+ if None != fields:
+ ptr = IntegratorElasticity_cellField(self.thisptr, &fieldType, name,
+ ptrFromHandle(mesh),
+ ptrFromHandle(fields))
+ else:
+ ptr = IntegratorElasticity_cellField(self.thisptr, &fieldType, name,
+ ptrFromHandle(mesh), NULL)
+ return (PyCObject_FromVoidPtr(ptr, NULL), fieldType)
+
- Integrator.__init__(self)
- self.thisptr = ElasticityExplicit_constructor()
- self.handle = self._createHandle()
- return
-
-
property material:
def __set__(self, m):
"""
Set material.
"""
# create shim for method 'material'
- #embed{ void ElasticityExplicit_material_set(void* objVptr, void* mVptr)
+ #embed{ void IntegratorElasticity_material_set(void* objVptr, void* mVptr)
try {
assert(0 != objVptr);
pylith::materials::ElasticMaterial* material =
(pylith::materials::ElasticMaterial*) mVptr;
- ((pylith::feassemble::ElasticityExplicit*) objVptr)->material(material);
+ ((pylith::feassemble::IntegratorElasticity*) objVptr)->material(material);
} catch (const std::exception& err) {
PyErr_SetString(PyExc_RuntimeError,
const_cast<char*>(err.what()));
@@ -1286,17 +1321,49 @@
if not m.name == "pylith_materials_ElasticMaterial":
raise TypeError, \
"Argument must be extension module type 'ElasticMaterial'."
- ElasticityExplicit_material_set(self.thisptr, ptrFromHandle(m))
+ IntegratorElasticity_material_set(self.thisptr, ptrFromHandle(m))
# ----------------------------------------------------------------------
-cdef class ElasticityImplicit(Integrator):
+cdef class ElasticityExplicit(IntegratorElasticity):
def __init__(self):
"""
Constructor.
"""
# create shim for constructor
+ #embed{ void* ElasticityExplicit_constructor()
+ void* result = 0;
+ try {
+ result = (void*)(new pylith::feassemble::ElasticityExplicit);
+ assert(0 != result);
+ } 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
+ return result;
+ #}embed
+
+ Integrator.__init__(self)
+ self.thisptr = ElasticityExplicit_constructor()
+ self.handle = self._createHandle()
+ return
+
+
+# ----------------------------------------------------------------------
+cdef class ElasticityImplicit(IntegratorElasticity):
+
+ def __init__(self):
+ """
+ Constructor.
+ """
+ # create shim for constructor
#embed{ void* ElasticityImplicit_constructor()
void* result = 0;
try {
@@ -1321,36 +1388,21 @@
return
- property material:
- def __set__(self, m):
- """
- Set material.
- """
- # create shim for method 'material'
- #embed{ void ElasticityImplicit_material_set(void* objVptr, void* mVptr)
- try {
- assert(0 != objVptr);
- pylith::materials::ElasticMaterial* material =
- (pylith::materials::ElasticMaterial*) mVptr;
- ((pylith::feassemble::ElasticityImplicit*) objVptr)->material(material);
- } 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 m.name == "pylith_materials_ElasticMaterial":
- raise TypeError, \
- "Argument must be extension module type 'ElasticMaterial'."
- ElasticityImplicit_material_set(self.thisptr, ptrFromHandle(m))
+# ----------------------------------------------------------------------
+cdef void Constraint_destructor(void* obj):
+ """
+ Destroy Constraint object.
+ """
+ # create shim for destructor
+ #embed{ void Constraint_destructor_cpp(void* objVptr)
+ pylith::feassemble::Constraint* pQ =
+ (pylith::feassemble::Constraint*) objVptr;
+ delete pQ;
+ #}embed
+ Constraint_destructor_cpp(obj)
+ return
-# ----------------------------------------------------------------------
cdef class Constraint:
cdef void* thisptr # Pointer to C++ object
Modified: short/3D/PyLith/trunk/pylith/faults/Fault.py
===================================================================
--- short/3D/PyLith/trunk/pylith/faults/Fault.py 2008-02-13 20:36:12 UTC (rev 9317)
+++ short/3D/PyLith/trunk/pylith/faults/Fault.py 2008-02-13 21:09:06 UTC (rev 9318)
@@ -196,12 +196,12 @@
return
- def poststep(self, t, dt, totalTime):
+ def poststep(self, t, dt, totalTime, fields):
"""
Hook for doing stuff after advancing time step.
"""
self._info.log("Writing fault data.")
- self.output.writeData(t+dt)
+ self.output.writeData(t+dt, fields)
return
@@ -212,19 +212,19 @@
return (self.faultMesh, None, None)
- def getVertexField(self, name):
+ def getVertexField(self, name, fields=None):
"""
Get vertex field.
"""
- raise NotImplementedError("Material.getVertexField() not implemented.")
+ raise NotImplementedError("Fault.getVertexField() not implemented.")
return
- def getCellField(self, name):
+ def getCellField(self, name, fields=None):
"""
Get cell field.
"""
- raise NotImplementedError("Material.getCellField() not implemented.")
+ raise NotImplementedError("Fault.getCellField() not implemented.")
return
Modified: short/3D/PyLith/trunk/pylith/faults/FaultCohesiveKin.py
===================================================================
--- short/3D/PyLith/trunk/pylith/faults/FaultCohesiveKin.py 2008-02-13 20:36:12 UTC (rev 9317)
+++ short/3D/PyLith/trunk/pylith/faults/FaultCohesiveKin.py 2008-02-13 21:09:06 UTC (rev 9318)
@@ -126,31 +126,43 @@
return
- def poststep(self, t, dt, totalTime):
+ def poststep(self, t, dt, totalTime, fields):
"""
Hook for doing stuff after advancing time step.
"""
logEvent = "%spoststep" % self._loggingPrefix
self._logger.eventBegin(logEvent)
- FaultCohesive.poststep(self, t, dt, totalTime)
+ FaultCohesive.poststep(self, t, dt, totalTime, fields)
self._logger.eventEnd(logEvent)
return
- def getVertexField(self, name):
+ def getVertexField(self, name, fields=None):
"""
Get vertex field.
"""
- return self.cppHandle.vertexField(name, self.mesh.cppHandle)
+ if None == fields:
+ (field, fieldType) = self.cppHandle.vertexField(name,
+ self.mesh.cppHandle)
+ else:
+ (field, fieldType) = self.cppHandle.vertexField(name,
+ self.mesh.cppHandle,
+ fields.cppHandle)
+ return (field, fieldType)
- def getCellField(self, name):
+ def getCellField(self, name, fields=None):
"""
Get cell field.
"""
- return self.cppHandle.cellField(name, self.mesh.cppHandle)
+ if None == fields:
+ (field, fieldType) = self.cppHandle.cellField(name, self.mesh.cppHandle)
+ else:
+ (field, fieldType) = self.cppHandle.cellField(name, self.mesh.cppHandle,
+ fields.cppHandle)
+ return (field, fieldType)
# PRIVATE METHODS ////////////////////////////////////////////////////
Modified: short/3D/PyLith/trunk/pylith/feassemble/Constraint.py
===================================================================
--- short/3D/PyLith/trunk/pylith/feassemble/Constraint.py 2008-02-13 20:36:12 UTC (rev 9317)
+++ short/3D/PyLith/trunk/pylith/feassemble/Constraint.py 2008-02-13 21:09:06 UTC (rev 9318)
@@ -141,7 +141,7 @@
return
- def poststep(self, t, dt, totalTime):
+ def poststep(self, t, dt, totalTime, fields):
"""
Hook for doing stuff after advancing time step.
"""
Modified: short/3D/PyLith/trunk/pylith/feassemble/Integrator.py
===================================================================
--- short/3D/PyLith/trunk/pylith/feassemble/Integrator.py 2008-02-13 20:36:12 UTC (rev 9317)
+++ short/3D/PyLith/trunk/pylith/feassemble/Integrator.py 2008-02-13 21:09:06 UTC (rev 9318)
@@ -179,7 +179,7 @@
return
- def poststep(self, t, dt, totalTime):
+ def poststep(self, t, dt, totalTime, fields):
"""
Hook for doing stuff after advancing time step.
"""
Modified: short/3D/PyLith/trunk/pylith/feassemble/IntegratorElasticity.py
===================================================================
--- short/3D/PyLith/trunk/pylith/feassemble/IntegratorElasticity.py 2008-02-13 20:36:12 UTC (rev 9317)
+++ short/3D/PyLith/trunk/pylith/feassemble/IntegratorElasticity.py 2008-02-13 21:09:06 UTC (rev 9318)
@@ -35,6 +35,9 @@
Integrator.__init__(self)
import journal
self._info = journal.info(name)
+ self.output = None
+ self.availableFields = None
+ self.name = "Integrator Elasticity"
return
@@ -54,6 +57,9 @@
self.material = material
self.cppHandle.material = self.material.cppHandle
+ self.output = material.output
+ self.availableFields = material.availableFields
+ self.output.preinitialize(self)
return
@@ -63,6 +69,7 @@
"""
Integrator.verifyConfiguration(self)
self.material.verifyConfiguration()
+ self.output.verifyConfiguration()
return
@@ -77,22 +84,45 @@
self.material.label)
self.material.initialize(self.mesh, totalTime, numTimeSteps)
+ self.output.initialize(self.quadrature.cppHandle)
+ #self.output.writeInfo()
+ #self.output.open(totalTime, numTimeSteps)
self._logger.eventEnd(logEvent)
return
- def poststep(self, t, dt, totalTime):
+ def poststep(self, t, dt, totalTime, fields):
"""
Hook for doing stuff after advancing time step.
"""
logEvent = "%spoststep" % self._loggingPrefix
self._logger.eventBegin(logEvent)
- self.material.poststep(t, dt, totalTime)
+ self._info.log("Writing material data.")
+ #self.output.writeData(t+dt, fields)
self._logger.eventEnd(logEvent)
return
+ def getDataMesh(self):
+ """
+ Get mesh associated with data fields.
+ """
+ return self.material.getDataMesh()
+
+
+ def getCellField(self, name, fields=None):
+ """
+ Get cell field.
+ """
+ if None == fields:
+ (field, fieldType) = self.cppHandle.cellField(name, self.mesh.cppHandle)
+ else:
+ (field, fieldType) = self.cppHandle.cellField(name, self.mesh.cppHandle,
+ fields.cppHandle)
+ return (field, fieldType)
+
+
# End of file
Modified: short/3D/PyLith/trunk/pylith/materials/ElasticIsotropic3D.py
===================================================================
--- short/3D/PyLith/trunk/pylith/materials/ElasticIsotropic3D.py 2008-02-13 20:36:12 UTC (rev 9317)
+++ short/3D/PyLith/trunk/pylith/materials/ElasticIsotropic3D.py 2008-02-13 21:09:06 UTC (rev 9318)
@@ -38,7 +38,7 @@
{'info': [],
'data': []},
'cell': \
- {'info': ["Lame mu", "Lame lambda", "density"],
+ {'info': ["mu", "lambda", "density"],
'data': []}}
return
Modified: short/3D/PyLith/trunk/pylith/materials/ElasticPlaneStrain.py
===================================================================
--- short/3D/PyLith/trunk/pylith/materials/ElasticPlaneStrain.py 2008-02-13 20:36:12 UTC (rev 9317)
+++ short/3D/PyLith/trunk/pylith/materials/ElasticPlaneStrain.py 2008-02-13 21:09:06 UTC (rev 9318)
@@ -40,7 +40,7 @@
{'info': [],
'data': []},
'cell': \
- {'info': ["Lame mu", "Lame lambda", "density"],
+ {'info': ["mu", "lambda", "density"],
'data': []}}
return
Modified: short/3D/PyLith/trunk/pylith/materials/ElasticPlaneStress.py
===================================================================
--- short/3D/PyLith/trunk/pylith/materials/ElasticPlaneStress.py 2008-02-13 20:36:12 UTC (rev 9317)
+++ short/3D/PyLith/trunk/pylith/materials/ElasticPlaneStress.py 2008-02-13 21:09:06 UTC (rev 9318)
@@ -40,7 +40,7 @@
{'info': [],
'data': []},
'cell': \
- {'info': ["Lame mu", "Lame lambda", "density"],
+ {'info': ["mu", "lambda", "density"],
'data': []}}
return
Modified: short/3D/PyLith/trunk/pylith/materials/ElasticStrain1D.py
===================================================================
--- short/3D/PyLith/trunk/pylith/materials/ElasticStrain1D.py 2008-02-13 20:36:12 UTC (rev 9317)
+++ short/3D/PyLith/trunk/pylith/materials/ElasticStrain1D.py 2008-02-13 21:09:06 UTC (rev 9318)
@@ -39,7 +39,7 @@
{'info': [],
'data': []},
'cell': \
- {'info': ["Lame mu", "Lame lambda", "density"],
+ {'info': ["mu", "lambda", "density"],
'data': []}}
return
Modified: short/3D/PyLith/trunk/pylith/materials/ElasticStress1D.py
===================================================================
--- short/3D/PyLith/trunk/pylith/materials/ElasticStress1D.py 2008-02-13 20:36:12 UTC (rev 9317)
+++ short/3D/PyLith/trunk/pylith/materials/ElasticStress1D.py 2008-02-13 21:09:06 UTC (rev 9318)
@@ -39,7 +39,7 @@
{'info': [],
'data': []},
'cell': \
- {'info': ["Lame mu", "Lame lambda", "density"],
+ {'info': ["mu", "lambda", "density"],
'data': []}}
return
Modified: short/3D/PyLith/trunk/pylith/materials/GenMaxwellIsotropic3D.py
===================================================================
--- short/3D/PyLith/trunk/pylith/materials/GenMaxwellIsotropic3D.py 2008-02-13 20:36:12 UTC (rev 9317)
+++ short/3D/PyLith/trunk/pylith/materials/GenMaxwellIsotropic3D.py 2008-02-13 21:09:06 UTC (rev 9318)
@@ -38,8 +38,8 @@
{'info': [],
'data': []},
'cell': \
- {'info': ["Lame mu", "Lame lambda", "density"],
- 'data': []}}
+ {'info': ["mu", "lambda", "density", "shear-ratio", "Maxwell-time"],
+ 'data': ["total-strain", "viscous-strain", "stress"]}}
return
Modified: short/3D/PyLith/trunk/pylith/materials/Material.py
===================================================================
--- short/3D/PyLith/trunk/pylith/materials/Material.py 2008-02-13 20:36:12 UTC (rev 9317)
+++ short/3D/PyLith/trunk/pylith/materials/Material.py 2008-02-13 21:09:06 UTC (rev 9318)
@@ -95,8 +95,6 @@
self.cppHandle.id = self.id
self.cppHandle.label = self.label
self.quadrature.preinitialize()
- if None != self.output:
- self.output.preinitialize(self)
return
@@ -115,9 +113,6 @@
# fact that any given processor may only have a subset of the
# materials)
- if None != self.output:
- self.output.verifyConfiguration()
-
return
@@ -133,23 +128,9 @@
self.cppHandle.initialize(mesh.cppHandle, mesh.coordsys.cppHandle,
self.quadrature.cppHandle)
- if None != self.output:
- self.output.initialize(self.quadrature.cppHandle)
- self.output.writeInfo()
- self.output.open(totalTime, numTimeSteps)
return
- def poststep(self, t, dt, totalTime):
- """
- Hook for doing stuff after advancing time step.
- """
- if None != self.output:
- self._info.log("Writing material data.")
- self.output.writeData(t+dt)
- return
-
-
def getDataMesh(self):
"""
Get mesh associated with data fields.
@@ -157,22 +138,6 @@
return (self.mesh, "material-id", self.id)
- def getVertexField(self, name):
- """
- Get vertex field.
- """
- raise NotImplementedError("Material.getVertexField() not implemented.")
- return
-
-
- def getCellField(self, name):
- """
- Get cell field.
- """
- raise NotImplementedError("Material.getCellField() not implemented.")
- return
-
-
# PRIVATE METHODS ////////////////////////////////////////////////////
def _configure(self):
Modified: short/3D/PyLith/trunk/pylith/materials/MaxwellIsotropic3D.py
===================================================================
--- short/3D/PyLith/trunk/pylith/materials/MaxwellIsotropic3D.py 2008-02-13 20:36:12 UTC (rev 9317)
+++ short/3D/PyLith/trunk/pylith/materials/MaxwellIsotropic3D.py 2008-02-13 21:09:06 UTC (rev 9318)
@@ -38,8 +38,8 @@
{'info': [],
'data': []},
'cell': \
- {'info': ["Lame mu", "Lame lambda", "density"],
- 'data': []}}
+ {'info': ["mu", "lambda", "density", "Maxwell-time"],
+ 'data': ["total-strain", "viscous-strain", "stress"]}}
return
Modified: short/3D/PyLith/trunk/pylith/meshio/OutputManager.py
===================================================================
--- short/3D/PyLith/trunk/pylith/meshio/OutputManager.py 2008-02-13 20:36:12 UTC (rev 9317)
+++ short/3D/PyLith/trunk/pylith/meshio/OutputManager.py 2008-02-13 21:09:06 UTC (rev 9318)
@@ -207,10 +207,10 @@
self.cppHandle.appendVertexField(t.value, name, field, fieldType,
mesh.cppHandle)
- #for name in self.cellInfoFields:
- # (field, fieldType) = self.dataProvider.getCellField(name)
- # self.cppHandle.appendCellField(t.value, name, field, fieldType,
- # mesh.cppHandle)
+ for name in self.cellInfoFields:
+ (field, fieldType) = self.dataProvider.getCellField(name)
+ self.cppHandle.appendCellField(t.value, name, field, fieldType,
+ mesh.cppHandle)
self.cppHandle.closeTimeStep()
self.close()
@@ -219,7 +219,7 @@
return
- def writeData(self, t):
+ def writeData(self, t, fields):
"""
Write fields at current time step.
"""
@@ -234,12 +234,12 @@
label, labelId)
for name in self.vertexDataFields:
- (field, fieldType) = self.dataProvider.getVertexField(name)
+ (field, fieldType) = self.dataProvider.getVertexField(name, fields)
self.cppHandle.appendVertexField(t.value, name, field, fieldType,
mesh.cppHandle)
for name in self.cellDataFields:
- (field, fieldType) = self.dataProvider.getCellField(name)
+ (field, fieldType) = self.dataProvider.getCellField(name, fields)
self.cppHandle.appendCellField(t.value, name, field, fieldType,
mesh.cppHandle)
Modified: short/3D/PyLith/trunk/pylith/meshio/OutputMatElastic.py
===================================================================
--- short/3D/PyLith/trunk/pylith/meshio/OutputMatElastic.py 2008-02-13 20:36:12 UTC (rev 9317)
+++ short/3D/PyLith/trunk/pylith/meshio/OutputMatElastic.py 2008-02-13 21:09:06 UTC (rev 9318)
@@ -48,8 +48,8 @@
import pyre.inventory
cellInfoFields = pyre.inventory.list("cell_info_fields",
- default=["Lame mu",
- "Lame lambda",
+ default=["mu",
+ "lambda",
"density"])
cellInfoFields.meta['tip'] = "Names of cell info fields to output."
Modified: short/3D/PyLith/trunk/pylith/problems/Formulation.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/Formulation.py 2008-02-13 20:36:12 UTC (rev 9317)
+++ short/3D/PyLith/trunk/pylith/problems/Formulation.py 2008-02-13 21:09:06 UTC (rev 9318)
@@ -211,13 +211,12 @@
self._logger.eventBegin(logEvent)
self._info.log("Writing solution fields.")
- field = self.fields.getSolution()
for output in self.output.bin:
- output.writeData(t+dt)
+ output.writeData(t+dt, self.fields)
for integrator in self.integrators:
- integrator.poststep(t, dt, totalTime)
+ integrator.poststep(t, dt, totalTime, self.fields)
for constraint in self.constraints:
- constraint.poststep(t, dt, totalTime)
+ constraint.poststep(t, dt, totalTime, self.fields)
self._logger.eventEnd(logEvent)
return
@@ -251,14 +250,14 @@
return (self.mesh, None, None)
- def getVertexField(self, name):
+ def getVertexField(self, name, fields):
"""
Get vertex field.
"""
field = None
fieldType = None
if name == "displacements":
- field = self.fields.getSolution()
+ field = fields.getSolution()
fieldType = 1 # vector field
else:
raise ValueError, "Vertex field '%s' not available." % name
More information about the cig-commits
mailing list