DimensionedField: Added "New" methods to return unregistered temporary fields
This commit is contained in:
@ -276,6 +276,64 @@ DimensionedField<Type, GeoMesh>::clone() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type, class GeoMesh>
|
||||||
|
Foam::tmp<Foam::DimensionedField<Type, GeoMesh>>
|
||||||
|
DimensionedField<Type, GeoMesh>::New
|
||||||
|
(
|
||||||
|
const word& name,
|
||||||
|
const Mesh& mesh,
|
||||||
|
const dimensionSet& ds
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return tmp<DimensionedField<Type, GeoMesh>>
|
||||||
|
(
|
||||||
|
new DimensionedField<Type, GeoMesh>
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
name,
|
||||||
|
mesh.time().timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE,
|
||||||
|
false
|
||||||
|
),
|
||||||
|
mesh,
|
||||||
|
ds,
|
||||||
|
false
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type, class GeoMesh>
|
||||||
|
Foam::tmp<Foam::DimensionedField<Type, GeoMesh>>
|
||||||
|
DimensionedField<Type, GeoMesh>::New
|
||||||
|
(
|
||||||
|
const word& newName,
|
||||||
|
const tmp<DimensionedField<Type, GeoMesh>>& tdf
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return tmp<DimensionedField<Type, GeoMesh>>
|
||||||
|
(
|
||||||
|
new DimensionedField<Type, GeoMesh>
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
newName,
|
||||||
|
tdf().instance(),
|
||||||
|
tdf().local(),
|
||||||
|
tdf().db(),
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE,
|
||||||
|
false
|
||||||
|
),
|
||||||
|
tdf
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type, class GeoMesh>
|
template<class Type, class GeoMesh>
|
||||||
|
|||||||
@ -236,6 +236,22 @@ public:
|
|||||||
//- Clone
|
//- Clone
|
||||||
tmp<DimensionedField<Type, GeoMesh>> clone() const;
|
tmp<DimensionedField<Type, GeoMesh>> clone() const;
|
||||||
|
|
||||||
|
//- Return a temporary field constructed from name, mesh
|
||||||
|
// and dimensionSet
|
||||||
|
static tmp<DimensionedField<Type, GeoMesh>> New
|
||||||
|
(
|
||||||
|
const word& name,
|
||||||
|
const Mesh& mesh,
|
||||||
|
const dimensionSet&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Rename temporary field and return
|
||||||
|
static tmp<DimensionedField<Type, GeoMesh>> New
|
||||||
|
(
|
||||||
|
const word& newName,
|
||||||
|
const tmp<DimensionedField<Type, GeoMesh>>&
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~DimensionedField();
|
virtual ~DimensionedField();
|
||||||
|
|||||||
Reference in New Issue
Block a user