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
\\ / 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);
}
// ************************************************************************* //

View File

@ -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<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
//- 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)
{}
};

View File

@ -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> 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> 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> 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
\\ / 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<const cyclicGAMGInterface>(GAMGCp)),
doTransform_(doTransform),
rank_(rank)
{}
// * * * * * * * * * * * * * * * * Desstructor * * * * * * * * * * * * * * * //
Foam::cyclicGAMGInterfaceField::~cyclicGAMGInterfaceField()

View File

@ -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();

View File

@ -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()

View File

@ -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

View File

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

View File

@ -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();