Generalization of storage for solverPerformanceDict (by Pascal Beckstein), solutionFaControl and VectorN in Finite Area. Vanja Skuric and Pascal Beckstein"

This commit is contained in:
Hrvoje Jasak 2018-02-27 10:43:19 +00:00
commit d1abd6fb28
86 changed files with 5027 additions and 92 deletions

View file

@ -22,26 +22,37 @@ $(faMeshMapper)/faPatchMapper.C
faPatchFields = fields/faPatchFields faPatchFields = fields/faPatchFields
$(faPatchFields)/faPatchField/faPatchFields.C $(faPatchFields)/faPatchField/faPatchFields.C
$(faPatchFields)/faPatchField/faPatchVectorNFields.C
basicFaPatchFields = $(faPatchFields)/basic basicFaPatchFields = $(faPatchFields)/basic
$(basicFaPatchFields)/basicSymmetry/basicSymmetryFaPatchFields.C $(basicFaPatchFields)/basicSymmetry/basicSymmetryFaPatchFields.C
$(basicFaPatchFields)/basicSymmetry/basicSymmetryFaPatchScalarField.C $(basicFaPatchFields)/basicSymmetry/basicSymmetryFaPatchScalarField.C
$(basicFaPatchFields)/calculated/calculatedFaPatchFields.C $(basicFaPatchFields)/calculated/calculatedFaPatchFields.C
$(basicFaPatchFields)/calculated/calculatedFaPatchVectorNFields.C
$(basicFaPatchFields)/coupled/coupledFaPatchFields.C $(basicFaPatchFields)/coupled/coupledFaPatchFields.C
$(basicFaPatchFields)/coupled/coupledFaPatchVectorNFields.C
$(basicFaPatchFields)/zeroGradient/zeroGradientFaPatchFields.C $(basicFaPatchFields)/zeroGradient/zeroGradientFaPatchFields.C
$(basicFaPatchFields)/zeroGradient/zeroGradientFaPatchVectorNFields.C
$(basicFaPatchFields)/fixedValue/fixedValueFaPatchFields.C $(basicFaPatchFields)/fixedValue/fixedValueFaPatchFields.C
$(basicFaPatchFields)/fixedValue/fixedValueFaPatchVectorNFields.C
$(basicFaPatchFields)/fixedGradient/fixedGradientFaPatchFields.C $(basicFaPatchFields)/fixedGradient/fixedGradientFaPatchFields.C
$(basicFaPatchFields)/fixedGradient/fixedGradientFaPatchVectorNFields.C
$(basicFaPatchFields)/mixed/mixedFaPatchFields.C $(basicFaPatchFields)/mixed/mixedFaPatchFields.C
$(basicFaPatchFields)/transform/transformFaPatchFields.C $(basicFaPatchFields)/transform/transformFaPatchFields.C
$(basicFaPatchFields)/transform/transformFaPatchScalarField.C $(basicFaPatchFields)/transform/transformFaPatchScalarField.C
$(basicFaPatchFields)/transform/transformFaPatchVectorNFields.C
constraintFaPatchFields = $(faPatchFields)/constraint constraintFaPatchFields = $(faPatchFields)/constraint
$(constraintFaPatchFields)/empty/emptyFaPatchFields.C $(constraintFaPatchFields)/empty/emptyFaPatchFields.C
$(constraintFaPatchFields)/empty/emptyFaPatchVectorNFields.C
$(constraintFaPatchFields)/processor/processorFaPatchFields.C $(constraintFaPatchFields)/processor/processorFaPatchFields.C
$(constraintFaPatchFields)/processor/processorFaPatchScalarField.C $(constraintFaPatchFields)/processor/processorFaPatchScalarField.C
$(constraintFaPatchFields)/processor/processorFaPatchVectorNFields.C
$(constraintFaPatchFields)/wedge/wedgeFaPatchFields.C $(constraintFaPatchFields)/wedge/wedgeFaPatchFields.C
$(constraintFaPatchFields)/wedge/wedgeFaPatchScalarField.C $(constraintFaPatchFields)/wedge/wedgeFaPatchScalarField.C
$(constraintFaPatchFields)/wedge/wedgeFaPatchVectorNFields.C
$(constraintFaPatchFields)/cyclic/cyclicFaPatchFields.C $(constraintFaPatchFields)/cyclic/cyclicFaPatchFields.C
$(constraintFaPatchFields)/cyclic/cyclicFaPatchVectorNFields.C
$(constraintFaPatchFields)/symmetry/symmetryFaPatchFields.C $(constraintFaPatchFields)/symmetry/symmetryFaPatchFields.C
derivedFaPatchFields = $(faPatchFields)/derived derivedFaPatchFields = $(faPatchFields)/derived
@ -66,8 +77,18 @@ $(constraintFaePatchFields)/wedge/wedgeFaePatchFields.C
$(constraintFaePatchFields)/cyclic/cyclicFaePatchFields.C $(constraintFaePatchFields)/cyclic/cyclicFaePatchFields.C
$(constraintFaePatchFields)/symmetry/symmetryFaePatchFields.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/areaFields.C
fields/areaFields/areaVectorNFields.C
fields/edgeFields/edgeFields.C fields/edgeFields/edgeFields.C
fields/edgeFields/edgeVectorNFields.C
faMatrices/faMatrices.C faMatrices/faMatrices.C
faMatrices/faScalarMatrix/faScalarMatrix.C faMatrices/faScalarMatrix/faScalarMatrix.C
@ -122,4 +143,12 @@ convectionSchemes = finiteArea/convectionSchemes
$(convectionSchemes)/faConvectionScheme/faConvectionSchemes.C $(convectionSchemes)/faConvectionScheme/faConvectionSchemes.C
$(convectionSchemes)/gaussFaConvectionScheme/gaussFaConvectionSchemes.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 LIB = $(FOAM_LIBBIN)/libfiniteArea

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#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<label>("nOuterCorrectors", 1);
nCorrPISO_ = pimpleDict.lookupOrDefault<label>("nCorrectors", 1);
turbOnFinalIterOnly_ =
pimpleDict.lookupOrDefault<Switch>("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;
}
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
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
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * 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();
}
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#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()
{}
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
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
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#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<Time&>(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();
}
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
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
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#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<label>("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<fieldData> 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<label>();
storePrevIter<scalar>();
storePrevIter<vector>();
storePrevIter<sphericalTensor>();
storePrevIter<symmTensor>();
storePrevIter<tensor>();
storePrevIter<vector2>();
storePrevIter<vector4>();
storePrevIter<vector6>();
storePrevIter<vector8>();
storePrevIter<sphericalTensor2>();
storePrevIter<sphericalTensor4>();
storePrevIter<sphericalTensor6>();
storePrevIter<sphericalTensor8>();
storePrevIter<tensor2>();
storePrevIter<tensor4>();
storePrevIter<tensor6>();
storePrevIter<tensor8>();
}
template<class Type>
void Foam::solutionFaControl::maxTypeResidual
(
const word& fieldName,
ITstream& data,
scalar& firstRes,
scalar& lastRes
) const
{
typedef GeometricField<Type, faPatchField, areaMesh> fieldType;
if (mesh_.db().foundObject<fieldType>(fieldName))
{
const List<BlockSolverPerformance<Type> > 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<scalar>(fieldName, data, firstRes, lastRes);
maxTypeResidual<vector>(fieldName, data, firstRes, lastRes);
maxTypeResidual<sphericalTensor>(fieldName, data, firstRes, lastRes);
maxTypeResidual<symmTensor>(fieldName, data, firstRes, lastRes);
maxTypeResidual<tensor>(fieldName, data, firstRes, lastRes);
maxTypeResidual<vector2>(fieldName, data, firstRes, lastRes);
maxTypeResidual<vector4>(fieldName, data, firstRes, lastRes);
maxTypeResidual<vector6>(fieldName, data, firstRes, lastRes);
maxTypeResidual<vector8>(fieldName, data, firstRes, lastRes);
maxTypeResidual<sphericalTensor2>(fieldName, data, firstRes, lastRes);
maxTypeResidual<sphericalTensor4>(fieldName, data, firstRes, lastRes);
maxTypeResidual<sphericalTensor6>(fieldName, data, firstRes, lastRes);
maxTypeResidual<sphericalTensor8>(fieldName, data, firstRes, lastRes);
maxTypeResidual<tensor2>(fieldName, data, firstRes, lastRes);
maxTypeResidual<tensor4>(fieldName, data, firstRes, lastRes);
maxTypeResidual<tensor6>(fieldName, data, firstRes, lastRes);
maxTypeResidual<tensor8>(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()
{}
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
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<fieldData> 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 area<Type>Fields
template<class Type>
void storePrevIter() const;
template<class Type>
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
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * 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;
}
}
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "GeometricField.H"
#include "areaMesh.H"
#include "faPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type>
void Foam::solutionFaControl::storePrevIter() const
{
typedef GeometricField<Type, faPatchField, areaMesh> GeoField;
HashTable<const GeoField*>
flds(mesh_.db().objectRegistry::lookupClass<GeoField>());
forAllIter(typename HashTable<const GeoField*>, 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();
}
}
}
// ************************************************************************* //

