Commit 0a296832 authored by mattijs's avatar mattijs
Browse files

Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev

parents 5ef1bac7 536e2fd4
......@@ -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())
......
......@@ -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
......
......@@ -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())
......
......@@ -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
......
......@@ -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())
......
......@@ -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
......
......@@ -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);
}
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment