/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2026 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see .
\*---------------------------------------------------------------------------*/
#include "GeometricField.H"
#include "Time.H"
#include "demandDrivenData.H"
#include "dictionary.H"
#include "localIOdictionary.H"
#include "solutionControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define checkFieldAssignment(gf1, gf2) \
\
if \
( \
static_cast(&gf1) \
== static_cast(&gf2) \
) \
{ \
FatalErrorInFunction \
<< "attempted assignment to self for field " \
<< (gf1).name() << abort(FatalError); \
}
#define checkFieldOperation(gf1, gf2, op) \
\
if ((gf1).mesh() != (gf2).mesh()) \
{ \
FatalErrorInFunction \
<< "different mesh for fields " \
<< (gf1).name() << " and " << (gf2).name() \
<< " during operation " << op \
<< abort(FatalError); \
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
template class PrimitiveField>
void Foam::GeometricField::readFields
(
const dictionary& dict
)
{
printDictionary print(dict);
Internal::readField(dict, "internalField");
boundaryField_.readField(*this, dict.subDict("boundaryField"));
// Don't use subOrEmptyDict here, or line numbers will be lost from any IO
// error messages. Use an actual sub-dict reference here if possible.
if (dict.found("sources"))
{
sources_.readField(*this, dict.subDict("sources"));
}
else
{
sources_.readField(*this, dictionary("sources", dict));
}
if (dict.found("referenceLevel"))
{
Type fieldAverage(pTraits(dict.lookup("referenceLevel")));
Field::operator+=(fieldAverage);
forAll(boundaryField_, patchi)
{
boundaryField_[patchi] == boundaryField_[patchi] + fieldAverage;
}
}
}
template class PrimitiveField>
void Foam::GeometricField::readFields()
{
const localIOdictionary dict
(
IOobject
(
this->name(),
this->instance(),
this->local(),
this->db(),
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
),
typeName
);
this->close();
readFields(dict);
}
template class PrimitiveField>
bool Foam::GeometricField::readIfPresent()
{
if
(
this->readOpt() == IOobject::MUST_READ
|| this->readOpt() == IOobject::MUST_READ_IF_MODIFIED
|| (this->readOpt() == IOobject::READ_IF_PRESENT && this->headerOk())
)
{
readFields();
// Check compatibility between field and mesh
if (this->size() != this->mesh().size())
{
FatalIOErrorInFunction(this->readStream(typeName))
<< " number of field elements = " << this->size()
<< " number of mesh elements = "
<< this->mesh().size()
<< exit(FatalIOError);
}
readOldTimeIfPresent();
return true;
}
return false;
}
// * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
template class PrimitiveField>
Foam::GeometricField::GeometricField
(
const IOobject& io,
const GeoMesh& mesh,
const dimensionSet& ds,
const word& patchFieldType
)
:
Internal(io, mesh, ds, false),
OldTimeField(this->time().timeIndex()),
fieldPrevIterPtr_(nullptr),
boundaryField_(mesh.boundary(), *this, patchFieldType),
sources_()
{
if (debug)
{
InfoInFunction
<< "Constructing field" << endl << this->info() << endl;
}
readIfPresent();
}
template class PrimitiveField>
Foam::GeometricField::GeometricField
(
const IOobject& io,
const GeoMesh& mesh,
const dimensionSet& ds,
const wordList& patchFieldTypes,
const wordList& actualPatchTypes,
const HashTable& fieldSourceTypes,
const IOerrorLocation& fieldSourceErrorLocation
)
:
Internal(io, mesh, ds, false),
OldTimeField(this->time().timeIndex()),
fieldPrevIterPtr_(nullptr),
boundaryField_(mesh.boundary(), *this, patchFieldTypes, actualPatchTypes),
sources_(*this, fieldSourceTypes, fieldSourceErrorLocation)
{
if (debug)
{
InfoInFunction
<< "Constructing field" << endl << this->info() << endl;
}
readIfPresent();
}
template class PrimitiveField>
Foam::GeometricField::GeometricField
(
const IOobject& io,
const GeoMesh& mesh,
const dimensioned& dt,
const word& patchFieldType
)
:
Internal(io, mesh, dt, false),
OldTimeField(this->time().timeIndex()),
fieldPrevIterPtr_(nullptr),
boundaryField_(mesh.boundary(), *this, patchFieldType),
sources_()
{
if (debug)
{
InfoInFunction
<< "Constructing field" << endl << this->info() << endl;
}
boundaryField_ == dt.value();
readIfPresent();
}
template class PrimitiveField>
Foam::GeometricField::GeometricField
(
const IOobject& io,
const GeoMesh& mesh,
const dimensioned& dt,
const wordList& patchFieldTypes,
const wordList& actualPatchTypes,
const HashTable& fieldSourceTypes,
const IOerrorLocation& fieldSourceErrorLocation
)
:
Internal(io, mesh, dt, false),
OldTimeField(this->time().timeIndex()),
fieldPrevIterPtr_(nullptr),
boundaryField_(mesh.boundary(), *this, patchFieldTypes, actualPatchTypes),
sources_(*this, fieldSourceTypes, fieldSourceErrorLocation)
{
if (debug)
{
InfoInFunction
<< "Constructing field" << endl << this->info() << endl;
}
boundaryField_ == dt.value();
readIfPresent();
}
template class PrimitiveField>
Foam::GeometricField::GeometricField
(
const IOobject& io,
const Internal& diField,
const PtrField& ptfl,
const HashPtrTable& stft
)
:
Internal(io, diField, false),
OldTimeField(this->time().timeIndex()),
fieldPrevIterPtr_(nullptr),
boundaryField_(this->mesh().boundary(), *this, ptfl),
sources_(*this, stft)
{
if (debug)
{
InfoInFunction
<< "Constructing field from components" << endl
<< this->info() << endl;
}
readIfPresent();
}
template class PrimitiveField>
template
Foam::GeometricField::GeometricField
(
const IOobject& io,
const InternalExpression& ie,
const BoundaryExpression& be,
const HashPtrTable& stft
)
:
Internal(io, ie, false),
OldTimeField(this->time().timeIndex()),
fieldPrevIterPtr_(nullptr),
boundaryField_(this->mesh().boundary(), internalField(), be),
sources_(*this, stft)
{
if (debug)
{
InfoInFunction
<< "Constructing field from component expressions" << endl
<< this->info() << endl;
}
readIfPresent();
}
template class PrimitiveField>
Foam::GeometricField::GeometricField
(
const IOobject& io,
const GeoMesh& mesh,
const dimensionSet& ds,
const PrimitiveField& iField,
const PtrField& ptfl,
const HashPtrTable& stft
)
:
Internal(io, mesh, ds, iField),
OldTimeField(this->time().timeIndex()),
fieldPrevIterPtr_(nullptr),
boundaryField_(mesh.boundary(), *this, ptfl),
sources_(*this, stft)
{
if (debug)
{
InfoInFunction
<< "Constructing field from components" << endl
<< this->info() << endl;
}
}
template class PrimitiveField>
template
Foam::GeometricField::GeometricField
(
const IOobject& io,
const GeoMesh& mesh,
const dimensionSet& ds,
const InternalExpression& ie,
const BoundaryExpression& be,
const HashPtrTable& stft
)
:
Internal(io, mesh, ds, ie),
OldTimeField(this->time().timeIndex()),
fieldPrevIterPtr_(nullptr),
boundaryField_(mesh.boundary(), internalField(), be),
sources_(*this, stft)
{
if (debug)
{
InfoInFunction
<< "Constructing field from components" << endl
<< this->info() << endl;
}
}
template class PrimitiveField>
Foam::GeometricField::GeometricField
(
const IOobject& io,
const GeoMesh& mesh,
const dimensionSet& dims
)
:
Internal(io, mesh, dims, false),
OldTimeField(this->time().timeIndex()),
fieldPrevIterPtr_(nullptr),
boundaryField_(mesh.boundary()),
sources_()
{
readFields();
// Check compatibility between field and mesh
if (this->size() != this->mesh().size())
{
FatalIOErrorInFunction(this->readStream(typeName))
<< " number of field elements = " << this->size()
<< " number of mesh elements = " << this->mesh().size()
<< exit(FatalIOError);
}
readOldTimeIfPresent();
if (debug)
{
InfoInFunction
<< "Finishing read-construction of" << endl << this->info() << endl;
}
}
template class PrimitiveField>
Foam::GeometricField::GeometricField
(
const IOobject& io,
const GeoMesh& mesh,
const dictionary& dict,
const dimensionSet& dims
)
:
Internal(io, mesh, dims, false),
OldTimeField(this->time().timeIndex()),
fieldPrevIterPtr_(nullptr),
boundaryField_(mesh.boundary()),
sources_()
{
readFields(dict);
// Check compatibility between field and mesh
if (this->size() != this->mesh().size())
{
FatalErrorInFunction
<< " number of field elements = " << this->size()
<< " number of mesh elements = " << this->mesh().size()
<< exit(FatalIOError);
}
if (debug)
{
InfoInFunction
<< "Finishing dictionary-construct of "
<< endl << this->info() << endl;
}
}
template class PrimitiveField>
Foam::GeometricField::GeometricField
(
const GeometricField& gf
)
:
Internal(gf.internalField()),
OldTimeField(gf),
fieldPrevIterPtr_(nullptr),
boundaryField_(*this, gf.boundaryField_),
sources_(*this, gf.sources_)
{
if (debug)
{
InfoInFunction
<< "Constructing field as copy" << endl << this->info() << endl;
}
this->writeOpt() = IOobject::NO_WRITE;
}
template class PrimitiveField>
template class PrimitiveField2>
Foam::GeometricField::GeometricField
(
const GeometricField& gf
)
:
Internal(gf.internalField()),
OldTimeField(gf),
fieldPrevIterPtr_(nullptr),
boundaryField_(*this, gf.boundaryField_),
sources_(*this, gf.sources_)
{
if (debug)
{
InfoInFunction
<< "Constructing field as copy" << endl << this->info() << endl;
}
this->writeOpt() = IOobject::NO_WRITE;
}
template class PrimitiveField>
Foam::GeometricField::GeometricField
(
GeometricField&& gf
)
:
Internal(move(gf.internalFieldRef())),
OldTimeField(move(gf)),
fieldPrevIterPtr_(nullptr),
boundaryField_(*this, gf.boundaryField_),
sources_(*this, gf.sources_)
{
if (debug)
{
InfoInFunction
<< "Constructing field by moving" << endl << this->info() << endl;
}
this->writeOpt() = IOobject::NO_WRITE;
}
template class PrimitiveField>
Foam::GeometricField::GeometricField
(
const tmp>& tgf
)
:
Internal
(
const_cast&>(tgf()),
tgf.isTmp()
),
OldTimeField(tgf().timeIndex()),
fieldPrevIterPtr_(nullptr),
boundaryField_(*this, tgf().boundaryField_),
sources_(*this, tgf().sources_)
{
if (debug)
{
InfoInFunction
<< "Constructing field from tmp" << endl << this->info() << endl;
}
this->writeOpt() = IOobject::NO_WRITE;
tgf.clear();
}
template class PrimitiveField>
template
Foam::GeometricField::GeometricField
(
const Expression& e
)
:
Internal(expression::access(e, GeometricField_InternalField())),
OldTimeField(this->time().timeIndex()),
fieldPrevIterPtr_(nullptr),
boundaryField_
(
internalField().mesh().boundary(),
internalField(),
expression::access
(
e,
expression::Value(),
GeometricField_BoundaryField()
)
)
{
if (debug)
{
InfoInFunction
<< "Constructing field from expression" << nl
<< this->info() << endl;
}
this->writeOpt() = IOobject::NO_WRITE;
}
template class PrimitiveField>
template class PrimitiveField2>
Foam::GeometricField::GeometricField
(
const IOobject& io,
const GeometricField& gf
)
:
Internal(io, gf.internalField(), false),
OldTimeField(gf.timeIndex()),
fieldPrevIterPtr_(nullptr),
boundaryField_(*this, gf.boundaryField_),
sources_(*this, gf.sources_)
{
if (debug)
{
InfoInFunction
<< "Constructing field as copy resetting IO params"
<< endl << this->info() << endl;
}
if (!readIfPresent())
{
copyOldTimes(io, gf);
}
}
template class PrimitiveField>
Foam::GeometricField::GeometricField
(
const IOobject& io,
const tmp>& tgf
)
:
Internal
(
io,
const_cast&>(tgf()),
tgf.isTmp(),
false
),
OldTimeField(tgf().timeIndex()),
fieldPrevIterPtr_(nullptr),
boundaryField_(*this, tgf().boundaryField_),
sources_(*this, tgf().sources_)
{
if (debug)
{
InfoInFunction
<< "Constructing field from tmp resetting IO params"
<< endl << this->info() << endl;
}
tgf.clear();
readIfPresent();
}
template class PrimitiveField>
template class PrimitiveField2>
Foam::GeometricField::GeometricField
(
const word& newName,
const GeometricField& gf
)
:
Internal(newName, gf.internalField()),
OldTimeField(gf.timeIndex()),
fieldPrevIterPtr_(nullptr),
boundaryField_(*this, gf.boundaryField_),
sources_(*this, gf.sources_)
{
if (debug)
{
InfoInFunction
<< "Constructing field as copy resetting name"
<< endl << this->info() << endl;
}
copyOldTimes(newName, gf);
}
template class PrimitiveField>
Foam::GeometricField::GeometricField
(
const word& newName,
const tmp>& tgf
)
:
Internal
(
newName,
const_cast&>(tgf()),
tgf.isTmp()
),
OldTimeField(tgf().timeIndex()),
fieldPrevIterPtr_(nullptr),
boundaryField_(*this, tgf().boundaryField_),
sources_(*this, tgf().sources_)
{
if (debug)
{
InfoInFunction
<< "Constructing field from tmp resetting name"
<< endl << this->info() << endl;
}
tgf.clear();
}
template class PrimitiveField>
template class PrimitiveField2>
Foam::GeometricField::GeometricField
(
const IOobject& io,
const GeometricField& gf,
const word& patchFieldType
)
:
Internal(io, gf.internalField(), false),
OldTimeField(gf.timeIndex()),
fieldPrevIterPtr_(nullptr),
boundaryField_(this->mesh().boundary(), *this, patchFieldType),
sources_(*this, gf.sources_)
{
if (debug)
{
InfoInFunction
<< "Constructing field as copy resetting IO params"
<< endl << this->info() << endl;
}
boundaryField_ == gf.boundaryField_;
if (!readIfPresent())
{
copyOldTimes(io, gf);
}
}
template class PrimitiveField>
Foam::GeometricField::GeometricField
(
const IOobject& io,
const tmp>& tgf,
const word& patchFieldType
)
:
Internal
(
io,
const_cast&>(tgf()),
tgf.isTmp(),
false
),
OldTimeField(tgf().timeIndex()),
fieldPrevIterPtr_(nullptr),
boundaryField_(this->mesh().boundary(), *this, patchFieldType),
sources_(*this, tgf().sources_)
{
if (debug)
{
InfoInFunction
<< "Constructing field as copy resetting IO params"
<< endl << this->info() << endl;
}
boundaryField_ == tgf().boundaryField_;
tgf.clear();
readIfPresent();
}
template class PrimitiveField>
template
Foam::GeometricField::GeometricField
(
const IOobject& io,
const Expression& e,
const word& patchFieldType
)
:
Internal(io, expression::access(e, GeometricField_InternalField()), false),
OldTimeField(this->time().timeIndex()),
fieldPrevIterPtr_(nullptr),
boundaryField_
(
this->mesh().boundary(),
*this,
patchFieldType
),
sources_()
{
if (debug)
{
InfoInFunction
<< "Constructing field as copy resetting IO params"
<< endl << this->info() << endl;
}
boundaryField_ == expression::access
(
e,
expression::Value(),
GeometricField_BoundaryField()
);
readIfPresent();
}
template class PrimitiveField>
template class PrimitiveField2>
Foam::GeometricField::GeometricField
(
const IOobject& io,
const DimensionedField& df,
const word& patchFieldType
)
:
Internal(io, df, false),
OldTimeField(this->time().timeIndex()),
fieldPrevIterPtr_(nullptr),
boundaryField_(this->mesh().boundary(), *this, patchFieldType),
sources_()
{
if (debug)
{
InfoInFunction
<< "Constructing field from components" << endl
<< this->info() << endl;
}
if (!readIfPresent())
{
boundaryField_.evaluate();
}
}
template class PrimitiveField>
Foam::GeometricField::GeometricField
(
const IOobject& io,
const tmp& tdf,
const word& patchFieldType
)
:
Internal(io, const_cast(tdf()), tdf.isTmp(), false),
OldTimeField(tdf().timeIndex()),
fieldPrevIterPtr_(nullptr),
boundaryField_(this->mesh().boundary(), *this, patchFieldType),
sources_()
{
if (debug)
{
InfoInFunction
<< "Constructing field from components" << endl
<< this->info() << endl;
}
if (!readIfPresent())
{
boundaryField_.evaluate();
}
}
template class PrimitiveField>
template class PrimitiveField2>
Foam::GeometricField::GeometricField
(
const IOobject& io,
const GeometricField& gf,
const wordList& patchFieldTypes,
const wordList& actualPatchTypes,
const HashTable& fieldSourceTypes,
const IOerrorLocation& fieldSourceErrorLocation
)
:
Internal(io, gf.internalField(), false),
OldTimeField(gf.timeIndex()),
fieldPrevIterPtr_(nullptr),
boundaryField_
(
this->mesh().boundary(),
*this,
patchFieldTypes,
actualPatchTypes
),
sources_(*this, fieldSourceTypes, fieldSourceErrorLocation)
{
if (debug)
{
InfoInFunction
<< "Constructing field as copy resetting IO params and patch types"
<< endl << this->info() << endl;
}
boundaryField_ == gf.boundaryField_;
if (!readIfPresent())
{
copyOldTimes(io, gf);
}
}
template class PrimitiveField>
Foam::GeometricField::GeometricField
(
const IOobject& io,
const tmp>& tgf,
const wordList& patchFieldTypes,
const wordList& actualPatchTypes,
const HashTable& fieldSourceTypes,
const IOerrorLocation& fieldSourceErrorLocation
)
:
Internal
(
io,
const_cast&>(tgf()),
tgf.isTmp(),
false
),
OldTimeField(tgf().timeIndex()),
fieldPrevIterPtr_(nullptr),
boundaryField_
(
this->mesh().boundary(),
*this,
patchFieldTypes,
actualPatchTypes
),
sources_(*this, fieldSourceTypes, fieldSourceErrorLocation)
{
if (debug)
{
InfoInFunction
<< "Constructing field from tmp resetting IO params and patch types"
<< endl << this->info() << endl;
}
boundaryField_ == tgf().boundaryField_;
tgf.clear();
readIfPresent();
}
template class PrimitiveField>
template
Foam::GeometricField::GeometricField
(
const IOobject& io,
const Expression& e,
const wordList& patchFieldTypes,
const wordList& actualPatchTypes,
const HashTable& fieldSourceTypes,
const IOerrorLocation& fieldSourceErrorLocation
)
:
Internal(io, expression::access(e, GeometricField_InternalField()), false),
OldTimeField(this->time().timeIndex()),
fieldPrevIterPtr_(nullptr),
boundaryField_
(
this->mesh().boundary(),
*this,
patchFieldTypes,
actualPatchTypes
),
sources_(*this, fieldSourceTypes, fieldSourceErrorLocation)
{
if (debug)
{
InfoInFunction
<< "Constructing field from tmp resetting IO params and patch types"
<< endl << this->info() << endl;
}
boundaryField_ == expression::access
(
e,
expression::Value(),
GeometricField_BoundaryField()
);
readIfPresent();
}
template class PrimitiveField>
template class PrimitiveField2>
Foam::GeometricField::GeometricField
(
const IOobject& io,
const DimensionedField& df,
const wordList& patchFieldTypes,
const wordList& actualPatchTypes,
const HashTable& fieldSourceTypes,
const IOerrorLocation& fieldSourceErrorLocation
)
:
Internal(io, df, false),
OldTimeField(df.timeIndex()),
fieldPrevIterPtr_(nullptr),
boundaryField_
(
this->mesh().boundary(),
*this,
patchFieldTypes,
actualPatchTypes
),
sources_(*this, fieldSourceTypes, fieldSourceErrorLocation)
{
if (debug)
{
InfoInFunction
<< "Constructing field from internal field and patch types"
<< endl << this->info() << endl;
}
readIfPresent();
}
template class PrimitiveField>
Foam::GeometricField::GeometricField
(
const IOobject& io,
const tmp& tdf,
const wordList& patchFieldTypes,
const wordList& actualPatchTypes,
const HashTable& fieldSourceTypes,
const IOerrorLocation& fieldSourceErrorLocation
)
:
Internal(io, const_cast(tdf()), tdf.isTmp(), false),
OldTimeField(tdf().timeIndex()),
fieldPrevIterPtr_(nullptr),
boundaryField_
(
this->mesh().boundary(),
*this,
patchFieldTypes,
actualPatchTypes
),
sources_(*this, fieldSourceTypes, fieldSourceErrorLocation)
{
if (debug)
{
InfoInFunction
<< "Constructing field from tmp internal field and patch types"
<< endl << this->info() << endl;
}
tdf.clear();
readIfPresent();
}
template class PrimitiveField>
Foam::tmp>
Foam::GeometricField::clone() const
{
return tmp>
(
new GeometricField(*this)
);
}
template class PrimitiveField>
Foam::tmp>
Foam::GeometricField::cloneUnSliced() const
{
return tmp>
(
new GeometricField
(
IOobject
(
this->name(),
this->mesh().db().time().name(),
this->mesh().db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
*this,
PatchField::calculatedType()
)
);
}
template class PrimitiveField>
Foam::tmp>
Foam::GeometricField::New
(
const word& name,
const Internal& diField,
const PtrField& ptfl,
const HashPtrTable& stft
)
{
const bool cacheTmp = diField.mesh().db().temporaryObjectCached(name);
return tmp>
(
new GeometricField
(
IOobject
(
name,
diField.mesh().db().time().name(),
diField.mesh().db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
cacheTmp
),
diField,
ptfl,
stft
),
cacheTmp
);
}
template class PrimitiveField>
template
Foam::tmp>
Foam::GeometricField::New
(
const word& name,
const InternalExpression& ie,
const BoundaryExpression& be,
const HashPtrTable& stft
)
{
const GeoMesh& mesh = expression::getFirst>(ie);
const bool cacheTmp = mesh.db().temporaryObjectCached(name);
return tmp>
(
new GeometricField
(
IOobject
(
name,
mesh.db().time().name(),
mesh.db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
cacheTmp
),
ie,
be,
stft
),
cacheTmp
);
}
template class PrimitiveField>
Foam::tmp>
Foam::GeometricField::New
(
const word& name,
const GeoMesh& mesh,
const dimensionSet& ds,
const word& patchFieldType
)
{
const bool cacheTmp = mesh.db().temporaryObjectCached(name);
return tmp>
(
new GeometricField
(
IOobject
(
name,
mesh.db().time().name(),
mesh.db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
cacheTmp
),
mesh,
ds,
patchFieldType
),
cacheTmp
);
}
template class PrimitiveField>
Foam::tmp>
Foam::GeometricField::New
(
const word& name,
const GeoMesh& mesh,
const dimensioned& dt,
const word& patchFieldType
)
{
const bool cacheTmp = mesh.db().temporaryObjectCached(name);
return tmp>
(
new GeometricField
(
IOobject
(
name,
mesh.db().time().name(),
mesh.db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
cacheTmp
),
mesh,
dt,
patchFieldType
),
cacheTmp
);
}
template class PrimitiveField>
Foam::tmp>
Foam::GeometricField::New
(
const word& name,
const GeoMesh& mesh,
const dimensioned& dt,
const wordList& patchFieldTypes,
const wordList& actualPatchTypes,
const HashTable& fieldSourceTypes,
const IOerrorLocation& fieldSourceErrorLocation
)
{
const bool cacheTmp = mesh.db().temporaryObjectCached(name);
return tmp>
(
new GeometricField
(
IOobject
(
name,
mesh.db().time().name(),
mesh.db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
cacheTmp
),
mesh,
dt,
patchFieldTypes,
actualPatchTypes,
fieldSourceTypes,
fieldSourceErrorLocation
),
cacheTmp
);
}
template class PrimitiveField>
Foam::tmp>
Foam::GeometricField::New
(
const word& newName,
const tmp>& tgf
)
{
const bool cacheTmp = tgf().db().temporaryObjectCached(newName);
return tmp>
(
new GeometricField
(
IOobject
(
newName,
tgf().instance(),
tgf().local(),
tgf().db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
cacheTmp
),
tgf
),
cacheTmp
);
}
template class PrimitiveField>
template class PrimitiveField2>
Foam::tmp>
Foam::GeometricField::New
(
const word& newName,
const GeometricField& gf,
const word& patchFieldType
)
{
const bool cacheTmp = gf.db().temporaryObjectCached(newName);
return tmp>
(
new GeometricField
(
IOobject
(
newName,
gf.instance(),
gf.local(),
gf.db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
cacheTmp
),
gf,
patchFieldType
),
cacheTmp
);
}
template class PrimitiveField>
Foam::tmp>
Foam::GeometricField::New
(
const word& newName,
const tmp>& tgf,
const word& patchFieldType
)
{
const bool cacheTmp = tgf().db().temporaryObjectCached(newName);
return tmp>
(
new GeometricField
(
IOobject
(
newName,
tgf().instance(),
tgf().local(),
tgf().db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
cacheTmp
),
tgf,
patchFieldType
),
cacheTmp
);
}
template class PrimitiveField>
template class PrimitiveField2>
Foam::tmp>
Foam::GeometricField::New
(
const word& newName,
const DimensionedField& df,
const word& patchFieldType
)
{
const bool cacheTmp = df.db().temporaryObjectCached(newName);
return tmp>
(
new GeometricField
(
IOobject
(
newName,
df.instance(),
df.local(),
df.db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
cacheTmp
),
df,
patchFieldType
),
cacheTmp
);
}
template class PrimitiveField>
Foam::tmp>
Foam::GeometricField::New
(
const word& newName,
const tmp& tdf,
const word& patchFieldType
)
{
const bool cacheTmp = tdf().db().temporaryObjectCached(newName);
return tmp>
(
new GeometricField
(
IOobject
(
newName,
tdf().instance(),
tdf().local(),
tdf().db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
cacheTmp
),
tdf,
patchFieldType
),
cacheTmp
);
}
template class PrimitiveField>
template
Foam::tmp>
Foam::GeometricField::New
(
const word& newName,
const Expression& e,
const word& patchFieldType
)
{
return New(newName, eval(e), patchFieldType);
}
template class PrimitiveField>
template class PrimitiveField2>
Foam::tmp>
Foam::GeometricField::New
(
const word& newName,
const GeometricField& gf,
const wordList& patchFieldTypes,
const wordList& actualPatchTypes,
const HashTable& fieldSourceTypes,
const IOerrorLocation& fieldSourceErrorLocation
)
{
const bool cacheTmp = gf.db().temporaryObjectCached(newName);
return tmp>
(
new GeometricField
(
IOobject
(
newName,
gf.instance(),
gf.local(),
gf.db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
cacheTmp
),
gf,
patchFieldTypes,
actualPatchTypes,
fieldSourceTypes,
fieldSourceErrorLocation
),
cacheTmp
);
}
template class PrimitiveField>
Foam::tmp>
Foam::GeometricField::New
(
const word& newName,
const tmp>& tgf,
const wordList& patchFieldTypes,
const wordList& actualPatchTypes,
const HashTable& fieldSourceTypes,
const IOerrorLocation& fieldSourceErrorLocation
)
{
const bool cacheTmp = tgf().db().temporaryObjectCached(newName);
return tmp>
(
new GeometricField
(
IOobject
(
newName,
tgf().instance(),
tgf().local(),
tgf().db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
cacheTmp
),
tgf,
patchFieldTypes,
actualPatchTypes,
fieldSourceTypes,
fieldSourceErrorLocation
),
cacheTmp
);
}
template class PrimitiveField>
template class PrimitiveField2>
Foam::tmp>
Foam::GeometricField::New
(
const word& newName,
const DimensionedField& df,
const wordList& patchFieldTypes,
const wordList& actualPatchTypes,
const HashTable& fieldSourceTypes,
const IOerrorLocation& fieldSourceErrorLocation
)
{
const bool cacheTmp = df.db().temporaryObjectCached(newName);
return tmp>
(
new GeometricField
(
IOobject
(
newName,
df.instance(),
df.local(),
df.db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
cacheTmp
),
df,
patchFieldTypes,
actualPatchTypes,
fieldSourceTypes,
fieldSourceErrorLocation
),
cacheTmp
);
}
template class PrimitiveField>
Foam::tmp>
Foam::GeometricField::New
(
const word& newName,
const tmp& tdf,
const wordList& patchFieldTypes,
const wordList& actualPatchTypes,
const HashTable