Commit 8f0a5ff1 authored by graham's avatar graham
Browse files

ENH: Adding lagrangianFields option to reconstruction.

parent f4c1042f
......@@ -56,6 +56,14 @@ int main(int argc, char *argv[])
"specify a list of fields to be reconstructed. Eg, '(U T p)' - "
"regular expressions not currently supported"
);
argList::addOption
(
"lagrangianFields",
"list",
"specify a list of lagrangian fields to be reconstructed. Eg, '(U d)' -"
"regular expressions not currently supported, "
"positions always included."
);
argList::addBoolOption
(
"noLagrangian",
......@@ -73,6 +81,20 @@ int main(int argc, char *argv[])
const bool noLagrangian = args.optionFound("noLagrangian");
HashSet<word> selectedLagrangianFields;
if (args.optionFound("lagrangianFields"))
{
if (noLagrangian)
{
FatalErrorIn(args.executable())
<< "Cannot specify noLagrangian and lagrangianFields "
<< "options together."
<< exit(FatalError);
}
args.optionLookup("lagrangianFields")() >> selectedLagrangianFields;
}
// determine the processor count directly
label nProcs = 0;
while (isDir(args.path()/(word("processor") + name(nProcs))))
......@@ -403,84 +425,96 @@ int main(int argc, char *argv[])
cloudName,
mesh,
procMeshes.meshes(),
sprayObjs
sprayObjs,
selectedLagrangianFields
);
reconstructLagrangianFieldFields<label>
(
cloudName,
mesh,
procMeshes.meshes(),
sprayObjs
sprayObjs,
selectedLagrangianFields
);
reconstructLagrangianFields<scalar>
(
cloudName,
mesh,
procMeshes.meshes(),
sprayObjs
sprayObjs,
selectedLagrangianFields
);
reconstructLagrangianFieldFields<scalar>
(
cloudName,
mesh,
procMeshes.meshes(),
sprayObjs
sprayObjs,
selectedLagrangianFields
);
reconstructLagrangianFields<vector>
(
cloudName,
mesh,
procMeshes.meshes(),
sprayObjs
sprayObjs,
selectedLagrangianFields
);
reconstructLagrangianFieldFields<vector>
(
cloudName,
mesh,
procMeshes.meshes(),
sprayObjs
sprayObjs,
selectedLagrangianFields
);
reconstructLagrangianFields<sphericalTensor>
(
cloudName,
mesh,
procMeshes.meshes(),
sprayObjs
sprayObjs,
selectedLagrangianFields
);
reconstructLagrangianFieldFields<sphericalTensor>
(
cloudName,
mesh,
procMeshes.meshes(),
sprayObjs
sprayObjs,
selectedLagrangianFields
);
reconstructLagrangianFields<symmTensor>
(
cloudName,
mesh,
procMeshes.meshes(),
sprayObjs
sprayObjs,
selectedLagrangianFields
);
reconstructLagrangianFieldFields<symmTensor>
(
cloudName,
mesh,
procMeshes.meshes(),
sprayObjs
sprayObjs,
selectedLagrangianFields
);
reconstructLagrangianFields<tensor>
(
cloudName,
mesh,
procMeshes.meshes(),
sprayObjs
sprayObjs,
selectedLagrangianFields
);
reconstructLagrangianFieldFields<tensor>
(
cloudName,
mesh,
procMeshes.meshes(),
sprayObjs
sprayObjs,
selectedLagrangianFields
);
}
}
......
......@@ -539,7 +539,7 @@ void Foam::fvFieldReconstructor::reconstructFvVolumeInternalFields
{
if
(
!selectedFields.size()
selectedFields.empty()
|| selectedFields.found(fieldIter()->name())
)
{
......@@ -575,7 +575,7 @@ void Foam::fvFieldReconstructor::reconstructFvVolumeFields
{
if
(
!selectedFields.size()
selectedFields.empty()
|| selectedFields.found(fieldIter()->name())
)
{
......@@ -611,7 +611,7 @@ void Foam::fvFieldReconstructor::reconstructFvSurfaceFields
{
if
(
!selectedFields.size()
selectedFields.empty()
|| selectedFields.found(fieldIter()->name())
)
{
......
......@@ -84,7 +84,8 @@ void reconstructLagrangianFields
const word& cloudName,
const polyMesh& mesh,
const PtrList<fvMesh>& meshes,
const IOobjectList& objects
const IOobjectList& objects,
const HashSet<word>& selectedFields
);
......@@ -94,7 +95,8 @@ void reconstructLagrangianFieldFields
const word& cloudName,
const polyMesh& mesh,
const PtrList<fvMesh>& meshes,
const IOobjectList& objects
const IOobjectList& objects,
const HashSet<word>& selectedFields
);
......
......@@ -155,28 +155,36 @@ void Foam::reconstructLagrangianFields
const word& cloudName,
const polyMesh& mesh,
const PtrList<fvMesh>& meshes,
const IOobjectList& objects
const IOobjectList& objects,
const HashSet<word>& selectedFields
)
{
const word fieldClassName(IOField<Type>::typeName);
IOobjectList fields = objects.lookupClass(fieldClassName);
if (fields.size())
if(fields.size())
{
Info<< " Reconstructing lagrangian "
<< fieldClassName << "s\n" << endl;
forAllConstIter(IOobjectList, fields, fieldIter)
{
Info<< " " << fieldIter()->name() << endl;
reconstructLagrangianField<Type>
if
(
cloudName,
mesh,
meshes,
fieldIter()->name()
)().write();
selectedFields.empty()
|| selectedFields.found(fieldIter()->name())
)
{
Info<< " " << fieldIter()->name() << endl;
reconstructLagrangianField<Type>
(
cloudName,
mesh,
meshes,
fieldIter()->name()
)().write();
}
}
Info<< endl;
......@@ -190,7 +198,8 @@ void Foam::reconstructLagrangianFieldFields
const word& cloudName,
const polyMesh& mesh,
const PtrList<fvMesh>& meshes,
const IOobjectList& objects
const IOobjectList& objects,
const HashSet<word>& selectedFields
)
{
{
......@@ -205,14 +214,21 @@ void Foam::reconstructLagrangianFieldFields
forAllConstIter(IOobjectList, fields, fieldIter)
{
Info<< " " << fieldIter()->name() << endl;
reconstructLagrangianFieldField<Type>
if
(
cloudName,
mesh,
meshes,
fieldIter()->name()
)().write();
selectedFields.empty()
|| selectedFields.found(fieldIter()->name())
)
{
Info<< " " << fieldIter()->name() << endl;
reconstructLagrangianFieldField<Type>
(
cloudName,
mesh,
meshes,
fieldIter()->name()
)().write();
}
}
Info<< endl;
......@@ -231,14 +247,21 @@ void Foam::reconstructLagrangianFieldFields
forAllConstIter(IOobjectList, fields, fieldIter)
{
Info<< " " << fieldIter()->name() << endl;
reconstructLagrangianFieldField<Type>
if
(
cloudName,
mesh,
meshes,
fieldIter()->name()
)().write();
selectedFields.empty()
|| selectedFields.found(fieldIter()->name())
)
{
Info<< " " << fieldIter()->name() << endl;
reconstructLagrangianFieldField<Type>
(
cloudName,
mesh,
meshes,
fieldIter()->name()
)().write();
}
}
Info<< endl;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment