STYLE: add documentation to GeometricField::New

- also use tmp::New forwarding internally
This commit is contained in:
Mark Olesen
2019-11-15 15:54:37 +01:00
committed by Andrew Heather
parent cf2b84ef32
commit a3d0a7d049
2 changed files with 89 additions and 96 deletions

View File

@ -709,23 +709,20 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::New
const word& patchFieldType
)
{
return tmp<GeometricField<Type, PatchField, GeoMesh>>
return tmp<GeometricField<Type, PatchField, GeoMesh>>::New
(
new GeometricField<Type, PatchField, GeoMesh>
IOobject
(
IOobject
(
name,
mesh.thisDb().time().timeName(),
mesh.thisDb(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
ds,
patchFieldType
)
name,
mesh.thisDb().time().timeName(),
mesh.thisDb(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
ds,
patchFieldType
);
}
@ -740,28 +737,24 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::New
const word& patchFieldType
)
{
return tmp<GeometricField<Type, PatchField, GeoMesh>>
return tmp<GeometricField<Type, PatchField, GeoMesh>>::New
(
new GeometricField<Type, PatchField, GeoMesh>
IOobject
(
IOobject
(
name,
mesh.thisDb().time().timeName(),
mesh.thisDb(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
dt,
patchFieldType
)
name,
mesh.thisDb().time().timeName(),
mesh.thisDb(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
dt,
patchFieldType
);
}
template<class Type, template<class> class PatchField, class GeoMesh>
Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh>>
Foam::GeometricField<Type, PatchField, GeoMesh>::New
@ -773,24 +766,21 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::New
const wordList& actualPatchTypes
)
{
return tmp<GeometricField<Type, PatchField, GeoMesh>>
return tmp<GeometricField<Type, PatchField, GeoMesh>>::New
(
new GeometricField<Type, PatchField, GeoMesh>
IOobject
(
IOobject
(
name,
mesh.thisDb().time().timeName(),
mesh.thisDb(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
dt,
patchFieldTypes,
actualPatchTypes
)
name,
mesh.thisDb().time().timeName(),
mesh.thisDb(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
dt,
patchFieldTypes,
actualPatchTypes
);
}
@ -803,22 +793,19 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::New
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf
)
{
return tmp<GeometricField<Type, PatchField, GeoMesh>>
return tmp<GeometricField<Type, PatchField, GeoMesh>>::New
(
new GeometricField<Type, PatchField, GeoMesh>
IOobject
(
IOobject
(
newName,
tgf().instance(),
tgf().local(),
tgf().db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
tgf
)
newName,
tgf().instance(),
tgf().local(),
tgf().db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
tgf
);
}
@ -833,24 +820,21 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::New
const wordList& actualPatchTypes
)
{
return tmp<GeometricField<Type, PatchField, GeoMesh>>
return tmp<GeometricField<Type, PatchField, GeoMesh>>::New
(
new GeometricField<Type, PatchField, GeoMesh>
IOobject
(
IOobject
(
newName,
tgf().instance(),
tgf().local(),
tgf().db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
tgf,
patchFieldTypes,
actualPatchTypes
)
newName,
tgf().instance(),
tgf().local(),
tgf().db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
tgf,
patchFieldTypes,
actualPatchTypes
);
}

View File

@ -462,49 +462,58 @@ public:
//- Clone
tmp<GeometricField<Type, PatchField, GeoMesh>> clone() const;
//- Return a temporary field constructed from name, mesh, dimensionSet
// and patch type.
//- Return tmp field from name, mesh, dimensions and patch type.
// The field is NO_READ, NO_WRITE, unregistered and uses the
// current timeName from the mesh registry
static tmp<GeometricField<Type, PatchField, GeoMesh>> New
(
const word& name,
const Mesh&,
const dimensionSet&,
const word& patchFieldType=PatchField<Type>::calculatedType()
const Mesh& mesh,
const dimensionSet& ds,
const word& patchFieldType = PatchField<Type>::calculatedType()
);
//- Return a temporary field constructed from mesh, dimensioned<Type>
// and patch type.
//- Return tmp field from name, mesh, dimensioned\<Type\>
//- and patch type.
// The field is NO_READ, NO_WRITE, unregistered and uses the
// current timeName from the mesh registry
static tmp<GeometricField<Type, PatchField, GeoMesh>> New
(
const word& name,
const Mesh&,
const dimensioned<Type>&,
const word& patchFieldType=PatchField<Type>::calculatedType()
const Mesh& mesh,
const dimensioned<Type>& dt,
const word& patchFieldType = PatchField<Type>::calculatedType()
);
//- Return a temporary field constructed from mesh, dimensioned<Type>
// and patch types.
//- Return tmp field from name, mesh, dimensioned\<Type\>
//- and patch types.
// The field is NO_READ, NO_WRITE, unregistered and uses the
// current timeName from the mesh registry
static tmp<GeometricField<Type, PatchField, GeoMesh>> New
(
const word& name,
const Mesh&,
const dimensioned<Type>&,
const Mesh& mesh,
const dimensioned<Type>& dt,
const wordList& patchFieldTypes,
const wordList& actualPatchTypes = wordList()
);
//- Rename temporary field and return
//- Return renamed tmp field
// The field is NO_READ, NO_WRITE, unregistered and uses the
// current timeName from the mesh registry
static tmp<GeometricField<Type, PatchField, GeoMesh>> New
(
const word& newName,
const tmp<GeometricField<Type, PatchField, GeoMesh>>&
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf
);
//- Rename and reset patch fields types of temporary field and return
//- Rename tmp field and reset patch field types and return
// The field is NO_READ, NO_WRITE, unregistered and uses the
// current timeName from the mesh registry
static tmp<GeometricField<Type, PatchField, GeoMesh>> New
(
const word& newName,
const tmp<GeometricField<Type, PatchField, GeoMesh>>&,
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf,
const wordList& patchFieldTypes,
const wordList& actualPatchTypes = wordList()
);
@ -621,7 +630,7 @@ public:
void writeMinMax(Ostream& os) const;
// Member function *this operators
// Member Function *this Operators
//- Negate the field inplace
void negate();