Commit 21203782 authored by laurence's avatar laurence
Browse files

Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev

parents 9989b015 c130b38e
......@@ -76,6 +76,8 @@ wmake $makeType engine
wmake $makeType fieldSources
wmake $makeType regionCoupled
postProcessing/Allwmake $*
# ----------------------------------------------------------------- end-of-file
......@@ -258,7 +258,8 @@ void Foam::GAMGAgglomeration::agglomerateLduAddressing
(
Pstream::nonBlocking,
restrictMap
)
),
fineLevelIndex
).ptr()
);
......
......@@ -38,6 +38,7 @@ SourceFiles
#include "autoPtr.H"
#include "lduInterfacePtrsList.H"
#include "GAMGAgglomeration.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -99,14 +100,16 @@ public:
const lduInterfacePtrsList& coarseInterfaces,
const lduInterface& fineInterface,
const labelField& localRestrictAddressing,
const labelField& neighbourRestrictAddressing
const labelField& neighbourRestrictAddressing,
const label fineLevelIndex
),
(
index,
coarseInterfaces,
fineInterface,
localRestrictAddressing,
neighbourRestrictAddressing
neighbourRestrictAddressing,
fineLevelIndex
)
);
......@@ -121,7 +124,8 @@ public:
const lduInterfacePtrsList& coarseInterfaces,
const lduInterface& fineInterface,
const labelField& localRestrictAddressing,
const labelField& neighbourRestrictAddressing
const labelField& neighbourRestrictAddressing,
const label fineLevelIndex
);
......@@ -135,7 +139,8 @@ public:
const lduInterfacePtrsList& coarseInterfaces,
const lduInterface&,
const labelField&,
const labelField&
const labelField&,
const label fineLevelIndex = -1
)
:
index_(index),
......
......@@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "GAMGInterface.H"
#include "GAMGAgglomeration.H"
#include "lduMatrix.H"
......@@ -35,7 +36,8 @@ Foam::autoPtr<Foam::GAMGInterface> Foam::GAMGInterface::New
const lduInterfacePtrsList& coarseInterfaces,
const lduInterface& fineInterface,
const labelField& localRestrictAddressing,
const labelField& neighbourRestrictAddressing
const labelField& neighbourRestrictAddressing,
const label fineLevelIndex
)
{
const word coupleType(fineInterface.type());
......@@ -65,7 +67,8 @@ Foam::autoPtr<Foam::GAMGInterface> Foam::GAMGInterface::New
coarseInterfaces,
fineInterface,
localRestrictAddressing,
neighbourRestrictAddressing
neighbourRestrictAddressing,
fineLevelIndex
)
);
}
......
......@@ -50,7 +50,8 @@ Foam::cyclicGAMGInterface::cyclicGAMGInterface
const lduInterfacePtrsList& coarseInterfaces,
const lduInterface& fineInterface,
const labelField& localRestrictAddressing,
const labelField& neighbourRestrictAddressing
const labelField& neighbourRestrictAddressing,
const label fineLevelIndex
)
:
GAMGInterface
......
......@@ -84,7 +84,8 @@ public:
const lduInterfacePtrsList& coarseInterfaces,
const lduInterface& fineInterface,
const labelField& restrictAddressing,
const labelField& neighbourRestrictAddressing
const labelField& neighbourRestrictAddressing,
const label fineLevelIndex
);
......
......@@ -49,7 +49,8 @@ Foam::processorCyclicGAMGInterface::processorCyclicGAMGInterface
const lduInterfacePtrsList& coarseInterfaces,
const lduInterface& fineInterface,
const labelField& localRestrictAddressing,
const labelField& neighbourRestrictAddressing
const labelField& neighbourRestrictAddressing,
const label fineLevelIndex
)
:
processorGAMGInterface
......@@ -58,7 +59,8 @@ Foam::processorCyclicGAMGInterface::processorCyclicGAMGInterface
coarseInterfaces,
fineInterface,
localRestrictAddressing,
neighbourRestrictAddressing
neighbourRestrictAddressing,
fineLevelIndex
)
{}
......
......@@ -75,7 +75,8 @@ public:
const lduInterfacePtrsList& coarseInterfaces,
const lduInterface& fineInterface,
const labelField& restrictAddressing,
const labelField& neighbourRestrictAddressing
const labelField& neighbourRestrictAddressing,
const label fineLevelIndex
);
......
......@@ -50,7 +50,8 @@ Foam::processorGAMGInterface::processorGAMGInterface
const lduInterfacePtrsList& coarseInterfaces,
const lduInterface& fineInterface,
const labelField& localRestrictAddressing,
const labelField& neighbourRestrictAddressing
const labelField& neighbourRestrictAddressing,
const label fineLevelIndex
)
:
GAMGInterface
......
......@@ -84,7 +84,8 @@ public:
const lduInterfacePtrsList& coarseInterfaces,
const lduInterface& fineInterface,
const labelField& restrictAddressing,
const labelField& neighbourRestrictAddressing
const labelField& neighbourRestrictAddressing,
const label fineLevelIndex
);
......
......@@ -30,6 +30,10 @@ derivedFvPatches = $(fvPatches)/derived
$(derivedFvPatches)/wall/wallFvPatch.C
$(derivedFvPatches)/mapped/mappedFvPatch.C
$(derivedFvPatches)/mapped/mappedWallFvPatch.C
$(derivedFvPatches)/regionCoupled/regionCoupledBaseFvPatch.C
$(derivedFvPatches)/regionCoupled/regionCoupledFvPatch.C
$(derivedFvPatches)/regionCoupled/regionCoupledWallFvPatch.C
wallDist = fvMesh/wallDist
$(wallDist)/wallPointYPlus/wallPointYPlus.C
......
EXE_INC = \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
-I$(LIB_SRC)/meshTools/lnInclude \
LIB_LIBS = \
-lOpenFOAM \
......
......@@ -105,7 +105,12 @@ uniformFixedValueFvPatchField<Type>::uniformFixedValueFvPatchField
)
:
fixedValueFvPatchField<Type>(ptf),
uniformValue_(ptf.uniformValue_().clone().ptr())
uniformValue_
(
ptf.uniformValue_.valid()
? ptf.uniformValue_().clone().ptr()
: NULL
)
{}
......@@ -117,11 +122,20 @@ uniformFixedValueFvPatchField<Type>::uniformFixedValueFvPatchField
)
:
fixedValueFvPatchField<Type>(ptf, iF),
uniformValue_(ptf.uniformValue_().clone().ptr())
uniformValue_
(
ptf.uniformValue_.valid()
? ptf.uniformValue_().clone().ptr()
: NULL
)
{
// For safety re-evaluate
const scalar t = this->db().time().timeOutputValue();
fvPatchField<Type>::operator==(uniformValue_->value(t));
if (ptf.uniformValue_.valid())
{
fvPatchField<Type>::operator==(uniformValue_->value(t));
}
}
......
......@@ -40,6 +40,7 @@ Foam::tmp<Foam::fvPatchField<Type> > Foam::fvPatchField<Type>::New
"const fvPatch&, const DimensionedField<Type, volMesh>&) :"
" patchFieldType="
<< patchFieldType
<< " : " << p.type()
<< endl;
}
......@@ -50,7 +51,7 @@ Foam::tmp<Foam::fvPatchField<Type> > Foam::fvPatchField<Type>::New
{
FatalErrorIn
(
"fvPatchField<Type>::New(const word&, const word&, const fvPatch&, "
"fvPatchField<Type>::New(const word&, const word&, const fvPatch&,"
"const DimensionedField<Type, volMesh>&)"
) << "Unknown patchField type "
<< patchFieldType << nl << nl
......
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM 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.
OpenFOAM 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 OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
\*---------------------------------------------------------------------------*/
#include "regionCoupledBaseFvPatch.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(regionCoupledBaseFvPatch, 0);
}
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM 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.
OpenFOAM 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 OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::regionCoupledBaseFvPatch
Description
Base class of regionCoupledFvPatch with common functionality for
regionCoupledFvPatch and regionCoupledWallFvPatch
SourceFiles
regionCoupledBaseFvPatch.C
\*---------------------------------------------------------------------------*/
#ifndef regionCoupledBaseFvPatch_H
#define regionCoupledBaseFvPatch_H
#include "regionCoupledBase.H"
#include "fvMesh.H"
#include "Time.H"
#include "polyPatch.H"
#include "regionCoupledLduInterface.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class regionCoupledBaseFvPatch Declaration
\*---------------------------------------------------------------------------*/
class regionCoupledBaseFvPatch
:
public regionCoupledLduInterface
{
protected:
// Protected data
//- Reference to regionCoupledBase
const regionCoupledBase& regionCoupledBase_;
//- Reference to fvPatch
const fvPatch& patch_;
// Protected members
//- Returns fvMesh
const fvMesh& nbrFvMesh() const
{
return
(
patch_.boundaryMesh().mesh().time().lookupObject<fvMesh>
(
regionCoupledBase_.nbrRegionName()
)
);
}
public:
//- Runtime type information
TypeName("regionCoupledBase");
// Constructors
//- Construct from polyPatch
regionCoupledBaseFvPatch
(
const polyPatch& pp,
const fvPatch& patch
)
:
regionCoupledLduInterface(),
regionCoupledBase_
(
refCast<const regionCoupledBase>(pp)
),
patch_(patch)
{}
//- Destructor
virtual ~regionCoupledBaseFvPatch()
{}
// Member Functions
// Access
//- Return neighbour
virtual label neighbPatchID() const
{
return regionCoupledBase_.neighbPatchID();
}
//- Is it the owner?
virtual bool owner() const
{
return regionCoupledBase_.owner();
}
//- Return regionCoupledBase neighb Patch
virtual const regionCoupledBaseFvPatch& neighbPatch() const
{
return refCast<const regionCoupledBaseFvPatch>
(
nbrFvMesh().boundary()
[
regionCoupledBase_.neighbPatchID()
]
);
}
//- Return a reference to the AMI interpolator
virtual const AMIPatchToPatchInterpolation& AMI() const
{
return regionCoupledBase_.AMI();
}
//- Returns neighbour polyMesh
virtual const polyMesh& nbrMesh() const
{
return
(
patch_.boundaryMesh().mesh().time().lookupObject<polyMesh>
(
regionCoupledBase_.nbrRegionName()
)
);
}
//- Return fvPatch
const fvPatch& patch() const
{
return patch_;
}
//- Returns if it is the same Region
bool sameRegion() const
{
return regionCoupledBase_.sameRegion();
}
//- Return regionCoupledPolyPatch
const regionCoupledBase& regionCoupledPatch() const
{
return regionCoupledBase_;
}
//- Return neighbor fvPatch
const fvPatch& neighbFvPatch() const
{
return refCast<const fvPatch>
(
nbrFvMesh().boundary()
[
regionCoupledBase_.neighbPatchID()
]
);
}
//- Return the interface type
const word& regionCoupleType() const
{
return regionCoupledBase_.regionCoupleType();
}
//- Return faceCell addressing
virtual const labelUList& faceCells() const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM 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.
OpenFOAM 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 OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
coupledFvPatch is an abstract base class for patches that couple regions
of the computational domain e.g. cyclic and processor-processor links.
\*---------------------------------------------------------------------------*/
#include "regionCoupledFvPatch.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(regionCoupledFvPatch, 0);
addToRunTimeSelectionTable(fvPatch, regionCoupledFvPatch, polyPatch);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::labelField> Foam::regionCoupledFvPatch::interfaceInternalField
(
const labelUList& internalData
) const
{
return patchInternalField(internalData);
}
Foam::tmp<Foam::labelField> Foam::regionCoupledFvPatch::internalFieldTransfer
(
const Pstream::commsTypes commsType,
const labelUList& iF
) const
{
if (neighbFvPatch().sameRegion())
{
return neighbFvPatch().patchInternalField(iF);
}
else
{
/*
WarningIn
(
"regionCoupledFvPatch::internalFieldTransfer"
"( const Pstream::commsTypes, const labelUList&)"
" the internal field can not be transfered "
" as the neighbFvPatch are in different meshes "
);
*/
return tmp<labelField>(new labelField(iF.size(), 0));
}
return tmp<labelField>(NULL);
}
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.