42 namespace solidBodyMotionFunctions
47 solidBodyMotionFunction,
57 Foam::solidBodyMotionFunctions::tabulated6DoFMotion::interpolationType
59 Foam::solidBodyMotionFunctions::tabulated6DoFMotion::interpolationTypeNames
61 { interpolationType::SPLINE,
"spline" },
62 { interpolationType::LINEAR,
"linear" }
68 Foam::solidBodyMotionFunctions::tabulated6DoFMotion::tabulated6DoFMotion
85 scalar t = time_.value();
90 <<
"current time (" << t
91 <<
") is less than the minimum in the data table (" 96 if (t > times_.last())
99 <<
"current time (" << t
100 <<
") is greater than the maximum in the data table (" 101 << times_.last() <<
')' 105 translationRotationVectors TRV(
Zero,
Zero);
106 switch (interpolator_)
108 case interpolationType::SPLINE:
113 case interpolationType::LINEAR:
121 <<
"Unrecognised 'interpolationScheme' option: " 122 << interpolationTypeNames[interpolator_]
132 septernion TR(septernion(-CofG_ + -TRV[0])*
R*septernion(CofG_));
154 if (newTimeDataFileName != timeDataFileName_)
156 timeDataFileName_ = newTimeDataFileName;
158 IFstream dataStream(timeDataFileName_);
160 if (dataStream.
good())
167 times_.setSize(timeValues.
size());
168 values_.setSize(timeValues.
size());
172 times_[i] = timeValues[i].
first();
173 values_[i] = timeValues[i].second();
179 <<
"Cannot open time data file " << timeDataFileName_
184 SBMFCoeffs_.readEntry(
"CofG", CofG_);
187 interpolationTypeNames.getOrDefault
189 "interpolationScheme",
191 interpolationType::SPLINE
virtual septernion transformation() const
Return the solid-body motion transformation septernion.
void size(const label n)
Older name for setAddressableSize.
A class for handling file names.
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Unit conversion functions.
Interpolates y values from one curve to another with a different x distribution.
T & first()
Access first element of the list, position [0].
Ostream & endl(Ostream &os)
Add newline and flush stream.
Septernion class used to perform translations and rotations in 3D space.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Macros for easy insertion into run-time selection tables.
defineTypeNameAndDebug(axisRotationMotion, 0)
#define forAll(list, i)
Loop across all elements in list.
Field< Type > interpolateSplineXY(const scalarField &xNew, const scalarField &xOld, const Field< Type > &yOld)
Base class for defining solid-body motions.
#define DebugInFunction
Report an information message using Foam::Info.
Interpolates y values from one curve to another with a different x distribution.
virtual bool read(const dictionary &SBMFCoeffs)=0
Update properties from given dictionary.
Field< Type > interpolateXY(const scalarField &xNew, const scalarField &xOld, const Field< Type > &yOld)
virtual bool read(const dictionary &SBMFCoeffs)
Update properties from given dictionary.
Input from file stream as an ISstream, normally using std::ifstream for the actual input...
#define R(A, B, C, D, E, F, K, M)
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
string & expand(const bool allowEmpty=false)
Inplace expand initial tags, tildes, and all occurrences of environment variables as per stringOps::e...
bool good() const noexcept
True if next operation might succeed.
addToRunTimeSelectionTable(solidBodyMotionFunction, axisRotationMotion, dictionary)
constexpr scalar degToRad(const scalar deg) noexcept
Conversion from degrees to radians.
static constexpr const zero Zero
Global zero (0)