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_)
109 if (fieldNames.size())
111 Info<<
" " << clsName <<
's';
114 for (
const word& fieldName : fieldNames)
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
Get a value from the named option if present, or return default.
static word timeName(const scalar t, const int precision=precision_)
static void addNote(const string ¬e)
Add extra notes for the usage information.
Ostream & endl(Ostream &os)
Add newline and flush stream.
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
#define forAll(list, i)
Loop across all elements in list.
static void noFunctionObjects(bool addWithOption=false)
Remove '-noFunctionObjects' option and ignore any occurrences.
bool interpolate(const vector &p1, const vector &p2, const vector &o, vector &n, scalar l)
messageStream Info
Information stream (uses stdout - output is on the master only)
Abstract base class for interpolating in 1D.
Mesh data needed to do the Finite Volume discretisation.
List of IOobjects with searching and retrieving facilities.
const T & name() const
The name/key (const access)
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)
Return a reference to the selected interpolationWeights.
FlatOutput< Container > flatOutput(const Container &obj, label len=0)
Global flatOutput function.
static void addOptions(const bool constant=true, const bool withZero=false)
Add timeSelector options to argList::validOptions.
virtual void setTime(const Time &t)
Reset the time and time-index to those of the given time.
A List of wordRe with additional matching capabilities.
List< T > getList(const label index) const
Get a List of values from the argument at index.
A List with indirect addressing.
An instant of time. Contains the time value and name.
static instantList select0(Time &runTime, const argList &args)
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Add an option to validOptions with usage information.
Foam::argList args(argc, argv)
static tmp< GeometricField< Type, faePatchField, edgeMesh > > interpolate(const GeometricField< Type, faPatchField, areaMesh > &tvf, const edgeScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.