Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev

Conflicts:
	src/parallel/decompose/scotchDecomp/scotchDecomp.C
This commit is contained in:
mattijs
2010-06-04 16:09:16 +01:00
1046 changed files with 4231 additions and 1807 deletions

View File

@ -29,14 +29,9 @@ License
#include "volFields.H" #include "volFields.H"
#include "mathematicalConstants.H" #include "mathematicalConstants.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField Foam::smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField
( (
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF const DimensionedField<scalar, volMesh>& iF
@ -52,7 +47,8 @@ smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField
valueFraction() = 0.0; valueFraction() = 0.0;
} }
smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField
Foam::smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField
( (
const smoluchowskiJumpTFvPatchScalarField& ptf, const smoluchowskiJumpTFvPatchScalarField& ptf,
const fvPatch& p, const fvPatch& p,
@ -67,7 +63,7 @@ smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField
{} {}
smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField Foam::smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField
( (
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF, const DimensionedField<scalar, volMesh>& iF,
@ -118,7 +114,7 @@ smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField
} }
smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField Foam::smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField
( (
const smoluchowskiJumpTFvPatchScalarField& ptpsf, const smoluchowskiJumpTFvPatchScalarField& ptpsf,
const DimensionedField<scalar, volMesh>& iF const DimensionedField<scalar, volMesh>& iF
@ -134,7 +130,7 @@ smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// Map from self // Map from self
void smoluchowskiJumpTFvPatchScalarField::autoMap void Foam::smoluchowskiJumpTFvPatchScalarField::autoMap
( (
const fvPatchFieldMapper& m const fvPatchFieldMapper& m
) )
@ -144,7 +140,7 @@ void smoluchowskiJumpTFvPatchScalarField::autoMap
// Reverse-map the given fvPatchField onto this fvPatchField // Reverse-map the given fvPatchField onto this fvPatchField
void smoluchowskiJumpTFvPatchScalarField::rmap void Foam::smoluchowskiJumpTFvPatchScalarField::rmap
( (
const fvPatchField<scalar>& ptf, const fvPatchField<scalar>& ptf,
const labelList& addr const labelList& addr
@ -155,7 +151,7 @@ void smoluchowskiJumpTFvPatchScalarField::rmap
// Update the coefficients associated with the patch field // Update the coefficients associated with the patch field
void smoluchowskiJumpTFvPatchScalarField::updateCoeffs() void Foam::smoluchowskiJumpTFvPatchScalarField::updateCoeffs()
{ {
if (updated()) if (updated())
{ {
@ -174,11 +170,16 @@ void smoluchowskiJumpTFvPatchScalarField::updateCoeffs()
// Prandtl number reading consistent with rhoCentralFoam // Prandtl number reading consistent with rhoCentralFoam
const dictionary& thermophysicalProperties = const dictionary& thermophysicalProperties =
db().lookupObject<IOdictionary>("thermophysicalProperties"); db().lookupObject<IOdictionary>("thermophysicalProperties");
dimensionedScalar Pr = dimensionedScalar("Pr", dimless, 1.0);
if (thermophysicalProperties.found("Pr")) dimensionedScalar Pr
{ (
Pr = thermophysicalProperties.lookup("Pr"); dimensionedScalar::lookupOrDefault
} (
"Pr",
thermophysicalProperties,
1.0
)
);
Field<scalar> C2 = pmu/prho Field<scalar> C2 = pmu/prho
*sqrt(ppsi*constant::mathematical::piByTwo) *sqrt(ppsi*constant::mathematical::piByTwo)
@ -197,7 +198,7 @@ void smoluchowskiJumpTFvPatchScalarField::updateCoeffs()
// Write // Write
void smoluchowskiJumpTFvPatchScalarField::write(Ostream& os) const void Foam::smoluchowskiJumpTFvPatchScalarField::write(Ostream& os) const
{ {
fvPatchScalarField::write(os); fvPatchScalarField::write(os);
os.writeKeyword("accommodationCoeff") os.writeKeyword("accommodationCoeff")
@ -211,10 +212,12 @@ void smoluchowskiJumpTFvPatchScalarField::write(Ostream& os) const
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makePatchTypeField(fvPatchScalarField, smoluchowskiJumpTFvPatchScalarField); makePatchTypeField(fvPatchScalarField, smoluchowskiJumpTFvPatchScalarField);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // }
} // End namespace Foam
// ************************************************************************* // // ************************************************************************* //

View File

@ -1,7 +1,6 @@
word fluxScheme("Kurganov"); word fluxScheme("Kurganov");
if (mesh.schemesDict().found("fluxScheme")) if (mesh.schemesDict().readIfPresent("fluxScheme", fluxScheme))
{ {
fluxScheme = word(mesh.schemesDict().lookup("fluxScheme"));
if ((fluxScheme == "Tadmor") || (fluxScheme == "Kurganov")) if ((fluxScheme == "Tadmor") || (fluxScheme == "Kurganov"))
{ {
Info<< "fluxScheme: " << fluxScheme << endl; Info<< "fluxScheme: " << fluxScheme << endl;

View File

@ -14,9 +14,13 @@ IOdictionary thermophysicalProperties
) )
); );
dimensionedScalar Pr = dimensionedScalar("Pr", dimless, 1.0); dimensionedScalar Pr
(
dimensionedScalar::lookupOrDefault
(
"Pr",
thermophysicalProperties,
1.0
)
);
if (thermophysicalProperties.found("Pr"))
{
Pr = thermophysicalProperties.lookup("Pr");
}

View File

@ -70,22 +70,13 @@
dimensionedScalar initialMass = fvc::domainIntegrate(rho); dimensionedScalar initialMass = fvc::domainIntegrate(rho);
thermalPorousZones pZones(mesh); thermalPorousZones pZones(mesh);
Switch pressureImplicitPorosity(false);
// nUCorrectors used for pressureImplicitPorosity
int nUCorr = 0; int nUCorr = 0;
if (pZones.size()) const bool pressureImplicitPorosity =
{ (
// nUCorrectors for pressureImplicitPorosity pZones.size()
if (mesh.solutionDict().subDict("SIMPLE").found("nUCorrectors")) && mesh.solutionDict().subDict("SIMPLE").readIfPresent("nUCorrectors", nUCorr)
{ && (nUCorr > 0)
nUCorr = readInt );
(
mesh.solutionDict().subDict("SIMPLE").lookup("nUCorrectors")
);
}
if (nUCorr > 0)
{
pressureImplicitPorosity = true;
}
}

View File

@ -26,8 +26,13 @@
dimensionedScalar gamma = Cp/Cv; dimensionedScalar gamma = Cp/Cv;
dimensionedScalar Pr = dimensionedScalar("Pr", dimless, 1.0); dimensionedScalar Pr
if (thermodynamicProperties.found("Pr")) (
{ dimensionedScalar::lookupOrDefault
Pr = thermodynamicProperties.lookup("Pr"); (
} "Pr",
thermodynamicProperties,
1.0
)
);

View File

@ -1,3 +1,4 @@
const dictionary& Bpiso = mesh.solutionDict().subDict("BPISO"); const dictionary& Bpiso = mesh.solutionDict().subDict("BPISO");
const int nBcorr = Bpiso.lookupOrDefault<int>("nCorrectors", 1);
int nBcorr(readInt(Bpiso.lookup("nCorrectors")));

View File

@ -1,25 +1,11 @@
dictionary simple = fluidRegions[i].solutionDict().subDict("SIMPLE"); const dictionary& simple = fluidRegions[i].solutionDict().subDict("SIMPLE");
int nNonOrthCorr = 0; const int nNonOrthCorr =
if (simple.found("nNonOrthogonalCorrectors")) simple.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0);
{
nNonOrthCorr = readInt(simple.lookup("nNonOrthogonalCorrectors"));
}
bool momentumPredictor = true; const bool momentumPredictor =
if (simple.found("momentumPredictor")) simple.lookupOrDefault("momentumPredictor", true);
{
momentumPredictor = Switch(simple.lookup("momentumPredictor"));
}
bool fluxGradp = false; const bool transonic =
if (simple.found("fluxGradp")) simple.lookupOrDefault("transonic", false);
{
fluxGradp = Switch(simple.lookup("fluxGradp"));
}
bool transonic = false;
if (simple.found("transonic"))
{
transonic = Switch(simple.lookup("transonic"));
}

View File

@ -1,7 +1,5 @@
dictionary simple = solidRegions[i].solutionDict().subDict("SIMPLE"); const dictionary& simple = solidRegions[i].solutionDict().subDict("SIMPLE");
const int nNonOrthCorr =
simple.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0);
int nNonOrthCorr = 0;
if (simple.found("nNonOrthogonalCorrectors"))
{
nNonOrthCorr = readInt(simple.lookup("nNonOrthogonalCorrectors"));
}

View File

@ -1,9 +1,11 @@
const dictionary& pimple = mesh.solutionDict().subDict("PIMPLE"); const dictionary& pimple = mesh.solutionDict().subDict("PIMPLE");
int nCorr(readInt(pimple.lookup("nCorrectors"))); const int nCorr =
pimple.lookupOrDefault<int>("nCorrectors", 1);
int nNonOrthCorr = const int nNonOrthCorr =
pimple.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0); pimple.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0);
bool momentumPredictor = const bool momentumPredictor =
pimple.lookupOrDefault<Switch>("momentumPredictor", true); pimple.lookupOrDefault("momentumPredictor", true);

View File

@ -1,27 +1,17 @@
dictionary piso = fluidRegions[i].solutionDict().subDict("PISO"); const dictionary& piso = fluidRegions[i].solutionDict().subDict("PISO");
int nCorr(readInt(piso.lookup("nCorrectors"))); const int nOuterCorr =
piso.lookupOrDefault<int>("nOuterCorrectors", 1);
int nNonOrthCorr = 0; const int nCorr =
if (piso.found("nNonOrthogonalCorrectors")) piso.lookupOrDefault<int>("nCorrectors", 1);
{
nNonOrthCorr = readInt(piso.lookup("nNonOrthogonalCorrectors"));
}
bool momentumPredictor = true; const int nNonOrthCorr =
if (piso.found("momentumPredictor")) piso.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0);
{
momentumPredictor = Switch(piso.lookup("momentumPredictor"));
}
bool transonic = false; const bool momentumPredictor =
if (piso.found("transonic")) piso.lookupOrDefault("momentumPredictor", true);
{
transonic = Switch(piso.lookup("transonic")); const bool transonic =
} piso.lookupOrDefault("transonic", false);
int nOuterCorr = 1;
if (piso.found("nOuterCorrectors"))
{
nOuterCorr = readInt(piso.lookup("nOuterCorrectors"));
}

View File

@ -4,4 +4,6 @@
const dictionary& pimple = solutionDict.subDict("PIMPLE"); const dictionary& pimple = solutionDict.subDict("PIMPLE");
int nOuterCorr(readInt(pimple.lookup("nOuterCorrectors"))); const int nOuterCorr =
pimple.lookupOrDefault<int>("nOuterCorrectors", 1);

View File

@ -1,7 +1,5 @@
const dictionary& piso = solidRegions[i].solutionDict().subDict("PISO"); const dictionary& piso = solidRegions[i].solutionDict().subDict("PISO");
int nNonOrthCorr = 0; const int nNonOrthCorr =
if (piso.found("nNonOrthogonalCorrectors")) piso.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0);
{
nNonOrthCorr = readInt(piso.lookup("nNonOrthogonalCorrectors"));
}

View File

@ -1,14 +1,9 @@
#include "readTimeControls.H" #include "readTimeControls.H"
#include "readPIMPLEControls.H" #include "readPIMPLEControls.H"
bool correctPhi = false; const bool correctPhi =
if (pimple.found("correctPhi")) pimple.lookupOrDefault("correctPhi", false);
{
correctPhi = Switch(pimple.lookup("correctPhi")); const bool checkMeshCourantNo =
} pimple.lookupOrDefault("checkMeshCourantNo", false);
bool checkMeshCourantNo = false;
if (pimple.found("checkMeshCourantNo"))
{
checkMeshCourantNo = Switch(pimple.lookup("checkMeshCourantNo"));
}

View File

@ -43,22 +43,13 @@
porousZones pZones(mesh); porousZones pZones(mesh);
Switch pressureImplicitPorosity(false);
// nUCorrectors used for pressureImplicitPorosity
int nUCorr = 0; int nUCorr = 0;
if (pZones.size()) const bool pressureImplicitPorosity =
{ (
// nUCorrectors for pressureImplicitPorosity pZones.size()
if (mesh.solutionDict().subDict("SIMPLE").found("nUCorrectors")) && mesh.solutionDict().subDict("SIMPLE").readIfPresent("nUCorrectors", nUCorr)
{ && (nUCorr > 0)
nUCorr = readInt );
(
mesh.solutionDict().subDict("SIMPLE").lookup("nUCorrectors")
);
}
if (nUCorr > 0)
{
pressureImplicitPorosity = true;
}
}

View File

@ -96,7 +96,7 @@
) )
); );
if (RASProperties.lookupOrDefault<Switch>("printCoeffs", false)) if (RASProperties.lookupOrDefault("printCoeffs", false))
{ {
Info<< "kEpsilonCoeffs" << kEpsilonDict << nl Info<< "kEpsilonCoeffs" << kEpsilonDict << nl
<< "wallFunctionCoeffs" << wallFunctionDict << endl; << "wallFunctionCoeffs" << wallFunctionDict << endl;

View File

@ -1,5 +1,5 @@
#include "readPISOControls.H" #include "readPISOControls.H"
#include "readTimeControls.H" #include "readTimeControls.H"
label nAlphaCorr label nAlphaCorr
( (
@ -19,14 +19,9 @@
<< exit(FatalError); << exit(FatalError);
} }
bool correctPhi = true; const bool correctPhi =
if (piso.found("correctPhi")) piso.lookupOrDefault("correctPhi", true);
{
correctPhi = Switch(piso.lookup("correctPhi")); const bool checkMeshCourantNo =
} piso.lookupOrDefault("checkMeshCourantNo", false);
bool checkMeshCourantNo = false;
if (piso.found("checkMeshCourantNo"))
{
checkMeshCourantNo = Switch(piso.lookup("checkMeshCourantNo"));
}

View File

@ -1,14 +1,9 @@
# include "readTimeControls.H" # include "readTimeControls.H"
# include "readPISOControls.H" # include "readPISOControls.H"
bool correctPhi = true; const bool correctPhi =
if (piso.found("correctPhi")) piso.lookupOrDefault("correctPhi", true);
{
correctPhi = Switch(piso.lookup("correctPhi")); const bool checkMeshCourantNo =
} piso.lookupOrDefault("checkMeshCourantNo", false);
bool checkMeshCourantNo = false;
if (piso.found("checkMeshCourantNo"))
{
checkMeshCourantNo = Switch(piso.lookup("checkMeshCourantNo"));
}

View File

@ -276,7 +276,7 @@
) )
); );
if (RASProperties.lookupOrDefault<Switch>("printCoeffs", false)) if (RASProperties.lookupOrDefault("printCoeffs", false))
{ {
Info<< "kEpsilonCoeffs" << kEpsilonDict << nl Info<< "kEpsilonCoeffs" << kEpsilonDict << nl
<< "wallFunctionCoeffs" << wallFunctionDict << endl; << "wallFunctionCoeffs" << wallFunctionDict << endl;

View File

@ -175,10 +175,8 @@
); );
word dragPhase("blended"); word dragPhase("blended");
if (interfacialProperties.found("dragPhase")) if (interfacialProperties.readIfPresent("dragPhase", dragPhase))
{ {
dragPhase = word(interfacialProperties.lookup("dragPhase"));
bool validDrag = bool validDrag =
dragPhase == "a" || dragPhase == "b" || dragPhase == "blended"; dragPhase == "a" || dragPhase == "b" || dragPhase == "blended";

View File

@ -1,5 +1,6 @@
const dictionary& stressControl = mesh.solutionDict().subDict("stressAnalysis"); const dictionary& stressControl = mesh.solutionDict().subDict("stressAnalysis");
int nCorr(readInt(stressControl.lookup("nCorrectors"))); const int nCorr = stressControl.lookupOrDefault<int>("nCorrectors", 1);
scalar convergenceTolerance(readScalar(stressControl.lookup("D"))); scalar convergenceTolerance(readScalar(stressControl.lookup("D")));
Switch compactNormalStress(stressControl.lookup("compactNormalStress")); Switch compactNormalStress(stressControl.lookup("compactNormalStress"));

View File

@ -1,10 +1,10 @@
/*-------------------------------*- C++ -*---------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | ========= | |
| \\ / OpenFOAM | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / | | \\ / O peration | Version: 1.6 |
| \\ / The Open Source CFD Toolbox | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ http://www.OpenFOAM.org | | \\/ M anipulation | |
\*-------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -1,10 +1,10 @@
/*-------------------------------*- C++ -*---------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | ========= | |
| \\ / OpenFOAM | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / | | \\ / O peration | Version: 1.6 |
| \\ / The Open Source CFD Toolbox | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ http://www.OpenFOAM.org | | \\/ M anipulation | |
\*-------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile
{ {
version 2.0; version 2.0;

View File

@ -1,10 +1,10 @@
/*-------------------------------*- C++ -*---------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | ========= | |
| \\ / OpenFOAM | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / | | \\ / O peration | Version: 1.6 |
| \\ / The Open Source CFD Toolbox | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ http://www.OpenFOAM.org | | \\/ M anipulation | |
\*-------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
( (

View File

@ -1,10 +1,10 @@
/*-------------------------------*- C++ -*---------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | ========= | |
| \\ / OpenFOAM | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / | | \\ / O peration | Version: 1.6 |
| \\ / The Open Source CFD Toolbox | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ http://www.OpenFOAM.org | | \\/ M anipulation | |
\*-------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile

View File

@ -579,12 +579,17 @@ void ReadCells
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::addNote
(
"read CCM files as written by proSTAR/ccm\n"
" - does not handle 'interfaces' (couples), cyclics or data\n"
" - does not handle mesh regions (porosity, solids, ...)\n"
);
argList::noParallel(); argList::noParallel();
argList::validArgs.append("ccm26 file"); argList::validArgs.append("ccmFile");
# include "setRootCase.H"
# include "createTime.H"
#include "setRootCase.H"
#include "createTime.H"
// Foam mesh data // Foam mesh data
// ~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~
@ -615,6 +620,7 @@ int main(int argc, char *argv[])
{ {
const fileName ccmFile = args[1]; const fileName ccmFile = args[1];
const word ccmExt = ccmFile.ext();
if (!isFile(ccmFile)) if (!isFile(ccmFile))
{ {
@ -623,8 +629,6 @@ int main(int argc, char *argv[])
<< exit(FatalError); << exit(FatalError);
} }
word ccmExt = ccmFile.ext();
if (ccmExt != "ccm" && ccmExt != "ccmg") if (ccmExt != "ccm" && ccmExt != "ccmg")
{ {
FatalErrorIn(args.executable()) FatalErrorIn(args.executable())

View File

@ -90,7 +90,7 @@ cellShape create3DCellShape
// make a list of outward-pointing faces // make a list of outward-pointing faces
labelListList localFaces(faceLabels.size()); labelListList localFaces(faceLabels.size());
forAll (faceLabels, faceI) forAll(faceLabels, faceI)
{ {
const label curFaceLabel = faceLabels[faceI]; const label curFaceLabel = faceLabels[faceI];

View File

@ -62,6 +62,10 @@ using namespace Foam;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::addNote
(
"read OpenFOAM mesh and write a pro-STAR (v4) bnd/cel/vrt format"
);
argList::noParallel(); argList::noParallel();
timeSelector::addOptions(); timeSelector::addOptions();
@ -74,7 +78,7 @@ int main(int argc, char *argv[])
argList::addBoolOption argList::addBoolOption
( (
"noBnd", "noBnd",
"suppress writing the .bnd file" "suppress writing a boundary (.bnd) file"
); );
# include "setRootCase.H" # include "setRootCase.H"

View File

@ -38,8 +38,13 @@ Description
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::addNote
(
"convert pro-STAR (v3) mesh to OpenFOAM"
);
argList::noParallel(); argList::noParallel();
argList::validArgs.append("STAR mesh file prefix"); argList::validArgs.append("pro-STAR prefix");
argList::addOption argList::addOption
( (
"scale", "scale",
@ -56,7 +61,7 @@ int main(int argc, char *argv[])
const scalar scaleFactor = args.optionLookupOrDefault("scale", 1.0); const scalar scaleFactor = args.optionLookupOrDefault("scale", 1.0);
# include "createTime.H" #include "createTime.H"
starMesh makeMesh(args[1], runTime, scaleFactor); starMesh makeMesh(args[1], runTime, scaleFactor);

View File

@ -59,6 +59,11 @@ using namespace Foam;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::addNote
(
"convert pro-STAR (v4) mesh to OpenFOAM"
);
argList::noParallel(); argList::noParallel();
argList::validArgs.append("pro-STAR prefix"); argList::validArgs.append("pro-STAR prefix");
argList::addBoolOption argList::addBoolOption

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile

View File

@ -881,9 +881,6 @@ Foam::meshDualiser::meshDualiser(const polyMesh& mesh)
{} {}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::meshDualiser::setRefinement void Foam::meshDualiser::setRefinement
@ -1469,14 +1466,4 @@ void Foam::meshDualiser::setRefinement
} }
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile

View File

@ -42,6 +42,12 @@ using namespace Foam;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::addNote
(
"Read the specified dictionary file, expand the macros etc. and write\n"
"the resulting dictionary to standard output."
);
argList::noBanner(); argList::noBanner();
argList::noParallel(); argList::noParallel();
argList::validArgs.append("inputDict"); argList::validArgs.append("inputDict");
@ -49,9 +55,10 @@ int main(int argc, char *argv[])
const string dictName = args[1]; const string dictName = args[1];
Info<<"//\n// expansion of dictionary " << dictName << "\n//\n"; IOobject::writeBanner(Info)
<<"//\n// " << dictName << "\n//\n";
dictionary(IFstream(dictName)()).write(Info, false); dictionary(IFstream(dictName)(), true).write(Info, false);
IOobject::writeDivider(Info); IOobject::writeDivider(Info);

View File

@ -64,11 +64,17 @@ Usage
#include "IOobjectList.H" #include "IOobjectList.H"
#include "domainDecomposition.H" #include "domainDecomposition.H"
#include "labelIOField.H" #include "labelIOField.H"
#include "labelFieldIOField.H"
#include "scalarIOField.H" #include "scalarIOField.H"
#include "scalarFieldIOField.H"
#include "vectorIOField.H" #include "vectorIOField.H"
#include "vectorFieldIOField.H"
#include "sphericalTensorIOField.H" #include "sphericalTensorIOField.H"
#include "sphericalTensorFieldIOField.H"
#include "symmTensorIOField.H" #include "symmTensorIOField.H"
#include "symmTensorFieldIOField.H"
#include "tensorIOField.H" #include "tensorIOField.H"
#include "tensorFieldIOField.H"
#include "pointFields.H" #include "pointFields.H"
#include "readFields.H" #include "readFields.H"
@ -374,20 +380,42 @@ int main(int argc, char *argv[])
PtrList< List<SLList<indexedParticle*>*> > cellParticles(cloudDirs.size()); PtrList< List<SLList<indexedParticle*>*> > cellParticles(cloudDirs.size());
PtrList<PtrList<labelIOField> > lagrangianLabelFields(cloudDirs.size()); PtrList<PtrList<labelIOField> > lagrangianLabelFields(cloudDirs.size());
PtrList<PtrList<labelIOFieldField> > lagrangianLabelFieldFields
(
cloudDirs.size()
);
PtrList<PtrList<scalarIOField> > lagrangianScalarFields(cloudDirs.size()); PtrList<PtrList<scalarIOField> > lagrangianScalarFields(cloudDirs.size());
PtrList<PtrList<scalarIOFieldField> > lagrangianScalarFieldFields
(
cloudDirs.size()
);
PtrList<PtrList<vectorIOField> > lagrangianVectorFields(cloudDirs.size()); PtrList<PtrList<vectorIOField> > lagrangianVectorFields(cloudDirs.size());
PtrList<PtrList<vectorIOFieldField> > lagrangianVectorFieldFields
(
cloudDirs.size()
);
PtrList<PtrList<sphericalTensorIOField> > lagrangianSphericalTensorFields PtrList<PtrList<sphericalTensorIOField> > lagrangianSphericalTensorFields
( (
cloudDirs.size() cloudDirs.size()
); );
PtrList<PtrList<sphericalTensorIOFieldField> >
lagrangianSphericalTensorFieldFields(cloudDirs.size());
PtrList<PtrList<symmTensorIOField> > lagrangianSymmTensorFields PtrList<PtrList<symmTensorIOField> > lagrangianSymmTensorFields
( (
cloudDirs.size() cloudDirs.size()
); );
PtrList<PtrList<symmTensorIOFieldField> > lagrangianSymmTensorFieldFields
(
cloudDirs.size()
);
PtrList<PtrList<tensorIOField> > lagrangianTensorFields PtrList<PtrList<tensorIOField> > lagrangianTensorFields
( (
cloudDirs.size() cloudDirs.size()
); );
PtrList<PtrList<tensorIOFieldField> > lagrangianTensorFieldFields
(
cloudDirs.size()
);
label cloudI = 0; label cloudI = 0;
@ -487,6 +515,13 @@ int main(int argc, char *argv[])
lagrangianLabelFields lagrangianLabelFields
); );
lagrangianFieldDecomposer::readFieldFields
(
cloudI,
lagrangianObjects,
lagrangianLabelFieldFields
);
lagrangianFieldDecomposer::readFields lagrangianFieldDecomposer::readFields
( (
cloudI, cloudI,
@ -494,6 +529,14 @@ int main(int argc, char *argv[])
lagrangianScalarFields lagrangianScalarFields
); );
lagrangianFieldDecomposer::readFieldFields
(
cloudI,
lagrangianObjects,
lagrangianScalarFieldFields
);
lagrangianFieldDecomposer::readFields lagrangianFieldDecomposer::readFields
( (
cloudI, cloudI,
@ -501,6 +544,13 @@ int main(int argc, char *argv[])
lagrangianVectorFields lagrangianVectorFields
); );
lagrangianFieldDecomposer::readFieldFields
(
cloudI,
lagrangianObjects,
lagrangianVectorFieldFields
);
lagrangianFieldDecomposer::readFields lagrangianFieldDecomposer::readFields
( (
cloudI, cloudI,
@ -508,6 +558,13 @@ int main(int argc, char *argv[])
lagrangianSphericalTensorFields lagrangianSphericalTensorFields
); );
lagrangianFieldDecomposer::readFieldFields
(
cloudI,
lagrangianObjects,
lagrangianSphericalTensorFieldFields
);
lagrangianFieldDecomposer::readFields lagrangianFieldDecomposer::readFields
( (
cloudI, cloudI,
@ -515,6 +572,13 @@ int main(int argc, char *argv[])
lagrangianSymmTensorFields lagrangianSymmTensorFields
); );
lagrangianFieldDecomposer::readFieldFields
(
cloudI,
lagrangianObjects,
lagrangianSymmTensorFieldFields
);
lagrangianFieldDecomposer::readFields lagrangianFieldDecomposer::readFields
( (
cloudI, cloudI,
@ -522,6 +586,13 @@ int main(int argc, char *argv[])
lagrangianTensorFields lagrangianTensorFields
); );
lagrangianFieldDecomposer::readFieldFields
(
cloudI,
lagrangianObjects,
lagrangianTensorFieldFields
);
cloudI++; cloudI++;
} }
} }
@ -529,11 +600,17 @@ int main(int argc, char *argv[])
lagrangianPositions.setSize(cloudI); lagrangianPositions.setSize(cloudI);
cellParticles.setSize(cloudI); cellParticles.setSize(cloudI);
lagrangianLabelFields.setSize(cloudI); lagrangianLabelFields.setSize(cloudI);
lagrangianLabelFieldFields.setSize(cloudI);
lagrangianScalarFields.setSize(cloudI); lagrangianScalarFields.setSize(cloudI);
lagrangianScalarFieldFields.setSize(cloudI);
lagrangianVectorFields.setSize(cloudI); lagrangianVectorFields.setSize(cloudI);
lagrangianVectorFieldFields.setSize(cloudI);
lagrangianSphericalTensorFields.setSize(cloudI); lagrangianSphericalTensorFields.setSize(cloudI);
lagrangianSphericalTensorFieldFields.setSize(cloudI);
lagrangianSymmTensorFields.setSize(cloudI); lagrangianSymmTensorFields.setSize(cloudI);
lagrangianSymmTensorFieldFields.setSize(cloudI);
lagrangianTensorFields.setSize(cloudI); lagrangianTensorFields.setSize(cloudI);
lagrangianTensorFieldFields.setSize(cloudI);
// Any uniform data to copy/link? // Any uniform data to copy/link?
@ -725,11 +802,17 @@ int main(int argc, char *argv[])
if if
( (
lagrangianLabelFields[cloudI].size() lagrangianLabelFields[cloudI].size()
|| lagrangianLabelFieldFields[cloudI].size()
|| lagrangianScalarFields[cloudI].size() || lagrangianScalarFields[cloudI].size()
|| lagrangianScalarFieldFields[cloudI].size()
|| lagrangianVectorFields[cloudI].size() || lagrangianVectorFields[cloudI].size()
|| lagrangianVectorFieldFields[cloudI].size()
|| lagrangianSphericalTensorFields[cloudI].size() || lagrangianSphericalTensorFields[cloudI].size()
|| lagrangianSphericalTensorFieldFields[cloudI].size()
|| lagrangianSymmTensorFields[cloudI].size() || lagrangianSymmTensorFields[cloudI].size()
|| lagrangianSymmTensorFieldFields[cloudI].size()
|| lagrangianTensorFields[cloudI].size() || lagrangianTensorFields[cloudI].size()
|| lagrangianTensorFieldFields[cloudI].size()
) )
{ {
fieldDecomposer.decomposeFields fieldDecomposer.decomposeFields
@ -737,31 +820,61 @@ int main(int argc, char *argv[])
cloudDirs[cloudI], cloudDirs[cloudI],
lagrangianLabelFields[cloudI] lagrangianLabelFields[cloudI]
); );
fieldDecomposer.decomposeFieldFields
(
cloudDirs[cloudI],
lagrangianLabelFieldFields[cloudI]
);
fieldDecomposer.decomposeFields fieldDecomposer.decomposeFields
( (
cloudDirs[cloudI], cloudDirs[cloudI],
lagrangianScalarFields[cloudI] lagrangianScalarFields[cloudI]
); );
fieldDecomposer.decomposeFieldFields
(
cloudDirs[cloudI],
lagrangianScalarFieldFields[cloudI]
);
fieldDecomposer.decomposeFields fieldDecomposer.decomposeFields
( (
cloudDirs[cloudI], cloudDirs[cloudI],
lagrangianVectorFields[cloudI] lagrangianVectorFields[cloudI]
); );
fieldDecomposer.decomposeFieldFields
(
cloudDirs[cloudI],
lagrangianVectorFieldFields[cloudI]
);
fieldDecomposer.decomposeFields fieldDecomposer.decomposeFields
( (
cloudDirs[cloudI], cloudDirs[cloudI],
lagrangianSphericalTensorFields[cloudI] lagrangianSphericalTensorFields[cloudI]
); );
fieldDecomposer.decomposeFieldFields
(
cloudDirs[cloudI],
lagrangianSphericalTensorFieldFields[cloudI]
);
fieldDecomposer.decomposeFields fieldDecomposer.decomposeFields
( (
cloudDirs[cloudI], cloudDirs[cloudI],
lagrangianSymmTensorFields[cloudI] lagrangianSymmTensorFields[cloudI]
); );
fieldDecomposer.decomposeFieldFields
(
cloudDirs[cloudI],
lagrangianSymmTensorFieldFields[cloudI]
);
fieldDecomposer.decomposeFields fieldDecomposer.decomposeFields
( (
cloudDirs[cloudI], cloudDirs[cloudI],
lagrangianTensorFields[cloudI] lagrangianTensorFields[cloudI]
); );
fieldDecomposer.decomposeFieldFields
(
cloudDirs[cloudI],
lagrangianTensorFieldFields[cloudI]
);
} }
} }
} }

View File

@ -1,10 +1,10 @@
/*-------------------------------*- C++ -*---------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | ========= | |
| \\ / OpenFOAM | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / | | \\ / O peration | Version: 1.6 |
| \\ / The Open Source CFD Toolbox | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ http://www.OpenFOAM.org | | \\/ M anipulation | |
\*-------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile
{ {
version 2.0; version 2.0;

View File

@ -112,11 +112,7 @@ Foam::domainDecomposition::domainDecomposition(const IOobject& io)
procProcessorPatchSubPatchIDs_(nProcs_), procProcessorPatchSubPatchIDs_(nProcs_),
procProcessorPatchSubPatchStarts_(nProcs_) procProcessorPatchSubPatchStarts_(nProcs_)
{ {
if (decompositionDict_.found("distributed")) decompositionDict_.readIfPresent("distributed", distributed_);
{
Switch distributed(decompositionDict_.lookup("distributed"));
distributed_ = distributed;
}
} }

View File

@ -130,7 +130,7 @@ void Foam::domainDecomposition::decomposeMesh()
procFaceAddressing_.setSize(nProcs_); procFaceAddressing_.setSize(nProcs_);
// Internal faces // Internal faces
forAll (neighbour, facei) forAll(neighbour, facei)
{ {
if (cellToProc_[owner[facei]] == cellToProc_[neighbour[facei]]) if (cellToProc_[owner[facei]] == cellToProc_[neighbour[facei]])
{ {
@ -141,16 +141,16 @@ void Foam::domainDecomposition::decomposeMesh()
// for all processors, set the size of start index and patch size // for all processors, set the size of start index and patch size
// lists to the number of patches in the mesh // lists to the number of patches in the mesh
forAll (procPatchSize_, procI) forAll(procPatchSize_, procI)
{ {
procPatchSize_[procI].setSize(patches.size()); procPatchSize_[procI].setSize(patches.size());
procPatchStartIndex_[procI].setSize(patches.size()); procPatchStartIndex_[procI].setSize(patches.size());
} }
forAll (patches, patchi) forAll(patches, patchi)
{ {
// Reset size and start index for all processors // Reset size and start index for all processors
forAll (procPatchSize_, procI) forAll(procPatchSize_, procI)
{ {
procPatchSize_[procI][patchi] = 0; procPatchSize_[procI][patchi] = 0;
procPatchStartIndex_[procI][patchi] = procPatchStartIndex_[procI][patchi] =
@ -167,7 +167,7 @@ void Foam::domainDecomposition::decomposeMesh()
const unallocLabelList& patchFaceCells = const unallocLabelList& patchFaceCells =
patches[patchi].faceCells(); patches[patchi].faceCells();
forAll (patchFaceCells, facei) forAll(patchFaceCells, facei)
{ {
const label curProc = cellToProc_[patchFaceCells[facei]]; const label curProc = cellToProc_[patchFaceCells[facei]];
@ -190,7 +190,7 @@ void Foam::domainDecomposition::decomposeMesh()
const unallocLabelList& nbrPatchFaceCells = const unallocLabelList& nbrPatchFaceCells =
pp.neighbPatch().faceCells(); pp.neighbPatch().faceCells();
forAll (patchFaceCells, facei) forAll(patchFaceCells, facei)
{ {
const label curProc = cellToProc_[patchFaceCells[facei]]; const label curProc = cellToProc_[patchFaceCells[facei]];
const label nbrProc = cellToProc_[nbrPatchFaceCells[facei]]; const label nbrProc = cellToProc_[nbrPatchFaceCells[facei]];
@ -216,7 +216,7 @@ void Foam::domainDecomposition::decomposeMesh()
List<DynamicList<DynamicList<label> > > interPatchFaces(nProcs_); List<DynamicList<DynamicList<label> > > interPatchFaces(nProcs_);
// Processor boundaries from internal faces // Processor boundaries from internal faces
forAll (neighbour, facei) forAll(neighbour, facei)
{ {
label ownerProc = cellToProc_[owner[facei]]; label ownerProc = cellToProc_[owner[facei]];
label nbrProc = cellToProc_[neighbour[facei]]; label nbrProc = cellToProc_[neighbour[facei]];
@ -249,7 +249,7 @@ void Foam::domainDecomposition::decomposeMesh()
} }
// Processor boundaries from split cyclics // Processor boundaries from split cyclics
forAll (patches, patchi) forAll(patches, patchi)
{ {
if (isA<cyclicPolyPatch>(patches[patchi])) if (isA<cyclicPolyPatch>(patches[patchi]))
{ {
@ -279,7 +279,7 @@ void Foam::domainDecomposition::decomposeMesh()
} }
// Add faces with different owner and neighbour processors // Add faces with different owner and neighbour processors
forAll (patchFaceCells, facei) forAll(patchFaceCells, facei)
{ {
const label ownerProc = cellToProc_[patchFaceCells[facei]]; const label ownerProc = cellToProc_[patchFaceCells[facei]];
const label nbrProc = cellToProc_[nbrPatchFaceCells[facei]]; const label nbrProc = cellToProc_[nbrPatchFaceCells[facei]];

View File

@ -37,6 +37,7 @@ SourceFiles
#define lagrangianFieldDecomposer_H #define lagrangianFieldDecomposer_H
#include "Cloud.H" #include "Cloud.H"
#include "IOFieldField.H"
#include "indexedParticle.H" #include "indexedParticle.H"
#include "passiveParticle.H" #include "passiveParticle.H"
@ -102,6 +103,19 @@ public:
// PtrList<IOField<Type> >& lagrangianFields // PtrList<IOField<Type> >& lagrangianFields
); );
template<class Type>
static void readFieldFields
(
const label cloudI,
const IOobjectList& lagrangianObjects,
PtrList
<
PtrList<IOFieldField<Field<Type>, Type> >
>& lagrangianFields
// PtrList<IOFieldField<Field<Type>, Type > >& lagrangianFields
);
//- Decompose volume field //- Decompose volume field
template<class Type> template<class Type>
tmp<IOField<Type> > decomposeField tmp<IOField<Type> > decomposeField
@ -110,12 +124,27 @@ public:
const IOField<Type>& field const IOField<Type>& field
) const; ) const;
template<class Type>
tmp<IOFieldField<Field<Type>, Type> > decomposeFieldField
(
const word& cloudName,
const IOFieldField<Field<Type>, Type>& field
) const;
template<class GeoField> template<class GeoField>
void decomposeFields void decomposeFields
( (
const word& cloudName, const word& cloudName,
const PtrList<GeoField>& fields const PtrList<GeoField>& fields
) const; ) const;
template<class GeoField>
void decomposeFieldFields
(
const word& cloudName,
const PtrList<GeoField>& fields
) const;
}; };

View File

@ -63,6 +63,56 @@ void Foam::lagrangianFieldDecomposer::readFields
} }
template<class Type>
void Foam::lagrangianFieldDecomposer::readFieldFields
(
const label cloudI,
const IOobjectList& lagrangianObjects,
PtrList<PtrList<IOFieldField<Field<Type>, Type> > >& lagrangianFields
)
{
// Search list of objects for lagrangian fields
IOobjectList lagrangianTypeObjectsA
(
lagrangianObjects.lookupClass(IOField<Field<Type> >::typeName)
);
IOobjectList lagrangianTypeObjectsB
(
lagrangianObjects.lookupClass(IOFieldField<Field<Type>, Type>::typeName)
);
lagrangianFields.set
(
cloudI,
new PtrList<IOFieldField<Field<Type>, Type> >
(
lagrangianTypeObjectsA.size() + lagrangianTypeObjectsB.size()
)
);
label lagrangianFieldi=0;
forAllIter(IOobjectList, lagrangianTypeObjectsA, iter)
{
lagrangianFields[cloudI].set
(
lagrangianFieldi++,
new IOFieldField<Field<Type>, Type>(*iter())
);
}
forAllIter(IOobjectList, lagrangianTypeObjectsB, iter)
{
lagrangianFields[cloudI].set
(
lagrangianFieldi++,
new IOFieldField<Field<Type>, Type>(*iter())
);
}
}
template<class Type> template<class Type>
Foam::tmp<Foam::IOField<Type> > Foam::tmp<Foam::IOField<Type> >
Foam::lagrangianFieldDecomposer::decomposeField Foam::lagrangianFieldDecomposer::decomposeField
@ -94,6 +144,37 @@ Foam::lagrangianFieldDecomposer::decomposeField
} }
template<class Type>
Foam::tmp<Foam::IOFieldField<Foam::Field<Type>, Type> >
Foam::lagrangianFieldDecomposer::decomposeFieldField
(
const word& cloudName,
const IOFieldField<Field<Type>, Type>& field
) const
{
// Create and map the internal field values
Field<Field<Type> > procField(field, particleIndices_);
// Create the field for the processor
return tmp<IOFieldField<Field<Type>, Type> >
(
new IOFieldField<Field<Type>, Type>
(
IOobject
(
field.name(),
procMesh_.time().timeName(),
cloud::prefix/cloudName,
procMesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
procField
)
);
}
template<class GeoField> template<class GeoField>
void Foam::lagrangianFieldDecomposer::decomposeFields void Foam::lagrangianFieldDecomposer::decomposeFields
( (
@ -111,4 +192,21 @@ void Foam::lagrangianFieldDecomposer::decomposeFields
} }
template<class GeoField>
void Foam::lagrangianFieldDecomposer::decomposeFieldFields
(
const word& cloudName,
const PtrList<GeoField>& fields
) const
{
if (particleIndices_.size())
{
forAll(fields, fieldI)
{
decomposeFieldField(cloudName, fields[fieldI])().write();
}
}
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -402,6 +402,13 @@ int main(int argc, char *argv[])
procMeshes.meshes(), procMeshes.meshes(),
sprayObjs sprayObjs
); );
reconstructLagrangianFieldFields<label>
(
cloudName,
mesh,
procMeshes.meshes(),
sprayObjs
);
reconstructLagrangianFields<scalar> reconstructLagrangianFields<scalar>
( (
cloudName, cloudName,
@ -409,6 +416,13 @@ int main(int argc, char *argv[])
procMeshes.meshes(), procMeshes.meshes(),
sprayObjs sprayObjs
); );
reconstructLagrangianFieldFields<scalar>
(
cloudName,
mesh,
procMeshes.meshes(),
sprayObjs
);
reconstructLagrangianFields<vector> reconstructLagrangianFields<vector>
( (
cloudName, cloudName,
@ -416,6 +430,13 @@ int main(int argc, char *argv[])
procMeshes.meshes(), procMeshes.meshes(),
sprayObjs sprayObjs
); );
reconstructLagrangianFieldFields<vector>
(
cloudName,
mesh,
procMeshes.meshes(),
sprayObjs
);
reconstructLagrangianFields<sphericalTensor> reconstructLagrangianFields<sphericalTensor>
( (
cloudName, cloudName,
@ -423,6 +444,13 @@ int main(int argc, char *argv[])
procMeshes.meshes(), procMeshes.meshes(),
sprayObjs sprayObjs
); );
reconstructLagrangianFieldFields<sphericalTensor>
(
cloudName,
mesh,
procMeshes.meshes(),
sprayObjs
);
reconstructLagrangianFields<symmTensor> reconstructLagrangianFields<symmTensor>
( (
cloudName, cloudName,
@ -430,6 +458,13 @@ int main(int argc, char *argv[])
procMeshes.meshes(), procMeshes.meshes(),
sprayObjs sprayObjs
); );
reconstructLagrangianFieldFields<symmTensor>
(
cloudName,
mesh,
procMeshes.meshes(),
sprayObjs
);
reconstructLagrangianFields<tensor> reconstructLagrangianFields<tensor>
( (
cloudName, cloudName,
@ -437,6 +472,13 @@ int main(int argc, char *argv[])
procMeshes.meshes(), procMeshes.meshes(),
sprayObjs sprayObjs
); );
reconstructLagrangianFieldFields<tensor>
(
cloudName,
mesh,
procMeshes.meshes(),
sprayObjs
);
} }
} }
else else

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile

View File

@ -1,10 +1,10 @@
/*-------------------------------*- C++ -*---------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | ========= | |
| \\ / OpenFOAM 1.4.1 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / | | \\ / O peration | Version: 1.6 |
| \\ / The Open Source CFD Toolbox | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ http://www.OpenFOAM.org | | \\/ M anipulation | |
\*-------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile
{ {
version 2.0; version 2.0;

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile

View File

@ -102,7 +102,7 @@ int main(int argc, char *argv[])
); );
const bool invertSelection = const bool invertSelection =
meshSubsetDict.lookupOrDefault<bool>("invertSelection", false); meshSubsetDict.lookupOrDefault("invertSelection", false);
// Mark the cells for the subset // Mark the cells for the subset

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
Exec : adiabaticFlameT -case . controlDict Exec : adiabaticFlameT -case . controlDict

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
Exec : adiabaticFlameT -case . controlDict Exec : adiabaticFlameT -case . controlDict

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
Exec : adiabaticFlameT -case . controlDict Exec : adiabaticFlameT -case . controlDict

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
Exec : equilibriumFlameT -case . controlDict Exec : equilibriumFlameT -case . controlDict

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile

1
bin/org-pdflatex Symbolic link
View File

@ -0,0 +1 @@
tools/org-batch

View File

@ -37,8 +37,9 @@ usage() {
Usage: ${0##*/} [OPTIONS] file1 [.. fileN] Usage: ${0##*/} [OPTIONS] file1 [.. fileN]
options: options:
-html create html (default) -html create html (default)
-latex create LaTeX -latex create LaTeX
-pdflatex create pdf via pdflatex
* Batch process emacs org-mode files to create html/LaTeX etc. * Batch process emacs org-mode files to create html/LaTeX etc.
@ -49,8 +50,14 @@ USAGE
# default is html export: # default is html export:
mode=html mode=html
unset makePDF
echo "have $Script"
case $Script in case $Script in
*pdflatex)
mode=latex
makePDF=pdflatex
;;
*latex) *latex)
mode=latex mode=latex
;; ;;
@ -59,7 +66,6 @@ case $Script in
;; ;;
esac esac
# parse options # parse options
while [ "$#" -gt 0 ] while [ "$#" -gt 0 ]
do do
@ -75,6 +81,11 @@ do
mode=latex mode=latex
shift shift
;; ;;
-pdflatex)
mode=latex
makePDF=pdflatex
shift
;;
-*) -*)
usage "unknown option: '$*'" usage "unknown option: '$*'"
;; ;;
@ -98,6 +109,21 @@ do
then then
emacs --batch -l org --visit=$org \ emacs --batch -l org --visit=$org \
--funcall org-export-as-$mode-batch --funcall org-export-as-$mode-batch
# post-processing step to create pdf
case "$makePDF" in
pdflatex)
input="${org%.org}.tex"
if [ -f "$input" ]
then
pdflatex "$input"
else
echo "No $input to convert to pdf"
fi
;;
esac
else else
echo "File not found" echo "File not found"
fi fi

