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;
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
static void noFunctionObjects(bool addWithOption=false)
Remove '-noFunctionObjects' option and ignore any occurrences.
static void addNote(const string ¬e)
Add extra notes for the usage information.
void size(const label n)
Older name for setAddressableSize.
List of IOobjects with searching and retrieving facilities. Implemented as a HashTable, so the various sorted methods should be used if traversing in parallel.
bool interpolate(const vector &p1, const vector &p2, const vector &o, vector &n, scalar l)
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.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
List< T > getList(const label index) const
Get a List of values from the argument at index.
Field reading functions for post-processing utilities.
Ignore writing from objectRegistry::writeObject()
T getOrDefault(const word &optName, const T &deflt) const
Get a value from the named option if present, or return default.
Abstract base class for interpolating in 1D.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
#define forAll(list, i)
Loop across all elements in list.
const T & name() const noexcept
The name/key (const access)
A class for handling words, derived from Foam::string.
A List of wordRe with additional matching capabilities.
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Add an option to validOptions with usage information.
virtual void setTime(const Time &t)
Reset the time and time-index to those of the given time.
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings...
static word timeName(const scalar t, const int precision=precision_)
Return time name of given scalar time formatted with the given precision.
static instantList select0(Time &runTime, const argList &args)
Return the set of times selected based on the argList options and also set the runTime to the first i...
static autoPtr< interpolationWeights > New(const word &type, const scalarField &samples)
Return a reference to the selected interpolationWeights.
An instant of time. Contains the time value and name. Uses Foam::Time when formatting the name...
Mesh data needed to do the Finite Volume discretisation.
A List with indirect addressing. Like IndirectList but does not store addressing. ...
messageStream Info
Information stream (stdout output on master, null elsewhere)
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Foam::argList args(argc, argv)
Defines the attributes of an object for which implicit objectRegistry management is supported...
static void addOptions(const bool constant=true, const bool withZero=false)
Add timeSelector options to argList::validOptions.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.