View file

@ -60,7 +60,7 @@ lduSolverPerformance faMatrix<Type>::solve(const dictionary& solverControls)
<< endl; << endl;
} }
lduSolverPerformance solverPerfVec BlockSolverPerformance<Type> solverPerfVec
( (
"faMatrix<Type>::solve", "faMatrix<Type>::solve",
psi_.name() psi_.name()
@ -134,14 +134,7 @@ lduSolverPerformance faMatrix<Type>::solve(const dictionary& solverControls)
solverPerf.print(); solverPerf.print();
if solverPerfVec.replace(cmpt, solverPerf);
(
solverPerf.initialResidual() > solverPerfVec.initialResidual()
&& !solverPerf.singular()
)
{
solverPerfVec = solverPerf;
}
psi.internalField().replace(cmpt, psiCmpt); psi.internalField().replace(cmpt, psiCmpt);
diag() = saveDiag; diag() = saveDiag;
@ -149,7 +142,9 @@ lduSolverPerformance faMatrix<Type>::solve(const dictionary& solverControls)
psi.correctBoundaryConditions(); psi.correctBoundaryConditions();
return solverPerfVec; psi_.mesh().solutionDict().setSolverPerformance(psi_.name(), solverPerfVec);
return solverPerfVec.max();
} }

View file

@ -130,6 +130,8 @@ lduSolverPerformance faMatrix<scalar>::faSolver::solve
psi.correctBoundaryConditions(); psi.correctBoundaryConditions();
psi.mesh().solutionDict().setSolverPerformance(psi.name(), solverPerf);
return solverPerf; return solverPerf;
} }
@ -177,6 +179,8 @@ lduSolverPerformance faMatrix<scalar>::solve
psi.correctBoundaryConditions(); psi.correctBoundaryConditions();
psi_.mesh().solutionDict().setSolverPerformance(psi_.name(), solverPerf);
return solverPerf; return solverPerf;
} }

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#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
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View file

@ -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 <http://www.gnu.org/licenses/>.
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
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
Class
areaVectorNFields
Description
SourceFiles
areaVectorNFields.C
\*---------------------------------------------------------------------------*/
#ifndef areaVectorNFieldsFwd_H
#define areaVectorNFieldsFwd_H
#include "areaFieldsFwd.H"
#include "VectorNFieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
class areaMesh;
template<class Type>
class faPatchField;
template<class Type, template<class> class PatchField, class GeoMesh>
class GeometricField;
#define doMakeTypedefs(type, Type, args...) \
typedef GeometricField<type, faPatchField, areaMesh> area##Type##Field;
forAllVectorNTypes(doMakeTypedefs)
forAllTensorNTypes(doMakeTypedefs)
forAllDiagTensorNTypes(doMakeTypedefs)
forAllSphericalTensorNTypes(doMakeTypedefs)
#undef doMakeTypedefs
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#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
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View file

