56const string singleCellName =
"singleCell";
59template<
class GeoField>
69 GeoField* scFldPtr = scFld.
ptr();
70 scFldPtr->writeOpt(IOobject::AUTO_WRITE);
77int main(
int argc,
char *argv[])
81 "Map fields to a mesh with all internal faces removed"
82 " (singleCellFvMesh) which gets written to region 'singleCell'"
85 timeSelector::addOptions(
true,
false);
97 <<
"Cannot convert region " << singleCellName
98 <<
" since result would overwrite it. Please rename your region."
103 Info<<
"Creating singleCell mesh" <<
nl <<
endl;
111 mesh.pointsInstance(),
122 if (!
exists(scMesh().fvSolution::objectPath()))
124 mkDir(scMesh().fvSolution::path());
125 ln(
"../fvSolution", scMesh().fvSolution::objectPath());
127 if (!
exists(scMesh().fvSchemes::objectPath()))
129 mkDir(scMesh().fvSolution::path());
130 ln(
"../fvSchemes", scMesh().fvSchemes::objectPath());
136 runTime.setTime(timeDirs[timeI], timeI);
142 if (
mesh.readUpdate() != polyMesh::UNCHANGED)
144 Info<<
"Detected changed mesh. Recreating singleCell mesh." <<
endl;
153 mesh.pointsInstance(),
184 interpolateFields(scMesh(), vsFlds);
185 interpolateFields(scMesh(), vvFlds);
186 interpolateFields(scMesh(), vstFlds);
187 interpolateFields(scMesh(), vsymtFlds);
188 interpolateFields(scMesh(), vtFlds);
Field reading functions for post-processing utilities.
List of IOobjects with searching and retrieving facilities.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
virtual bool write(const bool valid=true) const
Write mesh using IO settings from time.
void clear()
Clear all entries from the registry.
void setInstance(const fileName &instance, const IOobject::writeOption wOpt=IOobject::AUTO_WRITE)
Set the instance for mesh files.
void reset(const label nPoints, const label nInternalFaces, const label nFaces, const label nCells)
Reset this primitiveMesh given the primitive array sizes.
fvMesh as subset of other mesh. Consists of one cell and all original bounday faces....
tmp< GeometricField< Type, fvPatchField, volMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &) const
A class for managing temporary objects.
T * ptr() const
Return managed pointer for reuse, or clone() the object reference.
Foam::word regionName(Foam::polyMesh::defaultRegion)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
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.
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?
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
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.