56 const word singleCellName =
"singleCell";
59 template<
class GeoField>
70 GeoField* subFld = subsetter.
interpolate(flds[i]).ptr();
75 names[i] = subFld->name();
84 int main(
int argc,
char *argv[])
88 "Map fields to a mesh with all internal faces removed" 89 " (singleCellFvMesh) which gets written to region 'singleCell'" 105 <<
" since result would overwrite it. Please rename your region." 110 Info<<
"Creating singleCell mesh" <<
nl <<
endl;
152 if (!storedObjects.
empty())
155 storedObjects.
clear();
161 Info<<
"Detected changed mesh. Recreating singleCell mesh." <<
endl;
162 scMesh.reset(
nullptr);
183 storedObjects.
reserve(objects.size());
186 #define doLocalCode(GeoField) \ 188 PtrList<GeoField> flds; \ 189 ReadFields(mesh, objects, flds); \ 190 storedObjects.push_back(interpolateFields(scMesh(), flds)); \ 202 Info<<
"Writing " << singleCellName
static void addNote(const string ¬e)
Add extra notes for the usage information.
fvMesh as subset of other mesh. Consists of one cell and all original boundary faces. Useful when manipulating boundary data. Single internal cell only needed to be able to manipulate in a standard way.
List< word > names(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
List of names generated by calling name() for each list item and filtered for matches.
tmp< GeometricField< Type, fvPatchField, volMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &) const
Map volField. Internal field set to average, patch fields straight copies.
List of IOobjects with searching and retrieving facilities. Implemented as a HashTable, so the various sorted methods should be used if traversing in parallel.
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
constexpr char nl
The newline '\n' character (0x0a)
bool empty() const noexcept
True if List is empty (ie, size() is zero)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Field reading functions for post-processing utilities.
#define doLocalCode(FieldType, Variable)
fileName objectPath() const
The complete path + object name.
fileName path() const
The complete path for the object (with instance, local,...).
#define forAll(list, i)
Loop across all elements in list.
const fileName & pointsInstance() const
Return the current instance directory for points.
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
virtual readUpdateState readUpdate()
Update the mesh based on the mesh files saved in time.
A class for handling words, derived from Foam::string.
label size() const noexcept
The number of entries in the list.
bool exists(const fileName &name, const bool checkGzip=true, const bool followLink=true)
Does the name exist (as DIRECTORY or FILE) in the file system?
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
virtual void setTime(const Time &t)
Reset the time and time-index to those of the given time.
bool ln(const fileName &src, const fileName &dst)
Create a softlink. dst should not exist. Returns true if successful.
void reserve(const label len)
Reserve allocation space for at least this size, allocating new space if required and retaining old c...
static word timeName(const scalar t, const int precision=precision_)
Return a time name for the given scalar time value formatted with the given precision.
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
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...
Foam::word regionName(args.getOrDefault< word >("region", Foam::polyMesh::defaultRegion))
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
Automatically write from objectRegistry::writeObject()
messageStream Info
Information stream (stdout output on master, null elsewhere)
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Registry of regIOobjects.
Foam::argList args(argc, argv)
Defines the attributes of an object for which implicit objectRegistry management is supported...
Do not request registration (bool: false)
static void addOptions(const bool constant=true, const bool withZero=false)
Add timeSelector options to argList::validOptions.