40template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
41GeometricField<Type, PatchField, GeoMesh>* variablesSet::allocateNamedField
45 const word& solverName
48 typedef GeometricField<Type, PatchField, GeoMesh> fieldType;
51 localIOdictionary
dict
69 for (entry& dEntry : bField)
73 dEntry.dict().add<word>(
"solverName",
solverName,
true);
83template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
84bool variablesSet::readFieldOK
86 autoPtr<GeometricField<Type, PatchField, GeoMesh>>& fieldPtr,
89 const word& solverName,
90 const bool useSolverNameForFields
93 typedef GeometricField<Type, PatchField, GeoMesh> fieldType;
96 IOobject headerCustomName
105 IOobject headerBaseName
114 bool fieldFound(
false);
119 headerCustomName.typeHeaderOk<fieldType>(
false)
125 allocateNamedField<Type, PatchField, GeoMesh>
135 else if (headerBaseName.typeHeaderOk<fieldType>(
false))
139 allocateNamedField<Type, PatchField, GeoMesh>
150 Info<<
"Field " << customName <<
" not found" <<
endl;
151 Info<<
"Reading base field " << baseName <<
" and renaming ... "
153 fieldPtr.ref().rename(customName);
164template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
165autoPtr<GeometricField<Type, PatchField, GeoMesh>>
189template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
225 const word& baseName,
226 const word& solverName,
227 const bool useSolverNameForFields
247 <<
"Could not read field with custom ("
249 <<
"or base (" << baseName <<
") name"
259 const word& baseName,
260 const word& solverName,
261 const bool useSolverNameForFields
277 const word& solverName
282 typedef typename VolFieldType::Boundary Boundary;
285 const word baseName = baseField.
name();
290 baseField.
rename(customName);
321 Info<<
"Reading custom turbulence field " << customName
322 <<
" and replacing " << baseName <<
nl <<
endl;
323 VolFieldType customField(headerCustomName,
mesh);
332 Boundary& customBoundary = customField.boundaryFieldRef();
333 forAll(baseBoundary, patchI)
338 customBoundary[patchI].
clone(baseField.
ref())
345template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
353 if (
field.nOldTimes())
const Mesh & mesh() const
Return mesh.
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
Generic GeometricField class.
Internal::FieldType & primitiveFieldRef(const bool updateAccessTime=true)
Return a reference to the internal field.
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
Internal & ref(const bool updateAccessTime=true)
Return a reference to the dimensioned internal field.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const word & name() const noexcept
Return the object name.
bool typeHeaderOk(const bool checkType=true, const bool search=true, const bool verbose=true)
Read header (uses typeFilePath to find file) and check its info.
const objectRegistry & db() const noexcept
Return the local objectRegistry.
const fileName & local() const noexcept
Read access to local path component.
const fileName & instance() const noexcept
Read access to instance path component.
static word timeName(const scalar t, const int precision=precision_)
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
void reset(autoPtr< T > &&other) noexcept
Delete managed object and set to new given pointer.
T * ptr() noexcept
Same as release().
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
Generic dimensioned Type class.
Mesh data needed to do the Finite Volume discretisation.
const Time & time() const
Return the top-level database.
virtual void rename(const word &newName)
Rename.
A class for managing temporary objects.
void swapAndRename(autoPtr< GeometricField< Type, PatchField, GeoMesh > > &p1, autoPtr< GeometricField< Type, PatchField, GeoMesh > > &p2)
Swap autoPtrs and rename managed fields.
autoPtr< GeometricField< Type, PatchField, GeoMesh > > allocateRenamedField(const autoPtr< GeometricField< Type, PatchField, GeoMesh > > &bf)
void renameTurbulenceField(GeometricField< Type, fvPatchField, volMesh > &baseField, const word &solverName)
static void setField(autoPtr< GeometricField< Type, fvPatchField, volMesh > > &fieldPtr, const fvMesh &mesh, const word &baseName, const word &solverName, const bool useSolverNameForFields)
Read vol fields.
const word & solverName() const
Return solver name.
bool useSolverNameForFields() const
Append solver name to fields?
virtual autoPtr< variablesSet > clone() const
Clone the variablesSet.
tmp< GeometricField< Type, fvPatchField, volMesh > > allocateField(const fvMesh &mesh, const word &baseName, const word &solverName, const bool useSolverNameForFields)
static void nullifyField(GeometricField< Type, PatchField, GeoMesh > &fieldPtr)
Nullify field and old times, if present.
A class for handling words, derived from Foam::string.
Info<< "Creating field kinetic energy K\n"<< endl;volScalarField K("K", 0.5 *magSqr(U));if(U.nOldTimes()){ volVectorField *Uold=&U.oldTime();volScalarField *Kold=&K.oldTime();*Kold==0.5 *magSqr(*Uold);while(Uold->nOldTimes()) { Uold=&Uold-> oldTime()
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
#define DebugInfo
Report an information message using Foam::Info.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static constexpr const zero Zero
Global zero (0)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.