@ -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 <http://www.gnu.org/licenses/>.
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
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
Class
edgeVectorNFields
Description
SourceFiles
edgeVectorNFields.C
\*---------------------------------------------------------------------------*/
#ifndef edgeVectorNFieldsFwd_H
#define edgeVectorNFieldsFwd_H
#include "edgeFieldsFwd.H"
#include "VectorNFieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
class edgeMesh;
template<class Type>
class faePatchField;
template<class Type, template<class> class PatchField, class GeoMesh>
class GeometricField;
#define doMakeTypedefs(type, Type, args...) \
typedef GeometricField<type, faePatchField, edgeMesh> edge##Type##Field;
forAllVectorNTypes(doMakeTypedefs)
forAllTensorNTypes(doMakeTypedefs)
forAllDiagTensorNTypes(doMakeTypedefs)
forAllSphericalTensorNTypes(doMakeTypedefs)
#undef doMakeTypedefs
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#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
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef calculatedFaPatchVectorNFields_H
#define calculatedFaPatchVectorNFields_H
#include "areaVectorNFields.H"
#include "faPatchVectorNFields.H"
#include "calculatedFaPatchVectorNFieldsFwd.H"
#include "calculatedFaPatchField.H"
#endif
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef calculatedFaPatchVectorNFieldsFwd_H
#define calculatedFaPatchVectorNFieldsFwd_H
#include "VectorNFieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class calculatedFaPatchField;
#define makeTypedef(type, Type, args...) \
typedef calculatedFaPatchField<type> calculatedFaPatch##Type##Field;
forAllVectorNTypes(makeTypedef)
forAllTensorNTypes(makeTypedef)
forAllDiagTensorNTypes(makeTypedef)
forAllSphericalTensorNTypes(makeTypedef)
#undef makeTypedef
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#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
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef coupledFaPatchVectorNFields_H
#define coupledFaPatchVectorNFields_H
#include "areaVectorNFields.H"
#include "faPatchVectorNFields.H"
#include "coupledFaPatchVectorNFieldsFwd.H"
#include "coupledFaPatchField.H"
#endif
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef coupledFaPatchFieldsFwd_H
#define coupledFaPatchFieldsFwd_H
#include "VectorNFieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class coupledFaPatchField;
#define makeTypedef(type, Type, args...) \
typedef coupledFaPatchField<type> coupledFaPatch##Type##Field;
forAllVectorNTypes(makeTypedef)
forAllTensorNTypes(makeTypedef)
forAllDiagTensorNTypes(makeTypedef)
forAllSphericalTensorNTypes(makeTypedef)
#undef makeTypedef
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#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
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef fixedGradientFaPatchVectorNFields_H
#define fixedGradientFaPatchVectorNFields_H
#include "areaVectorNFields.H"
#include "faPatchVectorNFields.H"
#include "fixedGradientFaPatchVectorNFieldsFwd.H"
#include "fixedGradientFaPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef fixedGradientFaPatchVectorNFieldsFwd_H
#define fixedGradientFaPatchVectorNFieldsFwd_H
#include "VectorNFieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class fixedGradientFaPatchField;
#define makeTypedef(type, Type, args...) \
typedef fixedGradientFaPatchField<type> fixedGradientFaPatch##Type##Field;
forAllVectorNTypes(makeTypedef)
forAllTensorNTypes(makeTypedef)
forAllDiagTensorNTypes(makeTypedef)
forAllSphericalTensorNTypes(makeTypedef)
#undef makeTypedef
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#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
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef fixedValueFaPatchVectorNFields_H
#define fixedValueFaPatchVectorNFields_H
#include "areaVectorNFields.H"
#include "faPatchVectorNFields.H"
#include "fixedValueFaPatchVectorNFieldsFwd.H"
#include "fixedValueFaPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef fixedValueFaPatchVectorNFieldsFwd_H
#define fixedValueFaPatchVectorNFieldsFwd_H
#include "VectorNFieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class fixedValueFaPatchField;
#define makeTypedef(type, Type, args...) \
typedef fixedValueFaPatchField<type> fixedValueFaPatch##Type##Field;
forAllVectorNTypes(makeTypedef)
forAllTensorNTypes(makeTypedef)
forAllDiagTensorNTypes(makeTypedef)
forAllSphericalTensorNTypes(makeTypedef)
#undef makeTypedef
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#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
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef transformFaPatchVectorNFields_H
#define transformFaPatchVectorNFields_H
#include "areaVectorNFields.H"
#include "faPatchVectorNFields.H"
#include "VectorNFieldTypes.H"
#include "transformFaPatchVectorNFieldsFwd.H"
#include "transformFaPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef transformFaPatchVectorNFieldsFwd_H
#define transformFaPatchVectorNFieldsFwd_H
#include "VectorNFieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
template<class Type> class transformFaPatchField;
#define makeTypedef(type, Type, args...) \
typedef transformFaPatchField<type> transformFaPatch##Type##Field;
forAllVectorNTypes(makeTypedef)
forAllTensorNTypes(makeTypedef)
forAllDiagTensorNTypes(makeTypedef)
forAllSphericalTensorNTypes(makeTypedef)
#undef makeTypedef
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#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
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef zeroGradientFaPatchVectorNFields_H
#define zeroGradientFaPatchVectorNFields_H
#include "areaVectorNFields.H"
#include "faPatchVectorNFields.H"
#include "zeroGradientFaPatchVectorNFieldsFwd.H"
#include "zeroGradientFaPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef zeroGradientFaPatchVectorNFieldsFwd_H
#define zeroGradientFaPatchVectorNFieldsFwd_H
#include "VectorNFieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class zeroGradientFaPatchField;
#define makeTypedef(type, Type, args...) \
typedef zeroGradientFaPatchField<type> zeroGradientFaPatch##Type##Field;
forAllVectorNTypes(makeTypedef)
forAllTensorNTypes(makeTypedef)
forAllDiagTensorNTypes(makeTypedef)
forAllSphericalTensorNTypes(makeTypedef)
#undef makeTypedef
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -164,7 +164,37 @@ public:
const direction cmpt const direction cmpt
) const ) 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<Type>::one
);
scalar forwardScale =
pow(component(powFwdTransform, cmpt), rank());
Type powRevTransform = transform
(
this->reverseT()[0],
pTraits<Type>::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 //- Update result field based on interface functionality
@ -180,6 +210,27 @@ public:
) const; ) const;
// Block coupled interface functionality
//- Update result field based on interface functionality
virtual void updateInterfaceMatrix
(
const Field<Type>&,
Field<Type>&,
const BlockLduMatrix<Type>&,
const CoeffField<Type>&,
const Pstream::commsTypes commsType,
const bool switchToLhs
) const
{
notImplemented
(
"cyclicFaPatchField<Type>::"
"updateInterfaceMatrix for block matrices"
);
}
//- Cyclic coupled interface functions //- Cyclic coupled interface functions
//- Does the patch field perform the transfromation //- Does the patch field perform the transfromation

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "cyclicFaPatchVectorNFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
#define VectorNMatrixInterfaceFunc(Type) \
template<> \
void cyclicFaPatchField<Type>::updateInterfaceMatrix \
( \
const Field<Type>& psiInternal, \
Field<Type>& result, \
const BlockLduMatrix<Type>&, \
const CoeffField<Type>& coeffs, \
const Pstream::commsTypes commsType, \
const bool switchToLhs \
) const \
{ \
Field<Type> pnf(this->size()); \
\
label sizeby2 = this->size()/2; \
const unallocLabelList& faceCells = cyclicPatch_.faceCells(); \
\
for (label facei=0; facei<sizeby2; facei++) \
{ \
pnf[facei] = psiInternal[faceCells[facei + sizeby2]]; \
pnf[facei + sizeby2] = psiInternal[faceCells[facei]]; \
} \
\
if (coeffs.activeType() == blockCoeffBase::SCALAR) \
{ \
pnf = coeffs.asScalar() * pnf; \
} \
else if (coeffs.activeType() == blockCoeffBase::LINEAR) \
{ \
pnf = cmptMultiply(coeffs.asLinear(), pnf); \
} \
else if (coeffs.activeType() == blockCoeffBase::SQUARE) \
{ \
pnf = coeffs.asSquare() & pnf; \
} \
\
if (switchToLhs) \
{ \
forAll(faceCells, elemI) \
{ \
result[faceCells[elemI]] += pnf[elemI]; \
} \
} \
else \
{ \
forAll(faceCells, elemI) \
{ \
result[faceCells[elemI]] -= pnf[elemI]; \
} \
} \
}
#define doMakePatchTypeField(type, Type, args...) \
\
VectorNMatrixInterfaceFunc(type) \
\
makeTemplateFaPatchTypeField \
( \
faPatch##Type##Field, \
cyclicFaPatch##Type##Field \
);
forAllVectorNTypes(doMakePatchTypeField)
#undef doMakePatchTypeField
#undef VectorNMatrixInterfaceFunc
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef cyclicFaPatchVectorNFields_H
#define cyclicFaPatchVectorNFields_H
#include "areaVectorNFields.H"
#include "faPatchVectorNFields.H"
#include "cyclicFaPatchVectorNFieldsFwd.H"
#include "cyclicFaPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef cyclicFaPatchVectorNFieldsFwd_H
#define cyclicFaPatchVectorNFieldsFwd_H
#include "VectorNFieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class cyclicFaPatchField;
#define makeTypedef(type, Type, args...) \
typedef cyclicFaPatchField<type> cyclicFaPatch##Type##Field;
forAllVectorNTypes(makeTypedef)
#undef makeTypedef
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#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
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef emptyFaPatchVectorNFields_H
#define emptyFaPatchVectorNFields_H
#include "areaVectorNFields.H"
#include "faPatchVectorNFields.H"
#include "emptyFaPatchVectorNFieldsFwd.H"
#include "emptyFaPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef emptyFaPatchVectorNFieldsFwd_H
#define emptyFaPatchVectorNFieldsFwd_H
#include "VectorNFieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class emptyFaPatchField;
#define makeTypedef(type, Type, args...) \
typedef emptyFaPatchField<type> emptyFaPatch##Type##Field;
forAllVectorNTypes(makeTypedef)
forAllTensorNTypes(makeTypedef)
forAllDiagTensorNTypes(makeTypedef)
forAllSphericalTensorNTypes(makeTypedef)
#undef makeTypedef
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -83,7 +83,7 @@ processorFaPatchField<Type>::processorFaPatchField
"(\n" "(\n"
" const processorFaPatchField<Type>& ptf,\n" " const processorFaPatchField<Type>& ptf,\n"
" const faPatch& p,\n" " const faPatch& p,\n"
" const DimensionedField<Type, volMesh>& iF,\n" " const DimensionedField<Type, areaMesh>& iF,\n"
" const faPatchFieldMapper& mapper\n" " const faPatchFieldMapper& mapper\n"
")\n" ")\n"
) << "\n patch type '" << p.type() ) << "\n patch type '" << p.type()

