diff --git a/applications/solvers/DNS/dnsFoam/readTransportProperties.H b/applications/solvers/DNS/dnsFoam/readTransportProperties.H
index 77af096bf..0d8090854 100644
--- a/applications/solvers/DNS/dnsFoam/readTransportProperties.H
+++ b/applications/solvers/DNS/dnsFoam/readTransportProperties.H
@@ -7,7 +7,7 @@
"transportProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/DNS/dnsFoam/readTurbulenceProperties.H b/applications/solvers/DNS/dnsFoam/readTurbulenceProperties.H
index 9f4d8368a..dc48e2fd8 100644
--- a/applications/solvers/DNS/dnsFoam/readTurbulenceProperties.H
+++ b/applications/solvers/DNS/dnsFoam/readTurbulenceProperties.H
@@ -7,7 +7,7 @@
"turbulenceProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/basic/laplacianFoam/createFields.H b/applications/solvers/basic/laplacianFoam/createFields.H
index 3359f2896..616afe1a8 100644
--- a/applications/solvers/basic/laplacianFoam/createFields.H
+++ b/applications/solvers/basic/laplacianFoam/createFields.H
@@ -23,7 +23,7 @@
"transportProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/basic/scalarTransportFoam/createFields.H b/applications/solvers/basic/scalarTransportFoam/createFields.H
index fb88dcc88..394fe42e9 100644
--- a/applications/solvers/basic/scalarTransportFoam/createFields.H
+++ b/applications/solvers/basic/scalarTransportFoam/createFields.H
@@ -39,7 +39,7 @@
"transportProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C b/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C
index 950a370d4..d7402c175 100644
--- a/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C
+++ b/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C
@@ -50,10 +50,12 @@ PDRkEpsilon::PDRkEpsilon
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
- const basicThermo& thermophysicalModel
+ const basicThermo& thermophysicalModel,
+ const word& turbulenceModelName,
+ const word& modelName
)
:
- RASModel(typeName, rho, U, phi, thermophysicalModel),
+ RASModel(typeName, rho, U, phi, thermophysicalModel, turbulenceModelName),
Cmu_
(
diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.H b/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.H
index 8ab470533..839c3de99 100644
--- a/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.H
+++ b/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.H
@@ -112,7 +112,9 @@ public:
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
- const basicThermo& thermophysicalModel
+ const basicThermo& thermophysicalModel,
+ const word& turbulenceModelName = turbulenceModel::typeName,
+ const word& modelName = typeName
);
diff --git a/applications/solvers/combustion/PDRFoam/createFields.H b/applications/solvers/combustion/PDRFoam/createFields.H
index 6d3a4bdf5..047840fae 100644
--- a/applications/solvers/combustion/PDRFoam/createFields.H
+++ b/applications/solvers/combustion/PDRFoam/createFields.H
@@ -110,7 +110,7 @@
"PDRProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/combustion/PDRFoam/readCombustionProperties.H b/applications/solvers/combustion/PDRFoam/readCombustionProperties.H
index 9f4435b25..acc5cb786 100644
--- a/applications/solvers/combustion/PDRFoam/readCombustionProperties.H
+++ b/applications/solvers/combustion/PDRFoam/readCombustionProperties.H
@@ -7,7 +7,7 @@
"combustionProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/combustion/XiFoam/readCombustionProperties.H b/applications/solvers/combustion/XiFoam/readCombustionProperties.H
index da0a3a94a..58b0626fb 100644
--- a/applications/solvers/combustion/XiFoam/readCombustionProperties.H
+++ b/applications/solvers/combustion/XiFoam/readCombustionProperties.H
@@ -7,7 +7,7 @@
"combustionProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/combustion/dieselEngineFoam/readCombustionProperties.H b/applications/solvers/combustion/dieselEngineFoam/readCombustionProperties.H
index 687d83ea9..84cf9b975 100644
--- a/applications/solvers/combustion/dieselEngineFoam/readCombustionProperties.H
+++ b/applications/solvers/combustion/dieselEngineFoam/readCombustionProperties.H
@@ -7,7 +7,7 @@ IOdictionary combustionProperties
"combustionProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/combustion/fireFoam/createFields.H b/applications/solvers/combustion/fireFoam/createFields.H
index b2acec7ed..1ad5cd190 100644
--- a/applications/solvers/combustion/fireFoam/createFields.H
+++ b/applications/solvers/combustion/fireFoam/createFields.H
@@ -65,7 +65,7 @@ IOdictionary combustionProperties
"combustionProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/combustion/reactingFoam/readChemistryProperties.H b/applications/solvers/combustion/reactingFoam/readChemistryProperties.H
index ab51afe28..f0bcf7597 100644
--- a/applications/solvers/combustion/reactingFoam/readChemistryProperties.H
+++ b/applications/solvers/combustion/reactingFoam/readChemistryProperties.H
@@ -7,7 +7,7 @@ IOdictionary chemistryProperties
"chemistryProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE,
false
)
diff --git a/applications/solvers/combustion/rhoReactingFoam/readChemistryProperties.H b/applications/solvers/combustion/rhoReactingFoam/readChemistryProperties.H
index ab51afe28..f0bcf7597 100644
--- a/applications/solvers/combustion/rhoReactingFoam/readChemistryProperties.H
+++ b/applications/solvers/combustion/rhoReactingFoam/readChemistryProperties.H
@@ -7,7 +7,7 @@ IOdictionary chemistryProperties
"chemistryProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE,
false
)
diff --git a/applications/solvers/compressible/rhoCentralFoam/readThermophysicalProperties.H b/applications/solvers/compressible/rhoCentralFoam/readThermophysicalProperties.H
index adc9ec4d1..0b28b77ee 100644
--- a/applications/solvers/compressible/rhoCentralFoam/readThermophysicalProperties.H
+++ b/applications/solvers/compressible/rhoCentralFoam/readThermophysicalProperties.H
@@ -9,7 +9,7 @@ IOdictionary thermophysicalProperties
"thermophysicalProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/compressible/rhoSonicFoam/readThermodynamicProperties.H b/applications/solvers/compressible/rhoSonicFoam/readThermodynamicProperties.H
index 1fc57fc5f..4e19adaae 100644
--- a/applications/solvers/compressible/rhoSonicFoam/readThermodynamicProperties.H
+++ b/applications/solvers/compressible/rhoSonicFoam/readThermodynamicProperties.H
@@ -7,7 +7,7 @@
"thermodynamicProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/compressible/rhopSonicFoam/readThermodynamicProperties.H b/applications/solvers/compressible/rhopSonicFoam/readThermodynamicProperties.H
index e8242e806..1e08986df 100644
--- a/applications/solvers/compressible/rhopSonicFoam/readThermodynamicProperties.H
+++ b/applications/solvers/compressible/rhopSonicFoam/readThermodynamicProperties.H
@@ -7,7 +7,7 @@
"thermodynamicProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/compressible/sonicDyMFoam/readTransportProperties.H b/applications/solvers/compressible/sonicDyMFoam/readTransportProperties.H
index 1502e2033..c30f65b44 100644
--- a/applications/solvers/compressible/sonicDyMFoam/readTransportProperties.H
+++ b/applications/solvers/compressible/sonicDyMFoam/readTransportProperties.H
@@ -7,7 +7,7 @@
"transportProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/compressible/sonicLiquidFoam/readThermodynamicProperties.H b/applications/solvers/compressible/sonicLiquidFoam/readThermodynamicProperties.H
index d8dad7d80..82f3655f4 100644
--- a/applications/solvers/compressible/sonicLiquidFoam/readThermodynamicProperties.H
+++ b/applications/solvers/compressible/sonicLiquidFoam/readThermodynamicProperties.H
@@ -7,7 +7,7 @@
"thermodynamicProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/compressible/sonicLiquidFoam/readTransportProperties.H b/applications/solvers/compressible/sonicLiquidFoam/readTransportProperties.H
index 1502e2033..c30f65b44 100644
--- a/applications/solvers/compressible/sonicLiquidFoam/readTransportProperties.H
+++ b/applications/solvers/compressible/sonicLiquidFoam/readTransportProperties.H
@@ -7,7 +7,7 @@
"transportProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/coupled/blockCoupledScalarTransportFoam/createFields.H b/applications/solvers/coupled/blockCoupledScalarTransportFoam/createFields.H
index d3d4b42a8..6f4efc8e9 100644
--- a/applications/solvers/coupled/blockCoupledScalarTransportFoam/createFields.H
+++ b/applications/solvers/coupled/blockCoupledScalarTransportFoam/createFields.H
@@ -69,7 +69,7 @@
"transportProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/coupled/conjugateHeatFoam/createFields.H b/applications/solvers/coupled/conjugateHeatFoam/createFields.H
index d04677e18..afd4d5483 100644
--- a/applications/solvers/coupled/conjugateHeatFoam/createFields.H
+++ b/applications/solvers/coupled/conjugateHeatFoam/createFields.H
@@ -7,7 +7,7 @@
"transportProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/coupled/conjugateHeatSimpleFoam/createFields.H b/applications/solvers/coupled/conjugateHeatSimpleFoam/createFields.H
index 42330b79f..e9d058919 100644
--- a/applications/solvers/coupled/conjugateHeatSimpleFoam/createFields.H
+++ b/applications/solvers/coupled/conjugateHeatSimpleFoam/createFields.H
@@ -7,7 +7,7 @@
"transportProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/electromagnetics/electrostaticFoam/createFields.H b/applications/solvers/electromagnetics/electrostaticFoam/createFields.H
index 64522273b..04c86c4ed 100644
--- a/applications/solvers/electromagnetics/electrostaticFoam/createFields.H
+++ b/applications/solvers/electromagnetics/electrostaticFoam/createFields.H
@@ -7,7 +7,7 @@
"physicalProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/electromagnetics/mhdFoam/createFields.H b/applications/solvers/electromagnetics/mhdFoam/createFields.H
index d5a0e62de..dcc9b127b 100644
--- a/applications/solvers/electromagnetics/mhdFoam/createFields.H
+++ b/applications/solvers/electromagnetics/mhdFoam/createFields.H
@@ -7,7 +7,7 @@
"transportProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/engine/icoDyMEngineFoam/createFields.H b/applications/solvers/engine/icoDyMEngineFoam/createFields.H
index 3fbf47549..b203e1283 100644
--- a/applications/solvers/engine/icoDyMEngineFoam/createFields.H
+++ b/applications/solvers/engine/icoDyMEngineFoam/createFields.H
@@ -7,7 +7,7 @@
"transportProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/financial/financialFoam/createFields.H b/applications/solvers/financial/financialFoam/createFields.H
index 6cdbbe2bd..dc0da4d2a 100644
--- a/applications/solvers/financial/financialFoam/createFields.H
+++ b/applications/solvers/financial/financialFoam/createFields.H
@@ -7,7 +7,7 @@
"financialProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/finiteArea/liquidFilmFoam/readTransportProperties.H b/applications/solvers/finiteArea/liquidFilmFoam/readTransportProperties.H
index 2f2c99ffd..1d68c4173 100644
--- a/applications/solvers/finiteArea/liquidFilmFoam/readTransportProperties.H
+++ b/applications/solvers/finiteArea/liquidFilmFoam/readTransportProperties.H
@@ -5,7 +5,7 @@ IOdictionary transportProperties
"transportProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/finiteArea/surfactantFoam/createFaFields.H b/applications/solvers/finiteArea/surfactantFoam/createFaFields.H
index 89d8da2f7..a8be20751 100644
--- a/applications/solvers/finiteArea/surfactantFoam/createFaFields.H
+++ b/applications/solvers/finiteArea/surfactantFoam/createFaFields.H
@@ -21,7 +21,7 @@ IOdictionary transportProperties
"transportProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/heatTransfer/boussinesqBuoyantFoam/readTransportProperties.H b/applications/solvers/heatTransfer/boussinesqBuoyantFoam/readTransportProperties.H
index 571a66ee0..02492fe22 100644
--- a/applications/solvers/heatTransfer/boussinesqBuoyantFoam/readTransportProperties.H
+++ b/applications/solvers/heatTransfer/boussinesqBuoyantFoam/readTransportProperties.H
@@ -7,7 +7,7 @@
"transportProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/immersedBoundary/icoDyMIbFoam/createFields.H b/applications/solvers/immersedBoundary/icoDyMIbFoam/createFields.H
index 2721134d9..5af8f976c 100644
--- a/applications/solvers/immersedBoundary/icoDyMIbFoam/createFields.H
+++ b/applications/solvers/immersedBoundary/icoDyMIbFoam/createFields.H
@@ -7,7 +7,7 @@
"transportProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/immersedBoundary/icoIbFoam/createFields.H b/applications/solvers/immersedBoundary/icoIbFoam/createFields.H
index 2721134d9..5af8f976c 100644
--- a/applications/solvers/immersedBoundary/icoIbFoam/createFields.H
+++ b/applications/solvers/immersedBoundary/icoIbFoam/createFields.H
@@ -7,7 +7,7 @@
"transportProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/incompressible/RichardsFoam/RichardsFoam.C b/applications/solvers/incompressible/RichardsFoam/RichardsFoam.C
index 7c8ed800e..1097a75a9 100644
--- a/applications/solvers/incompressible/RichardsFoam/RichardsFoam.C
+++ b/applications/solvers/incompressible/RichardsFoam/RichardsFoam.C
@@ -1,25 +1,25 @@
/*---------------------------------------------------------------------------*\
========= |
- \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
- \\ / O peration |
- \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
- \\/ M anipulation |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
-------------------------------------------------------------------------------
License
- This file is part of OpenFOAM.
+ This file is part of foam-extend.
- 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.
+ foam-extend 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.
+ foam-extend 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 .
+ along with foam-extend. If not, see .
Application
RichardsFoam
diff --git a/applications/solvers/incompressible/RichardsFoam/setDeltaT.H b/applications/solvers/incompressible/RichardsFoam/setDeltaT.H
index c597cda93..b2c47552e 100644
--- a/applications/solvers/incompressible/RichardsFoam/setDeltaT.H
+++ b/applications/solvers/incompressible/RichardsFoam/setDeltaT.H
@@ -1,25 +1,25 @@
/*---------------------------------------------------------------------------*\
========= |
- \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
- \\ / O peration |
- \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
- \\/ M anipulation |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
-------------------------------------------------------------------------------
License
- This file is part of OpenFOAM.
+ This file is part of foam-extend.
- 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.
+ foam-extend 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.
+ foam-extend 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 .
+ along with foam-extend. If not, see .
Global
setDeltaT
diff --git a/applications/solvers/incompressible/RichardsFoam/spatialMeanValueRichardsonFoam/spatialMeanValueRichardsonFoam.C b/applications/solvers/incompressible/RichardsFoam/spatialMeanValueRichardsonFoam/spatialMeanValueRichardsonFoam.C
index 298304b98..2068fb95d 100644
--- a/applications/solvers/incompressible/RichardsFoam/spatialMeanValueRichardsonFoam/spatialMeanValueRichardsonFoam.C
+++ b/applications/solvers/incompressible/RichardsFoam/spatialMeanValueRichardsonFoam/spatialMeanValueRichardsonFoam.C
@@ -1,25 +1,25 @@
/*---------------------------------------------------------------------------*\
========= |
- \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
- \\ / O peration |
- \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
- \\/ M anipulation |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
-------------------------------------------------------------------------------
License
- This file is part of OpenFOAM.
+ This file is part of foam-extend.
- 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.
+ foam-extend 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.
+ foam-extend 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 .
+ along with foam-extend. If not, see .
Application
spatialMeanValue
diff --git a/applications/solvers/incompressible/boundaryFoam/createFields.H b/applications/solvers/incompressible/boundaryFoam/createFields.H
index e4db531c0..34a4592e5 100644
--- a/applications/solvers/incompressible/boundaryFoam/createFields.H
+++ b/applications/solvers/incompressible/boundaryFoam/createFields.H
@@ -6,7 +6,7 @@
"U",
runTime.timeName(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::AUTO_WRITE
),
mesh
@@ -44,7 +44,7 @@
"transportProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/incompressible/channelFoam/readTransportProperties.H b/applications/solvers/incompressible/channelFoam/readTransportProperties.H
index 87c93c919..abaee647c 100644
--- a/applications/solvers/incompressible/channelFoam/readTransportProperties.H
+++ b/applications/solvers/incompressible/channelFoam/readTransportProperties.H
@@ -6,7 +6,7 @@
"transportProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE,
false
)
diff --git a/applications/solvers/incompressible/icoDyMFoam/createFields.H b/applications/solvers/incompressible/icoDyMFoam/createFields.H
index 6e54a75c4..ba6a35cc0 100644
--- a/applications/solvers/incompressible/icoDyMFoam/createFields.H
+++ b/applications/solvers/incompressible/icoDyMFoam/createFields.H
@@ -7,7 +7,7 @@
"transportProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/incompressible/icoDyMSimpleFoam/createFields.H b/applications/solvers/incompressible/icoDyMSimpleFoam/createFields.H
index ad0d528b7..de42195a6 100644
--- a/applications/solvers/incompressible/icoDyMSimpleFoam/createFields.H
+++ b/applications/solvers/incompressible/icoDyMSimpleFoam/createFields.H
@@ -7,7 +7,7 @@
"transportProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/incompressible/icoFoam/createFields.H b/applications/solvers/incompressible/icoFoam/createFields.H
index 4fdfcb208..b9747cf22 100644
--- a/applications/solvers/incompressible/icoFoam/createFields.H
+++ b/applications/solvers/incompressible/icoFoam/createFields.H
@@ -7,7 +7,7 @@
"transportProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/incompressible/shallowWaterFoam/readGravitationalAcceleration.H b/applications/solvers/incompressible/shallowWaterFoam/readGravitationalAcceleration.H
index 0e34b0fa1..78b2bdc33 100644
--- a/applications/solvers/incompressible/shallowWaterFoam/readGravitationalAcceleration.H
+++ b/applications/solvers/incompressible/shallowWaterFoam/readGravitationalAcceleration.H
@@ -7,7 +7,7 @@ IOdictionary gravitationalProperties
"gravitationalProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/lagrangian/coalChemistryFoam/readChemistryProperties.H b/applications/solvers/lagrangian/coalChemistryFoam/readChemistryProperties.H
index ab51afe28..f0bcf7597 100644
--- a/applications/solvers/lagrangian/coalChemistryFoam/readChemistryProperties.H
+++ b/applications/solvers/lagrangian/coalChemistryFoam/readChemistryProperties.H
@@ -7,7 +7,7 @@ IOdictionary chemistryProperties
"chemistryProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE,
false
)
diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/readChemistryProperties.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/readChemistryProperties.H
index ab51afe28..f0bcf7597 100644
--- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/readChemistryProperties.H
+++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/readChemistryProperties.H
@@ -7,7 +7,7 @@ IOdictionary chemistryProperties
"chemistryProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE,
false
)
diff --git a/applications/solvers/lagrangian/reactingParcelFoam/readChemistryProperties.H b/applications/solvers/lagrangian/reactingParcelFoam/readChemistryProperties.H
index ab51afe28..f0bcf7597 100644
--- a/applications/solvers/lagrangian/reactingParcelFoam/readChemistryProperties.H
+++ b/applications/solvers/lagrangian/reactingParcelFoam/readChemistryProperties.H
@@ -7,7 +7,7 @@ IOdictionary chemistryProperties
"chemistryProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE,
false
)
diff --git a/applications/solvers/multiSolver/multiSolverDemo/createFields_icoFoam.H b/applications/solvers/multiSolver/multiSolverDemo/createFields_icoFoam.H
index 2e2c782db..cdbed4af2 100644
--- a/applications/solvers/multiSolver/multiSolverDemo/createFields_icoFoam.H
+++ b/applications/solvers/multiSolver/multiSolverDemo/createFields_icoFoam.H
@@ -7,7 +7,7 @@
"transportProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/multiSolver/multiSolverDemo/createFields_scalarTransportFoam.H b/applications/solvers/multiSolver/multiSolverDemo/createFields_scalarTransportFoam.H
index 5eb6c116f..c33ab487c 100644
--- a/applications/solvers/multiSolver/multiSolverDemo/createFields_scalarTransportFoam.H
+++ b/applications/solvers/multiSolver/multiSolverDemo/createFields_scalarTransportFoam.H
@@ -39,7 +39,7 @@
"transportProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/multiphase/barotropicCavitatingFoam/readThermodynamicProperties.H b/applications/solvers/multiphase/barotropicCavitatingFoam/readThermodynamicProperties.H
index c057c442b..5121f49e1 100644
--- a/applications/solvers/multiphase/barotropicCavitatingFoam/readThermodynamicProperties.H
+++ b/applications/solvers/multiphase/barotropicCavitatingFoam/readThermodynamicProperties.H
@@ -7,7 +7,7 @@
"thermodynamicProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/multiphase/barotropicCavitatingFoam/readTransportProperties.H b/applications/solvers/multiphase/barotropicCavitatingFoam/readTransportProperties.H
index a253dd1be..722b7e4ba 100644
--- a/applications/solvers/multiphase/barotropicCavitatingFoam/readTransportProperties.H
+++ b/applications/solvers/multiphase/barotropicCavitatingFoam/readTransportProperties.H
@@ -7,7 +7,7 @@
"transportProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/multiphase/bubbleFoam/createFields.H b/applications/solvers/multiphase/bubbleFoam/createFields.H
index 26013f9f4..c5c1a8212 100644
--- a/applications/solvers/multiphase/bubbleFoam/createFields.H
+++ b/applications/solvers/multiphase/bubbleFoam/createFields.H
@@ -91,7 +91,7 @@
"transportProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/multiphase/bubbleFoam/createRASTurbulence.H b/applications/solvers/multiphase/bubbleFoam/createRASTurbulence.H
index 9eb468f91..906b2e39a 100644
--- a/applications/solvers/multiphase/bubbleFoam/createRASTurbulence.H
+++ b/applications/solvers/multiphase/bubbleFoam/createRASTurbulence.H
@@ -5,7 +5,7 @@
"RASProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/multiphase/cavitatingFoam/readThermodynamicProperties.H b/applications/solvers/multiphase/cavitatingFoam/readThermodynamicProperties.H
index d3fbb9307..3740f1056 100644
--- a/applications/solvers/multiphase/cavitatingFoam/readThermodynamicProperties.H
+++ b/applications/solvers/multiphase/cavitatingFoam/readThermodynamicProperties.H
@@ -7,7 +7,7 @@
"thermodynamicProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C
index bf96e7a7c..0c896f119 100644
--- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C
+++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C
@@ -43,7 +43,7 @@ Foam::phaseChangeTwoPhaseMixture::New
"transportProperties",
U.time().constant(),
U.db(),
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE,
false
)
diff --git a/applications/solvers/multiphase/settlingFoam/createFields.H b/applications/solvers/multiphase/settlingFoam/createFields.H
index 57f62457b..38a71cff7 100644
--- a/applications/solvers/multiphase/settlingFoam/createFields.H
+++ b/applications/solvers/multiphase/settlingFoam/createFields.H
@@ -50,7 +50,7 @@
"transportProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/createFields.H b/applications/solvers/multiphase/twoPhaseEulerFoam/createFields.H
index 0a2d24ed6..4b11cce9c 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/createFields.H
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/createFields.H
@@ -7,7 +7,7 @@
"transportProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/readPPProperties.H b/applications/solvers/multiphase/twoPhaseEulerFoam/readPPProperties.H
index 3acbf758d..c1b319cbc 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/readPPProperties.H
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/readPPProperties.H
@@ -5,7 +5,7 @@
"ppProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/solidMechanics/deprecatedSolvers/contactStressFoam/createFields.H b/applications/solvers/solidMechanics/deprecatedSolvers/contactStressFoam/createFields.H
index 52b1f820a..9454eaed8 100644
--- a/applications/solvers/solidMechanics/deprecatedSolvers/contactStressFoam/createFields.H
+++ b/applications/solvers/solidMechanics/deprecatedSolvers/contactStressFoam/createFields.H
@@ -8,7 +8,7 @@
"U",
runTime.timeName(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::AUTO_WRITE
),
mesh
@@ -23,7 +23,7 @@
"mechanicalProperties",
"constant",
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/solidMechanics/deprecatedSolvers/icoFsiFoam/createFields.H b/applications/solvers/solidMechanics/deprecatedSolvers/icoFsiFoam/createFields.H
index 461709e4b..68d92f649 100644
--- a/applications/solvers/solidMechanics/deprecatedSolvers/icoFsiFoam/createFields.H
+++ b/applications/solvers/solidMechanics/deprecatedSolvers/icoFsiFoam/createFields.H
@@ -7,7 +7,7 @@
"transportProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/solidMechanics/deprecatedSolvers/icoFsiFoam/readCouplingProperties.H b/applications/solvers/solidMechanics/deprecatedSolvers/icoFsiFoam/readCouplingProperties.H
index c10e7af3c..51fc02d14 100644
--- a/applications/solvers/solidMechanics/deprecatedSolvers/icoFsiFoam/readCouplingProperties.H
+++ b/applications/solvers/solidMechanics/deprecatedSolvers/icoFsiFoam/readCouplingProperties.H
@@ -6,7 +6,7 @@
"couplingProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/solidMechanics/deprecatedSolvers/icoFsiFoam/readMechanicalProperties.H b/applications/solvers/solidMechanics/deprecatedSolvers/icoFsiFoam/readMechanicalProperties.H
index f06856dce..be3280868 100644
--- a/applications/solvers/solidMechanics/deprecatedSolvers/icoFsiFoam/readMechanicalProperties.H
+++ b/applications/solvers/solidMechanics/deprecatedSolvers/icoFsiFoam/readMechanicalProperties.H
@@ -7,7 +7,7 @@
"mechanicalProperties",
runTime.constant(),
stressMesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/solidMechanics/deprecatedSolvers/solidDisplacementFoam/readMechanicalProperties.H b/applications/solvers/solidMechanics/deprecatedSolvers/solidDisplacementFoam/readMechanicalProperties.H
index 91bd5f3da..9f256bd68 100644
--- a/applications/solvers/solidMechanics/deprecatedSolvers/solidDisplacementFoam/readMechanicalProperties.H
+++ b/applications/solvers/solidMechanics/deprecatedSolvers/solidDisplacementFoam/readMechanicalProperties.H
@@ -7,7 +7,7 @@
"mechanicalProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/solidMechanics/deprecatedSolvers/solidDisplacementFoam/readThermalProperties.H b/applications/solvers/solidMechanics/deprecatedSolvers/solidDisplacementFoam/readThermalProperties.H
index a4c3082fb..12e10a607 100644
--- a/applications/solvers/solidMechanics/deprecatedSolvers/solidDisplacementFoam/readThermalProperties.H
+++ b/applications/solvers/solidMechanics/deprecatedSolvers/solidDisplacementFoam/readThermalProperties.H
@@ -7,7 +7,7 @@
"thermalProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/solidMechanics/deprecatedSolvers/stressedFoam/readMechanicalProperties.H b/applications/solvers/solidMechanics/deprecatedSolvers/stressedFoam/readMechanicalProperties.H
index 0e8a1918b..81afaeafe 100644
--- a/applications/solvers/solidMechanics/deprecatedSolvers/stressedFoam/readMechanicalProperties.H
+++ b/applications/solvers/solidMechanics/deprecatedSolvers/stressedFoam/readMechanicalProperties.H
@@ -7,7 +7,7 @@
"mechanicalProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/solidMechanics/deprecatedSolvers/stressedFoam/readThermalProperties.H b/applications/solvers/solidMechanics/deprecatedSolvers/stressedFoam/readThermalProperties.H
index a4c3082fb..12e10a607 100644
--- a/applications/solvers/solidMechanics/deprecatedSolvers/stressedFoam/readThermalProperties.H
+++ b/applications/solvers/solidMechanics/deprecatedSolvers/stressedFoam/readThermalProperties.H
@@ -7,7 +7,7 @@
"thermalProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/solidMechanics/elasticThermalSolidFoam/readThermalProperties.H b/applications/solvers/solidMechanics/elasticThermalSolidFoam/readThermalProperties.H
index a4c3082fb..12e10a607 100644
--- a/applications/solvers/solidMechanics/elasticThermalSolidFoam/readThermalProperties.H
+++ b/applications/solvers/solidMechanics/elasticThermalSolidFoam/readThermalProperties.H
@@ -7,7 +7,7 @@
"thermalProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/solidMechanics/icoFsiElasticNonLinULSolidFoam/createFields.H b/applications/solvers/solidMechanics/icoFsiElasticNonLinULSolidFoam/createFields.H
index 1f930006d..caaf161fd 100644
--- a/applications/solvers/solidMechanics/icoFsiElasticNonLinULSolidFoam/createFields.H
+++ b/applications/solvers/solidMechanics/icoFsiElasticNonLinULSolidFoam/createFields.H
@@ -7,7 +7,7 @@
"transportProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/solidMechanics/icoFsiElasticNonLinULSolidFoam/readCouplingProperties.H b/applications/solvers/solidMechanics/icoFsiElasticNonLinULSolidFoam/readCouplingProperties.H
index 26f76ed67..f07a7969f 100644
--- a/applications/solvers/solidMechanics/icoFsiElasticNonLinULSolidFoam/readCouplingProperties.H
+++ b/applications/solvers/solidMechanics/icoFsiElasticNonLinULSolidFoam/readCouplingProperties.H
@@ -6,7 +6,7 @@
"couplingProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/solidMechanics/stressFemFoam/readMechanicalProperties.H b/applications/solvers/solidMechanics/stressFemFoam/readMechanicalProperties.H
index abeff6d13..f042c1082 100644
--- a/applications/solvers/solidMechanics/stressFemFoam/readMechanicalProperties.H
+++ b/applications/solvers/solidMechanics/stressFemFoam/readMechanicalProperties.H
@@ -7,7 +7,7 @@
"mechanicalProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/surfaceTracking/bubbleInterTrackFoam/createBubble.H b/applications/solvers/surfaceTracking/bubbleInterTrackFoam/createBubble.H
index e46ce1469..4e71afe3c 100644
--- a/applications/solvers/surfaceTracking/bubbleInterTrackFoam/createBubble.H
+++ b/applications/solvers/surfaceTracking/bubbleInterTrackFoam/createBubble.H
@@ -28,7 +28,7 @@
"mrfProperties",
runTime.constant(),
mesh,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
diff --git a/applications/solvers/surfaceTracking/freeSurface/functionObjects/bubbleHistory/bubbleHistory.C b/applications/solvers/surfaceTracking/freeSurface/functionObjects/bubbleHistory/bubbleHistory.C
index 7d76173b6..7408a0222 100644
--- a/applications/solvers/surfaceTracking/freeSurface/functionObjects/bubbleHistory/bubbleHistory.C
+++ b/applications/solvers/surfaceTracking/freeSurface/functionObjects/bubbleHistory/bubbleHistory.C
@@ -285,7 +285,7 @@ bool Foam::bubbleHistory::start()
}
-bool Foam::bubbleHistory::execute()
+bool Foam::bubbleHistory::execute(const bool forceWrite)
{
const fvMesh& mesh =
time_.lookupObject(regionName_);
@@ -401,6 +401,11 @@ bool Foam::bubbleHistory::execute()
}
+bool Foam::bubbleHistory::setTime()
+{
+ return true;
+}
+
bool Foam::bubbleHistory::read(const dictionary& dict)
{
if (dict.found("region"))
diff --git a/applications/solvers/surfaceTracking/freeSurface/functionObjects/bubbleHistory/bubbleHistory.H b/applications/solvers/surfaceTracking/freeSurface/functionObjects/bubbleHistory/bubbleHistory.H
index fc0f48a2b..013d5c0f0 100644
--- a/applications/solvers/surfaceTracking/freeSurface/functionObjects/bubbleHistory/bubbleHistory.H
+++ b/applications/solvers/surfaceTracking/freeSurface/functionObjects/bubbleHistory/bubbleHistory.H
@@ -109,10 +109,21 @@ public:
virtual bool start();
//- execute is called at each ++ or += of the time-loop
- virtual bool execute();
+ virtual bool execute(const bool forceWrite);
+
+ //- Called when time was set at the end of the Time::operator++
+ virtual bool setTime();
//- Read and set the function object if its data has changed
virtual bool read(const dictionary& dict);
+
+ //- Update for changes of mesh
+ virtual void updateMesh(const mapPolyMesh&)
+ {}
+
+ //- Update for changes of mesh
+ virtual void movePoints(const pointField&)
+ {}
};
diff --git a/applications/solvers/surfaceTracking/freeSurface/functionObjects/sloshingHistory/sloshingHistory.C b/applications/solvers/surfaceTracking/freeSurface/functionObjects/sloshingHistory/sloshingHistory.C
index beba853fb..cde12ffc1 100644
--- a/applications/solvers/surfaceTracking/freeSurface/functionObjects/sloshingHistory/sloshingHistory.C
+++ b/applications/solvers/surfaceTracking/freeSurface/functionObjects/sloshingHistory/sloshingHistory.C
@@ -186,7 +186,7 @@ bool Foam::sloshingHistory::start()
}
-bool Foam::sloshingHistory::execute()
+bool Foam::sloshingHistory::execute(const bool forceWrite)
{
const fvMesh& mesh =
time_.lookupObject(regionName_);
@@ -209,6 +209,12 @@ bool Foam::sloshingHistory::execute()
}
+bool Foam::sloshingHistory::setTime()
+{
+ return true;
+}
+
+
bool Foam::sloshingHistory::read(const dictionary& dict)
{
if (dict.found("region"))
diff --git a/applications/solvers/surfaceTracking/freeSurface/functionObjects/sloshingHistory/sloshingHistory.H b/applications/solvers/surfaceTracking/freeSurface/functionObjects/sloshingHistory/sloshingHistory.H
index 633c70a76..310146395 100644
--- a/applications/solvers/surfaceTracking/freeSurface/functionObjects/sloshingHistory/sloshingHistory.H
+++ b/applications/solvers/surfaceTracking/freeSurface/functionObjects/sloshingHistory/sloshingHistory.H
@@ -114,10 +114,21 @@ public:
virtual bool start();
//- execute is called at each ++ or += of the time-loop
- virtual bool execute();
+ virtual bool execute(const bool forceWrite);
+
+ //- Called when time was set at the end of the Time::operator++
+ virtual bool setTime();
//- Read and set the function object if its data has changed
virtual bool read(const dictionary& dict);
+
+ //- Update for changes of mesh
+ virtual void updateMesh(const mapPolyMesh&)
+ {}
+
+ //- Update for changes of mesh
+ virtual void movePoints(const pointField&)
+ {}
};
diff --git a/applications/utilities/mesh/generation/snappyHexMesh/Make/options b/applications/utilities/mesh/generation/snappyHexMesh/Make/options
index d380ebf20..281ba3844 100644
--- a/applications/utilities/mesh/generation/snappyHexMesh/Make/options
+++ b/applications/utilities/mesh/generation/snappyHexMesh/Make/options
@@ -14,5 +14,4 @@ EXE_LIBS = \
-lmeshTools \
-ldynamicMesh \
-ldynamicFvMesh \
- -lautoMesh \
- -L$(MESQUITE_LIB_DIR) -lmesquite
+ -lautoMesh
diff --git a/applications/utilities/mesh/manipulation/createPatch/createPatch.C b/applications/utilities/mesh/manipulation/createPatch/createPatch.C
index b3d567b7e..3c601ed0e 100644
--- a/applications/utilities/mesh/manipulation/createPatch/createPatch.C
+++ b/applications/utilities/mesh/manipulation/createPatch/createPatch.C
@@ -46,6 +46,7 @@ Description
#include "mapPolyMesh.H"
#include "directTopoChange.H"
#include "polyModifyFace.H"
+#include "wordReList.H"
using namespace Foam;
@@ -698,7 +699,10 @@ int main(int argc, char *argv[])
if (sourceType == "patches")
{
- labelHashSet patchSources(patches.patchSet(dict.lookup("patches")));
+ labelHashSet patchSources
+ (
+ patches.patchSet(wordReList(dict.lookup("patches")))
+ );
// Repatch faces of the patches.
forAllConstIter(labelHashSet, patchSources, iter)
diff --git a/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C b/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C
index c68bf6f24..6cc19d35f 100644
--- a/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C
+++ b/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C
@@ -95,7 +95,7 @@ using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template
-void addPatchFields(fvMesh& mesh, const word& patchFieldType)
+void addPatchFields(const fvMesh& mesh, const word& patchFieldType)
{
HashTable flds
(
@@ -136,7 +136,7 @@ void addPatchFields(fvMesh& mesh, const word& patchFieldType)
// Remove last patch field
template
-void trimPatchFields(fvMesh& mesh, const label nPatches)
+void trimPatchFields(const fvMesh& mesh, const label nPatches)
{
HashTable flds
(
@@ -163,7 +163,7 @@ void trimPatchFields(fvMesh& mesh, const label nPatches)
// Reorder patch field
template
-void reorderPatchFields(fvMesh& mesh, const labelList& oldToNew)
+void reorderPatchFields(const fvMesh& mesh, const labelList& oldToNew)
{
HashTable flds
(
diff --git a/applications/utilities/parallelProcessing/decomposeSets/decomposeSets.C b/applications/utilities/parallelProcessing/decomposeSets/decomposeSets.C
index 77daf7e6f..a2c9a1494 100644
--- a/applications/utilities/parallelProcessing/decomposeSets/decomposeSets.C
+++ b/applications/utilities/parallelProcessing/decomposeSets/decomposeSets.C
@@ -90,7 +90,7 @@ int main(int argc, char *argv[])
// Set all times on processor meshes equal to decomposed mesh
forAll (databases, procI)
{
- databases[procI].setTime(runTime.timeName(), runTime.timeIndex());
+ databases[procI].setTime(runTime, runTime.timeIndex());
}
// Read all meshes and addressing to reconstructed mesh
diff --git a/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C b/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C
index 51dcb16f8..122b05d98 100644
--- a/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C
+++ b/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C
@@ -51,7 +51,7 @@ Description
int main(int argc, char *argv[])
{
// enable -constant ... if someone really wants it
- // enable -zeroTime to prevent accidentally trashing the initial fields
+ // enable -noZero to prevent accidentally trashing the initial fields
timeSelector::addOptions(true, true);
argList::noParallel();
# include "addRegionOption.H"
@@ -125,7 +125,7 @@ int main(int argc, char *argv[])
// Set all times on processor meshes equal to reconstructed mesh
forAll (databases, procI)
{
- databases[procI].setTime(runTime.timeName(), runTime.timeIndex());
+ databases[procI].setTime(runTime);
}
// Read all meshes and addressing to reconstructed mesh
diff --git a/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C b/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C
index c5a01c0c0..c619b42aa 100644
--- a/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C
+++ b/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C
@@ -50,8 +50,8 @@ Description
int main(int argc, char *argv[])
{
- // enable -constant ... if someone really wants it
- // enable -zeroTime to prevent accidentally trashing the initial fields
+ // disable -constant
+ // enable -noZero to prevent accidentally trashing the initial fields
timeSelector::addOptions(false, true);
argList::noParallel();
# include "addRegionOption.H"
diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/foamToEnsightParts.C b/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/foamToEnsightParts.C
index db185e03b..d38f0016c 100644
--- a/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/foamToEnsightParts.C
+++ b/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/foamToEnsightParts.C
@@ -74,7 +74,7 @@ using namespace Foam;
int main(int argc, char *argv[])
{
// enable -constant
- // probably don't need -zeroTime though, since the fields are vetted
+ // probably don't need -noZero though, since the fields are vetted
// afterwards anyhow
timeSelector::addOptions(true, false);
argList::noParallel();
diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/CMakeLists.txt
index 18f46de99..b9679bbf7 100644
--- a/applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/CMakeLists.txt
+++ b/applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/CMakeLists.txt
@@ -22,12 +22,14 @@ LINK_DIRECTORIES(
INCLUDE_DIRECTORIES(
$ENV{WM_PROJECT_DIR}/src/OpenFOAM/lnInclude
+ $ENV{WM_PROJECT_DIR}/src/OSspecific/$ENV{WM_OSTYPE}/lnInclude
$ENV{WM_PROJECT_DIR}/src/finiteVolume/lnInclude
${PROJECT_SOURCE_DIR}/../vtkPV3Foam
)
ADD_DEFINITIONS(
-DWM_$ENV{WM_PRECISION_OPTION}
+ -DWM_LABEL_SIZE=$ENV{WM_LABEL_SIZE}
)
# Set output library destination to plugin folder
diff --git a/applications/utilities/postProcessing/graphics/PV4FoamReader/PV4FoamReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PV4FoamReader/PV4FoamReader/CMakeLists.txt
index e9054371f..b34f901da 100644
--- a/applications/utilities/postProcessing/graphics/PV4FoamReader/PV4FoamReader/CMakeLists.txt
+++ b/applications/utilities/postProcessing/graphics/PV4FoamReader/PV4FoamReader/CMakeLists.txt
@@ -22,12 +22,14 @@ LINK_DIRECTORIES(
INCLUDE_DIRECTORIES(
$ENV{WM_PROJECT_DIR}/src/foam/lnInclude
+ $ENV{WM_PROJECT_DIR}/src/OSspecific/$ENV{WM_OSTYPE}/lnInclude
$ENV{WM_PROJECT_DIR}/src/finiteVolume/lnInclude
${PROJECT_SOURCE_DIR}/../vtkPV4Foam
)
ADD_DEFINITIONS(
-DWM_$ENV{WM_PRECISION_OPTION}
+ -DWM_LABEL_SIZE=$ENV{WM_LABEL_SIZE}
)
# Set output library destination to plugin folder
diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/CMakeLists.txt
index 1c88efbbf..14e5d235a 100644
--- a/applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/CMakeLists.txt
+++ b/applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/CMakeLists.txt
@@ -18,11 +18,16 @@ SET(PVFoamReader_LIBS
INCLUDE_DIRECTORIES(
$ENV{WM_PROJECT_DIR}/src/OpenFOAM/lnInclude
+ $ENV{WM_PROJECT_DIR}/src/OSspecific/$ENV{WM_OSTYPE}/lnInclude
$ENV{WM_PROJECT_DIR}/src/finiteVolume/lnInclude
$ENV{ParaView_INST_DIR}/include
../vtkFoam/lnInclude
)
-ADD_DEFINITIONS(-DWM_$ENV{WM_PRECISION_OPTION})
+
+ADD_DEFINITIONS(
+ -DWM_$ENV{WM_PRECISION_OPTION}
+ -DWM_LABEL_SIZE=$ENV{WM_LABEL_SIZE}
+)
#-----------------------------------------------------------------------------
# Most users should not need to change anything below this line.
diff --git a/applications/utilities/postProcessing/multiSolver/multiSolver.C b/applications/utilities/postProcessing/multiSolver/multiSolver.C
index ed162a23a..88481bf71 100644
--- a/applications/utilities/postProcessing/multiSolver/multiSolver.C
+++ b/applications/utilities/postProcessing/multiSolver/multiSolver.C
@@ -55,7 +55,7 @@ void parseOptions
token nextOption(optionsStream);
// Bug workaround
- if (nextOption.type() == token::FATALERROR)
+ if (nextOption.type() == token::ERROR)
{
break;
}
@@ -89,7 +89,7 @@ void parseOptions
token nextOption(optionsStream);
// Bug workaround
- if (nextOption.type() == token::FATALERROR)
+ if (nextOption.type() == token::ERROR)
{
break;
}
diff --git a/applications/utilities/postProcessing/sampling/probeLocations/probeLocations.C b/applications/utilities/postProcessing/sampling/probeLocations/probeLocations.C
index 587cae97a..441c43871 100644
--- a/applications/utilities/postProcessing/sampling/probeLocations/probeLocations.C
+++ b/applications/utilities/postProcessing/sampling/probeLocations/probeLocations.C
@@ -49,7 +49,7 @@ int main(int argc, char *argv[])
(
probes::typeName,
mesh,
- "probesDict",
+ word("probesDict"),
IOobject::MUST_READ,
true
);
diff --git a/applications/utilities/postProcessing/sampling/sample/sample.C b/applications/utilities/postProcessing/sampling/sample/sample.C
index c0ce97c5a..0eeac119f 100644
--- a/applications/utilities/postProcessing/sampling/sample/sample.C
+++ b/applications/utilities/postProcessing/sampling/sample/sample.C
@@ -106,7 +106,7 @@ int main(int argc, char *argv[])
(
sampledSets::typeName,
mesh,
- "sampleDict",
+ word("sampleDict"),
IOobject::MUST_READ,
true
);
@@ -115,7 +115,7 @@ int main(int argc, char *argv[])
(
sampledSurfaces::typeName,
mesh,
- "sampleDict",
+ word("sampleDict"),
IOobject::MUST_READ,
true
);
diff --git a/etc/bashrc b/etc/bashrc
index 47ae6e22d..8e0ce4362 100755
--- a/etc/bashrc
+++ b/etc/bashrc
@@ -47,7 +47,7 @@ export FOAM_DEV=1
#
# Location of FOAM installation
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-foamInstall=$HOME/$WM_PROJECT
+foamInstall=$HOME/OpenFOAM
# foamInstall=~$WM_PROJECT
# foamInstall=/usr/local/$WM_PROJECT
# foamInstall=/opt/$WM_PROJECT
@@ -179,6 +179,9 @@ export WM_COMPILER_LIB_ARCH=
# WM_PRECISION_OPTION = LDP | DP | SP
: ${WM_PRECISION_OPTION:=DP}; export WM_PRECISION_OPTION
+# WM_LABEL_SIZE = 32 | 64
+: ${WM_LABEL_SIZE:=32}; export WM_LABEL_SIZE
+
# WM_COMPILE_OPTION = Opt | Debug | Prof
: ${WM_COMPILE_OPTION:=Opt}; export WM_COMPILE_OPTION
diff --git a/etc/codeTemplates/BC/BC.C b/etc/codeTemplates/BC/BC.C
new file mode 100644
index 000000000..918205766
--- /dev/null
+++ b/etc/codeTemplates/BC/BC.C
@@ -0,0 +1,240 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+\*---------------------------------------------------------------------------*/
+
+#include "CONSTRUCT.H"
+#include "addToRunTimeSelectionTable.H"
+#include "fvPatchFieldMapper.H"
+#include "volFields.H"
+#include "surfaceFields.H"
+
+// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
+
+template
+Foam::scalar Foam::CLASS::t() const
+{
+ return this->db().time().timeOutputValue();
+}
+
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+template
+Foam::CLASS::
+CONSTRUCT
+(
+ const fvPatch& p,
+ const DimensionedField& iF
+)
+:
+ PARENT(p, iF),
+ scalarData_(0.0),
+ data_(pTraits::zero),
+ fieldData_(p.size(), pTraits::zero),
+ timeVsData_(),
+ wordData_("wordDefault"),
+ labelData_(-1),
+ boolData_(false)
+{
+ this->refValue() = pTraits::zero;
+ this->refGrad() = pTraits::zero;
+ this->valueFraction() = 0.0;
+}
+
+
+template
+Foam::CLASS::
+CONSTRUCT
+(
+ const fvPatch& p,
+ const DimensionedField& iF,
+ const dictionary& dict
+)
+:
+ PARENT(p, iF),
+ scalarData_(readScalar(dict.lookup("scalarData"))),
+ data_(pTraits(dict.lookup("data"))),
+ fieldData_("fieldData", dict, p.size()),
+ timeVsData_(DataEntry::New("timeVsData", dict)),
+ wordData_(dict.lookupOrDefault("wordName", "wordDefault")),
+ labelData_(-1),
+ boolData_(false)
+{
+ this->refGrad() = pTraits::zero;
+ this->valueFraction() = 0.0;
+
+ this->refValue() = FIELD("fieldData", dict, p.size());
+ FVPATCHF::operator=(this->refValue());
+
+ PARENT::evaluate();
+
+ /*
+ //Initialise with the value entry if evaluation is not possible
+ FVPATCHF::operator=
+ (
+ FIELD("value", dict, p.size())
+ );
+ this->refValue() = *this;
+ */
+}
+
+
+template
+Foam::CLASS::
+CONSTRUCT
+(
+ const CLASS& ptf,
+ const fvPatch& p,
+ const DimensionedField& iF,
+ const fvPatchFieldMapper& mapper
+)
+:
+ PARENT(ptf, p, iF, mapper),
+ scalarData_(ptf.scalarData_),
+ data_(ptf.data_),
+ fieldData_(ptf.fieldData_, mapper),
+ timeVsData_(ptf.timeVsData_, false),
+ wordData_(ptf.wordData_),
+ labelData_(-1),
+ boolData_(ptf.boolData_)
+{}
+
+
+template
+Foam::CLASS::
+CONSTRUCT
+(
+ const CLASS& ptf
+)
+:
+ PARENT(ptf),
+ scalarData_(ptf.scalarData_),
+ data_(ptf.data_),
+ fieldData_(ptf.fieldData_),
+ timeVsData_(ptf.timeVsData_, false),
+ wordData_(ptf.wordData_),
+ labelData_(-1),
+ boolData_(ptf.boolData_)
+{}
+
+
+template
+Foam::CLASS::
+CONSTRUCT
+(
+ const CLASS& ptf,
+ const DimensionedField& iF
+)
+:
+ PARENT(ptf, iF),
+ scalarData_(ptf.scalarData_),
+ data_(ptf.data_),
+ fieldData_(ptf.fieldData_),
+ timeVsData_(ptf.timeVsData_, false),
+ wordData_(ptf.wordData_),
+ labelData_(-1),
+ boolData_(ptf.boolData_)
+{}
+
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+template
+void Foam::CLASS::autoMap
+(
+ const fvPatchFieldMapper& m
+)
+{
+ PARENT::autoMap(m);
+ fieldData_.autoMap(m);
+}
+
+
+template
+void Foam::CLASS::rmap
+(
+ const FVPATCHF& ptf,
+ const labelList& addr
+)
+{
+ PARENT::rmap(ptf, addr);
+
+ const CLASS& tiptf =
+ refCast(ptf);
+
+ fieldData_.rmap(tiptf.fieldData_, addr);
+}
+
+
+template
+void Foam::CLASS::updateCoeffs()
+{
+ if (this->updated())
+ {
+ return;
+ }
+
+ PARENT::operator==
+ (
+ data_
+ + fieldData_
+ + scalarData_*timeVsData_->value(t())
+ );
+
+ const scalarField& phip =
+ this->patch().template lookupPatchField("phi");
+ this->valueFraction() = 1.0 - pos(phip);
+
+ PARENT::updateCoeffs();
+}
+
+
+template
+void Foam::CLASS::write
+(
+ Ostream& os
+) const
+{
+ FVPATCHF::write(os);
+ os.writeKeyword("scalarData") << scalarData_ << token::END_STATEMENT << nl;
+ os.writeKeyword("data") << data_ << token::END_STATEMENT << nl;
+ fieldData_.writeEntry("fieldData", os);
+ timeVsData_->writeData(os);
+ os.writeKeyword("wordData") << wordData_ << token::END_STATEMENT << nl;
+ this->writeEntry("value", os);
+}
+
+
+// * * * * * * * * * * * * * * Build Macro Function * * * * * * * * * * * * //
+
+namespace Foam
+{
+ makePatchTypeField
+ (
+ FVPATCHF,
+ CLASS
+ );
+}
+
+// ************************************************************************* //
diff --git a/etc/codeTemplates/BC/BC.H b/etc/codeTemplates/BC/BC.H
new file mode 100644
index 000000000..f8906e6fd
--- /dev/null
+++ b/etc/codeTemplates/BC/BC.H
@@ -0,0 +1,246 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+Class
+ Foam::CONSTRUCT
+
+Group
+ grpGenericBoundaryConditions
+
+Description
+ This boundary condition provides a NAME condition,
+ calculated as:
+
+ \f[
+ Q = Q_{0} + Q_{p} + s*Q_{t}
+ \f]
+
+ where
+ \vartable
+ s | single scalar value [units]
+ Q_{0} | single TYPE value [units]
+ Q_{p} | TYPE field across patch [units]
+ Q_{t} | TYPE function of time [units]
+ \endtable
+
+ \heading Patch usage
+
+ \table
+ Property | Description | Req'd? | Default
+ scalarData | single scalar value | yes |
+ data | single TYPE value | yes |
+ fieldData | TYPE field across patch | yes |
+ timeVsData | TYPE function of time | yes |
+ wordData | word, eg name of data object | no | wordDefault
+ \endtable
+
+ Example of the boundary condition specification:
+ \verbatim
+ myPatch
+ {
+ type NAME;
+ scalarData -1;
+ data ONE;
+ fieldData uniform THREE;
+ timeVsData table (
+ (0 ZERO)
+ (1 TWO)
+ );
+ wordName anotherName;
+ value uniform FOUR; // optional initial value
+ }
+ \endverbatim
+
+SourceFiles
+ CONSTRUCT.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef CONSTRUCT_H
+#define CONSTRUCT_H
+
+#include "BASEFvPatchFields.H"
+#include "DataEntry.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+/*---------------------------------------------------------------------------*\
+ Class CONSTRUCT Declaration
+\*---------------------------------------------------------------------------*/
+
+template
+class CONSTRUCT
+:
+ public PARENT
+{
+ // Private data
+
+ //- Single valued scalar quantity, e.g. a coefficient
+ scalar scalarData_;
+
+ //- Single valued Type quantity, e.g. reference pressure pRefValue_
+ // Other options include vector, tensor
+ TYPE data_;
+
+ //- Field of Types, typically defined across patch faces
+ // e.g. total pressure p0_. Other options include vectorField
+ FIELD fieldData_;
+
+ //- Type specified as a function of time for time-varying BCs
+ autoPtr > timeVsData_;
+
+ //- Word entry, e.g. pName_ for name of the pressure field on database
+ word wordData_;
+
+ //- Label, e.g. patch index, current time index
+ label labelData_;
+
+ //- Boolean for true/false, e.g. specify if flow rate is volumetric_
+ bool boolData_;
+
+
+ // Private Member Functions
+
+ //- Return current time
+ scalar t() const;
+
+
+public:
+
+ //- Runtime type information
+ TypeName("NAME");
+
+
+ // Constructors
+
+ //- Construct from patch and internal field
+ CONSTRUCT
+ (
+ const fvPatch&,
+ const DimensionedField&
+ );
+
+ //- Construct from patch, internal field and dictionary
+ CONSTRUCT
+ (
+ const fvPatch&,
+ const DimensionedField&,
+ const dictionary&
+ );
+
+ //- Construct by mapping given BASETypeFvPatchField
+ // onto a new patch
+ CONSTRUCT
+ (
+ const CLASS&,
+ const fvPatch&,
+ const DimensionedField&,
+ const fvPatchFieldMapper&
+ );
+
+ //- Construct as copy
+ CONSTRUCT
+ (
+ const CLASS&
+ );
+
+ //- Construct and return a clone
+ virtual tmp clone() const
+ {
+ return tmp
+ (
+ new CLASS(*this)
+ );
+ }
+
+ //- Construct as copy setting internal field reference
+ CONSTRUCT
+ (
+ const CLASS&,
+ const DimensionedField&
+ );
+
+ //- Construct and return a clone setting internal field reference
+ virtual tmp clone
+ (
+ const DimensionedField& iF
+ ) const
+ {
+ return tmp
+ (
+ new CLASS
+ (
+ *this,
+ iF
+ )
+ );
+ }
+
+
+ // Member functions
+
+ // Mapping functions
+
+ //- Map (and resize as needed) from self given a mapping object
+ virtual void autoMap
+ (
+ const fvPatchFieldMapper&
+ );
+
+ //- Reverse map the given fvPatchField onto this fvPatchField
+ virtual void rmap
+ (
+ const FVPATCHF&,
+ const labelList&
+ );
+
+
+ // Evaluation functions
+
+ //- Update the coefficients associated with the patch field
+ virtual void updateCoeffs();
+
+
+ //- Write
+ virtual void write(Ostream&) const;
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#ifdef NoRepository
+# include "CONSTRUCT.C"
+#endif
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/sampling/sampledSurface/writers/dx/dxSurfaceWriterRunTime.C b/etc/codeTemplates/BC/BCs.C
similarity index 93%
rename from src/sampling/sampledSurface/writers/dx/dxSurfaceWriterRunTime.C
rename to etc/codeTemplates/BC/BCs.C
index 64380a317..ac5e5e8b2 100644
--- a/src/sampling/sampledSurface/writers/dx/dxSurfaceWriterRunTime.C
+++ b/etc/codeTemplates/BC/BCs.C
@@ -23,10 +23,9 @@ License
\*---------------------------------------------------------------------------*/
-#include "objectRegistry.H"
-#include "dxSurfaceWriter.H"
-#include "surfaceWriters.H"
+#include "CONSTRUCTs.H"
#include "addToRunTimeSelectionTable.H"
+#include "volFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -35,7 +34,7 @@ namespace Foam
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
-makeSurfaceWriters(dxSurfaceWriter);
+makePatchFields(NAME);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/sampling/sampledSurface/writers/raw/rawSurfaceWriterRunTime.C b/etc/codeTemplates/BC/BCs.H
similarity index 84%
rename from src/sampling/sampledSurface/writers/raw/rawSurfaceWriterRunTime.C
rename to etc/codeTemplates/BC/BCs.H
index bbe6e410b..7d6466fa5 100644
--- a/src/sampling/sampledSurface/writers/raw/rawSurfaceWriterRunTime.C
+++ b/etc/codeTemplates/BC/BCs.H
@@ -23,23 +23,27 @@ License
\*---------------------------------------------------------------------------*/
-#include "objectRegistry.H"
-#include "rawSurfaceWriter.H"
-#include "surfaceWriters.H"
-#include "addToRunTimeSelectionTable.H"
+#ifndef CONSTRUCTs_H
+#define CONSTRUCTs_H
+
+#include "CONSTRUCT.H"
+#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
-// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-makeSurfaceWriterType(rawSurfaceWriter, bool);
-makeSurfaceWriters(rawSurfaceWriter);
+makePatchTypeFieldTypedefs(NAME);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
// ************************************************************************* //
diff --git a/src/sampling/sampledSurface/writers/null/nullSurfaceWriterRunTime.C b/etc/codeTemplates/BC/BCsFwd.H
similarity index 83%
rename from src/sampling/sampledSurface/writers/null/nullSurfaceWriterRunTime.C
rename to etc/codeTemplates/BC/BCsFwd.H
index 47abcf259..33690cbcf 100644
--- a/src/sampling/sampledSurface/writers/null/nullSurfaceWriterRunTime.C
+++ b/etc/codeTemplates/BC/BCsFwd.H
@@ -23,23 +23,28 @@ License
\*---------------------------------------------------------------------------*/
-#include "objectRegistry.H"
-#include "nullSurfaceWriter.H"
-#include "surfaceWriters.H"
-#include "addToRunTimeSelectionTable.H"
+#ifndef CONSTRUCTsFwd_H
+#define CONSTRUCTsFwd_H
+
+#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
-// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-makeSurfaceWriterType(nullSurfaceWriter, bool);
-makeSurfaceWriters(nullSurfaceWriter);
+template class CONSTRUCT;
+
+makePatchTypeFieldTypedefs(NAME);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
// ************************************************************************* //
diff --git a/etc/codeTemplates/BC/Make/files b/etc/codeTemplates/BC/Make/files
new file mode 100644
index 000000000..bf5c6588a
--- /dev/null
+++ b/etc/codeTemplates/BC/Make/files
@@ -0,0 +1,3 @@
+COMPILED.C
+
+LIB = $(FOAM_USER_LIBBIN)/libNAME
diff --git a/etc/codeTemplates/BC/Make/options b/etc/codeTemplates/BC/Make/options
new file mode 100644
index 000000000..a3ae8da83
--- /dev/null
+++ b/etc/codeTemplates/BC/Make/options
@@ -0,0 +1,7 @@
+EXE_INC = \
+ -I$(LIB_SRC)/finiteVolume/lnInclude \
+ -I$(LIB_SRC)/meshTools/lnInclude
+
+LIB_LIBS = \
+ -lfiniteVolume \
+ -lmeshTools
diff --git a/etc/codeTemplates/app/Make/files b/etc/codeTemplates/app/Make/files
new file mode 100644
index 000000000..bfe94ae06
--- /dev/null
+++ b/etc/codeTemplates/app/Make/files
@@ -0,0 +1,3 @@
+NAME.C
+
+EXE = $(FOAM_USER_APPBIN)/NAME
diff --git a/etc/codeTemplates/app/Make/options b/etc/codeTemplates/app/Make/options
new file mode 100644
index 000000000..d27c95d03
--- /dev/null
+++ b/etc/codeTemplates/app/Make/options
@@ -0,0 +1,7 @@
+EXE_INC = \
+ -I$(LIB_SRC)/finiteVolume/lnInclude \
+ -I$(LIB_SRC)/meshTools/lnInclude
+
+EXE_LIBS = \
+ -lfiniteVolume \
+ -lmeshTools
diff --git a/etc/codeTemplates/app/app.C b/etc/codeTemplates/app/app.C
new file mode 100644
index 000000000..85722a69b
--- /dev/null
+++ b/etc/codeTemplates/app/app.C
@@ -0,0 +1,52 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+Application
+ NAME
+
+Description
+
+\*---------------------------------------------------------------------------*/
+
+#include "fvCFD.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+int main(int argc, char *argv[])
+{
+ #include "setRootCase.H"
+ #include "createTime.H"
+
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+ Info<< nl << "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
+ << " ClockTime = " << runTime.elapsedClockTime() << " s"
+ << nl << endl;
+
+ Info<< "End\n" << endl;
+
+ return 0;
+}
+
+
+// ************************************************************************* //
diff --git a/etc/codeTemplates/dynamicCode/FilterFunctionObjectTemplate.C b/etc/codeTemplates/dynamicCode/FilterFunctionObjectTemplate.C
new file mode 100644
index 000000000..f1df6147e
--- /dev/null
+++ b/etc/codeTemplates/dynamicCode/FilterFunctionObjectTemplate.C
@@ -0,0 +1,65 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+\*---------------------------------------------------------------------------*/
+
+#include "FilterFunctionObjectTemplate.H"
+
+// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
+
+extern "C"
+{
+ // dynamicCode:
+ // SHA1 = ${SHA1sum}
+ //
+ // unique function name that can be checked if the correct library version
+ // has been loaded
+ void ${typeName}_${SHA1sum}(bool load)
+ {
+ if (load)
+ {
+ // code that can be explicitly executed after loading
+ }
+ else
+ {
+ // code that can be explicitly executed before unloading
+ }
+ }
+}
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+namespace Foam
+{
+ defineNamedTemplateTypeNameAndDebug(${typeName}FilterFunctionObject, 0);
+
+ //addToRunTimeSelectionTable
+ addToRunTimeSelectionTable
+ (
+ functionObject,
+ ${typeName}FilterFunctionObject,
+ dictionary
+ );
+}
+
+// ************************************************************************* //
diff --git a/etc/codeTemplates/dynamicCode/FilterFunctionObjectTemplate.H b/etc/codeTemplates/dynamicCode/FilterFunctionObjectTemplate.H
new file mode 100644
index 000000000..b048d2782
--- /dev/null
+++ b/etc/codeTemplates/dynamicCode/FilterFunctionObjectTemplate.H
@@ -0,0 +1,51 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+Description
+ FunctionObject wrapper around functionObjectTemplate to allow them
+ to be created via the functions entry within controlDict.
+
+SourceFiles
+ FilterFunctionObject.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef FilterFunctionObject_H
+#define FilterFunctionObject_H
+
+#include "functionObjectTemplate.H"
+#include "OutputFilterFunctionObject.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+ typedef OutputFilterFunctionObject<${typeName}FunctionObject>
+ ${typeName}FilterFunctionObject;
+}
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/etc/codeTemplates/dynamicCode/IOfunctionObjectTemplate.H b/etc/codeTemplates/dynamicCode/IOfunctionObjectTemplate.H
new file mode 100644
index 000000000..5c7c5f7a0
--- /dev/null
+++ b/etc/codeTemplates/dynamicCode/IOfunctionObjectTemplate.H
@@ -0,0 +1,50 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+Typedef
+ Foam::IOfunctionObjectTemplate
+
+Description
+ Instance of the generic IOOutputFilter for ${typeName}FunctionObject.
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef IOfunctionObjectTemplate_H
+#define IOfunctionObjectTemplate_H
+
+#include "functionObjectTemplate.H"
+#include "IOOutputFilter.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+ typedef IOOutputFilter<${typeName}FunctionObject>
+ IO${typeName}FunctionObject;
+}
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/foam/primitives/ints/ulong/ulong.H b/etc/codeTemplates/dynamicCode/codeStreamTemplate.C
similarity index 72%
rename from src/foam/primitives/ints/ulong/ulong.H
rename to etc/codeTemplates/dynamicCode/codeStreamTemplate.C
index 3081d39c2..e0b7eb6e9 100644
--- a/src/foam/primitives/ints/ulong/ulong.H
+++ b/etc/codeTemplates/dynamicCode/codeStreamTemplate.C
@@ -21,47 +21,51 @@ License
You should have received a copy of the GNU General Public License
along with foam-extend. If not, see .
-Primitive
- ulong
-
Description
- System unsigned long
-
-SourceFiles
- ulongIO.C
+ Template for use with codeStream.
\*---------------------------------------------------------------------------*/
-#ifndef ulong_H
-#define ulong_H
+#include "dictionary.H"
+#include "Ostream.H"
+#include "Pstream.H"
+#include "unitConversion.H"
-#include "word.H"
+//{{{ begin codeInclude
+${codeInclude}
+//}}} end codeInclude
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
-class Istream;
-class Ostream;
+// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+//{{{ begin localCode
+${localCode}
+//}}} end localCode
-//- Return a string representation of a ulong
-word name(const unsigned long);
-// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
+// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
+
+extern "C"
+{
+ void ${typeName}
+ (
+ Ostream& os,
+ const dictionary& dict
+ )
+ {
+//{{{ begin code
+ ${code}
+//}}} end code
+ }
+}
-unsigned long readUlong(Istream&);
-Istream& operator>>(Istream&, unsigned long&);
-Ostream& operator<<(Ostream&, const unsigned long);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-#endif
-
// ************************************************************************* //
diff --git a/etc/codeTemplates/dynamicCode/codedFvOptionTemplate.C b/etc/codeTemplates/dynamicCode/codedFvOptionTemplate.C
new file mode 100644
index 000000000..3f2a6a4a2
--- /dev/null
+++ b/etc/codeTemplates/dynamicCode/codedFvOptionTemplate.C
@@ -0,0 +1,204 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+\*---------------------------------------------------------------------------*/
+
+#include "codedFvOptionTemplate.H"
+#include "addToRunTimeSelectionTable.H"
+#include "fvPatchFieldMapper.H"
+#include "volFields.H"
+#include "surfaceFields.H"
+#include "unitConversion.H"
+#include "fvMatrix.H"
+
+//{{{ begin codeInclude
+${codeInclude}
+//}}} end codeInclude
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+namespace fv
+{
+
+// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
+
+//{{{ begin localCode
+${localCode}
+//}}} end localCode
+
+
+// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
+
+extern "C"
+{
+ // dynamicCode:
+ // SHA1 = ${SHA1sum}
+ //
+ // unique function name that can be checked if the correct library version
+ // has been loaded
+ void ${typeName}_${SHA1sum}(bool load)
+ {
+ if (load)
+ {
+ // code that can be explicitly executed after loading
+ }
+ else
+ {
+ // code that can be explicitly executed before unloading
+ }
+ }
+}
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+//makeRemovablePatchTypeField
+//(
+// fvPatch${FieldType},
+// ${typeName}FvOption${SourceType}
+//);
+defineTypeNameAndDebug(${typeName}FvOption${SourceType}, 0);
+addToRunTimeSelectionTable
+(
+ option,
+ ${typeName}FvOption${SourceType},
+ dictionary
+);
+
+
+const char* const ${typeName}FvOption${SourceType}::SHA1sum =
+ "${SHA1sum}";
+
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+${typeName}FvOption${SourceType}::
+${typeName}FvOption${SourceType}
+(
+ const word& name,
+ const word& modelType,
+ const dictionary& dict,
+ const fvMesh& mesh
+)
+:
+ option(name, modelType, dict, mesh)
+{
+ if (${verbose:-false})
+ {
+ Info<<"construct ${typeName} sha1: ${SHA1sum}"
+ " from components\n";
+ }
+}
+
+
+// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
+
+${typeName}FvOption${SourceType}::
+~${typeName}FvOption${SourceType}()
+{
+ if (${verbose:-false})
+ {
+ Info<<"destroy ${typeName} sha1: ${SHA1sum}\n";
+ }
+}
+
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+void ${typeName}FvOption${SourceType}::correct
+(
+ GeometricField<${TemplateType}, fvPatchField, volMesh>& fld
+)
+{
+ if (${verbose:-false})
+ {
+ Info<<"${typeName}FvOption${SourceType}::correct()\n";
+ }
+
+//{{{ begin code
+ ${codeCorrect}
+//}}} end code
+}
+
+
+void ${typeName}FvOption${SourceType}::addSup
+(
+ fvMatrix<${TemplateType}>& eqn,
+ const label fieldI
+)
+{
+ if (${verbose:-false})
+ {
+ Info<<"${typeName}FvOption${SourceType}::addSup()\n";
+ }
+
+//{{{ begin code
+ ${codeAddSup}
+//}}} end code
+}
+
+
+void ${typeName}FvOption${SourceType}::addSup
+(
+ const volScalarField& rho,
+ fvMatrix<${TemplateType}>& eqn,
+ const label fieldI
+)
+{
+ if (${verbose:-false})
+ {
+ Info<<"${typeName}FvOption${SourceType}::addSup()\n";
+ }
+
+//{{{ begin code
+ ${codeAddSup}
+//}}} end code
+}
+
+
+void ${typeName}FvOption${SourceType}::setValue
+(
+ fvMatrix<${TemplateType}>& eqn,
+ const label fieldI
+)
+{
+ if (${verbose:-false})
+ {
+ Info<<"${typeName}FvOption${SourceType}::setValue()\n";
+ }
+
+//{{{ begin code
+ ${codeSetValue}
+//}}} end code
+}
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+} // End namespace fv
+// ************************************************************************* //
diff --git a/etc/codeTemplates/dynamicCode/codedFvOptionTemplate.H b/etc/codeTemplates/dynamicCode/codedFvOptionTemplate.H
new file mode 100644
index 000000000..bb4482f84
--- /dev/null
+++ b/etc/codeTemplates/dynamicCode/codedFvOptionTemplate.H
@@ -0,0 +1,193 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+Description
+ Template for use with dynamic code generation of a source.
+ The hook functions take the following arguments:
+
+ codeCorrect
+ (
+ GeometricField& fld
+ )
+
+ codeAddSup
+ (
+ fvMatrix& eqn,
+ const label fieldI
+ )
+
+ setValue
+ (
+ fvMatrix& eqn,
+ const label fieldI
+ )
+
+ where :
+ fld is the field in fieldNames
+ eqn is the fvMatrix
+
+ energySource
+ {
+ type scalarCodedSource;
+
+ active true;
+ selectionMode all;
+
+ scalarCodedSourceCoeffs
+ {
+ fieldNames (h);
+ redirectType sourceTime;
+
+ codeInclude
+ #{
+
+ #};
+
+ codeCorrect
+ #{
+ Pout<< "**codeCorrect**" << endl;
+ #};
+
+ codeAddSup
+ #{
+ const Time& time = mesh().time();
+ const scalarField& V = mesh_.V();
+ scalarField& heSource = eqn.source();
+ heSource -= 0.1*sqr(time.value())*V;
+ #};
+
+ codeSetValue
+ #{
+ Pout<< "**codeSetValue**" << endl;
+ #};
+
+ // Dummy entry. Make dependent on above to trigger recompilation
+ code
+ #{
+ $codeInclude
+ $codeCorrect
+ $codeAddSup
+ $codeSetValue
+ #};
+ }
+
+ sourceTimeCoeffs
+ {
+ // Dummy entry
+ }
+ }
+
+SourceFiles
+ codedFvOptionTemplate.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef codedFvOptionTemplate_H
+#define codedFvOptionTemplate_H
+
+#include "fvOption.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+namespace fv
+{
+
+/*---------------------------------------------------------------------------*\
+ A templated CodedFvOption
+\*---------------------------------------------------------------------------*/
+
+class ${typeName}FvOption${SourceType}
+:
+ public option
+{
+public:
+
+ //- Information about the SHA1 of the code itself
+ static const char* const SHA1sum;
+
+ //- Runtime type information
+ TypeName("${typeName}");
+
+
+ // Constructors
+
+ //- Construct from patch and internal field
+ ${typeName}FvOption${SourceType}
+ (
+ const word& name,
+ const word& modelType,
+ const dictionary& dict,
+ const fvMesh& mesh
+ );
+
+ //- Destructor
+ virtual ~${typeName}FvOption${SourceType}();
+
+
+ // Member functions
+
+ //- Correct field
+ virtual void correct
+ (
+ GeometricField<${TemplateType}, fvPatchField, volMesh>&
+ );
+
+ //- Explicit and implicit matrix contributions
+ virtual void addSup
+ (
+ fvMatrix<${TemplateType}>& eqn,
+ const label fieldI
+ );
+
+ //- Explicit and implicit matrix contributions for compressible
+ // equations
+ virtual void addSup
+ (
+ const volScalarField& rho,
+ fvMatrix<${TemplateType}>& eqn,
+ const label fieldI
+ );
+
+ //- Set value
+ virtual void setValue
+ (
+ fvMatrix<${TemplateType}>& eqn,
+ const label fieldI
+ );
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+} // End namespace fv
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/etc/codeTemplates/dynamicCode/fixedValueFvPatchFieldTemplate.C b/etc/codeTemplates/dynamicCode/fixedValueFvPatchFieldTemplate.C
new file mode 100644
index 000000000..ace8bba6b
--- /dev/null
+++ b/etc/codeTemplates/dynamicCode/fixedValueFvPatchFieldTemplate.C
@@ -0,0 +1,211 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+\*---------------------------------------------------------------------------*/
+
+#include "fixedValueFvPatchFieldTemplate.H"
+#include "addToRunTimeSelectionTable.H"
+#include "fvPatchFieldMapper.H"
+#include "volFields.H"
+#include "surfaceFields.H"
+#include "unitConversion.H"
+//{{{ begin codeInclude
+${codeInclude}
+//}}} end codeInclude
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
+
+//{{{ begin localCode
+${localCode}
+//}}} end localCode
+
+
+// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
+
+extern "C"
+{
+ // dynamicCode:
+ // SHA1 = ${SHA1sum}
+ //
+ // unique function name that can be checked if the correct library version
+ // has been loaded
+ void ${typeName}_${SHA1sum}(bool load)
+ {
+ if (load)
+ {
+ // code that can be explicitly executed after loading
+ }
+ else
+ {
+ // code that can be explicitly executed before unloading
+ }
+ }
+}
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+makeRemovablePatchTypeField
+(
+ fvPatch${FieldType},
+ ${typeName}FixedValueFvPatch${FieldType}
+);
+
+
+const char* const ${typeName}FixedValueFvPatch${FieldType}::SHA1sum =
+ "${SHA1sum}";
+
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+${typeName}FixedValueFvPatch${FieldType}::
+${typeName}FixedValueFvPatch${FieldType}
+(
+ const fvPatch& p,
+ const DimensionedField<${TemplateType}, volMesh>& iF
+)
+:
+ fixedValueFvPatchField<${TemplateType}>(p, iF)
+{
+ if (${verbose:-false})
+ {
+ Info<<"construct ${typeName} sha1: ${SHA1sum}"
+ " from patch/DimensionedField\n";
+ }
+}
+
+
+${typeName}FixedValueFvPatch${FieldType}::
+${typeName}FixedValueFvPatch${FieldType}
+(
+ const ${typeName}FixedValueFvPatch${FieldType}& ptf,
+ const fvPatch& p,
+ const DimensionedField<${TemplateType}, volMesh>& iF,
+ const fvPatchFieldMapper& mapper
+)
+:
+ fixedValueFvPatchField<${TemplateType}>(ptf, p, iF, mapper)
+{
+ if (${verbose:-false})
+ {
+ Info<<"construct ${typeName} sha1: ${SHA1sum}"
+ " from patch/DimensionedField/mapper\n";
+ }
+}
+
+
+${typeName}FixedValueFvPatch${FieldType}::
+${typeName}FixedValueFvPatch${FieldType}
+(
+ const fvPatch& p,
+ const DimensionedField<${TemplateType}, volMesh>& iF,
+ const dictionary& dict
+)
+:
+ fixedValueFvPatchField<${TemplateType}>(p, iF, dict)
+{
+ if (${verbose:-false})
+ {
+ Info<<"construct ${typeName} sha1: ${SHA1sum}"
+ " from patch/dictionary\n";
+ }
+}
+
+
+${typeName}FixedValueFvPatch${FieldType}::
+${typeName}FixedValueFvPatch${FieldType}
+(
+ const ${typeName}FixedValueFvPatch${FieldType}& ptf
+)
+:
+ fixedValueFvPatchField<${TemplateType}>(ptf)
+{
+ if (${verbose:-false})
+ {
+ Info<<"construct ${typeName} sha1: ${SHA1sum}"
+ " as copy\n";
+ }
+}
+
+
+${typeName}FixedValueFvPatch${FieldType}::
+${typeName}FixedValueFvPatch${FieldType}
+(
+ const ${typeName}FixedValueFvPatch${FieldType}& ptf,
+ const DimensionedField<${TemplateType}, volMesh>& iF
+)
+:
+ fixedValueFvPatchField<${TemplateType}>(ptf, iF)
+{
+ if (${verbose:-false})
+ {
+ Info<<"construct ${typeName} sha1: ${SHA1sum} "
+ "as copy/DimensionedField\n";
+ }
+}
+
+
+// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
+
+${typeName}FixedValueFvPatch${FieldType}::
+~${typeName}FixedValueFvPatch${FieldType}()
+{
+ if (${verbose:-false})
+ {
+ Info<<"destroy ${typeName} sha1: ${SHA1sum}\n";
+ }
+}
+
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+void ${typeName}FixedValueFvPatch${FieldType}::updateCoeffs()
+{
+ if (this->updated())
+ {
+ return;
+ }
+
+ if (${verbose:-false})
+ {
+ Info<<"updateCoeffs ${typeName} sha1: ${SHA1sum}\n";
+ }
+
+//{{{ begin code
+ ${code}
+//}}} end code
+
+ this->fixedValueFvPatchField<${TemplateType}>::updateCoeffs();
+}
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/etc/codeTemplates/dynamicCode/fixedValueFvPatchFieldTemplate.H b/etc/codeTemplates/dynamicCode/fixedValueFvPatchFieldTemplate.H
new file mode 100644
index 000000000..cd2efdbbe
--- /dev/null
+++ b/etc/codeTemplates/dynamicCode/fixedValueFvPatchFieldTemplate.H
@@ -0,0 +1,142 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+Description
+ Template for use with dynamic code generation of a
+ fixedValue fvPatchField.
+
+ - without state
+
+SourceFiles
+ fixedValueFvPatchFieldTemplate.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef fixedValueFvPatchTemplate${FieldType}_H
+#define fixedValueFvPatchTemplate${FieldType}_H
+
+#include "fixedValueFvPatchFields.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+/*---------------------------------------------------------------------------*\
+ A templated FixedValueFvPatch
+\*---------------------------------------------------------------------------*/
+
+class ${typeName}FixedValueFvPatch${FieldType}
+:
+ public fixedValueFvPatchField<${TemplateType}>
+{
+public:
+
+ //- Information about the SHA1 of the code itself
+ static const char* const SHA1sum;
+
+ //- Runtime type information
+ TypeName("${typeName}");
+
+
+ // Constructors
+
+ //- Construct from patch and internal field
+ ${typeName}FixedValueFvPatch${FieldType}
+ (
+ const fvPatch&,
+ const DimensionedField<${TemplateType}, volMesh>&
+ );
+
+ //- Construct from patch, internal field and dictionary
+ ${typeName}FixedValueFvPatch${FieldType}
+ (
+ const fvPatch&,
+ const DimensionedField<${TemplateType}, volMesh>&,
+ const dictionary&
+ );
+
+ //- Construct by mapping a copy onto a new patch
+ ${typeName}FixedValueFvPatch${FieldType}
+ (
+ const ${typeName}FixedValueFvPatch${FieldType}&,
+ const fvPatch&,
+ const DimensionedField<${TemplateType}, volMesh>&,
+ const fvPatchFieldMapper&
+ );
+
+ //- Construct as copy
+ ${typeName}FixedValueFvPatch${FieldType}
+ (
+ const ${typeName}FixedValueFvPatch${FieldType}&
+ );
+
+ //- Construct and return a clone
+ virtual tmp< fvPatch${FieldType} > clone() const
+ {
+ return tmp< fvPatch${FieldType} >
+ (
+ new ${typeName}FixedValueFvPatch${FieldType}(*this)
+ );
+ }
+
+ //- Construct as copy setting internal field reference
+ ${typeName}FixedValueFvPatch${FieldType}
+ (
+ const ${typeName}FixedValueFvPatch${FieldType}&,
+ const DimensionedField<${TemplateType}, volMesh>&
+ );
+
+ //- Construct and return a clone setting internal field reference
+ virtual tmp< fvPatch${FieldType} > clone
+ (
+ const DimensionedField<${TemplateType}, volMesh>& iF
+ ) const
+ {
+ return tmp< fvPatch${FieldType} >
+ (
+ new ${typeName}FixedValueFvPatch${FieldType}(*this, iF)
+ );
+ }
+
+
+ //- Destructor
+ virtual ~${typeName}FixedValueFvPatch${FieldType}();
+
+
+ // Member functions
+
+ //- Update the coefficients associated with the patch field
+ virtual void updateCoeffs();
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/etc/codeTemplates/dynamicCode/fixedValuePointPatchFieldTemplate.C b/etc/codeTemplates/dynamicCode/fixedValuePointPatchFieldTemplate.C
new file mode 100644
index 000000000..39b025d2b
--- /dev/null
+++ b/etc/codeTemplates/dynamicCode/fixedValuePointPatchFieldTemplate.C
@@ -0,0 +1,211 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+\*---------------------------------------------------------------------------*/
+
+#include "fixedValuePointPatchFieldTemplate.H"
+#include "addToRunTimeSelectionTable.H"
+#include "pointPatchFieldMapper.H"
+#include "pointFields.H"
+#include "unitConversion.H"
+//{{{ begin codeInclude
+${codeInclude}
+//}}} end codeInclude
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
+
+//{{{ begin localCode
+${localCode}
+//}}} end localCode
+
+
+// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
+
+extern "C"
+{
+ // dynamicCode:
+ // SHA1 = ${SHA1sum}
+ //
+ // unique function name that can be checked if the correct library version
+ // has been loaded
+ void ${typeName}_${SHA1sum}(bool load)
+ {
+ if (load)
+ {
+ // code that can be explicitly executed after loading
+ }
+ else
+ {
+ // code that can be explicitly executed before unloading
+ }
+ }
+}
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+makePointPatchTypeField
+(
+ pointPatch${FieldType},
+ ${typeName}FixedValuePointPatch${FieldType}
+);
+
+
+const char* const ${typeName}FixedValuePointPatch${FieldType}::SHA1sum =
+ "${SHA1sum}";
+
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+${typeName}FixedValuePointPatch${FieldType}::
+${typeName}FixedValuePointPatch${FieldType}
+(
+ const pointPatch& p,
+ const DimensionedField<${TemplateType}, pointMesh>& iF
+)
+:
+ fixedValuePointPatchField<${TemplateType}>(p, iF)
+{
+ if (${verbose:-false})
+ {
+ Info<<"construct ${typeName} sha1: ${SHA1sum}"
+ " from patch/DimensionedField\n";
+ }
+}
+
+
+${typeName}FixedValuePointPatch${FieldType}::
+${typeName}FixedValuePointPatch${FieldType}
+(
+ const ${typeName}FixedValuePointPatch${FieldType}& ptf,
+ const pointPatch& p,
+ const DimensionedField<${TemplateType}, pointMesh>& iF,
+ const pointPatchFieldMapper& mapper
+)
+:
+ fixedValuePointPatchField<${TemplateType}>(ptf, p, iF, mapper)
+{
+ if (${verbose:-false})
+ {
+ Info<<"construct ${typeName} sha1: ${SHA1sum}"
+ " from patch/DimensionedField/mapper\n";
+ }
+}
+
+
+${typeName}FixedValuePointPatch${FieldType}::
+${typeName}FixedValuePointPatch${FieldType}
+(
+ const pointPatch& p,
+ const DimensionedField<${TemplateType}, pointMesh>& iF,
+ const dictionary& dict,
+ const bool valueRequired
+)
+:
+ fixedValuePointPatchField<${TemplateType}>(p, iF, dict, valueRequired)
+{
+ if (${verbose:-false})
+ {
+ Info<<"construct ${typeName} sha1: ${SHA1sum}"
+ " from patch/dictionary\n";
+ }
+}
+
+
+${typeName}FixedValuePointPatch${FieldType}::
+${typeName}FixedValuePointPatch${FieldType}
+(
+ const ${typeName}FixedValuePointPatch${FieldType}& ptf
+)
+:
+ fixedValuePointPatchField<${TemplateType}>(ptf)
+{
+ if (${verbose:-false})
+ {
+ Info<<"construct ${typeName} sha1: ${SHA1sum}"
+ " as copy\n";
+ }
+}
+
+
+${typeName}FixedValuePointPatch${FieldType}::
+${typeName}FixedValuePointPatch${FieldType}
+(
+ const ${typeName}FixedValuePointPatch${FieldType}& ptf,
+ const DimensionedField<${TemplateType}, pointMesh>& iF
+)
+:
+ fixedValuePointPatchField<${TemplateType}>(ptf, iF)
+{
+ if (${verbose:-false})
+ {
+ Info<<"construct ${typeName} sha1: ${SHA1sum} "
+ "as copy/DimensionedField\n";
+ }
+}
+
+
+// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
+
+${typeName}FixedValuePointPatch${FieldType}::
+~${typeName}FixedValuePointPatch${FieldType}()
+{
+ if (${verbose:-false})
+ {
+ Info<<"destroy ${typeName} sha1: ${SHA1sum}\n";
+ }
+}
+
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+void ${typeName}FixedValuePointPatch${FieldType}::updateCoeffs()
+{
+ if (this->updated())
+ {
+ return;
+ }
+
+ if (${verbose:-false})
+ {
+ Info<<"updateCoeffs ${typeName} sha1: ${SHA1sum}\n";
+ }
+
+//{{{ begin code
+ ${code}
+//}}} end code
+
+ this->fixedValuePointPatchField<${TemplateType}>::updateCoeffs();
+}
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/etc/codeTemplates/dynamicCode/fixedValuePointPatchFieldTemplate.H b/etc/codeTemplates/dynamicCode/fixedValuePointPatchFieldTemplate.H
new file mode 100644
index 000000000..35174e101
--- /dev/null
+++ b/etc/codeTemplates/dynamicCode/fixedValuePointPatchFieldTemplate.H
@@ -0,0 +1,143 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+Description
+ Template for use with dynamic code generation of a
+ fixedValue pointPatchField.
+
+ - without state
+
+SourceFiles
+ fixedValuePointPatchFieldTemplate.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef fixedValuePointPatchTemplate${FieldType}_H
+#define fixedValuePointPatchTemplate${FieldType}_H
+
+#include "fixedValuePointPatchFields.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+/*---------------------------------------------------------------------------*\
+ A templated FixedValuePointPatchField
+\*---------------------------------------------------------------------------*/
+
+class ${typeName}FixedValuePointPatch${FieldType}
+:
+ public fixedValuePointPatchField<${TemplateType}>
+{
+public:
+
+ //- Information about the SHA1 of the code itself
+ static const char* const SHA1sum;
+
+ //- Runtime type information
+ TypeName("${typeName}");
+
+
+ // Constructors
+
+ //- Construct from patch and internal field
+ ${typeName}FixedValuePointPatch${FieldType}
+ (
+ const pointPatch&,
+ const DimensionedField<${TemplateType}, pointMesh>&
+ );
+
+ //- Construct from patch, internal field and dictionary
+ ${typeName}FixedValuePointPatch${FieldType}
+ (
+ const pointPatch&,
+ const DimensionedField<${TemplateType}, pointMesh>&,
+ const dictionary&,
+ const bool valueRequired=true
+ );
+
+ //- Construct by mapping a copy onto a new patch
+ ${typeName}FixedValuePointPatch${FieldType}
+ (
+ const ${typeName}FixedValuePointPatch${FieldType}&,
+ const pointPatch&,
+ const DimensionedField<${TemplateType}, pointMesh>&,
+ const pointPatchFieldMapper&
+ );
+
+ //- Construct as copy
+ ${typeName}FixedValuePointPatch${FieldType}
+ (
+ const ${typeName}FixedValuePointPatch${FieldType}&
+ );
+
+ //- Construct and return a clone
+ virtual autoPtr< pointPatchField<${TemplateType}> > clone() const
+ {
+ return autoPtr< pointPatchField<${TemplateType}> >
+ (
+ new ${typeName}FixedValuePointPatch${FieldType}(*this)
+ );
+ }
+
+ //- Construct as copy setting internal field reference
+ ${typeName}FixedValuePointPatch${FieldType}
+ (
+ const ${typeName}FixedValuePointPatch${FieldType}&,
+ const DimensionedField<${TemplateType}, pointMesh>&
+ );
+
+ //- Construct and return a clone setting internal field reference
+ virtual autoPtr< pointPatchField<${TemplateType}> > clone
+ (
+ const DimensionedField<${TemplateType}, pointMesh>& iF
+ ) const
+ {
+ return autoPtr< pointPatchField<${TemplateType}> >
+ (
+ new ${typeName}FixedValuePointPatch${FieldType}(*this, iF)
+ );
+ }
+
+
+ //- Destructor
+ virtual ~${typeName}FixedValuePointPatch${FieldType}();
+
+
+ // Member functions
+
+ //- Update the coefficients associated with the patch field
+ virtual void updateCoeffs();
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/etc/codeTemplates/dynamicCode/functionObjectTemplate.C b/etc/codeTemplates/dynamicCode/functionObjectTemplate.C
new file mode 100644
index 000000000..9d881b899
--- /dev/null
+++ b/etc/codeTemplates/dynamicCode/functionObjectTemplate.C
@@ -0,0 +1,157 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+\*---------------------------------------------------------------------------*/
+
+#include "functionObjectTemplate.H"
+#include "functionObject.H"
+#include "foamTime.H"
+#include "fvCFD.H"
+#include "unitConversion.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+defineTypeNameAndDebug(${typeName}FunctionObject, 0);
+
+
+// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
+
+//{{{ begin localCode
+${localCode}
+//}}} end localCode
+
+
+// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
+
+const objectRegistry& ${typeName}FunctionObject::obr() const
+{
+ return obr_;
+}
+
+
+const fvMesh& ${typeName}FunctionObject::mesh() const
+{
+ return refCast(obr_);
+}
+
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+${typeName}FunctionObject::${typeName}FunctionObject
+(
+ const word& name,
+ const objectRegistry& obr,
+ const dictionary& dict,
+ const bool
+)
+:
+ name_(name),
+ obr_(obr)
+{
+ read(dict);
+}
+
+
+// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
+
+${typeName}FunctionObject::~${typeName}FunctionObject()
+{}
+
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+void ${typeName}FunctionObject::read(const dictionary& dict)
+{
+ if (${verbose:-false})
+ {
+ Info<<"read ${typeName} sha1: ${SHA1sum}\n";
+ }
+
+//{{{ begin code
+ ${codeRead}
+//}}} end code
+}
+
+
+void ${typeName}FunctionObject::execute()
+{
+ if (${verbose:-false})
+ {
+ Info<<"execute ${typeName} sha1: ${SHA1sum}\n";
+ }
+
+//{{{ begin code
+ ${codeExecute}
+//}}} end code
+}
+
+
+void ${typeName}FunctionObject::end()
+{
+ if (${verbose:-false})
+ {
+ Info<<"end ${typeName} sha1: ${SHA1sum}\n";
+ }
+
+//{{{ begin code
+ ${codeEnd}
+//}}} end code
+}
+
+
+void ${typeName}FunctionObject::timeSet()
+{
+ if (${verbose:-false})
+ {
+ Info<<"timeSet ${typeName} sha1: ${SHA1sum}\n";
+ }
+
+//{{{ begin codeTime
+ ${codeTimeSet}
+//}}} end code
+}
+
+
+void ${typeName}FunctionObject::write()
+{
+ if (${verbose:-false})
+ {
+ Info<<"write ${typeName} sha1: ${SHA1sum}\n";
+ }
+
+//{{{ begin code
+ ${code}
+//}}} end code
+}
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+
+// ************************************************************************* //
diff --git a/etc/codeTemplates/dynamicCode/functionObjectTemplate.H b/etc/codeTemplates/dynamicCode/functionObjectTemplate.H
new file mode 100644
index 000000000..09fb75556
--- /dev/null
+++ b/etc/codeTemplates/dynamicCode/functionObjectTemplate.H
@@ -0,0 +1,151 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+Description
+ Template for use with dynamic code generation of a
+ OutputFilter functionObject.
+
+SourceFiles
+ functionObjectTemplate.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef functionObjectTemplate_H
+#define functionObjectTemplate_H
+
+#include "stringList.H"
+#include "pointField.H"
+
+//{{{ begin codeInclude
+${codeInclude}
+//}}} end codeInclude
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// Forward declaration of classes
+class objectRegistry;
+class dictionary;
+class polyMesh;
+class mapPolyMesh;
+class fvMesh;
+
+/*---------------------------------------------------------------------------*\
+ A templated functionObject
+\*---------------------------------------------------------------------------*/
+
+class ${typeName}FunctionObject
+{
+ // Private data
+
+ //- Name of this set of system calls
+ word name_;
+
+ //- Registry
+ const objectRegistry& obr_;
+
+//{{{ begin codeData
+ ${codeData}
+//}}} end codeData
+
+
+ // Private Member Functions
+
+ const objectRegistry& obr() const;
+
+ const fvMesh& mesh() const;
+
+ //- Disallow default bitwise copy construct
+ ${typeName}FunctionObject(const ${typeName}FunctionObject&);
+
+ //- Disallow default bitwise assignment
+ void operator=(const ${typeName}FunctionObject&);
+
+
+public:
+
+ //- Runtime type information
+ TypeName("${typeName}");
+
+
+ // Constructors
+
+ //- Construct for given objectRegistry and dictionary.
+ // Allow the possibility to load fields from files
+ ${typeName}FunctionObject
+ (
+ const word& name,
+ const objectRegistry& unused,
+ const dictionary&,
+ const bool loadFromFilesUnused = false
+ );
+
+
+ //- Destructor
+ virtual ~${typeName}FunctionObject();
+
+
+ // Member Functions
+
+ //- Return name of the system call set
+ virtual const word& name() const
+ {
+ return name_;
+ }
+
+ //- Read the system calls
+ virtual void read(const dictionary&);
+
+ //- Execute the "executeCalls" at each time-step
+ virtual void execute();
+
+ //- Execute the "endCalls" at the final time-loop
+ virtual void end();
+
+ //- Write, execute the "writeCalls"
+ virtual void write();
+
+ //- Called when time was set at the end of the Time::operator++
+ virtual void timeSet();
+
+ //- Update for changes of mesh
+ virtual void updateMesh(const mapPolyMesh&)
+ {}
+
+ //- Update for changes of mesh
+ virtual void movePoints(const pointField&)
+ {}
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/etc/codeTemplates/dynamicCode/mixedFvPatchFieldTemplate.C b/etc/codeTemplates/dynamicCode/mixedFvPatchFieldTemplate.C
new file mode 100644
index 000000000..48a51671f
--- /dev/null
+++ b/etc/codeTemplates/dynamicCode/mixedFvPatchFieldTemplate.C
@@ -0,0 +1,211 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+\*---------------------------------------------------------------------------*/
+
+#include "mixedFvPatchFieldTemplate.H"
+#include "addToRunTimeSelectionTable.H"
+#include "fvPatchFieldMapper.H"
+#include "volFields.H"
+#include "surfaceFields.H"
+#include "unitConversion.H"
+//{{{ begin codeInclude
+${codeInclude}
+//}}} end codeInclude
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
+
+//{{{ begin localCode
+${localCode}
+//}}} end localCode
+
+
+// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
+
+extern "C"
+{
+ // dynamicCode:
+ // SHA1 = ${SHA1sum}
+ //
+ // unique function name that can be checked if the correct library version
+ // has been loaded
+ void ${typeName}_${SHA1sum}(bool load)
+ {
+ if (load)
+ {
+ // code that can be explicitly executed after loading
+ }
+ else
+ {
+ // code that can be explicitly executed before unloading
+ }
+ }
+}
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+makeRemovablePatchTypeField
+(
+ fvPatch${FieldType},
+ ${typeName}MixedValueFvPatch${FieldType}
+);
+
+
+const char* const ${typeName}MixedValueFvPatch${FieldType}::SHA1sum =
+ "${SHA1sum}";
+
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+${typeName}MixedValueFvPatch${FieldType}::
+${typeName}MixedValueFvPatch${FieldType}
+(
+ const fvPatch& p,
+ const DimensionedField<${TemplateType}, volMesh>& iF
+)
+:
+ mixedFvPatchField<${TemplateType}>(p, iF)
+{
+ if (${verbose:-false})
+ {
+ Info<<"construct ${typeName} sha1: ${SHA1sum}"
+ " from patch/DimensionedField\n";
+ }
+}
+
+
+${typeName}MixedValueFvPatch${FieldType}::
+${typeName}MixedValueFvPatch${FieldType}
+(
+ const ${typeName}MixedValueFvPatch${FieldType}& ptf,
+ const fvPatch& p,
+ const DimensionedField<${TemplateType}, volMesh>& iF,
+ const fvPatchFieldMapper& mapper
+)
+:
+ mixedFvPatchField<${TemplateType}>(ptf, p, iF, mapper)
+{
+ if (${verbose:-false})
+ {
+ Info<<"construct ${typeName} sha1: ${SHA1sum}"
+ " from patch/DimensionedField/mapper\n";
+ }
+}
+
+
+${typeName}MixedValueFvPatch${FieldType}::
+${typeName}MixedValueFvPatch${FieldType}
+(
+ const fvPatch& p,
+ const DimensionedField<${TemplateType}, volMesh>& iF,
+ const dictionary& dict
+)
+:
+ mixedFvPatchField<${TemplateType}>(p, iF, dict)
+{
+ if (${verbose:-false})
+ {
+ Info<<"construct ${typeName} sha1: ${SHA1sum}"
+ " from patch/dictionary\n";
+ }
+}
+
+
+${typeName}MixedValueFvPatch${FieldType}::
+${typeName}MixedValueFvPatch${FieldType}
+(
+ const ${typeName}MixedValueFvPatch${FieldType}& ptf
+)
+:
+ mixedFvPatchField<${TemplateType}>(ptf)
+{
+ if (${verbose:-false})
+ {
+ Info<<"construct ${typeName} sha1: ${SHA1sum}"
+ " as copy\n";
+ }
+}
+
+
+${typeName}MixedValueFvPatch${FieldType}::
+${typeName}MixedValueFvPatch${FieldType}
+(
+ const ${typeName}MixedValueFvPatch${FieldType}& ptf,
+ const DimensionedField<${TemplateType}, volMesh>& iF
+)
+:
+ mixedFvPatchField<${TemplateType}>(ptf, iF)
+{
+ if (${verbose:-false})
+ {
+ Info<<"construct ${typeName} sha1: ${SHA1sum} "
+ "as copy/DimensionedField\n";
+ }
+}
+
+
+// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
+
+${typeName}MixedValueFvPatch${FieldType}::
+~${typeName}MixedValueFvPatch${FieldType}()
+{
+ if (${verbose:-false})
+ {
+ Info<<"destroy ${typeName} sha1: ${SHA1sum}\n";
+ }
+}
+
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+void ${typeName}MixedValueFvPatch${FieldType}::updateCoeffs()
+{
+ if (this->updated())
+ {
+ return;
+ }
+
+ if (${verbose:-false})
+ {
+ Info<<"updateCoeffs ${typeName} sha1: ${SHA1sum}\n";
+ }
+
+//{{{ begin code
+ ${code}
+//}}} end code
+
+ this->mixedFvPatchField<${TemplateType}>::updateCoeffs();
+}
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/etc/codeTemplates/dynamicCode/mixedFvPatchFieldTemplate.H b/etc/codeTemplates/dynamicCode/mixedFvPatchFieldTemplate.H
new file mode 100644
index 000000000..494d33644
--- /dev/null
+++ b/etc/codeTemplates/dynamicCode/mixedFvPatchFieldTemplate.H
@@ -0,0 +1,142 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+Description
+ Template for use with dynamic code generation of a
+ mixed fvPatchField.
+
+ - without state
+
+SourceFiles
+ mixedFvPatchFieldTemplate.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef mixedFvPatchTemplate${FieldType}_H
+#define mixedFvPatchTemplate${FieldType}_H
+
+#include "mixedFvPatchFields.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+/*---------------------------------------------------------------------------*\
+ A templated MixedValueFvPatchField
+\*---------------------------------------------------------------------------*/
+
+class ${typeName}MixedValueFvPatch${FieldType}
+:
+ public mixedFvPatchField<${TemplateType}>
+{
+public:
+
+ //- Information about the SHA1 of the code itself
+ static const char* const SHA1sum;
+
+ //- Runtime type information
+ TypeName("${typeName}");
+
+
+ // Constructors
+
+ //- Construct from patch and internal field
+ ${typeName}MixedValueFvPatch${FieldType}
+ (
+ const fvPatch&,
+ const DimensionedField<${TemplateType}, volMesh>&
+ );
+
+ //- Construct from patch, internal field and dictionary
+ ${typeName}MixedValueFvPatch${FieldType}
+ (
+ const fvPatch&,
+ const DimensionedField<${TemplateType}, volMesh>&,
+ const dictionary&
+ );
+
+ //- Construct by mapping a copy onto a new patch
+ ${typeName}MixedValueFvPatch${FieldType}
+ (
+ const ${typeName}MixedValueFvPatch${FieldType}&,
+ const fvPatch&,
+ const DimensionedField<${TemplateType}, volMesh>&,
+ const fvPatchFieldMapper&
+ );
+
+ //- Construct as copy
+ ${typeName}MixedValueFvPatch${FieldType}
+ (
+ const ${typeName}MixedValueFvPatch${FieldType}&
+ );
+
+ //- Construct and return a clone
+ virtual tmp< fvPatch${FieldType} > clone() const
+ {
+ return tmp< fvPatch${FieldType} >
+ (
+ new ${typeName}MixedValueFvPatch${FieldType}(*this)
+ );
+ }
+
+ //- Construct as copy setting internal field reference
+ ${typeName}MixedValueFvPatch${FieldType}
+ (
+ const ${typeName}MixedValueFvPatch${FieldType}&,
+ const DimensionedField<${TemplateType}, volMesh>&
+ );
+
+ //- Construct and return a clone setting internal field reference
+ virtual tmp< fvPatch${FieldType} > clone
+ (
+ const DimensionedField<${TemplateType}, volMesh>& iF
+ ) const
+ {
+ return tmp< fvPatch${FieldType} >
+ (
+ new ${typeName}MixedValueFvPatch${FieldType}(*this, iF)
+ );
+ }
+
+
+ //- Destructor
+ virtual ~${typeName}MixedValueFvPatch${FieldType}();
+
+
+ // Member functions
+
+ //- Update the coefficients associated with the patch field
+ virtual void updateCoeffs();
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/etc/codeTemplates/foamCommentStyles b/etc/codeTemplates/foamCommentStyles
new file mode 100644
index 000000000..b55f2c237
--- /dev/null
+++ b/etc/codeTemplates/foamCommentStyles
@@ -0,0 +1,31 @@
+1234567890123456789012345678901234567890123456789012345678901234567890123456789
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+-------------------------------------------------------------------------------
+
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+// ************************************************************************* //
+
+// ------------------------------------------------------------------------- //
+
+// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
+
+// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
+
+// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
+
+// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
+
+// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
diff --git a/etc/codeTemplates/foamScript b/etc/codeTemplates/foamScript
new file mode 100755
index 000000000..49c427da7
--- /dev/null
+++ b/etc/codeTemplates/foamScript
@@ -0,0 +1,32 @@
+#!/bin/sh
+#------------------------------------------------------------------------------
+# ========= |
+# \\ / F ield | foam-extend: Open Source CFD
+# \\ / O peration | Version: 4.0
+# \\ / A nd | Web: http://www.foam-extend.org
+# \\/ M anipulation | For copyright notice see file Copyright
+#------------------------------------------------------------------------------
+# License
+# This file is part of foam-extend.
+#
+# foam-extend 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.
+#
+# foam-extend 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 foam-extend. If not, see .
+#
+# Script
+#
+#
+# Description
+#
+#------------------------------------------------------------------------------
+
+# ----------------------------------------------------------------- end-of-file
diff --git a/etc/codeTemplates/functionObject/FUNCTIONOBJECT.C b/etc/codeTemplates/functionObject/FUNCTIONOBJECT.C
new file mode 100644
index 000000000..61fc5e904
--- /dev/null
+++ b/etc/codeTemplates/functionObject/FUNCTIONOBJECT.C
@@ -0,0 +1,96 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+\*---------------------------------------------------------------------------*/
+
+#include "FUNCTIONOBJECT.H"
+#include "dictionary.H"
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+namespace Foam
+{
+defineTypeNameAndDebug(FUNCTIONOBJECT, 0);
+}
+
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+Foam::FUNCTIONOBJECT::FUNCTIONOBJECT
+(
+ const word& name,
+ const objectRegistry& obr,
+ const dictionary& dict,
+ const bool loadFromFiles
+)
+:
+ name_(name),
+ obr_(obr),
+ wordData_(dict.lookupOrDefault("wordData", "defaultWord")),
+ scalarData_(readScalar(dict.lookup("scalarData"))),
+ labelData_(readLabel(dict.lookup("labelData")))
+{
+ read(dict);
+}
+
+
+// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
+
+Foam::FUNCTIONOBJECT::~FUNCTIONOBJECT()
+{}
+
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+void Foam::FUNCTIONOBJECT::read(const dictionary& dict)
+{
+ dict.readIfPresent("wordData", wordData_);
+ dict.lookup("scalarData") >> scalarData_;
+ dict.lookup("labelData") >> labelData_;
+}
+
+
+void Foam::FUNCTIONOBJECT::execute()
+{
+ // Do nothing - only valid on write
+}
+
+
+void Foam::FUNCTIONOBJECT::end()
+{
+ // Do nothing - only valid on write
+}
+
+
+void Foam::FUNCTIONOBJECT::timeSet()
+{
+ // Do nothing - only valid on write
+}
+
+
+void Foam::FUNCTIONOBJECT::write()
+{
+}
+
+
+// ************************************************************************* //
diff --git a/etc/codeTemplates/functionObject/FUNCTIONOBJECT.H b/etc/codeTemplates/functionObject/FUNCTIONOBJECT.H
new file mode 100644
index 000000000..826815335
--- /dev/null
+++ b/etc/codeTemplates/functionObject/FUNCTIONOBJECT.H
@@ -0,0 +1,176 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+Class
+ Foam::FUNCTIONOBJECT
+
+Group
+
+Description
+ This function object...
+
+ Example of function object specification:
+ \verbatim
+ FUNCTIONOBJECT1
+ {
+ type FUNCTIONOBJECT;
+ functionObjectLibs ("libFUNCTIONOBJECTFunctionObject.so");
+ ...
+ wordData someWord;
+ scalarData 1.0;
+ labelData 1;
+ }
+ \endverbatim
+
+ \heading Function object usage
+ \table
+ Property | Description | Required | Default value
+ type | type name: FUNCTIONOBJECT | yes |
+ wordData | some word option... | no | defaultWord
+ scalarData | some scalar value... | yes |
+ labelData | some label value... | yes |
+ \endtable
+
+SourceFiles
+ FUNCTIONOBJECT.C
+ IOFUNCTIONOBJECT.H
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef FUNCTIONOBJECT_H
+#define FUNCTIONOBJECT_H
+
+#include "runTimeSelectionTables.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// Forward declaration of classes
+class objectRegistry;
+class dictionary;
+class polyMesh;
+class mapPolyMesh;
+
+/*---------------------------------------------------------------------------*\
+ Class FUNCTIONOBJECT Declaration
+\*---------------------------------------------------------------------------*/
+
+class FUNCTIONOBJECT
+{
+ // Private data
+
+ //- Name of this set of FUNCTIONOBJECT
+ word name_;
+
+ //- Refererence to Db
+ const objectRegistry& obr_;
+
+ // Read from dictionary
+
+ //- word
+ word wordData_;
+
+ //- scalar
+ scalar scalarData_;
+
+ //- label
+ label labelData_;
+
+
+ // Private Member Functions
+
+
+ //- Disallow default bitwise copy construct
+ FUNCTIONOBJECT(const FUNCTIONOBJECT&);
+
+ //- Disallow default bitwise assignment
+ void operator=(const FUNCTIONOBJECT&);
+
+
+public:
+
+ //- Runtime type information
+ TypeName("FUNCTIONOBJECT");
+
+
+ // Constructors
+
+ //- Construct for given objectRegistry and dictionary.
+ // Allow the possibility to load fields from files
+ FUNCTIONOBJECT
+ (
+ const word& name,
+ const objectRegistry&,
+ const dictionary&,
+ const bool loadFromFiles = false
+ );
+
+
+ //- Destructor
+ virtual ~FUNCTIONOBJECT();
+
+
+ // Member Functions
+
+ //- Return name of the FUNCTIONOBJECT
+ virtual const word& name() const
+ {
+ return name_;
+ }
+
+ //- Read the FUNCTIONOBJECT data
+ virtual void read(const dictionary&);
+
+ //- Execute, currently does nothing
+ virtual void execute();
+
+ //- Execute at the final time-loop, currently does nothing
+ virtual void end();
+
+ //- Called when time was set at the end of the Time::operator++
+ virtual void timeSet();
+
+ //- Write the FUNCTIONOBJECT
+ virtual void write();
+
+ //- Update for changes of mesh
+ virtual void updateMesh(const mapPolyMesh&)
+ {}
+
+ //- Update for changes of mesh
+ virtual void movePoints(const polyMesh&)
+ {}
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/etc/codeTemplates/functionObject/FUNCTIONOBJECTFunctionObject.C b/etc/codeTemplates/functionObject/FUNCTIONOBJECTFunctionObject.C
new file mode 100644
index 000000000..3fcaccb19
--- /dev/null
+++ b/etc/codeTemplates/functionObject/FUNCTIONOBJECTFunctionObject.C
@@ -0,0 +1,46 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+\*---------------------------------------------------------------------------*/
+
+#include "FUNCTIONOBJECTFunctionObject.H"
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+namespace Foam
+{
+ defineNamedTemplateTypeNameAndDebug
+ (
+ FUNCTIONOBJECTFunctionObject,
+ 0
+ );
+
+ addToRunTimeSelectionTable
+ (
+ functionObject,
+ FUNCTIONOBJECTFunctionObject,
+ dictionary
+ );
+}
+
+// ************************************************************************* //
diff --git a/etc/codeTemplates/functionObject/FUNCTIONOBJECTFunctionObject.H b/etc/codeTemplates/functionObject/FUNCTIONOBJECTFunctionObject.H
new file mode 100644
index 000000000..083783cec
--- /dev/null
+++ b/etc/codeTemplates/functionObject/FUNCTIONOBJECTFunctionObject.H
@@ -0,0 +1,54 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+Typedef
+ Foam::FUNCTIONOBJECTFunctionObject
+
+Description
+ FunctionObject wrapper around FUNCTIONOBJECT to allow them to be
+ created via the functions entry within controlDict.
+
+SourceFiles
+ FUNCTIONOBJECTFunctionObject.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef FUNCTIONOBJECTFunctionObject_H
+#define FUNCTIONOBJECTFunctionObject_H
+
+#include "FUNCTIONOBJECT.H"
+#include "OutputFilterFunctionObject.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+ typedef OutputFilterFunctionObject
+ FUNCTIONOBJECTFunctionObject;
+}
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/etc/codeTemplates/functionObject/IOFUNCTIONOBJECT.H b/etc/codeTemplates/functionObject/IOFUNCTIONOBJECT.H
new file mode 100644
index 000000000..9c6db88e0
--- /dev/null
+++ b/etc/codeTemplates/functionObject/IOFUNCTIONOBJECT.H
@@ -0,0 +1,49 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+Typedef
+ Foam::IOFUNCTIONOBJECT
+
+Description
+ Instance of the generic IOOutputFilter for FUNCTIONOBJECT.
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef IOFUNCTIONOBJECT_H
+#define IOFUNCTIONOBJECT_H
+
+#include "FUNCTIONOBJECT.H"
+#include "IOOutputFilter.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+ typedef IOOutputFilter IOFUNCTIONOBJECT;
+}
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/etc/codeTemplates/functionObject/Make/files b/etc/codeTemplates/functionObject/Make/files
new file mode 100644
index 000000000..73b995603
--- /dev/null
+++ b/etc/codeTemplates/functionObject/Make/files
@@ -0,0 +1,4 @@
+FUNCTIONOBJECT.C
+FUNCTIONOBJECTFunctionObject.C
+
+LIB = $(FOAM_USER_LIBBIN)/libFUNCTIONOBJECTFunctionObject
diff --git a/etc/codeTemplates/functionObject/Make/options b/etc/codeTemplates/functionObject/Make/options
new file mode 100644
index 000000000..a3ae8da83
--- /dev/null
+++ b/etc/codeTemplates/functionObject/Make/options
@@ -0,0 +1,7 @@
+EXE_INC = \
+ -I$(LIB_SRC)/finiteVolume/lnInclude \
+ -I$(LIB_SRC)/meshTools/lnInclude
+
+LIB_LIBS = \
+ -lfiniteVolume \
+ -lmeshTools
diff --git a/etc/codeTemplates/source/_Template.C b/etc/codeTemplates/source/_Template.C
new file mode 100644
index 000000000..d143f0562
--- /dev/null
+++ b/etc/codeTemplates/source/_Template.C
@@ -0,0 +1,102 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+\*---------------------------------------------------------------------------*/
+
+#include "CLASSNAME.H"
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+const dataType Foam::CLASSNAME::staticData();
+
+
+// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
+
+
+// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
+
+
+// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
+
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+Foam::CLASSNAME::CLASSNAME()
+:
+ baseClassName(),
+ data_()
+{}
+
+
+Foam::CLASSNAME::CLASSNAME(const dataType& data)
+:
+ baseClassName(),
+ data_(data)
+{}
+
+
+Foam::CLASSNAME::CLASSNAME(const CLASSNAME&)
+:
+ baseClassName(),
+ data_()
+{}
+
+
+// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
+
+Foam::autoPtr
+Foam::CLASSNAME::New()
+{
+ return autoPtr(new CLASSNAME);
+}
+
+
+// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
+
+Foam::CLASSNAME::~CLASSNAME()
+{}
+
+
+// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
+
+
+// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
+
+void Foam::CLASSNAME::operator=(const CLASSNAME& rhs)
+{
+ // Check for assignment to self
+ if (this == &rhs)
+ {
+ FatalErrorIn("Foam::CLASSNAME::operator=(const Foam::CLASSNAME&)")
+ << "Attempted assignment to self"
+ << abort(FatalError);
+ }
+}
+
+// * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * * //
+
+
+// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * //
+
+
+// ************************************************************************* //
diff --git a/src/foam/db/IOstreams/token/CompoundToken/CompoundToken.H b/etc/codeTemplates/source/_Template.H
similarity index 62%
rename from src/foam/db/IOstreams/token/CompoundToken/CompoundToken.H
rename to etc/codeTemplates/source/_Template.H
index bdd0f3dd0..088c2adf5 100644
--- a/src/foam/db/IOstreams/token/CompoundToken/CompoundToken.H
+++ b/etc/codeTemplates/source/_Template.H
@@ -22,86 +22,91 @@ License
along with foam-extend. If not, see .
Class
- Foam::CompoundToken
+ Foam::CLASSNAME
Description
- An abstract base class for managing compound tokens
+
+SourceFiles
+ CLASSNAMEI.H
+ CLASSNAME.C
+ CLASSNAMEIO.C
\*---------------------------------------------------------------------------*/
-#ifndef CompoundToken_H
-#define CompoundToken_H
+#ifndef CLASSNAME_H
+#define CLASSNAME_H
-#include "refCount.H"
-#include "typeInfo.H"
-#include "autoPtr.H"
-#include "runTimeSelectionTables.H"
+#include ".H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
-// Forward declaration of friend functions and operators
+// Forward declaration of classes
+class Istream;
+class Ostream;
-class CompoundToken;
-Ostream& operator<<(Ostream&, const CompoundToken&);
+// Forward declaration of friend functions and operators
+class CLASSNAME;
+Istream& operator>>(Istream&, CLASSNAME&);
+Ostream& operator<<(Ostream&, const CLASSNAME&);
/*---------------------------------------------------------------------------*\
- Class CompoundToken Declaration
+ Class CLASSNAME Declaration
\*---------------------------------------------------------------------------*/
-class CompoundToken
+class CLASSNAME
:
- public refCount
+ public baseClassName
{
+ // Private data
+
+ //- Description of data_
+ dataType data_;
+
+
// Private Member Functions
//- Disallow default bitwise copy construct
- CompoundToken(const CompoundToken&);
+ CLASSNAME(const CLASSNAME&);
//- Disallow default bitwise assignment
- void operator=(const CompoundToken&);
+ void operator=(const CLASSNAME&);
public:
- //- Runtime type information
- virtual const word& type() const = 0;
+ // Static data members
-
- // Declare run-time constructor selection tables
-
- declareRunTimeSelectionTable
- (
- autoPtr,
- CompoundToken,
- Istream,
- (const word& type, Istream& is),
- (type, is)
- );
+ //- Static data staticData
+ static const dataType staticData;
// Constructors
//- Construct null
- CompoundToken()
- {}
+ CLASSNAME();
- //- Return the clone as this and increment reference count
- virtual autoPtr clone() const = 0;
+ //- Construct from components
+ CLASSNAME(const dataType& data);
+
+ //- Construct from Istream
+ CLASSNAME(Istream&);
+
+ //- Construct as copy
+ CLASSNAME(const CLASSNAME&);
// Selectors
//- Select null constructed
- static autoPtr New(const word& type, Istream& is);
+ static autoPtr New();
- // Destructor
-
- virtual ~CompoundToken();
+ //- Destructor
+ ~CLASSNAME();
// Member Functions
@@ -114,12 +119,20 @@ public:
// Write
- virtual void write(Istream&) = 0;
+ // Member Operators
+
+ void operator=(const CLASSNAME&);
+
+
+ // Friend Functions
+
+ // Friend Operators
// IOstream Operators
- friend Ostream& operator<<(Ostream&, const CompoundToken&);
+ friend Istream& operator>>(Istream&, CLASSNAME&);
+ friend Ostream& operator<<(Ostream&, const CLASSNAME&);
};
@@ -129,6 +142,10 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+#include "CLASSNAMEI.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
#endif
// ************************************************************************* //
diff --git a/etc/codeTemplates/source/_TemplateApp.C b/etc/codeTemplates/source/_TemplateApp.C
new file mode 100644
index 000000000..65e484a09
--- /dev/null
+++ b/etc/codeTemplates/source/_TemplateApp.C
@@ -0,0 +1,48 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+Application
+ CLASSNAME
+
+Description
+
+\*---------------------------------------------------------------------------*/
+
+#include "fvCFD.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+// Main program:
+
+int main(int argc, char *argv[])
+{
+ #include "setRootCase.H"
+ #include "createTime.H"
+
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+ Info<< "\nEnd\n" << endl;
+ return 0;
+}
+
+
+// ************************************************************************* //
diff --git a/src/sampling/sampledSurface/writers/null/nullSurfaceWriter.C b/etc/codeTemplates/source/_TemplateI.H
similarity index 74%
rename from src/sampling/sampledSurface/writers/null/nullSurfaceWriter.C
rename to etc/codeTemplates/source/_TemplateI.H
index d3ff7f1cf..a4e6bf00c 100644
--- a/src/sampling/sampledSurface/writers/null/nullSurfaceWriter.C
+++ b/etc/codeTemplates/source/_TemplateI.H
@@ -23,40 +23,36 @@ License
\*---------------------------------------------------------------------------*/
-#include "nullSurfaceWriter.H"
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
-// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
-template
-Foam::nullSurfaceWriter::nullSurfaceWriter()
-:
- surfaceWriter()
-{}
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
-template
-Foam::nullSurfaceWriter::~nullSurfaceWriter()
-{}
-
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
-template
-void Foam::nullSurfaceWriter::write
-(
- const fileName& outputDir,
- const fileName& surfaceName,
- const pointField& points,
- const faceList& faces,
- const fileName& fieldName,
- const Field& values,
- const bool verbose
-) const
-{}
+
+// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
+
+
+// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
+
+
+// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
+
+
+// * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * * //
+
+
+// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //
diff --git a/etc/codeTemplates/source/_TemplateIO.C b/etc/codeTemplates/source/_TemplateIO.C
new file mode 100644
index 000000000..61aa2c71b
--- /dev/null
+++ b/etc/codeTemplates/source/_TemplateIO.C
@@ -0,0 +1,70 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+\*---------------------------------------------------------------------------*/
+
+#include "CLASSNAME.H"
+#include "IOstreams.H"
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+Foam::CLASSNAME::CLASSNAME(Istream& is)
+:
+ base1(is),
+ base2(is),
+ member1(is),
+ member2(is)
+{
+ // Check state of Istream
+ is.check("Foam::CLASSNAME::CLASSNAME(Foam::Istream&)");
+}
+
+
+// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
+
+Foam::Istream& Foam::operator>>(Istream& is, CLASSNAME&)
+{
+ // Check state of Istream
+ is.check
+ (
+ "Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::CLASSNAME&)"
+ );
+
+ return is;
+}
+
+
+Foam::Ostream& Foam::operator<<(Ostream& os, const CLASSNAME&)
+{
+ // Check state of Ostream
+ os.check
+ (
+ "Foam::Ostream& Foam::operator<<(Foam::Ostream&, "
+ "const Foam::CLASSNAME&)"
+ );
+
+ return os;
+}
+
+
+// ************************************************************************* //
diff --git a/etc/codeTemplates/source/foamNewSource b/etc/codeTemplates/source/foamNewSource
new file mode 100755
index 000000000..b0e33f24e
--- /dev/null
+++ b/etc/codeTemplates/source/foamNewSource
@@ -0,0 +1,115 @@
+#!/bin/sh
+#------------------------------------------------------------------------------
+# ========= |
+# \\ / F ield | foam-extend: Open Source CFD
+# \\ / O peration | Version: 4.0
+# \\ / A nd | Web: http://www.foam-extend.org
+# \\/ M anipulation | For copyright notice see file Copyright
+#-------------------------------------------------------------------------------
+# License
+# This file is part of foam-extend.
+#
+# foam-extend 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.
+#
+# foam-extend 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 foam-extend. If not, see .
+#
+# Script
+# foamNewSource
+#
+# Description
+# Create a new standard OpenFOAM source file
+#
+#------------------------------------------------------------------------------
+Script=${0##*/}
+Template="$WM_PROJECT_DIR/etc/codeTemplates/source/_Template"
+
+usage() {
+ while [ "$#" -ge 1 ]; do echo "$1"; shift; done
+ cat<
+options:
+ -help print the usage
+
+* create a new standard OpenFOAM source file
+
+type: (C|H|I|IO|App)
+
+A ClassName starting with '-' will simply display the template
+
+USAGE
+ exit 1
+}
+
+
+className="$2"
+unset subType Type printOpt
+
+# for a className starting with '-' simply display the code
+if [ "${2#-}" != "${2}" ]
+then
+ printOpt=true
+fi
+
+
+# this implicitly covers a lone -help
+[ "$#" -gt 1 ] || usage
+
+case "$1" in
+(-h | -help)
+ usage
+ ;;
+(C|H)
+ Type=".$1"
+ ;;
+(I)
+ Type="$1.H"
+ ;;
+(IO)
+ Type="$1.C"
+ ;;
+(app|App)
+ subType=App
+ Type=".C"
+ ;;
+(*)
+ usage "unknown type '$1'"
+ ;;
+esac
+
+[ "$#" -eq 2 ] || usage "wrong number of arguments"
+shift 2
+
+
+if [ "${printOpt:-false}" = true ]
+then
+ cat $Template$subType$Type
+else
+
+ fileName="$className$Type"
+
+ echo "$Script: Creating new interface file $fileName"
+ if [ -e "$fileName" ]
+ then
+ echo " Error: file exists"
+ exit 1
+ fi
+
+ # process class name
+ sed "s/CLASSNAME/$className/g" $Template$subType$Type > $fileName
+
+ if [ "$subType" = App -a ! -d Make ]
+ then
+ wmakeFilesAndOptions
+ fi
+fi
+
+#------------------------------------------------------------------------------
diff --git a/etc/codeTemplates/template/_TemplateTemplate.C b/etc/codeTemplates/template/_TemplateTemplate.C
new file mode 100644
index 000000000..086321407
--- /dev/null
+++ b/etc/codeTemplates/template/_TemplateTemplate.C
@@ -0,0 +1,122 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+\*---------------------------------------------------------------------------*/
+
+#include "CLASSNAME.H"
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+template
+const dataType Foam::CLASSNAME::staticData();
+
+
+// * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * //
+
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+template
+Foam::CLASSNAME::CLASSNAME()
+:
+ baseClassName(),
+ data_()
+{}
+
+
+template
+Foam::CLASSNAME::CLASSNAME(const dataType& data)
+:
+ baseClassName(),
+ data_(data)
+{}
+
+
+template
+Foam::CLASSNAME::CLASSNAME
+(
+ const CLASSNAME&
+)
+:
+ baseCLASSNAME(),
+ data_()
+{}
+
+
+// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
+
+template
+Foam::autoPtr >
+Foam::CLASSNAME::New()
+{
+ return autoPtr >
+ (
+ new CLASSNAME
+ );
+}
+
+
+// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
+
+template
+Foam::CLASSNAME::~CLASSNAME()
+{}
+
+
+// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
+
+
+// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
+
+
+// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
+
+
+// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
+
+template
+void Foam::CLASSNAME::operator=
+(
+ const CLASSNAME& rhs
+)
+{
+ // Check for assignment to self
+ if (this == &rhs)
+ {
+ FatalErrorIn
+ (
+ "Foam::CLASSNAME::operator="
+ "(const Foam::CLASSNAME&)"
+ ) << "Attempted assignment to self"
+ << abort(FatalError);
+ }
+}
+
+
+// * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * * //
+
+
+// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * //
+
+
+// ************************************************************************* //
diff --git a/etc/codeTemplates/template/_TemplateTemplate.H b/etc/codeTemplates/template/_TemplateTemplate.H
new file mode 100644
index 000000000..3410c6dd6
--- /dev/null
+++ b/etc/codeTemplates/template/_TemplateTemplate.H
@@ -0,0 +1,157 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+Class
+ Foam::CLASSNAME
+
+Description
+
+SourceFiles
+ CLASSNAMEI.H
+ CLASSNAME.C
+ CLASSNAMEIO.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef CLASSNAME_H
+#define CLASSNAME_H
+
+#include ".H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// Forward declaration of classes
+class someClass;
+
+
+// Forward declaration of friend functions and operators
+
+template
+class CLASSNAME;
+
+template
+Istream& operator>>(Istream&, CLASSNAME&);
+
+template
+Ostream& operator<<(Ostream&, const CLASSNAME&);
+
+
+/*---------------------------------------------------------------------------*\
+ Class CLASSNAME Declaration
+\*---------------------------------------------------------------------------*/
+
+template
+class CLASSNAME
+:
+ public baseClassName
+{
+ // Private data
+
+ dataType data_;
+
+
+ // Private Member Functions
+
+ //- Disallow default bitwise copy construct
+ CLASSNAME(const CLASSNAME&);
+
+ //- Disallow default bitwise assignment
+ void operator=(const CLASSNAME&);
+
+
+public:
+
+ // Static data members
+
+ //- Static data someStaticData
+ static const dataType staticData;
+
+
+ // Constructors
+
+ //- Construct null
+ CLASSNAME();
+
+ //- Construct from components
+ CLASSNAME(const dataType& data);
+
+ //- Construct from Istream
+ CLASSNAME(Istream&);
+
+ //- Construct as copy
+ CLASSNAME(const CLASSNAME&);
+
+
+ // Selectors
+
+ //- Select null constructed
+ static autoPtr > New();
+
+
+ //- Destructor
+ ~CLASSNAME();
+
+
+ // Member Functions
+
+ // Member Operators
+
+ void operator=(const CLASSNAME&);
+
+
+ // Friend Functions
+
+ // Friend Operators
+
+ // IOstream Operators
+
+ friend Istream& operator>>
+ (Istream&, CLASSNAME&);
+
+ friend Ostream& operator<<
+ (Ostream&, const CLASSNAME&);
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#include "CLASSNAMEI.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#ifdef NoRepository
+# include "CLASSNAME.C"
+#endif
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/foam/primitives/ints/longLong/longLong.H b/etc/codeTemplates/template/_TemplateTemplateI.H
similarity index 69%
rename from src/foam/primitives/ints/longLong/longLong.H
rename to etc/codeTemplates/template/_TemplateTemplateI.H
index a593ecb26..a4e6bf00c 100644
--- a/src/foam/primitives/ints/longLong/longLong.H
+++ b/etc/codeTemplates/template/_TemplateTemplateI.H
@@ -21,47 +21,38 @@ License
You should have received a copy of the GNU General Public License
along with foam-extend. If not, see .
-Primitive
- long long
-
-Description
- A long long (64 bits on many systems)
-
-SourceFiles
- longLongIO.C
-
\*---------------------------------------------------------------------------*/
-#ifndef longLong_H
-#define longLong_H
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
+
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+
+// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
+
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+
+// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
+
+
+// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
+
+
+// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
+
+
+// * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * * //
+
+
+// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
-#include "word.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-namespace Foam
-{
-
-class Istream;
-class Ostream;
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-//- Return a string representation of a long long
-word name(long long);
-
-// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
-
-long long readLongLong(Istream&);
-Istream& operator>>(Istream&, long long&);
-Ostream& operator<<(Ostream&, const long long);
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-} // End namespace Foam
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-#endif
// ************************************************************************* //
diff --git a/etc/codeTemplates/template/_TemplateTemplateIO.C b/etc/codeTemplates/template/_TemplateTemplateIO.C
new file mode 100644
index 000000000..fd5aaf94b
--- /dev/null
+++ b/etc/codeTemplates/template/_TemplateTemplateIO.C
@@ -0,0 +1,82 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+\*---------------------------------------------------------------------------*/
+
+#include "CLASSNAME.H"
+#include "IOstreams.H"
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+template
+Foam::CLASSNAME::CLASSNAME(Istream& is)
+:
+ base1(is),
+ base2(is),
+ member1(is),
+ member2(is)
+{
+ // Check state of Istream
+ is.check("Foam::CLASSNAME::CLASSNAME(Foam::Istream&)");
+}
+
+
+// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
+
+template
+Foam::Istream& Foam::operator>>
+(
+ Istream& is,
+ CLASSNAME&
+)
+{
+ // Check state of Istream
+ is.check
+ (
+ "Foam::Istream& Foam::operator>>"
+ "(Foam::Istream&, Foam::CLASSNAME&)"
+ );
+
+ return is;
+}
+
+
+template
+Foam::Ostream& Foam::operator<<
+(
+ Ostream& os,
+ const CLASSNAME&
+)
+{
+ // Check state of Ostream
+ os.check
+ (
+ "Foam::Ostream& Foam::operator<<"
+ "(Ostream&, const CLASSNAME&)"
+ );
+
+ return os;
+}
+
+
+// ************************************************************************* //
diff --git a/etc/codeTemplates/template/foamNewTemplate b/etc/codeTemplates/template/foamNewTemplate
new file mode 100755
index 000000000..f5e5e1891
--- /dev/null
+++ b/etc/codeTemplates/template/foamNewTemplate
@@ -0,0 +1,130 @@
+#!/bin/sh
+#------------------------------------------------------------------------------
+# ========= |
+# \\ / F ield | foam-extend: Open Source CFD
+# \\ / O peration | Version: 4.0
+# \\ / A nd | Web: http://www.foam-extend.org
+# \\/ M anipulation | For copyright notice see file Copyright
+#-------------------------------------------------------------------------------
+# License
+# This file is part of foam-extend.
+#
+# foam-extend 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.
+#
+# foam-extend 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 foam-extend. If not, see .
+#
+# Script
+# foamNewTemplate
+#
+# Description
+# Create a new standard OpenFOAM templated source file
+#
+#------------------------------------------------------------------------------
+Script=${0##*/}
+Template="$WM_PROJECT_DIR/etc/codeTemplates/template/_TemplateTemplate"
+
+usage() {
+ while [ "$#" -ge 1 ]; do echo "$1"; shift; done
+ cat<
+options:
+ -help print the usage
+
+* create a new standard OpenFOAM source file for templated classes
+
+type: (C|H|I|IO)
+
+A ClassName starting with '-' will simply display the template
+
+USAGE
+ exit 1
+}
+
+# this implicitly covers a lone -help
+[ "$#" -gt 1 ] || usage
+
+
+className="$2"
+unset Type printOpt
+
+# for a className starting with '-' simply display the code
+if [ "${2#-}" != "${2}" ]
+then
+ printOpt=true
+fi
+
+
+case "$1" in
+(-h | -help)
+ usage
+ ;;
+(C|H)
+ Type=".$1"
+ ;;
+(I)
+ Type="$1.H"
+ ;;
+(IO)
+ Type="$1.C"
+ ;;
+*)
+ usage "unknown type '$1'"
+ ;;
+esac
+
+
+if [ "${printOpt:-false}" = true ]
+then
+ [ "$#" -eq 2 ] || usage "wrong number of arguments"
+ shift 2
+
+ cat $Template$Type
+
+else
+
+ [ "$#" -ge 3 ] || usage "wrong number of arguments"
+ shift 2
+
+ fileName="$className$Type"
+
+ echo "$Script: Creating new template interface file $fileName"
+ if [ -e "$fileName" ]
+ then
+ echo " Error: file exists"
+ exit 1
+ fi
+
+
+ # process class name
+ sed -e "s/CLASSNAME/$className/g" $Template$Type > $fileName.1
+
+
+ # process remaining (template) arguments
+ for tArg
+ do
+ sed -e "s/TemplateClassArgument/class $tArg, TemplateClassArgument/g" \
+ -e "s/TemplateArgument/$tArg, TemplateArgument/g" \
+ $fileName.1 > $fileName.2
+
+ mv $fileName.2 $fileName.1
+ done
+
+
+ # remove remaining ", Template .."
+ sed -e "s/, TemplateClassArgument//g" \
+ -e "s/, TemplateArgument//g" \
+ $fileName.1 > $fileName
+
+ rm $fileName.1
+fi
+#------------------------------------------------------------------------------
diff --git a/etc/cshrc b/etc/cshrc
index 6b29c5005..213e8e681 100644
--- a/etc/cshrc
+++ b/etc/cshrc
@@ -150,6 +150,9 @@ if ( ! $?WM_ARCH_OPTION ) setenv WM_ARCH_OPTION 64
# WM_PRECISION_OPTION = LDP | DP | SP
if ( ! $?WM_PRECISION_OPTION ) setenv WM_PRECISION_OPTION DP
+# WM_LABEL_SIZE = 32 | 64
+if ( ! $?WM_LABEL_SIZE ) setenv WM_LABEL_SIZE 32
+
# WM_COMPILE_OPTION = Opt | Debug | Prof
if ( ! $?WM_COMPILE_OPTION ) setenv WM_COMPILE_OPTION Opt
setenv WM_COMPILE_OPTION Opt
diff --git a/src/Allwmake b/src/Allwmake
index afb77baac..f20fefbe7 100755
--- a/src/Allwmake
+++ b/src/Allwmake
@@ -39,6 +39,7 @@ wmake libso meshTools
wmake libso finiteVolume
wmake libso finiteArea
+conversion/Allwmake
wmake libso lduSolvers
wmake libso tetFiniteElement
@@ -62,7 +63,6 @@ lagrangian/Allwmake
wmake libso conjugateHeatTransfer
postProcessing/Allwmake
-conversion/Allwmake
wmake libso errorEstimation
diff --git a/src/ODE/sixDOF/sixDOFBodies/sixDOFBodies.C b/src/ODE/sixDOF/sixDOFBodies/sixDOFBodies.C
index 1ad5e32dd..1bbfba477 100644
--- a/src/ODE/sixDOF/sixDOFBodies/sixDOFBodies.C
+++ b/src/ODE/sixDOF/sixDOFBodies/sixDOFBodies.C
@@ -74,7 +74,7 @@ void Foam::sixDOFBodies::setBodies()
names_[bodyI],
runTime_.timeName(),
runTime_,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::AUTO_WRITE
)
)
@@ -106,7 +106,7 @@ Foam::sixDOFBodies::sixDOFBodies
"sixDOFsolverDict",
runTime.system(),
runTime,
- IOobject::MUST_READ,
+ IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
),
diff --git a/src/ODE/sixDOF/sixDOFODE/newSixDOFODE.C b/src/ODE/sixDOF/sixDOFODE/newSixDOFODE.C
index 246f80e5a..a3496a2c2 100644
--- a/src/ODE/sixDOF/sixDOFODE/newSixDOFODE.C
+++ b/src/ODE/sixDOF/sixDOFODE/newSixDOFODE.C
@@ -1,26 +1,25 @@
/*---------------------------------------------------------------------------*\
========= |
- \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
- \\ / O peration |
- \\ / A nd | Copyright held by original author
- \\/ M anipulation |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
-------------------------------------------------------------------------------
License
- This file is part of OpenFOAM.
+ This file is part of foam-extend.
- OpenFOAM is free software; you can redistribute it and/or modify it
+ foam-extend 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 2 of the License, or (at your
+ 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.
+ foam-extend 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, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ along with foam-extend. If not, see .
Class
sixDOFODE
diff --git a/src/OSspecific/POSIX/Make/files b/src/OSspecific/POSIX/Make/files
index 532069a8e..9bb28cd84 100644
--- a/src/OSspecific/POSIX/Make/files
+++ b/src/OSspecific/POSIX/Make/files
@@ -8,8 +8,15 @@ fileStat.C
POSIX.C
cpuTime/cpuTime.C
clockTime/clockTime.C
+memInfo/memInfo.C
multiThreader/multiThreader.C
+/*
+ * Note: fileMonitor assumes inotify by default. Compile with -DFOAM_USE_STAT
+ * to use stat (=timestamps) instead of inotify
+ */
+fileMonitor.C
+
#ifdef SunOS64
dummyPrintStack.C
#else
diff --git a/src/OSspecific/POSIX/POSIX.C b/src/OSspecific/POSIX/POSIX.C
index 76b9d5271..2271f6a0e 100644
--- a/src/OSspecific/POSIX/POSIX.C
+++ b/src/OSspecific/POSIX/POSIX.C
@@ -27,7 +27,7 @@ Description
\*---------------------------------------------------------------------------*/
#ifdef solarisGcc
-# define _SYS_VNODE_H
+ #define _SYS_VNODE_H
#endif
#include "OSspecific.H"
@@ -36,6 +36,7 @@ Description
#include "fileName.H"
#include "fileStat.H"
#include "timer.H"
+#include "DynamicList.H"
#include
#include
@@ -50,6 +51,8 @@ Description
#include
#include
#include
+#include
+#include
#include
@@ -100,7 +103,7 @@ Foam::string Foam::getEnv(const word& envName)
bool Foam::setEnv
(
const word& envName,
- const string& value,
+ const std::string& value,
const bool overwrite
)
{
@@ -108,16 +111,47 @@ bool Foam::setEnv
}
-Foam::word Foam::hostName()
+Foam::string Foam::hostName(bool full)
{
- char buffer[256];
- gethostname(buffer, 256);
+ char buf[256];
+ gethostname(buf, sizeof(buf));
- return buffer;
+ // implementation as per hostname from net-tools
+ if (full)
+ {
+ struct hostent *hp = gethostbyname(buf);
+ if (hp)
+ {
+ return hp->h_name;
+ }
+ }
+
+ return buf;
}
-Foam::word Foam::userName()
+Foam::string Foam::domainName()
+{
+ char buf[128];
+ ::gethostname(buf, sizeof(buf));
+
+ // implementation as per hostname from net-tools
+ struct hostent *hp = ::gethostbyname(buf);
+ if (hp)
+ {
+ char *p = ::strchr(hp->h_name, '.');
+ if (p)
+ {
+ ++p;
+ return p;
+ }
+ }
+
+ return string::null;
+}
+
+
+Foam::string Foam::userName()
{
struct passwd* pw = getpwuid(getuid());
@@ -127,12 +161,17 @@ Foam::word Foam::userName()
}
else
{
- return word::null;
+ return string::null;
}
}
-// use $HOME environment variable or passwd info
+bool Foam::isAdministrator()
+{
+ return (::geteuid() == 0);
+}
+
+
Foam::fileName Foam::home()
{
char* env = getenv("HOME");
@@ -157,7 +196,7 @@ Foam::fileName Foam::home()
}
-Foam::fileName Foam::home(const word& userName)
+Foam::fileName Foam::home(const string& userName)
{
struct passwd* pw;
@@ -212,54 +251,152 @@ bool Foam::chDir(const fileName& dir)
}
-Foam::fileName Foam::findEtcFile(const fileName& name, bool mandatory)
+Foam::fileNameList Foam::findEtcFiles
+(
+ const fileName& name,
+ bool mandatory,
+ bool findFirst
+)
{
- // Search user files: deprecated. HJ, 11/Dec/2013
+ fileNameList results;
- // Search site files:
- fileName searchDir = getEnv("WM_PROJECT_INST_DIR");
+ // Search for user files in
+ // * ~/.OpenFOAM/VERSION
+ // * ~/.OpenFOAM
+ //
+ fileName searchDir = home()/".OpenFOAM";
if (isDir(searchDir))
{
- // Check for site file in $WM_PROJECT_INST_DIR/site/VERSION
- fileName fullName = searchDir/"site"/FOAMversion/name;
+ fileName fullName = searchDir/FOAMversion/name;
if (isFile(fullName))
{
- return fullName;
+ results.append(fullName);
+ if (findFirst)
+ {
+ return results;
+ }
}
- // Check for version-independent site file in $WM_PROJECT_INST_DIR/site
- fullName = searchDir/"site"/name;
+ fullName = searchDir/name;
if (isFile(fullName))
{
- return fullName;
+ results.append(fullName);
+ if (findFirst)
+ {
+ return results;
+ }
}
}
- // Search installation files:
+ // Search for group (site) files in
+ // * $WM_PROJECT_SITE/VERSION
+ // * $WM_PROJECT_SITE
+ //
+ searchDir = getEnv("WM_PROJECT_SITE");
+ if (searchDir.size())
+ {
+ if (isDir(searchDir))
+ {
+ fileName fullName = searchDir/FOAMversion/name;
+ if (isFile(fullName))
+ {
+ results.append(fullName);
+ if (findFirst)
+ {
+ return results;
+ }
+ }
+
+ fullName = searchDir/name;
+ if (isFile(fullName))
+ {
+ results.append(fullName);
+ if (findFirst)
+ {
+ return results;
+ }
+ }
+ }
+ }
+ else
+ {
+ // OR search for group (site) files in
+ // * $WM_PROJECT_INST_DIR/site/VERSION
+ // * $WM_PROJECT_INST_DIR/site
+ //
+ searchDir = getEnv("WM_PROJECT_INST_DIR");
+ if (isDir(searchDir))
+ {
+ fileName fullName = searchDir/"site"/FOAMversion/name;
+ if (isFile(fullName))
+ {
+ results.append(fullName);
+ if (findFirst)
+ {
+ return results;
+ }
+ }
+
+ fullName = searchDir/"site"/name;
+ if (isFile(fullName))
+ {
+ results.append(fullName);
+ if (findFirst)
+ {
+ return results;
+ }
+ }
+ }
+ }
+
+ // Search for other (shipped) files in
+ // * $WM_PROJECT_DIR/etc
+ //
searchDir = getEnv("WM_PROJECT_DIR");
if (isDir(searchDir))
{
- // Check for shipped FOAM file in $WM_PROJECT_DIR/etc
fileName fullName = searchDir/"etc"/name;
if (isFile(fullName))
{
- return fullName;
+ results.append(fullName);
+ if (findFirst)
+ {
+ return results;
+ }
}
}
// Not found
- // abort if the file is mandatory, otherwise return null
- if (mandatory)
+ if (results.empty())
{
- cerr<< "--> FOAM FATAL ERROR in Foam::findEtcFile() :"
- " could not find mandatory file\n '"
- << name.c_str() << "'\n\n" << std::endl;
- ::exit(1);
+ // Abort if the file is mandatory, otherwise return null
+ if (mandatory)
+ {
+ std::cerr
+ << "--> FOAM FATAL ERROR in Foam::findEtcFiles() :"
+ " could not find mandatory file\n '"
+ << name.c_str() << "'\n\n" << std::endl;
+ ::exit(1);
+ }
}
- // Return null-constructed fileName rather than fileName::null
- // to avoid cyclic dependencies in the construction of globals
- return fileName();
+ // Return list of matching paths or empty list if none found
+ return results;
+}
+
+
+Foam::fileName Foam::findEtcFile(const fileName& name, bool mandatory)
+{
+ fileNameList results(findEtcFiles(name, mandatory, true));
+
+ if (results.size())
+ {
+ return results[0];
+ }
+ else
+ {
+ return fileName();
+ }
}
@@ -283,7 +420,7 @@ bool Foam::mkDir(const fileName& pathName, mode_t mode)
{
case EPERM:
{
- FatalErrorIn("Foam::mkDir(const fileName&, mode_t)")
+ FatalErrorInFunction
<< "The filesystem containing " << pathName
<< " does not support the creation of directories."
<< exit(FatalError);
@@ -299,7 +436,7 @@ bool Foam::mkDir(const fileName& pathName, mode_t mode)
case EFAULT:
{
- FatalErrorIn("Foam::mkDir(const fileName&, mode_t)")
+ FatalErrorInFunction
<< "" << pathName
<< " points outside your accessible address space."
<< exit(FatalError);
@@ -309,7 +446,7 @@ bool Foam::mkDir(const fileName& pathName, mode_t mode)
case EACCES:
{
- FatalErrorIn("Foam::mkDir(const fileName&, mode_t)")
+ FatalErrorInFunction
<< "The parent directory does not allow write "
"permission to the process,"<< nl
<< "or one of the directories in " << pathName
@@ -321,7 +458,7 @@ bool Foam::mkDir(const fileName& pathName, mode_t mode)
case ENAMETOOLONG:
{
- FatalErrorIn("Foam::mkDir(const fileName&, mode_t)")
+ FatalErrorInFunction
<< "" << pathName << " is too long."
<< exit(FatalError);
@@ -337,7 +474,7 @@ bool Foam::mkDir(const fileName& pathName, mode_t mode)
}
else
{
- FatalErrorIn("Foam::mkDir(const fileName&, mode_t)")
+ FatalErrorInFunction
<< "Couldn't create directory " << pathName
<< exit(FatalError);
@@ -347,7 +484,7 @@ bool Foam::mkDir(const fileName& pathName, mode_t mode)
case ENOTDIR:
{
- FatalErrorIn("Foam::mkDir(const fileName&, mode_t)")
+ FatalErrorInFunction
<< "A component used as a directory in " << pathName
<< " is not, in fact, a directory."
<< exit(FatalError);
@@ -357,7 +494,7 @@ bool Foam::mkDir(const fileName& pathName, mode_t mode)
case ENOMEM:
{
- FatalErrorIn("Foam::mkDir(const fileName&, mode_t)")
+ FatalErrorInFunction
<< "Insufficient kernel memory was available to make "
"directory " << pathName << '.'
<< exit(FatalError);
@@ -367,7 +504,7 @@ bool Foam::mkDir(const fileName& pathName, mode_t mode)
case EROFS:
{
- FatalErrorIn("Foam::mkDir(const fileName&, mode_t)")
+ FatalErrorInFunction
<< "" << pathName
<< " refers to a file on a read-only filesystem."
<< exit(FatalError);
@@ -377,7 +514,7 @@ bool Foam::mkDir(const fileName& pathName, mode_t mode)
case ELOOP:
{
- FatalErrorIn("Foam::mkDir(const fileName&, mode_t)")
+ FatalErrorInFunction
<< "Too many symbolic links were encountered in resolving "
<< pathName << '.'
<< exit(FatalError);
@@ -387,7 +524,7 @@ bool Foam::mkDir(const fileName& pathName, mode_t mode)
case ENOSPC:
{
- FatalErrorIn("Foam::mkDir(const fileName&, mode_t)")
+ FatalErrorInFunction
<< "The device containing " << pathName
<< " has no room for the new directory or "
<< "the user's disk quota is exhausted."
@@ -398,7 +535,7 @@ bool Foam::mkDir(const fileName& pathName, mode_t mode)
default:
{
- FatalErrorIn("Foam::mkDir(const fileName&, mode_t)")
+ FatalErrorInFunction
<< "Couldn't create directory " << pathName
<< exit(FatalError);
@@ -409,14 +546,12 @@ bool Foam::mkDir(const fileName& pathName, mode_t mode)
}
-// Set the file mode
bool Foam::chMod(const fileName& name, const mode_t m)
{
return ::chmod(name.c_str(), m) == 0;
}
-// Return the file mode
mode_t Foam::mode(const fileName& name)
{
fileStat fileStatus(name);
@@ -431,7 +566,6 @@ mode_t Foam::mode(const fileName& name)
}
-// Return the file type: FILE or DIRECTORY
Foam::fileName::Type Foam::type(const fileName& name)
{
mode_t m = mode(name);
@@ -451,28 +585,24 @@ Foam::fileName::Type Foam::type(const fileName& name)
}
-// Does the name exist in the filing system?
bool Foam::exists(const fileName& name, const bool checkGzip)
{
return mode(name) || isFile(name, checkGzip);
}
-// Does the directory exist?
bool Foam::isDir(const fileName& name)
{
return S_ISDIR(mode(name));
}
-// Does the file exist?
bool Foam::isFile(const fileName& name, const bool checkGzip)
{
return S_ISREG(mode(name)) || (checkGzip && S_ISREG(mode(name + ".gz")));
}
-// Return size of file
off_t Foam::fileSize(const fileName& name)
{
fileStat fileStatus(name);
@@ -487,7 +617,6 @@ off_t Foam::fileSize(const fileName& name)
}
-// Return time of last file modification
time_t Foam::lastModified(const fileName& name)
{
fileStat fileStatus(name);
@@ -502,7 +631,6 @@ time_t Foam::lastModified(const fileName& name)
}
-// Read a directory and return the entries as a string list
Foam::fileNameList Foam::readDir
(
const fileName& directory,
@@ -516,8 +644,8 @@ Foam::fileNameList Foam::readDir
if (POSIX::debug)
{
- Info<< "readDir(const fileName&, const fileType, const bool filtergz)"
- << " : reading directory " << directory << endl;
+ InfoInFunction
+ << "reading directory " << directory << endl;
}
// Setup empty string list MAXTVALUES long
@@ -537,9 +665,8 @@ Foam::fileNameList Foam::readDir
if (POSIX::debug)
{
- Info<< "readDir(const fileName&, const fileType, "
- "const bool filtergz) : cannot open directory "
- << directory << endl;
+ InfoInFunction
+ << "cannot open directory " << directory << endl;
}
}
else
@@ -599,7 +726,6 @@ Foam::fileNameList Foam::readDir
}
-// Copy, recursively if necessary, the source to the destination
bool Foam::cp(const fileName& src, const fileName& dest)
{
// Make sure source exists.
@@ -671,7 +797,8 @@ bool Foam::cp(const fileName& src, const fileName& dest)
{
if (POSIX::debug)
{
- Info<< "Copying : " << src/contents[i]
+ InfoInFunction
+ << "Copying : " << src/contents[i]
<< " to " << destFile/contents[i] << endl;
}
@@ -698,26 +825,26 @@ bool Foam::cp(const fileName& src, const fileName& dest)
}
-// Create a softlink. dst should not exist. Returns true if successful.
bool Foam::ln(const fileName& src, const fileName& dst)
{
if (POSIX::debug)
{
- Info<< "Create softlink from : " << src << " to " << dst
+ InfoInFunction
+ << "Create softlink from : " << src << " to " << dst
<< endl;
}
if (exists(dst))
{
- WarningIn("ln(const fileName&, const fileName&)")
+ WarningInFunction
<< "destination " << dst << " already exists. Not linking."
<< endl;
return false;
}
- if (!exists(src))
+ if (src.isAbsolute() && !exists(src))
{
- WarningIn("ln(const fileName&, const fileName&)")
+ WarningInFunction
<< "source " << src << " does not exist." << endl;
return false;
}
@@ -728,19 +855,19 @@ bool Foam::ln(const fileName& src, const fileName& dst)
}
else
{
- WarningIn("ln(const fileName&, const fileName&)")
+ WarningInFunction
<< "symlink from " << src << " to " << dst << " failed." << endl;
return false;
}
}
-// Rename srcFile dstFile
bool Foam::mv(const fileName& src, const fileName& dst)
{
if (POSIX::debug)
{
- Info<< "Move : " << src << " to " << dst << endl;
+ InfoInFunction
+ << "Move : " << src << " to " << dst << endl;
}
if
@@ -760,13 +887,12 @@ bool Foam::mv(const fileName& src, const fileName& dst)
}
-//- Rename to a corresponding backup file
-// If the backup file already exists, attempt with "01" .. "99" index
bool Foam::mvBak(const fileName& src, const std::string& ext)
{
if (POSIX::debug)
{
- Info<< "mvBak : " << src << " to extension " << ext << endl;
+ InfoInFunction
+ << "mvBak : " << src << " to extension " << ext << endl;
}
if (exists(src, false))
@@ -798,13 +924,12 @@ bool Foam::mvBak(const fileName& src, const std::string& ext)
}
-
-// Remove a file, returning true if successful otherwise false
bool Foam::rm(const fileName& file)
{
if (POSIX::debug)
{
- Info<< "Removing : " << file << endl;
+ InfoInFunction
+ << "Removing : " << file << endl;
}
// Try returning plain file name; if not there, try with .gz
@@ -819,12 +944,11 @@ bool Foam::rm(const fileName& file)
}
-// Remove a dirctory and its contents
bool Foam::rmDir(const fileName& directory)
{
if (POSIX::debug)
{
- Info<< "rmDir(const fileName&) : "
+ InfoInFunction
<< "removing directory " << directory << endl;
}
@@ -835,7 +959,7 @@ bool Foam::rmDir(const fileName& directory)
// Attempt to open directory and set the structure pointer
if ((source = opendir(directory.c_str())) == NULL)
{
- WarningIn("rmDir(const fileName&)")
+ WarningInFunction
<< "cannot open directory " << directory << endl;
return false;
@@ -855,7 +979,7 @@ bool Foam::rmDir(const fileName& directory)
{
if (!rmDir(path))
{
- WarningIn("rmDir(const fileName&)")
+ WarningInFunction
<< "failed to remove directory " << fName
<< " while removing directory " << directory
<< endl;
@@ -869,7 +993,7 @@ bool Foam::rmDir(const fileName& directory)
{
if (!rm(path))
{
- WarningIn("rmDir(const fileName&)")
+ WarningInFunction
<< "failed to remove file " << fName
<< " while removing directory " << directory
<< endl;
@@ -885,7 +1009,7 @@ bool Foam::rmDir(const fileName& directory)
if (!rm(directory))
{
- WarningIn("rmDir(const fileName&)")
+ WarningInFunction
<< "failed to remove directory " << directory << endl;
closedir(source);
@@ -910,10 +1034,8 @@ void Foam::fdClose(const int fd)
{
if (close(fd) != 0)
{
- FatalErrorIn
- (
- "fdClose(const int fd)"
- ) << "close error on " << fd << endl
+ FatalErrorInFunction
+ << "close error on " << fd << endl
<< abort(FatalError);
}
}
@@ -921,7 +1043,7 @@ void Foam::fdClose(const int fd)
bool Foam::ping
(
- const word& destName,
+ const string& destName,
const label destPort,
const label timeOut
)
@@ -1005,7 +1127,7 @@ bool Foam::ping
}
-bool Foam::ping(const word& hostname, const label timeOut)
+bool Foam::ping(const string& hostname, const label timeOut)
{
return ping(hostname, 222, timeOut) || ping(hostname, 22, timeOut);
}
@@ -1017,6 +1139,129 @@ int Foam::system(const std::string& command)
}
+void* Foam::dlOpen(const fileName& lib, const bool check)
+{
+ if (POSIX::debug)
+ {
+ std::cout<< "dlOpen(const fileName&)"
+ << " : dlopen of " << lib << std::endl;
+ }
+ void* handle = ::dlopen(lib.c_str(), RTLD_LAZY|RTLD_GLOBAL);
+
+ if (!handle && check)
+ {
+ WarningInFunction
+ << "dlopen error : " << ::dlerror()
+ << endl;
+ }
+
+ if (POSIX::debug)
+ {
+ std::cout
+ << "dlOpen(const fileName&)"
+ << " : dlopen of " << lib
+ << " handle " << handle << std::endl;
+ }
+
+ return handle;
+}
+
+
+bool Foam::dlClose(void* handle)
+{
+ if (POSIX::debug)
+ {
+ std::cout
+ << "dlClose(void*)"
+ << " : dlclose of handle " << handle << std::endl;
+ }
+ return ::dlclose(handle) == 0;
+}
+
+
+void* Foam::dlSym(void* handle, const std::string& symbol)
+{
+ if (POSIX::debug)
+ {
+ std::cout
+ << "dlSym(void*, const std::string&)"
+ << " : dlsym of " << symbol << std::endl;
+ }
+ // clear any old errors - see manpage dlopen
+ (void) ::dlerror();
+
+ // get address of symbol
+ void* fun = ::dlsym(handle, symbol.c_str());
+
+ // find error (if any)
+ char *error = ::dlerror();
+
+ if (error)
+ {
+ WarningInFunction
+ << "Cannot lookup symbol " << symbol << " : " << error
+ << endl;
+ }
+
+ return fun;
+}
+
+
+bool Foam::dlSymFound(void* handle, const std::string& symbol)
+{
+ if (handle && !symbol.empty())
+ {
+ if (POSIX::debug)
+ {
+ std::cout
+ << "dlSymFound(void*, const std::string&)"
+ << " : dlsym of " << symbol << std::endl;
+ }
+
+ // clear any old errors - see manpage dlopen
+ (void) ::dlerror();
+
+ // get address of symbol
+ (void) ::dlsym(handle, symbol.c_str());
+
+ // symbol can be found if there was no error
+ return !::dlerror();
+ }
+ else
+ {
+ return false;
+ }
+}
+
+
+static int collectLibsCallback
+(
+ struct dl_phdr_info *info,
+ size_t size,
+ void *data
+)
+{
+ Foam::DynamicList* ptr =
+ reinterpret_cast*>(data);
+ ptr->append(info->dlpi_name);
+ return 0;
+}
+
+
+Foam::fileNameList Foam::dlLoaded()
+{
+ DynamicList libs;
+ dl_iterate_phdr(collectLibsCallback, &libs);
+ if (POSIX::debug)
+ {
+ std::cout
+ << "dlLoaded()"
+ << " : determined loaded libraries :" << libs.size() << std::endl;
+ }
+ return libs;
+}
+
+
void Foam::osRandomSeed(const label seed)
{
#ifdef USE_RANDOM
diff --git a/src/OSspecific/POSIX/fileMonitor.C b/src/OSspecific/POSIX/fileMonitor.C
new file mode 100644
index 000000000..e58d7b071
--- /dev/null
+++ b/src/OSspecific/POSIX/fileMonitor.C
@@ -0,0 +1,626 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+\*---------------------------------------------------------------------------*/
+
+#include "fileMonitor.H"
+#include "IOstreams.H"
+#include "Pstream.H"
+#include "PackedList.H"
+#include "PstreamReduceOps.H"
+#include "OSspecific.H"
+#include "regIOobject.H" // for fileModificationSkew symbol
+
+#ifdef FOAM_USE_INOTIFY
+# include
+# include
+# include
+# include
+# define EVENT_SIZE ( sizeof (struct inotify_event) )
+# define EVENT_LEN (EVENT_SIZE + 16)
+# define EVENT_BUF_LEN ( 1024 * EVENT_LEN )
+#else
+# include "OSspecific.H"
+#endif
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+const Foam::NamedEnum
+ Foam::fileMonitor::fileStateNames_;
+
+namespace Foam
+{
+ defineTypeNameAndDebug(fileMonitor, 0);
+
+ template<>
+ const char* Foam::NamedEnum
+ <
+ Foam::fileMonitor::fileState,
+ 3
+ >::names[] =
+ {
+ "unmodified",
+ "modified",
+ "deleted"
+ };
+
+ //- Reduction operator for PackedList of fileState
+ class reduceFileStates
+ {
+ public:
+ unsigned int operator()(const unsigned int x, const unsigned int y)
+ const
+ {
+ // x,y are sets of 2bits representing fileState
+
+ unsigned int mask = 3u;
+ unsigned int shift = 0;
+ unsigned int result = 0;
+
+ while (mask)
+ {
+ // Combine state
+ unsigned int xState = (x & mask) >> shift;
+ unsigned int yState = (y & mask) >> shift;
+
+ // Combine and add to result. Combine is such that UNMODIFIED
+ // wins.
+ unsigned int state = min(xState, yState);
+ result |= (state << shift);
+
+ shift += 2;
+ mask <<= 2;
+ }
+ return result;
+ }
+ };
+
+ //- Combine operator for PackedList of fileState
+ class combineReduceFileStates
+ {
+ public:
+ void operator()(unsigned int& x, const unsigned int y) const
+ {
+ x = reduceFileStates()(x, y);
+ }
+ };
+
+
+
+ //- Internal tracking via stat(3p) or inotify(7)
+ class fileMonitorWatcher
+ {
+ public:
+
+ const bool useInotify_;
+
+ // For inotify
+
+ //- File descriptor for the inotify instance
+ int inotifyFd_;
+
+ //- Current watchIDs and corresponding directory id
+ DynamicList