diff --git a/src/finiteArea/Make/files b/src/finiteArea/Make/files
index 9e8ffce86..65abb8311 100644
--- a/src/finiteArea/Make/files
+++ b/src/finiteArea/Make/files
@@ -22,26 +22,37 @@ $(faMeshMapper)/faPatchMapper.C
faPatchFields = fields/faPatchFields
$(faPatchFields)/faPatchField/faPatchFields.C
+$(faPatchFields)/faPatchField/faPatchVectorNFields.C
basicFaPatchFields = $(faPatchFields)/basic
$(basicFaPatchFields)/basicSymmetry/basicSymmetryFaPatchFields.C
$(basicFaPatchFields)/basicSymmetry/basicSymmetryFaPatchScalarField.C
$(basicFaPatchFields)/calculated/calculatedFaPatchFields.C
+$(basicFaPatchFields)/calculated/calculatedFaPatchVectorNFields.C
$(basicFaPatchFields)/coupled/coupledFaPatchFields.C
+$(basicFaPatchFields)/coupled/coupledFaPatchVectorNFields.C
$(basicFaPatchFields)/zeroGradient/zeroGradientFaPatchFields.C
+$(basicFaPatchFields)/zeroGradient/zeroGradientFaPatchVectorNFields.C
$(basicFaPatchFields)/fixedValue/fixedValueFaPatchFields.C
+$(basicFaPatchFields)/fixedValue/fixedValueFaPatchVectorNFields.C
$(basicFaPatchFields)/fixedGradient/fixedGradientFaPatchFields.C
+$(basicFaPatchFields)/fixedGradient/fixedGradientFaPatchVectorNFields.C
$(basicFaPatchFields)/mixed/mixedFaPatchFields.C
$(basicFaPatchFields)/transform/transformFaPatchFields.C
$(basicFaPatchFields)/transform/transformFaPatchScalarField.C
+$(basicFaPatchFields)/transform/transformFaPatchVectorNFields.C
constraintFaPatchFields = $(faPatchFields)/constraint
$(constraintFaPatchFields)/empty/emptyFaPatchFields.C
+$(constraintFaPatchFields)/empty/emptyFaPatchVectorNFields.C
$(constraintFaPatchFields)/processor/processorFaPatchFields.C
$(constraintFaPatchFields)/processor/processorFaPatchScalarField.C
+$(constraintFaPatchFields)/processor/processorFaPatchVectorNFields.C
$(constraintFaPatchFields)/wedge/wedgeFaPatchFields.C
$(constraintFaPatchFields)/wedge/wedgeFaPatchScalarField.C
+$(constraintFaPatchFields)/wedge/wedgeFaPatchVectorNFields.C
$(constraintFaPatchFields)/cyclic/cyclicFaPatchFields.C
+$(constraintFaPatchFields)/cyclic/cyclicFaPatchVectorNFields.C
$(constraintFaPatchFields)/symmetry/symmetryFaPatchFields.C
derivedFaPatchFields = $(faPatchFields)/derived
@@ -66,8 +77,18 @@ $(constraintFaePatchFields)/wedge/wedgeFaePatchFields.C
$(constraintFaePatchFields)/cyclic/cyclicFaePatchFields.C
$(constraintFaePatchFields)/symmetry/symmetryFaePatchFields.C
+faePatchVectorNFields = $(faePatchFields)/faePatchVectorNFields
+$(faePatchVectorNFields)/faePatchVectorNFields.C
+$(faePatchVectorNFields)/calculatedFaePatchVectorNFields.C
+$(faePatchVectorNFields)/emptyFaePatchVectorNFields.C
+$(faePatchVectorNFields)/wedgeFaePatchVectorNFields.C
+$(faePatchVectorNFields)/coupledFaePatchVectorNFields.C
+$(faePatchVectorNFields)/processorFaePatchVectorNFields.C
+
fields/areaFields/areaFields.C
+fields/areaFields/areaVectorNFields.C
fields/edgeFields/edgeFields.C
+fields/edgeFields/edgeVectorNFields.C
faMatrices/faMatrices.C
faMatrices/faScalarMatrix/faScalarMatrix.C
@@ -122,4 +143,12 @@ convectionSchemes = finiteArea/convectionSchemes
$(convectionSchemes)/faConvectionScheme/faConvectionSchemes.C
$(convectionSchemes)/gaussFaConvectionScheme/gaussFaConvectionSchemes.C
+general = cfdTools/general
+
+solutionFaControl = $(general)/solutionFaControl
+$(solutionFaControl)/solutionFaControl/solutionFaControl.C
+$(solutionFaControl)/simpleFaControl/simpleFaControl.C
+$(solutionFaControl)/pimpleFaControl/pimpleFaControl.C
+$(solutionFaControl)/pisoFaControl/pisoFaControl.C
+
LIB = $(FOAM_LIBBIN)/libfiniteArea
diff --git a/src/finiteArea/cfdTools/general/solutionFaControl/pimpleFaControl/pimpleFaControl.C b/src/finiteArea/cfdTools/general/solutionFaControl/pimpleFaControl/pimpleFaControl.C
new file mode 100644
index 000000000..cd6312f9f
--- /dev/null
+++ b/src/finiteArea/cfdTools/general/solutionFaControl/pimpleFaControl/pimpleFaControl.C
@@ -0,0 +1,239 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 "pimpleFaControl.H"
+#include "Switch.H"
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+namespace Foam
+{
+ defineTypeNameAndDebug(pimpleFaControl, 0);
+}
+
+
+// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
+
+void Foam::pimpleFaControl::read()
+{
+ solutionFaControl::read(false);
+
+ // Read solution controls
+ const dictionary& pimpleDict = dict();
+ nCorrPIMPLE_ = pimpleDict.lookupOrDefault("nOuterCorrectors", 1);
+ nCorrPISO_ = pimpleDict.lookupOrDefault("nCorrectors", 1);
+ turbOnFinalIterOnly_ =
+ pimpleDict.lookupOrDefault("turbOnFinalIterOnly", true);
+}
+
+
+bool Foam::pimpleFaControl::criteriaSatisfied()
+{
+ // no checks on first iteration - nothing has been calculated yet
+ if ((corr_ == 1) || residualControl_.empty() || finalIter())
+ {
+ return false;
+ }
+
+
+ bool storeIni = this->storeInitialResiduals();
+
+ bool achieved = true;
+ bool checked = false; // safety that some checks were indeed performed
+
+ const dictionary& solverDict = mesh_.solutionDict().solverPerformanceDict();
+ forAllConstIter(dictionary, solverDict, iter)
+ {
+ const word& variableName = iter().keyword();
+ const label fieldI = applyToField(variableName);
+ if (fieldI != -1)
+ {
+ scalar residual = 0;
+ const scalar firstResidual =
+ maxResidual(variableName, iter().stream(), residual);
+
+ checked = true;
+
+ if (storeIni)
+ {
+ residualControl_[fieldI].initialResidual = firstResidual;
+ }
+
+ const bool absCheck = residual < residualControl_[fieldI].absTol;
+ bool relCheck = false;
+
+ scalar relative = 0.0;
+ if (!storeIni)
+ {
+ const scalar iniRes =
+ residualControl_[fieldI].initialResidual
+ + ROOTVSMALL;
+
+ relative = residual/iniRes;
+ relCheck = relative < residualControl_[fieldI].relTol;
+ }
+
+ achieved = achieved && (absCheck || relCheck);
+
+ if (debug)
+ {
+ Info<< algorithmName_ << " loop:" << endl;
+
+ Info<< " " << variableName
+ << " PIMPLE iter " << corr_
+ << ": ini res = "
+ << residualControl_[fieldI].initialResidual
+ << ", abs tol = " << residual
+ << " (" << residualControl_[fieldI].absTol << ")"
+ << ", rel tol = " << relative
+ << " (" << residualControl_[fieldI].relTol << ")"
+ << endl;
+ }
+ }
+ }
+
+ return checked && achieved;
+}
+
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+Foam::pimpleFaControl::pimpleFaControl(faMesh& mesh, const word& dictName)
+:
+ solutionFaControl(mesh, dictName),
+ nCorrPIMPLE_(0),
+ nCorrPISO_(0),
+ corrPISO_(0),
+ turbOnFinalIterOnly_(true),
+ converged_(false)
+{
+ read();
+
+ if (nCorrPIMPLE_ > 1)
+ {
+ Info<< nl;
+ if (residualControl_.empty())
+ {
+ Info<< algorithmName_ << ": no residual control data found. "
+ << "Calculations will employ " << nCorrPIMPLE_
+ << " corrector loops" << nl << endl;
+ }
+ else
+ {
+ Info<< algorithmName_ << ": max iterations = " << nCorrPIMPLE_
+ << endl;
+ forAll(residualControl_, i)
+ {
+ Info<< " field " << residualControl_[i].name << token::TAB
+ << ": relTol " << residualControl_[i].relTol
+ << ", tolerance " << residualControl_[i].absTol
+ << nl;
+ }
+ Info<< endl;
+ }
+ }
+ else
+ {
+ Info<< nl << algorithmName_ << ": Operating solver in PISO mode" << nl
+ << endl;
+ }
+}
+
+
+// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
+
+Foam::pimpleFaControl::~pimpleFaControl()
+{}
+
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+bool Foam::pimpleFaControl::loop()
+{
+ read();
+
+ corr_++;
+
+ if (debug)
+ {
+ Info<< algorithmName_ << " loop: corr = " << corr_ << endl;
+ }
+
+ if (corr_ == nCorrPIMPLE_ + 1)
+ {
+ if ((!residualControl_.empty()) && (nCorrPIMPLE_ != 1))
+ {
+ Info<< algorithmName_ << ": not converged within "
+ << nCorrPIMPLE_ << " iterations" << endl;
+ }
+
+ corr_ = 0;
+ mesh_.solutionDict().remove("finalIteration");
+ return false;
+ }
+
+ bool completed = false;
+ if (converged_ || criteriaSatisfied())
+ {
+ if (converged_)
+ {
+ Info<< algorithmName_ << ": converged in " << corr_ - 1
+ << " iterations" << endl;
+
+ mesh_.solutionDict().remove("finalIteration");
+ corr_ = 0;
+ converged_ = false;
+
+ completed = true;
+ }
+ else
+ {
+ Info<< algorithmName_ << ": iteration " << corr_ << endl;
+ storePrevIterFields();
+
+ mesh_.solutionDict().add("finalIteration", true);
+ converged_ = true;
+ }
+ }
+ else
+ {
+ if (finalIter())
+ {
+ mesh_.solutionDict().add("finalIteration", true);
+ }
+
+ if (corr_ <= nCorrPIMPLE_)
+ {
+ Info<< algorithmName_ << ": iteration " << corr_ << endl;
+ storePrevIterFields();
+ completed = false;
+ }
+ }
+
+ return !completed;
+}
+
+
+// ************************************************************************* //
diff --git a/src/finiteArea/cfdTools/general/solutionFaControl/pimpleFaControl/pimpleFaControl.H b/src/finiteArea/cfdTools/general/solutionFaControl/pimpleFaControl/pimpleFaControl.H
new file mode 100644
index 000000000..02dcc5661
--- /dev/null
+++ b/src/finiteArea/cfdTools/general/solutionFaControl/pimpleFaControl/pimpleFaControl.H
@@ -0,0 +1,163 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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::pimpleFaControl
+
+Description
+ PIMPLE control class to supply convergence information/checks for
+ the PIMPLE loop.
+
+ May also be used to for PISO-based algorithms as PISO controls are a
+ sub-set of PIMPLE controls.
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef pimpleFaControl_H
+#define pimpleFaControl_H
+
+#include "solutionFaControl.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+/*---------------------------------------------------------------------------*\
+ Class pimpleFaControl Declaration
+\*---------------------------------------------------------------------------*/
+
+class pimpleFaControl
+:
+ public solutionFaControl
+{
+ // Private member functions
+
+ //- Disallow default bitwise copy construct
+ pimpleFaControl(const pimpleFaControl&);
+
+ //- Disallow default bitwise assignment
+ void operator=(const pimpleFaControl&);
+
+
+protected:
+
+ // Protected data
+
+ // Solution controls
+
+ //- Maximum number of PIMPLE correctors
+ label nCorrPIMPLE_;
+
+ //- Maximum number of PISO correctors
+ label nCorrPISO_;
+
+ //- Current PISO corrector
+ label corrPISO_;
+
+ //- Flag to indicate whether to only solve turbulence on final iter
+ bool turbOnFinalIterOnly_;
+
+ //- Converged flag
+ bool converged_;
+
+
+ // Protected Member Functions
+
+ //- Read controls from faSolution dictionary
+ virtual void read();
+
+ //- Return true if all convergence checks are satisfied
+ virtual bool criteriaSatisfied();
+
+
+public:
+
+ // Static Data Members
+
+ //- Run-time type information
+ TypeName("pimpleFaControl");
+
+
+ // Constructors
+
+ //- Construct from mesh and the name of control sub-dictionary
+ pimpleFaControl(faMesh& mesh, const word& dictName="PIMPLE");
+
+
+ //- Destructor
+ virtual ~pimpleFaControl();
+
+
+ // Member Functions
+
+ // Access
+
+ //- Maximum number of PIMPLE correctors
+ inline label nCorrPIMPLE() const;
+
+ //- Maximum number of PISO correctors
+ inline label nCorrPISO() const;
+
+ //- Current PISO corrector index
+ inline label corrPISO() const;
+
+
+ // Solution control
+
+ //- PIMPLE loop
+ virtual bool loop();
+
+ //- Pressure corrector loop
+ inline bool correct();
+
+ //- Helper function to identify when to store the intial residuals
+ inline bool storeInitialResiduals() const;
+
+ //- Helper function to identify first PIMPLE (outer) iteration
+ inline bool firstIter() const;
+
+ //- Helper function to identify final PIMPLE (outer) iteration
+ inline bool finalIter() const;
+
+ //- Helper function to identify final inner iteration
+ inline bool finalInnerIter() const;
+
+ //- Helper function to identify whether to solve for turbulence
+ inline bool turbCorr() const;
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#include "pimpleFaControlI.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/cfdTools/general/solutionFaControl/pimpleFaControl/pimpleFaControlI.H b/src/finiteArea/cfdTools/general/solutionFaControl/pimpleFaControl/pimpleFaControlI.H
new file mode 100644
index 000000000..9e9fb7bc4
--- /dev/null
+++ b/src/finiteArea/cfdTools/general/solutionFaControl/pimpleFaControl/pimpleFaControlI.H
@@ -0,0 +1,101 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 .
+
+\*---------------------------------------------------------------------------*/
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+inline Foam::label Foam::pimpleFaControl::nCorrPIMPLE() const
+{
+ return nCorrPIMPLE_;
+}
+
+
+inline Foam::label Foam::pimpleFaControl::nCorrPISO() const
+{
+ return nCorrPISO_;
+}
+
+
+inline Foam::label Foam::pimpleFaControl::corrPISO() const
+{
+ return corrPISO_;
+}
+
+
+inline bool Foam::pimpleFaControl::correct()
+{
+ corrPISO_++;
+
+ if (debug)
+ {
+ Info<< algorithmName_ << " correct: corrPISO = " << corrPISO_ << endl;
+ }
+
+ if (corrPISO_ <= nCorrPISO_)
+ {
+ return true;
+ }
+ else
+ {
+ corrPISO_ = 0;
+ return false;
+ }
+}
+
+
+inline bool Foam::pimpleFaControl::storeInitialResiduals() const
+{
+ // Start from second PIMPLE iteration
+ return (corr_ == 2) && (corrPISO_ == 0) && (corrNonOrtho_ == 0);
+}
+
+
+inline bool Foam::pimpleFaControl::firstIter() const
+{
+ return corr_ == 1;
+}
+
+
+inline bool Foam::pimpleFaControl::finalIter() const
+{
+ return converged_ || (corr_ == nCorrPIMPLE_);
+}
+
+
+inline bool Foam::pimpleFaControl::finalInnerIter() const
+{
+ return
+ finalIter()
+ && corrPISO_ == nCorrPISO_
+ && corrNonOrtho_ == nNonOrthCorr_ + 1;
+}
+
+
+inline bool Foam::pimpleFaControl::turbCorr() const
+{
+ return !turbOnFinalIterOnly_ || finalIter();
+}
+
+
+// ************************************************************************* //
diff --git a/src/finiteArea/cfdTools/general/solutionFaControl/pisoFaControl/pisoFaControl.C b/src/finiteArea/cfdTools/general/solutionFaControl/pisoFaControl/pisoFaControl.C
new file mode 100644
index 000000000..e1dc63ce1
--- /dev/null
+++ b/src/finiteArea/cfdTools/general/solutionFaControl/pisoFaControl/pisoFaControl.C
@@ -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 .
+
+\*---------------------------------------------------------------------------*/
+
+#include "pisoFaControl.H"
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+namespace Foam
+{
+ defineTypeNameAndDebug(pisoFaControl, 0);
+}
+
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+Foam::pisoFaControl::pisoFaControl(faMesh& mesh, const word& dictName)
+:
+ pimpleFaControl(mesh, dictName)
+{}
+
+
+// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
+
+Foam::pisoFaControl::~pisoFaControl()
+{}
+
+
+// ************************************************************************* //
diff --git a/src/finiteArea/cfdTools/general/solutionFaControl/pisoFaControl/pisoFaControl.H b/src/finiteArea/cfdTools/general/solutionFaControl/pisoFaControl/pisoFaControl.H
new file mode 100644
index 000000000..cae1ee4b3
--- /dev/null
+++ b/src/finiteArea/cfdTools/general/solutionFaControl/pisoFaControl/pisoFaControl.H
@@ -0,0 +1,86 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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::pisoFaControl
+
+Description
+ Specialization of the pimpleFaControl class for PISO control.
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef pisoFaControl_H
+#define pisoFaControl_H
+
+#include "pimpleFaControl.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+/*---------------------------------------------------------------------------*\
+ Class pisoFaControl Declaration
+\*---------------------------------------------------------------------------*/
+
+class pisoFaControl
+:
+ public pimpleFaControl
+{
+ // Private member functions
+
+ //- Disallow default bitwise copy construct
+ pisoFaControl(const pisoFaControl&);
+
+ //- Disallow default bitwise assignment
+ void operator=(const pisoFaControl&);
+
+
+public:
+
+ // Static Data Members
+
+ //- Run-time type information
+ TypeName("pisoFaControl");
+
+
+ // Constructors
+
+ //- Construct from mesh and the name of control sub-dictionary
+ pisoFaControl(faMesh& mesh, const word& dictName="PISO");
+
+
+ //- Destructor
+ virtual ~pisoFaControl();
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/cfdTools/general/solutionFaControl/simpleFaControl/simpleFaControl.C b/src/finiteArea/cfdTools/general/solutionFaControl/simpleFaControl/simpleFaControl.C
new file mode 100644
index 000000000..fbcaf9767
--- /dev/null
+++ b/src/finiteArea/cfdTools/general/solutionFaControl/simpleFaControl/simpleFaControl.C
@@ -0,0 +1,158 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 "simpleFaControl.H"
+#include "foamTime.H"
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+namespace Foam
+{
+ defineTypeNameAndDebug(simpleFaControl, 0);
+}
+
+
+// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
+
+void Foam::simpleFaControl::read()
+{
+ solutionFaControl::read(true);
+}
+
+
+bool Foam::simpleFaControl::criteriaSatisfied()
+{
+ if (residualControl_.empty())
+ {
+ return false;
+ }
+
+ bool achieved = true;
+ bool checked = false; // safety that some checks were indeed performed
+
+ const dictionary& solverDict = mesh_.solutionDict().solverPerformanceDict();
+ forAllConstIter(dictionary, solverDict, iter)
+ {
+ const word& variableName = iter().keyword();
+ const label fieldI = applyToField(variableName);
+
+ if (fieldI != -1)
+ {
+ scalar lastResidual = 0;
+ const scalar residual =
+ maxResidual(variableName, iter().stream(), lastResidual);
+
+ checked = true;
+
+ bool absCheck = residual < residualControl_[fieldI].absTol;
+ achieved = achieved && absCheck;
+
+ if (debug)
+ {
+ Info<< algorithmName_ << " solution statistics:" << endl;
+
+ Info<< " " << variableName << ": tolerance = " << residual
+ << " (" << residualControl_[fieldI].absTol << ")"
+ << endl;
+ }
+ }
+ }
+
+ return checked && achieved;
+}
+
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+Foam::simpleFaControl::simpleFaControl(faMesh& mesh)
+:
+ solutionFaControl(mesh, "SIMPLE"),
+ initialised_(false)
+{
+ read();
+
+ Info<< nl;
+
+ if (residualControl_.empty())
+ {
+ Info<< algorithmName_ << ": no convergence criteria found. "
+ << "Calculations will run for " << mesh_.time().endTime().value()
+ << " steps." << nl << endl;
+ }
+ else
+ {
+ Info<< algorithmName_ << ": convergence criteria" << nl;
+ forAll(residualControl_, i)
+ {
+ Info<< " field " << residualControl_[i].name << token::TAB
+ << " tolerance " << residualControl_[i].absTol
+ << nl;
+ }
+ Info<< endl;
+ }
+}
+
+
+// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
+
+Foam::simpleFaControl::~simpleFaControl()
+{}
+
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+bool Foam::simpleFaControl::loop()
+{
+ read();
+
+ Time& time = const_cast(mesh_.time());
+
+ if (initialised_)
+ {
+ if (criteriaSatisfied())
+ {
+ Info<< nl << algorithmName_ << " solution converged in "
+ << time.value() << " iterations" << nl << endl;
+
+ // Set to finalise calculation
+ time.writeAndEnd();
+ }
+ else
+ {
+ storePrevIterFields();
+ }
+ }
+ else
+ {
+ initialised_ = true;
+ storePrevIterFields();
+ }
+
+
+ return time.loop();
+}
+
+
+// ************************************************************************* //
diff --git a/src/finiteArea/cfdTools/general/solutionFaControl/simpleFaControl/simpleFaControl.H b/src/finiteArea/cfdTools/general/solutionFaControl/simpleFaControl/simpleFaControl.H
new file mode 100644
index 000000000..2a9499b2c
--- /dev/null
+++ b/src/finiteArea/cfdTools/general/solutionFaControl/simpleFaControl/simpleFaControl.H
@@ -0,0 +1,111 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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::simpleFaControl
+
+Description
+ SIMPLE control class to supply convergence information/checks for
+ the SIMPLE loop.
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef simpleFaControl_H
+#define simpleFaControl_H
+
+#include "solutionFaControl.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+/*---------------------------------------------------------------------------*\
+ Class simpleFaControl Declaration
+\*---------------------------------------------------------------------------*/
+
+class simpleFaControl
+:
+ public solutionFaControl
+{
+
+protected:
+
+ // Protected Data
+
+ //- Initialised flag
+ bool initialised_;
+
+
+ // Protected Member Functions
+
+ //- Read controls from faSolution dictionary
+ void read();
+
+ //- Return true if all convergence checks are satisfied
+ bool criteriaSatisfied();
+
+ //- Disallow default bitwise copy construct
+ simpleFaControl(const simpleFaControl&);
+
+ //- Disallow default bitwise assignment
+ void operator=(const simpleFaControl&);
+
+
+public:
+
+
+ // Static Data Members
+
+ //- Run-time type information
+ TypeName("simpleFaControl");
+
+
+ // Constructors
+
+ //- Construct from mesh
+ simpleFaControl(faMesh& mesh);
+
+
+ //- Destructor
+ virtual ~simpleFaControl();
+
+
+ // Member Functions
+
+ // Solution control
+
+ //- Loop loop
+ virtual bool loop();
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/cfdTools/general/solutionFaControl/solutionFaControl/solutionFaControl.C b/src/finiteArea/cfdTools/general/solutionFaControl/solutionFaControl/solutionFaControl.C
new file mode 100644
index 000000000..584d3bfa4
--- /dev/null
+++ b/src/finiteArea/cfdTools/general/solutionFaControl/solutionFaControl/solutionFaControl.C
@@ -0,0 +1,280 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 "solutionFaControl.H"
+#include "fieldTypes.H"
+#include "VectorNFieldTypes.H"
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+namespace Foam
+{
+ defineTypeNameAndDebug(solutionFaControl, 0);
+}
+
+
+// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
+
+void Foam::solutionFaControl::read(const bool absTolOnly)
+{
+ const dictionary& solutionDict = this->dict();
+
+ // Read solution controls
+ nNonOrthCorr_ =
+ solutionDict.lookupOrDefault("nNonOrthogonalCorrectors", 0);
+ momentumPredictor_ =
+ solutionDict.lookupOrDefault("momentumPredictor", true);
+ transonic_ = solutionDict.lookupOrDefault("transonic", false);
+ consistent_ = solutionDict.lookupOrDefault("consistent", false);
+
+ // Read residual information
+ const dictionary residualDict
+ (
+ solutionDict.subOrEmptyDict("residualControl")
+ );
+
+ DynamicList data(residualControl_);
+
+ forAllConstIter(dictionary, residualDict, iter)
+ {
+ const word& fName = iter().keyword();
+ const label fieldI = applyToField(fName, false);
+ if (fieldI == -1)
+ {
+ fieldData fd;
+ fd.name = fName.c_str();
+
+ if (absTolOnly)
+ {
+ fd.absTol = readScalar(residualDict.lookup(fName));
+ fd.relTol = -1;
+ fd.initialResidual = -1;
+ }
+ else
+ {
+ if (iter().isDict())
+ {
+ const dictionary& fieldDict(iter().dict());
+ fd.absTol = readScalar(fieldDict.lookup("tolerance"));
+ fd.relTol = readScalar(fieldDict.lookup("relTol"));
+ fd.initialResidual = 0.0;
+ }
+ else
+ {
+ FatalErrorIn
+ (
+ "void Foam::solutionFaControl::read"
+ "(const bool absTolOnly)"
+ ) << "Residual data for " << iter().keyword()
+ << " must be specified as a dictionary"
+ << exit(FatalError);
+ }
+ }
+
+ data.append(fd);
+ }
+ else
+ {
+ fieldData& fd = data[fieldI];
+ if (absTolOnly)
+ {
+ fd.absTol = readScalar(residualDict.lookup(fName));
+ }
+ else
+ {
+ if (iter().isDict())
+ {
+ const dictionary& fieldDict(iter().dict());
+ fd.absTol = readScalar(fieldDict.lookup("tolerance"));
+ fd.relTol = readScalar(fieldDict.lookup("relTol"));
+ }
+ else
+ {
+ FatalErrorIn
+ (
+ "void Foam::solutionFaControl::read"
+ "(const bool absTolOnly)"
+ ) << "Residual data for " << iter().keyword()
+ << " must be specified as a dictionary"
+ << exit(FatalError);
+ }
+ }
+ }
+ }
+
+ residualControl_.transfer(data);
+
+ if (debug)
+ {
+ forAll(residualControl_, i)
+ {
+ const fieldData& fd = residualControl_[i];
+ Info<< "residualControl[" << i << "]:" << nl
+ << " name : " << fd.name << nl
+ << " absTol : " << fd.absTol << nl
+ << " relTol : " << fd.relTol << nl
+ << " iniResid : " << fd.initialResidual << endl;
+ }
+ }
+}
+
+
+void Foam::solutionFaControl::read()
+{
+ read(false);
+}
+
+
+Foam::label Foam::solutionFaControl::applyToField
+(
+ const word& fieldName,
+ const bool useRegEx
+) const
+{
+ forAll(residualControl_, i)
+ {
+ if (useRegEx && residualControl_[i].name.match(fieldName))
+ {
+ return i;
+ }
+ else if (residualControl_[i].name == fieldName)
+ {
+ return i;
+ }
+ }
+
+ return -1;
+}
+
+
+void Foam::solutionFaControl::storePrevIterFields() const
+{
+// storePrevIter();
+ storePrevIter();
+ storePrevIter();
+ storePrevIter();
+ storePrevIter();
+ storePrevIter();
+
+ storePrevIter();
+ storePrevIter();
+ storePrevIter();
+ storePrevIter();
+
+ storePrevIter();
+ storePrevIter();
+ storePrevIter();
+ storePrevIter();
+
+ storePrevIter();
+ storePrevIter();
+ storePrevIter();
+ storePrevIter();
+}
+
+
+template
+void Foam::solutionFaControl::maxTypeResidual
+(
+ const word& fieldName,
+ ITstream& data,
+ scalar& firstRes,
+ scalar& lastRes
+) const
+{
+ typedef GeometricField fieldType;
+
+ if (mesh_.db().foundObject(fieldName))
+ {
+ const List > sp(data);
+ firstRes = cmptMax(sp.first().initialResidual());
+ lastRes = cmptMax(sp.last().initialResidual());
+ }
+}
+
+
+Foam::scalar Foam::solutionFaControl::maxResidual
+(
+ const word& fieldName,
+ ITstream& data,
+ scalar& lastRes
+) const
+{
+ scalar firstRes = 0;
+
+ maxTypeResidual(fieldName, data, firstRes, lastRes);
+ maxTypeResidual(fieldName, data, firstRes, lastRes);
+ maxTypeResidual(fieldName, data, firstRes, lastRes);
+ maxTypeResidual(fieldName, data, firstRes, lastRes);
+ maxTypeResidual(fieldName, data, firstRes, lastRes);
+
+ maxTypeResidual(fieldName, data, firstRes, lastRes);
+ maxTypeResidual(fieldName, data, firstRes, lastRes);
+ maxTypeResidual(fieldName, data, firstRes, lastRes);
+ maxTypeResidual(fieldName, data, firstRes, lastRes);
+
+ maxTypeResidual(fieldName, data, firstRes, lastRes);
+ maxTypeResidual(fieldName, data, firstRes, lastRes);
+ maxTypeResidual(fieldName, data, firstRes, lastRes);
+ maxTypeResidual(fieldName, data, firstRes, lastRes);
+
+ maxTypeResidual(fieldName, data, firstRes, lastRes);
+ maxTypeResidual(fieldName, data, firstRes, lastRes);
+ maxTypeResidual(fieldName, data, firstRes, lastRes);
+ maxTypeResidual(fieldName, data, firstRes, lastRes);
+
+ return firstRes;
+}
+
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+Foam::solutionFaControl::solutionFaControl(faMesh& mesh, const word& algorithmName)
+:
+ IOobject
+ (
+ "solutionFaControl",
+ mesh.time().timeName(),
+ mesh.mesh()
+ ),
+ mesh_(mesh),
+ residualControl_(),
+ algorithmName_(algorithmName),
+ nNonOrthCorr_(0),
+ momentumPredictor_(true),
+ transonic_(false),
+ consistent_(false),
+ corr_(0),
+ corrNonOrtho_(0)
+{}
+
+
+// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
+
+Foam::solutionFaControl::~solutionFaControl()
+{}
+
+
+// ************************************************************************* //
diff --git a/src/finiteArea/cfdTools/general/solutionFaControl/solutionFaControl/solutionFaControl.H b/src/finiteArea/cfdTools/general/solutionFaControl/solutionFaControl/solutionFaControl.H
new file mode 100644
index 000000000..5b60be007
--- /dev/null
+++ b/src/finiteArea/cfdTools/general/solutionFaControl/solutionFaControl/solutionFaControl.H
@@ -0,0 +1,235 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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::solutionFaControl
+
+Description
+ Base class for solution control classes
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef solutionFaControl_H
+#define solutionFaControl_H
+
+#include "faMesh.H"
+#include "edgeMesh.H"
+#include "faePatchField.H"
+#include "faMatrices.H"
+#include "wordRe.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+/*---------------------------------------------------------------------------*\
+ Class solutionFaControl Declaration
+\*---------------------------------------------------------------------------*/
+
+class solutionFaControl
+:
+ public IOobject
+{
+public:
+
+ struct fieldData
+ {
+ wordRe name;
+ scalar absTol;
+ scalar relTol;
+ scalar initialResidual;
+ };
+
+
+protected:
+
+ // Protected data
+
+ //- Reference to the mesh database
+ faMesh& mesh_;
+
+ //- List of residual data per field
+ List residualControl_;
+
+ //- The dictionary name, e.g. SIMPLE, PIMPLE
+ const word algorithmName_;
+
+
+ // Solution controls
+
+ //- Maximum number of non-orthogonal correctors
+ label nNonOrthCorr_;
+
+ //- Flag to indicate to solve for momentum
+ bool momentumPredictor_;
+
+ //- Flag to indicate to solve using transonic algorithm
+ bool transonic_;
+
+ //- Flag to indicate to relax pressure using the
+ // "consistent" approach of SIMPLEC
+ bool consistent_;
+
+
+ // Eareaution
+
+ //- Current corrector loop index
+ label corr_;
+
+ //- Current non-orthogonal corrector loop index
+ label corrNonOrtho_;
+
+
+ // Protected Member Functions
+
+ //- Read controls from faSolution dictionary
+ virtual void read(const bool absTolOnly);
+
+ //- Read controls from faSolution dictionary
+ virtual void read();
+
+ //- Return index of field in residualControl_ if present
+ virtual label applyToField
+ (
+ const word& fieldName,
+ const bool useRegEx = true
+ ) const;
+
+ //- Return true if all convergence checks are satisfied
+ virtual bool criteriaSatisfied() = 0;
+
+ //- Store previous iteration fields
+ virtual void storePrevIterFields() const;
+
+ //- Store previous iteration field for areaFields
+ template
+ void storePrevIter() const;
+
+ template
+ void maxTypeResidual
+ (
+ const word& fieldName,
+ ITstream& data,
+ scalar& firstRes,
+ scalar& lastRes
+ ) const;
+
+ scalar maxResidual
+ (
+ const word& fieldName,
+ ITstream& data,
+ scalar& lastRes
+ ) const;
+
+
+private:
+
+ //- Disallow default bitwise copy construct
+ solutionFaControl(const solutionFaControl&);
+
+ //- Disallow default bitwise assignment
+ void operator=(const solutionFaControl&);
+
+
+public:
+
+
+ // Static Data Members
+
+ //- Run-time type information
+ TypeName("solutionFaControl");
+
+
+ // Constructors
+
+ //- Construct from mesh
+ solutionFaControl(faMesh& mesh, const word& algorithmName);
+
+
+ //- Destructor
+ virtual ~solutionFaControl();
+
+
+ // Member Functions
+
+ // Access
+
+ //- Return the solution dictionary
+ inline const dictionary& dict() const;
+
+ //- Current corrector loop index
+ inline label corr() const;
+
+ //- Current non-orthogonal corrector index
+ inline label corrNonOrtho() const;
+
+
+ // Solution control
+
+ //- Maximum number of non-orthogonal correctors
+ inline label nNonOrthCorr() const;
+
+ //- Helper function to identify final non-orthogonal iteration
+ inline bool finalNonOrthogonalIter() const;
+
+ //- Flag to indicate to solve for momentum
+ inline bool momentumPredictor() const;
+
+ //- Flag to indicate to solve using transonic algorithm
+ inline bool transonic() const;
+
+ //- Flag to indicate to relax pressure using the
+ // "consistent" approach of SIMPLEC
+ inline bool consistent() const;
+
+
+ // Eareaution
+
+ //- Main control loop
+ virtual bool loop() = 0;
+
+ //- Non-orthogonal corrector loop
+ inline bool correctNonOrthogonal();
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#include "solutionFaControlI.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#ifdef NoRepository
+ #include "solutionFaControlTemplates.C"
+#endif
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/cfdTools/general/solutionFaControl/solutionFaControl/solutionFaControlI.H b/src/finiteArea/cfdTools/general/solutionFaControl/solutionFaControl/solutionFaControlI.H
new file mode 100644
index 000000000..43310dda1
--- /dev/null
+++ b/src/finiteArea/cfdTools/general/solutionFaControl/solutionFaControl/solutionFaControlI.H
@@ -0,0 +1,98 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 .
+
+\*---------------------------------------------------------------------------*/
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+inline const Foam::dictionary& Foam::solutionFaControl::dict() const
+{
+ return mesh_.solutionDict().subDict(algorithmName_);
+}
+
+
+inline Foam::label Foam::solutionFaControl::corr() const
+{
+ return corr_;
+}
+
+
+inline Foam::label Foam::solutionFaControl::corrNonOrtho() const
+{
+ return corrNonOrtho_;
+}
+
+
+inline Foam::label Foam::solutionFaControl::nNonOrthCorr() const
+{
+ return nNonOrthCorr_;
+}
+
+
+inline bool Foam::solutionFaControl::finalNonOrthogonalIter() const
+{
+ return corrNonOrtho_ == nNonOrthCorr_ + 1;
+}
+
+
+inline bool Foam::solutionFaControl::momentumPredictor() const
+{
+ return momentumPredictor_;
+}
+
+
+inline bool Foam::solutionFaControl::transonic() const
+{
+ return transonic_;
+}
+
+
+inline bool Foam::solutionFaControl::consistent() const
+{
+ return consistent_;
+}
+
+
+inline bool Foam::solutionFaControl::correctNonOrthogonal()
+{
+ corrNonOrtho_++;
+
+ if (debug)
+ {
+ Info<< algorithmName_ << " correctNonOrthogonal: corrNonOrtho = "
+ << corrNonOrtho_ << endl;
+ }
+
+ if (corrNonOrtho_ <= nNonOrthCorr_ + 1)
+ {
+ return true;
+ }
+ else
+ {
+ corrNonOrtho_ = 0;
+ return false;
+ }
+}
+
+
+// ************************************************************************* //
diff --git a/src/finiteArea/cfdTools/general/solutionFaControl/solutionFaControl/solutionFaControlTemplates.C b/src/finiteArea/cfdTools/general/solutionFaControl/solutionFaControl/solutionFaControlTemplates.C
new file mode 100644
index 000000000..504bf42bc
--- /dev/null
+++ b/src/finiteArea/cfdTools/general/solutionFaControl/solutionFaControl/solutionFaControlTemplates.C
@@ -0,0 +1,66 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 "GeometricField.H"
+#include "areaMesh.H"
+#include "faPatchField.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+template
+void Foam::solutionFaControl::storePrevIter() const
+{
+ typedef GeometricField GeoField;
+
+ HashTable
+ flds(mesh_.db().objectRegistry::lookupClass());
+
+ forAllIter(typename HashTable, flds, iter)
+ {
+ const GeoField& fld = *iter();
+
+ const word& fName = fld.name();
+
+ size_t prevIterField = fName.find("PrevIter");
+
+ if
+ (
+ (prevIterField == word::npos)
+ && mesh_.solutionDict().relaxField(fName)
+ )
+ {
+ if (debug)
+ {
+ Info<< algorithmName_ << ": storing previous iter for "
+ << fName << endl;
+ }
+
+ fld.storePrevIter();
+ }
+ }
+}
+
+
+// ************************************************************************* //
diff --git a/src/finiteArea/faMatrices/faMatrix/faMatrixSolve.C b/src/finiteArea/faMatrices/faMatrix/faMatrixSolve.C
index 948c04b51..126ead1b3 100644
--- a/src/finiteArea/faMatrices/faMatrix/faMatrixSolve.C
+++ b/src/finiteArea/faMatrices/faMatrix/faMatrixSolve.C
@@ -60,7 +60,7 @@ lduSolverPerformance faMatrix::solve(const dictionary& solverControls)
<< endl;
}
- lduSolverPerformance solverPerfVec
+ BlockSolverPerformance solverPerfVec
(
"faMatrix::solve",
psi_.name()
@@ -134,14 +134,7 @@ lduSolverPerformance faMatrix::solve(const dictionary& solverControls)
solverPerf.print();
- if
- (
- solverPerf.initialResidual() > solverPerfVec.initialResidual()
- && !solverPerf.singular()
- )
- {
- solverPerfVec = solverPerf;
- }
+ solverPerfVec.replace(cmpt, solverPerf);
psi.internalField().replace(cmpt, psiCmpt);
diag() = saveDiag;
@@ -149,7 +142,9 @@ lduSolverPerformance faMatrix::solve(const dictionary& solverControls)
psi.correctBoundaryConditions();
- return solverPerfVec;
+ psi_.mesh().solutionDict().setSolverPerformance(psi_.name(), solverPerfVec);
+
+ return solverPerfVec.max();
}
diff --git a/src/finiteArea/faMatrices/faScalarMatrix/faScalarMatrix.C b/src/finiteArea/faMatrices/faScalarMatrix/faScalarMatrix.C
index 5b89e8903..85bd8d706 100644
--- a/src/finiteArea/faMatrices/faScalarMatrix/faScalarMatrix.C
+++ b/src/finiteArea/faMatrices/faScalarMatrix/faScalarMatrix.C
@@ -130,6 +130,8 @@ lduSolverPerformance faMatrix::faSolver::solve
psi.correctBoundaryConditions();
+ psi.mesh().solutionDict().setSolverPerformance(psi.name(), solverPerf);
+
return solverPerf;
}
@@ -177,6 +179,8 @@ lduSolverPerformance faMatrix::solve
psi.correctBoundaryConditions();
+ psi_.mesh().solutionDict().setSolverPerformance(psi_.name(), solverPerf);
+
return solverPerf;
}
diff --git a/src/finiteArea/fields/areaFields/areaVectorNFields.C b/src/finiteArea/fields/areaFields/areaVectorNFields.C
new file mode 100644
index 000000000..e157f56c8
--- /dev/null
+++ b/src/finiteArea/fields/areaFields/areaVectorNFields.C
@@ -0,0 +1,55 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 "areaVectorNFields.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+#define doMakeAreaFields(type, Type, args...) \
+ defineTemplateTypeNameAndDebug( \
+ area##Type##Field::DimensionedInternalField, 0); \
+ \
+ defineTemplateTypeNameAndDebug(area##Type##Field, 0);
+
+forAllVectorNTypes(doMakeAreaFields)
+
+forAllTensorNTypes(doMakeAreaFields)
+
+forAllDiagTensorNTypes(doMakeAreaFields)
+
+forAllSphericalTensorNTypes(doMakeAreaFields)
+
+#undef doMakeAreaFields
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/finiteArea/fields/areaFields/areaVectorNFields.H b/src/finiteArea/fields/areaFields/areaVectorNFields.H
new file mode 100644
index 000000000..db79bb70d
--- /dev/null
+++ b/src/finiteArea/fields/areaFields/areaVectorNFields.H
@@ -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 .
+
+Class
+ areaVectorNFields
+
+Description
+
+SourceFiles
+ areaVectorNFields.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef areaVectorNFields_H
+#define areaVectorNFields_H
+
+#include "areaFields.H"
+#include "areaVectorNFieldsFwd.H"
+#include "GeometricVectorNFields.H"
+#include "GeometricTensorNFields.H"
+#include "GeometricDiagTensorNFields.H"
+#include "GeometricSphericalTensorNFields.H"
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/areaFields/areaVectorNFieldsFwd.H b/src/finiteArea/fields/areaFields/areaVectorNFieldsFwd.H
new file mode 100644
index 000000000..9edc6eaa0
--- /dev/null
+++ b/src/finiteArea/fields/areaFields/areaVectorNFieldsFwd.H
@@ -0,0 +1,77 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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
+ areaVectorNFields
+
+Description
+
+SourceFiles
+ areaVectorNFields.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef areaVectorNFieldsFwd_H
+#define areaVectorNFieldsFwd_H
+
+#include "areaFieldsFwd.H"
+
+#include "VectorNFieldTypes.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+class areaMesh;
+
+template
+class faPatchField;
+
+template class PatchField, class GeoMesh>
+class GeometricField;
+
+#define doMakeTypedefs(type, Type, args...) \
+ typedef GeometricField area##Type##Field;
+
+forAllVectorNTypes(doMakeTypedefs)
+
+forAllTensorNTypes(doMakeTypedefs)
+
+forAllDiagTensorNTypes(doMakeTypedefs)
+
+forAllSphericalTensorNTypes(doMakeTypedefs)
+
+#undef doMakeTypedefs
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/edgeFields/edgeVectorNFields.C b/src/finiteArea/fields/edgeFields/edgeVectorNFields.C
new file mode 100644
index 000000000..7bd54b157
--- /dev/null
+++ b/src/finiteArea/fields/edgeFields/edgeVectorNFields.C
@@ -0,0 +1,55 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 "edgeVectorNFields.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+#define doMakeEdgeFields(type, Type, args...) \
+ defineTemplateTypeNameAndDebug( \
+ edge##Type##Field::DimensionedInternalField, 0); \
+ \
+ defineTemplateTypeNameAndDebug(edge##Type##Field, 0);
+
+forAllVectorNTypes(doMakeEdgeFields)
+
+forAllTensorNTypes(doMakeEdgeFields)
+
+forAllDiagTensorNTypes(doMakeEdgeFields)
+
+forAllSphericalTensorNTypes(doMakeEdgeFields)
+
+#undef doMakeEdgeFields
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/finiteArea/fields/edgeFields/edgeVectorNFields.H b/src/finiteArea/fields/edgeFields/edgeVectorNFields.H
new file mode 100644
index 000000000..521deb0bf
--- /dev/null
+++ b/src/finiteArea/fields/edgeFields/edgeVectorNFields.H
@@ -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 .
+
+Class
+ edgeVectorNFields
+
+Description
+
+SourceFiles
+ edgeVectorNFields.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef edgeVectorNFields_H
+#define edgeVectorNFields_H
+
+#include "edgeFields.H"
+#include "edgeVectorNFieldsFwd.H"
+#include "GeometricVectorNFields.H"
+#include "GeometricTensorNFields.H"
+#include "GeometricDiagTensorNFields.H"
+#include "GeometricSphericalTensorNFields.H"
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/edgeFields/edgeVectorNFieldsFwd.H b/src/finiteArea/fields/edgeFields/edgeVectorNFieldsFwd.H
new file mode 100644
index 000000000..77259233e
--- /dev/null
+++ b/src/finiteArea/fields/edgeFields/edgeVectorNFieldsFwd.H
@@ -0,0 +1,77 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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
+ edgeVectorNFields
+
+Description
+
+SourceFiles
+ edgeVectorNFields.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef edgeVectorNFieldsFwd_H
+#define edgeVectorNFieldsFwd_H
+
+#include "edgeFieldsFwd.H"
+
+#include "VectorNFieldTypes.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+class edgeMesh;
+
+template
+class faePatchField;
+
+template class PatchField, class GeoMesh>
+class GeometricField;
+
+#define doMakeTypedefs(type, Type, args...) \
+ typedef GeometricField edge##Type##Field;
+
+forAllVectorNTypes(doMakeTypedefs)
+
+forAllTensorNTypes(doMakeTypedefs)
+
+forAllDiagTensorNTypes(doMakeTypedefs)
+
+forAllSphericalTensorNTypes(doMakeTypedefs)
+
+#undef doMakeTypedefs
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/basic/calculated/calculatedFaPatchVectorNFields.C b/src/finiteArea/fields/faPatchFields/basic/calculated/calculatedFaPatchVectorNFields.C
new file mode 100644
index 000000000..4b804b3e7
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/basic/calculated/calculatedFaPatchVectorNFields.C
@@ -0,0 +1,60 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 "calculatedFaPatchVectorNFields.H"
+#include "faPatchVectorNFields.H"
+#include "areaMesh.H"
+#include "addToRunTimeSelectionTable.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+#define doMakePatchTypeField(type, Type, args...) \
+ \
+makeTemplateFaPatchTypeField \
+( \
+ faPatch##Type##Field, \
+ calculatedFaPatch##Type##Field \
+);
+
+forAllVectorNTypes(doMakePatchTypeField)
+
+forAllTensorNTypes(doMakePatchTypeField)
+
+forAllDiagTensorNTypes(doMakePatchTypeField)
+
+forAllSphericalTensorNTypes(doMakePatchTypeField)
+
+#undef doMakePatchTypeField
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/basic/calculated/calculatedFaPatchVectorNFields.H b/src/finiteArea/fields/faPatchFields/basic/calculated/calculatedFaPatchVectorNFields.H
new file mode 100644
index 000000000..27b94e7c1
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/basic/calculated/calculatedFaPatchVectorNFields.H
@@ -0,0 +1,37 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef calculatedFaPatchVectorNFields_H
+#define calculatedFaPatchVectorNFields_H
+
+#include "areaVectorNFields.H"
+#include "faPatchVectorNFields.H"
+
+#include "calculatedFaPatchVectorNFieldsFwd.H"
+#include "calculatedFaPatchField.H"
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/basic/calculated/calculatedFaPatchVectorNFieldsFwd.H b/src/finiteArea/fields/faPatchFields/basic/calculated/calculatedFaPatchVectorNFieldsFwd.H
new file mode 100644
index 000000000..fe48029b8
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/basic/calculated/calculatedFaPatchVectorNFieldsFwd.H
@@ -0,0 +1,61 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef calculatedFaPatchVectorNFieldsFwd_H
+#define calculatedFaPatchVectorNFieldsFwd_H
+
+#include "VectorNFieldTypes.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+template class calculatedFaPatchField;
+
+#define makeTypedef(type, Type, args...) \
+ typedef calculatedFaPatchField calculatedFaPatch##Type##Field;
+
+forAllVectorNTypes(makeTypedef)
+
+forAllTensorNTypes(makeTypedef)
+
+forAllDiagTensorNTypes(makeTypedef)
+
+forAllSphericalTensorNTypes(makeTypedef)
+
+#undef makeTypedef
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/basic/coupled/coupledFaPatchVectorNFields.C b/src/finiteArea/fields/faPatchFields/basic/coupled/coupledFaPatchVectorNFields.C
new file mode 100644
index 000000000..9f6d6fa76
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/basic/coupled/coupledFaPatchVectorNFields.C
@@ -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 .
+
+\*---------------------------------------------------------------------------*/
+
+#include "coupledFaPatchVectorNFields.H"
+#include "addToRunTimeSelectionTable.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+#define doMakePatchTypeField(type, Type, args...) \
+ makeFaPatchTypeFieldTypeName(coupledFaPatch##Type##Field);
+
+forAllVectorNTypes(doMakePatchTypeField)
+
+forAllTensorNTypes(doMakePatchTypeField)
+
+forAllDiagTensorNTypes(doMakePatchTypeField)
+
+forAllSphericalTensorNTypes(doMakePatchTypeField)
+
+
+#undef doMakePatchTypeField
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/basic/coupled/coupledFaPatchVectorNFields.H b/src/finiteArea/fields/faPatchFields/basic/coupled/coupledFaPatchVectorNFields.H
new file mode 100644
index 000000000..f9153024c
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/basic/coupled/coupledFaPatchVectorNFields.H
@@ -0,0 +1,38 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef coupledFaPatchVectorNFields_H
+#define coupledFaPatchVectorNFields_H
+
+#include "areaVectorNFields.H"
+#include "faPatchVectorNFields.H"
+
+#include "coupledFaPatchVectorNFieldsFwd.H"
+#include "coupledFaPatchField.H"
+
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/basic/coupled/coupledFaPatchVectorNFieldsFwd.H b/src/finiteArea/fields/faPatchFields/basic/coupled/coupledFaPatchVectorNFieldsFwd.H
new file mode 100644
index 000000000..e79ed7f71
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/basic/coupled/coupledFaPatchVectorNFieldsFwd.H
@@ -0,0 +1,61 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef coupledFaPatchFieldsFwd_H
+#define coupledFaPatchFieldsFwd_H
+
+#include "VectorNFieldTypes.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+template class coupledFaPatchField;
+
+#define makeTypedef(type, Type, args...) \
+ typedef coupledFaPatchField coupledFaPatch##Type##Field;
+
+forAllVectorNTypes(makeTypedef)
+
+forAllTensorNTypes(makeTypedef)
+
+forAllDiagTensorNTypes(makeTypedef)
+
+forAllSphericalTensorNTypes(makeTypedef)
+
+#undef makeTypedef
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/basic/fixedGradient/fixedGradientFaPatchVectorNFields.C b/src/finiteArea/fields/faPatchFields/basic/fixedGradient/fixedGradientFaPatchVectorNFields.C
new file mode 100644
index 000000000..6f90224ec
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/basic/fixedGradient/fixedGradientFaPatchVectorNFields.C
@@ -0,0 +1,59 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 "fixedGradientFaPatchVectorNFields.H"
+#include "addToRunTimeSelectionTable.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+#define doMakePatchTypeField(type, Type, args...) \
+ \
+makeTemplateFaPatchTypeField \
+( \
+ faPatch##Type##Field, \
+ fixedGradientFaPatch##Type##Field \
+);
+
+forAllVectorNTypes(doMakePatchTypeField)
+
+forAllTensorNTypes(doMakePatchTypeField)
+
+forAllDiagTensorNTypes(doMakePatchTypeField)
+
+forAllSphericalTensorNTypes(doMakePatchTypeField)
+
+
+#undef doMakePatchTypeField
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/basic/fixedGradient/fixedGradientFaPatchVectorNFields.H b/src/finiteArea/fields/faPatchFields/basic/fixedGradient/fixedGradientFaPatchVectorNFields.H
new file mode 100644
index 000000000..dbea67e95
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/basic/fixedGradient/fixedGradientFaPatchVectorNFields.H
@@ -0,0 +1,39 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef fixedGradientFaPatchVectorNFields_H
+#define fixedGradientFaPatchVectorNFields_H
+
+#include "areaVectorNFields.H"
+#include "faPatchVectorNFields.H"
+
+#include "fixedGradientFaPatchVectorNFieldsFwd.H"
+#include "fixedGradientFaPatchField.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/basic/fixedGradient/fixedGradientFaPatchVectorNFieldsFwd.H b/src/finiteArea/fields/faPatchFields/basic/fixedGradient/fixedGradientFaPatchVectorNFieldsFwd.H
new file mode 100644
index 000000000..de636c3ba
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/basic/fixedGradient/fixedGradientFaPatchVectorNFieldsFwd.H
@@ -0,0 +1,61 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef fixedGradientFaPatchVectorNFieldsFwd_H
+#define fixedGradientFaPatchVectorNFieldsFwd_H
+
+#include "VectorNFieldTypes.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+template class fixedGradientFaPatchField;
+
+#define makeTypedef(type, Type, args...) \
+ typedef fixedGradientFaPatchField fixedGradientFaPatch##Type##Field;
+
+forAllVectorNTypes(makeTypedef)
+
+forAllTensorNTypes(makeTypedef)
+
+forAllDiagTensorNTypes(makeTypedef)
+
+forAllSphericalTensorNTypes(makeTypedef)
+
+#undef makeTypedef
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/basic/fixedValue/fixedValueFaPatchVectorNFields.C b/src/finiteArea/fields/faPatchFields/basic/fixedValue/fixedValueFaPatchVectorNFields.C
new file mode 100644
index 000000000..0e58a99da
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/basic/fixedValue/fixedValueFaPatchVectorNFields.C
@@ -0,0 +1,59 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 "fixedValueFaPatchVectorNFields.H"
+#include "addToRunTimeSelectionTable.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+#define doMakePatchTypeField(type, Type, args...) \
+ \
+makeTemplateFaPatchTypeField \
+( \
+ faPatch##Type##Field, \
+ fixedValueFaPatch##Type##Field \
+);
+
+forAllVectorNTypes(doMakePatchTypeField)
+
+forAllTensorNTypes(doMakePatchTypeField)
+
+forAllDiagTensorNTypes(doMakePatchTypeField)
+
+forAllSphericalTensorNTypes(doMakePatchTypeField)
+
+
+#undef doMakePatchTypeField
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/basic/fixedValue/fixedValueFaPatchVectorNFields.H b/src/finiteArea/fields/faPatchFields/basic/fixedValue/fixedValueFaPatchVectorNFields.H
new file mode 100644
index 000000000..feb38fc1b
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/basic/fixedValue/fixedValueFaPatchVectorNFields.H
@@ -0,0 +1,39 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef fixedValueFaPatchVectorNFields_H
+#define fixedValueFaPatchVectorNFields_H
+
+#include "areaVectorNFields.H"
+#include "faPatchVectorNFields.H"
+
+#include "fixedValueFaPatchVectorNFieldsFwd.H"
+#include "fixedValueFaPatchField.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/basic/fixedValue/fixedValueFaPatchVectorNFieldsFwd.H b/src/finiteArea/fields/faPatchFields/basic/fixedValue/fixedValueFaPatchVectorNFieldsFwd.H
new file mode 100644
index 000000000..0d233168b
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/basic/fixedValue/fixedValueFaPatchVectorNFieldsFwd.H
@@ -0,0 +1,61 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef fixedValueFaPatchVectorNFieldsFwd_H
+#define fixedValueFaPatchVectorNFieldsFwd_H
+
+#include "VectorNFieldTypes.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+template class fixedValueFaPatchField;
+
+#define makeTypedef(type, Type, args...) \
+ typedef fixedValueFaPatchField fixedValueFaPatch##Type##Field;
+
+forAllVectorNTypes(makeTypedef)
+
+forAllTensorNTypes(makeTypedef)
+
+forAllDiagTensorNTypes(makeTypedef)
+
+forAllSphericalTensorNTypes(makeTypedef)
+
+#undef makeTypedef
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/basic/transform/transformFaPatchVectorNFields.C b/src/finiteArea/fields/faPatchFields/basic/transform/transformFaPatchVectorNFields.C
new file mode 100644
index 000000000..ee663771b
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/basic/transform/transformFaPatchVectorNFields.C
@@ -0,0 +1,53 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 "transformFaPatchVectorNFields.H"
+#include "addToRunTimeSelectionTable.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+#define makePatch(type, Type, args...) \
+ defineNamedTemplateTypeNameAndDebug(transformFaPatch##Type##Field, 0);
+
+forAllVectorNTypes(makePatch)
+
+forAllTensorNTypes(makePatch)
+
+forAllDiagTensorNTypes(makePatch)
+
+forAllSphericalTensorNTypes(makePatch)
+
+#undef makePatch
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/basic/transform/transformFaPatchVectorNFields.H b/src/finiteArea/fields/faPatchFields/basic/transform/transformFaPatchVectorNFields.H
new file mode 100644
index 000000000..1e7047f8e
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/basic/transform/transformFaPatchVectorNFields.H
@@ -0,0 +1,40 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef transformFaPatchVectorNFields_H
+#define transformFaPatchVectorNFields_H
+
+#include "areaVectorNFields.H"
+#include "faPatchVectorNFields.H"
+#include "VectorNFieldTypes.H"
+
+#include "transformFaPatchVectorNFieldsFwd.H"
+#include "transformFaPatchFields.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/basic/transform/transformFaPatchVectorNFieldsFwd.H b/src/finiteArea/fields/faPatchFields/basic/transform/transformFaPatchVectorNFieldsFwd.H
new file mode 100644
index 000000000..dfce564b8
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/basic/transform/transformFaPatchVectorNFieldsFwd.H
@@ -0,0 +1,57 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef transformFaPatchVectorNFieldsFwd_H
+#define transformFaPatchVectorNFieldsFwd_H
+
+#include "VectorNFieldTypes.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+template class transformFaPatchField;
+
+#define makeTypedef(type, Type, args...) \
+ typedef transformFaPatchField transformFaPatch##Type##Field;
+
+forAllVectorNTypes(makeTypedef)
+
+forAllTensorNTypes(makeTypedef)
+
+forAllDiagTensorNTypes(makeTypedef)
+
+forAllSphericalTensorNTypes(makeTypedef)
+
+#undef makeTypedef
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/basic/zeroGradient/zeroGradientFaPatchVectorNFields.C b/src/finiteArea/fields/faPatchFields/basic/zeroGradient/zeroGradientFaPatchVectorNFields.C
new file mode 100644
index 000000000..1be998c31
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/basic/zeroGradient/zeroGradientFaPatchVectorNFields.C
@@ -0,0 +1,59 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 "zeroGradientFaPatchVectorNFields.H"
+#include "addToRunTimeSelectionTable.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+#define doMakePatchTypeField(type, Type, args...) \
+ \
+makeTemplateFaPatchTypeField \
+( \
+ faPatch##Type##Field, \
+ zeroGradientFaPatch##Type##Field \
+);
+
+forAllVectorNTypes(doMakePatchTypeField)
+
+forAllTensorNTypes(doMakePatchTypeField)
+
+forAllDiagTensorNTypes(doMakePatchTypeField)
+
+forAllSphericalTensorNTypes(doMakePatchTypeField)
+
+
+#undef doMakePatchTypeField
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/basic/zeroGradient/zeroGradientFaPatchVectorNFields.H b/src/finiteArea/fields/faPatchFields/basic/zeroGradient/zeroGradientFaPatchVectorNFields.H
new file mode 100644
index 000000000..acb6598b0
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/basic/zeroGradient/zeroGradientFaPatchVectorNFields.H
@@ -0,0 +1,39 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef zeroGradientFaPatchVectorNFields_H
+#define zeroGradientFaPatchVectorNFields_H
+
+#include "areaVectorNFields.H"
+#include "faPatchVectorNFields.H"
+
+#include "zeroGradientFaPatchVectorNFieldsFwd.H"
+#include "zeroGradientFaPatchField.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/basic/zeroGradient/zeroGradientFaPatchVectorNFieldsFwd.H b/src/finiteArea/fields/faPatchFields/basic/zeroGradient/zeroGradientFaPatchVectorNFieldsFwd.H
new file mode 100644
index 000000000..a5e887ef1
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/basic/zeroGradient/zeroGradientFaPatchVectorNFieldsFwd.H
@@ -0,0 +1,61 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef zeroGradientFaPatchVectorNFieldsFwd_H
+#define zeroGradientFaPatchVectorNFieldsFwd_H
+
+#include "VectorNFieldTypes.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+template class zeroGradientFaPatchField;
+
+#define makeTypedef(type, Type, args...) \
+ typedef zeroGradientFaPatchField zeroGradientFaPatch##Type##Field;
+
+forAllVectorNTypes(makeTypedef)
+
+forAllTensorNTypes(makeTypedef)
+
+forAllDiagTensorNTypes(makeTypedef)
+
+forAllSphericalTensorNTypes(makeTypedef)
+
+#undef makeTypedef
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchField.H b/src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchField.H
index eb86cc034..2929f0d66 100644
--- a/src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchField.H
+++ b/src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchField.H
@@ -164,7 +164,37 @@ public:
const direction cmpt
) const
{
- cyclicLduInterfaceField::transformCoupleField(f, cmpt);
+ // See comments in cyclicLduInterfaceField
+ // HJ, 3/Sep/2015
+// cyclicLduInterfaceField::transformCoupleField(f, cmpt);
+ if (doTransform())
+ {
+ label sizeby2 = f.size()/2;
+
+ Type powFwdTransform = transform
+ (
+ this->forwardT()[0],
+ pTraits::one
+ );
+
+ scalar forwardScale =
+ pow(component(powFwdTransform, cmpt), rank());
+
+ Type powRevTransform = transform
+ (
+ this->reverseT()[0],
+ pTraits::one
+ );
+
+ scalar reverseScale =
+ pow(component(powRevTransform, cmpt), rank());
+
+ for (label facei = 0; facei < sizeby2; facei++)
+ {
+ f[facei] *= forwardScale;
+ f[facei + sizeby2] *= reverseScale;
+ }
+ }
}
//- Update result field based on interface functionality
@@ -180,6 +210,27 @@ public:
) const;
+ // Block coupled interface functionality
+
+ //- Update result field based on interface functionality
+ virtual void updateInterfaceMatrix
+ (
+ const Field&,
+ Field&,
+ const BlockLduMatrix&,
+ const CoeffField&,
+ const Pstream::commsTypes commsType,
+ const bool switchToLhs
+ ) const
+ {
+ notImplemented
+ (
+ "cyclicFaPatchField::"
+ "updateInterfaceMatrix for block matrices"
+ );
+ }
+
+
//- Cyclic coupled interface functions
//- Does the patch field perform the transfromation
diff --git a/src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchVectorNFields.C b/src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchVectorNFields.C
new file mode 100644
index 000000000..193a8f811
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchVectorNFields.C
@@ -0,0 +1,109 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 "cyclicFaPatchVectorNFields.H"
+#include "addToRunTimeSelectionTable.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+#define VectorNMatrixInterfaceFunc(Type) \
+template<> \
+void cyclicFaPatchField::updateInterfaceMatrix \
+( \
+ const Field& psiInternal, \
+ Field& result, \
+ const BlockLduMatrix&, \
+ const CoeffField& coeffs, \
+ const Pstream::commsTypes commsType, \
+ const bool switchToLhs \
+) const \
+{ \
+ Field pnf(this->size()); \
+ \
+ label sizeby2 = this->size()/2; \
+ const unallocLabelList& faceCells = cyclicPatch_.faceCells(); \
+ \
+ for (label facei=0; facei .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef cyclicFaPatchVectorNFields_H
+#define cyclicFaPatchVectorNFields_H
+
+#include "areaVectorNFields.H"
+#include "faPatchVectorNFields.H"
+
+#include "cyclicFaPatchVectorNFieldsFwd.H"
+#include "cyclicFaPatchField.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchVectorNFieldsFwd.H b/src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchVectorNFieldsFwd.H
new file mode 100644
index 000000000..2f96f84a4
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchVectorNFieldsFwd.H
@@ -0,0 +1,55 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef cyclicFaPatchVectorNFieldsFwd_H
+#define cyclicFaPatchVectorNFieldsFwd_H
+
+#include "VectorNFieldTypes.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+template class cyclicFaPatchField;
+
+#define makeTypedef(type, Type, args...) \
+ typedef cyclicFaPatchField cyclicFaPatch##Type##Field;
+
+forAllVectorNTypes(makeTypedef)
+
+#undef makeTypedef
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/constraint/empty/emptyFaPatchVectorNFields.C b/src/finiteArea/fields/faPatchFields/constraint/empty/emptyFaPatchVectorNFields.C
new file mode 100644
index 000000000..f14b7c820
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/constraint/empty/emptyFaPatchVectorNFields.C
@@ -0,0 +1,59 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 "emptyFaPatchVectorNFields.H"
+#include "addToRunTimeSelectionTable.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+#define doMakePatchTypeField(type, Type, args...) \
+ \
+makeTemplateFaPatchTypeField \
+( \
+ faPatch##Type##Field, \
+ emptyFaPatch##Type##Field \
+);
+
+forAllVectorNTypes(doMakePatchTypeField)
+
+forAllTensorNTypes(doMakePatchTypeField)
+
+forAllDiagTensorNTypes(doMakePatchTypeField)
+
+forAllSphericalTensorNTypes(doMakePatchTypeField)
+
+
+#undef doMakePatchTypeField
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/constraint/empty/emptyFaPatchVectorNFields.H b/src/finiteArea/fields/faPatchFields/constraint/empty/emptyFaPatchVectorNFields.H
new file mode 100644
index 000000000..7c7df0fa6
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/constraint/empty/emptyFaPatchVectorNFields.H
@@ -0,0 +1,39 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef emptyFaPatchVectorNFields_H
+#define emptyFaPatchVectorNFields_H
+
+#include "areaVectorNFields.H"
+#include "faPatchVectorNFields.H"
+
+#include "emptyFaPatchVectorNFieldsFwd.H"
+#include "emptyFaPatchField.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/constraint/empty/emptyFaPatchVectorNFieldsFwd.H b/src/finiteArea/fields/faPatchFields/constraint/empty/emptyFaPatchVectorNFieldsFwd.H
new file mode 100644
index 000000000..21e43748d
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/constraint/empty/emptyFaPatchVectorNFieldsFwd.H
@@ -0,0 +1,61 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef emptyFaPatchVectorNFieldsFwd_H
+#define emptyFaPatchVectorNFieldsFwd_H
+
+#include "VectorNFieldTypes.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+template class emptyFaPatchField;
+
+#define makeTypedef(type, Type, args...) \
+ typedef emptyFaPatchField emptyFaPatch##Type##Field;
+
+forAllVectorNTypes(makeTypedef)
+
+forAllTensorNTypes(makeTypedef)
+
+forAllDiagTensorNTypes(makeTypedef)
+
+forAllSphericalTensorNTypes(makeTypedef)
+
+#undef makeTypedef
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchField.C b/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchField.C
index 3537b4c27..68fd084d0 100644
--- a/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchField.C
+++ b/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchField.C
@@ -83,7 +83,7 @@ processorFaPatchField::processorFaPatchField
"(\n"
" const processorFaPatchField& ptf,\n"
" const faPatch& p,\n"
- " const DimensionedField& iF,\n"
+ " const DimensionedField& iF,\n"
" const faPatchFieldMapper& mapper\n"
")\n"
) << "\n patch type '" << p.type()
diff --git a/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchField.H b/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchField.H
index 4f730752f..21e397cdc 100644
--- a/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchField.H
+++ b/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchField.H
@@ -22,7 +22,7 @@ License
along with foam-extend. If not, see .
Class
- processorFvPatchField
+ processorFaPatchField
Description
diff --git a/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchVectorNFields.C b/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchVectorNFields.C
new file mode 100644
index 000000000..39e29619e
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchVectorNFields.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 .
+
+\*---------------------------------------------------------------------------*/
+
+#include "processorFaPatchVectorNFields.H"
+#include "addToRunTimeSelectionTable.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+#define doMakePatchTypeField(type, Type, args...) \
+ \
+makeTemplateFaPatchTypeField \
+( \
+ faPatch##Type##Field, \
+ processorFaPatch##Type##Field \
+);
+
+forAllVectorNTypes(doMakePatchTypeField)
+
+#undef doMakePatchTypeField
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchVectorNFields.H b/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchVectorNFields.H
new file mode 100644
index 000000000..bf0441867
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchVectorNFields.H
@@ -0,0 +1,39 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef processorFaPatchVectorNFields_H
+#define processorFaPatchVectorNFields_H
+
+#include "areaVectorNFields.H"
+#include "faPatchVectorNFields.H"
+
+#include "processorFaPatchVectorNFieldsFwd.H"
+#include "processorFaPatchField.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchVectorNFieldsFwd.H b/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchVectorNFieldsFwd.H
new file mode 100644
index 000000000..59603e92f
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchVectorNFieldsFwd.H
@@ -0,0 +1,55 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef processorFaPatchVectorNFieldsFwd_H
+#define processorFaPatchVectorNFieldsFwd_H
+
+#include "VectorNFieldTypes.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+template class processorFaPatchField;
+
+#define makeTypedef(type, Type, args...) \
+ typedef processorFaPatchField processorFaPatch##Type##Field;
+
+forAllVectorNTypes(makeTypedef)
+
+#undef makeTypedef
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchFieldsFwd.H b/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchFieldsFwd.H
index a36300dab..0d98a15d0 100644
--- a/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchFieldsFwd.H
+++ b/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchFieldsFwd.H
@@ -22,7 +22,7 @@ License
along with foam-extend. If not, see .
Class
- wedgeFvPatchField
+ wedgeFaPatchField
\*---------------------------------------------------------------------------*/
@@ -44,7 +44,7 @@ template class wedgeFaPatchField;
// typedef wedgeFaPatchField wedgeFaPatchVectorField;
// typedef wedgeFaPatchField wedgeFaPatchTensorField;
-// template class wedgeFvPatchField;
+// template class wedgeFaPatchField;
makeFaPatchTypeFieldTypedefs(wedge)
diff --git a/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchVectorNFields.C b/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchVectorNFields.C
new file mode 100644
index 000000000..990222847
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchVectorNFields.C
@@ -0,0 +1,99 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 "wedgeFaPatchVectorNFields.H"
+#include "addToRunTimeSelectionTable.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+#define makeVectorTensorNWedgeFuncDefs(Type) \
+template<> \
+tmp > wedgeFaPatchField::snGrad() const \
+{ \
+ return tmp > \
+ ( \
+ new Field(size(), pTraits::zero) \
+ ); \
+} \
+ \
+template<> \
+void wedgeFaPatchField::evaluate \
+( \
+ const Pstream::commsTypes commsType \
+) \
+{ \
+ if (!updated()) \
+ { \
+ updateCoeffs(); \
+ } \
+ \
+ this->operator==(patchInternalField()); \
+} \
+ \
+template<> \
+tmp > wedgeFaPatchField::snGradTransformDiag() \
+const \
+{ \
+ return tmp > \
+ ( \
+ new Field(this->size(), pTraits::zero) \
+ ); \
+}
+
+
+#define doMakePatchTypeField(type, Type, args...) \
+ \
+makeVectorTensorNWedgeFuncDefs(type) \
+ \
+makeTemplateFaPatchTypeField \
+( \
+ faPatch##Type##Field, \
+ wedgeFaPatch##Type##Field \
+);
+
+
+forAllVectorNTypes(doMakePatchTypeField)
+
+forAllTensorNTypes(doMakePatchTypeField)
+
+forAllDiagTensorNTypes(doMakePatchTypeField)
+
+forAllSphericalTensorNTypes(doMakePatchTypeField)
+
+
+#undef doMakePatchTypeField
+
+#undef makeVectorTensorNWedgeFuncDefs
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchVectorNFields.H b/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchVectorNFields.H
new file mode 100644
index 000000000..9e0e674ec
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchVectorNFields.H
@@ -0,0 +1,74 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef wedgeFaPatchVectorNFields_H
+#define wedgeFaPatchVectorNFields_H
+
+#include "areaVectorNFields.H"
+#include "faPatchVectorNFields.H"
+
+#include "wedgeFaPatchVectorNFieldsFwd.H"
+#include "wedgeFaPatchField.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#define doMakeVectorTensorNWedgeFuncDefs(type, Type, args...) \
+template<> \
+tmp > wedgeFaPatchField::snGrad() const; \
+ \
+template<> \
+void wedgeFaPatchField::evaluate \
+( \
+ const Pstream::commsTypes commsType \
+); \
+ \
+template<> \
+tmp > \
+wedgeFaPatchField::snGradTransformDiag() const;
+
+forAllVectorNTypes(doMakeVectorTensorNWedgeFuncDefs)
+
+forAllTensorNTypes(doMakeVectorTensorNWedgeFuncDefs)
+
+forAllDiagTensorNTypes(doMakeVectorTensorNWedgeFuncDefs)
+
+forAllSphericalTensorNTypes(doMakeVectorTensorNWedgeFuncDefs)
+
+#undef doMakeVectorTensorNWedgeFuncDefs
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchVectorNFieldsFwd.H b/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchVectorNFieldsFwd.H
new file mode 100644
index 000000000..b2db6c231
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchVectorNFieldsFwd.H
@@ -0,0 +1,61 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef wedgeFaPatchVectorNFieldsFwd_H
+#define wedgeFaPatchVectorNFieldsFwd_H
+
+#include "VectorNFieldTypes.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+template class wedgeFaPatchField;
+
+#define makeTypedef(type, Type, args...) \
+ typedef wedgeFaPatchField wedgeFaPatch##Type##Field;
+
+forAllVectorNTypes(makeTypedef)
+
+forAllTensorNTypes(makeTypedef)
+
+forAllDiagTensorNTypes(makeTypedef)
+
+forAllSphericalTensorNTypes(makeTypedef)
+
+#undef makeTypedef
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/faPatchField/faPatchVectorNFields.C b/src/finiteArea/fields/faPatchFields/faPatchField/faPatchVectorNFields.C
new file mode 100644
index 000000000..5eab483ed
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/faPatchField/faPatchVectorNFields.C
@@ -0,0 +1,68 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 "faPatchVectorNFields.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+#define makeFaPatchField(faPatchTypeField) \
+ \
+defineNamedTemplateTypeNameAndDebug(faPatchTypeField, 0); \
+template<> \
+Foam::debug::debugSwitch \
+faPatchTypeField::disallowDefaultFaPatchField \
+( \
+ "disallowDefaultFaPatchField", \
+ 0 \
+); \
+defineTemplateRunTimeSelectionTable(faPatchTypeField, patch); \
+defineTemplateRunTimeSelectionTable(faPatchTypeField, patchMapper); \
+defineTemplateRunTimeSelectionTable(faPatchTypeField, dictionary);
+
+
+#define doMakeFaPatchField(type, Type, args...) \
+ makeFaPatchField(faPatch##Type##Field)
+
+forAllVectorNTypes(doMakeFaPatchField)
+
+forAllTensorNTypes(doMakeFaPatchField)
+
+forAllDiagTensorNTypes(doMakeFaPatchField)
+
+forAllSphericalTensorNTypes(doMakeFaPatchField)
+
+#undef doMakeFaPatchField
+#undef makeFaPatchField
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/faPatchField/faPatchVectorNFields.H b/src/finiteArea/fields/faPatchFields/faPatchField/faPatchVectorNFields.H
new file mode 100644
index 000000000..8dc63497f
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/faPatchField/faPatchVectorNFields.H
@@ -0,0 +1,37 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef faPatchVectorNFields_H
+#define faPatchVectorNFields_H
+
+#include "faPatchVectorNFieldsFwd.H"
+#include "faPatchField.H"
+#include "faPatchFieldsFwd.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/faPatchField/faPatchVectorNFieldsFwd.H b/src/finiteArea/fields/faPatchFields/faPatchField/faPatchVectorNFieldsFwd.H
new file mode 100644
index 000000000..eba6610eb
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/faPatchField/faPatchVectorNFieldsFwd.H
@@ -0,0 +1,61 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef faPatchVectorNFieldsFwd_H
+#define faPatchVectorNFieldsFwd_H
+
+#include "VectorNFieldTypes.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+template class faPatchField;
+
+#define doMakeTypedef(type, Type, args...) \
+ typedef faPatchField faPatch##Type##Field;
+
+forAllVectorNTypes(doMakeTypedef)
+
+forAllTensorNTypes(doMakeTypedef)
+
+forAllDiagTensorNTypes(doMakeTypedef)
+
+forAllSphericalTensorNTypes(doMakeTypedef)
+
+#undef doMakeTypedef
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/calculatedFaePatchVectorNFields.C b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/calculatedFaePatchVectorNFields.C
new file mode 100644
index 000000000..faa263177
--- /dev/null
+++ b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/calculatedFaePatchVectorNFields.C
@@ -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 .
+
+\*---------------------------------------------------------------------------*/
+
+#include "calculatedFaePatchVectorNFields.H"
+#include "faePatchFields.H"
+#include "addToRunTimeSelectionTable.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+#define doMakeFaePatchTypeField(type, Type, args...) \
+ makeFaePatchTypeField(faePatch##Type##Field, calculatedFaePatch##Type##Field);
+
+forAllVectorNTypes(doMakeFaePatchTypeField)
+
+forAllTensorNTypes(doMakeFaePatchTypeField)
+
+forAllDiagTensorNTypes(doMakeFaePatchTypeField)
+
+forAllSphericalTensorNTypes(doMakeFaePatchTypeField)
+
+#undef doMakeFaePatchTypeField
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/calculatedFaePatchVectorNFields.H b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/calculatedFaePatchVectorNFields.H
new file mode 100644
index 000000000..d19efb463
--- /dev/null
+++ b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/calculatedFaePatchVectorNFields.H
@@ -0,0 +1,37 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef calculatedFaePatchVectorNFields_H
+#define calculatedFaePatchVectorNFields_H
+
+#include "calculatedFaePatchVectorNFieldsFwd.H"
+#include "calculatedFaePatchField.H"
+#include "faePatchVectorNFields.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/calculatedFaePatchVectorNFieldsFwd.H b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/calculatedFaePatchVectorNFieldsFwd.H
new file mode 100644
index 000000000..8942750f4
--- /dev/null
+++ b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/calculatedFaePatchVectorNFieldsFwd.H
@@ -0,0 +1,67 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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
+ calculatedFaePatchField
+
+Description
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef calculatedFaePatchVectorNFieldsFwd_H
+#define calculatedFaePatchVectorNFieldsFwd_H
+
+#include "VectorNFieldTypes.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+template class calculatedFaePatchField;
+
+#define doMakeTypedef(type, Type, args...) \
+ typedef calculatedFaePatchField calculatedFaePatch##Type##Field;
+
+forAllVectorNTypes(doMakeTypedef)
+
+forAllTensorNTypes(doMakeTypedef)
+
+forAllDiagTensorNTypes(doMakeTypedef)
+
+forAllSphericalTensorNTypes(doMakeTypedef)
+
+#undef doMakeTypedef
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/coupledFaePatchVectorNFields.C b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/coupledFaePatchVectorNFields.C
new file mode 100644
index 000000000..23162eb3b
--- /dev/null
+++ b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/coupledFaePatchVectorNFields.C
@@ -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 .
+
+\*---------------------------------------------------------------------------*/
+
+#include "coupledFaePatchVectorNFields.H"
+#include "faePatchFields.H"
+#include "addToRunTimeSelectionTable.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+#define doMakeFaePatchTypeField(type, Type, args...) \
+ makeFaePatchTypeFieldTypeName(coupledFaePatch##Type##Field);
+
+forAllVectorNTypes(doMakeFaePatchTypeField)
+
+forAllTensorNTypes(doMakeFaePatchTypeField)
+
+forAllDiagTensorNTypes(doMakeFaePatchTypeField)
+
+forAllSphericalTensorNTypes(doMakeFaePatchTypeField)
+
+#undef doMakeFaePatchTypeField
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/coupledFaePatchVectorNFields.H b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/coupledFaePatchVectorNFields.H
new file mode 100644
index 000000000..28980d014
--- /dev/null
+++ b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/coupledFaePatchVectorNFields.H
@@ -0,0 +1,37 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef coupledFaePatchVectorNFields_H
+#define coupledFaePatchVectorNFields_H
+
+#include "coupledFaePatchVectorNFieldsFwd.H"
+#include "coupledFaePatchField.H"
+#include "faePatchVectorNFields.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/coupledFaePatchVectorNFieldsFwd.H b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/coupledFaePatchVectorNFieldsFwd.H
new file mode 100644
index 000000000..f0061a672
--- /dev/null
+++ b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/coupledFaePatchVectorNFieldsFwd.H
@@ -0,0 +1,66 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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
+ coupledFaePatchField
+
+Description
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef coupledFaePatchVectorNFieldsFwd_H
+#define coupledFaePatchVectorNFieldsFwd_H
+
+#include "VectorNFieldTypes.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+template class coupledFaePatchField;
+
+#define doMakeTypedef(type, Type, args...) \
+ typedef coupledFaePatchField coupledFaePatch##Type##Field;
+
+forAllVectorNTypes(doMakeTypedef)
+
+forAllTensorNTypes(doMakeTypedef)
+
+forAllDiagTensorNTypes(doMakeTypedef)
+
+forAllSphericalTensorNTypes(doMakeTypedef)
+
+#undef doMakeTypedef
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/emptyFaePatchVectorNFields.C b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/emptyFaePatchVectorNFields.C
new file mode 100644
index 000000000..15a491965
--- /dev/null
+++ b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/emptyFaePatchVectorNFields.C
@@ -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 .
+
+\*---------------------------------------------------------------------------*/
+
+#include "emptyFaePatchVectorNFields.H"
+#include "faePatchFields.H"
+#include "addToRunTimeSelectionTable.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+#define doMakeFaePatchTypeField(type, Type, args...) \
+ makeFaePatchTypeField(faePatch##Type##Field, emptyFaePatch##Type##Field);
+
+forAllVectorNTypes(doMakeFaePatchTypeField)
+
+forAllTensorNTypes(doMakeFaePatchTypeField)
+
+forAllDiagTensorNTypes(doMakeFaePatchTypeField)
+
+forAllSphericalTensorNTypes(doMakeFaePatchTypeField)
+
+#undef doMakeFaePatchTypeField
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/emptyFaePatchVectorNFields.H b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/emptyFaePatchVectorNFields.H
new file mode 100644
index 000000000..eb5f2e210
--- /dev/null
+++ b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/emptyFaePatchVectorNFields.H
@@ -0,0 +1,37 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef emptyFaePatchVectorNFields_H
+#define emptyFaePatchVectorNFields_H
+
+#include "emptyFaePatchVectorNFieldsFwd.H"
+#include "emptyFaePatchField.H"
+#include "faePatchVectorNFields.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/emptyFaePatchVectorNFieldsFwd.H b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/emptyFaePatchVectorNFieldsFwd.H
new file mode 100644
index 000000000..18b00ad02
--- /dev/null
+++ b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/emptyFaePatchVectorNFieldsFwd.H
@@ -0,0 +1,61 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef emptyFaePatchVectorNFieldsFwd_H
+#define emptyFaePatchVectorNFieldsFwd_H
+
+#include "VectorNFieldTypes.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+template class emptyFaePatchField;
+
+#define doMakeTypedef(type, Type, args...) \
+ typedef emptyFaePatchField emptyFaePatch##Type##Field;
+
+forAllVectorNTypes(doMakeTypedef)
+
+forAllTensorNTypes(doMakeTypedef)
+
+forAllDiagTensorNTypes(doMakeTypedef)
+
+forAllSphericalTensorNTypes(doMakeTypedef)
+
+#undef doMakeTypedef
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/faePatchVectorNFields.C b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/faePatchVectorNFields.C
new file mode 100644
index 000000000..5b56071d1
--- /dev/null
+++ b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/faePatchVectorNFields.C
@@ -0,0 +1,67 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 "faePatchVectorNFields.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+#define makeFaePatchField(faePatchTypeField) \
+ \
+defineNamedTemplateTypeNameAndDebug(faePatchTypeField, 0); \
+template<> \
+Foam::debug::debugSwitch \
+faePatchTypeField::disallowDefaultFaePatchField \
+( \
+ "disallowDefaultFaePatchField", \
+ 0 \
+); \
+defineTemplateRunTimeSelectionTable(faePatchTypeField, patch); \
+defineTemplateRunTimeSelectionTable(faePatchTypeField, patchMapper); \
+defineTemplateRunTimeSelectionTable(faePatchTypeField, dictionary);
+
+#define doMakeFaePatchField(type, Type, args...) \
+ makeFaePatchField(faePatch##Type##Field)
+
+forAllVectorNTypes(doMakeFaePatchField)
+
+forAllTensorNTypes(doMakeFaePatchField)
+
+forAllDiagTensorNTypes(doMakeFaePatchField)
+
+forAllSphericalTensorNTypes(doMakeFaePatchField)
+
+#undef makeFaePatchField
+#undef doMakeFaePatchField
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/faePatchVectorNFields.H b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/faePatchVectorNFields.H
new file mode 100644
index 000000000..59a433b51
--- /dev/null
+++ b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/faePatchVectorNFields.H
@@ -0,0 +1,37 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef faePatchVectorNFields_H
+#define faePatchVectorNFields_H
+
+#include "faePatchVectorNFieldsFwd.H"
+#include "faePatchField.H"
+#include "faePatchFieldsFwd.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/faePatchVectorNFieldsFwd.H b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/faePatchVectorNFieldsFwd.H
new file mode 100644
index 000000000..1083247d6
--- /dev/null
+++ b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/faePatchVectorNFieldsFwd.H
@@ -0,0 +1,72 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef faePatchVectorNFieldsFwd_H
+#define faePatchVectorNFieldsFwd_H
+
+#include "VectorNFieldTypes.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+template class faePatchField;
+
+typedef faePatchField faePatchVector2Field;
+typedef faePatchField faePatchVector3Field;
+typedef faePatchField faePatchVector4Field;
+typedef faePatchField faePatchVector6Field;
+typedef faePatchField faePatchVector8Field;
+
+typedef faePatchField faePatchTensor2Field;
+typedef faePatchField faePatchTensor3Field;
+typedef faePatchField faePatchTensor4Field;
+typedef faePatchField faePatchTensor6Field;
+typedef faePatchField faePatchTensor8Field;
+
+typedef faePatchField faePatchDiagTensor2Field;
+typedef faePatchField faePatchDiagTensor3Field;
+typedef faePatchField faePatchDiagTensor4Field;
+typedef faePatchField faePatchDiagTensor6Field;
+typedef faePatchField faePatchDiagTensor8Field;
+
+typedef faePatchField faePatchSphericalTensor2Field;
+typedef faePatchField faePatchSphericalTensor3Field;
+typedef faePatchField faePatchSphericalTensor4Field;
+typedef faePatchField faePatchSphericalTensor6Field;
+typedef faePatchField faePatchSphericalTensor8Field;
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/processorFaePatchVectorNFields.C b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/processorFaePatchVectorNFields.C
new file mode 100644
index 000000000..b144f8589
--- /dev/null
+++ b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/processorFaePatchVectorNFields.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 .
+
+\*---------------------------------------------------------------------------*/
+
+#include "processorFaePatchVectorNFields.H"
+#include "faePatchFields.H"
+#include "addToRunTimeSelectionTable.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+#define doMakeFaePatchTypeField(type, Type, args...) \
+ makeFaePatchTypeField(faePatch##Type##Field, processorFaePatch##Type##Field);
+
+forAllVectorNTypes(doMakeFaePatchTypeField)
+
+#undef doMakeFaePatchTypeField
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/processorFaePatchVectorNFields.H b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/processorFaePatchVectorNFields.H
new file mode 100644
index 000000000..16eb29761
--- /dev/null
+++ b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/processorFaePatchVectorNFields.H
@@ -0,0 +1,37 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef processorFaePatchVectorNFields_H
+#define processorFaePatchVectorNFields_H
+
+#include "processorFaePatchVectorNFieldsFwd.H"
+#include "processorFaePatchField.H"
+#include "faePatchVectorNFields.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/processorFaePatchVectorNFieldsFwd.H b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/processorFaePatchVectorNFieldsFwd.H
new file mode 100644
index 000000000..2a4592cd6
--- /dev/null
+++ b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/processorFaePatchVectorNFieldsFwd.H
@@ -0,0 +1,60 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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
+ processorFaePatchField
+
+Description
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef processorFaePatchVectorNFieldsFwd_H
+#define processorFaePatchVectorNFieldsFwd_H
+
+#include "VectorNFieldTypes.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+template class processorFaePatchField;
+
+#define doMakeTypedef(type, Type, args...) \
+ typedef processorFaePatchField processorFaePatch##Type##Field;
+
+forAllVectorNTypes(doMakeTypedef)
+
+#undef doMakeTypedef
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/wedgeFaePatchVectorNFields.C b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/wedgeFaePatchVectorNFields.C
new file mode 100644
index 000000000..8a069401d
--- /dev/null
+++ b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/wedgeFaePatchVectorNFields.C
@@ -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 .
+
+\*---------------------------------------------------------------------------*/
+
+#include "wedgeFaePatchVectorNFields.H"
+#include "faePatchFields.H"
+#include "addToRunTimeSelectionTable.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+#define doMakeFaePatchTypeField(type, Type, args...) \
+ makeFaePatchTypeField(faePatch##Type##Field, wedgeFaePatch##Type##Field);
+
+forAllVectorNTypes(doMakeFaePatchTypeField)
+
+forAllTensorNTypes(doMakeFaePatchTypeField)
+
+forAllDiagTensorNTypes(doMakeFaePatchTypeField)
+
+forAllSphericalTensorNTypes(doMakeFaePatchTypeField)
+
+#undef doMakeFaePatchTypeField
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/wedgeFaePatchVectorNFields.H b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/wedgeFaePatchVectorNFields.H
new file mode 100644
index 000000000..6de279526
--- /dev/null
+++ b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/wedgeFaePatchVectorNFields.H
@@ -0,0 +1,37 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef wedgeFaePatchVectorNFields_H
+#define wedgeFaePatchVectorNFields_H
+
+#include "wedgeFaePatchVectorNFieldsFwd.H"
+#include "wedgeFaePatchField.H"
+#include "faePatchVectorNFields.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/wedgeFaePatchVectorNFieldsFwd.H b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/wedgeFaePatchVectorNFieldsFwd.H
new file mode 100644
index 000000000..eb5f8e3db
--- /dev/null
+++ b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/wedgeFaePatchVectorNFieldsFwd.H
@@ -0,0 +1,61 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef wedgeFaePatchVectorNFieldsFwd_H
+#define wedgeFaePatchVectorNFieldsFwd_H
+
+#include "VectorNFieldTypes.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+template class wedgeFaePatchField;
+
+#define doMakeTypedef(type, Type, args...) \
+ typedef wedgeFaePatchField wedgeFaePatch##Type##Field;
+
+forAllVectorNTypes(doMakeTypedef)
+
+forAllTensorNTypes(doMakeTypedef)
+
+forAllDiagTensorNTypes(doMakeTypedef)
+
+forAllSphericalTensorNTypes(doMakeTypedef)
+
+#undef doMakeTypedef
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteVolume/cfdTools/general/solutionControl/solutionControl/solutionControl.C b/src/finiteVolume/cfdTools/general/solutionControl/solutionControl/solutionControl.C
index 67b1bcf30..c54a37f37 100644
--- a/src/finiteVolume/cfdTools/general/solutionControl/solutionControl/solutionControl.C
+++ b/src/finiteVolume/cfdTools/general/solutionControl/solutionControl/solutionControl.C
@@ -24,7 +24,8 @@ License
\*---------------------------------------------------------------------------*/
#include "solutionControl.H"
-#include "lduMatrix.H"
+#include "fieldTypes.H"
+#include "VectorNFieldTypes.H"
#include "fvc.H"
#include "inletOutletFvPatchFields.H"
#include "slipFvPatchFields.H"
@@ -180,6 +181,21 @@ void Foam::solutionControl::storePrevIterFields() const
storePrevIter();
storePrevIter();
storePrevIter();
+
+ storePrevIter();
+ storePrevIter();
+ storePrevIter();
+ storePrevIter();
+
+ storePrevIter();
+ storePrevIter();
+ storePrevIter();
+ storePrevIter();
+
+ storePrevIter();
+ storePrevIter();
+ storePrevIter();
+ storePrevIter();
}
@@ -196,7 +212,7 @@ void Foam::solutionControl::maxTypeResidual
if (mesh_.foundObject(fieldName))
{
- const List sp(data);
+ const List > sp(data);
firstRes = cmptMax(sp.first().initialResidual());
lastRes = cmptMax(sp.last().initialResidual());
}
@@ -218,6 +234,21 @@ Foam::scalar Foam::solutionControl::maxResidual
maxTypeResidual(fieldName, data, firstRes, lastRes);
maxTypeResidual(fieldName, data, firstRes, lastRes);
+ maxTypeResidual(fieldName, data, firstRes, lastRes);
+ maxTypeResidual(fieldName, data, firstRes, lastRes);
+ maxTypeResidual(fieldName, data, firstRes, lastRes);
+ maxTypeResidual(fieldName, data, firstRes, lastRes);
+
+ maxTypeResidual(fieldName, data, firstRes, lastRes);
+ maxTypeResidual(fieldName, data, firstRes, lastRes);
+ maxTypeResidual(fieldName, data, firstRes, lastRes);
+ maxTypeResidual(fieldName, data, firstRes, lastRes);
+
+ maxTypeResidual(fieldName, data, firstRes, lastRes);
+ maxTypeResidual(fieldName, data, firstRes, lastRes);
+ maxTypeResidual(fieldName, data, firstRes, lastRes);
+ maxTypeResidual(fieldName, data, firstRes, lastRes);
+
return firstRes;
}
diff --git a/src/finiteVolume/fvMatrices/fvBlockMatrix/fvBlockMatrix.C b/src/finiteVolume/fvMatrices/fvBlockMatrix/fvBlockMatrix.C
index 89a2a816d..ba23a5892 100644
--- a/src/finiteVolume/fvMatrices/fvBlockMatrix/fvBlockMatrix.C
+++ b/src/finiteVolume/fvMatrices/fvBlockMatrix/fvBlockMatrix.C
@@ -1375,6 +1375,8 @@ Foam::BlockSolverPerformance Foam::fvBlockMatrix::solve
// Print performance
solverPerf.print();
+ psi_.mesh().solutionDict().setSolverPerformance(psi_.name(), solverPerf);
+
return solverPerf;
}
diff --git a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C
index 7ecc96951..a8130abb4 100644
--- a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C
+++ b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C
@@ -69,7 +69,7 @@ Foam::lduSolverPerformance Foam::fvMatrix::solve
// Complete matrix assembly. HJ, 17/Apr/2012
this->completeAssembly();
- lduSolverPerformance solverPerfVec
+ BlockSolverPerformance solverPerfVec
(
"fvMatrix::solve",
psi_.name()
@@ -155,14 +155,7 @@ Foam::lduSolverPerformance Foam::fvMatrix::solve
solverPerf.print();
- if
- (
- solverPerf.initialResidual() > solverPerfVec.initialResidual()
- && !solverPerf.singular()
- )
- {
- solverPerfVec = solverPerf;
- }
+ solverPerfVec.replace(cmpt, solverPerf);
psi.internalField().replace(cmpt, psiCmpt);
diag() = saveDiag;
@@ -172,7 +165,7 @@ Foam::lduSolverPerformance Foam::fvMatrix::solve
psi_.mesh().solutionDict().setSolverPerformance(psi_.name(), solverPerfVec);
- return solverPerfVec;
+ return solverPerfVec.max();
}
diff --git a/src/foam/matrices/blockLduMatrix/BlockLduSolvers/BlockLduSolver/BlockSolverPerformance.C b/src/foam/matrices/blockLduMatrix/BlockLduSolvers/BlockLduSolver/BlockSolverPerformance.C
index 2881f8096..4bdbcaa9a 100644
--- a/src/foam/matrices/blockLduMatrix/BlockLduSolvers/BlockLduSolver/BlockSolverPerformance.C
+++ b/src/foam/matrices/blockLduMatrix/BlockLduSolvers/BlockLduSolver/BlockSolverPerformance.C
@@ -112,6 +112,36 @@ void Foam::BlockSolverPerformance::print() const
}
+template
+void Foam::BlockSolverPerformance::replace
+(
+ const Foam::label cmpt,
+ const Foam::BlockSolverPerformance::cmptType>& bsp
+)
+{
+ initialResidual_.replace(cmpt, bsp.initialResidual());
+ finalResidual_.replace(cmpt, bsp.finalResidual());
+ singular_ = singular_ || bsp.singular();
+}
+
+
+template
+Foam::BlockSolverPerformance::cmptType>
+Foam::BlockSolverPerformance::max()
+{
+ return BlockSolverPerformance::cmptType>
+ (
+ solverName_,
+ fieldName_,
+ cmptMax(initialResidual_),
+ cmptMax(finalResidual_),
+ nIterations_,
+ converged_,
+ singular_
+ );
+}
+
+
template
bool Foam::BlockSolverPerformance::operator!=
(
@@ -131,6 +161,26 @@ bool Foam::BlockSolverPerformance::operator!=
}
+template
+typename Foam::BlockSolverPerformance Foam::max
+(
+ const typename Foam::BlockSolverPerformance& bsp1,
+ const typename Foam::BlockSolverPerformance& bsp2
+)
+{
+ return BlockSolverPerformance
+ (
+ bsp1.solverName(),
+ bsp1.fieldName(),
+ max(bsp1.initialResidual(), bsp2.initialResidual()),
+ max(bsp1.finalResidual(), bsp2.finalResidual()),
+ max(bsp1.nIterations(), bsp2.nIterations()),
+ bsp1.converged() && bsp2.converged(),
+ bsp1.singular() || bsp2.singular()
+ );
+}
+
+
template
Foam::Istream& Foam::operator>>
(
diff --git a/src/foam/matrices/blockLduMatrix/BlockLduSolvers/BlockLduSolver/BlockSolverPerformance.H b/src/foam/matrices/blockLduMatrix/BlockLduSolvers/BlockLduSolver/BlockSolverPerformance.H
index 9ee67da3d..331f0c873 100644
--- a/src/foam/matrices/blockLduMatrix/BlockLduSolvers/BlockLduSolver/BlockSolverPerformance.H
+++ b/src/foam/matrices/blockLduMatrix/BlockLduSolvers/BlockLduSolver/BlockSolverPerformance.H
@@ -50,6 +50,13 @@ namespace Foam
template
class BlockSolverPerformance;
+template
+BlockSolverPerformance max
+(
+ const BlockSolverPerformance&,
+ const BlockSolverPerformance&
+);
+
template
Istream& operator>>(Istream&, BlockSolverPerformance&);
@@ -217,6 +224,17 @@ public:
//- Print summary of solver performance
void print() const;
+ //- Replace component based on the minimal BlockSolverPerformance
+ void replace
+ (
+ const label cmpt,
+ const BlockSolverPerformance::cmptType>& sp
+ );
+
+ //- Return the summary maximum of BlockSolverPerformance
+ // Effectively it will mostly return BlockSolverPerformance
+ BlockSolverPerformance::cmptType> max();
+
// Member Operators
@@ -225,6 +243,16 @@ public:
// Friend functions
+ //- Return the element-wise max of two BlockSolverPerformances
+ friend BlockSolverPerformance Foam::max
+ (
+ const BlockSolverPerformance&,
+ const BlockSolverPerformance&
+ );
+
+
+ // Ostream operator
+
friend Istream& operator>>
(
Istream&,
diff --git a/src/foam/matrices/blockLduMatrix/BlockLduSolvers/BlockLduSolver/BlockSolverPerformances.C b/src/foam/matrices/blockLduMatrix/BlockLduSolvers/BlockLduSolver/BlockSolverPerformances.C
index 73049b778..633e797c2 100644
--- a/src/foam/matrices/blockLduMatrix/BlockLduSolvers/BlockLduSolver/BlockSolverPerformances.C
+++ b/src/foam/matrices/blockLduMatrix/BlockLduSolvers/BlockLduSolver/BlockSolverPerformances.C
@@ -31,22 +31,27 @@ Author
#include "BlockSolverPerformances.H"
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
-// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
-
defineNamedTemplateTypeNameAndDebug(BlockSolverPerformanceScalar, 1);
defineNamedTemplateTypeNameAndDebug(BlockSolverPerformanceVector, 1);
defineNamedTemplateTypeNameAndDebug(BlockSolverPerformanceSphericalTensor, 1);
defineNamedTemplateTypeNameAndDebug(BlockSolverPerformanceSymmTensor, 1);
defineNamedTemplateTypeNameAndDebug(BlockSolverPerformanceTensor, 1);
+};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-} // End namespace Foam
+template<>
+Foam::BlockSolverPerformance
+Foam::BlockSolverPerformance::max()
+{
+ return *this;
+}
+
// ************************************************************************* //
diff --git a/src/foam/matrices/solution/solution.C b/src/foam/matrices/solution/solution.C
index c63cff6e9..5ce6a3886 100644
--- a/src/foam/matrices/solution/solution.C
+++ b/src/foam/matrices/solution/solution.C
@@ -127,6 +127,15 @@ void Foam::solution::read(const dictionary& dict)
{
solverPerformance_ = dict.subDict("solverPerformance");
}
+
+ if (dict.found("residuals"))
+ {
+ storeAllResiduals_ =
+ dict.subDict("residuals").lookupOrDefault
+ (
+ "storeAllResiduals", false
+ );
+ }
}
@@ -153,7 +162,8 @@ Foam::solution::solution(const objectRegistry& obr, const fileName& dictName)
eqnRelaxDefault_(0),
solvers_(dictionary::null),
solverPerformance_(dictionary::null),
- prevTimeIndex_(0)
+ prevTimeIndex_(0),
+ storeAllResiduals_(false)
{
if (!headerOk())
{
@@ -422,49 +432,4 @@ Foam::dictionary& Foam::solution::solverPerformanceDict() const
return solverPerformance_;
}
-
-void Foam::solution::setSolverPerformance
-(
- const word& name,
- const lduSolverPerformance& sp
-) const
-{
- List perfs;
-
- if (prevTimeIndex_ != this->time().timeIndex())
- {
- // Reset solver performance between iterations
- prevTimeIndex_ = this->time().timeIndex();
- solverPerformance_.clear();
- }
- else
- {
- solverPerformance_.readIfPresent(name, perfs);
- }
-
- // Only the first iteration and the current iteration residuals are
- // required, so the current iteration residual replaces the previous one and
- // only the first iteration is always present, VS 2017-11-27
- if (perfs.size() < 2)
- {
- // Append to list
- perfs.setSize(perfs.size() + 1, sp);
- }
- else
- {
- perfs.last() = sp;
- }
-
- solverPerformance_.set(name, perfs);
-}
-
-
-void Foam::solution::setSolverPerformance
-(
- const lduSolverPerformance& sp
-) const
-{
- setSolverPerformance(sp.fieldName(), sp);
-}
-
// ************************************************************************* //
diff --git a/src/foam/matrices/solution/solution.H b/src/foam/matrices/solution/solution.H
index bf4206213..d1c3aab04 100644
--- a/src/foam/matrices/solution/solution.H
+++ b/src/foam/matrices/solution/solution.H
@@ -37,7 +37,8 @@ SourceFiles
#include "IOdictionary.H"
#include "debugSwitch.H"
-#include "lduSolverPerformance.H"
+#include "foamTime.H"
+#include "BlockSolverPerformance.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -81,6 +82,10 @@ class solution
//- Previously used time-index, used for reset between iterations
mutable label prevTimeIndex_;
+ //- Switch for storing residuals of every iteration inside a single
+ // timestep
+ bool storeAllResiduals_;
+
// Private Member Functions
@@ -156,17 +161,19 @@ public:
// checking
dictionary& solverPerformanceDict() const;
- //- Add/set the solverPerformance entry for the named field
+ //- Add/set the BlockSolverPerformance entry for the named field
+ template
void setSolverPerformance
(
const word& name,
- const lduSolverPerformance&
+ const BlockSolverPerformance&
) const;
- //- Add/set the solverPerformance entry, using its fieldName
+ //- Add/set the BlockSolverPerformance entry, using its fieldName
+ template
void setSolverPerformance
(
- const lduSolverPerformance&
+ const BlockSolverPerformance&
) const;
diff --git a/src/foam/matrices/solution/solutionTemplates.C b/src/foam/matrices/solution/solutionTemplates.C
index 67cdd879f..d655ed3a3 100644
--- a/src/foam/matrices/solution/solutionTemplates.C
+++ b/src/foam/matrices/solution/solutionTemplates.C
@@ -45,6 +45,55 @@ void Foam::solution::cachePrintMessage
}
+template
+void Foam::solution::setSolverPerformance
+(
+ const word& name,
+ const BlockSolverPerformance& sp
+) const
+{
+ List > perfs;
+
+ if (prevTimeIndex_ != this->time().timeIndex())
+ {
+ // Reset solver performance between iterations
+ prevTimeIndex_ = this->time().timeIndex();
+ solverPerformance_.clear();
+ }
+ else
+ {
+ solverPerformance_.readIfPresent(name, perfs);
+ }
+
+ // If storeAllResiduals_ is true, we are storing residual of every iteration
+ // inside a single time step. Otherwise, only the first iteration residual
+ // and the current iteration residual are required, so the current
+ // iteration residual replaces the previous one and only the first iteration
+ // residual is always present, VS 2018-02-11
+ if (storeAllResiduals_ || perfs.size() < 2)
+ {
+ // Append to list
+ perfs.setSize(perfs.size() + 1, sp);
+ }
+ else
+ {
+ perfs.last() = sp;
+ }
+
+ solverPerformance_.set(name, perfs);
+}
+
+
+template
+void Foam::solution::setSolverPerformance
+(
+ const BlockSolverPerformance& sp
+) const
+{
+ setSolverPerformance(sp.fieldName(), sp);
+}
+
+
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/tetFiniteElement/tetFemMatrix/tetFemMatrixSolve.C b/src/tetFiniteElement/tetFemMatrix/tetFemMatrixSolve.C
index f136f758f..6a8ae9d8e 100644
--- a/src/tetFiniteElement/tetFemMatrix/tetFemMatrixSolve.C
+++ b/src/tetFiniteElement/tetFemMatrix/tetFemMatrixSolve.C
@@ -52,7 +52,7 @@ lduSolverPerformance tetFemMatrix::solve
this->check();
}
- lduSolverPerformance solverPerfVec
+ BlockSolverPerformance solverPerfVec
(
"tetFemMatrix::solve",
psi_.name()
@@ -152,14 +152,7 @@ lduSolverPerformance tetFemMatrix::solve
solverPerf.print();
- if
- (
- solverPerf.initialResidual() > solverPerfVec.initialResidual()
- && !solverPerf.singular()
- )
- {
- solverPerfVec = solverPerf;
- }
+ solverPerfVec.replace(cmpt, solverPerf);
psi.internalField().replace(cmpt, psiCmpt);
@@ -174,7 +167,9 @@ lduSolverPerformance tetFemMatrix::solve
psi.correctBoundaryConditions();
- return solverPerfVec;
+ psi_.mesh().solutionDict().setSolverPerformance(psi_.name(), solverPerfVec);
+
+ return solverPerfVec.max();
}
diff --git a/src/tetFiniteElement/tetFemMatrix/tetFemScalarMatrix.C b/src/tetFiniteElement/tetFemMatrix/tetFemScalarMatrix.C
index 0199325bf..9fdcd40ad 100644
--- a/src/tetFiniteElement/tetFemMatrix/tetFemScalarMatrix.C
+++ b/src/tetFiniteElement/tetFemMatrix/tetFemScalarMatrix.C
@@ -131,6 +131,8 @@ lduSolverPerformance tetFemMatrix::solve
psi.correctBoundaryConditions();
+ psi_.mesh().solutionDict().setSolverPerformance(psi_.name(), solverPerf);
+
return solverPerf;
}