diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/GAMGInterfaceField.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/GAMGInterfaceField.C index 1e5e31b0df..a390c7c2fd 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/GAMGInterfaceField.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/GAMGInterfaceField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -32,6 +32,7 @@ namespace Foam { defineTypeNameAndDebug(GAMGInterfaceField, 0); defineRunTimeSelectionTable(GAMGInterfaceField, lduInterface); + defineRunTimeSelectionTable(GAMGInterfaceField, lduInterfaceField); } // ************************************************************************* // diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/GAMGInterfaceField.H b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/GAMGInterfaceField.H index 8bb85bfeef..4609da8219 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/GAMGInterfaceField.H +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/GAMGInterfaceField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -29,7 +29,7 @@ Description SourceFiles GAMGInterfaceField.C - newAmgInterfaceField.C + GAMGInterfaceFieldNew.C \*---------------------------------------------------------------------------*/ @@ -80,7 +80,7 @@ public: ( autoPtr, GAMGInterfaceField, - lduInterface, + lduInterfaceField, ( const GAMGInterface& GAMGCp, const lduInterfaceField& fineInterface @@ -88,6 +88,19 @@ public: (GAMGCp, fineInterface) ); + declareRunTimeSelectionTable + ( + autoPtr, + GAMGInterfaceField, + lduInterface, + ( + const GAMGInterface& GAMGCp, + const bool doTransform, + const int rank + ), + (GAMGCp, doTransform, rank) + ); + // Selectors @@ -100,6 +113,24 @@ public: ); +//TBD: make into construct from Istream. +// autoPtr New +// ( +// const GAMGInterface& GAMGCp, +// Istream& is +// ); + + //- Return a pointer to a new interface created on freestore given + // the fine interface + static autoPtr New + ( + const GAMGInterface& GAMGCp, + const bool doTransform, + const int rank + ); + + + // Constructors //- Construct from GAMG interface and fine level interface field @@ -112,6 +143,19 @@ public: lduInterfaceField(GAMGCp), interface_(GAMGCp) {} + + //- Construct from GAMG interface and fine level interface field + GAMGInterfaceField + ( + const GAMGInterface& GAMGCp, + const bool doTransform, + const int rank + ) + : + lduInterfaceField(GAMGCp), + interface_(GAMGCp) + {} + }; diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/GAMGInterfaceFieldNew.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/GAMGInterfaceFieldNew.C index 7eeb97d8bc..0407aa6051 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/GAMGInterfaceFieldNew.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/GAMGInterfaceFieldNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -35,10 +35,10 @@ Foam::autoPtr Foam::GAMGInterfaceField::New { const word coupleType(fineInterface.interfaceFieldType()); - lduInterfaceConstructorTable::iterator cstrIter = - lduInterfaceConstructorTablePtr_->find(coupleType); + lduInterfaceFieldConstructorTable::iterator cstrIter = + lduInterfaceFieldConstructorTablePtr_->find(coupleType); - if (cstrIter == lduInterfaceConstructorTablePtr_->end()) + if (cstrIter == lduInterfaceFieldConstructorTablePtr_->end()) { FatalErrorIn ( @@ -48,7 +48,7 @@ Foam::autoPtr Foam::GAMGInterfaceField::New ) << "Unknown GAMGInterfaceField type " << coupleType << nl << "Valid GAMGInterfaceField types are :" - << lduInterfaceConstructorTablePtr_->sortedToc() + << lduInterfaceFieldConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -56,4 +56,33 @@ Foam::autoPtr Foam::GAMGInterfaceField::New } +Foam::autoPtr Foam::GAMGInterfaceField::New +( + const GAMGInterface& GAMGCp, + const bool doTransform, + const int rank +) +{ + const word coupleType(GAMGCp.type()); + + lduInterfaceConstructorTable::iterator cstrIter = + lduInterfaceConstructorTablePtr_->find(coupleType); + + if (cstrIter == lduInterfaceConstructorTablePtr_->end()) + { + FatalErrorIn + ( + "GAMGInterfaceField::New" + "(const word&, const GAMGInterface&, const bool, const int)" + ) << "Unknown GAMGInterfaceField type " + << coupleType << nl + << "Valid GAMGInterfaceField types are :" + << lduInterfaceConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return autoPtr(cstrIter()(GAMGCp, doTransform, rank)); +} + + // ************************************************************************* // diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/cyclicGAMGInterfaceField/cyclicGAMGInterfaceField.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/cyclicGAMGInterfaceField/cyclicGAMGInterfaceField.C index c3a44bf160..3c54c8280a 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/cyclicGAMGInterfaceField/cyclicGAMGInterfaceField.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/cyclicGAMGInterfaceField/cyclicGAMGInterfaceField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -38,6 +38,12 @@ namespace Foam cyclicGAMGInterfaceField, lduInterface ); + addToRunTimeSelectionTable + ( + GAMGInterfaceField, + cyclicGAMGInterfaceField, + lduInterfaceField + ); } @@ -62,6 +68,20 @@ Foam::cyclicGAMGInterfaceField::cyclicGAMGInterfaceField } +Foam::cyclicGAMGInterfaceField::cyclicGAMGInterfaceField +( + const GAMGInterface& GAMGCp, + const bool doTransform, + const int rank +) +: + GAMGInterfaceField(GAMGCp, doTransform, rank), + cyclicInterface_(refCast(GAMGCp)), + doTransform_(doTransform), + rank_(rank) +{} + + // * * * * * * * * * * * * * * * * Desstructor * * * * * * * * * * * * * * * // Foam::cyclicGAMGInterfaceField::~cyclicGAMGInterfaceField() diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/cyclicGAMGInterfaceField/cyclicGAMGInterfaceField.H b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/cyclicGAMGInterfaceField/cyclicGAMGInterfaceField.H index 29677f0c50..f9068707ca 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/cyclicGAMGInterfaceField/cyclicGAMGInterfaceField.H +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/cyclicGAMGInterfaceField/cyclicGAMGInterfaceField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -89,6 +89,14 @@ public: const lduInterfaceField& fineInterfaceField ); + //- Construct from GAMG interface and fine level interface field + cyclicGAMGInterfaceField + ( + const GAMGInterface& GAMGCp, + const bool doTransform, + const int rank + ); + //- Destructor virtual ~cyclicGAMGInterfaceField(); diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorCyclicGAMGInterfaceField/processorCyclicGAMGInterfaceField.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorCyclicGAMGInterfaceField/processorCyclicGAMGInterfaceField.C index c0b1d8927d..129f8df5d4 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorCyclicGAMGInterfaceField/processorCyclicGAMGInterfaceField.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorCyclicGAMGInterfaceField/processorCyclicGAMGInterfaceField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -38,6 +38,12 @@ namespace Foam processorCyclicGAMGInterfaceField, lduInterface ); + addToRunTimeSelectionTable + ( + GAMGInterfaceField, + processorCyclicGAMGInterfaceField, + lduInterfaceField + ); } @@ -53,6 +59,17 @@ Foam::processorCyclicGAMGInterfaceField::processorCyclicGAMGInterfaceField {} +Foam::processorCyclicGAMGInterfaceField::processorCyclicGAMGInterfaceField +( + const GAMGInterface& GAMGCp, + const bool doTransform, + const int rank +) +: + processorGAMGInterfaceField(GAMGCp, doTransform, rank) +{} + + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::processorCyclicGAMGInterfaceField::~processorCyclicGAMGInterfaceField() diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorCyclicGAMGInterfaceField/processorCyclicGAMGInterfaceField.H b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorCyclicGAMGInterfaceField/processorCyclicGAMGInterfaceField.H index 55e6471b46..fd65135586 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorCyclicGAMGInterfaceField/processorCyclicGAMGInterfaceField.H +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorCyclicGAMGInterfaceField/processorCyclicGAMGInterfaceField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -77,6 +77,14 @@ public: const lduInterfaceField& fineInterface ); + //- Construct from GAMG interface and fine level interface field + processorCyclicGAMGInterfaceField + ( + const GAMGInterface& GAMGCp, + const bool doTransform, + const int rank + ); + // Destructor diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorGAMGInterfaceField/processorGAMGInterfaceField.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorGAMGInterfaceField/processorGAMGInterfaceField.C index a653bc71d5..07a967892e 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorGAMGInterfaceField/processorGAMGInterfaceField.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorGAMGInterfaceField/processorGAMGInterfaceField.C @@ -38,6 +38,12 @@ namespace Foam processorGAMGInterfaceField, lduInterface ); + addToRunTimeSelectionTable + ( + GAMGInterfaceField, + processorGAMGInterfaceField, + lduInterfaceField + ); } @@ -62,6 +68,20 @@ Foam::processorGAMGInterfaceField::processorGAMGInterfaceField } +Foam::processorGAMGInterfaceField::processorGAMGInterfaceField +( + const GAMGInterface& GAMGCp, + const bool doTransform, + const int rank +) +: + GAMGInterfaceField(GAMGCp, doTransform, rank), + procInterface_(refCast(GAMGCp)), + doTransform_(doTransform), + rank_(rank) +{} + + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::processorGAMGInterfaceField::~processorGAMGInterfaceField() diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorGAMGInterfaceField/processorGAMGInterfaceField.H b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorGAMGInterfaceField/processorGAMGInterfaceField.H index 68007b2c81..473af8669e 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorGAMGInterfaceField/processorGAMGInterfaceField.H +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorGAMGInterfaceField/processorGAMGInterfaceField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -105,6 +105,14 @@ public: const lduInterfaceField& fineInterface ); + //- Construct from GAMG interface and fine level interface field + processorGAMGInterfaceField + ( + const GAMGInterface& GAMGCp, + const bool doTransform, + const int rank + ); + //- Destructor virtual ~processorGAMGInterfaceField();