View File

@ -2,7 +2,7 @@
# #
#+TITLE: OpenFOAM C++ style guide #+TITLE: OpenFOAM C++ style guide
#+AUTHOR: OpenCFD Ltd. #+AUTHOR: OpenCFD Ltd.
#+DATE: May 2010 #+DATE: June 2010
#+LINK: http://www.opencfd.co.uk #+LINK: http://www.opencfd.co.uk
#+OPTIONS: author:nil ^:{} #+OPTIONS: author:nil ^:{}
@ -13,9 +13,12 @@
+ The normal indentation is 4 spaces per logical level. + The normal indentation is 4 spaces per logical level.
+ Use spaces for indentation, not tab characters. + Use spaces for indentation, not tab characters.
+ Avoid trailing whitespace. + Avoid trailing whitespace.
+ The body of control statements (eg, =if=, =else=, =while=, etc). + The body of control statements (eg, =if=, =else=, =while=, etc). is
always delineated with brace brackets. A possible exception can be always delineated with brace brackets. A possible exception can be
made with =break= or =continue= as part of a control structure. made in conjunction with =break= or =continue= as part of a control
structure.
+ The body of =case= statements is usually delineated with brace brackets.
+ A fall-through =case= should be commented as such.
+ stream output + stream output
+ =<<= is always four characters after the start of the stream, + =<<= is always four characters after the start of the stream,
@ -132,22 +135,25 @@
+ Use two empty lines between functions + Use two empty lines between functions
*** Coding Practice *** Coding Practice
+ passing data as arguments or return + passing data as arguments or return values.
Pass bool, label and scalar as copy, anything larger by reference. + Pass bool, label and scalar as copy, anything larger by reference.
+ const + const
Use everywhere it is applicable. + Use everywhere it is applicable.
+ variable initialisation using = + variable initialisation using
#+BEGIN_EXAMPLE
: const className& variableName = otherClass.data(); const className& variableName = otherClass.data();
#+END_EXAMPLE
NOT NOT
: const className& variableName(otherClass.data()); #+BEGIN_EXAMPLE
const className& variableName(otherClass.data());
#+END_EXAMPLE
+ virtual functions + virtual functions
If a class is virtual - make all derived classes virtual. + If a class is virtual, make all derived classes virtual.
*** Conditional Statements *** Conditional Statements
#+BEGIN_EXAMPLE #+BEGIN_EXAMPLE
@ -169,7 +175,7 @@
} }
#+END_EXAMPLE #+END_EXAMPLE
NOT (no space between =if= and =(=) NOT (no space between =if= and =(= used)
#+BEGIN_EXAMPLE #+BEGIN_EXAMPLE
if(condition) if(condition)
@ -201,7 +207,7 @@
} }
#+END_EXAMPLE #+END_EXAMPLE
NOT (no space between =for= and =(=) NOT this (no space between =for= and =(= used)
#+BEGIN_EXAMPLE #+BEGIN_EXAMPLE
for(i = 0; i < maxI; i++) for(i = 0; i < maxI; i++)
@ -349,7 +355,7 @@
* (k + t); * (k + t);
#+END_EXAMPLE #+END_EXAMPLE
This is sometime more legible when surrounded by extra parentheses: This is sometimes more legible when surrounded by extra parentheses:
#+BEGIN_EXAMPLE #+BEGIN_EXAMPLE
variableName = variableName =
@ -437,15 +443,15 @@
*** Doxygen Special Commands *** Doxygen Special Commands
Doxygen has a large number of special commands with a '\' prefix or a Doxygen has a large number of special commands with a =\= prefix or
(alternatively) an '@' prefix. (alternatively) an =@= prefix.
The '@' prefix form is recommended for most Doxygen specials, since it The =@= prefix form is recommended for most Doxygen specials, since it
has the advantage of standing out. It also happens to be what projects has the advantage of standing out. It also happens to be what projects
like gcc and VTK are using. like gcc and VTK are using.
The '\' prefix form, however, looks a bit better for the '\n' newline The =\= prefix form, however, looks a bit better for the =\n= newline
command and when escaping single characters - eg, '\@', '\<', '\>', etc. command and when escaping single characters - eg, =\@=, =\<=, =\>=, etc.
Since the filtering removes the leading 4 spaces within the blocks, the Since the filtering removes the leading 4 spaces within the blocks, the
Doxygen commmands can be inserted within the block without problems. Doxygen commmands can be inserted within the block without problems.
@ -514,7 +520,7 @@
#+END_EXAMPLE #+END_EXAMPLE
*** Documenting Typedefs and classes defined via macros *** Documenting typedefs and classes defined via macros
... not yet properly resolved ... not yet properly resolved

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile

View File

@ -497,10 +497,15 @@ $(Fields)/scalarField/scalarFieldIOField.C
$(Fields)/vectorField/vectorIOField.C $(Fields)/vectorField/vectorIOField.C
$(Fields)/vectorField/vectorFieldIOField.C $(Fields)/vectorField/vectorFieldIOField.C
$(Fields)/vector2DField/vector2DIOField.C $(Fields)/vector2DField/vector2DIOField.C
$(Fields)/vector2DField/vector2DFieldIOField.C
$(Fields)/sphericalTensorField/sphericalTensorIOField.C $(Fields)/sphericalTensorField/sphericalTensorIOField.C
$(Fields)/sphericalTensorField/sphericalTensorFieldIOField.C
$(Fields)/diagTensorField/diagTensorIOField.C $(Fields)/diagTensorField/diagTensorIOField.C
$(Fields)/diagTensorField/diagTensorFieldIOField.C
$(Fields)/symmTensorField/symmTensorIOField.C $(Fields)/symmTensorField/symmTensorIOField.C
$(Fields)/symmTensorField/symmTensorFieldIOField.C
$(Fields)/tensorField/tensorIOField.C $(Fields)/tensorField/tensorIOField.C
$(Fields)/tensorField/tensorFieldIOField.C
$(Fields)/transformField/transformField.C $(Fields)/transformField/transformField.C
pointPatchFields = fields/pointPatchFields pointPatchFields = fields/pointPatchFields

View File

@ -33,25 +33,25 @@ Foam::NamedEnum<Enum, nEnum>::NamedEnum()
: :
HashTable<int>(2*nEnum) HashTable<int>(2*nEnum)
{ {
for (int i=0; i<nEnum; i++) for (int enumI = 0; enumI < nEnum; ++enumI)
{ {
if (!names[i] || names[i][0] == '\0') if (!names[enumI] || names[enumI][0] == '\0')
{ {
stringList goodNames(i); stringList goodNames(enumI);
for (int j = 0; j < i; j++) for (int i = 0; i < enumI; ++i)
{ {
goodNames[j] = names[j]; goodNames[i] = names[i];
} }
FatalErrorIn("NamedEnum<Enum, nEnum>::NamedEnum()") FatalErrorIn("NamedEnum<Enum, nEnum>::NamedEnum()")
<< "Illegal enumeration name at position " << i << endl << "Illegal enumeration name at position " << enumI << endl
<< "after entries " << goodNames << ".\n" << "after entries " << goodNames << ".\n"
<< "Possibly your NamedEnum<Enum, nEnum>::names array" << "Possibly your NamedEnum<Enum, nEnum>::names array"
<< " is not of size " << nEnum << endl << " is not of size " << nEnum << endl
<< abort(FatalError); << abort(FatalError);
} }
insert(names[i], i); insert(names[enumI], enumI);
} }
} }
@ -61,7 +61,7 @@ Foam::NamedEnum<Enum, nEnum>::NamedEnum()
template<class Enum, int nEnum> template<class Enum, int nEnum>
Enum Foam::NamedEnum<Enum, nEnum>::read(Istream& is) const Enum Foam::NamedEnum<Enum, nEnum>::read(Istream& is) const
{ {
word name(is); const word name(is);
HashTable<int>::const_iterator iter = find(name); HashTable<int>::const_iterator iter = find(name);
@ -71,7 +71,7 @@ Enum Foam::NamedEnum<Enum, nEnum>::read(Istream& is) const
( (
"NamedEnum<Enum, nEnum>::read(Istream&) const", is "NamedEnum<Enum, nEnum>::read(Istream&) const", is
) << name << " is not in enumeration: " ) << name << " is not in enumeration: "
<< toc() << exit(FatalIOError); << sortedToc() << exit(FatalIOError);
} }
return Enum(iter()); return Enum(iter());

View File

@ -597,8 +597,9 @@ bool Foam::Time::end() const
} }
void Foam::Time::stopAt(const stopAtControls sa) const bool Foam::Time::stopAt(const stopAtControls sa) const
{ {
const bool changed = (stopAt_ != sa);
stopAt_ = sa; stopAt_ = sa;
// adjust endTime // adjust endTime
@ -610,6 +611,7 @@ void Foam::Time::stopAt(const stopAtControls sa) const
{ {
endTime_ = GREAT; endTime_ = GREAT;
} }
return changed;
} }

