56const word singleCellName =
"singleCell";
59template<
class GeoField>
70 GeoField* subFld = subsetter.
interpolate(flds[i]).ptr();
75 names[i] = subFld->name();
84int 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;
118 mesh.pointsInstance(),
127 scMesh().setInstance(
mesh.pointsInstance());
147 runTime.setTime(timeDirs[timei], timei);
152 if (!storedObjects.
empty())
155 storedObjects.
clear();
161 Info<<
"Detected changed mesh. Recreating singleCell mesh." <<
endl;
162 scMesh.reset(
nullptr);
170 mesh.pointsInstance(),
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
203 <<
" mesh/fields to time " <<
runTime.timeName() <<
endl;
Field reading functions for post-processing utilities.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
void reserve(const label len)
Reserve allocation space for at least this size, allocating new space if required and retaining old c...
List of IOobjects with searching and retrieving facilities. Implemented as a HashTable,...
@ NO_REGISTER
Do not request registration (bool: false).
@ NO_READ
Nothing to be read.
@ AUTO_WRITE
Automatically write from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
fileName path() const
The complete path for the object (with instance, local,...).
fileName objectPath() const
The complete path + object name.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
bool empty() const noexcept
True if List is empty (ie, size() is zero).
label size() const noexcept
The number of entries in the list.
static void addNote(const string ¬e)
Add extra notes for the usage information.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Registry of regIOobjects.
fvMesh as subset of other mesh. Consists of one cell and all original boundary faces....
tmp< GeometricField< Type, fvPatchField, volMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &) const
Map volField. Internal field set to average, patch fields straight copies.
static void addOptions(const bool constant=true, const bool withZero=false)
Add timeSelector options to argList::validOptions.
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...
A class for handling words, derived from Foam::string.
Foam::word regionName(args.getOrDefault< word >("region", Foam::polyMesh::defaultRegion))
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define doLocalCode(FieldType, Variable)
List< word > wordList
List of word.
GeometricField< vector, fvPatchField, volMesh > volVectorField
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?
GeometricField< scalar, fvPatchField, volMesh > volScalarField
messageStream Info
Information stream (stdout output on master, null elsewhere).
List< instant > instantList
List of instants.
Ostream & endl(Ostream &os)
Add newline and flush stream.
GeometricField< tensor, fvPatchField, volMesh > volTensorField
GeometricField< sphericalTensor, fvPatchField, volMesh > volSphericalTensorField
GeometricField< symmTensor, fvPatchField, volMesh > volSymmTensorField
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
errorManipArg< error, int > exit(error &err, const int errNo=1)
bool ln(const fileName &src, const fileName &dst)
Create a softlink. dst should not exist. Returns true if successful.
constexpr char nl
The newline '\n' character (0x0a).
Foam::argList args(argc, argv)
#define forAll(list, i)
Loop across all elements in list.