adding -fields option

This commit is contained in:
andy
2008-09-30 15:57:55 +01:00
parent 071b8ffe89
commit cc0dbb0549
3 changed files with 74 additions and 36 deletions

View File

@ -131,7 +131,7 @@ Foam::fvFieldReconstructor::reconstructFvVolumeField
forAll(cp, faceI)
{
// Subtract one to take into account offsets for
// face direction.
// face direction.
reverseAddressing[faceI] = cp[faceI] - 1 - curPatchStart;
}
@ -151,7 +151,7 @@ Foam::fvFieldReconstructor::reconstructFvVolumeField
forAll(cp, faceI)
{
// Subtract one to take into account offsets for
// face direction.
// face direction.
label curF = cp[faceI] - 1;
// Is the face on the boundary?
@ -282,7 +282,7 @@ Foam::fvFieldReconstructor::reconstructFvSurfaceField
// It is necessary to create a copy of the addressing array to
// take care of the face direction offset trick.
//
//
{
labelList curAddr(faceProcAddressing_[procI]);
@ -342,7 +342,7 @@ Foam::fvFieldReconstructor::reconstructFvSurfaceField
forAll(cp, faceI)
{
// Subtract one to take into account offsets for
// face direction.
// face direction.
reverseAddressing[faceI] = cp[faceI] - 1 - curPatchStart;
}
@ -452,11 +452,12 @@ Foam::fvFieldReconstructor::reconstructFvSurfaceField
}
// Reconstruct and write all volume fields
// Reconstruct and write all/selected volume fields
template<class Type>
void Foam::fvFieldReconstructor::reconstructFvVolumeFields
(
const IOobjectList& objects
const IOobjectList& objects,
const HashSet<word>& selectedFields
)
{
const word& fieldClassName =
@ -468,27 +469,29 @@ void Foam::fvFieldReconstructor::reconstructFvVolumeFields
{
Info<< " Reconstructing " << fieldClassName << "s\n" << endl;
for
(
IOobjectList::const_iterator fieldIter = fields.begin();
fieldIter != fields.end();
++fieldIter
)
forAllConstIter(IOobjectList, fields, fieldIter)
{
Info<< " " << fieldIter()->name() << endl;
if
(
!selectedFields.size()
|| selectedFields.found(fieldIter()->name())
)
{
Info<< " " << fieldIter()->name() << endl;
reconstructFvVolumeField<Type>(*fieldIter())().write();
reconstructFvVolumeField<Type>(*fieldIter())().write();
}
}
Info<< endl;
}
}
// Reconstruct and write all surface fields
// Reconstruct and write all/selected surface fields
template<class Type>
void Foam::fvFieldReconstructor::reconstructFvSurfaceFields
(
const IOobjectList& objects
const IOobjectList& objects,
const HashSet<word>& selectedFields
)
{
const word& fieldClassName =
@ -500,18 +503,19 @@ void Foam::fvFieldReconstructor::reconstructFvSurfaceFields
{
Info<< " Reconstructing " << fieldClassName << "s\n" << endl;
for
(
IOobjectList::const_iterator fieldIter = fields.begin();
fieldIter != fields.end();
++fieldIter
)
forAllConstIter(IOobjectList, fields, fieldIter)
{
Info<< " " << fieldIter()->name() << endl;
if
(
!selectedFields.size()
|| selectedFields.found(fieldIter()->name())
)
{
Info<< " " << fieldIter()->name() << endl;
reconstructFvSurfaceField<Type>(*fieldIter())().write();
reconstructFvSurfaceField<Type>(*fieldIter())().write();
}
}
Info<< endl;
}
}