View File

@ -434,7 +434,8 @@ public:
//- Adjust the current stopAtControl. Note that this value //- Adjust the current stopAtControl. Note that this value
// only persists until the next time the dictionary is read. // only persists until the next time the dictionary is read.
virtual void stopAt(const stopAtControls) const; // Return true if the stopAtControl changed.
virtual bool stopAt(const stopAtControls) const;
//- Reset the time and time-index to those of the given time //- Reset the time and time-index to those of the given time
virtual void setTime(const Time&); virtual void setTime(const Time&);

View File

@ -191,10 +191,14 @@ public:
Istream& Istream&
); );
//- Construct top-level dictionary from Istream, reading entries //- Construct top-level dictionary from Istream,
// until EOF // reading entries until EOF
dictionary(Istream&); dictionary(Istream&);
//- Construct top-level dictionary from Istream,
// reading entries until EOF, optionally keeping the header
dictionary(Istream&, const bool keepHeader);
//- Construct as copy given the parent dictionary //- Construct as copy given the parent dictionary
dictionary(const dictionary& parentDict, const dictionary&); dictionary(const dictionary& parentDict, const dictionary&);
@ -441,6 +445,9 @@ public:
//- Read dictionary from Istream //- Read dictionary from Istream
bool read(Istream&); bool read(Istream&);
//- Read dictionary from Istream, optionally keeping the header
bool read(Istream&, const bool keepHeader);
// Write // Write

