Go to the documentation of this file.
54 class fieldInterpolator
84 selectedFields_(selectedFields),
87 interpolator_(interpolator),
88 timeNames_(timeNames),
92 template<
class GeoFieldType>
97 template<
class GeoFieldType>
100 const word& clsName = GeoFieldType::typeName;
104 selectedFields_.empty()
105 ? objects_.sortedNames(clsName)
106 : objects_.sortedNames(clsName, selectedFields_)
111 Info<<
" " << clsName <<
's';
116 Info<<
' ' << fieldName <<
'(';
118 const scalar deltaT = (ti1_.value() - ti_.value())/(divisions_ + 1);
120 for (
int j=0; j<divisions_; j++)
128 if (j < divisions_-1)
136 interpolator_.valueWeights
154 ReadFields<GeoFieldType>
163 uniformInterpolate<GeoFieldType>
169 objects_[fieldName]->db(),
192 int main(
int argc,
char *argv[])
196 "Interpolate fields between time-steps. Eg, for animation."
205 "The fields (or field) to be interpolated."
206 " Eg, '(U T p \"Y.*\")' or a single field 'U'"
212 "Specify number of temporal sub-divisions to create (default = 1)."
218 "The type of interpolation (linear or spline)"
229 if (selectedFields.empty())
231 Info<<
"Interpolating all fields" <<
nl <<
endl;
241 Info<<
"Using " << divisions <<
" per time interval" <<
nl <<
endl;
244 const word interpolationType =
247 Info<<
"Using interpolation " << interpolationType <<
nl <<
endl;
253 wordList timeNames(timeDirs.size());
256 timeVals[i] = timeDirs[i].value();
257 timeNames[i] = timeDirs[i].name();
271 Info<<
"Interpolating fields for times:" <<
endl;
273 for (label timei = 0; timei < timeDirs.size() - 1; timei++)
280 fieldInterpolator interpolator
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A class for handling words, derived from Foam::string.
T getOrDefault(const word &optName, const T &deflt) const
static word timeName(const scalar t, const int precision=precision_)
static void addNote(const string ¬e)
Ostream & endl(Ostream &os)
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
static void noFunctionObjects(bool addWithOption=false)
bool interpolate(const vector &p1, const vector &p2, const vector &o, vector &n, scalar l)
Generic templated field type.
Abstract base class for interpolating in 1D.
const wordRes fieldNames(propsDict.getOrDefault< wordRes >("fields", wordRes()))
Mesh data needed to do the Finite Volume discretisation.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
List of IOobjects with searching and retrieving facilities.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Field reading functions for post-processing utilities.
static autoPtr< interpolationWeights > New(const word &type, const scalarField &samples)
static void addOptions(const bool constant=true, const bool withZero=false)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
virtual void setTime(const Time &t)
A List of wordRe with additional matching capabilities.
List< T > getList(const label index) const
A List with indirect addressing.
An instant of time. Contains the time value and name.
static instantList select0(Time &runTime, const argList &args)
Generic GeometricField class.
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Foam::argList args(argc, argv)
static tmp< GeometricField< Type, faePatchField, edgeMesh > > interpolate(const GeometricField< Type, faPatchField, areaMesh > &tvf, const edgeScalarField &faceFlux, Istream &schemeData)