View file

@ -22,7 +22,7 @@ License
along with foam-extend. If not, see <http://www.gnu.org/licenses/>. along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
Class Class
processorFvPatchField processorFaPatchField
Description Description

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#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
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef processorFaPatchVectorNFields_H
#define processorFaPatchVectorNFields_H
#include "areaVectorNFields.H"
#include "faPatchVectorNFields.H"
#include "processorFaPatchVectorNFieldsFwd.H"
#include "processorFaPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef processorFaPatchVectorNFieldsFwd_H
#define processorFaPatchVectorNFieldsFwd_H
#include "VectorNFieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class processorFaPatchField;
#define makeTypedef(type, Type, args...) \
typedef processorFaPatchField<type> processorFaPatch##Type##Field;
forAllVectorNTypes(makeTypedef)
#undef makeTypedef
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -22,7 +22,7 @@ License
along with foam-extend. If not, see <http://www.gnu.org/licenses/>. along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
Class Class
wedgeFvPatchField wedgeFaPatchField
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -44,7 +44,7 @@ template<class Type> class wedgeFaPatchField;
// typedef wedgeFaPatchField<vector> wedgeFaPatchVectorField; // typedef wedgeFaPatchField<vector> wedgeFaPatchVectorField;
// typedef wedgeFaPatchField<tensor> wedgeFaPatchTensorField; // typedef wedgeFaPatchField<tensor> wedgeFaPatchTensorField;
// template<class Type> class wedgeFvPatchField; // template<class Type> class wedgeFaPatchField;
makeFaPatchTypeFieldTypedefs(wedge) makeFaPatchTypeFieldTypedefs(wedge)

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "wedgeFaPatchVectorNFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
#define makeVectorTensorNWedgeFuncDefs(Type) \
template<> \
tmp<Field<Type> > wedgeFaPatchField<Type>::snGrad() const \
{ \
return tmp<Field<Type> > \
( \
new Field<Type>(size(), pTraits<Type>::zero) \
); \
} \
\
template<> \
void wedgeFaPatchField<Type>::evaluate \
( \
const Pstream::commsTypes commsType \
) \
{ \
if (!updated()) \
{ \
updateCoeffs(); \
} \
\
this->operator==(patchInternalField()); \
} \
\
template<> \
tmp<Field<Type> > wedgeFaPatchField<Type>::snGradTransformDiag() \
const \
{ \
return tmp<Field<Type> > \
( \
new Field<Type>(this->size(), pTraits<Type>::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
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#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<Field<type > > wedgeFaPatchField<type >::snGrad() const; \
\
template<> \
void wedgeFaPatchField<type >::evaluate \
( \
const Pstream::commsTypes commsType \
); \
\
template<> \
tmp<Field<type > > \
wedgeFaPatchField<type >::snGradTransformDiag() const;
forAllVectorNTypes(doMakeVectorTensorNWedgeFuncDefs)
forAllTensorNTypes(doMakeVectorTensorNWedgeFuncDefs)
forAllDiagTensorNTypes(doMakeVectorTensorNWedgeFuncDefs)
forAllSphericalTensorNTypes(doMakeVectorTensorNWedgeFuncDefs)
#undef doMakeVectorTensorNWedgeFuncDefs
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef wedgeFaPatchVectorNFieldsFwd_H
#define wedgeFaPatchVectorNFieldsFwd_H
#include "VectorNFieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class wedgeFaPatchField;
#define makeTypedef(type, Type, args...) \
typedef wedgeFaPatchField<type> wedgeFaPatch##Type##Field;
forAllVectorNTypes(makeTypedef)
forAllTensorNTypes(makeTypedef)
forAllDiagTensorNTypes(makeTypedef)
forAllSphericalTensorNTypes(makeTypedef)
#undef makeTypedef
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#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
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef faPatchVectorNFields_H
#define faPatchVectorNFields_H
#include "faPatchVectorNFieldsFwd.H"
#include "faPatchField.H"
#include "faPatchFieldsFwd.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef faPatchVectorNFieldsFwd_H
#define faPatchVectorNFieldsFwd_H
#include "VectorNFieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class faPatchField;
#define doMakeTypedef(type, Type, args...) \
typedef faPatchField<type > faPatch##Type##Field;
forAllVectorNTypes(doMakeTypedef)
forAllTensorNTypes(doMakeTypedef)
forAllDiagTensorNTypes(doMakeTypedef)
forAllSphericalTensorNTypes(doMakeTypedef)
#undef doMakeTypedef
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#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
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef calculatedFaePatchVectorNFields_H
#define calculatedFaePatchVectorNFields_H
#include "calculatedFaePatchVectorNFieldsFwd.H"
#include "calculatedFaePatchField.H"
#include "faePatchVectorNFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
Class
calculatedFaePatchField
Description
\*---------------------------------------------------------------------------*/
#ifndef calculatedFaePatchVectorNFieldsFwd_H
#define calculatedFaePatchVectorNFieldsFwd_H
#include "VectorNFieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class calculatedFaePatchField;
#define doMakeTypedef(type, Type, args...) \
typedef calculatedFaePatchField<type > calculatedFaePatch##Type##Field;
forAllVectorNTypes(doMakeTypedef)
forAllTensorNTypes(doMakeTypedef)
forAllDiagTensorNTypes(doMakeTypedef)
forAllSphericalTensorNTypes(doMakeTypedef)
#undef doMakeTypedef
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#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
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef coupledFaePatchVectorNFields_H
#define coupledFaePatchVectorNFields_H
#include "coupledFaePatchVectorNFieldsFwd.H"
#include "coupledFaePatchField.H"
#include "faePatchVectorNFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
Class
coupledFaePatchField
Description
\*---------------------------------------------------------------------------*/
#ifndef coupledFaePatchVectorNFieldsFwd_H
#define coupledFaePatchVectorNFieldsFwd_H
#include "VectorNFieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class coupledFaePatchField;
#define doMakeTypedef(type, Type, args...) \
typedef coupledFaePatchField<type > coupledFaePatch##Type##Field;
forAllVectorNTypes(doMakeTypedef)
forAllTensorNTypes(doMakeTypedef)
forAllDiagTensorNTypes(doMakeTypedef)
forAllSphericalTensorNTypes(doMakeTypedef)
#undef doMakeTypedef
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#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
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef emptyFaePatchVectorNFields_H
#define emptyFaePatchVectorNFields_H
#include "emptyFaePatchVectorNFieldsFwd.H"
#include "emptyFaePatchField.H"
#include "faePatchVectorNFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef emptyFaePatchVectorNFieldsFwd_H
#define emptyFaePatchVectorNFieldsFwd_H
#include "VectorNFieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class emptyFaePatchField;
#define doMakeTypedef(type, Type, args...) \
typedef emptyFaePatchField<type > emptyFaePatch##Type##Field;
forAllVectorNTypes(doMakeTypedef)
forAllTensorNTypes(doMakeTypedef)
forAllDiagTensorNTypes(doMakeTypedef)
forAllSphericalTensorNTypes(doMakeTypedef)
#undef doMakeTypedef
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#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
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef faePatchVectorNFields_H
#define faePatchVectorNFields_H
#include "faePatchVectorNFieldsFwd.H"
#include "faePatchField.H"
#include "faePatchFieldsFwd.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef faePatchVectorNFieldsFwd_H
#define faePatchVectorNFieldsFwd_H
#include "VectorNFieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class faePatchField;
typedef faePatchField<vector2> faePatchVector2Field;
typedef faePatchField<vector3> faePatchVector3Field;
typedef faePatchField<vector4> faePatchVector4Field;
typedef faePatchField<vector6> faePatchVector6Field;
typedef faePatchField<vector8> faePatchVector8Field;
typedef faePatchField<tensor2> faePatchTensor2Field;
typedef faePatchField<tensor3> faePatchTensor3Field;
typedef faePatchField<tensor4> faePatchTensor4Field;
typedef faePatchField<tensor6> faePatchTensor6Field;
typedef faePatchField<tensor8> faePatchTensor8Field;
typedef faePatchField<diagTensor2> faePatchDiagTensor2Field;
typedef faePatchField<diagTensor3> faePatchDiagTensor3Field;
typedef faePatchField<diagTensor4> faePatchDiagTensor4Field;
typedef faePatchField<diagTensor6> faePatchDiagTensor6Field;
typedef faePatchField<diagTensor8> faePatchDiagTensor8Field;
typedef faePatchField<sphericalTensor2> faePatchSphericalTensor2Field;
typedef faePatchField<sphericalTensor3> faePatchSphericalTensor3Field;
typedef faePatchField<sphericalTensor4> faePatchSphericalTensor4Field;
typedef faePatchField<sphericalTensor6> faePatchSphericalTensor6Field;
typedef faePatchField<sphericalTensor8> faePatchSphericalTensor8Field;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#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
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef processorFaePatchVectorNFields_H
#define processorFaePatchVectorNFields_H
#include "processorFaePatchVectorNFieldsFwd.H"
#include "processorFaePatchField.H"
#include "faePatchVectorNFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
Class
processorFaePatchField
Description
\*---------------------------------------------------------------------------*/
#ifndef processorFaePatchVectorNFieldsFwd_H
#define processorFaePatchVectorNFieldsFwd_H
#include "VectorNFieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class processorFaePatchField;
#define doMakeTypedef(type, Type, args...) \
typedef processorFaePatchField<type > processorFaePatch##Type##Field;
forAllVectorNTypes(doMakeTypedef)
#undef doMakeTypedef
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#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
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef wedgeFaePatchVectorNFields_H
#define wedgeFaePatchVectorNFields_H
#include "wedgeFaePatchVectorNFieldsFwd.H"
#include "wedgeFaePatchField.H"
#include "faePatchVectorNFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef wedgeFaePatchVectorNFieldsFwd_H
#define wedgeFaePatchVectorNFieldsFwd_H
#include "VectorNFieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class wedgeFaePatchField;
#define doMakeTypedef(type, Type, args...) \
typedef wedgeFaePatchField<type > wedgeFaePatch##Type##Field;
forAllVectorNTypes(doMakeTypedef)
forAllTensorNTypes(doMakeTypedef)
forAllDiagTensorNTypes(doMakeTypedef)
forAllSphericalTensorNTypes(doMakeTypedef)
#undef doMakeTypedef
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -24,7 +24,8 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "solutionControl.H" #include "solutionControl.H"
#include "lduMatrix.H" #include "fieldTypes.H"
#include "VectorNFieldTypes.H"
#include "fvc.H" #include "fvc.H"
#include "inletOutletFvPatchFields.H" #include "inletOutletFvPatchFields.H"
#include "slipFvPatchFields.H" #include "slipFvPatchFields.H"
@ -180,6 +181,21 @@ void Foam::solutionControl::storePrevIterFields() const
storePrevIter<sphericalTensor>(); storePrevIter<sphericalTensor>();
storePrevIter<symmTensor>(); storePrevIter<symmTensor>();
storePrevIter<tensor>(); storePrevIter<tensor>();
storePrevIter<vector2>();
storePrevIter<vector4>();
storePrevIter<vector6>();
storePrevIter<vector8>();
storePrevIter<sphericalTensor2>();
storePrevIter<sphericalTensor4>();
storePrevIter<sphericalTensor6>();
storePrevIter<sphericalTensor8>();
storePrevIter<tensor2>();
storePrevIter<tensor4>();
storePrevIter<tensor6>();
storePrevIter<tensor8>();
} }
@ -196,7 +212,7 @@ void Foam::solutionControl::maxTypeResidual
if (mesh_.foundObject<fieldType>(fieldName)) if (mesh_.foundObject<fieldType>(fieldName))
{ {
const List<lduSolverPerformance> sp(data); const List<BlockSolverPerformance<Type> > sp(data);
firstRes = cmptMax(sp.first().initialResidual()); firstRes = cmptMax(sp.first().initialResidual());
lastRes = cmptMax(sp.last().initialResidual()); lastRes = cmptMax(sp.last().initialResidual());
} }
@ -218,6 +234,21 @@ Foam::scalar Foam::solutionControl::maxResidual
maxTypeResidual<symmTensor>(fieldName, data, firstRes, lastRes); maxTypeResidual<symmTensor>(fieldName, data, firstRes, lastRes);
maxTypeResidual<tensor>(fieldName, data, firstRes, lastRes); maxTypeResidual<tensor>(fieldName, data, firstRes, lastRes);
maxTypeResidual<vector2>(fieldName, data, firstRes, lastRes);
maxTypeResidual<vector4>(fieldName, data, firstRes, lastRes);
maxTypeResidual<vector6>(fieldName, data, firstRes, lastRes);
maxTypeResidual<vector8>(fieldName, data, firstRes, lastRes);
maxTypeResidual<sphericalTensor2>(fieldName, data, firstRes, lastRes);
maxTypeResidual<sphericalTensor4>(fieldName, data, firstRes, lastRes);
maxTypeResidual<sphericalTensor6>(fieldName, data, firstRes, lastRes);
maxTypeResidual<sphericalTensor8>(fieldName, data, firstRes, lastRes);
maxTypeResidual<tensor2>(fieldName, data, firstRes, lastRes);
maxTypeResidual<tensor4>(fieldName, data, firstRes, lastRes);
maxTypeResidual<tensor6>(fieldName, data, firstRes, lastRes);
maxTypeResidual<tensor8>(fieldName, data, firstRes, lastRes);
return firstRes; return firstRes;
} }