View File

@ -28,68 +28,6 @@ License
#include "inputModeEntry.H" #include "inputModeEntry.H"
#include "regExp.H" #include "regExp.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
bool Foam::dictionary::read(Istream& is)
{
if (!is.good())
{
FatalIOErrorIn("dictionary::read(Istream&, const word&)", is)
<< "Istream not OK for reading dictionary "
<< exit(FatalIOError);
return false;
}
token currToken(is);
if (currToken != token::BEGIN_BLOCK)
{
is.putBack(currToken);
}
while (!is.eof() && entry::New(*this, is))
{}
// Remove the FoamFile header entry if it exists
remove("FoamFile");
if (is.bad())
{
Info<< "dictionary::read(Istream&, const word&) : "
<< "Istream not OK after reading dictionary " << name()
<< endl;
return false;
}
return true;
}
bool Foam::dictionary::substituteKeyword(const word& keyword)
{
word varName = keyword(1, keyword.size()-1);
// lookup the variable name in the given dictionary
const entry* ePtr = lookupEntryPtr(varName, true, true);
// if defined insert its entries into this dictionary
if (ePtr != NULL)
{
const dictionary& addDict = ePtr->dict();
forAllConstIter(IDLList<entry>, addDict, iter)
{
add(iter());
}
return true;
}
return false;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::dictionary::dictionary Foam::dictionary::dictionary
@ -118,12 +56,97 @@ Foam::dictionary::dictionary(Istream& is)
} }
Foam::dictionary::dictionary(Istream& is, const bool keepHeader)
:
dictionaryName(is.name()),
parent_(dictionary::null)
{
// Reset input mode as this is a "top-level" dictionary
functionEntries::inputModeEntry::clear();
read(is, keepHeader);
}
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::dictionary> Foam::dictionary::New(Istream& is) Foam::autoPtr<Foam::dictionary> Foam::dictionary::New(Istream& is)
{ {
return autoPtr<dictionary>(new dictionary(is)); return autoPtr<dictionary>(new dictionary(is));
} }
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
bool Foam::dictionary::read(Istream& is, const bool keepHeader)
{
if (!is.good())
{
FatalIOErrorIn("dictionary::read(Istream&, bool)", is)
<< "Istream not OK for reading dictionary "
<< exit(FatalIOError);
return false;
}
token currToken(is);
if (currToken != token::BEGIN_BLOCK)
{
is.putBack(currToken);
}
while (!is.eof() && entry::New(*this, is))
{}
// normally remove the FoamFile header entry if it exists
if (!keepHeader)
{
remove("FoamFile");
}
if (is.bad())
{
Info<< "dictionary::read(Istream&, bool) : "
<< "Istream not OK after reading dictionary " << name()
<< endl;
return false;
}
return true;
}
bool Foam::dictionary::read(Istream& is)
{
return this->read(is, false);
}
bool Foam::dictionary::substituteKeyword(const word& keyword)
{
word varName = keyword(1, keyword.size()-1);
// lookup the variable name in the given dictionary
const entry* ePtr = lookupEntryPtr(varName, true, true);
// if defined insert its entries into this dictionary
if (ePtr != NULL)
{
const dictionary& addDict = ePtr->dict();
forAllConstIter(IDLList<entry>, addDict, iter)
{
add(iter());
}
return true;
}
return false;
}
// * * * * * * * * * * * * * * Istream Operator * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Istream Operator * * * * * * * * * * * * * * //
Foam::Istream& Foam::operator>>(Istream& is, dictionary& dict) Foam::Istream& Foam::operator>>(Istream& is, dictionary& dict)
@ -145,7 +168,7 @@ void Foam::dictionary::write(Ostream& os, bool subDict) const
{ {
if (subDict) if (subDict)
{ {
os << nl << indent << token::BEGIN_BLOCK << incrIndent << nl; os << nl << indent << token::BEGIN_BLOCK << incrIndent << nl;
} }
forAllConstIter(IDLList<entry>, *this, iter) forAllConstIter(IDLList<entry>, *this, iter)
@ -153,12 +176,12 @@ void Foam::dictionary::write(Ostream& os, bool subDict) const
const entry& e = *iter; const entry& e = *iter;
// Write entry // Write entry
os << e; os << e;
// Add extra new line between entries for "top-level" dictionaries // Add extra new line between entries for "top-level" dictionaries
if (!subDict && parent() == dictionary::null && e != *last()) if (!subDict && parent() == dictionary::null && e != *last())
{ {
os << nl; os << nl;
} }
// Check stream before going to next entry. // Check stream before going to next entry.
@ -173,7 +196,7 @@ void Foam::dictionary::write(Ostream& os, bool subDict) const
if (subDict) if (subDict)
{ {
os << decrIndent << indent << token::END_BLOCK << endl; os << decrIndent << indent << token::END_BLOCK << endl;
} }
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -68,17 +68,27 @@ Foam::outputFilterOutputControl::~outputFilterOutputControl()
void Foam::outputFilterOutputControl::read(const dictionary& dict) void Foam::outputFilterOutputControl::read(const dictionary& dict)
{ {
outputControl_ = outputControlNames_.read(dict.lookup("outputControl")); if (dict.found("outputControl"))
{
outputControl_ = outputControlNames_.read(dict.lookup("outputControl"));
}
else
{
outputControl_ = ocTimeStep;
}
switch (outputControl_) switch (outputControl_)
{ {
case ocTimeStep: case ocTimeStep:
{ {
dict.lookup("outputInterval") >> outputInterval_; outputInterval_ = dict.lookupOrDefault<label>("outputInterval", 0);
break;
} }
default: default:
{ {
// do nothing // do nothing
break;
} }
} }
} }
@ -97,17 +107,21 @@ bool Foam::outputFilterOutputControl::output() const
); );
break; break;
} }
case ocOutputTime: case ocOutputTime:
{ {
return time_.outputTime(); return time_.outputTime();
break; break;
} }
default: default:
{ {
// this error should not actually be possible
FatalErrorIn("bool Foam::outputFilterOutputControl::output()") FatalErrorIn("bool Foam::outputFilterOutputControl::output()")
<< "Unknown output control: " << "Undefined output control: "
<< outputControlNames_[outputControl_] << nl << outputControlNames_[outputControl_] << nl
<< abort(FatalError); << abort(FatalError);
break;
} }
} }

