From e3115846f5cad2bf95fcd999952a827c9dd6e667 Mon Sep 17 00:00:00 2001 From: Vanja Skuric Date: Sun, 11 Feb 2018 18:59:15 +0100 Subject: [PATCH 1/6] New feature: generalization of storage for solverPerformanceDict based on templated BlockSolverPerformance (by Pascal Beckstein) To correct the previous commit, the BlockSolverPerformance has been enhanced by a replace(...) and max(...) memeber function. The matrix solve functions of fvMatrix, faMatrix and tetFemMatrix now store solver performance data for all components in the solverPerformance dictionary of solution. However, they will still return a scalar-valued lduSolverPerformance based on the component with the max residual. This is necessary as otherwise the type of a non-scalar field, which may be specified in fvSolution::residualControl does not match the type which is written to and read from the solverPerformance dictionary in the maxTypeResidual(...) from solutionControl. If e.g. the field U is given in fvSolution::residualControl of solutionControl, the constructor of BlockSolverPerformance in the maxTypeResidual(...) from solutionControl expects to read a vector ( u1 u2 u3 ) from the dictionary and not just one component. The changes are inspired and directly related to the following vanilla commit: https://github.com/OpenFOAM/OpenFOAM-dev/commit/1944b09bb530a8b9a2546ac3b196b137668d329f --- .../faMatrices/faMatrix/faMatrixSolve.C | 15 +- .../faScalarMatrix/faScalarMatrix.C | 4 + .../solutionControl/solutionControl.C | 556 ++---------------- .../fvMatrices/fvBlockMatrix/fvBlockMatrix.C | 2 + .../fvMatrices/fvMatrix/fvMatrixSolve.C | 13 +- .../BlockLduSolver/BlockSolverPerformance.C | 50 ++ .../BlockLduSolver/BlockSolverPerformance.H | 28 + .../BlockLduSolver/BlockSolverPerformances.C | 13 +- src/foam/matrices/solution/solution.C | 45 -- src/foam/matrices/solution/solution.H | 13 +- .../matrices/solution/solutionTemplates.C | 37 ++ .../tetFemMatrix/tetFemMatrixSolve.C | 15 +- .../tetFemMatrix/tetFemScalarMatrix.C | 2 + 13 files changed, 187 insertions(+), 606 deletions(-) diff --git a/src/finiteArea/faMatrices/faMatrix/faMatrixSolve.C b/src/finiteArea/faMatrices/faMatrix/faMatrixSolve.C index 948c04b51..126ead1b3 100644 --- a/src/finiteArea/faMatrices/faMatrix/faMatrixSolve.C +++ b/src/finiteArea/faMatrices/faMatrix/faMatrixSolve.C @@ -60,7 +60,7 @@ lduSolverPerformance faMatrix::solve(const dictionary& solverControls) << endl; } - lduSolverPerformance solverPerfVec + BlockSolverPerformance solverPerfVec ( "faMatrix::solve", psi_.name() @@ -134,14 +134,7 @@ lduSolverPerformance faMatrix::solve(const dictionary& solverControls) solverPerf.print(); - if - ( - solverPerf.initialResidual() > solverPerfVec.initialResidual() - && !solverPerf.singular() - ) - { - solverPerfVec = solverPerf; - } + solverPerfVec.replace(cmpt, solverPerf); psi.internalField().replace(cmpt, psiCmpt); diag() = saveDiag; @@ -149,7 +142,9 @@ lduSolverPerformance faMatrix::solve(const dictionary& solverControls) psi.correctBoundaryConditions(); - return solverPerfVec; + psi_.mesh().solutionDict().setSolverPerformance(psi_.name(), solverPerfVec); + + return solverPerfVec.max(); } diff --git a/src/finiteArea/faMatrices/faScalarMatrix/faScalarMatrix.C b/src/finiteArea/faMatrices/faScalarMatrix/faScalarMatrix.C index 5b89e8903..85bd8d706 100644 --- a/src/finiteArea/faMatrices/faScalarMatrix/faScalarMatrix.C +++ b/src/finiteArea/faMatrices/faScalarMatrix/faScalarMatrix.C @@ -130,6 +130,8 @@ lduSolverPerformance faMatrix::faSolver::solve psi.correctBoundaryConditions(); + psi.mesh().solutionDict().setSolverPerformance(psi.name(), solverPerf); + return solverPerf; } @@ -177,6 +179,8 @@ lduSolverPerformance faMatrix::solve psi.correctBoundaryConditions(); + psi_.mesh().solutionDict().setSolverPerformance(psi_.name(), solverPerf); + return solverPerf; } diff --git a/src/finiteVolume/cfdTools/general/solutionControl/solutionControl/solutionControl.C b/src/finiteVolume/cfdTools/general/solutionControl/solutionControl/solutionControl.C index 67b1bcf30..1882b95fc 100644 --- a/src/finiteVolume/cfdTools/general/solutionControl/solutionControl/solutionControl.C +++ b/src/finiteVolume/cfdTools/general/solutionControl/solutionControl/solutionControl.C @@ -24,11 +24,8 @@ License \*---------------------------------------------------------------------------*/ #include "solutionControl.H" -#include "lduMatrix.H" -#include "fvc.H" -#include "inletOutletFvPatchFields.H" -#include "slipFvPatchFields.H" -#include "symmetryFvPatchFields.H" +#include "fieldTypes.H" +#include "VectorNFieldTypes.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -180,6 +177,21 @@ void Foam::solutionControl::storePrevIterFields() const storePrevIter(); storePrevIter(); storePrevIter(); + + storePrevIter(); + storePrevIter(); + storePrevIter(); + storePrevIter(); + + storePrevIter(); + storePrevIter(); + storePrevIter(); + storePrevIter(); + + storePrevIter(); + storePrevIter(); + storePrevIter(); + storePrevIter(); } @@ -196,7 +208,7 @@ void Foam::solutionControl::maxTypeResidual if (mesh_.foundObject(fieldName)) { - const List sp(data); + const List > sp(data); firstRes = cmptMax(sp.first().initialResidual()); lastRes = cmptMax(sp.last().initialResidual()); } @@ -218,119 +230,25 @@ Foam::scalar Foam::solutionControl::maxResidual maxTypeResidual(fieldName, data, firstRes, lastRes); maxTypeResidual(fieldName, data, firstRes, lastRes); + maxTypeResidual(fieldName, data, firstRes, lastRes); + maxTypeResidual(fieldName, data, firstRes, lastRes); + maxTypeResidual(fieldName, data, firstRes, lastRes); + maxTypeResidual(fieldName, data, firstRes, lastRes); + + maxTypeResidual(fieldName, data, firstRes, lastRes); + maxTypeResidual(fieldName, data, firstRes, lastRes); + maxTypeResidual(fieldName, data, firstRes, lastRes); + maxTypeResidual(fieldName, data, firstRes, lastRes); + + maxTypeResidual(fieldName, data, firstRes, lastRes); + maxTypeResidual(fieldName, data, firstRes, lastRes); + maxTypeResidual(fieldName, data, firstRes, lastRes); + maxTypeResidual(fieldName, data, firstRes, lastRes); + return firstRes; } -const Foam::dimensionedScalar Foam::solutionControl::relaxFactor -( - const Foam::volVectorField& U -) const -{ - scalar urf = 1; - - if (mesh_.solutionDict().relaxEquation(U.name())) - { - urf = mesh_.solutionDict().equationRelaxationFactor(U.name()); - } - - return dimensionedScalar("alphaU", dimless, urf); -} - - -void Foam::solutionControl::addDdtFluxContribution -( - surfaceScalarField& phi, - surfaceScalarField& aCoeff, - const surfaceVectorField& faceU, - const volVectorField& U, - const surfaceScalarField& rAUf, - const fvVectorMatrix& ddtUEqn -) const -{ - // Add ddt scheme dependent flux contribution. Here: phi = H/A & Sf. - phi += fvc::ddtConsistentPhiCorr(faceU, U, rAUf); - - // Add ddt scheme dependent contribution to diffusion scale coeff. Here: - // aCoeff = 1. - aCoeff += fvc::interpolate(ddtUEqn.A())*rAUf; -} - - -void Foam::solutionControl::addUnderRelaxationFluxContribution -( - surfaceScalarField& phi, - surfaceScalarField& aCoeff, - const volVectorField& U -) const -{ - // Get under-relaxation factor used in this iteration - const dimensionedScalar alphaU(this->relaxFactor(U)); - - // Return if the under-relaxation factor is >= 1 and =< 0 - if ((alphaU.value() > 1.0 - SMALL) || (alphaU.value() < SMALL)) - { - return; - } - - const dimensionedScalar urfCoeff((1.0 - alphaU)/alphaU); - - // Add under-relaxation dependent flux contribution - phi += urfCoeff*aCoeff*phi.prevIter(); - - // Add under-relaxation dependent contribution to diffusion scale coeff - aCoeff += urfCoeff*aCoeff; -} - - -void Foam::solutionControl::correctBoundaryFlux -( - surfaceScalarField& phi, - const volVectorField& U -) const -{ - // Get necessary data at the boundaries - const volVectorField::GeometricBoundaryField& Ub = U.boundaryField(); - const surfaceVectorField::GeometricBoundaryField& Sb = - mesh_.Sf().boundaryField(); - - surfaceScalarField::GeometricBoundaryField& phib = phi.boundaryField(); - - // Correct flux at boundaries depending on patch type. Note: it is possible - // that we missed some important boundary conditions that need special - // considerations when calculating the flux. Maybe we can reorganise this in - // future by relying on distinction between = and == operators for - // fvsPatchFields. However, that would require serious changes at the - // moment (e.g. using phi = rUA*UEqn.H() as in most solvers would not update - // the boundary values correctly for fixed fvsPatchFields). VV, 20/Apr/2017. - forAll (phib, patchI) - { - // Get patch field - const fvPatchVectorField& Up = Ub[patchI]; - - if - ( - Up.fixesValue() - && !isA(Up) - ) - { - // This is fixed value patch, flux needs to be recalculated - // with respect to the boundary condition - phib[patchI] == (Up & Sb[patchI]); - } - else if - ( - isA(Up) - || isA(Up) - ) - { - // This is slip or symmetry, flux needs to be zero - phib[patchI] == 0.0; - } - } -} - - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::solutionControl::solutionControl(fvMesh& mesh, const word& algorithmName) @@ -349,10 +267,7 @@ Foam::solutionControl::solutionControl(fvMesh& mesh, const word& algorithmName) transonic_(false), consistent_(false), corr_(0), - corrNonOrtho_(0), - aCoeffPtrs_(), - faceUPtrs_(), - indices_() + corrNonOrtho_(0) {} @@ -362,407 +277,4 @@ Foam::solutionControl::~solutionControl() {} -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void Foam::solutionControl::calcTransientConsistentFlux -( - surfaceScalarField& phi, - const volVectorField& U, - const volScalarField& rAU, - const fvVectorMatrix& ddtUEqn -) const -{ - // Store necessary data for this velocity field - const word& UName = U.name(); - - // Check whether the fields are present in the list - if (!indices_.found(UName)) - { - // Get current index as size of the indices list (before insertion) - const label i = indices_.size(); - - // Insert the index into the hash table - indices_.insert(UName, i); - - // Extend lists - aCoeffPtrs_.resize(indices_.size()); - faceUPtrs_.resize(indices_.size()); - - // Double check whether the fields have been already set - if (!aCoeffPtrs_.set(i) && !faceUPtrs_.set(i)) - { - aCoeffPtrs_.set - ( - i, - new surfaceScalarField - ( - IOobject - ( - "aCoeff." + UName, - mesh_.time().timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh_, - dimensionedScalar("zero", dimless, 0.0) - ) - ); - - faceUPtrs_.set - ( - i, - new surfaceVectorField - ( - IOobject - ( - "faceU." + UName, - mesh_.time().timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh_, - dimensionedVector("zero", dimVelocity, vector::zero) - ) - ); - } - else if (!aCoeffPtrs_.set(i) || !faceUPtrs_.set(i)) - { - FatalErrorIn - ( - "void solutionControl::calcTransientConsistentFlux" - "\n(" - "\n surfaceScalarField& phi," - "\n const volVectorField& U," - "\n const volScalarField& rAU," - "\n const fvVectorMatrix& ddtUEqn" - "\n)" - ) << "Either aCoeff or faceU is allocated for field " << UName - << " while the other is not." << nl - << " This must not happen in transient simulation. Make sure" - << " that functions aiding consistency are called in the right" - << " order (first flux and then velocity reconstruction)." - << exit(FatalError); - } - } - else - { - // Index has been set for this field, so the fields must be there as - // well. Check and report an error if they are not allocated - if (!aCoeffPtrs_.set(indices_[UName])) - { - FatalErrorIn - ( - "void solutionControl::calcTransientConsistentFlux" - "\n(" - "\n surfaceScalarField& phi," - "\n const volVectorField& U," - "\n const volScalarField& rAU," - "\n const fvVectorMatrix& ddtUEqn" - "\n)" - ) << "Index is set, but the aCoeff field is not allocated for " - << UName << "." << nl - << "This should not happen for transient simulation." << nl - << "Something went wrong." - << exit(FatalError); - } - else if (!faceUPtrs_.set(indices_[UName])) - { - FatalErrorIn - ( - "void solutionControl::calcTransientConsistentFlux" - "\n(" - "\n surfaceScalarField& phi," - "\n const volVectorField& U," - "\n const volScalarField& rAU," - "\n const fvVectorMatrix& ddtUEqn" - "\n)" - ) << "Index is set, but the faceU field is not allocated for " - << UName << "." << nl - << "This should not happen for transient simulation." << nl - << "Something went wrong." - << exit(FatalError); - } - } - - // Algorithm: - // 1. Update flux and aCoeff due to ddt discretisation - // 2. Update flux and aCoeff due to under-relaxation - // 3. Scale the flux with aCoeff, making sure that flux at fixed boundaries - // remains consistent - - // Get index from the hash table - const label i = indices_[UName]; - - // Get fields that will be updated - surfaceScalarField& aCoeff = aCoeffPtrs_[i]; - surfaceVectorField& faceU = faceUPtrs_[i]; - - // Update face interpolated velocity field. Note: handling of oldTime faceU - // fields happens in ddt scheme when calling ddtConsistentPhiCorr inside - // addDdtFluxContribution - faceU = fvc::interpolate(U); - - // Interpolate original rAU on the faces - const surfaceScalarField rAUf = fvc::interpolate(rAU); - - // Store previous iteration for the correct handling of under-relaxation - phi.storePrevIter(); - - // Calculate the ordinary part of the flux (H/A) - phi = (faceU & mesh_.Sf()); - - // Initialize aCoeff to 1 - aCoeff = dimensionedScalar("one", dimless, 1.0); - - // STAGE 1: consistent ddt discretisation handling - addDdtFluxContribution(phi, aCoeff, faceU, U, rAUf, ddtUEqn); - - // STAGE 2: consistent under-relaxation handling - addUnderRelaxationFluxContribution(phi, aCoeff, U); - - // STAGE 3: scale the flux and correct it at the boundaries - phi /= aCoeff; - correctBoundaryFlux(phi, U); -} - - -void Foam::solutionControl::calcSteadyConsistentFlux -( - surfaceScalarField& phi, - const volVectorField& U -) const -{ - // Store necessary data for this velocity field - const word& UName = U.name(); - - // Check whether the fields are present in the list - if (!indices_.found(UName)) - { - // Get current index as size of the indices list (before insertion) - const label i = indices_.size(); - - // Insert the index into the hash table - indices_.insert(UName, i); - - // Extend list (only aCoeff list because faceU does not need to be - // stored for steady state simulations) - aCoeffPtrs_.resize(indices_.size()); - - // Double check whether the aCoeff field has been already set. Note: - // faceU does not need to be stored for steady state - if (!aCoeffPtrs_.set(i) && faceUPtrs_.empty()) - { - aCoeffPtrs_.set - ( - i, - new surfaceScalarField - ( - IOobject - ( - "aCoeff." + UName, - mesh_.time().timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh_, - dimensionedScalar("zero", dimless, 0.0) - ) - ); - } - else if (!aCoeffPtrs_.set(i) || !faceUPtrs_.empty()) - { - FatalErrorIn - ( - "void solutionControl::calcSteadyConsistentFlux" - "\n(" - "\n surfaceScalarField& phi," - "\n const volVectorField& U," - "\n const volScalarField& rAU" - "\n)" - ) << "Either aCoeff or faceU is allocated for field " << UName - << " while the other is not." - << "This must not happen in transient simulation. Make sure" - << " that functions aiding consistency are called in the right" - << " order (first flux and then velocity reconstruction)." - << exit(FatalError); - } - } - else - { - // Index has been set for this field. Check the state of fields - if (!aCoeffPtrs_.set(indices_[UName])) - { - // aCoeff field should be allocated - FatalErrorIn - ( - "void solutionControl::calcSteadyConsistentFlux" - "\n(" - "\n surfaceScalarField& phi," - "\n const volVectorField& U," - "\n const volScalarField& rAU" - "\n)" - ) << "Index is set, but the aCoeff field is not allocated for " - << UName << "." << nl - << "This should not happen for steady state simulation." << nl - << "Something went wrong." - << exit(FatalError); - } - else if (!faceUPtrs_.empty()) - { - // faceU field shouldn't be allocated - FatalErrorIn - ( - "void solutionControl::calcSteadyConsistentFlux" - "\n(" - "\n surfaceScalarField& phi," - "\n const volVectorField& U," - "\n const volScalarField& rAU" - "\n)" - ) << "Index is set, but the faceU field is allocated for " - << UName << "." << nl - << "This should not happen for steady state simulation." << nl - << "Something went wrong." - << exit(FatalError); - } - } - - // Algorithm: - // 1. Update flux and aCoeff due to under-relaxation - // 2. Scale the flux with aCoeff, making sure that flux at fixed boundaries - // remains consistent - - // Get index from the hash table - const label i = indices_[UName]; - - // Get aCoeff field. Note: no need to check whether the entry has been found - // since we have just inserted it above - surfaceScalarField& aCoeff = aCoeffPtrs_[i]; - - // Store previous iteration for the correct handling of under-relaxation - phi.storePrevIter(); - - // Calculate the ordinary part of the flux (H/A) - phi = (fvc::interpolate(U) & mesh_.Sf()); - - // Initialize aCoeff to 1 - aCoeff = dimensionedScalar("one", dimless, 1.0); - - // STAGE 1: consistent under-relaxation handling - addUnderRelaxationFluxContribution(phi, aCoeff, U); - - // STAGE 2: scale the flux and correct it at the boundaries - phi /= aCoeff; - correctBoundaryFlux(phi, U); -} - - -void Foam::solutionControl::reconstructTransientVelocity -( - volVectorField& U, - surfaceScalarField& phi, - const fvVectorMatrix& ddtUEqn, - const volScalarField& rAU, - const volScalarField& p -) const -{ - // Reconstruct the velocity using all the components from original equation - U = 1.0/(1.0/rAU + ddtUEqn.A())* - ( - U/rAU + ddtUEqn.H() - fvc::grad(p) - ); - - // Get name and the corresponding index - const word& UName = U.name(); - const label i = indices_[UName]; - - // Update divergence free face velocity field, whose value will be used in - // the next time step. Note that we need to have absolute flux here. - if (!faceUPtrs_.set(i)) - { - FatalErrorIn - ( - "void solutionControl::reconstructTransientVelocity" - "\n(" - "\n volVectorField& U," - "\n const volVectorField& ddtUEqn," - "\n const volScalarField& rAU," - "\n const volScalarField& p" - "\n const surfaceScalarField& phi" - "\n) const" - ) << "faceU not calculated for field " << UName - << ". Make sure you have called" - << " calcTransientConsistentFlux(...) before calling this function." - << exit(FatalError); - } - - // Get faceU field. Note: no need to check whether the entry has been found - // since we have just checked - surfaceVectorField& faceU = faceUPtrs_[i]; - - // First interpolate the reconstructed velocity on the faces - faceU = fvc::interpolate(U); - - // Replace the normal component with conservative flux - - const surfaceVectorField& Sf = mesh_.Sf(); - const surfaceVectorField rSf = Sf/magSqr(Sf); - - // Subtract interpolated normal component - faceU -= (Sf & faceU)*rSf; - - // Now that the normal component is zero, add the normal component from - // conservative flux - faceU += phi*rSf; - - // If the mesh is moving, flux needs to be relative before boundary - // conditions for velocity are corrected. VV and IG, 4/Jan/2016. - fvc::makeRelative(phi, U); - - // Correct boundary conditions with relative flux - U.correctBoundaryConditions(); -} - - -void Foam::solutionControl::reconstructSteadyVelocity -( - volVectorField& U, - const volScalarField& rAU, - const volScalarField& p -) const -{ - // Reconstruct the velocity field - U -= rAU*fvc::grad(p); - U.correctBoundaryConditions(); - - // Note: no need to store and update faceU field for steady state run -} - - -const Foam::surfaceScalarField& Foam::solutionControl::aCoeff -( - const word& UName -) const -{ - // Get corresponding index - const label i = indices_[UName]; - - if (!aCoeffPtrs_.set(i)) - { - FatalErrorIn - ( - "const surfaceScalarField& solutionControl::aCoeff() const" - ) << "aCoeff not calculated for field " << UName - << ". Make sure you have called" - << " calcTransientConsistentFlux(...) or " - << " calcSteadyConsistentFlux(...) before calling aCoeff()." - << exit(FatalError); - } - - return aCoeffPtrs_[i]; -} - - // ************************************************************************* // diff --git a/src/finiteVolume/fvMatrices/fvBlockMatrix/fvBlockMatrix.C b/src/finiteVolume/fvMatrices/fvBlockMatrix/fvBlockMatrix.C index 89a2a816d..ba23a5892 100644 --- a/src/finiteVolume/fvMatrices/fvBlockMatrix/fvBlockMatrix.C +++ b/src/finiteVolume/fvMatrices/fvBlockMatrix/fvBlockMatrix.C @@ -1375,6 +1375,8 @@ Foam::BlockSolverPerformance Foam::fvBlockMatrix::solve // Print performance solverPerf.print(); + psi_.mesh().solutionDict().setSolverPerformance(psi_.name(), solverPerf); + return solverPerf; } diff --git a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C index 7ecc96951..a8130abb4 100644 --- a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C +++ b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C @@ -69,7 +69,7 @@ Foam::lduSolverPerformance Foam::fvMatrix::solve // Complete matrix assembly. HJ, 17/Apr/2012 this->completeAssembly(); - lduSolverPerformance solverPerfVec + BlockSolverPerformance solverPerfVec ( "fvMatrix::solve", psi_.name() @@ -155,14 +155,7 @@ Foam::lduSolverPerformance Foam::fvMatrix::solve solverPerf.print(); - if - ( - solverPerf.initialResidual() > solverPerfVec.initialResidual() - && !solverPerf.singular() - ) - { - solverPerfVec = solverPerf; - } + solverPerfVec.replace(cmpt, solverPerf); psi.internalField().replace(cmpt, psiCmpt); diag() = saveDiag; @@ -172,7 +165,7 @@ Foam::lduSolverPerformance Foam::fvMatrix::solve psi_.mesh().solutionDict().setSolverPerformance(psi_.name(), solverPerfVec); - return solverPerfVec; + return solverPerfVec.max(); } diff --git a/src/foam/matrices/blockLduMatrix/BlockLduSolvers/BlockLduSolver/BlockSolverPerformance.C b/src/foam/matrices/blockLduMatrix/BlockLduSolvers/BlockLduSolver/BlockSolverPerformance.C index 2881f8096..4bdbcaa9a 100644 --- a/src/foam/matrices/blockLduMatrix/BlockLduSolvers/BlockLduSolver/BlockSolverPerformance.C +++ b/src/foam/matrices/blockLduMatrix/BlockLduSolvers/BlockLduSolver/BlockSolverPerformance.C @@ -112,6 +112,36 @@ void Foam::BlockSolverPerformance::print() const } +template +void Foam::BlockSolverPerformance::replace +( + const Foam::label cmpt, + const Foam::BlockSolverPerformance::cmptType>& bsp +) +{ + initialResidual_.replace(cmpt, bsp.initialResidual()); + finalResidual_.replace(cmpt, bsp.finalResidual()); + singular_ = singular_ || bsp.singular(); +} + + +template +Foam::BlockSolverPerformance::cmptType> +Foam::BlockSolverPerformance::max() +{ + return BlockSolverPerformance::cmptType> + ( + solverName_, + fieldName_, + cmptMax(initialResidual_), + cmptMax(finalResidual_), + nIterations_, + converged_, + singular_ + ); +} + + template bool Foam::BlockSolverPerformance::operator!= ( @@ -131,6 +161,26 @@ bool Foam::BlockSolverPerformance::operator!= } +template +typename Foam::BlockSolverPerformance Foam::max +( + const typename Foam::BlockSolverPerformance& bsp1, + const typename Foam::BlockSolverPerformance& bsp2 +) +{ + return BlockSolverPerformance + ( + bsp1.solverName(), + bsp1.fieldName(), + max(bsp1.initialResidual(), bsp2.initialResidual()), + max(bsp1.finalResidual(), bsp2.finalResidual()), + max(bsp1.nIterations(), bsp2.nIterations()), + bsp1.converged() && bsp2.converged(), + bsp1.singular() || bsp2.singular() + ); +} + + template Foam::Istream& Foam::operator>> ( diff --git a/src/foam/matrices/blockLduMatrix/BlockLduSolvers/BlockLduSolver/BlockSolverPerformance.H b/src/foam/matrices/blockLduMatrix/BlockLduSolvers/BlockLduSolver/BlockSolverPerformance.H index 9ee67da3d..331f0c873 100644 --- a/src/foam/matrices/blockLduMatrix/BlockLduSolvers/BlockLduSolver/BlockSolverPerformance.H +++ b/src/foam/matrices/blockLduMatrix/BlockLduSolvers/BlockLduSolver/BlockSolverPerformance.H @@ -50,6 +50,13 @@ namespace Foam template class BlockSolverPerformance; +template +BlockSolverPerformance max +( + const BlockSolverPerformance&, + const BlockSolverPerformance& +); + template Istream& operator>>(Istream&, BlockSolverPerformance&); @@ -217,6 +224,17 @@ public: //- Print summary of solver performance void print() const; + //- Replace component based on the minimal BlockSolverPerformance + void replace + ( + const label cmpt, + const BlockSolverPerformance::cmptType>& sp + ); + + //- Return the summary maximum of BlockSolverPerformance + // Effectively it will mostly return BlockSolverPerformance + BlockSolverPerformance::cmptType> max(); + // Member Operators @@ -225,6 +243,16 @@ public: // Friend functions + //- Return the element-wise max of two BlockSolverPerformances + friend BlockSolverPerformance Foam::max + ( + const BlockSolverPerformance&, + const BlockSolverPerformance& + ); + + + // Ostream operator + friend Istream& operator>> ( Istream&, diff --git a/src/foam/matrices/blockLduMatrix/BlockLduSolvers/BlockLduSolver/BlockSolverPerformances.C b/src/foam/matrices/blockLduMatrix/BlockLduSolvers/BlockLduSolver/BlockSolverPerformances.C index 73049b778..633e797c2 100644 --- a/src/foam/matrices/blockLduMatrix/BlockLduSolvers/BlockLduSolver/BlockSolverPerformances.C +++ b/src/foam/matrices/blockLduMatrix/BlockLduSolvers/BlockLduSolver/BlockSolverPerformances.C @@ -31,22 +31,27 @@ Author #include "BlockSolverPerformances.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - defineNamedTemplateTypeNameAndDebug(BlockSolverPerformanceScalar, 1); defineNamedTemplateTypeNameAndDebug(BlockSolverPerformanceVector, 1); defineNamedTemplateTypeNameAndDebug(BlockSolverPerformanceSphericalTensor, 1); defineNamedTemplateTypeNameAndDebug(BlockSolverPerformanceSymmTensor, 1); defineNamedTemplateTypeNameAndDebug(BlockSolverPerformanceTensor, 1); +}; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace Foam +template<> +Foam::BlockSolverPerformance +Foam::BlockSolverPerformance::max() +{ + return *this; +} + // ************************************************************************* // diff --git a/src/foam/matrices/solution/solution.C b/src/foam/matrices/solution/solution.C index 7721094c9..100d0713a 100644 --- a/src/foam/matrices/solution/solution.C +++ b/src/foam/matrices/solution/solution.C @@ -422,49 +422,4 @@ Foam::dictionary& Foam::solution::solverPerformanceDict() const return solverPerformance_; } - -void Foam::solution::setSolverPerformance -( - const word& name, - const lduSolverPerformance& sp -) const -{ - List perfs; - - if (prevTimeIndex_ != this->time().timeIndex()) - { - // Reset solver performance between iterations - prevTimeIndex_ = this->time().timeIndex(); - solverPerformance_.clear(); - } - else - { - solverPerformance_.readIfPresent(name, perfs); - } - - // Only the first iteration and the current iteration residuals are - // required, so the current iteration residual replaces the previous one and - // only the first iteration is always present, VS 2017-11-27 - if (perfs.size() < 2) - { - // Append to list - perfs.setSize(perfs.size() + 1, sp); - } - else - { - perfs.last() = sp; - } - - solverPerformance_.set(name, perfs); -} - - -void Foam::solution::setSolverPerformance -( - const lduSolverPerformance& sp -) const -{ - setSolverPerformance(sp.fieldName(), sp); -} - // ************************************************************************* // diff --git a/src/foam/matrices/solution/solution.H b/src/foam/matrices/solution/solution.H index bf4206213..8461d3c07 100644 --- a/src/foam/matrices/solution/solution.H +++ b/src/foam/matrices/solution/solution.H @@ -37,7 +37,8 @@ SourceFiles #include "IOdictionary.H" #include "debugSwitch.H" -#include "lduSolverPerformance.H" +#include "foamTime.H" +#include "BlockSolverPerformance.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -156,17 +157,19 @@ public: // checking dictionary& solverPerformanceDict() const; - //- Add/set the solverPerformance entry for the named field + //- Add/set the BlockSolverPerformance entry for the named field + template void setSolverPerformance ( const word& name, - const lduSolverPerformance& + const BlockSolverPerformance& ) const; - //- Add/set the solverPerformance entry, using its fieldName + //- Add/set the BlockSolverPerformance entry, using its fieldName + template void setSolverPerformance ( - const lduSolverPerformance& + const BlockSolverPerformance& ) const; diff --git a/src/foam/matrices/solution/solutionTemplates.C b/src/foam/matrices/solution/solutionTemplates.C index 67cdd879f..6f85c4166 100644 --- a/src/foam/matrices/solution/solutionTemplates.C +++ b/src/foam/matrices/solution/solutionTemplates.C @@ -45,6 +45,43 @@ void Foam::solution::cachePrintMessage } +template +void Foam::solution::setSolverPerformance +( + const word& name, + const BlockSolverPerformance& sp +) const +{ + List > perfs; + + if (prevTimeIndex_ != this->time().timeIndex()) + { + // Reset solver performance between iterations + prevTimeIndex_ = this->time().timeIndex(); + solverPerformance_.clear(); + } + else + { + solverPerformance_.readIfPresent(name, perfs); + } + + // Append to list + perfs.setSize(perfs.size() + 1, sp); + + solverPerformance_.set(name, perfs); +} + + +template +void Foam::solution::setSolverPerformance +( + const BlockSolverPerformance& sp +) const +{ + setSolverPerformance(sp.fieldName(), sp); +} + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/tetFiniteElement/tetFemMatrix/tetFemMatrixSolve.C b/src/tetFiniteElement/tetFemMatrix/tetFemMatrixSolve.C index f136f758f..6a8ae9d8e 100644 --- a/src/tetFiniteElement/tetFemMatrix/tetFemMatrixSolve.C +++ b/src/tetFiniteElement/tetFemMatrix/tetFemMatrixSolve.C @@ -52,7 +52,7 @@ lduSolverPerformance tetFemMatrix::solve this->check(); } - lduSolverPerformance solverPerfVec + BlockSolverPerformance solverPerfVec ( "tetFemMatrix::solve", psi_.name() @@ -152,14 +152,7 @@ lduSolverPerformance tetFemMatrix::solve solverPerf.print(); - if - ( - solverPerf.initialResidual() > solverPerfVec.initialResidual() - && !solverPerf.singular() - ) - { - solverPerfVec = solverPerf; - } + solverPerfVec.replace(cmpt, solverPerf); psi.internalField().replace(cmpt, psiCmpt); @@ -174,7 +167,9 @@ lduSolverPerformance tetFemMatrix::solve psi.correctBoundaryConditions(); - return solverPerfVec; + psi_.mesh().solutionDict().setSolverPerformance(psi_.name(), solverPerfVec); + + return solverPerfVec.max(); } diff --git a/src/tetFiniteElement/tetFemMatrix/tetFemScalarMatrix.C b/src/tetFiniteElement/tetFemMatrix/tetFemScalarMatrix.C index 0199325bf..9fdcd40ad 100644 --- a/src/tetFiniteElement/tetFemMatrix/tetFemScalarMatrix.C +++ b/src/tetFiniteElement/tetFemMatrix/tetFemScalarMatrix.C @@ -131,6 +131,8 @@ lduSolverPerformance tetFemMatrix::solve psi.correctBoundaryConditions(); + psi_.mesh().solutionDict().setSolverPerformance(psi_.name(), solverPerf); + return solverPerf; } From f58e0ebf498aefc12aa5061550195b53c4750857 Mon Sep 17 00:00:00 2001 From: Vanja Skuric Date: Sun, 11 Feb 2018 19:00:28 +0100 Subject: [PATCH 2/6] New feature: Added switch which enables storing only first and last iteration residuals in solvePerformance --- src/foam/matrices/solution/solution.C | 12 +++++++++++- src/foam/matrices/solution/solution.H | 4 ++++ src/foam/matrices/solution/solutionTemplates.C | 16 ++++++++++++++-- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/src/foam/matrices/solution/solution.C b/src/foam/matrices/solution/solution.C index 100d0713a..f8d0fa2ac 100644 --- a/src/foam/matrices/solution/solution.C +++ b/src/foam/matrices/solution/solution.C @@ -127,6 +127,15 @@ void Foam::solution::read(const dictionary& dict) { solverPerformance_ = dict.subDict("solverPerformance"); } + + if (dict.found("residuals")) + { + storeAllResiduals_ = + dict.subDict("residuals").lookupOrDefault + ( + "storeAllResiduals", false + ); + } } @@ -153,7 +162,8 @@ Foam::solution::solution(const objectRegistry& obr, const fileName& dictName) eqnRelaxDefault_(0), solvers_(dictionary::null), solverPerformance_(dictionary::null), - prevTimeIndex_(0) + prevTimeIndex_(0), + storeAllResiduals_(false) { if (!headerOk()) { diff --git a/src/foam/matrices/solution/solution.H b/src/foam/matrices/solution/solution.H index 8461d3c07..d1c3aab04 100644 --- a/src/foam/matrices/solution/solution.H +++ b/src/foam/matrices/solution/solution.H @@ -82,6 +82,10 @@ class solution //- Previously used time-index, used for reset between iterations mutable label prevTimeIndex_; + //- Switch for storing residuals of every iteration inside a single + // timestep + bool storeAllResiduals_; + // Private Member Functions diff --git a/src/foam/matrices/solution/solutionTemplates.C b/src/foam/matrices/solution/solutionTemplates.C index 6f85c4166..1287cfb18 100644 --- a/src/foam/matrices/solution/solutionTemplates.C +++ b/src/foam/matrices/solution/solutionTemplates.C @@ -65,8 +65,20 @@ void Foam::solution::setSolverPerformance solverPerformance_.readIfPresent(name, perfs); } - // Append to list - perfs.setSize(perfs.size() + 1, sp); + // 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 (storeAllResiudals_ || perfs.size() < 2) + { + // Append to list + perfs.setSize(perfs.size() + 1, sp); + } + else + { + perfs.last() = sp; + } solverPerformance_.set(name, perfs); } From 2df03ebe250741b9c865ab3ecd0db76a4564d282 Mon Sep 17 00:00:00 2001 From: Vanja Skuric Date: Sun, 11 Feb 2018 19:01:44 +0100 Subject: [PATCH 3/6] New feature: Added solutionFaControl (with simple, pimple and piso controls) and VectorN to finiteArea --- src/finiteArea/Make/files | 29 +++++ .../fields/areaFields/areaVectorNFields.C | 55 +++++++++ .../fields/areaFields/areaVectorNFields.H | 46 ++++++++ .../fields/areaFields/areaVectorNFieldsFwd.H | 77 +++++++++++++ .../fields/edgeFields/edgeVectorNFields.C | 55 +++++++++ .../fields/edgeFields/edgeVectorNFields.H | 46 ++++++++ .../fields/edgeFields/edgeVectorNFieldsFwd.H | 77 +++++++++++++ .../calculatedFaPatchVectorNFields.C | 60 ++++++++++ .../calculatedFaPatchVectorNFields.H | 37 ++++++ .../calculatedFaPatchVectorNFieldsFwd.H | 61 ++++++++++ .../coupled/coupledFaPatchVectorNFields.C | 54 +++++++++ .../coupled/coupledFaPatchVectorNFields.H | 38 ++++++ .../coupled/coupledFaPatchVectorNFieldsFwd.H | 61 ++++++++++ .../fixedGradientFaPatchVectorNFields.C | 59 ++++++++++ .../fixedGradientFaPatchVectorNFields.H | 39 +++++++ .../fixedGradientFaPatchVectorNFieldsFwd.H | 61 ++++++++++ .../fixedValueFaPatchVectorNFields.C | 59 ++++++++++ .../fixedValueFaPatchVectorNFields.H | 39 +++++++ .../fixedValueFaPatchVectorNFieldsFwd.H | 61 ++++++++++ .../transform/transformFaPatchVectorNFields.C | 53 +++++++++ .../transform/transformFaPatchVectorNFields.H | 40 +++++++ .../transformFaPatchVectorNFieldsFwd.H | 57 +++++++++ .../zeroGradientFaPatchVectorNFields.C | 59 ++++++++++ .../zeroGradientFaPatchVectorNFields.H | 39 +++++++ .../zeroGradientFaPatchVectorNFieldsFwd.H | 61 ++++++++++ .../constraint/cyclic/cyclicFaPatchField.H | 53 ++++++++- .../cyclic/cyclicFaPatchVectorNFields.C | 109 ++++++++++++++++++ .../cyclic/cyclicFaPatchVectorNFields.H | 39 +++++++ .../cyclic/cyclicFaPatchVectorNFieldsFwd.H | 55 +++++++++ .../empty/emptyFaPatchVectorNFields.C | 59 ++++++++++ .../empty/emptyFaPatchVectorNFields.H | 39 +++++++ .../empty/emptyFaPatchVectorNFieldsFwd.H | 61 ++++++++++ .../processor/processorFaPatchField.C | 2 +- .../processor/processorFaPatchField.H | 2 +- .../processor/processorFaPatchVectorNFields.C | 52 +++++++++ .../processor/processorFaPatchVectorNFields.H | 39 +++++++ .../processorFaPatchVectorNFieldsFwd.H | 55 +++++++++ .../constraint/wedge/wedgeFaPatchFieldsFwd.H | 4 +- .../wedge/wedgeFaPatchVectorNFields.C | 99 ++++++++++++++++ .../wedge/wedgeFaPatchVectorNFields.H | 74 ++++++++++++ .../wedge/wedgeFaPatchVectorNFieldsFwd.H | 61 ++++++++++ .../faPatchField/faPatchVectorNFields.C | 68 +++++++++++ .../faPatchField/faPatchVectorNFields.H | 37 ++++++ .../faPatchField/faPatchVectorNFieldsFwd.H | 61 ++++++++++ .../calculatedFaePatchVectorNFields.C | 54 +++++++++ .../calculatedFaePatchVectorNFields.H | 37 ++++++ .../calculatedFaePatchVectorNFieldsFwd.H | 67 +++++++++++ .../coupledFaePatchVectorNFields.C | 54 +++++++++ .../coupledFaePatchVectorNFields.H | 37 ++++++ .../coupledFaePatchVectorNFieldsFwd.H | 66 +++++++++++ .../emptyFaePatchVectorNFields.C | 54 +++++++++ .../emptyFaePatchVectorNFields.H | 37 ++++++ .../emptyFaePatchVectorNFieldsFwd.H | 61 ++++++++++ .../faePatchVectorNFields.C | 67 +++++++++++ .../faePatchVectorNFields.H | 37 ++++++ .../faePatchVectorNFieldsFwd.H | 72 ++++++++++++ .../processorFaePatchVectorNFields.C | 48 ++++++++ .../processorFaePatchVectorNFields.H | 37 ++++++ .../processorFaePatchVectorNFieldsFwd.H | 60 ++++++++++ .../wedgeFaePatchVectorNFields.C | 54 +++++++++ .../wedgeFaePatchVectorNFields.H | 37 ++++++ .../wedgeFaePatchVectorNFieldsFwd.H | 61 ++++++++++ 62 files changed, 3227 insertions(+), 5 deletions(-) create mode 100644 src/finiteArea/fields/areaFields/areaVectorNFields.C create mode 100644 src/finiteArea/fields/areaFields/areaVectorNFields.H create mode 100644 src/finiteArea/fields/areaFields/areaVectorNFieldsFwd.H create mode 100644 src/finiteArea/fields/edgeFields/edgeVectorNFields.C create mode 100644 src/finiteArea/fields/edgeFields/edgeVectorNFields.H create mode 100644 src/finiteArea/fields/edgeFields/edgeVectorNFieldsFwd.H create mode 100644 src/finiteArea/fields/faPatchFields/basic/calculated/calculatedFaPatchVectorNFields.C create mode 100644 src/finiteArea/fields/faPatchFields/basic/calculated/calculatedFaPatchVectorNFields.H create mode 100644 src/finiteArea/fields/faPatchFields/basic/calculated/calculatedFaPatchVectorNFieldsFwd.H create mode 100644 src/finiteArea/fields/faPatchFields/basic/coupled/coupledFaPatchVectorNFields.C create mode 100644 src/finiteArea/fields/faPatchFields/basic/coupled/coupledFaPatchVectorNFields.H create mode 100644 src/finiteArea/fields/faPatchFields/basic/coupled/coupledFaPatchVectorNFieldsFwd.H create mode 100644 src/finiteArea/fields/faPatchFields/basic/fixedGradient/fixedGradientFaPatchVectorNFields.C create mode 100644 src/finiteArea/fields/faPatchFields/basic/fixedGradient/fixedGradientFaPatchVectorNFields.H create mode 100644 src/finiteArea/fields/faPatchFields/basic/fixedGradient/fixedGradientFaPatchVectorNFieldsFwd.H create mode 100644 src/finiteArea/fields/faPatchFields/basic/fixedValue/fixedValueFaPatchVectorNFields.C create mode 100644 src/finiteArea/fields/faPatchFields/basic/fixedValue/fixedValueFaPatchVectorNFields.H create mode 100644 src/finiteArea/fields/faPatchFields/basic/fixedValue/fixedValueFaPatchVectorNFieldsFwd.H create mode 100644 src/finiteArea/fields/faPatchFields/basic/transform/transformFaPatchVectorNFields.C create mode 100644 src/finiteArea/fields/faPatchFields/basic/transform/transformFaPatchVectorNFields.H create mode 100644 src/finiteArea/fields/faPatchFields/basic/transform/transformFaPatchVectorNFieldsFwd.H create mode 100644 src/finiteArea/fields/faPatchFields/basic/zeroGradient/zeroGradientFaPatchVectorNFields.C create mode 100644 src/finiteArea/fields/faPatchFields/basic/zeroGradient/zeroGradientFaPatchVectorNFields.H create mode 100644 src/finiteArea/fields/faPatchFields/basic/zeroGradient/zeroGradientFaPatchVectorNFieldsFwd.H create mode 100644 src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchVectorNFields.C create mode 100644 src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchVectorNFields.H create mode 100644 src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchVectorNFieldsFwd.H create mode 100644 src/finiteArea/fields/faPatchFields/constraint/empty/emptyFaPatchVectorNFields.C create mode 100644 src/finiteArea/fields/faPatchFields/constraint/empty/emptyFaPatchVectorNFields.H create mode 100644 src/finiteArea/fields/faPatchFields/constraint/empty/emptyFaPatchVectorNFieldsFwd.H create mode 100644 src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchVectorNFields.C create mode 100644 src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchVectorNFields.H create mode 100644 src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchVectorNFieldsFwd.H create mode 100644 src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchVectorNFields.C create mode 100644 src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchVectorNFields.H create mode 100644 src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchVectorNFieldsFwd.H create mode 100644 src/finiteArea/fields/faPatchFields/faPatchField/faPatchVectorNFields.C create mode 100644 src/finiteArea/fields/faPatchFields/faPatchField/faPatchVectorNFields.H create mode 100644 src/finiteArea/fields/faPatchFields/faPatchField/faPatchVectorNFieldsFwd.H create mode 100644 src/finiteArea/fields/faePatchFields/faePatchVectorNFields/calculatedFaePatchVectorNFields.C create mode 100644 src/finiteArea/fields/faePatchFields/faePatchVectorNFields/calculatedFaePatchVectorNFields.H create mode 100644 src/finiteArea/fields/faePatchFields/faePatchVectorNFields/calculatedFaePatchVectorNFieldsFwd.H create mode 100644 src/finiteArea/fields/faePatchFields/faePatchVectorNFields/coupledFaePatchVectorNFields.C create mode 100644 src/finiteArea/fields/faePatchFields/faePatchVectorNFields/coupledFaePatchVectorNFields.H create mode 100644 src/finiteArea/fields/faePatchFields/faePatchVectorNFields/coupledFaePatchVectorNFieldsFwd.H create mode 100644 src/finiteArea/fields/faePatchFields/faePatchVectorNFields/emptyFaePatchVectorNFields.C create mode 100644 src/finiteArea/fields/faePatchFields/faePatchVectorNFields/emptyFaePatchVectorNFields.H create mode 100644 src/finiteArea/fields/faePatchFields/faePatchVectorNFields/emptyFaePatchVectorNFieldsFwd.H create mode 100644 src/finiteArea/fields/faePatchFields/faePatchVectorNFields/faePatchVectorNFields.C create mode 100644 src/finiteArea/fields/faePatchFields/faePatchVectorNFields/faePatchVectorNFields.H create mode 100644 src/finiteArea/fields/faePatchFields/faePatchVectorNFields/faePatchVectorNFieldsFwd.H create mode 100644 src/finiteArea/fields/faePatchFields/faePatchVectorNFields/processorFaePatchVectorNFields.C create mode 100644 src/finiteArea/fields/faePatchFields/faePatchVectorNFields/processorFaePatchVectorNFields.H create mode 100644 src/finiteArea/fields/faePatchFields/faePatchVectorNFields/processorFaePatchVectorNFieldsFwd.H create mode 100644 src/finiteArea/fields/faePatchFields/faePatchVectorNFields/wedgeFaePatchVectorNFields.C create mode 100644 src/finiteArea/fields/faePatchFields/faePatchVectorNFields/wedgeFaePatchVectorNFields.H create mode 100644 src/finiteArea/fields/faePatchFields/faePatchVectorNFields/wedgeFaePatchVectorNFieldsFwd.H diff --git a/src/finiteArea/Make/files b/src/finiteArea/Make/files index 9e8ffce86..65abb8311 100644 --- a/src/finiteArea/Make/files +++ b/src/finiteArea/Make/files @@ -22,26 +22,37 @@ $(faMeshMapper)/faPatchMapper.C faPatchFields = fields/faPatchFields $(faPatchFields)/faPatchField/faPatchFields.C +$(faPatchFields)/faPatchField/faPatchVectorNFields.C basicFaPatchFields = $(faPatchFields)/basic $(basicFaPatchFields)/basicSymmetry/basicSymmetryFaPatchFields.C $(basicFaPatchFields)/basicSymmetry/basicSymmetryFaPatchScalarField.C $(basicFaPatchFields)/calculated/calculatedFaPatchFields.C +$(basicFaPatchFields)/calculated/calculatedFaPatchVectorNFields.C $(basicFaPatchFields)/coupled/coupledFaPatchFields.C +$(basicFaPatchFields)/coupled/coupledFaPatchVectorNFields.C $(basicFaPatchFields)/zeroGradient/zeroGradientFaPatchFields.C +$(basicFaPatchFields)/zeroGradient/zeroGradientFaPatchVectorNFields.C $(basicFaPatchFields)/fixedValue/fixedValueFaPatchFields.C +$(basicFaPatchFields)/fixedValue/fixedValueFaPatchVectorNFields.C $(basicFaPatchFields)/fixedGradient/fixedGradientFaPatchFields.C +$(basicFaPatchFields)/fixedGradient/fixedGradientFaPatchVectorNFields.C $(basicFaPatchFields)/mixed/mixedFaPatchFields.C $(basicFaPatchFields)/transform/transformFaPatchFields.C $(basicFaPatchFields)/transform/transformFaPatchScalarField.C +$(basicFaPatchFields)/transform/transformFaPatchVectorNFields.C constraintFaPatchFields = $(faPatchFields)/constraint $(constraintFaPatchFields)/empty/emptyFaPatchFields.C +$(constraintFaPatchFields)/empty/emptyFaPatchVectorNFields.C $(constraintFaPatchFields)/processor/processorFaPatchFields.C $(constraintFaPatchFields)/processor/processorFaPatchScalarField.C +$(constraintFaPatchFields)/processor/processorFaPatchVectorNFields.C $(constraintFaPatchFields)/wedge/wedgeFaPatchFields.C $(constraintFaPatchFields)/wedge/wedgeFaPatchScalarField.C +$(constraintFaPatchFields)/wedge/wedgeFaPatchVectorNFields.C $(constraintFaPatchFields)/cyclic/cyclicFaPatchFields.C +$(constraintFaPatchFields)/cyclic/cyclicFaPatchVectorNFields.C $(constraintFaPatchFields)/symmetry/symmetryFaPatchFields.C derivedFaPatchFields = $(faPatchFields)/derived @@ -66,8 +77,18 @@ $(constraintFaePatchFields)/wedge/wedgeFaePatchFields.C $(constraintFaePatchFields)/cyclic/cyclicFaePatchFields.C $(constraintFaePatchFields)/symmetry/symmetryFaePatchFields.C +faePatchVectorNFields = $(faePatchFields)/faePatchVectorNFields +$(faePatchVectorNFields)/faePatchVectorNFields.C +$(faePatchVectorNFields)/calculatedFaePatchVectorNFields.C +$(faePatchVectorNFields)/emptyFaePatchVectorNFields.C +$(faePatchVectorNFields)/wedgeFaePatchVectorNFields.C +$(faePatchVectorNFields)/coupledFaePatchVectorNFields.C +$(faePatchVectorNFields)/processorFaePatchVectorNFields.C + fields/areaFields/areaFields.C +fields/areaFields/areaVectorNFields.C fields/edgeFields/edgeFields.C +fields/edgeFields/edgeVectorNFields.C faMatrices/faMatrices.C faMatrices/faScalarMatrix/faScalarMatrix.C @@ -122,4 +143,12 @@ convectionSchemes = finiteArea/convectionSchemes $(convectionSchemes)/faConvectionScheme/faConvectionSchemes.C $(convectionSchemes)/gaussFaConvectionScheme/gaussFaConvectionSchemes.C +general = cfdTools/general + +solutionFaControl = $(general)/solutionFaControl +$(solutionFaControl)/solutionFaControl/solutionFaControl.C +$(solutionFaControl)/simpleFaControl/simpleFaControl.C +$(solutionFaControl)/pimpleFaControl/pimpleFaControl.C +$(solutionFaControl)/pisoFaControl/pisoFaControl.C + LIB = $(FOAM_LIBBIN)/libfiniteArea diff --git a/src/finiteArea/fields/areaFields/areaVectorNFields.C b/src/finiteArea/fields/areaFields/areaVectorNFields.C new file mode 100644 index 000000000..e157f56c8 --- /dev/null +++ b/src/finiteArea/fields/areaFields/areaVectorNFields.C @@ -0,0 +1,55 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "areaVectorNFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +#define doMakeAreaFields(type, Type, args...) \ + defineTemplateTypeNameAndDebug( \ + area##Type##Field::DimensionedInternalField, 0); \ + \ + defineTemplateTypeNameAndDebug(area##Type##Field, 0); + +forAllVectorNTypes(doMakeAreaFields) + +forAllTensorNTypes(doMakeAreaFields) + +forAllDiagTensorNTypes(doMakeAreaFields) + +forAllSphericalTensorNTypes(doMakeAreaFields) + +#undef doMakeAreaFields + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteArea/fields/areaFields/areaVectorNFields.H b/src/finiteArea/fields/areaFields/areaVectorNFields.H new file mode 100644 index 000000000..db79bb70d --- /dev/null +++ b/src/finiteArea/fields/areaFields/areaVectorNFields.H @@ -0,0 +1,46 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +Class + areaVectorNFields + +Description + +SourceFiles + areaVectorNFields.C + +\*---------------------------------------------------------------------------*/ + +#ifndef areaVectorNFields_H +#define areaVectorNFields_H + +#include "areaFields.H" +#include "areaVectorNFieldsFwd.H" +#include "GeometricVectorNFields.H" +#include "GeometricTensorNFields.H" +#include "GeometricDiagTensorNFields.H" +#include "GeometricSphericalTensorNFields.H" + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/areaFields/areaVectorNFieldsFwd.H b/src/finiteArea/fields/areaFields/areaVectorNFieldsFwd.H new file mode 100644 index 000000000..9edc6eaa0 --- /dev/null +++ b/src/finiteArea/fields/areaFields/areaVectorNFieldsFwd.H @@ -0,0 +1,77 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +Class + areaVectorNFields + +Description + +SourceFiles + areaVectorNFields.C + +\*---------------------------------------------------------------------------*/ + +#ifndef areaVectorNFieldsFwd_H +#define areaVectorNFieldsFwd_H + +#include "areaFieldsFwd.H" + +#include "VectorNFieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +class areaMesh; + +template +class faPatchField; + +template class PatchField, class GeoMesh> +class GeometricField; + +#define doMakeTypedefs(type, Type, args...) \ + typedef GeometricField area##Type##Field; + +forAllVectorNTypes(doMakeTypedefs) + +forAllTensorNTypes(doMakeTypedefs) + +forAllDiagTensorNTypes(doMakeTypedefs) + +forAllSphericalTensorNTypes(doMakeTypedefs) + +#undef doMakeTypedefs + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/edgeFields/edgeVectorNFields.C b/src/finiteArea/fields/edgeFields/edgeVectorNFields.C new file mode 100644 index 000000000..7bd54b157 --- /dev/null +++ b/src/finiteArea/fields/edgeFields/edgeVectorNFields.C @@ -0,0 +1,55 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "edgeVectorNFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +#define doMakeEdgeFields(type, Type, args...) \ + defineTemplateTypeNameAndDebug( \ + edge##Type##Field::DimensionedInternalField, 0); \ + \ + defineTemplateTypeNameAndDebug(edge##Type##Field, 0); + +forAllVectorNTypes(doMakeEdgeFields) + +forAllTensorNTypes(doMakeEdgeFields) + +forAllDiagTensorNTypes(doMakeEdgeFields) + +forAllSphericalTensorNTypes(doMakeEdgeFields) + +#undef doMakeEdgeFields + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteArea/fields/edgeFields/edgeVectorNFields.H b/src/finiteArea/fields/edgeFields/edgeVectorNFields.H new file mode 100644 index 000000000..521deb0bf --- /dev/null +++ b/src/finiteArea/fields/edgeFields/edgeVectorNFields.H @@ -0,0 +1,46 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +Class + edgeVectorNFields + +Description + +SourceFiles + edgeVectorNFields.C + +\*---------------------------------------------------------------------------*/ + +#ifndef edgeVectorNFields_H +#define edgeVectorNFields_H + +#include "edgeFields.H" +#include "edgeVectorNFieldsFwd.H" +#include "GeometricVectorNFields.H" +#include "GeometricTensorNFields.H" +#include "GeometricDiagTensorNFields.H" +#include "GeometricSphericalTensorNFields.H" + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/edgeFields/edgeVectorNFieldsFwd.H b/src/finiteArea/fields/edgeFields/edgeVectorNFieldsFwd.H new file mode 100644 index 000000000..77259233e --- /dev/null +++ b/src/finiteArea/fields/edgeFields/edgeVectorNFieldsFwd.H @@ -0,0 +1,77 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +Class + edgeVectorNFields + +Description + +SourceFiles + edgeVectorNFields.C + +\*---------------------------------------------------------------------------*/ + +#ifndef edgeVectorNFieldsFwd_H +#define edgeVectorNFieldsFwd_H + +#include "edgeFieldsFwd.H" + +#include "VectorNFieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +class edgeMesh; + +template +class faePatchField; + +template class PatchField, class GeoMesh> +class GeometricField; + +#define doMakeTypedefs(type, Type, args...) \ + typedef GeometricField edge##Type##Field; + +forAllVectorNTypes(doMakeTypedefs) + +forAllTensorNTypes(doMakeTypedefs) + +forAllDiagTensorNTypes(doMakeTypedefs) + +forAllSphericalTensorNTypes(doMakeTypedefs) + +#undef doMakeTypedefs + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/basic/calculated/calculatedFaPatchVectorNFields.C b/src/finiteArea/fields/faPatchFields/basic/calculated/calculatedFaPatchVectorNFields.C new file mode 100644 index 000000000..4b804b3e7 --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/basic/calculated/calculatedFaPatchVectorNFields.C @@ -0,0 +1,60 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "calculatedFaPatchVectorNFields.H" +#include "faPatchVectorNFields.H" +#include "areaMesh.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +#define doMakePatchTypeField(type, Type, args...) \ + \ +makeTemplateFaPatchTypeField \ +( \ + faPatch##Type##Field, \ + calculatedFaPatch##Type##Field \ +); + +forAllVectorNTypes(doMakePatchTypeField) + +forAllTensorNTypes(doMakePatchTypeField) + +forAllDiagTensorNTypes(doMakePatchTypeField) + +forAllSphericalTensorNTypes(doMakePatchTypeField) + +#undef doMakePatchTypeField + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/basic/calculated/calculatedFaPatchVectorNFields.H b/src/finiteArea/fields/faPatchFields/basic/calculated/calculatedFaPatchVectorNFields.H new file mode 100644 index 000000000..27b94e7c1 --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/basic/calculated/calculatedFaPatchVectorNFields.H @@ -0,0 +1,37 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef calculatedFaPatchVectorNFields_H +#define calculatedFaPatchVectorNFields_H + +#include "areaVectorNFields.H" +#include "faPatchVectorNFields.H" + +#include "calculatedFaPatchVectorNFieldsFwd.H" +#include "calculatedFaPatchField.H" + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/basic/calculated/calculatedFaPatchVectorNFieldsFwd.H b/src/finiteArea/fields/faPatchFields/basic/calculated/calculatedFaPatchVectorNFieldsFwd.H new file mode 100644 index 000000000..fe48029b8 --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/basic/calculated/calculatedFaPatchVectorNFieldsFwd.H @@ -0,0 +1,61 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef calculatedFaPatchVectorNFieldsFwd_H +#define calculatedFaPatchVectorNFieldsFwd_H + +#include "VectorNFieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template class calculatedFaPatchField; + +#define makeTypedef(type, Type, args...) \ + typedef calculatedFaPatchField calculatedFaPatch##Type##Field; + +forAllVectorNTypes(makeTypedef) + +forAllTensorNTypes(makeTypedef) + +forAllDiagTensorNTypes(makeTypedef) + +forAllSphericalTensorNTypes(makeTypedef) + +#undef makeTypedef + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/basic/coupled/coupledFaPatchVectorNFields.C b/src/finiteArea/fields/faPatchFields/basic/coupled/coupledFaPatchVectorNFields.C new file mode 100644 index 000000000..9f6d6fa76 --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/basic/coupled/coupledFaPatchVectorNFields.C @@ -0,0 +1,54 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "coupledFaPatchVectorNFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +#define doMakePatchTypeField(type, Type, args...) \ + makeFaPatchTypeFieldTypeName(coupledFaPatch##Type##Field); + +forAllVectorNTypes(doMakePatchTypeField) + +forAllTensorNTypes(doMakePatchTypeField) + +forAllDiagTensorNTypes(doMakePatchTypeField) + +forAllSphericalTensorNTypes(doMakePatchTypeField) + + +#undef doMakePatchTypeField + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/basic/coupled/coupledFaPatchVectorNFields.H b/src/finiteArea/fields/faPatchFields/basic/coupled/coupledFaPatchVectorNFields.H new file mode 100644 index 000000000..f9153024c --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/basic/coupled/coupledFaPatchVectorNFields.H @@ -0,0 +1,38 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef coupledFaPatchVectorNFields_H +#define coupledFaPatchVectorNFields_H + +#include "areaVectorNFields.H" +#include "faPatchVectorNFields.H" + +#include "coupledFaPatchVectorNFieldsFwd.H" +#include "coupledFaPatchField.H" + + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/basic/coupled/coupledFaPatchVectorNFieldsFwd.H b/src/finiteArea/fields/faPatchFields/basic/coupled/coupledFaPatchVectorNFieldsFwd.H new file mode 100644 index 000000000..e79ed7f71 --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/basic/coupled/coupledFaPatchVectorNFieldsFwd.H @@ -0,0 +1,61 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef coupledFaPatchFieldsFwd_H +#define coupledFaPatchFieldsFwd_H + +#include "VectorNFieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template class coupledFaPatchField; + +#define makeTypedef(type, Type, args...) \ + typedef coupledFaPatchField coupledFaPatch##Type##Field; + +forAllVectorNTypes(makeTypedef) + +forAllTensorNTypes(makeTypedef) + +forAllDiagTensorNTypes(makeTypedef) + +forAllSphericalTensorNTypes(makeTypedef) + +#undef makeTypedef + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/basic/fixedGradient/fixedGradientFaPatchVectorNFields.C b/src/finiteArea/fields/faPatchFields/basic/fixedGradient/fixedGradientFaPatchVectorNFields.C new file mode 100644 index 000000000..6f90224ec --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/basic/fixedGradient/fixedGradientFaPatchVectorNFields.C @@ -0,0 +1,59 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "fixedGradientFaPatchVectorNFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +#define doMakePatchTypeField(type, Type, args...) \ + \ +makeTemplateFaPatchTypeField \ +( \ + faPatch##Type##Field, \ + fixedGradientFaPatch##Type##Field \ +); + +forAllVectorNTypes(doMakePatchTypeField) + +forAllTensorNTypes(doMakePatchTypeField) + +forAllDiagTensorNTypes(doMakePatchTypeField) + +forAllSphericalTensorNTypes(doMakePatchTypeField) + + +#undef doMakePatchTypeField + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/basic/fixedGradient/fixedGradientFaPatchVectorNFields.H b/src/finiteArea/fields/faPatchFields/basic/fixedGradient/fixedGradientFaPatchVectorNFields.H new file mode 100644 index 000000000..dbea67e95 --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/basic/fixedGradient/fixedGradientFaPatchVectorNFields.H @@ -0,0 +1,39 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef fixedGradientFaPatchVectorNFields_H +#define fixedGradientFaPatchVectorNFields_H + +#include "areaVectorNFields.H" +#include "faPatchVectorNFields.H" + +#include "fixedGradientFaPatchVectorNFieldsFwd.H" +#include "fixedGradientFaPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/basic/fixedGradient/fixedGradientFaPatchVectorNFieldsFwd.H b/src/finiteArea/fields/faPatchFields/basic/fixedGradient/fixedGradientFaPatchVectorNFieldsFwd.H new file mode 100644 index 000000000..de636c3ba --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/basic/fixedGradient/fixedGradientFaPatchVectorNFieldsFwd.H @@ -0,0 +1,61 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef fixedGradientFaPatchVectorNFieldsFwd_H +#define fixedGradientFaPatchVectorNFieldsFwd_H + +#include "VectorNFieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template class fixedGradientFaPatchField; + +#define makeTypedef(type, Type, args...) \ + typedef fixedGradientFaPatchField fixedGradientFaPatch##Type##Field; + +forAllVectorNTypes(makeTypedef) + +forAllTensorNTypes(makeTypedef) + +forAllDiagTensorNTypes(makeTypedef) + +forAllSphericalTensorNTypes(makeTypedef) + +#undef makeTypedef + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/basic/fixedValue/fixedValueFaPatchVectorNFields.C b/src/finiteArea/fields/faPatchFields/basic/fixedValue/fixedValueFaPatchVectorNFields.C new file mode 100644 index 000000000..0e58a99da --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/basic/fixedValue/fixedValueFaPatchVectorNFields.C @@ -0,0 +1,59 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "fixedValueFaPatchVectorNFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +#define doMakePatchTypeField(type, Type, args...) \ + \ +makeTemplateFaPatchTypeField \ +( \ + faPatch##Type##Field, \ + fixedValueFaPatch##Type##Field \ +); + +forAllVectorNTypes(doMakePatchTypeField) + +forAllTensorNTypes(doMakePatchTypeField) + +forAllDiagTensorNTypes(doMakePatchTypeField) + +forAllSphericalTensorNTypes(doMakePatchTypeField) + + +#undef doMakePatchTypeField + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/basic/fixedValue/fixedValueFaPatchVectorNFields.H b/src/finiteArea/fields/faPatchFields/basic/fixedValue/fixedValueFaPatchVectorNFields.H new file mode 100644 index 000000000..feb38fc1b --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/basic/fixedValue/fixedValueFaPatchVectorNFields.H @@ -0,0 +1,39 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef fixedValueFaPatchVectorNFields_H +#define fixedValueFaPatchVectorNFields_H + +#include "areaVectorNFields.H" +#include "faPatchVectorNFields.H" + +#include "fixedValueFaPatchVectorNFieldsFwd.H" +#include "fixedValueFaPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/basic/fixedValue/fixedValueFaPatchVectorNFieldsFwd.H b/src/finiteArea/fields/faPatchFields/basic/fixedValue/fixedValueFaPatchVectorNFieldsFwd.H new file mode 100644 index 000000000..0d233168b --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/basic/fixedValue/fixedValueFaPatchVectorNFieldsFwd.H @@ -0,0 +1,61 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef fixedValueFaPatchVectorNFieldsFwd_H +#define fixedValueFaPatchVectorNFieldsFwd_H + +#include "VectorNFieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template class fixedValueFaPatchField; + +#define makeTypedef(type, Type, args...) \ + typedef fixedValueFaPatchField fixedValueFaPatch##Type##Field; + +forAllVectorNTypes(makeTypedef) + +forAllTensorNTypes(makeTypedef) + +forAllDiagTensorNTypes(makeTypedef) + +forAllSphericalTensorNTypes(makeTypedef) + +#undef makeTypedef + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/basic/transform/transformFaPatchVectorNFields.C b/src/finiteArea/fields/faPatchFields/basic/transform/transformFaPatchVectorNFields.C new file mode 100644 index 000000000..ee663771b --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/basic/transform/transformFaPatchVectorNFields.C @@ -0,0 +1,53 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "transformFaPatchVectorNFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +#define makePatch(type, Type, args...) \ + defineNamedTemplateTypeNameAndDebug(transformFaPatch##Type##Field, 0); + +forAllVectorNTypes(makePatch) + +forAllTensorNTypes(makePatch) + +forAllDiagTensorNTypes(makePatch) + +forAllSphericalTensorNTypes(makePatch) + +#undef makePatch + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/basic/transform/transformFaPatchVectorNFields.H b/src/finiteArea/fields/faPatchFields/basic/transform/transformFaPatchVectorNFields.H new file mode 100644 index 000000000..1e7047f8e --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/basic/transform/transformFaPatchVectorNFields.H @@ -0,0 +1,40 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef transformFaPatchVectorNFields_H +#define transformFaPatchVectorNFields_H + +#include "areaVectorNFields.H" +#include "faPatchVectorNFields.H" +#include "VectorNFieldTypes.H" + +#include "transformFaPatchVectorNFieldsFwd.H" +#include "transformFaPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/basic/transform/transformFaPatchVectorNFieldsFwd.H b/src/finiteArea/fields/faPatchFields/basic/transform/transformFaPatchVectorNFieldsFwd.H new file mode 100644 index 000000000..dfce564b8 --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/basic/transform/transformFaPatchVectorNFieldsFwd.H @@ -0,0 +1,57 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef transformFaPatchVectorNFieldsFwd_H +#define transformFaPatchVectorNFieldsFwd_H + +#include "VectorNFieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +template class transformFaPatchField; + +#define makeTypedef(type, Type, args...) \ + typedef transformFaPatchField transformFaPatch##Type##Field; + +forAllVectorNTypes(makeTypedef) + +forAllTensorNTypes(makeTypedef) + +forAllDiagTensorNTypes(makeTypedef) + +forAllSphericalTensorNTypes(makeTypedef) + +#undef makeTypedef + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/basic/zeroGradient/zeroGradientFaPatchVectorNFields.C b/src/finiteArea/fields/faPatchFields/basic/zeroGradient/zeroGradientFaPatchVectorNFields.C new file mode 100644 index 000000000..1be998c31 --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/basic/zeroGradient/zeroGradientFaPatchVectorNFields.C @@ -0,0 +1,59 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "zeroGradientFaPatchVectorNFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +#define doMakePatchTypeField(type, Type, args...) \ + \ +makeTemplateFaPatchTypeField \ +( \ + faPatch##Type##Field, \ + zeroGradientFaPatch##Type##Field \ +); + +forAllVectorNTypes(doMakePatchTypeField) + +forAllTensorNTypes(doMakePatchTypeField) + +forAllDiagTensorNTypes(doMakePatchTypeField) + +forAllSphericalTensorNTypes(doMakePatchTypeField) + + +#undef doMakePatchTypeField + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/basic/zeroGradient/zeroGradientFaPatchVectorNFields.H b/src/finiteArea/fields/faPatchFields/basic/zeroGradient/zeroGradientFaPatchVectorNFields.H new file mode 100644 index 000000000..acb6598b0 --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/basic/zeroGradient/zeroGradientFaPatchVectorNFields.H @@ -0,0 +1,39 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef zeroGradientFaPatchVectorNFields_H +#define zeroGradientFaPatchVectorNFields_H + +#include "areaVectorNFields.H" +#include "faPatchVectorNFields.H" + +#include "zeroGradientFaPatchVectorNFieldsFwd.H" +#include "zeroGradientFaPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/basic/zeroGradient/zeroGradientFaPatchVectorNFieldsFwd.H b/src/finiteArea/fields/faPatchFields/basic/zeroGradient/zeroGradientFaPatchVectorNFieldsFwd.H new file mode 100644 index 000000000..a5e887ef1 --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/basic/zeroGradient/zeroGradientFaPatchVectorNFieldsFwd.H @@ -0,0 +1,61 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef zeroGradientFaPatchVectorNFieldsFwd_H +#define zeroGradientFaPatchVectorNFieldsFwd_H + +#include "VectorNFieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template class zeroGradientFaPatchField; + +#define makeTypedef(type, Type, args...) \ + typedef zeroGradientFaPatchField zeroGradientFaPatch##Type##Field; + +forAllVectorNTypes(makeTypedef) + +forAllTensorNTypes(makeTypedef) + +forAllDiagTensorNTypes(makeTypedef) + +forAllSphericalTensorNTypes(makeTypedef) + +#undef makeTypedef + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchField.H b/src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchField.H index eb86cc034..2929f0d66 100644 --- a/src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchField.H @@ -164,7 +164,37 @@ public: const direction cmpt ) const { - cyclicLduInterfaceField::transformCoupleField(f, cmpt); + // See comments in cyclicLduInterfaceField + // HJ, 3/Sep/2015 +// cyclicLduInterfaceField::transformCoupleField(f, cmpt); + if (doTransform()) + { + label sizeby2 = f.size()/2; + + Type powFwdTransform = transform + ( + this->forwardT()[0], + pTraits::one + ); + + scalar forwardScale = + pow(component(powFwdTransform, cmpt), rank()); + + Type powRevTransform = transform + ( + this->reverseT()[0], + pTraits::one + ); + + scalar reverseScale = + pow(component(powRevTransform, cmpt), rank()); + + for (label facei = 0; facei < sizeby2; facei++) + { + f[facei] *= forwardScale; + f[facei + sizeby2] *= reverseScale; + } + } } //- Update result field based on interface functionality @@ -180,6 +210,27 @@ public: ) const; + // Block coupled interface functionality + + //- Update result field based on interface functionality + virtual void updateInterfaceMatrix + ( + const Field&, + Field&, + const BlockLduMatrix&, + const CoeffField&, + const Pstream::commsTypes commsType, + const bool switchToLhs + ) const + { + notImplemented + ( + "cyclicFaPatchField::" + "updateInterfaceMatrix for block matrices" + ); + } + + //- Cyclic coupled interface functions //- Does the patch field perform the transfromation diff --git a/src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchVectorNFields.C b/src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchVectorNFields.C new file mode 100644 index 000000000..193a8f811 --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchVectorNFields.C @@ -0,0 +1,109 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "cyclicFaPatchVectorNFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +#define VectorNMatrixInterfaceFunc(Type) \ +template<> \ +void cyclicFaPatchField::updateInterfaceMatrix \ +( \ + const Field& psiInternal, \ + Field& result, \ + const BlockLduMatrix&, \ + const CoeffField& coeffs, \ + const Pstream::commsTypes commsType, \ + const bool switchToLhs \ +) const \ +{ \ + Field pnf(this->size()); \ + \ + label sizeby2 = this->size()/2; \ + const unallocLabelList& faceCells = cyclicPatch_.faceCells(); \ + \ + for (label facei=0; facei. + +\*---------------------------------------------------------------------------*/ + +#ifndef cyclicFaPatchVectorNFields_H +#define cyclicFaPatchVectorNFields_H + +#include "areaVectorNFields.H" +#include "faPatchVectorNFields.H" + +#include "cyclicFaPatchVectorNFieldsFwd.H" +#include "cyclicFaPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchVectorNFieldsFwd.H b/src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchVectorNFieldsFwd.H new file mode 100644 index 000000000..2f96f84a4 --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchVectorNFieldsFwd.H @@ -0,0 +1,55 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef cyclicFaPatchVectorNFieldsFwd_H +#define cyclicFaPatchVectorNFieldsFwd_H + +#include "VectorNFieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template class cyclicFaPatchField; + +#define makeTypedef(type, Type, args...) \ + typedef cyclicFaPatchField cyclicFaPatch##Type##Field; + +forAllVectorNTypes(makeTypedef) + +#undef makeTypedef + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/constraint/empty/emptyFaPatchVectorNFields.C b/src/finiteArea/fields/faPatchFields/constraint/empty/emptyFaPatchVectorNFields.C new file mode 100644 index 000000000..f14b7c820 --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/constraint/empty/emptyFaPatchVectorNFields.C @@ -0,0 +1,59 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "emptyFaPatchVectorNFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +#define doMakePatchTypeField(type, Type, args...) \ + \ +makeTemplateFaPatchTypeField \ +( \ + faPatch##Type##Field, \ + emptyFaPatch##Type##Field \ +); + +forAllVectorNTypes(doMakePatchTypeField) + +forAllTensorNTypes(doMakePatchTypeField) + +forAllDiagTensorNTypes(doMakePatchTypeField) + +forAllSphericalTensorNTypes(doMakePatchTypeField) + + +#undef doMakePatchTypeField + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/constraint/empty/emptyFaPatchVectorNFields.H b/src/finiteArea/fields/faPatchFields/constraint/empty/emptyFaPatchVectorNFields.H new file mode 100644 index 000000000..7c7df0fa6 --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/constraint/empty/emptyFaPatchVectorNFields.H @@ -0,0 +1,39 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef emptyFaPatchVectorNFields_H +#define emptyFaPatchVectorNFields_H + +#include "areaVectorNFields.H" +#include "faPatchVectorNFields.H" + +#include "emptyFaPatchVectorNFieldsFwd.H" +#include "emptyFaPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/constraint/empty/emptyFaPatchVectorNFieldsFwd.H b/src/finiteArea/fields/faPatchFields/constraint/empty/emptyFaPatchVectorNFieldsFwd.H new file mode 100644 index 000000000..21e43748d --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/constraint/empty/emptyFaPatchVectorNFieldsFwd.H @@ -0,0 +1,61 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef emptyFaPatchVectorNFieldsFwd_H +#define emptyFaPatchVectorNFieldsFwd_H + +#include "VectorNFieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template class emptyFaPatchField; + +#define makeTypedef(type, Type, args...) \ + typedef emptyFaPatchField emptyFaPatch##Type##Field; + +forAllVectorNTypes(makeTypedef) + +forAllTensorNTypes(makeTypedef) + +forAllDiagTensorNTypes(makeTypedef) + +forAllSphericalTensorNTypes(makeTypedef) + +#undef makeTypedef + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchField.C b/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchField.C index 3537b4c27..68fd084d0 100644 --- a/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchField.C +++ b/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchField.C @@ -83,7 +83,7 @@ processorFaPatchField::processorFaPatchField "(\n" " const processorFaPatchField& ptf,\n" " const faPatch& p,\n" - " const DimensionedField& iF,\n" + " const DimensionedField& iF,\n" " const faPatchFieldMapper& mapper\n" ")\n" ) << "\n patch type '" << p.type() diff --git a/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchField.H b/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchField.H index 4f730752f..21e397cdc 100644 --- a/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchField.H @@ -22,7 +22,7 @@ License along with foam-extend. If not, see . Class - processorFvPatchField + processorFaPatchField Description diff --git a/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchVectorNFields.C b/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchVectorNFields.C new file mode 100644 index 000000000..39e29619e --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchVectorNFields.C @@ -0,0 +1,52 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "processorFaPatchVectorNFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +#define doMakePatchTypeField(type, Type, args...) \ + \ +makeTemplateFaPatchTypeField \ +( \ + faPatch##Type##Field, \ + processorFaPatch##Type##Field \ +); + +forAllVectorNTypes(doMakePatchTypeField) + +#undef doMakePatchTypeField + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchVectorNFields.H b/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchVectorNFields.H new file mode 100644 index 000000000..bf0441867 --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchVectorNFields.H @@ -0,0 +1,39 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef processorFaPatchVectorNFields_H +#define processorFaPatchVectorNFields_H + +#include "areaVectorNFields.H" +#include "faPatchVectorNFields.H" + +#include "processorFaPatchVectorNFieldsFwd.H" +#include "processorFaPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchVectorNFieldsFwd.H b/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchVectorNFieldsFwd.H new file mode 100644 index 000000000..59603e92f --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchVectorNFieldsFwd.H @@ -0,0 +1,55 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef processorFaPatchVectorNFieldsFwd_H +#define processorFaPatchVectorNFieldsFwd_H + +#include "VectorNFieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template class processorFaPatchField; + +#define makeTypedef(type, Type, args...) \ + typedef processorFaPatchField processorFaPatch##Type##Field; + +forAllVectorNTypes(makeTypedef) + +#undef makeTypedef + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchFieldsFwd.H b/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchFieldsFwd.H index a36300dab..0d98a15d0 100644 --- a/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchFieldsFwd.H +++ b/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchFieldsFwd.H @@ -22,7 +22,7 @@ License along with foam-extend. If not, see . Class - wedgeFvPatchField + wedgeFaPatchField \*---------------------------------------------------------------------------*/ @@ -44,7 +44,7 @@ template class wedgeFaPatchField; // typedef wedgeFaPatchField wedgeFaPatchVectorField; // typedef wedgeFaPatchField wedgeFaPatchTensorField; -// template class wedgeFvPatchField; +// template class wedgeFaPatchField; makeFaPatchTypeFieldTypedefs(wedge) diff --git a/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchVectorNFields.C b/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchVectorNFields.C new file mode 100644 index 000000000..990222847 --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchVectorNFields.C @@ -0,0 +1,99 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "wedgeFaPatchVectorNFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +#define makeVectorTensorNWedgeFuncDefs(Type) \ +template<> \ +tmp > wedgeFaPatchField::snGrad() const \ +{ \ + return tmp > \ + ( \ + new Field(size(), pTraits::zero) \ + ); \ +} \ + \ +template<> \ +void wedgeFaPatchField::evaluate \ +( \ + const Pstream::commsTypes commsType \ +) \ +{ \ + if (!updated()) \ + { \ + updateCoeffs(); \ + } \ + \ + this->operator==(patchInternalField()); \ +} \ + \ +template<> \ +tmp > wedgeFaPatchField::snGradTransformDiag() \ +const \ +{ \ + return tmp > \ + ( \ + new Field(this->size(), pTraits::zero) \ + ); \ +} + + +#define doMakePatchTypeField(type, Type, args...) \ + \ +makeVectorTensorNWedgeFuncDefs(type) \ + \ +makeTemplateFaPatchTypeField \ +( \ + faPatch##Type##Field, \ + wedgeFaPatch##Type##Field \ +); + + +forAllVectorNTypes(doMakePatchTypeField) + +forAllTensorNTypes(doMakePatchTypeField) + +forAllDiagTensorNTypes(doMakePatchTypeField) + +forAllSphericalTensorNTypes(doMakePatchTypeField) + + +#undef doMakePatchTypeField + +#undef makeVectorTensorNWedgeFuncDefs + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchVectorNFields.H b/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchVectorNFields.H new file mode 100644 index 000000000..9e0e674ec --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchVectorNFields.H @@ -0,0 +1,74 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef wedgeFaPatchVectorNFields_H +#define wedgeFaPatchVectorNFields_H + +#include "areaVectorNFields.H" +#include "faPatchVectorNFields.H" + +#include "wedgeFaPatchVectorNFieldsFwd.H" +#include "wedgeFaPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define doMakeVectorTensorNWedgeFuncDefs(type, Type, args...) \ +template<> \ +tmp > wedgeFaPatchField::snGrad() const; \ + \ +template<> \ +void wedgeFaPatchField::evaluate \ +( \ + const Pstream::commsTypes commsType \ +); \ + \ +template<> \ +tmp > \ +wedgeFaPatchField::snGradTransformDiag() const; + +forAllVectorNTypes(doMakeVectorTensorNWedgeFuncDefs) + +forAllTensorNTypes(doMakeVectorTensorNWedgeFuncDefs) + +forAllDiagTensorNTypes(doMakeVectorTensorNWedgeFuncDefs) + +forAllSphericalTensorNTypes(doMakeVectorTensorNWedgeFuncDefs) + +#undef doMakeVectorTensorNWedgeFuncDefs + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchVectorNFieldsFwd.H b/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchVectorNFieldsFwd.H new file mode 100644 index 000000000..b2db6c231 --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchVectorNFieldsFwd.H @@ -0,0 +1,61 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef wedgeFaPatchVectorNFieldsFwd_H +#define wedgeFaPatchVectorNFieldsFwd_H + +#include "VectorNFieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template class wedgeFaPatchField; + +#define makeTypedef(type, Type, args...) \ + typedef wedgeFaPatchField wedgeFaPatch##Type##Field; + +forAllVectorNTypes(makeTypedef) + +forAllTensorNTypes(makeTypedef) + +forAllDiagTensorNTypes(makeTypedef) + +forAllSphericalTensorNTypes(makeTypedef) + +#undef makeTypedef + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/faPatchField/faPatchVectorNFields.C b/src/finiteArea/fields/faPatchFields/faPatchField/faPatchVectorNFields.C new file mode 100644 index 000000000..5eab483ed --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/faPatchField/faPatchVectorNFields.C @@ -0,0 +1,68 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "faPatchVectorNFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +#define makeFaPatchField(faPatchTypeField) \ + \ +defineNamedTemplateTypeNameAndDebug(faPatchTypeField, 0); \ +template<> \ +Foam::debug::debugSwitch \ +faPatchTypeField::disallowDefaultFaPatchField \ +( \ + "disallowDefaultFaPatchField", \ + 0 \ +); \ +defineTemplateRunTimeSelectionTable(faPatchTypeField, patch); \ +defineTemplateRunTimeSelectionTable(faPatchTypeField, patchMapper); \ +defineTemplateRunTimeSelectionTable(faPatchTypeField, dictionary); + + +#define doMakeFaPatchField(type, Type, args...) \ + makeFaPatchField(faPatch##Type##Field) + +forAllVectorNTypes(doMakeFaPatchField) + +forAllTensorNTypes(doMakeFaPatchField) + +forAllDiagTensorNTypes(doMakeFaPatchField) + +forAllSphericalTensorNTypes(doMakeFaPatchField) + +#undef doMakeFaPatchField +#undef makeFaPatchField + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/faPatchField/faPatchVectorNFields.H b/src/finiteArea/fields/faPatchFields/faPatchField/faPatchVectorNFields.H new file mode 100644 index 000000000..8dc63497f --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/faPatchField/faPatchVectorNFields.H @@ -0,0 +1,37 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef faPatchVectorNFields_H +#define faPatchVectorNFields_H + +#include "faPatchVectorNFieldsFwd.H" +#include "faPatchField.H" +#include "faPatchFieldsFwd.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/faPatchField/faPatchVectorNFieldsFwd.H b/src/finiteArea/fields/faPatchFields/faPatchField/faPatchVectorNFieldsFwd.H new file mode 100644 index 000000000..eba6610eb --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/faPatchField/faPatchVectorNFieldsFwd.H @@ -0,0 +1,61 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef faPatchVectorNFieldsFwd_H +#define faPatchVectorNFieldsFwd_H + +#include "VectorNFieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template class faPatchField; + +#define doMakeTypedef(type, Type, args...) \ + typedef faPatchField faPatch##Type##Field; + +forAllVectorNTypes(doMakeTypedef) + +forAllTensorNTypes(doMakeTypedef) + +forAllDiagTensorNTypes(doMakeTypedef) + +forAllSphericalTensorNTypes(doMakeTypedef) + +#undef doMakeTypedef + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/calculatedFaePatchVectorNFields.C b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/calculatedFaePatchVectorNFields.C new file mode 100644 index 000000000..faa263177 --- /dev/null +++ b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/calculatedFaePatchVectorNFields.C @@ -0,0 +1,54 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "calculatedFaePatchVectorNFields.H" +#include "faePatchFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +#define doMakeFaePatchTypeField(type, Type, args...) \ + makeFaePatchTypeField(faePatch##Type##Field, calculatedFaePatch##Type##Field); + +forAllVectorNTypes(doMakeFaePatchTypeField) + +forAllTensorNTypes(doMakeFaePatchTypeField) + +forAllDiagTensorNTypes(doMakeFaePatchTypeField) + +forAllSphericalTensorNTypes(doMakeFaePatchTypeField) + +#undef doMakeFaePatchTypeField + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/calculatedFaePatchVectorNFields.H b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/calculatedFaePatchVectorNFields.H new file mode 100644 index 000000000..d19efb463 --- /dev/null +++ b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/calculatedFaePatchVectorNFields.H @@ -0,0 +1,37 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef calculatedFaePatchVectorNFields_H +#define calculatedFaePatchVectorNFields_H + +#include "calculatedFaePatchVectorNFieldsFwd.H" +#include "calculatedFaePatchField.H" +#include "faePatchVectorNFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/calculatedFaePatchVectorNFieldsFwd.H b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/calculatedFaePatchVectorNFieldsFwd.H new file mode 100644 index 000000000..8942750f4 --- /dev/null +++ b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/calculatedFaePatchVectorNFieldsFwd.H @@ -0,0 +1,67 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +Class + calculatedFaePatchField + +Description + +\*---------------------------------------------------------------------------*/ + +#ifndef calculatedFaePatchVectorNFieldsFwd_H +#define calculatedFaePatchVectorNFieldsFwd_H + +#include "VectorNFieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template class calculatedFaePatchField; + +#define doMakeTypedef(type, Type, args...) \ + typedef calculatedFaePatchField calculatedFaePatch##Type##Field; + +forAllVectorNTypes(doMakeTypedef) + +forAllTensorNTypes(doMakeTypedef) + +forAllDiagTensorNTypes(doMakeTypedef) + +forAllSphericalTensorNTypes(doMakeTypedef) + +#undef doMakeTypedef + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/coupledFaePatchVectorNFields.C b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/coupledFaePatchVectorNFields.C new file mode 100644 index 000000000..23162eb3b --- /dev/null +++ b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/coupledFaePatchVectorNFields.C @@ -0,0 +1,54 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "coupledFaePatchVectorNFields.H" +#include "faePatchFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +#define doMakeFaePatchTypeField(type, Type, args...) \ + makeFaePatchTypeFieldTypeName(coupledFaePatch##Type##Field); + +forAllVectorNTypes(doMakeFaePatchTypeField) + +forAllTensorNTypes(doMakeFaePatchTypeField) + +forAllDiagTensorNTypes(doMakeFaePatchTypeField) + +forAllSphericalTensorNTypes(doMakeFaePatchTypeField) + +#undef doMakeFaePatchTypeField + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/coupledFaePatchVectorNFields.H b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/coupledFaePatchVectorNFields.H new file mode 100644 index 000000000..28980d014 --- /dev/null +++ b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/coupledFaePatchVectorNFields.H @@ -0,0 +1,37 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef coupledFaePatchVectorNFields_H +#define coupledFaePatchVectorNFields_H + +#include "coupledFaePatchVectorNFieldsFwd.H" +#include "coupledFaePatchField.H" +#include "faePatchVectorNFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/coupledFaePatchVectorNFieldsFwd.H b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/coupledFaePatchVectorNFieldsFwd.H new file mode 100644 index 000000000..f0061a672 --- /dev/null +++ b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/coupledFaePatchVectorNFieldsFwd.H @@ -0,0 +1,66 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +Class + coupledFaePatchField + +Description + +\*---------------------------------------------------------------------------*/ + +#ifndef coupledFaePatchVectorNFieldsFwd_H +#define coupledFaePatchVectorNFieldsFwd_H + +#include "VectorNFieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template class coupledFaePatchField; + +#define doMakeTypedef(type, Type, args...) \ + typedef coupledFaePatchField coupledFaePatch##Type##Field; + +forAllVectorNTypes(doMakeTypedef) + +forAllTensorNTypes(doMakeTypedef) + +forAllDiagTensorNTypes(doMakeTypedef) + +forAllSphericalTensorNTypes(doMakeTypedef) + +#undef doMakeTypedef + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/emptyFaePatchVectorNFields.C b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/emptyFaePatchVectorNFields.C new file mode 100644 index 000000000..15a491965 --- /dev/null +++ b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/emptyFaePatchVectorNFields.C @@ -0,0 +1,54 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "emptyFaePatchVectorNFields.H" +#include "faePatchFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +#define doMakeFaePatchTypeField(type, Type, args...) \ + makeFaePatchTypeField(faePatch##Type##Field, emptyFaePatch##Type##Field); + +forAllVectorNTypes(doMakeFaePatchTypeField) + +forAllTensorNTypes(doMakeFaePatchTypeField) + +forAllDiagTensorNTypes(doMakeFaePatchTypeField) + +forAllSphericalTensorNTypes(doMakeFaePatchTypeField) + +#undef doMakeFaePatchTypeField + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/emptyFaePatchVectorNFields.H b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/emptyFaePatchVectorNFields.H new file mode 100644 index 000000000..eb5f2e210 --- /dev/null +++ b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/emptyFaePatchVectorNFields.H @@ -0,0 +1,37 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef emptyFaePatchVectorNFields_H +#define emptyFaePatchVectorNFields_H + +#include "emptyFaePatchVectorNFieldsFwd.H" +#include "emptyFaePatchField.H" +#include "faePatchVectorNFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/emptyFaePatchVectorNFieldsFwd.H b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/emptyFaePatchVectorNFieldsFwd.H new file mode 100644 index 000000000..18b00ad02 --- /dev/null +++ b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/emptyFaePatchVectorNFieldsFwd.H @@ -0,0 +1,61 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef emptyFaePatchVectorNFieldsFwd_H +#define emptyFaePatchVectorNFieldsFwd_H + +#include "VectorNFieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template class emptyFaePatchField; + +#define doMakeTypedef(type, Type, args...) \ + typedef emptyFaePatchField emptyFaePatch##Type##Field; + +forAllVectorNTypes(doMakeTypedef) + +forAllTensorNTypes(doMakeTypedef) + +forAllDiagTensorNTypes(doMakeTypedef) + +forAllSphericalTensorNTypes(doMakeTypedef) + +#undef doMakeTypedef + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/faePatchVectorNFields.C b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/faePatchVectorNFields.C new file mode 100644 index 000000000..5b56071d1 --- /dev/null +++ b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/faePatchVectorNFields.C @@ -0,0 +1,67 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "faePatchVectorNFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +#define makeFaePatchField(faePatchTypeField) \ + \ +defineNamedTemplateTypeNameAndDebug(faePatchTypeField, 0); \ +template<> \ +Foam::debug::debugSwitch \ +faePatchTypeField::disallowDefaultFaePatchField \ +( \ + "disallowDefaultFaePatchField", \ + 0 \ +); \ +defineTemplateRunTimeSelectionTable(faePatchTypeField, patch); \ +defineTemplateRunTimeSelectionTable(faePatchTypeField, patchMapper); \ +defineTemplateRunTimeSelectionTable(faePatchTypeField, dictionary); + +#define doMakeFaePatchField(type, Type, args...) \ + makeFaePatchField(faePatch##Type##Field) + +forAllVectorNTypes(doMakeFaePatchField) + +forAllTensorNTypes(doMakeFaePatchField) + +forAllDiagTensorNTypes(doMakeFaePatchField) + +forAllSphericalTensorNTypes(doMakeFaePatchField) + +#undef makeFaePatchField +#undef doMakeFaePatchField + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/faePatchVectorNFields.H b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/faePatchVectorNFields.H new file mode 100644 index 000000000..59a433b51 --- /dev/null +++ b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/faePatchVectorNFields.H @@ -0,0 +1,37 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef faePatchVectorNFields_H +#define faePatchVectorNFields_H + +#include "faePatchVectorNFieldsFwd.H" +#include "faePatchField.H" +#include "faePatchFieldsFwd.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/faePatchVectorNFieldsFwd.H b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/faePatchVectorNFieldsFwd.H new file mode 100644 index 000000000..1083247d6 --- /dev/null +++ b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/faePatchVectorNFieldsFwd.H @@ -0,0 +1,72 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef faePatchVectorNFieldsFwd_H +#define faePatchVectorNFieldsFwd_H + +#include "VectorNFieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template class faePatchField; + +typedef faePatchField faePatchVector2Field; +typedef faePatchField faePatchVector3Field; +typedef faePatchField faePatchVector4Field; +typedef faePatchField faePatchVector6Field; +typedef faePatchField faePatchVector8Field; + +typedef faePatchField faePatchTensor2Field; +typedef faePatchField faePatchTensor3Field; +typedef faePatchField faePatchTensor4Field; +typedef faePatchField faePatchTensor6Field; +typedef faePatchField faePatchTensor8Field; + +typedef faePatchField faePatchDiagTensor2Field; +typedef faePatchField faePatchDiagTensor3Field; +typedef faePatchField faePatchDiagTensor4Field; +typedef faePatchField faePatchDiagTensor6Field; +typedef faePatchField faePatchDiagTensor8Field; + +typedef faePatchField faePatchSphericalTensor2Field; +typedef faePatchField faePatchSphericalTensor3Field; +typedef faePatchField faePatchSphericalTensor4Field; +typedef faePatchField faePatchSphericalTensor6Field; +typedef faePatchField faePatchSphericalTensor8Field; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/processorFaePatchVectorNFields.C b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/processorFaePatchVectorNFields.C new file mode 100644 index 000000000..b144f8589 --- /dev/null +++ b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/processorFaePatchVectorNFields.C @@ -0,0 +1,48 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "processorFaePatchVectorNFields.H" +#include "faePatchFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +#define doMakeFaePatchTypeField(type, Type, args...) \ + makeFaePatchTypeField(faePatch##Type##Field, processorFaePatch##Type##Field); + +forAllVectorNTypes(doMakeFaePatchTypeField) + +#undef doMakeFaePatchTypeField + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/processorFaePatchVectorNFields.H b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/processorFaePatchVectorNFields.H new file mode 100644 index 000000000..16eb29761 --- /dev/null +++ b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/processorFaePatchVectorNFields.H @@ -0,0 +1,37 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef processorFaePatchVectorNFields_H +#define processorFaePatchVectorNFields_H + +#include "processorFaePatchVectorNFieldsFwd.H" +#include "processorFaePatchField.H" +#include "faePatchVectorNFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/processorFaePatchVectorNFieldsFwd.H b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/processorFaePatchVectorNFieldsFwd.H new file mode 100644 index 000000000..2a4592cd6 --- /dev/null +++ b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/processorFaePatchVectorNFieldsFwd.H @@ -0,0 +1,60 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +Class + processorFaePatchField + +Description + +\*---------------------------------------------------------------------------*/ + +#ifndef processorFaePatchVectorNFieldsFwd_H +#define processorFaePatchVectorNFieldsFwd_H + +#include "VectorNFieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template class processorFaePatchField; + +#define doMakeTypedef(type, Type, args...) \ + typedef processorFaePatchField processorFaePatch##Type##Field; + +forAllVectorNTypes(doMakeTypedef) + +#undef doMakeTypedef + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/wedgeFaePatchVectorNFields.C b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/wedgeFaePatchVectorNFields.C new file mode 100644 index 000000000..8a069401d --- /dev/null +++ b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/wedgeFaePatchVectorNFields.C @@ -0,0 +1,54 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "wedgeFaePatchVectorNFields.H" +#include "faePatchFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +#define doMakeFaePatchTypeField(type, Type, args...) \ + makeFaePatchTypeField(faePatch##Type##Field, wedgeFaePatch##Type##Field); + +forAllVectorNTypes(doMakeFaePatchTypeField) + +forAllTensorNTypes(doMakeFaePatchTypeField) + +forAllDiagTensorNTypes(doMakeFaePatchTypeField) + +forAllSphericalTensorNTypes(doMakeFaePatchTypeField) + +#undef doMakeFaePatchTypeField + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/wedgeFaePatchVectorNFields.H b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/wedgeFaePatchVectorNFields.H new file mode 100644 index 000000000..6de279526 --- /dev/null +++ b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/wedgeFaePatchVectorNFields.H @@ -0,0 +1,37 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef wedgeFaePatchVectorNFields_H +#define wedgeFaePatchVectorNFields_H + +#include "wedgeFaePatchVectorNFieldsFwd.H" +#include "wedgeFaePatchField.H" +#include "faePatchVectorNFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/wedgeFaePatchVectorNFieldsFwd.H b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/wedgeFaePatchVectorNFieldsFwd.H new file mode 100644 index 000000000..eb5f8e3db --- /dev/null +++ b/src/finiteArea/fields/faePatchFields/faePatchVectorNFields/wedgeFaePatchVectorNFieldsFwd.H @@ -0,0 +1,61 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef wedgeFaePatchVectorNFieldsFwd_H +#define wedgeFaePatchVectorNFieldsFwd_H + +#include "VectorNFieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template class wedgeFaePatchField; + +#define doMakeTypedef(type, Type, args...) \ + typedef wedgeFaePatchField wedgeFaePatch##Type##Field; + +forAllVectorNTypes(doMakeTypedef) + +forAllTensorNTypes(doMakeTypedef) + +forAllDiagTensorNTypes(doMakeTypedef) + +forAllSphericalTensorNTypes(doMakeTypedef) + +#undef doMakeTypedef + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // From f569d9ffaa7bbb20fd50e33ad941dbd7a28a3555 Mon Sep 17 00:00:00 2001 From: Vanja Skuric Date: Sun, 11 Feb 2018 19:14:04 +0100 Subject: [PATCH 4/6] Fixed a typo in solutionTemplates.C --- src/foam/matrices/solution/solutionTemplates.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/foam/matrices/solution/solutionTemplates.C b/src/foam/matrices/solution/solutionTemplates.C index 1287cfb18..d655ed3a3 100644 --- a/src/foam/matrices/solution/solutionTemplates.C +++ b/src/foam/matrices/solution/solutionTemplates.C @@ -70,7 +70,7 @@ void Foam::solution::setSolverPerformance // 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 (storeAllResiudals_ || perfs.size() < 2) + if (storeAllResiduals_ || perfs.size() < 2) { // Append to list perfs.setSize(perfs.size() + 1, sp); From c180b7088cfe0bfe88cb092c49a332c6d35d9185 Mon Sep 17 00:00:00 2001 From: Vanja Skuric Date: Sun, 11 Feb 2018 21:20:36 +0100 Subject: [PATCH 5/6] Added solutionFaControl files (forgot to add it in the previous commit) --- .../pimpleFaControl/pimpleFaControl.C | 239 +++++++++++++++ .../pimpleFaControl/pimpleFaControl.H | 163 ++++++++++ .../pimpleFaControl/pimpleFaControlI.H | 101 +++++++ .../pisoFaControl/pisoFaControl.C | 50 ++++ .../pisoFaControl/pisoFaControl.H | 86 ++++++ .../simpleFaControl/simpleFaControl.C | 158 ++++++++++ .../simpleFaControl/simpleFaControl.H | 111 +++++++ .../solutionFaControl/solutionFaControl.C | 280 ++++++++++++++++++ .../solutionFaControl/solutionFaControl.H | 235 +++++++++++++++ .../solutionFaControl/solutionFaControlI.H | 98 ++++++ .../solutionFaControlTemplates.C | 66 +++++ 11 files changed, 1587 insertions(+) create mode 100644 src/finiteArea/cfdTools/general/solutionFaControl/pimpleFaControl/pimpleFaControl.C create mode 100644 src/finiteArea/cfdTools/general/solutionFaControl/pimpleFaControl/pimpleFaControl.H create mode 100644 src/finiteArea/cfdTools/general/solutionFaControl/pimpleFaControl/pimpleFaControlI.H create mode 100644 src/finiteArea/cfdTools/general/solutionFaControl/pisoFaControl/pisoFaControl.C create mode 100644 src/finiteArea/cfdTools/general/solutionFaControl/pisoFaControl/pisoFaControl.H create mode 100644 src/finiteArea/cfdTools/general/solutionFaControl/simpleFaControl/simpleFaControl.C create mode 100644 src/finiteArea/cfdTools/general/solutionFaControl/simpleFaControl/simpleFaControl.H create mode 100644 src/finiteArea/cfdTools/general/solutionFaControl/solutionFaControl/solutionFaControl.C create mode 100644 src/finiteArea/cfdTools/general/solutionFaControl/solutionFaControl/solutionFaControl.H create mode 100644 src/finiteArea/cfdTools/general/solutionFaControl/solutionFaControl/solutionFaControlI.H create mode 100644 src/finiteArea/cfdTools/general/solutionFaControl/solutionFaControl/solutionFaControlTemplates.C diff --git a/src/finiteArea/cfdTools/general/solutionFaControl/pimpleFaControl/pimpleFaControl.C b/src/finiteArea/cfdTools/general/solutionFaControl/pimpleFaControl/pimpleFaControl.C new file mode 100644 index 000000000..cd6312f9f --- /dev/null +++ b/src/finiteArea/cfdTools/general/solutionFaControl/pimpleFaControl/pimpleFaControl.C @@ -0,0 +1,239 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "pimpleFaControl.H" +#include "Switch.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(pimpleFaControl, 0); +} + + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +void Foam::pimpleFaControl::read() +{ + solutionFaControl::read(false); + + // Read solution controls + const dictionary& pimpleDict = dict(); + nCorrPIMPLE_ = pimpleDict.lookupOrDefault