View file

@ -1375,6 +1375,8 @@ Foam::BlockSolverPerformance<Type> Foam::fvBlockMatrix<Type>::solve
// Print performance // Print performance
solverPerf.print(); solverPerf.print();
psi_.mesh().solutionDict().setSolverPerformance(psi_.name(), solverPerf);
return solverPerf; return solverPerf;
} }

View file

@ -69,7 +69,7 @@ Foam::lduSolverPerformance Foam::fvMatrix<Type>::solve
// Complete matrix assembly. HJ, 17/Apr/2012 // Complete matrix assembly. HJ, 17/Apr/2012
this->completeAssembly(); this->completeAssembly();
lduSolverPerformance solverPerfVec BlockSolverPerformance<Type> solverPerfVec
( (
"fvMatrix<Type>::solve", "fvMatrix<Type>::solve",
psi_.name() psi_.name()
@ -155,14 +155,7 @@ Foam::lduSolverPerformance Foam::fvMatrix<Type>::solve
solverPerf.print(); solverPerf.print();
if solverPerfVec.replace(cmpt, solverPerf);
(
solverPerf.initialResidual() > solverPerfVec.initialResidual()
&& !solverPerf.singular()
)
{
solverPerfVec = solverPerf;
}
psi.internalField().replace(cmpt, psiCmpt); psi.internalField().replace(cmpt, psiCmpt);
diag() = saveDiag; diag() = saveDiag;
@ -172,7 +165,7 @@ Foam::lduSolverPerformance Foam::fvMatrix<Type>::solve
psi_.mesh().solutionDict().setSolverPerformance(psi_.name(), solverPerfVec); psi_.mesh().solutionDict().setSolverPerformance(psi_.name(), solverPerfVec);
return solverPerfVec; return solverPerfVec.max();
} }