View File

@ -25,6 +25,8 @@ Class
Foam::outputFilterOutputControl Foam::outputFilterOutputControl
Description Description
An output control for function objects.
The default is time-step execution at every interval.
SourceFiles SourceFiles
outputFilterOutputControl.C outputFilterOutputControl.C
@ -51,10 +53,11 @@ class outputFilterOutputControl
{ {
public: public:
//- The output control options
enum outputControls enum outputControls
{ {
ocTimeStep, ocTimeStep, /*!< execution is coupled to the time-step */
ocOutputTime ocOutputTime /*!< execution is coupled to the output-time */
}; };
@ -71,7 +74,7 @@ private:
//- Type of output //- Type of output
outputControls outputControl_; outputControls outputControl_;
//- The execution interval (in time steps) when using TIMESTEP mode //- The execution interval (in time steps) when using @c timeStep mode,
// a value <= 1 means execute at every time step // a value <= 1 means execute at every time step
label outputInterval_; label outputInterval_;

View File

@ -0,0 +1,50 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ 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 <http://www.gnu.org/licenses/>.
Description
diagTensorField with IO.
\*---------------------------------------------------------------------------*/
#include "diagTensorFieldIOField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
defineTemplateTypeNameAndDebugWithName
(
diagTensorFieldIOField,
"diagTensorFieldField",
0
);
defineTemplateTypeNameAndDebugWithName
(
diagTensorIOFieldField,
"diagTensorCompactFieldField",
0
);
}
// ************************************************************************* //

View File

@ -0,0 +1,51 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ 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 <http://www.gnu.org/licenses/>.
Typedef
Foam::diagTensorFieldIOField
Description
diagTensorFieldField with IO.
\*---------------------------------------------------------------------------*/
#ifndef diagTensorFieldIOField_H
#define diagTensorFieldIOField_H
#include "diagTensorField.H"
#include "IOField.H"
#include "IOFieldField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
typedef IOField<diagTensorField> diagTensorFieldIOField;
typedef IOFieldField<diagTensorField, diagTensor> diagTensorIOFieldField;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ 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 <http://www.gnu.org/licenses/>.
Description
sphericalTensorField with IO.
\*---------------------------------------------------------------------------*/
#include "sphericalTensorFieldIOField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
defineTemplateTypeNameAndDebugWithName
(
sphericalTensorFieldIOField,
"sphericalTensorFieldField",
0
);
defineTemplateTypeNameAndDebugWithName
(
sphericalTensorIOFieldField,
"sphericalTensorCompactFieldField",
0
);
}
// ************************************************************************* //

