Extended interface for motion constraints
This commit is contained in:
parent
b5892ea8f8
commit
ca5c3600fe
8 changed files with 90 additions and 20 deletions
|
@ -75,7 +75,8 @@ Foam::constantAngularAcceleration::~constantAngularAcceleration()
|
|||
Foam::vector Foam::constantAngularAcceleration::matrixContribution
|
||||
(
|
||||
const scalar,
|
||||
const tensor& toRelative
|
||||
const tensor& toRelative,
|
||||
const vector&
|
||||
) const
|
||||
{
|
||||
vector mc;
|
||||
|
@ -98,7 +99,9 @@ Foam::vector Foam::constantAngularAcceleration::matrixContribution
|
|||
|
||||
Foam::scalar Foam::constantAngularAcceleration::sourceContribution
|
||||
(
|
||||
const scalar
|
||||
const scalar,
|
||||
const tensor& toRelative,
|
||||
const vector&
|
||||
) const
|
||||
{
|
||||
return alpha_;
|
||||
|
|
|
@ -101,11 +101,17 @@ public:
|
|||
virtual vector matrixContribution
|
||||
(
|
||||
const scalar,
|
||||
const tensor& toRelative
|
||||
const tensor& toRelative,
|
||||
const vector&
|
||||
) const;
|
||||
|
||||
//- Return source contribution defined by constraint, a(t)
|
||||
virtual scalar sourceContribution(const scalar) const;
|
||||
virtual scalar sourceContribution
|
||||
(
|
||||
const scalar,
|
||||
const tensor&,
|
||||
const vector&
|
||||
) const;
|
||||
|
||||
|
||||
// I-O Functions
|
||||
|
|
|
@ -153,11 +153,17 @@ public:
|
|||
virtual vector matrixContribution
|
||||
(
|
||||
const scalar t,
|
||||
const tensor& toRelative
|
||||
const tensor& toRelative,
|
||||
const vector& omega
|
||||
) const = 0;
|
||||
|
||||
//- Return source contribution defined by constraint, a(t)
|
||||
virtual scalar sourceContribution(const scalar t) const = 0;
|
||||
virtual scalar sourceContribution
|
||||
(
|
||||
const scalar t,
|
||||
const tensor& toRelative,
|
||||
const vector& omega
|
||||
) const = 0;
|
||||
|
||||
|
||||
// I-O Functions and Operators
|
||||
|
|
|
@ -74,7 +74,9 @@ Foam::constantTranslationalAcceleration::~constantTranslationalAcceleration()
|
|||
Foam::vector Foam::constantTranslationalAcceleration::matrixContribution
|
||||
(
|
||||
const scalar,
|
||||
const tensor&
|
||||
const tensor&,
|
||||
const vector&,
|
||||
const vector&
|
||||
) const
|
||||
{
|
||||
return dir_;
|
||||
|
@ -83,7 +85,10 @@ Foam::vector Foam::constantTranslationalAcceleration::matrixContribution
|
|||
|
||||
Foam::scalar Foam::constantTranslationalAcceleration::sourceContribution
|
||||
(
|
||||
const scalar
|
||||
const scalar,
|
||||
const tensor&,
|
||||
const vector&,
|
||||
const vector&
|
||||
) const
|
||||
{
|
||||
return a_;
|
||||
|
|
|
@ -97,11 +97,20 @@ public:
|
|||
virtual vector matrixContribution
|
||||
(
|
||||
const scalar,
|
||||
const tensor&
|
||||
const tensor&,
|
||||
const vector&,
|
||||
const vector&
|
||||
) const;
|
||||
|
||||
//- Return source contribution defined by constraint, a(t)
|
||||
virtual scalar sourceContribution(const scalar) const;
|
||||
virtual scalar sourceContribution
|
||||
(
|
||||
const scalar,
|
||||
const tensor&,
|
||||
const vector&,
|
||||
const vector&
|
||||
) const;
|
||||
|
||||
|
||||
|
||||
// I-O Functions
|
||||
|
|
|
@ -153,11 +153,19 @@ public:
|
|||
virtual vector matrixContribution
|
||||
(
|
||||
const scalar t,
|
||||
const tensor& toRelative
|
||||
const tensor& toRelative,
|
||||
const vector& x,
|
||||
const vector& u
|
||||
) const = 0;
|
||||
|
||||
//- Return source contribution defined by constraint, a(t)
|
||||
virtual scalar sourceContribution(const scalar t) const = 0;
|
||||
virtual scalar sourceContribution
|
||||
(
|
||||
const scalar t,
|
||||
const tensor& toRelative,
|
||||
const vector& x,
|
||||
const vector& u
|
||||
) const = 0;
|
||||
|
||||
|
||||
// I-O Functions and Operators
|
||||
|
|
|
@ -104,7 +104,14 @@ Foam::dimensionedVector Foam::geometricSixDOF::A
|
|||
const translationalConstraint& curTc = translationalConstraints_[tcI];
|
||||
|
||||
// Get matrix contribution from constraint
|
||||
const vector mc = curTc.matrixContribution(t, R.T());
|
||||
const vector mc =
|
||||
curTc.matrixContribution
|
||||
(
|
||||
t,
|
||||
R.T(),
|
||||
xR.value(),
|
||||
uR.value()
|
||||
);
|
||||
|
||||
// Get matrix index
|
||||
const label index = tcI + 3;
|
||||
|
@ -117,7 +124,7 @@ Foam::dimensionedVector Foam::geometricSixDOF::A
|
|||
}
|
||||
|
||||
// Insert source contribution (remainder of the constraint function)
|
||||
rhs[index] = curTc.sourceContribution(t);
|
||||
rhs[index] = curTc.sourceContribution(t, R.T(), xR.value(), uR.value());
|
||||
}
|
||||
|
||||
// Solve the matrix using LU decomposition. Note: solution is in the rhs and
|
||||
|
@ -174,7 +181,13 @@ Foam::dimensionedVector Foam::geometricSixDOF::OmegaDot
|
|||
const rotationalConstraint& curRc = rotationalConstraints_[rcI];
|
||||
|
||||
// Get matrix contribution from the constraint
|
||||
const vector mc = curRc.matrixContribution(t, RT.value());
|
||||
const vector mc =
|
||||
curRc.matrixContribution
|
||||
(
|
||||
t,
|
||||
RT.value(),
|
||||
omega.value()
|
||||
);
|
||||
|
||||
// Get matrix index
|
||||
const label index = rcI + 3;
|
||||
|
@ -187,7 +200,7 @@ Foam::dimensionedVector Foam::geometricSixDOF::OmegaDot
|
|||
}
|
||||
|
||||
// Insert source contribution (remainder of the constraint function)
|
||||
rhs[index] = curRc.sourceContribution(t);
|
||||
rhs[index] = curRc.sourceContribution(t, RT.value(), omega.value());
|
||||
}
|
||||
|
||||
// Solve the matrix using LU decomposition. Note: solution is in the rhs and
|
||||
|
|
|
@ -89,7 +89,14 @@ Foam::dimensionedVector Foam::quaternionSixDOF::A
|
|||
const translationalConstraint& curTc = translationalConstraints_[tcI];
|
||||
|
||||
// Get matrix contribution from constraint
|
||||
const vector mc = curTc.matrixContribution(t, rotation.R());
|
||||
const vector mc =
|
||||
curTc.matrixContribution
|
||||
(
|
||||
t,
|
||||
rotation.R(),
|
||||
xR.value(),
|
||||
uR.value()
|
||||
);
|
||||
|
||||
// Get matrix index
|
||||
const label index = tcI + 3;
|
||||
|
@ -102,7 +109,14 @@ Foam::dimensionedVector Foam::quaternionSixDOF::A
|
|||
}
|
||||
|
||||
// Insert source contribution (remainder of the constraint function)
|
||||
rhs[index] = curTc.sourceContribution(t);
|
||||
rhs[index] =
|
||||
curTc.sourceContribution
|
||||
(
|
||||
t,
|
||||
rotation.R(),
|
||||
xR.value(),
|
||||
uR.value()
|
||||
);
|
||||
}
|
||||
|
||||
// Solve the matrix using LU decomposition. Note: solution is in the rhs and
|
||||
|
@ -160,7 +174,13 @@ Foam::dimensionedVector Foam::quaternionSixDOF::OmegaDot
|
|||
const rotationalConstraint& curRc = rotationalConstraints_[rcI];
|
||||
|
||||
// Get matrix contribution from the constraint
|
||||
const vector mc = curRc.matrixContribution(t, R.value());
|
||||
const vector mc =
|
||||
curRc.matrixContribution
|
||||
(
|
||||
t,
|
||||
R.value(),
|
||||
omega.value()
|
||||
);
|
||||
|
||||
// Get matrix index
|
||||
const label index = rcI + 3;
|
||||
|
@ -173,7 +193,7 @@ Foam::dimensionedVector Foam::quaternionSixDOF::OmegaDot
|
|||
}
|
||||
|
||||
// Insert source contribution (remainder of the constraint function)
|
||||
rhs[index] = curRc.sourceContribution(t);
|
||||
rhs[index] = curRc.sourceContribution(t, R.value(), omega.value());
|
||||
}
|
||||
|
||||
// Solve the matrix using LU decomposition. Note: solution is in the rhs and
|
||||
|
|
Reference in a new issue