Revert "rigidBodyModel: Added movingBodyNames() member function"

This reverts commit a395752fa8.
This commit is contained in:
Henry Weller
2019-03-01 13:45:43 +00:00
parent a395752fa8
commit e68246b392
8 changed files with 51 additions and 69 deletions

View File

@ -384,25 +384,6 @@ Foam::spatialTransform Foam::RBD::rigidBodyModel::X0
}
Foam::wordList Foam::RBD::rigidBodyModel::movingBodyNames() const
{
wordList names(nBodies());
label j = 0;
for (label i=1; i<nBodies(); i++)
{
if (!isType<jointBody>(bodies_[i]))
{
names[j++] = bodies_[i].name();
}
}
names.setSize(j);
return names;
}
void Foam::RBD::rigidBodyModel::write(Ostream& os) const
{
os << indent << "bodies" << nl

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2016-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -252,9 +252,6 @@ public:
//- Return the name of body with the given ID
inline const word& name(const label bodyID) const;
//- Return the names of the moving bodies
wordList movingBodyNames() const;
//- Return the inertia of body i
inline const rigidBodyInertia& I(const label i) const;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2016-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -88,7 +88,7 @@ Foam::rigidBodyMeshMotion::rigidBodyMeshMotion
)
:
displacementMotionSolver(mesh, dict, typeName),
RBD::rigidBodyMotion
model_
(
coeffDict(),
IOobject
@ -141,7 +141,7 @@ Foam::rigidBodyMeshMotion::rigidBodyMeshMotion
if (bodyDict.found("patches"))
{
const label bodyID = this->bodyID(iter().keyword());
const label bodyID = model_.bodyID(iter().keyword());
if (bodyID == -1)
{
@ -239,7 +239,7 @@ void Foam::rigidBodyMeshMotion::solve()
// Store the motion state at the beginning of the time-step
if (curTimeIndex_ != this->db().time().timeIndex())
{
newTime();
model_.newTime();
curTimeIndex_ = this->db().time().timeIndex();
}
@ -247,7 +247,7 @@ void Foam::rigidBodyMeshMotion::solve()
if (db().foundObject<uniformDimensionedVectorField>("g"))
{
g() =
model_.g() =
ramp*db().lookupObject<uniformDimensionedVectorField>("g").value();
}
@ -257,18 +257,18 @@ void Foam::rigidBodyMeshMotion::solve()
for (label i=0; i<nIter; i++)
{
RBD::rigidBodyMotion::solve
model_.solve
(
t.value(),
t.deltaTValue(),
scalarField(nDoF(), Zero),
Field<spatialVector>(nBodies(), Zero)
scalarField(model_.nDoF(), Zero),
Field<spatialVector>(model_.nBodies(), Zero)
);
}
}
else
{
Field<spatialVector> fx(nBodies(), Zero);
Field<spatialVector> fx(model_.nBodies(), Zero);
forAll(bodyMeshes_, bi)
{
@ -287,27 +287,27 @@ void Foam::rigidBodyMeshMotion::solve()
fx[bodyID] = ramp*spatialVector(f.momentEff(), f.forceEff());
}
RBD::rigidBodyMotion::solve
model_.solve
(
t.value(),
t.deltaTValue(),
scalarField(nDoF(), Zero),
scalarField(model_.nDoF(), Zero),
fx
);
}
if (Pstream::master() && report())
if (Pstream::master() && model_.report())
{
forAll(bodyMeshes_, bi)
{
status(bodyMeshes_[bi].bodyID_);
model_.status(bodyMeshes_[bi].bodyID_);
}
}
// Update the displacements
if (bodyMeshes_.size() == 1)
{
pointDisplacement_.primitiveFieldRef() = transformPoints
pointDisplacement_.primitiveFieldRef() = model_.transformPoints
(
bodyMeshes_[0].bodyID_,
bodyMeshes_[0].weight_,
@ -325,7 +325,7 @@ void Foam::rigidBodyMeshMotion::solve()
}
pointDisplacement_.primitiveFieldRef() =
transformPoints(bodyIDs, weights, points0()) - points0();
model_.transformPoints(bodyIDs, weights, points0()) - points0();
}
// Displacement has changed. Update boundary conditions
@ -358,7 +358,7 @@ bool Foam::rigidBodyMeshMotion::writeObject
)
);
state().write(dict);
model_.state().write(dict);
return dict.regIOobject::write();
}
@ -367,7 +367,7 @@ bool Foam::rigidBodyMeshMotion::read()
{
if (displacementMotionSolver::read())
{
RBD::rigidBodyMotion::read(coeffDict());
model_.read(coeffDict());
return true;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2016-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -53,8 +53,7 @@ namespace Foam
class rigidBodyMeshMotion
:
public displacementMotionSolver,
public RBD::rigidBodyMotion
public displacementMotionSolver
{
//- Class containing the patches and point motion weighting for each body
class bodyMesh
@ -98,6 +97,9 @@ class rigidBodyMeshMotion
// Private data
//- Rigid-body model
RBD::rigidBodyMotion model_;
//- List of the bodyMeshes containing the patches and point motion
// weighting for each body
PtrList<bodyMesh> bodyMeshes_;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2016-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -71,7 +71,7 @@ Foam::rigidBodyMeshMotionSolver::rigidBodyMeshMotionSolver
)
:
motionSolver(mesh, dict, typeName),
RBD::rigidBodyMotion
model_
(
coeffDict(),
IOobject
@ -132,7 +132,7 @@ Foam::rigidBodyMeshMotionSolver::rigidBodyMeshMotionSolver
if (bodyDict.found("patches"))
{
const label bodyID = this->bodyID(iter().keyword());
const label bodyID = model_.bodyID(iter().keyword());
if (bodyID == -1)
{
@ -189,13 +189,13 @@ void Foam::rigidBodyMeshMotionSolver::solve()
// Store the motion state at the beginning of the time-step
if (curTimeIndex_ != this->db().time().timeIndex())
{
newTime();
model_.newTime();
curTimeIndex_ = this->db().time().timeIndex();
}
if (db().foundObject<uniformDimensionedVectorField>("g"))
{
g() =
model_.g() =
db().lookupObject<uniformDimensionedVectorField>("g").value();
}
@ -205,18 +205,18 @@ void Foam::rigidBodyMeshMotionSolver::solve()
for (label i=0; i<nIter; i++)
{
RBD::rigidBodyMotion::solve
model_.solve
(
t.value(),
t.deltaTValue(),
scalarField(nDoF(), Zero),
Field<spatialVector>(nBodies(), Zero)
scalarField(model_.nDoF(), Zero),
Field<spatialVector>(model_.nBodies(), Zero)
);
}
}
else
{
Field<spatialVector> fx(nBodies(), Zero);
Field<spatialVector> fx(model_.nBodies(), Zero);
forAll(bodyMeshes_, bi)
{
@ -235,20 +235,20 @@ void Foam::rigidBodyMeshMotionSolver::solve()
fx[bodyID] = spatialVector(f.momentEff(), f.forceEff());
}
RBD::rigidBodyMotion::solve
model_.solve
(
t.value(),
t.deltaTValue(),
scalarField(nDoF(), Zero),
scalarField(model_.nDoF(), Zero),
fx
);
}
if (Pstream::master() && report())
if (Pstream::master() && model_.report())
{
forAll(bodyMeshes_, bi)
{
status(bodyMeshes_[bi].bodyID_);
model_.status(bodyMeshes_[bi].bodyID_);
}
}
@ -267,7 +267,7 @@ void Foam::rigidBodyMeshMotionSolver::solve()
meshSolver_.pointDisplacement().boundaryFieldRef()[patchi] ==
(
transformPoints
model_.transformPoints
(
bodyMeshes_[bi].bodyID_,
patchPoints0
@ -302,7 +302,7 @@ bool Foam::rigidBodyMeshMotionSolver::writeObject
)
);
state().write(dict);
model_.state().write(dict);
return dict.regIOobject::write();
}
@ -311,7 +311,7 @@ bool Foam::rigidBodyMeshMotionSolver::read()
{
if (motionSolver::read())
{
RBD::rigidBodyMotion::read(coeffDict());
model_.read(coeffDict());
return true;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2016-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -52,8 +52,7 @@ namespace Foam
class rigidBodyMeshMotionSolver
:
public motionSolver,
public RBD::rigidBodyMotion
public motionSolver
{
//- Class containing the patches and point motion weighting for each body
class bodyMesh
@ -87,6 +86,9 @@ class rigidBodyMeshMotionSolver
// Private data
//- Rigid-body model
RBD::rigidBodyMotion model_;
//- List of the bodyMeshes containing the patches and point motion
// weighting for each body
PtrList<bodyMesh> bodyMeshes_;

View File

@ -2,8 +2,10 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/sixDoFRigidBodyMotion/lnInclude
-I$(LIB_SRC)/sixDoFRigidBodyMotion/lnInclude \
-I$(LIB_SRC)/OpenFOAM/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
LIB_LIBS = \
-lfiniteVolume \
-ldynamicFvMesh
-lmeshTools

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -125,11 +125,9 @@ public:
// Member Functions
//- Return the current body velocity
vector velocity() const;
vector velocity() const;
//- Return the current body angular velocity
vector angularVelocity() const;
vector angularVelocity() const;
//- Read the sixDoFRigidBodyState data
virtual bool read(const dictionary&);