View File

@ -0,0 +1,53 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ 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 <http://www.gnu.org/licenses/>.
Typedef
Foam::sphericalTensorFieldIOField
Description
sphericalTensorFieldField with IO.
\*---------------------------------------------------------------------------*/
#ifndef sphericalTensorFieldIOField_H
#define sphericalTensorFieldIOField_H
#include "sphericalTensorField.H"
#include "IOField.H"
#include "IOFieldField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
typedef IOField<sphericalTensorField> sphericalTensorFieldIOField;
typedef IOFieldField<sphericalTensorField, sphericalTensor>
sphericalTensorIOFieldField;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -32,7 +32,12 @@ Description
namespace Foam namespace Foam
{ {
defineTemplateTypeNameAndDebugWithName(sphericalTensorIOField, "sphericalTensorField", 0); defineTemplateTypeNameAndDebugWithName
(
sphericalTensorIOField,
"sphericalTensorField",
0
);
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ 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 <http://www.gnu.org/licenses/>.
Description
symmTensorField with IO.
\*---------------------------------------------------------------------------*/
#include "symmTensorFieldIOField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
defineTemplateTypeNameAndDebugWithName
(
symmTensorFieldIOField,
"symmTensorFieldField",
0
);
defineTemplateTypeNameAndDebugWithName
(
symmTensorIOFieldField,
"symmTensorCompactFieldField",
0
);
}
// ************************************************************************* //

View File

@ -0,0 +1,51 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ 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 <http://www.gnu.org/licenses/>.
Typedef
Foam::symmTensorFieldIOField
Description
symmTensorFieldField with IO.
\*---------------------------------------------------------------------------*/
#ifndef symmTensorFieldIOField_H
#define symmTensorFieldIOField_H
#include "symmTensorField.H"
#include "IOField.H"
#include "IOFieldField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
typedef IOField<symmTensorField> symmTensorFieldIOField;
typedef IOFieldField<symmTensorField, symmTensor> symmTensorIOFieldField;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ 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 <http://www.gnu.org/licenses/>.
Description
tensorField with IO.
\*---------------------------------------------------------------------------*/
#include "tensorFieldIOField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
defineTemplateTypeNameAndDebugWithName
(
tensorFieldIOField,
"tensorFieldField",
0
);
defineTemplateTypeNameAndDebugWithName
(
tensorIOFieldField,
"tensorCompactFieldField",
0
);
}
// ************************************************************************* //

