57 Foam::solidBodyMotionFunctions::tabulated6DoFMotion::interpolationType
59Foam::solidBodyMotionFunctions::tabulated6DoFMotion::interpolationTypeNames
61 { interpolationType::SPLINE,
"spline" },
62 { interpolationType::LINEAR,
"linear" }
68Foam::solidBodyMotionFunctions::tabulated6DoFMotion::tabulated6DoFMotion
74 solidBodyMotionFunction(SBMFCoeffs,
runTime)
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
#define R(A, B, C, D, E, F, K, M)
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Input from file stream as an ISstream, normally using std::ifstream for the actual input.
bool good() const noexcept
True if next operation might succeed.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
T & first()
Access first element of the list, position [0].
void size(const label n)
Older name for setAddressableSize.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A class for handling file names.
Quaternion class used to perform rotations in 3D space.
Septernion class used to perform translations and rotations in 3D space.
Base class for defining solid-body motions.
virtual bool read(const dictionary &SBMFCoeffs)=0
Update properties from given dictionary.
solidBodyMotionFunction(const solidBodyMotionFunction &)=delete
No copy construct.
Tabulated 6DoF motion function.
virtual septernion transformation() const
Return the solid-body motion transformation septernion.
virtual bool read(const dictionary &SBMFCoeffs)
Update properties from given dictionary.
string & expand(const bool allowEmpty=false)
Inplace expand initial tags, tildes, and all occurrences of environment variables as per stringOps::e...
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Interpolates y values from one curve to another with a different x distribution.
Interpolates y values from one curve to another with a different x distribution.
#define DebugInFunction
Report an information message using Foam::Info.
Namespace for solid-body motions.
Field< Type > interpolateXY(const scalarField &xNew, const scalarField &xOld, const Field< Type > &yOld)
Ostream & endl(Ostream &os)
Add newline and flush stream.
constexpr scalar degToRad() noexcept
Multiplication factor for degrees to radians conversion.
static constexpr const zero Zero
Global zero (0).
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
errorManipArg< error, int > exit(error &err, const int errNo=1)
Field< Type > interpolateSplineXY(const scalarField &xNew, const scalarField &xOld, const Field< Type > &yOld)
#define forAll(list, i)
Loop across all elements in list.
Unit conversion functions.