View file

@ -112,6 +112,36 @@ void Foam::BlockSolverPerformance<Type>::print() const
} }
template<class Type>
void Foam::BlockSolverPerformance<Type>::replace
(
const Foam::label cmpt,
const Foam::BlockSolverPerformance<typename pTraits<Type>::cmptType>& bsp
)
{
initialResidual_.replace(cmpt, bsp.initialResidual());
finalResidual_.replace(cmpt, bsp.finalResidual());
singular_ = singular_ || bsp.singular();
}
template<class Type>
Foam::BlockSolverPerformance<typename Foam::pTraits<Type>::cmptType>
Foam::BlockSolverPerformance<Type>::max()
{
return BlockSolverPerformance<typename pTraits<Type>::cmptType>
(
solverName_,
fieldName_,
cmptMax(initialResidual_),
cmptMax(finalResidual_),
nIterations_,
converged_,
singular_
);
}
template<class Type> template<class Type>
bool Foam::BlockSolverPerformance<Type>::operator!= bool Foam::BlockSolverPerformance<Type>::operator!=
( (
@ -131,6 +161,26 @@ bool Foam::BlockSolverPerformance<Type>::operator!=
} }
template<class Type>
typename Foam::BlockSolverPerformance<Type> Foam::max
(
const typename Foam::BlockSolverPerformance<Type>& bsp1,
const typename Foam::BlockSolverPerformance<Type>& bsp2
)
{
return BlockSolverPerformance<Type>
(
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<class Type> template<class Type>
Foam::Istream& Foam::operator>> Foam::Istream& Foam::operator>>
( (

View file

@ -50,6 +50,13 @@ namespace Foam
template<class Type> template<class Type>
class BlockSolverPerformance; class BlockSolverPerformance;
template<class Type>
BlockSolverPerformance<Type> max
(
const BlockSolverPerformance<Type>&,
const BlockSolverPerformance<Type>&
);
template<class Type> template<class Type>
Istream& operator>>(Istream&, BlockSolverPerformance<Type>&); Istream& operator>>(Istream&, BlockSolverPerformance<Type>&);
@ -217,6 +224,17 @@ public:
//- Print summary of solver performance //- Print summary of solver performance
void print() const; void print() const;
//- Replace component based on the minimal BlockSolverPerformance
void replace
(
const label cmpt,
const BlockSolverPerformance<typename pTraits<Type>::cmptType>& sp
);
//- Return the summary maximum of BlockSolverPerformance<Type>
// Effectively it will mostly return BlockSolverPerformance<scalar>
BlockSolverPerformance<typename pTraits<Type>::cmptType> max();
// Member Operators // Member Operators
@ -225,6 +243,16 @@ public:
// Friend functions // Friend functions
//- Return the element-wise max of two BlockSolverPerformance<Type>s
friend BlockSolverPerformance<Type> Foam::max <Type>
(
const BlockSolverPerformance<Type>&,
const BlockSolverPerformance<Type>&
);
// Ostream operator
friend Istream& operator>> <Type> friend Istream& operator>> <Type>
( (
Istream&, Istream&,

View file

@ -31,22 +31,27 @@ Author
#include "BlockSolverPerformances.H" #include "BlockSolverPerformances.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineNamedTemplateTypeNameAndDebug(BlockSolverPerformanceScalar, 1); defineNamedTemplateTypeNameAndDebug(BlockSolverPerformanceScalar, 1);
defineNamedTemplateTypeNameAndDebug(BlockSolverPerformanceVector, 1); defineNamedTemplateTypeNameAndDebug(BlockSolverPerformanceVector, 1);
defineNamedTemplateTypeNameAndDebug(BlockSolverPerformanceSphericalTensor, 1); defineNamedTemplateTypeNameAndDebug(BlockSolverPerformanceSphericalTensor, 1);
defineNamedTemplateTypeNameAndDebug(BlockSolverPerformanceSymmTensor, 1); defineNamedTemplateTypeNameAndDebug(BlockSolverPerformanceSymmTensor, 1);
defineNamedTemplateTypeNameAndDebug(BlockSolverPerformanceTensor, 1); defineNamedTemplateTypeNameAndDebug(BlockSolverPerformanceTensor, 1);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam template<>
Foam::BlockSolverPerformance<Foam::scalar>
Foam::BlockSolverPerformance<Foam::scalar>::max()
{
return *this;
}
// ************************************************************************* // // ************************************************************************* //

View file

@ -127,6 +127,15 @@ void Foam::solution::read(const dictionary& dict)
{ {
solverPerformance_ = dict.subDict("solverPerformance"); 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), eqnRelaxDefault_(0),
solvers_(dictionary::null), solvers_(dictionary::null),
solverPerformance_(dictionary::null), solverPerformance_(dictionary::null),
prevTimeIndex_(0) prevTimeIndex_(0),
storeAllResiduals_(false)
{ {
if (!headerOk()) if (!headerOk())
{ {
@ -422,49 +432,4 @@ Foam::dictionary& Foam::solution::solverPerformanceDict() const
return solverPerformance_; return solverPerformance_;
} }
void Foam::solution::setSolverPerformance
(
const word& name,
const lduSolverPerformance& sp
) const
{
List<lduSolverPerformance> 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);
}
// ************************************************************************* // // ************************************************************************* //

View file

@ -37,7 +37,8 @@ SourceFiles
#include "IOdictionary.H" #include "IOdictionary.H"
#include "debugSwitch.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 //- Previously used time-index, used for reset between iterations
mutable label prevTimeIndex_; mutable label prevTimeIndex_;
//- Switch for storing residuals of every iteration inside a single
// timestep
bool storeAllResiduals_;
// Private Member Functions // Private Member Functions
@ -156,17 +161,19 @@ public:
// checking // checking
dictionary& solverPerformanceDict() const; dictionary& solverPerformanceDict() const;
//- Add/set the solverPerformance entry for the named field //- Add/set the BlockSolverPerformance entry for the named field
template<class Type>
void setSolverPerformance void setSolverPerformance
( (
const word& name, const word& name,
const lduSolverPerformance& const BlockSolverPerformance<Type>&
) const; ) const;
//- Add/set the solverPerformance entry, using its fieldName //- Add/set the BlockSolverPerformance entry, using its fieldName
template<class Type>
void setSolverPerformance void setSolverPerformance
( (
const lduSolverPerformance& const BlockSolverPerformance<Type>&
) const; ) const;

View file

@ -45,6 +45,55 @@ void Foam::solution::cachePrintMessage
} }
template<class Type>
void Foam::solution::setSolverPerformance
(
const word& name,
const BlockSolverPerformance<Type>& sp
) const
{
List<BlockSolverPerformance<Type> > 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<class Type>
void Foam::solution::setSolverPerformance
(
const BlockSolverPerformance<Type>& sp
) const
{
setSolverPerformance(sp.fieldName(), sp);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View file

@ -52,7 +52,7 @@ lduSolverPerformance tetFemMatrix<Type>::solve
this->check(); this->check();
} }
lduSolverPerformance solverPerfVec BlockSolverPerformance<Type> solverPerfVec
( (
"tetFemMatrix<Type>::solve", "tetFemMatrix<Type>::solve",
psi_.name() psi_.name()
@ -152,14 +152,7 @@ lduSolverPerformance tetFemMatrix<Type>::solve
solverPerf.print(); solverPerf.print();
if solverPerfVec.replace(cmpt, solverPerf);
(
solverPerf.initialResidual() > solverPerfVec.initialResidual()
&& !solverPerf.singular()
)
{
solverPerfVec = solverPerf;
}
psi.internalField().replace(cmpt, psiCmpt); psi.internalField().replace(cmpt, psiCmpt);
@ -174,7 +167,9 @@ lduSolverPerformance tetFemMatrix<Type>::solve
psi.correctBoundaryConditions(); psi.correctBoundaryConditions();
return solverPerfVec; psi_.mesh().solutionDict().setSolverPerformance(psi_.name(), solverPerfVec);
return solverPerfVec.max();
} }

View file

@ -131,6 +131,8 @@ lduSolverPerformance tetFemMatrix<scalar>::solve
psi.correctBoundaryConditions(); psi.correctBoundaryConditions();
psi_.mesh().solutionDict().setSolverPerformance(psi_.name(), solverPerf);
return solverPerf; return solverPerf;
} }