From f22bc2261a5a7d40943a2282fce3d9980bc71e16 Mon Sep 17 00:00:00 2001 From: Dario Zivkovic Date: Sun, 28 Oct 2018 15:25:36 +0100 Subject: [PATCH] Bugfix: added mapping methods to point patch vector fields that have pointField 'p0_' member. --- ...llatingDisplacementPointPatchVectorField.C | 25 ++++++++++++++++++- ...llatingDisplacementPointPatchVectorField.H | 16 ++++++++++++ ...OscillatingVelocityPointPatchVectorField.C | 25 ++++++++++++++++++- ...OscillatingVelocityPointPatchVectorField.H | 16 ++++++++++++ ...oscillatingVelocityPointPatchVectorField.C | 25 ++++++++++++++++++- ...oscillatingVelocityPointPatchVectorField.H | 16 ++++++++++++ 6 files changed, 120 insertions(+), 3 deletions(-) diff --git a/src/dynamicMesh/meshMotion/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.C b/src/dynamicMesh/meshMotion/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.C index 418631bd4..a229530ad 100644 --- a/src/dynamicMesh/meshMotion/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.C +++ b/src/dynamicMesh/meshMotion/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.C @@ -99,7 +99,7 @@ angularOscillatingDisplacementPointPatchVectorField angle0_(ptf.angle0_), amplitude_(ptf.amplitude_), omega_(ptf.omega_), - p0_(ptf.p0_) + p0_(ptf.p0_, mapper) {} @@ -122,6 +122,29 @@ angularOscillatingDisplacementPointPatchVectorField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +void angularOscillatingDisplacementPointPatchVectorField::autoMap +( + const PointPatchFieldMapper& m +) +{ + fixedValuePointPatchVectorField::autoMap(m); + p0_.autoMap(m); +} + +void angularOscillatingDisplacementPointPatchVectorField::rmap +( + const PointPatchField + & ptf, + const labelList& addr +) +{ + const angularOscillatingDisplacementPointPatchVectorField& aODptf = + refCast(ptf); + + fixedValuePointPatchVectorField::rmap(aODptf, addr); + p0_.rmap(aODptf.p0_, addr); +} + void angularOscillatingDisplacementPointPatchVectorField::updateCoeffs() { if (this->updated()) diff --git a/src/dynamicMesh/meshMotion/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.H b/src/dynamicMesh/meshMotion/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.H index d820801ba..9b77e0d46 100644 --- a/src/dynamicMesh/meshMotion/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.H +++ b/src/dynamicMesh/meshMotion/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.H @@ -138,6 +138,22 @@ public: // Member functions + // Mapping functions + + //- Map (and resize as needed) from self given a mapping object + void autoMap + ( + const PointPatchFieldMapper& + ); + + //- Reverse map the given pointPatchField onto this pointPatchField + void rmap + ( + const PointPatchField + &, + const labelList& + ); + // Evaluation functions //- Update the coefficients associated with the patch field diff --git a/src/dynamicMesh/meshMotion/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.C b/src/dynamicMesh/meshMotion/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.C index 37be11306..906913424 100644 --- a/src/dynamicMesh/meshMotion/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.C +++ b/src/dynamicMesh/meshMotion/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.C @@ -99,7 +99,7 @@ angularOscillatingVelocityPointPatchVectorField angle0_(ptf.angle0_), amplitude_(ptf.amplitude_), omega_(ptf.omega_), - p0_(ptf.p0_) + p0_(ptf.p0_, mapper) {} @@ -122,6 +122,29 @@ angularOscillatingVelocityPointPatchVectorField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +void angularOscillatingVelocityPointPatchVectorField::autoMap +( + const PointPatchFieldMapper& m +) +{ + fixedValuePointPatchVectorField::autoMap(m); + p0_.autoMap(m); +} + +void angularOscillatingVelocityPointPatchVectorField::rmap +( + const PointPatchField + & ptf, + const labelList& addr +) +{ + const angularOscillatingVelocityPointPatchVectorField& aOVptf = + refCast(ptf); + + fixedValuePointPatchVectorField::rmap(aOVptf, addr); + p0_.rmap(aOVptf.p0_, addr); +} + void angularOscillatingVelocityPointPatchVectorField::updateCoeffs() { if (this->updated()) diff --git a/src/dynamicMesh/meshMotion/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.H b/src/dynamicMesh/meshMotion/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.H index dc61e5474..ca2ba1a53 100644 --- a/src/dynamicMesh/meshMotion/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.H +++ b/src/dynamicMesh/meshMotion/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.H @@ -130,6 +130,22 @@ public: // Member functions + // Mapping functions + + //- Map (and resize as needed) from self given a mapping object + void autoMap + ( + const PointPatchFieldMapper& + ); + + //- Reverse map the given pointPatchField onto this pointPatchField + void rmap + ( + const PointPatchField + &, + const labelList& + ); + // Evaluation functions //- Update the coefficients associated with the patch field diff --git a/src/dynamicMesh/meshMotion/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.C b/src/dynamicMesh/meshMotion/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.C index 89116378c..085fcce45 100644 --- a/src/dynamicMesh/meshMotion/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.C +++ b/src/dynamicMesh/meshMotion/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.C @@ -90,7 +90,7 @@ oscillatingVelocityPointPatchVectorField fixedValuePointPatchVectorField(ptf, p, iF, mapper), amplitude_(ptf.amplitude_), omega_(ptf.omega_), - p0_(ptf.p0_) + p0_(ptf.p0_, mapper) {} @@ -110,6 +110,29 @@ oscillatingVelocityPointPatchVectorField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +void oscillatingVelocityPointPatchVectorField::autoMap +( + const PointPatchFieldMapper& m +) +{ + fixedValuePointPatchVectorField::autoMap(m); + p0_.autoMap(m); +} + +void oscillatingVelocityPointPatchVectorField::rmap +( + const PointPatchField + & ptf, + const labelList& addr +) +{ + const oscillatingVelocityPointPatchVectorField& oVptf = + refCast(ptf); + + fixedValuePointPatchVectorField::rmap(oVptf, addr); + p0_.rmap(oVptf.p0_, addr); +} + void oscillatingVelocityPointPatchVectorField::updateCoeffs() { if (this->updated()) diff --git a/src/dynamicMesh/meshMotion/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.H b/src/dynamicMesh/meshMotion/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.H index 5710ad714..276b13bed 100644 --- a/src/dynamicMesh/meshMotion/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.H +++ b/src/dynamicMesh/meshMotion/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.H @@ -128,6 +128,22 @@ public: // Member functions + // Mapping functions + + //- Map (and resize as needed) from self given a mapping object + void autoMap + ( + const PointPatchFieldMapper& + ); + + //- Reverse map the given pointPatchField onto this pointPatchField + void rmap + ( + const PointPatchField + &, + const labelList& + ); + // Evaluation functions //- Update the coefficients associated with the patch field