[cig-commits] r21337 - short/3D/PyLith/branches/v1.8-mixedfault/libsrc/pylith/faults
rjolivet at geodynamics.org
rjolivet at geodynamics.org
Tue Feb 5 14:14:41 PST 2013
Author: rjolivet
Date: 2013-02-05 14:14:40 -0800 (Tue, 05 Feb 2013)
New Revision: 21337
Modified:
short/3D/PyLith/branches/v1.8-mixedfault/libsrc/pylith/faults/FaultCohesiveDynKin.cc
short/3D/PyLith/branches/v1.8-mixedfault/libsrc/pylith/faults/dkSelector.cc
short/3D/PyLith/branches/v1.8-mixedfault/libsrc/pylith/faults/dkSelector.hh
Log:
DKSelector compiles, yes
Modified: short/3D/PyLith/branches/v1.8-mixedfault/libsrc/pylith/faults/FaultCohesiveDynKin.cc
===================================================================
--- short/3D/PyLith/branches/v1.8-mixedfault/libsrc/pylith/faults/FaultCohesiveDynKin.cc 2013-02-05 21:20:18 UTC (rev 21336)
+++ short/3D/PyLith/branches/v1.8-mixedfault/libsrc/pylith/faults/FaultCohesiveDynKin.cc 2013-02-05 22:14:40 UTC (rev 21337)
@@ -221,6 +221,7 @@
// Get the DynKin Selector using a spatial database.
if (_dkSelector) {
_dkSelector->initialize(*_faultMesh, *_normalizer);
+ _fields->add("Dynamic Kinematic Selector","dynamic_kinematic_selector");
} // if should be useless
logger.stagePop();
@@ -315,12 +316,12 @@
// Get the dkSelector
if (_dkSelector) {
- _fields->add("Dynamic Kinematic Selector","dynamic_kinematic_selector")
topology::Field<topology::SubMesh>& dk = _fields->get("Dynamic Kinematic Selector");
_dkSelector->dk(&dk);
- const ALE::Obj<RealSection>& dkSelSection = dk->section();
- assert(!0 = dkSelSection);
- } else { // should never be here
+ const ALE::Obj<RealSection>& dkSelSection = dk.section();
+ assert(!dkSelSection.isNull());
+ }
+ else { // should never be here
std::ostringstream msg;
msg << "No Dynamic Kinematic Selector available.";
throw std::runtime_error(msg.str());
@@ -671,8 +672,10 @@
// Get the dkSelector
if (_dkSelector) {
- const ALE::Obj<RealSection>& dkSelSection = _dkSelector->dk(_faultMesh);
- assert(dkSelSection);
+ topology::Field<topology::SubMesh>& dk = _fields->get("Dynamic Kinematic Selector");
+ _dkSelector->dk(&dk);
+ const ALE::Obj<RealSection>& dkSelSection = dk.section();
+ assert(!dkSelSection.isNull());
} else { // should never be here
std::ostringstream msg;
msg << "No Dynamic Kinematic Selector available.";
Modified: short/3D/PyLith/branches/v1.8-mixedfault/libsrc/pylith/faults/dkSelector.cc
===================================================================
--- short/3D/PyLith/branches/v1.8-mixedfault/libsrc/pylith/faults/dkSelector.cc 2013-02-05 21:20:18 UTC (rev 21336)
+++ short/3D/PyLith/branches/v1.8-mixedfault/libsrc/pylith/faults/dkSelector.cc 2013-02-05 22:14:40 UTC (rev 21337)
@@ -91,7 +91,7 @@
// Use parameter to go fetch into the spatial data (DKSel is a par array between 0 and 1; >0.5 is kinematic, <=0.5 is dynamic)
delete _parameters;
- _parameters = new topology::FieldsNew<topology::SubMesh>(faultMesh);
+ _parameters = new topology::Fields<topology::Field<topology::SubMesh> >(faultMesh);
_parameters->add("Dynamic Kinematic Selector","dynamic_kinematic_selector");
topology::Field<topology::SubMesh>& DKSel = _parameters->get("Dynamic Kinematic Selector");
DKSel.newSection(vertices, spaceDim);
@@ -143,28 +143,23 @@
// ----------------------------------------------------------------------
// Get dynamic kinematic selector field on fault surface (time will be the argument in the future)
void
-pylith::faults::DKSelector::dk(const topology::Field<topology::SubMesh>& dk)
+pylith::faults::DKSelector::dk(topology::Field<topology::SubMesh>* dk)
{ // dk
assert(0 != _parameters);
// Get fault mesh
- const ALE::Obj<SieveMesh>& sieveMesh = dk.sieveMesh();
+ const ALE::Obj<SieveMesh>& sieveMesh = dk->mesh().sieveMesh();
assert(!sieveMesh.isNull());
const ALE::Obj<label_sequence>& vertices = sieveMesh->depthStratum(0);
assert(!vertices.isNull());
const label_sequence::iterator verticesBegin = vertices->begin();
const label_sequence::iterator verticesEnd = vertices->end();
- // Get the spatial coordinate and the dimension of the problem
- const spatialdata::geocoords::CoordSys* cs = dk.coordsys();
- assert(0 != cs);
- const int spaceDim = cs->spaceDim();
-
// Build the section
const topology::Field<topology::SubMesh>& DKSel = _parameters->get("Dynamic Kinematic Selector");
const ALE::Obj<RealSection>& DKSelSection = DKSel.section();
assert(!DKSelSection.isNull());
- const ALE::Obj<RealSection>& dkSection = dk->section()
+ const ALE::Obj<RealSection>& dkSection = dk->section();
// Iterate over vertices
for (label_sequence::iterator v_iter=verticesBegin;
@@ -185,9 +180,6 @@
} // for
PetscLogFlops(vertices->size());
-
- return dkSection;
-
} // dk
// End of file
Modified: short/3D/PyLith/branches/v1.8-mixedfault/libsrc/pylith/faults/dkSelector.hh
===================================================================
--- short/3D/PyLith/branches/v1.8-mixedfault/libsrc/pylith/faults/dkSelector.hh 2013-02-05 21:20:18 UTC (rev 21336)
+++ short/3D/PyLith/branches/v1.8-mixedfault/libsrc/pylith/faults/dkSelector.hh 2013-02-05 22:14:40 UTC (rev 21337)
@@ -83,7 +83,8 @@
*
* @returns a section for the given time (future)
*/
- void dk(const topology::Field<topology::SubMesh>& dk);
+ void
+ dk(topology::Field<topology::SubMesh>* dk);
// NOT IMPLEMENTED //////////////////////////////////////////////////////
private :
@@ -101,7 +102,7 @@
spatialdata::spatialdb::SpatialDB* _dbdksel;
/// Parameters for perturbations.
- topology::FieldsNew<topology::SubMesh>* _parameters;
+ topology::Fields<topology::Field<topology::SubMesh> >* _parameters;
}; // class DKSelector
More information about the CIG-COMMITS
mailing list