diff --git a/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.C b/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.C index 1b6a9e6d5a00120d5c46c68bca65a192d8e29b2c..2a29097f9d8b89408b6aad6bf2368dc6165c25ee 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.C +++ b/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.C @@ -123,6 +123,32 @@ angularOscillatingDisplacementPointPatchVectorField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +void angularOscillatingDisplacementPointPatchVectorField::autoMap +( + const pointPatchFieldMapper& m +) +{ + fixedValuePointPatchField<vector>::autoMap(m); + + p0_.autoMap(m); +} + + +void angularOscillatingDisplacementPointPatchVectorField::rmap +( + const pointPatchField<vector>& ptf, + const labelList& addr +) +{ + const angularOscillatingDisplacementPointPatchVectorField& aODptf = + refCast<const angularOscillatingDisplacementPointPatchVectorField>(ptf); + + fixedValuePointPatchField<vector>::rmap(aODptf, addr); + + p0_.rmap(aODptf.p0_, addr); +} + + void angularOscillatingDisplacementPointPatchVectorField::updateCoeffs() { if (this->updated()) diff --git a/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.H b/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.H index ed986cf2e0a64bedf867d6e275e03d987379211c..6cb005940a9b731e0c772eb7f03c407d97f836e2 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.H +++ b/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.H @@ -132,6 +132,22 @@ public: // Member functions + // Mapping functions + + //- Map (and resize as needed) from self given a mapping object + virtual void autoMap + ( + const pointPatchFieldMapper& + ); + + //- Reverse map the given pointPatchField onto this pointPatchField + virtual void rmap + ( + const pointPatchField<vector>&, + const labelList& + ); + + // Evaluation functions //- Update the coefficients associated with the patch field diff --git a/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.C b/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.C index 868cc70abb65758436989dc1bb8ef072f3edc29b..aa84419f1fc93c9245ddbe4fc109522faee78521 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.C +++ b/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.C @@ -123,6 +123,32 @@ angularOscillatingVelocityPointPatchVectorField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +void angularOscillatingVelocityPointPatchVectorField::autoMap +( + const pointPatchFieldMapper& m +) +{ + fixedValuePointPatchField<vector>::autoMap(m); + + p0_.autoMap(m); +} + + +void angularOscillatingVelocityPointPatchVectorField::rmap +( + const pointPatchField<vector>& ptf, + const labelList& addr +) +{ + const angularOscillatingVelocityPointPatchVectorField& aOVptf = + refCast<const angularOscillatingVelocityPointPatchVectorField>(ptf); + + fixedValuePointPatchField<vector>::rmap(aOVptf, addr); + + p0_.rmap(aOVptf.p0_, addr); +} + + void angularOscillatingVelocityPointPatchVectorField::updateCoeffs() { if (this->updated()) diff --git a/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.H b/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.H index 6ca391228b51f9139d2f5033222d71e05eaebdf7..ff5a451563c7e25b28c7099c7a0b026254343240 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.H +++ b/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.H @@ -132,6 +132,22 @@ public: // Member functions + // Mapping functions + + //- Map (and resize as needed) from self given a mapping object + virtual void autoMap + ( + const pointPatchFieldMapper& + ); + + //- Reverse map the given pointPatchField onto this pointPatchField + virtual void rmap + ( + const pointPatchField<vector>&, + const labelList& + ); + + // Evaluation functions //- Update the coefficients associated with the patch field diff --git a/src/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.C b/src/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.C index 412c9561a20fd0f85dd35d6e68db9c0ea456074b..6b9d63630f57dc74f5ae7a8360cff9036dc2942d 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.C +++ b/src/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.C @@ -111,6 +111,32 @@ oscillatingVelocityPointPatchVectorField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +void oscillatingVelocityPointPatchVectorField::autoMap +( + const pointPatchFieldMapper& m +) +{ + fixedValuePointPatchField<vector>::autoMap(m); + + p0_.autoMap(m); +} + + +void oscillatingVelocityPointPatchVectorField::rmap +( + const pointPatchField<vector>& ptf, + const labelList& addr +) +{ + const oscillatingVelocityPointPatchVectorField& oVptf = + refCast<const oscillatingVelocityPointPatchVectorField>(ptf); + + fixedValuePointPatchField<vector>::rmap(oVptf, addr); + + p0_.rmap(oVptf.p0_, addr); +} + + void oscillatingVelocityPointPatchVectorField::updateCoeffs() { if (this->updated()) diff --git a/src/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.H b/src/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.H index ec4892f621e45de0af2e0c8431c01f1e5c1e4902..b6f003540c3bf4189ededaf8fa34397a2122a1d1 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.H +++ b/src/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.H @@ -129,6 +129,22 @@ public: // Member functions + // Mapping functions + + //- Map (and resize as needed) from self given a mapping object + virtual void autoMap + ( + const pointPatchFieldMapper& + ); + + //- Reverse map the given pointPatchField onto this pointPatchField + virtual void rmap + ( + const pointPatchField<vector>&, + const labelList& + ); + + // Evaluation functions //- Update the coefficients associated with the patch field diff --git a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/uncoupledSixDoFRigidBodyDisplacement/uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField.C b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/uncoupledSixDoFRigidBodyDisplacement/uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField.C index d35eefd67130bd8949f52cd27a81406d1d1a8063..e8e9d4b628f95de619d1d0ab6bce89c63f9e9da3 100644 --- a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/uncoupledSixDoFRigidBodyDisplacement/uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField.C +++ b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/uncoupledSixDoFRigidBodyDisplacement/uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField.C @@ -48,7 +48,7 @@ uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField : fixedValuePointPatchField<vector>(p, iF), motion_(), - p0_(p.localPoints()), + initialPoints_(p.localPoints()), rhoInf_(1.0) {} @@ -70,13 +70,13 @@ uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField updateCoeffs(); } - if (dict.found("p0")) + if (dict.found("initialPoints")) { - p0_ = vectorField("p0", dict , p.size()); + initialPoints_ = vectorField("initialPoints", dict , p.size()); } else { - p0_ = p.localPoints(); + initialPoints_ = p.localPoints(); } } @@ -92,7 +92,7 @@ uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField : fixedValuePointPatchField<vector>(ptf, p, iF, mapper), motion_(ptf.motion_), - p0_(ptf.p0_, mapper), + initialPoints_(ptf.initialPoints_, mapper), rhoInf_(ptf.rhoInf_) {} @@ -106,13 +106,42 @@ uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField : fixedValuePointPatchField<vector>(ptf, iF), motion_(ptf.motion_), - p0_(ptf.p0_), + initialPoints_(ptf.initialPoints_), rhoInf_(ptf.rhoInf_) {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +void uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField::autoMap +( + const pointPatchFieldMapper& m +) +{ + fixedValuePointPatchField<vector>::autoMap(m); + + initialPoints_.autoMap(m); +} + + +void uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField::rmap +( + const pointPatchField<vector>& ptf, + const labelList& addr +) +{ + const uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField& uSDoFptf = + refCast + < + const uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField + >(ptf); + + fixedValuePointPatchField<vector>::rmap(uSDoFptf, addr); + + initialPoints_.rmap(uSDoFptf.initialPoints_, addr); +} + + void uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField::updateCoeffs() { if (this->updated()) @@ -138,7 +167,10 @@ void uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField::updateCoeffs() // Do not modify the accelerations, except with gravity, where available motion_.updateForce(gravity*motion_.mass(), vector::zero, t.deltaTValue()); - Field<vector>::operator=(motion_.currentPosition(p0_) - p0_); + Field<vector>::operator= + ( + motion_.currentPosition(initialPoints_) - initialPoints_ + ); fixedValuePointPatchField<vector>::updateCoeffs(); } @@ -153,7 +185,7 @@ void uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField::write motion_.write(os); os.writeKeyword("rhoInf") << rhoInf_ << token::END_STATEMENT << nl; - p0_.writeEntry("p0", os); + initialPoints_.writeEntry("initialPoints", os); writeEntry("value", os); } diff --git a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/uncoupledSixDoFRigidBodyDisplacement/uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField.H b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/uncoupledSixDoFRigidBodyDisplacement/uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField.H index fb4177d10464ecbd32726b7abb4f3fac56d6f487..a250601f3e5371ad67b7eb1703b46021b610dd71 100644 --- a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/uncoupledSixDoFRigidBodyDisplacement/uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField.H +++ b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/uncoupledSixDoFRigidBodyDisplacement/uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField.H @@ -57,8 +57,8 @@ class uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField //- Six dof motion object sixDoFRigidBodyMotion motion_; - //- Reference positions of points on the patch - pointField p0_; + //- Initial positions of points on the patch + pointField initialPoints_; //- Reference density required by the forces object for // incompressible calculations. Retained here to give @@ -136,6 +136,22 @@ public: // Member functions + // Mapping functions + + //- Map (and resize as needed) from self given a mapping object + virtual void autoMap + ( + const pointPatchFieldMapper& + ); + + //- Reverse map the given pointPatchField onto this pointPatchField + virtual void rmap + ( + const pointPatchField<vector>&, + const labelList& + ); + + // Evaluation functions //- Update the coefficients associated with the patch field