diff --git a/src/adjoint/DAFvSource/DAFvSource.C b/src/adjoint/DAFvSource/DAFvSource.C index 01ea675f..0f43089a 100755 --- a/src/adjoint/DAFvSource/DAFvSource.C +++ b/src/adjoint/DAFvSource/DAFvSource.C @@ -199,6 +199,29 @@ void DAFvSource::syncDAOptionToActuatorDVs() } } } + +void DAFvSource::findGlobalSnappedCenter( + label snappedCenterCellI, + vector& center) +{ + scalar centerX = 0.0; + scalar centerY = 0.0; + scalar centerZ = 0.0; + + if (snappedCenterCellI >= 0) + { + centerX = mesh_.C()[snappedCenterCellI][0]; + centerY = mesh_.C()[snappedCenterCellI][1]; + centerZ = mesh_.C()[snappedCenterCellI][2]; + } + reduce(centerX, sumOp()); + reduce(centerY, sumOp()); + reduce(centerZ, sumOp()); + + center[0] = centerX; + center[1] = centerY; + center[2] = centerZ; +} // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/adjoint/DAFvSource/DAFvSource.H b/src/adjoint/DAFvSource/DAFvSource.H index 296577c0..1315a003 100755 --- a/src/adjoint/DAFvSource/DAFvSource.H +++ b/src/adjoint/DAFvSource/DAFvSource.H @@ -154,6 +154,10 @@ public: /// virtual function for regIOobject bool writeData(Ostream& os) const; + + void findGlobalSnappedCenter( + label snappedCenterCellI, + vector& center); }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/adjoint/DAFvSource/DAFvSourceHeatSource.C b/src/adjoint/DAFvSource/DAFvSourceHeatSource.C index 69ba2abf..f86b5fb0 100755 --- a/src/adjoint/DAFvSource/DAFvSourceHeatSource.C +++ b/src/adjoint/DAFvSource/DAFvSourceHeatSource.C @@ -26,6 +26,12 @@ DAFvSourceHeatSource::DAFvSourceHeatSource( { printInterval_ = daOption.getOption