56 const string singleCellName =
"singleCell";
59 template<
class GeoField>
60 void interpolateFields
69 GeoField* scFldPtr = scFld.
ptr();
77 int main(
int argc,
char *argv[])
81 "Map fields to a mesh with all internal faces removed" 82 " (singleCellFvMesh) which gets written to region 'singleCell'" 97 <<
"Cannot convert region " << singleCellName
98 <<
" since result would overwrite it. Please rename your region." 103 Info<<
"Creating singleCell mesh" <<
nl <<
endl;
144 Info<<
"Detected changed mesh. Recreating singleCell mesh." <<
endl;
184 interpolateFields(scMesh(), vsFlds);
185 interpolateFields(scMesh(), vvFlds);
186 interpolateFields(scMesh(), vstFlds);
187 interpolateFields(scMesh(), vsymtFlds);
188 interpolateFields(scMesh(), vtFlds);
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 bounday faces. Useful when manipulating boundary data. Single internal cell only needed to be able to manipulate in a standard way.
wordList ReadFields(const typename GeoMesh::Mesh &mesh, const IOobjectList &objects, PtrList< GeometricField< Type, PatchField, GeoMesh >> &fields, const bool syncPar=true, const bool readOldTime=false)
Read Geometric fields of templated type.
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)
Ostream & endl(Ostream &os)
Add newline and flush stream.
tmp< GeometricField< Type, fvPatchField, volMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &) const
Map volField. Internal field set to average, patch fields straight copies.
Field reading functions for post-processing utilities.
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.
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 void setTime(const Time &t)
Reset the time and time-index to those of the given time.
virtual bool write(const bool writeOnProc=true) const
Write mesh using IO settings from time.
bool ln(const fileName &src, const fileName &dst)
Create a softlink. dst should not exist. Returns true if successful.
void reset(const label nPoints, const label nInternalFaces, const label nFaces, const label nCells)
Reset this primitiveMesh given the primitive array sizes.
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.
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...
void setInstance(const fileName &instance, const IOobjectOption::writeOption wOpt=IOobject::AUTO_WRITE)
Set the instance for mesh files.
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()
void clear()
Clear all entries from the registry.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
T * ptr() const
Return managed pointer for reuse, or clone() the object reference.
A class for managing temporary objects.
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.