ENH: GAMGInterfaceField: added construct from tag,transform

This commit is contained in:
mattijs
2013-02-22 17:16:11 +00:00
parent cc1e03a81f
commit d7d0b07e5b
9 changed files with 169 additions and 14 deletions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -32,6 +32,7 @@ namespace Foam
{ {
defineTypeNameAndDebug(GAMGInterfaceField, 0); defineTypeNameAndDebug(GAMGInterfaceField, 0);
defineRunTimeSelectionTable(GAMGInterfaceField, lduInterface); defineRunTimeSelectionTable(GAMGInterfaceField, lduInterface);
defineRunTimeSelectionTable(GAMGInterfaceField, lduInterfaceField);
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -29,7 +29,7 @@ Description
SourceFiles SourceFiles
GAMGInterfaceField.C GAMGInterfaceField.C
newAmgInterfaceField.C GAMGInterfaceFieldNew.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -80,7 +80,7 @@ public:
( (
autoPtr, autoPtr,
GAMGInterfaceField, GAMGInterfaceField,
lduInterface, lduInterfaceField,
( (
const GAMGInterface& GAMGCp, const GAMGInterface& GAMGCp,
const lduInterfaceField& fineInterface const lduInterfaceField& fineInterface
@ -88,6 +88,19 @@ public:
(GAMGCp, fineInterface) (GAMGCp, fineInterface)
); );
declareRunTimeSelectionTable
(
autoPtr,
GAMGInterfaceField,
lduInterface,
(
const GAMGInterface& GAMGCp,
const bool doTransform,
const int rank
),
(GAMGCp, doTransform, rank)
);
// Selectors // Selectors
@ -100,6 +113,24 @@ public:
); );
//TBD: make into construct from Istream.
// autoPtr<GAMGInterfaceField> New
// (
// const GAMGInterface& GAMGCp,
// Istream& is
// );
//- Return a pointer to a new interface created on freestore given
// the fine interface
static autoPtr<GAMGInterfaceField> New
(
const GAMGInterface& GAMGCp,
const bool doTransform,
const int rank
);
// Constructors // Constructors
//- Construct from GAMG interface and fine level interface field //- Construct from GAMG interface and fine level interface field
@ -112,6 +143,19 @@ public:
lduInterfaceField(GAMGCp), lduInterfaceField(GAMGCp),
interface_(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)
{}
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -35,10 +35,10 @@ Foam::autoPtr<Foam::GAMGInterfaceField> Foam::GAMGInterfaceField::New
{ {
const word coupleType(fineInterface.interfaceFieldType()); const word coupleType(fineInterface.interfaceFieldType());
lduInterfaceConstructorTable::iterator cstrIter = lduInterfaceFieldConstructorTable::iterator cstrIter =
lduInterfaceConstructorTablePtr_->find(coupleType); lduInterfaceFieldConstructorTablePtr_->find(coupleType);
if (cstrIter == lduInterfaceConstructorTablePtr_->end()) if (cstrIter == lduInterfaceFieldConstructorTablePtr_->end())
{ {
FatalErrorIn FatalErrorIn
( (
@ -48,7 +48,7 @@ Foam::autoPtr<Foam::GAMGInterfaceField> Foam::GAMGInterfaceField::New
) << "Unknown GAMGInterfaceField type " ) << "Unknown GAMGInterfaceField type "
<< coupleType << nl << coupleType << nl
<< "Valid GAMGInterfaceField types are :" << "Valid GAMGInterfaceField types are :"
<< lduInterfaceConstructorTablePtr_->sortedToc() << lduInterfaceFieldConstructorTablePtr_->sortedToc()
<< exit(FatalError); << exit(FatalError);
} }
@ -56,4 +56,33 @@ Foam::autoPtr<Foam::GAMGInterfaceField> Foam::GAMGInterfaceField::New
} }
Foam::autoPtr<Foam::GAMGInterfaceField> 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<GAMGInterfaceField>(cstrIter()(GAMGCp, doTransform, rank));
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -38,6 +38,12 @@ namespace Foam
cyclicGAMGInterfaceField, cyclicGAMGInterfaceField,
lduInterface 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<const cyclicGAMGInterface>(GAMGCp)),
doTransform_(doTransform),
rank_(rank)
{}
// * * * * * * * * * * * * * * * * Desstructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Desstructor * * * * * * * * * * * * * * * //
Foam::cyclicGAMGInterfaceField::~cyclicGAMGInterfaceField() Foam::cyclicGAMGInterfaceField::~cyclicGAMGInterfaceField()

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -89,6 +89,14 @@ public:
const lduInterfaceField& fineInterfaceField const lduInterfaceField& fineInterfaceField
); );
//- Construct from GAMG interface and fine level interface field
cyclicGAMGInterfaceField
(
const GAMGInterface& GAMGCp,
const bool doTransform,
const int rank
);
//- Destructor //- Destructor
virtual ~cyclicGAMGInterfaceField(); virtual ~cyclicGAMGInterfaceField();

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -38,6 +38,12 @@ namespace Foam
processorCyclicGAMGInterfaceField, processorCyclicGAMGInterfaceField,
lduInterface 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 * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::processorCyclicGAMGInterfaceField::~processorCyclicGAMGInterfaceField() Foam::processorCyclicGAMGInterfaceField::~processorCyclicGAMGInterfaceField()

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -77,6 +77,14 @@ public:
const lduInterfaceField& fineInterface const lduInterfaceField& fineInterface
); );
//- Construct from GAMG interface and fine level interface field
processorCyclicGAMGInterfaceField
(
const GAMGInterface& GAMGCp,
const bool doTransform,
const int rank
);
// Destructor // Destructor

View File

@ -38,6 +38,12 @@ namespace Foam
processorGAMGInterfaceField, processorGAMGInterfaceField,
lduInterface 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<const processorGAMGInterface>(GAMGCp)),
doTransform_(doTransform),
rank_(rank)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::processorGAMGInterfaceField::~processorGAMGInterfaceField() Foam::processorGAMGInterfaceField::~processorGAMGInterfaceField()

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -105,6 +105,14 @@ public:
const lduInterfaceField& fineInterface const lduInterfaceField& fineInterface
); );
//- Construct from GAMG interface and fine level interface field
processorGAMGInterfaceField
(
const GAMGInterface& GAMGCp,
const bool doTransform,
const int rank
);
//- Destructor //- Destructor
virtual ~processorGAMGInterfaceField(); virtual ~processorGAMGInterfaceField();