View File

@ -0,0 +1,51 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ 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 <http://www.gnu.org/licenses/>.
Typedef
Foam::tensorFieldIOField
Description
tensorFieldField with IO.
\*---------------------------------------------------------------------------*/
#ifndef tensorFieldIOField_H
#define tensorFieldIOField_H
#include "tensorField.H"
#include "IOField.H"
#include "IOFieldField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
typedef IOField<tensorField> tensorFieldIOField;
typedef IOFieldField<tensorField, tensor> tensorIOFieldField;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ 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 <http://www.gnu.org/licenses/>.
Description
vector2DField with IO.
\*---------------------------------------------------------------------------*/
#include "vector2DFieldIOField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
defineTemplateTypeNameAndDebugWithName
(
vector2DFieldIOField,
"vector2DFieldField",
0
);
defineTemplateTypeNameAndDebugWithName
(
vector2DIOFieldField,
"vector2DCompactFieldField",
0
);
}
// ************************************************************************* //

View File

@ -0,0 +1,51 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ 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 <http://www.gnu.org/licenses/>.
Typedef
Foam::vector2DFieldIOField
Description
vector2DFieldField with IO.
\*---------------------------------------------------------------------------*/
#ifndef vector2DFieldIOField_H
#define vector2DFieldIOField_H
#include "vector2DField.H"
#include "IOField.H"
#include "IOFieldField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
typedef IOField<vector2DField> vector2DFieldIOField;
typedef IOFieldField<vector2DField, vector2D> vector2DIOFieldField;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -32,7 +32,12 @@ Description
namespace Foam namespace Foam
{ {
defineTemplateTypeNameAndDebugWithName(vector2DIOField, "vector2DField", 0); defineTemplateTypeNameAndDebugWithName
(
vector2DIOField,
"vector2DField",
0
);
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -28,7 +28,6 @@ License
#include "clock.H" #include "clock.H"
#include "IFstream.H" #include "IFstream.H"
#include "dictionary.H" #include "dictionary.H"
#include "Switch.H"
#include "IOobject.H" #include "IOobject.H"
#include "JobInfo.H" #include "JobInfo.H"
#include "labelList.H" #include "labelList.H"
@ -564,7 +563,7 @@ Foam::argList::argList
} }
// distributed data // distributed data
if (decompDict.lookupOrDefault<Switch>("distributed", false)) if (decompDict.lookupOrDefault("distributed", false))
{ {
fileNameList roots; fileNameList roots;
decompDict.lookup("roots") >> roots; decompDict.lookup("roots") >> roots;

View File

@ -145,6 +145,20 @@ public:
return solverName_; return solverName_;
} }
//- Return solver name
word& solverName()
{
return solverName_;
}
//- Return field name
const word& fieldName() const
{
return fieldName_;
}
//- Return initial residual //- Return initial residual
scalar initialResidual() const scalar initialResidual() const
{ {
@ -209,6 +223,10 @@ public:
//- Print summary of solver performance //- Print summary of solver performance
void print() const; void print() const;
// Member Operators
bool operator!=(const solverPerformance&) const;
// Friend functions // Friend functions
@ -222,6 +240,7 @@ public:
// Ostream Operator // Ostream Operator
friend Istream& operator>>(Istream&, solverPerformance&);
friend Ostream& operator<<(Ostream&, const solverPerformance&); friend Ostream& operator<<(Ostream&, const solverPerformance&);
}; };

