Go to the documentation of this file.
70 commonFields.
append(fields1[i]);
81 os <<
tab << commonFields[i];
95 const bool loadFromFiles
101 loadFromFiles_(loadFromFiles),
103 operation_(opSubtract),
107 if (setActive<fvMesh>())
110 writeFileHeader(file());
129 log_ =
dict.lookupOrDefault<
Switch>(
"log",
true);
136 dict.subDict(
"source1"),
147 dict.subDict(
"source2"),
153 operation_ = operationTypeNames_.read(
dict.lookup(
"operation"));
168 source1Ptr_->write();
169 source2Ptr_->write();
173 if (log_)
Info <<
type() <<
" " << name_ <<
" output:" <<
endl;
175 const word& name1 = source1Ptr_->name();
176 const word& name2 = source2Ptr_->name();
178 const wordList entries1 = objectResultEntries(name1);
179 const wordList entries2 = objectResultEntries(name2);
181 if (entries1.
size() != entries2.
size())
184 << name_ <<
": objects must generate the same number of results"
186 <<
" " << name1 <<
" objects: " << entries1 <<
nl
187 <<
" " << name2 <<
" objects: " << entries2 <<
nl
193 const word& entry1(entries1[i]);
194 const word& entry2(entries2[i]);
195 const word type1 = objectResultType(name1, entry1);
196 const word type2 = objectResultType(name2, entry2);
202 <<
": input values for operation must be of the same type"
204 <<
" " << entry1 <<
": " << type1 <<
nl
205 <<
" " << entry2 <<
": " << type2 <<
nl
211 apply<scalar>(type1, name1, name2, entry1, entry2,
found);
212 apply<vector>(type1, name1, name2, entry1, entry2,
found);
213 apply<sphericalTensor>(type1, name1, name2, entry1, entry2,
found);
214 apply<symmTensor>(type1, name1, name2, entry1, entry2,
found);
215 apply<tensor>(type1, name1, name2, entry1, entry2,
found);
219 Info<<
"Operation between "
220 << name1 <<
" with result " << entry1 <<
" and "
221 << name2 <<
" with result " << entry2 <<
" not applied"
228 if (entries1.empty())
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
A class for handling words, derived from string.
Base class for function objects, adding functionality to read/write state information (data required ...
#define forAll(list, i)
Loop across all elements in list.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurence of given element and return index,.
bool read(const char *, int32_t &)
void read(const dictionary &dict)
Read.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Mesh consisting of general polyhedral cells.
Registry of regIOobjects.
virtual void execute()
Execute.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
autoPtr< fieldValue > source1Ptr_
Field value source object 1.
virtual ~fieldValueDelta()
Destructor.
virtual void updateMesh(const mapPolyMesh &)
Update mesh.
virtual void timeSet()
Called when time was set at the end of the Time::operator++.
virtual void writeFileHeader(Ostream &os) const
Output file header information.
operationType operation_
Operation to apply to values.
A list of keyword definitions, which are a keyword followed by any number of values (e....
virtual void read(const dictionary &)
Read from dictionary.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
errorManipArg< error, int > exit(error &err, const int errNo=1)
virtual void movePoints(const polyMesh &)
Move points.
void writeHeaderValue(Ostream &os, const string &property, const Type &value) const
Write a (commented) header property and value pair.
static autoPtr< fieldValue > New(const word &name, const objectRegistry &obr, const dictionary &dict, const bool loadFromFiles=false, const bool output=true)
Return a reference to the selected fieldValue.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
autoPtr< fieldValue > source2Ptr_
Field value source object 2.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Base class for output file data handling.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Various functions to operate on Lists.
void size(const label)
Override size to be inconsistent with allocated storage.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
fieldValueDelta(const word &name, const objectRegistry &obr, const dictionary &dict, const bool loadFromFiles=false)
Construct from components.
void writeCommented(Ostream &os, const string &str) const
Write a commented string to stream.
word name(const complex &)
Return a string representation of a complex.
defineTypeNameAndDebug(cellSource, 0)
static const NamedEnum< operationType, 5 > operationTypeNames_
Operation type names.
Initialise the NamedEnum HashTable from the static list of names.
virtual void end()
Execute the at the final time-loop, currently does nothing.
virtual void write()
Calculate and write.