View File

@ -32,15 +32,7 @@ Description
Foam::lduMatrix::solverPerformance::solverPerformance(Istream& is) Foam::lduMatrix::solverPerformance::solverPerformance(Istream& is)
{ {
is.readBeginList("lduMatrix::solverPerformance"); is >> *this;
is >> solverName_
>> fieldName_
>> initialResidual_
>> finalResidual_
>> noIterations_
>> converged_
>> singular_;
is.readEndList("lduMatrix::solverPerformance");
} }
@ -118,6 +110,24 @@ void Foam::lduMatrix::solverPerformance::print() const
} }
bool Foam::lduMatrix::solverPerformance::operator!=
(
const lduMatrix::solverPerformance& sp
) const
{
return
(
solverName() != sp.solverName()
|| fieldName() != sp.fieldName()
|| initialResidual() != sp.initialResidual()
|| finalResidual() != sp.finalResidual()
|| nIterations() != sp.nIterations()
|| converged() != sp.converged()
|| singular() != sp.singular()
);
}
Foam::lduMatrix::solverPerformance Foam::max Foam::lduMatrix::solverPerformance Foam::max
( (
const lduMatrix::solverPerformance& sp1, const lduMatrix::solverPerformance& sp1,
@ -137,6 +147,26 @@ Foam::lduMatrix::solverPerformance Foam::max
} }
Foam::Istream& Foam::operator>>
(
Istream& is,
Foam::lduMatrix::solverPerformance& sp
)
{
is.readBeginList("lduMatrix::solverPerformance");
is >> sp.solverName_
>> sp.fieldName_
>> sp.initialResidual_
>> sp.finalResidual_
>> sp.noIterations_
>> sp.converged_
>> sp.singular_;
is.readEndList("lduMatrix::solverPerformance");
return is;
}
Foam::Ostream& Foam::operator<< Foam::Ostream& Foam::operator<<
( (
Ostream& os, Ostream& os,

View File

@ -58,7 +58,6 @@ SourceFiles
#include "labelField.H" #include "labelField.H"
#include "primitiveFields.H" #include "primitiveFields.H"
#include "LUscalarMatrix.H" #include "LUscalarMatrix.H"
#include "Switch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -75,7 +74,7 @@ class GAMGSolver
{ {
// Private data // Private data
Switch cacheAgglomeration_; bool cacheAgglomeration_;
//- Number of pre-smoothing sweeps //- Number of pre-smoothing sweeps
label nPreSweeps_; label nPreSweeps_;

View File

@ -76,7 +76,7 @@ Foam::cyclicGAMGInterface::cyclicGAMGInterface
label nCoarseFaces = 0; label nCoarseFaces = 0;
forAll (localRestrictAddressing, ffi) forAll(localRestrictAddressing, ffi)
{ {
label curMaster = -1; label curMaster = -1;
label curSlave = -1; label curSlave = -1;
@ -164,7 +164,7 @@ Foam::cyclicGAMGInterface::cyclicGAMGInterface
if (owner()) if (owner())
{ {
// On master side, the owner addressing is stored in table of contents // On master side, the owner addressing is stored in table of contents
forAll (contents, masterI) forAll(contents, masterI)
{ {
SLList<label>& curNbrs = neighboursTable.find(contents[masterI])(); SLList<label>& curNbrs = neighboursTable.find(contents[masterI])();
@ -200,7 +200,7 @@ Foam::cyclicGAMGInterface::cyclicGAMGInterface
else else
{ {
// On slave side, the owner addressing is stored in linked lists // On slave side, the owner addressing is stored in linked lists
forAll (contents, masterI) forAll(contents, masterI)
{ {
SLList<label>& curNbrs = neighboursTable.find(contents[masterI])(); SLList<label>& curNbrs = neighboursTable.find(contents[masterI])();

Some files were not shown because too many files have changed in this diff Show More