regionCoupled: Removed unused code

This commit is contained in:
Will Bainbridge
2022-05-12 19:54:30 +01:00
parent 2d1428f667
commit e22784f5b2
34 changed files with 4 additions and 4079 deletions

View File

@ -36,9 +36,6 @@ 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
meshWave = algorithms/FvFaceCellWave

View File

@ -1,40 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 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);
}
// ************************************************************************* //

View File

@ -1,210 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 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 nbrPatchID() const
{
return regionCoupledBase_.nbrPatchID();
}
//- Is it the owner?
virtual bool owner() const
{
return regionCoupledBase_.owner();
}
//- Return regionCoupledBase neighb Patch
virtual const regionCoupledBaseFvPatch& nbrPatch() const
{
return refCast<const regionCoupledBaseFvPatch>
(
nbrFvMesh().boundary()
[
regionCoupledBase_.nbrPatchID()
]
);
}
//- Return a reference to the AMI interpolator
virtual const AMIInterpolation& 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_.nbrPatchID()
]
);
}
//- Return the interface type
const word& regionCoupleType() const
{
return regionCoupledBase_.regionCoupleType();
}
//- Return faceCell addressing
virtual const labelUList& faceCells() const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,69 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 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/>.
\*---------------------------------------------------------------------------*/
#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
{
return tmp<labelField>(new labelField(iF.size(), 0));
}
return tmp<labelField>(nullptr);
}
// ************************************************************************* //

View File

@ -1,163 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 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::regionCoupledFvPatch
Description
Common functionality for regionCoupleFvPatch and regionCoupledWallFvPatch
SourceFiles
regionCoupledFvPatch.C
\*---------------------------------------------------------------------------*/
#ifndef regionCoupledFvPatch_H
#define regionCoupledFvPatch_H
#include "fvPatch.H"
#include "fvMesh.H"
#include "Time.H"
#include "regionCoupledPolyPatch.H"
#include "regionCoupledBaseFvPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class regionCoupledFvPatch Declaration
\*---------------------------------------------------------------------------*/
class regionCoupledFvPatch
:
public lduInterface,
public fvPatch,
public regionCoupledBaseFvPatch
{
// Private Data
const regionCoupledPolyPatch& regionCoupledPolyPatch_;
// Private members
//- Return regionCoupledFvPatch nbr
const regionCoupledFvPatch& neighbFvPatch() const
{
return refCast<const regionCoupledFvPatch>
(
nbrFvMesh().boundary()
[
nbrPatchID()
]
);
}
public:
//- Runtime type information
TypeName(regionCoupledPolyPatch::typeName_());
// Constructors
//- Construct from polyPatch
regionCoupledFvPatch(const polyPatch& patch, const fvBoundaryMesh& bm)
:
fvPatch(patch, bm),
regionCoupledBaseFvPatch
(
patch,
*this
),
regionCoupledPolyPatch_
(
refCast<const regionCoupledPolyPatch>(patch)
)
{}
//- Destructor
~regionCoupledFvPatch()
{}
// Member Functions
// Access
//- Return faceCell addressing
virtual const labelUList& faceCells() const
{
return fvPatch::faceCells();
}
//- Return true because this patch is coupled
virtual bool coupled() const
{
return regionCoupledPolyPatch_.coupled();
}
// Interface transfer functions
//- Return the values of the given internal data adjacent to
// the interface as a field
virtual tmp<labelField> interfaceInternalField
(
const labelUList& internalData
) const;
//- Inherit initInternalFieldTransfer from lduInterface
using lduInterface::initInternalFieldTransfer;
//- Initialise neighbour field transfer
virtual void initInternalFieldTransfer
(
const Pstream::commsTypes commsType,
labelUList& iF
) const
{}
//- Return neighbour field
virtual tmp<labelField> internalFieldTransfer
(
const Pstream::commsTypes commsType,
const labelUList& iF
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,69 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 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/>.
\*---------------------------------------------------------------------------*/
#include "regionCoupledWallFvPatch.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(regionCoupledWallFvPatch, 0);
addToRunTimeSelectionTable(fvPatch, regionCoupledWallFvPatch, polyPatch);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::labelField> Foam::regionCoupledWallFvPatch::
interfaceInternalField
(
const labelUList& internalData
) const
{
return patchInternalField(internalData);
}
Foam::tmp<Foam::labelField> Foam::regionCoupledWallFvPatch::
internalFieldTransfer
(
const Pstream::commsTypes commsType,
const labelUList& iF
) const
{
if (neighbFvPatch().sameRegion())
{
return neighbFvPatch().patchInternalField(iF);
}
else
{
return tmp<labelField>(new labelField(iF.size(), 0));
}
return tmp<labelField>(nullptr);
}
// ************************************************************************* //

View File

@ -1,167 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 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::regionCoupledWallFvPatch
Description
Foam::regionCoupledWallFvPatch
SourceFiles
regionCoupledWallFvPatch.C
\*---------------------------------------------------------------------------*/
#ifndef regionCoupledWallFvPatch_H
#define regionCoupledWallFvPatch_H
#include "wallFvPatch.H"
#include "fvMesh.H"
#include "Time.H"
#include "regionCoupledWallPolyPatch.H"
#include "regionCoupledBaseFvPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class regionCoupledWallFvPatch Declaration
\*---------------------------------------------------------------------------*/
class regionCoupledWallFvPatch
:
public lduInterface,
public wallFvPatch,
public regionCoupledBaseFvPatch
{
// Private Data
//- Const reference to regionCoupledWallPolyPatch
const regionCoupledWallPolyPatch& regionCoupledPolyPatch_;
// Private members
//- Return regionCoupledBaseFvPatch nbr
const regionCoupledWallFvPatch& neighbFvPatch() const
{
return refCast<const regionCoupledWallFvPatch>
(
nbrFvMesh().boundary()[nbrPatchID()]
);
}
public:
//- Runtime type information
TypeName(regionCoupledWallPolyPatch::typeName_());
// Constructors
//- Construct from components
regionCoupledWallFvPatch
(
const polyPatch& patch,
const fvBoundaryMesh& bm
)
:
wallFvPatch(patch, bm),
regionCoupledBaseFvPatch
(
patch,
*this
),
regionCoupledPolyPatch_
(
refCast<const regionCoupledWallPolyPatch>(patch)
)
{}
//- Destructor
~regionCoupledWallFvPatch()
{}
// Member Functions
// Access
//- Return faceCell addressing
virtual const labelUList& faceCells() const
{
return fvPatch::faceCells();
}
//- Return true because this patch is coupled
virtual bool coupled() const
{
return regionCoupledPolyPatch_.coupled();
}
// Interface transfer functions
//- Return the values of the given internal data adjacent to
// the interface as a field
virtual tmp<labelField> interfaceInternalField
(
const labelUList& internalData
) const;
//- Inherit initInternalFieldTransfer from lduInterface
using lduInterface::initInternalFieldTransfer;
//- Initialise neighbour field transfer
virtual void initInternalFieldTransfer
(
const Pstream::commsTypes commsType,
labelUList& iF
) const
{}
//- Return neighbour field
virtual tmp<labelField> internalFieldTransfer
(
const Pstream::commsTypes commsType,
const labelUList& iF
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -268,19 +268,6 @@ meshStructure/meshStructure.C
meshStructure/topoDistanceData.C
meshStructure/pointTopoDistanceData.C
regionCoupled/patches/regionCoupledPolyPatch/regionCoupledBase.C
regionCoupled/patches/regionCoupledPolyPatch/regionCoupledPolyPatch.C
regionCoupled/patches/regionCoupledPolyPatch/regionCoupledWallPolyPatch.C
regionCoupled/patches/regionCoupledLduInterface/regionCoupledLduInterface.C
regionCoupled/patches/regionCoupledPointPatch/regionCoupledPointPatch.C
regionCoupled/patches/regionCoupledPointPatch/regionCoupledWallPointPatch.C
regionCoupled/GAMG/interfaces/regionCoupledGAMGInterface/regionCoupledBaseGAMGInterface.C
regionCoupled/GAMG/interfaces/regionCoupledGAMGInterface/regionCoupledGAMGInterface.C
regionCoupled/GAMG/interfaces/regionCoupledGAMGInterface/regionCoupledWallGAMGInterface.C
regionCoupled/GAMG/interfaceFields/regionCoupledGAMGInterfaceField/regionCoupledGAMGInterfaceField.C
regionCoupled/GAMG/interfaceFields/regionCoupledGAMGInterfaceField/regionCoupledWallGAMGInterfaceField.C
tetOverlapVolume/tetOverlapVolume.C
LIB = $(FOAM_LIBBIN)/libmeshTools

View File

@ -1,86 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 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/>.
\*---------------------------------------------------------------------------*/
#include "regionCoupledGAMGInterfaceField.H"
#include "addToRunTimeSelectionTable.H"
#include "lduMatrix.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(regionCoupledGAMGInterfaceField, 0);
addToRunTimeSelectionTable
(
GAMGInterfaceField,
regionCoupledGAMGInterfaceField,
lduInterface
);
addToRunTimeSelectionTable
(
GAMGInterfaceField,
regionCoupledGAMGInterfaceField,
lduInterfaceField
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::regionCoupledGAMGInterfaceField::regionCoupledGAMGInterfaceField
(
const GAMGInterface& GAMGCp,
const lduInterfaceField& fineInterface
)
:
GAMGInterfaceField(GAMGCp, fineInterface),
regionCoupledGAMGInterface_
(
refCast<const regionCoupledGAMGInterface>(GAMGCp)
)
{}
Foam::regionCoupledGAMGInterfaceField::regionCoupledGAMGInterfaceField
(
const GAMGInterface& GAMGCp,
const int rank
)
:
GAMGInterfaceField(GAMGCp, rank),
regionCoupledGAMGInterface_
(
refCast<const regionCoupledGAMGInterface>(GAMGCp)
)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::regionCoupledGAMGInterfaceField::~regionCoupledGAMGInterfaceField()
{}
// ************************************************************************* //

View File

@ -1,132 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 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::regionCoupledGAMGInterfaceField
Description
GAMG agglomerated region coupled interface field.
SourceFiles
regionCoupledGAMGInterfaceField.C
\*---------------------------------------------------------------------------*/
#ifndef regionCoupledGAMGInterfaceField_H
#define regionCoupledGAMGInterfaceField_H
#include "GAMGInterfaceField.H"
#include "regionCoupledGAMGInterface.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class regionCoupledGAMGInterfaceField Declaration
\*---------------------------------------------------------------------------*/
class regionCoupledGAMGInterfaceField
:
public GAMGInterfaceField
{
// Private Data
//- Local reference cast into the cyclic interface
const regionCoupledGAMGInterface& regionCoupledGAMGInterface_;
public:
//- Runtime type information
TypeName("regionCoupled");
// Constructors
//- Construct from GAMG interface and fine level interface field
regionCoupledGAMGInterfaceField
(
const GAMGInterface& GAMGCp,
const lduInterfaceField& fineInterfaceField
);
//- Construct from GAMG interface and fine level interface field
regionCoupledGAMGInterfaceField
(
const GAMGInterface& GAMGCp,
const int rank
);
//- Disallow default bitwise copy construction
regionCoupledGAMGInterfaceField
(
const regionCoupledGAMGInterfaceField&
);
//- Destructor
virtual ~regionCoupledGAMGInterfaceField();
// Member Functions
// Access
//- Return size
label size() const
{
return regionCoupledGAMGInterface_.size();
}
//- Interface matrix update
virtual void updateInterfaceMatrix
(
scalarField&,
const scalarField&,
const scalarField&,
const direction,
const Pstream::commsTypes commsType
) const
{}
// Member Operators
//- Disallow default bitwise assignment
void operator=(const regionCoupledGAMGInterfaceField&) = delete;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,87 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 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/>.
\*---------------------------------------------------------------------------*/
#include "regionCoupledWallGAMGInterfaceField.H"
#include "addToRunTimeSelectionTable.H"
#include "lduMatrix.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(regionCoupledWallGAMGInterfaceField, 0);
addToRunTimeSelectionTable
(
GAMGInterfaceField,
regionCoupledWallGAMGInterfaceField,
lduInterface
);
addToRunTimeSelectionTable
(
GAMGInterfaceField,
regionCoupledWallGAMGInterfaceField,
lduInterfaceField
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::regionCoupledWallGAMGInterfaceField::regionCoupledWallGAMGInterfaceField
(
const GAMGInterface& GAMGCp,
const lduInterfaceField& fineInterface
)
:
GAMGInterfaceField(GAMGCp, fineInterface),
regionCoupledGAMGInterface_
(
refCast<const regionCoupledWallGAMGInterface>(GAMGCp)
)
{}
Foam::regionCoupledWallGAMGInterfaceField::regionCoupledWallGAMGInterfaceField
(
const GAMGInterface& GAMGCp,
const int rank
)
:
GAMGInterfaceField(GAMGCp, rank),
regionCoupledGAMGInterface_
(
refCast<const regionCoupledWallGAMGInterface>(GAMGCp)
)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::regionCoupledWallGAMGInterfaceField::~regionCoupledWallGAMGInterfaceField
()
{}
// ************************************************************************* //

View File

@ -1,132 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 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::regionCoupledWallGAMGInterfaceField
Description
GAMG agglomerated region coupled interface field.
SourceFiles
regionCoupledWallGAMGInterfaceField.C
\*---------------------------------------------------------------------------*/
#ifndef regionCoupledWallGAMGInterfaceField_H
#define regionCoupledWallGAMGInterfaceField_H
#include "GAMGInterfaceField.H"
#include "regionCoupledWallGAMGInterface.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class regionCoupledWallGAMGInterfaceField Declaration
\*---------------------------------------------------------------------------*/
class regionCoupledWallGAMGInterfaceField
:
public GAMGInterfaceField
{
// Private Data
//- Local reference cast into the region coupled interface
const regionCoupledWallGAMGInterface& regionCoupledGAMGInterface_;
public:
//- Runtime type information
TypeName("regionCoupledWall");
// Constructors
//- Construct from GAMG interface and fine level interface field
regionCoupledWallGAMGInterfaceField
(
const GAMGInterface& GAMGCp,
const lduInterfaceField& fineInterfaceField
);
//- Construct from GAMG interface and fine level interface field
regionCoupledWallGAMGInterfaceField
(
const GAMGInterface& GAMGCp,
const int rank
);
//- Disallow default bitwise copy construction
regionCoupledWallGAMGInterfaceField
(
const regionCoupledWallGAMGInterfaceField&
);
//- Destructor
virtual ~regionCoupledWallGAMGInterfaceField();
// Member Functions
// Access
//- Return size
label size() const
{
return regionCoupledGAMGInterface_.size();
}
//- Interface matrix update
virtual void updateInterfaceMatrix
(
scalarField&,
const scalarField&,
const scalarField&,
const direction,
const Pstream::commsTypes commsType
) const
{}
// Member Operators
//- Disallow default bitwise assignment
void operator=(const regionCoupledWallGAMGInterfaceField&) = delete;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,239 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 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/>.
\*---------------------------------------------------------------------------*/
#include "AMIInterpolation.H"
#include "regionCoupledBaseGAMGInterface.H"
#include "addToRunTimeSelectionTable.H"
#include "Map.H"
#include "polyMesh.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::regionCoupledBaseGAMGInterface::regionCoupledBaseGAMGInterface
(
const label index,
const lduInterfacePtrsList& coarseInterfaces,
const lduInterface& fineInterface,
const labelField& localRestrictAddressing,
const labelField& neighbourRestrictAddressing,
const label fineLevelIndex,
const label coarseComm
)
:
GAMGInterface
(
index,
coarseInterfaces
),
fineRegionCoupledLduInterface_
(
refCast<const regionCoupledLduInterface>(fineInterface)
)
{
// Construct face agglomeration from cell agglomeration
{
// From coarse face to cell
DynamicList<label> dynFaceCells(localRestrictAddressing.size());
// From face to coarse face
DynamicList<label> dynFaceRestrictAddressing
(
localRestrictAddressing.size()
);
Map<label> masterToCoarseFace(localRestrictAddressing.size());
forAll(localRestrictAddressing, ffi)
{
label curMaster = localRestrictAddressing[ffi];
Map<label>::const_iterator fnd = masterToCoarseFace.find
(
curMaster
);
if (fnd == masterToCoarseFace.end())
{
// New coarse face
label coarseI = dynFaceCells.size();
dynFaceRestrictAddressing.append(coarseI);
dynFaceCells.append(curMaster);
masterToCoarseFace.insert(curMaster, coarseI);
}
else
{
// Already have coarse face
dynFaceRestrictAddressing.append(fnd());
}
}
faceCells_.transfer(dynFaceCells);
faceRestrictAddressing_.transfer(dynFaceRestrictAddressing);
}
/*
// On the owner side construct the AMI
if (fineRegionCoupledLduInterface_.owner())
{
const polyMesh& nbrMesh =
fineRegionCoupledLduInterface_.nbrMesh();
if
(
nbrMesh.foundObject<GAMGAgglomeration>(GAMGAgglomeration::typeName)
)
{
const GAMGAgglomeration& nbrAgg = nbrMesh.thisDb().lookupObject
<
GAMGAgglomeration
>
(
GAMGAgglomeration::typeName
);
label nbrLevel(-1);
if (nbrAgg.size() > fineLevelIndex)
{
nbrLevel = fineLevelIndex;
}
else
{
nbrLevel = nbrAgg.size() - 1;
}
const labelField& nbrRestrictMap =
nbrAgg.restrictAddressing(nbrLevel);
const labelUList& nbrFaceCells =
nbrLduInterface
(
nbrLevel,
nbrPatchID()
).faceCells();
const IndirectList<label> nbrPatchRestrictMap
(
nbrRestrictMap,
nbrFaceCells
);
labelList nbrFaceRestrictAddressing;
{
// From face to coarse face
DynamicList<label> dynNbrFaceRestrictAddressing
(
nbrPatchRestrictMap.size()
);
Map<label> masterToCoarseFace(nbrPatchRestrictMap.size());
forAll(nbrPatchRestrictMap, ffi)
{
label curMaster = nbrPatchRestrictMap[ffi];
Map<label>::const_iterator fnd = masterToCoarseFace.find
(
curMaster
);
if (fnd == masterToCoarseFace.end())
{
// New coarse face
label coarseI = masterToCoarseFace.size();
dynNbrFaceRestrictAddressing.append(coarseI);
masterToCoarseFace.insert(curMaster, coarseI);
}
else
{
// Already have coarse face
dynNbrFaceRestrictAddressing.append(fnd());
}
}
nbrFaceRestrictAddressing.transfer
(
dynNbrFaceRestrictAddressing
);
}
amiPtr_.reset
(
new AMIInterpolation
(
fineRegionCoupledLduInterface_.AMI(),
faceRestrictAddressing_,
nbrFaceRestrictAddressing
)
);
}
else
{
FatalErrorInFunction
<< " GAMGAgglomeration was not found in the nbr mesh. "
<< " Check on the cacheAgglomeration flag in fvSolution"
<< exit(FatalError);
}
}
*/
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::regionCoupledBaseGAMGInterface::~regionCoupledBaseGAMGInterface()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::labelField> Foam::regionCoupledBaseGAMGInterface::
internalFieldTransfer
(
const Pstream::commsTypes,
const labelUList& iF
) const
{
/*
// const labelUList& nbrFaceCells = nbrPatch().faceCells();
const labelUList& nbrFaceCells = nbrLduInterface().faceCells();
tmp<labelField> tpnf(new labelField(nbrFaceCells.size()));
labelField& pnf = tpnf();
forAll(pnf, facei)
{
pnf[facei] = iF[nbrFaceCells[facei]];
}
*/
tmp<labelField> tpnf(new labelField(iF));
return tpnf;
}
// ************************************************************************* //

View File

@ -1,169 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 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::regionCoupledBaseGAMGInterface
Description
Base class for GAMG agglomerated coupled region interface.
SourceFiles
regionCoupledBaseGAMGInterface.C
\*---------------------------------------------------------------------------*/
#ifndef regionCoupledBaseGAMGInterface_H
#define regionCoupledBaseGAMGInterface_H
#include "GAMGInterface.H"
#include "regionCoupledLduInterface.H"
#include "GAMGAgglomeration.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class regionCoupledBaseGAMGInterface Declaration
\*---------------------------------------------------------------------------*/
class regionCoupledBaseGAMGInterface
:
public GAMGInterface,
virtual public regionCoupledLduInterface
{
// Private Data
//- Reference for the regionCoupledBaseFvPatch from which this is
// agglomerated
const regionCoupledLduInterface& fineRegionCoupledLduInterface_;
public:
// Constructors
//- Construct from fine level interface,
// local and neighbour restrict addressing
regionCoupledBaseGAMGInterface
(
const label index,
const lduInterfacePtrsList& coarseInterfaces,
const lduInterface& fineInterface,
const labelField& restrictAddressing,
const labelField& neighbourRestrictAddressing,
const label fineLevelIndex,
const label coarseComm
);
//- Disallow default bitwise copy construction
regionCoupledBaseGAMGInterface
(
const regionCoupledBaseGAMGInterface&
) = delete;
//- Destructor
virtual ~regionCoupledBaseGAMGInterface();
// Member Functions
// Interface transfer functions
//- Transfer and return internal field adjacent to the interface
virtual tmp<labelField> internalFieldTransfer
(
const Pstream::commsTypes commsType,
const labelUList& iF
) const;
//- Cyclic interface functions
//- Return neighbour processor number
virtual label nbrPatchID() const
{
return fineRegionCoupledLduInterface_.nbrPatchID();
}
virtual bool owner() const
{
return fineRegionCoupledLduInterface_.owner();
}
virtual const regionCoupledBaseGAMGInterface& nbrPatch() const
{
return dynamic_cast<const regionCoupledBaseGAMGInterface&>
(
fineRegionCoupledLduInterface_.nbrPatch()
);
}
// virtual const AMIInterpolation& AMI() const
//{
// return amiPtr_();
//}
virtual const polyMesh& nbrMesh() const
{
return fineRegionCoupledLduInterface_.nbrMesh();
}
const lduInterface& nbrLduInterface
(
const label fineLevelIndex,
const label index
) const
{
const GAMGAgglomeration& agg = nbrMesh().thisDb().lookupObject
<
GAMGAgglomeration
>
(
GAMGAgglomeration::typeName
);
const lduMesh& mesh = agg.meshLevel(fineLevelIndex);
return mesh.interfaces()[index];
}
// Member Operators
//- Disallow default bitwise assignment
void operator=(const regionCoupledBaseGAMGInterface&) = delete;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,75 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 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/>.
\*---------------------------------------------------------------------------*/
#include "regionCoupledGAMGInterface.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(regionCoupledGAMGInterface, 0);
addToRunTimeSelectionTable
(
GAMGInterface,
regionCoupledGAMGInterface,
lduInterface
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::regionCoupledGAMGInterface::regionCoupledGAMGInterface
(
const label index,
const lduInterfacePtrsList& coarseInterfaces,
const lduInterface& fineInterface,
const labelField& localRestrictAddressing,
const labelField& neighbourRestrictAddressing,
const label fineLevelIndex,
const label coarseComm
)
:
regionCoupledBaseGAMGInterface
(
index,
coarseInterfaces,
fineInterface,
localRestrictAddressing,
neighbourRestrictAddressing,
fineLevelIndex,
coarseComm
)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::regionCoupledGAMGInterface::~regionCoupledGAMGInterface()
{}
// ************************************************************************* //

View File

@ -1,109 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 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::regionCoupledGAMGInterface
Description
GAMG agglomerated coupled region interface.
SourceFiles
regionCoupledGAMGInterface.C
\*---------------------------------------------------------------------------*/
#ifndef regionCoupledGAMGInterface_H
#define regionCoupledGAMGInterface_H
#include "regionCoupledBaseGAMGInterface.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class regionCoupledGAMGInterface Declaration
\*---------------------------------------------------------------------------*/
class regionCoupledGAMGInterface
:
public regionCoupledBaseGAMGInterface
{
public:
//- Runtime type information
TypeName("regionCoupled");
// Constructors
//- Construct from fine level interface,
// local and neighbour restrict addressing
regionCoupledGAMGInterface
(
const label index,
const lduInterfacePtrsList& coarseInterfaces,
const lduInterface& fineInterface,
const labelField& restrictAddressing,
const labelField& neighbourRestrictAddressing,
const label fineLevelIndex,
const label coarseComm
);
//- Disallow default bitwise copy construction
regionCoupledGAMGInterface(const regionCoupledGAMGInterface&) = delete;
//- Destructor
virtual ~regionCoupledGAMGInterface();
// Member Functions
// I/O
//- Write to stream
virtual void write(Ostream&) const
{
// TBD. How to serialise the AMI such that we can stream
// regionCoupledGAMGInterface.
NotImplemented;
}
// Member Operators
//- Disallow default bitwise assignment
void operator=(const regionCoupledGAMGInterface&) = delete;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,75 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 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/>.
\*---------------------------------------------------------------------------*/
#include "regionCoupledWallGAMGInterface.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(regionCoupledWallGAMGInterface, 0);
addToRunTimeSelectionTable
(
GAMGInterface,
regionCoupledWallGAMGInterface,
lduInterface
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::regionCoupledWallGAMGInterface::regionCoupledWallGAMGInterface
(
const label index,
const lduInterfacePtrsList& coarseInterfaces,
const lduInterface& fineInterface,
const labelField& localRestrictAddressing,
const labelField& neighbourRestrictAddressing,
const label fineLevelIndex,
const label coarseComm
)
:
regionCoupledBaseGAMGInterface
(
index,
coarseInterfaces,
fineInterface,
localRestrictAddressing,
neighbourRestrictAddressing,
fineLevelIndex,
coarseComm
)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::regionCoupledWallGAMGInterface::~regionCoupledWallGAMGInterface()
{}
// ************************************************************************* //

View File

@ -1,113 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 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::regionCoupledWallGAMGInterface
Description
GAMG agglomerated coupled region interface.
SourceFiles
regionCoupledWallGAMGInterface.C
\*---------------------------------------------------------------------------*/
#ifndef regionCoupledWallGAMGInterface_H
#define regionCoupledWallGAMGInterface_H
#include "regionCoupledBaseGAMGInterface.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class regionCoupledWallGAMGInterface Declaration
\*---------------------------------------------------------------------------*/
class regionCoupledWallGAMGInterface
:
public regionCoupledBaseGAMGInterface
{
public:
//- Runtime type information
TypeName("regionCoupledWall");
// Constructors
//- Construct from fine level interface,
// local and neighbour restrict addressing
regionCoupledWallGAMGInterface
(
const label index,
const lduInterfacePtrsList& coarseInterfaces,
const lduInterface& fineInterface,
const labelField& restrictAddressing,
const labelField& neighbourRestrictAddressing,
const label fineLevelIndex,
const label coarseComm
);
//- Disallow default bitwise copy construction
regionCoupledWallGAMGInterface
(
const regionCoupledWallGAMGInterface&
) = delete;
//- Destructor
virtual ~regionCoupledWallGAMGInterface();
// Member Functions
// I/O
//- Write to stream
virtual void write(Ostream&) const
{
// TBD. How to serialise the AMI such that we can stream
// regionCoupledWallGAMGInterface.
NotImplemented;
}
// Member Operators
//- Disallow default bitwise assignment
void operator=(const regionCoupledWallGAMGInterface&) = delete;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,40 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 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/>.
\*---------------------------------------------------------------------------*/
#include "regionCoupledLduInterface.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(regionCoupledLduInterface, 0);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::regionCoupledLduInterface::~regionCoupledLduInterface()
{}
// ************************************************************************* //

View File

@ -1,103 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 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::regionCoupledLduInterface
Description
An abstract base class for region coupled interfaces
SourceFiles
regionCoupledLduInterface.C
\*---------------------------------------------------------------------------*/
#ifndef regionCoupledLduInterface_H
#define regionCoupledLduInterface_H
#include "primitiveFieldsFwd.H"
#include "AMIInterpolation.H"
#include "polyMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class regionCoupledLduInterface Declaration
\*---------------------------------------------------------------------------*/
class regionCoupledLduInterface
{
public:
//- Runtime type information
TypeName("regionCoupledLduInterface");
// Constructors
//- Construct null
regionCoupledLduInterface()
{}
//- Destructor
virtual ~regionCoupledLduInterface();
// Member Functions
// Access
//- Return neighbour
virtual label nbrPatchID() const = 0;
//- Is it owner?
virtual bool owner() const = 0;
//- Return neighb regionCoupledLduInterface
virtual const regionCoupledLduInterface& nbrPatch() const = 0;
//- Return AMI
// virtual const AMIInterpolation& AMI() const = 0;
//- Return nbrMesh
virtual const polyMesh& nbrMesh() const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,48 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 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/>.
\*---------------------------------------------------------------------------*/
#include "regionCoupledPointPatch.H"
#include "addToRunTimeSelectionTable.H"
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defineTypeNameAndDebug(regionCoupledPointPatch, 0);
addToRunTimeSelectionTable
(
facePointPatch,
regionCoupledPointPatch,
polyPatch
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -1,84 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 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::regionCoupledPointPatch
Description
Cyclic AMI point patch - place holder only
SourceFiles
regionCoupledPointPatch.C
\*---------------------------------------------------------------------------*/
#ifndef regionCoupledPointPatch_H
#define regionCoupledPointPatch_H
#include "facePointPatch.H"
#include "regionCoupledPolyPatch.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class regionCoupledPointPatch Declaration
\*---------------------------------------------------------------------------*/
class regionCoupledPointPatch
:
public facePointPatch
{
public:
//- Runtime type information
TypeName(regionCoupledPolyPatch::typeName_());
// Constructors
//- Construct from components
regionCoupledPointPatch
(
const polyPatch& patch,
const pointBoundaryMesh& bm
):
facePointPatch(patch, bm)
{}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,48 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 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/>.
\*---------------------------------------------------------------------------*/
#include "regionCoupledWallPointPatch.H"
#include "addToRunTimeSelectionTable.H"
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defineTypeNameAndDebug(regionCoupledWallPointPatch, 0);
addToRunTimeSelectionTable
(
facePointPatch,
regionCoupledWallPointPatch,
polyPatch
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -1,84 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 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::regionCoupledWallPointPatch
Description
Cyclic AMI point patch - place holder only
SourceFiles
regionCoupledWallPointPatch.C
\*---------------------------------------------------------------------------*/
#ifndef regionCoupledWallPointPatch_H
#define regionCoupledWallPointPatch_H
#include "facePointPatch.H"
#include "regionCoupledWallPolyPatch.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class regionCoupledWallPointPatch Declaration
\*---------------------------------------------------------------------------*/
class regionCoupledWallPointPatch
:
public facePointPatch
{
public:
//- Runtime type information
TypeName(regionCoupledWallPolyPatch::typeName_());
// Constructors
//- Construct from components
regionCoupledWallPointPatch
(
const polyPatch& patch,
const pointBoundaryMesh& bm
):
facePointPatch(patch, bm)
{}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,350 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 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/>.
\*---------------------------------------------------------------------------*/
#include "regionCoupledBase.H"
#include "SubField.H"
#include "polyMesh.H"
#include "Time.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(regionCoupledBase, 0);
}
// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
void Foam::regionCoupledBase::resetAMI() const
{
if (owner())
{
AMIPtr_.clear();
const polyPatch& nbr = refCast<const polyPatch>(nbrPatch());
pointField nbrPoints = nbr.localPoints();
if (debug)
{
const Time& t = patch_.boundaryMesh().mesh().time();
OFstream os(t.path()/patch_.name() + "_neighbourPatch-org.obj");
meshTools::writeOBJ(os, nbr.localFaces(), nbrPoints);
}
// transform neighbour patch to local system
// transformPosition(nbrPoints);
primitivePatch nbrPatch0
(
SubList<face>
(
nbr.localFaces(),
nbr.size()
),
nbrPoints
);
if (debug)
{
const Time& t = patch_.boundaryMesh().mesh().time();
OFstream osN(t.path()/patch_.name() + "_neighbourPatch-trans.obj");
meshTools::writeOBJ(osN, nbrPatch0.localFaces(), nbrPoints);
OFstream osO(t.path()/patch_.name() + "_ownerPatch.obj");
meshTools::writeOBJ
(
osO,
patch_.localFaces(),
patch_.localPoints()
);
}
// Construct/apply AMI interpolation to determine addressing and weights
AMIPtr_.reset
(
new AMIInterpolation
(
patch_,
nbrPatch0,
surfPtr(),
faceAreaIntersect::tmMesh,
true,
faceAreaWeightAMI::typeName,
-1,
AMIReverse_
)
);
if (debug)
{
Pout<< "regionCoupledBase : " << patch_.name()
<< " constructed AMI with " << nl
<< " " << ":srcAddress:" << AMIPtr_().srcAddress().size()
<< nl
<< " " << " tgAddress :" << AMIPtr_().tgtAddress().size()
<< nl << endl;
}
}
}
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void Foam::regionCoupledBase::clearGeom()
{
AMIPtr_.clear();
surfPtr_.clear();
}
// * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * * //
Foam::regionCoupledBase::regionCoupledBase
(
const polyPatch& pp
)
:
patch_(pp),
nbrPatchName_(word::null),
nbrPatchID_(-1),
nbrRegionName_(word::null),
sameRegion_(false),
AMIPtr_(nullptr),
AMIReverse_(false),
surfPtr_(nullptr),
surfDict_(fileName("surface"))
{}
Foam::regionCoupledBase::regionCoupledBase
(
const polyPatch& pp,
const dictionary& dict
)
:
patch_(pp),
nbrPatchName_(dict.lookup("neighbourPatch")),
nbrPatchID_(-1),
nbrRegionName_(dict.lookup("neighbourRegion")),
sameRegion_(nbrRegionName_ == patch_.boundaryMesh().mesh().name()),
AMIPtr_(nullptr),
AMIReverse_(dict.lookupOrDefault<bool>("flipNormals", false)),
surfPtr_(nullptr),
surfDict_(dict.subOrEmptyDict("surface"))
{}
Foam::regionCoupledBase::regionCoupledBase
(
const polyPatch& pp,
const regionCoupledBase& mpb
)
:
patch_(pp),
nbrPatchName_(mpb.nbrPatchName_),
nbrPatchID_(mpb.nbrPatchID_),
nbrRegionName_(mpb.nbrRegionName_),
sameRegion_(mpb.sameRegion_),
AMIPtr_(nullptr),
AMIReverse_(mpb.AMIReverse_),
surfPtr_(mpb.surfPtr_),
surfDict_(mpb.surfDict_)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::regionCoupledBase::~regionCoupledBase()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::label Foam::regionCoupledBase::nbrPatchID() const
{
if (nbrPatchID_ == -1)
{
if
(
patch_.boundaryMesh().mesh().time().foundObject<polyMesh>
(
nbrRegionName_
)
)
{
const polyMesh& mesh =
patch_.boundaryMesh().mesh().time().lookupObject<polyMesh>
(
nbrRegionName_
);
nbrPatchID_ = mesh.boundaryMesh().findPatchID(nbrPatchName_);
if (nbrPatchID_ == -1)
{
FatalErrorInFunction
<< "Illegal neighbourPatch name " << nbrPatchName_
<< nl << "Valid patch names are "
<< mesh.boundaryMesh().names()
<< exit(FatalError);
}
// Check that it is a cyclic AMI patch
const regionCoupledBase& nbrPatch =
refCast<const regionCoupledBase>
(
mesh.boundaryMesh()[nbrPatchID_]
);
if (nbrPatch.nbrPatchName() != patch_.name())
{
WarningInFunction
<< "Patch " << patch_.name()
<< " specifies neighbour patch " << nbrPatchName()
<< nl << " but that in return specifies "
<< nbrPatch.nbrPatchName() << endl;
}
}
}
return nbrPatchID_;
}
bool Foam::regionCoupledBase::owner() const
{
if (nbrRegionName_ == patch_.boundaryMesh().mesh().name())
{
return patch_.index() < nbrPatchID();
}
else
{
return patch_.boundaryMesh().mesh().name() < nbrRegionName_;
}
}
const Foam::autoPtr<Foam::searchableSurface>&Foam::regionCoupledBase::
surfPtr() const
{
const word surfType(surfDict_.lookupOrDefault<word>("type", "none"));
if (!surfPtr_.valid() && owner() && surfType != "none")
{
word surfName(surfDict_.lookupOrDefault("name", patch_.name()));
const polyMesh& mesh = patch_.boundaryMesh().mesh();
surfPtr_ =
searchableSurface::New
(
surfType,
IOobject
(
surfName,
mesh.time().constant(),
searchableSurface::geometryDir(mesh.time()),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
surfDict_
);
}
return surfPtr_;
}
const Foam::AMIInterpolation& Foam::regionCoupledBase::AMI() const
{
if (!owner())
{
FatalErrorInFunction
<< "AMI interpolator only available to owner patch"
<< abort(FatalError);
}
if (!AMIPtr_.valid())
{
resetAMI();
}
return AMIPtr_();
}
const Foam::regionCoupledBase&
Foam::regionCoupledBase::nbrPatch() const
{
const polyMesh& mesh =
patch_.boundaryMesh().mesh().time().lookupObject<polyMesh>
(
nbrRegionName_
);
const polyPatch& pp = mesh.boundaryMesh()[nbrPatchID()];
return refCast<const regionCoupledBase>(pp);
}
bool Foam::regionCoupledBase::order
(
PstreamBuffers& pBufs,
const primitivePatch& pp,
labelList& faceMap,
labelList& rotation
) const
{
faceMap.setSize(pp.size());
faceMap = -1;
rotation.setSize(pp.size());
rotation = 0;
return false;
}
void Foam::regionCoupledBase::write(Ostream& os) const
{
writeEntry(os, "neighbourPatch", nbrPatchName_);
writeEntry(os, "neighbourRegion", nbrRegionName_);
if (AMIReverse_)
{
writeEntry(os, "flipNormals", AMIReverse_);
}
if (!surfDict_.empty())
{
writeKeyword(os, surfDict_.dictName());
os << surfDict_;
}
}
// ************************************************************************* //

View File

@ -1,217 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 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::regionCoupledBase
Description
Base class with common functionality for regionCoupled polyPatch.
It includes AMI.
SourceFiles
regionCoupledBase.C
\*---------------------------------------------------------------------------*/
#ifndef regionCoupledBase_H
#define regionCoupledBase_H
#include "AMIInterpolation.H"
#include "polyBoundaryMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class regionCoupledBase Declaration
\*---------------------------------------------------------------------------*/
class regionCoupledBase
{
// Private Data
//- Patch to sample
const polyPatch& patch_;
//- Name of other half
const word nbrPatchName_;
//- Index of other half
mutable label nbrPatchID_;
//- Name of other region
const word nbrRegionName_;
//- Same region
const bool sameRegion_;
//- AMI interpolation class
mutable autoPtr<AMIInterpolation> AMIPtr_;
//- Flag to indicate that slave patch should be reversed for AMI
const bool AMIReverse_;
//- Projection surface
mutable autoPtr<searchableSurface> surfPtr_;
//- Dictionary used during projection surface construction
const dictionary surfDict_;
// Private Member Functions
//- Reset the AMI interpolator
void resetAMI() const;
protected:
//- Clear geometry
virtual void clearGeom();
public:
//- Runtime type information
TypeName("regionCoupledBase");
// Constructors
//- Construct from patch
regionCoupledBase(const polyPatch&);
//- Construct from dictionary
regionCoupledBase(const polyPatch&, const dictionary&);
//- Construct as copy, resetting patch
regionCoupledBase(const polyPatch&, const regionCoupledBase&);
//- Destructor
virtual ~regionCoupledBase();
// Member Functions
// Access
//- Neighbour patch name
const word& nbrPatchName() const
{
return nbrPatchName_;
}
//- Neighbour region name
const word& nbrRegionName() const
{
return nbrRegionName_;
}
//- Cached sampleRegion != mesh.name()
bool sameRegion() const
{
return sameRegion_;
}
//- Neighbour patch ID
label nbrPatchID() const;
//- Does this side own the patch?
bool owner() const;
//- Return a reference to the neighbour patch
const regionCoupledBase& nbrPatch() const;
//- Return a reference to the projection surface
const autoPtr<searchableSurface>& surfPtr() const;
//- Return a reference to the AMI interpolator
const AMIInterpolation& AMI() const;
// Interpolations
//- Interpolate field
template<class Type>
tmp<Field<Type>> interpolate(const Field<Type>& fld) const;
//- Interpolate tmp field
template<class Type>
tmp<Field<Type>> interpolate
(
const tmp<Field<Type>>& tFld
) const;
//- Low-level interpolate List
template<class Type, class BinaryOp>
void interpolate
(
const UList<Type>& fld,
const BinaryOp& bop,
List<Type>& result
) const;
//- Return new ordering for primitivePatch.
// Ordering is -faceMap: for every face
// index of the new face -rotation:for every new face the clockwise
// shift of the original face. Return false if nothing changes
// (faceMap is identity, rotation is 0), true otherwise.
virtual bool order
(
PstreamBuffers&,
const primitivePatch&,
labelList& faceMap,
labelList& rotation
) const;
//- Return the type
virtual const word& regionCoupleType() const = 0;
//- Write the polyPatch data as a dictionary
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "regionCoupledBaseTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,81 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 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/>.
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type>
Foam::tmp<Foam::Field<Type>> Foam::regionCoupledBase::interpolate
(
const Field<Type>& fld
) const
{
if (owner())
{
return AMI().interpolateToSource(fld);
}
else
{
return nbrPatch().AMI().interpolateToTarget(fld);
}
}
template<class Type>
Foam::tmp<Foam::Field<Type>> Foam::regionCoupledBase::interpolate
(
const tmp<Field<Type>>& tFld
) const
{
if (owner())
{
return AMI().interpolateToSource(tFld);
}
else
{
return nbrPatch().AMI().interpolateToTarget(tFld);
}
}
template<class Type, class BinaryOp>
void Foam::regionCoupledBase::interpolate
(
const UList<Type>& fld,
const BinaryOp& bop,
List<Type>& result
) const
{
if (owner())
{
AMI().interpolateToSource(fld, bop, result);
}
else
{
nbrPatch().AMI().interpolateToTarget(fld, bop, result);
}
}
// ************************************************************************* //

View File

@ -1,170 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 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/>.
\*---------------------------------------------------------------------------*/
#include "regionCoupledPolyPatch.H"
#include "polyMesh.H"
#include "Time.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(regionCoupledPolyPatch, 0);
addToRunTimeSelectionTable(polyPatch, regionCoupledPolyPatch, word);
addToRunTimeSelectionTable(polyPatch, regionCoupledPolyPatch, dictionary);
}
// * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * * //
Foam::regionCoupledPolyPatch::regionCoupledPolyPatch
(
const word& name,
const label size,
const label start,
const label index,
const polyBoundaryMesh& bm,
const word& patchType
)
:
polyPatch(name, size, start, index, bm, patchType),
regionCoupledBase(static_cast<const polyPatch&>(*this))
{}
Foam::regionCoupledPolyPatch::regionCoupledPolyPatch
(
const word& name,
const dictionary& dict,
const label index,
const polyBoundaryMesh& bm,
const word& patchType
)
:
polyPatch(name, dict, index, bm, patchType),
regionCoupledBase(*this, dict)
{}
Foam::regionCoupledPolyPatch::regionCoupledPolyPatch
(
const regionCoupledPolyPatch& pp,
const polyBoundaryMesh& bm
)
:
polyPatch(pp, bm),
regionCoupledBase(*this, pp)
{}
Foam::regionCoupledPolyPatch::regionCoupledPolyPatch
(
const regionCoupledPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const label newSize,
const label newStart
)
:
polyPatch(pp, bm, index, newSize, newStart),
regionCoupledBase(*this, pp)
{}
Foam::regionCoupledPolyPatch::regionCoupledPolyPatch
(
const regionCoupledPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
)
:
polyPatch(pp, bm, index, mapAddressing, newStart),
regionCoupledBase(*this, pp)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::regionCoupledPolyPatch::~regionCoupledPolyPatch()
{
regionCoupledBase::clearGeom();
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::regionCoupledPolyPatch::initCalcGeometry(PstreamBuffers& pBufs)
{
polyPatch::initCalcGeometry(pBufs);
}
void Foam::regionCoupledPolyPatch::initMovePoints
(
PstreamBuffers& pBufs,
const pointField& p
)
{
polyPatch::initMovePoints(pBufs, p);
}
void Foam::regionCoupledPolyPatch::movePoints
(
PstreamBuffers& pBufs,
const pointField& p
)
{
polyPatch::movePoints(pBufs, p);
regionCoupledBase::clearGeom();
}
void Foam::regionCoupledPolyPatch::initTopoChange(PstreamBuffers& pBufs)
{
polyPatch::initTopoChange(pBufs);
}
void Foam::regionCoupledPolyPatch::topoChange(PstreamBuffers& pBufs)
{
polyPatch::topoChange(pBufs);
regionCoupledBase::clearGeom();
}
void Foam::regionCoupledPolyPatch::write(Ostream& os) const
{
polyPatch::write(os);
regionCoupledBase::write(os);
}
// ************************************************************************* //

View File

@ -1,223 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 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::regionCoupledPolyPatch
Description
Region coupled polyPatch
SourceFiles
regionCoupledPolyPatch.C
\*---------------------------------------------------------------------------*/
#ifndef regionCoupledPolyPatch_H
#define regionCoupledPolyPatch_H
#include "regionCoupledBase.H"
#include "polyBoundaryMesh.H"
#include "polyPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class regionCoupledPolyPatch Declaration
\*---------------------------------------------------------------------------*/
class regionCoupledPolyPatch
:
public polyPatch,
public regionCoupledBase
{
protected:
// Protected Member Functions
//- Initialise the calculation of the patch geometry
virtual void initCalcGeometry(PstreamBuffers&);
//- Initialise the patches for moving points
virtual void initMovePoints(PstreamBuffers& pBufs, const pointField&);
//- Correct patches after moving points
virtual void movePoints(PstreamBuffers& pBufs, const pointField&);
//- Initialise the update of the patch topology
virtual void initTopoChange(PstreamBuffers&);
//- Update of the patch topology
virtual void topoChange(PstreamBuffers&);
public:
//- Runtime type information
TypeName("regionCoupled");
// Constructors
//- Construct from (base couped patch) components
regionCoupledPolyPatch
(
const word& name,
const label size,
const label start,
const label index,
const polyBoundaryMesh& bm,
const word& patchType
);
//- Construct from dictionary
regionCoupledPolyPatch
(
const word& name,
const dictionary& dict,
const label index,
const polyBoundaryMesh& bm,
const word& patchType
);
//- Construct as copy, resetting the boundary mesh
regionCoupledPolyPatch
(
const regionCoupledPolyPatch&,
const polyBoundaryMesh&
);
//- Construct given the original patch and resetting the
// face list and boundary mesh information
regionCoupledPolyPatch
(
const regionCoupledPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const label newSize,
const label newStart
);
//- Construct given the original patch and a map
regionCoupledPolyPatch
(
const regionCoupledPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
);
//- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{
return autoPtr<polyPatch>(new regionCoupledPolyPatch(*this, bm));
}
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const label newSize,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new regionCoupledPolyPatch
(
*this,
bm,
index,
newSize,
newStart
)
);
}
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new regionCoupledPolyPatch
(
*this,
bm,
index,
mapAddressing,
newStart
)
);
}
//- Destructor
virtual ~regionCoupledPolyPatch();
// Member Functions
// Access
//- Is it coupled?
virtual bool coupled() const
{
return false;
}
//- Return the type
virtual const word& regionCoupleType() const
{
return type();
}
//- Write the polyPatch data as a dictionary
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,180 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 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/>.
\*---------------------------------------------------------------------------*/
#include "regionCoupledWallPolyPatch.H"
#include "addToRunTimeSelectionTable.H"
#include "polyPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(regionCoupledWallPolyPatch, 0);
addToRunTimeSelectionTable(polyPatch, regionCoupledWallPolyPatch, word);
addToRunTimeSelectionTable
(
polyPatch,
regionCoupledWallPolyPatch,
dictionary
);
}
// * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * * * * //
Foam::regionCoupledWallPolyPatch::regionCoupledWallPolyPatch
(
const word& name,
const label size,
const label start,
const label index,
const polyBoundaryMesh& bm,
const word& patchType
)
:
wallPolyPatch(name, size, start, index, bm, patchType),
regionCoupledBase(static_cast<const polyPatch&>(*this))
{}
Foam::regionCoupledWallPolyPatch::regionCoupledWallPolyPatch
(
const word& name,
const dictionary& dict,
const label index,
const polyBoundaryMesh& bm,
const word& patchType
)
:
wallPolyPatch(name, dict, index, bm, patchType),
regionCoupledBase(static_cast<const polyPatch&>(*this), dict)
{}
Foam::regionCoupledWallPolyPatch::regionCoupledWallPolyPatch
(
const regionCoupledWallPolyPatch& pp,
const polyBoundaryMesh& bm
)
:
wallPolyPatch(pp, bm),
regionCoupledBase(*this, pp)
{}
Foam::regionCoupledWallPolyPatch::regionCoupledWallPolyPatch
(
const regionCoupledWallPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const label newSize,
const label newStart
)
:
wallPolyPatch(pp, bm, index, newSize, newStart),
regionCoupledBase(*this, pp)
{}
Foam::regionCoupledWallPolyPatch::regionCoupledWallPolyPatch
(
const regionCoupledWallPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
)
:
wallPolyPatch(pp, bm, index, mapAddressing, newStart),
regionCoupledBase(*this, pp)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::regionCoupledWallPolyPatch::~regionCoupledWallPolyPatch()
{
regionCoupledBase::clearGeom();
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::regionCoupledWallPolyPatch::initCalcGeometry(PstreamBuffers& pBufs)
{
wallPolyPatch::initCalcGeometry(pBufs);
}
void Foam::regionCoupledWallPolyPatch::calcGeometry(PstreamBuffers& pBufs)
{
wallPolyPatch::calcGeometry(pBufs);
regionCoupledBase::clearGeom();
}
void Foam::regionCoupledWallPolyPatch::initMovePoints
(
PstreamBuffers& pBufs,
const pointField& p
)
{
wallPolyPatch::initMovePoints(pBufs, p);
}
void Foam::regionCoupledWallPolyPatch::movePoints
(
PstreamBuffers& pBufs,
const pointField& p
)
{
wallPolyPatch::movePoints(pBufs, p);
regionCoupledBase::clearGeom();
}
void Foam::regionCoupledWallPolyPatch::initTopoChange(PstreamBuffers& pBufs)
{
wallPolyPatch::initTopoChange(pBufs);
}
void Foam::regionCoupledWallPolyPatch::topoChange(PstreamBuffers& pBufs)
{
wallPolyPatch::topoChange(pBufs);
regionCoupledBase::clearGeom();
}
void Foam::regionCoupledWallPolyPatch::write(Ostream& os) const
{
wallPolyPatch::write(os);
regionCoupledBase::write(os);
}
// ************************************************************************* //

View File

@ -1,222 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 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::regionCoupledWallPolyPatch
Description
regionCoupledWall
SourceFiles
regionCoupledWallPolyPatch.C
\*---------------------------------------------------------------------------*/
#ifndef regionCoupledWallPolyPatch_H
#define regionCoupledWallPolyPatch_H
#include "wallPolyPatch.H"
#include "regionCoupledBase.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class polyMesh;
/*---------------------------------------------------------------------------*\
Class regionCoupledWallPolyPatch Declaration
\*---------------------------------------------------------------------------*/
class regionCoupledWallPolyPatch
:
public wallPolyPatch,
public regionCoupledBase
{
protected:
//- Initialise the calculation of the patch geometry
virtual void initCalcGeometry(PstreamBuffers&);
//- Calculate the patch geometry
virtual void calcGeometry(PstreamBuffers&);
//- Initialise the patches for moving points
virtual void initMovePoints(PstreamBuffers&, const pointField&);
//- Correct patches after moving points
virtual void movePoints(PstreamBuffers&, const pointField&);
//- Initialise the update of the patch topology
virtual void initTopoChange(PstreamBuffers&);
//- Update of the patch topology
virtual void topoChange(PstreamBuffers&);
public:
//- Runtime type information
TypeName("regionCoupledWall");
// Constructors
//- Construct from components
regionCoupledWallPolyPatch
(
const word& name,
const label size,
const label start,
const label index,
const polyBoundaryMesh& bm,
const word& patchType
);
//- Construct from dictionary
regionCoupledWallPolyPatch
(
const word& name,
const dictionary& dict,
const label index,
const polyBoundaryMesh& bm,
const word& patchType
);
//- Construct as copy, resetting the boundary mesh
regionCoupledWallPolyPatch
(
const regionCoupledWallPolyPatch&,
const polyBoundaryMesh&
);
//- Construct given the original patch and resetting the
// face list and boundary mesh information
regionCoupledWallPolyPatch
(
const regionCoupledWallPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const label newSize,
const label newStart
);
//- Construct given the original patch and a map
regionCoupledWallPolyPatch
(
const regionCoupledWallPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
);
//- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<wallPolyPatch::polyPatch> clone
(
const polyBoundaryMesh& bm
) const
{
return autoPtr<wallPolyPatch::polyPatch>
(
new regionCoupledWallPolyPatch(*this, bm)
);
}
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<wallPolyPatch::polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const label newSize,
const label newStart
) const
{
return autoPtr<wallPolyPatch::polyPatch>
(
new regionCoupledWallPolyPatch
(
*this,
bm,
index,
newSize,
newStart
)
);
}
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new regionCoupledWallPolyPatch
(
*this,
bm,
index,
mapAddressing,
newStart
)
);
}
//- Destructor
virtual ~regionCoupledWallPolyPatch();
// Member Functions
//- Return the type
virtual const word& regionCoupleType() const
{
return type();
}
//- Write the polyPatch data as a dictionary
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -171,94 +171,6 @@ bool Foam::regionModels::regionModel::read(const dictionary& dict)
}
const Foam::AMIInterpolation&
Foam::regionModels::regionModel::interRegionAMI
(
const regionModel& nbrRegion,
const label regionPatchi,
const label nbrPatchi,
const bool flip
) const
{
label nbrRegionID = findIndex(interRegionAMINames_, nbrRegion.name());
const fvMesh& nbrRegionMesh = nbrRegion.regionMesh();
if (nbrRegionID != -1)
{
if (!interRegionAMI_[nbrRegionID].set(regionPatchi))
{
const polyPatch& p = regionMesh().boundaryMesh()[regionPatchi];
const polyPatch& nbrP = nbrRegionMesh.boundaryMesh()[nbrPatchi];
int oldTag = UPstream::msgType();
UPstream::msgType() = oldTag + 1;
interRegionAMI_[nbrRegionID].set
(
regionPatchi,
new AMIInterpolation
(
p,
nbrP,
faceAreaIntersect::tmMesh,
true,
faceAreaWeightAMI::typeName,
-1,
flip
)
);
UPstream::msgType() = oldTag;
}
return interRegionAMI_[nbrRegionID][regionPatchi];
}
else
{
label nbrRegionID = interRegionAMINames_.size();
interRegionAMINames_.append(nbrRegion.name());
const polyPatch& p = regionMesh().boundaryMesh()[regionPatchi];
const polyPatch& nbrP = nbrRegionMesh.boundaryMesh()[nbrPatchi];
label nPatch = regionMesh().boundaryMesh().size();
interRegionAMI_.resize(nbrRegionID + 1);
interRegionAMI_.set
(
nbrRegionID,
new PtrList<AMIInterpolation>(nPatch)
);
int oldTag = UPstream::msgType();
UPstream::msgType() = oldTag + 1;
interRegionAMI_[nbrRegionID].set
(
regionPatchi,
new AMIInterpolation
(
p,
nbrP,
faceAreaIntersect::tmMesh,
true,
faceAreaWeightAMI::typeName,
-1,
flip
)
);
UPstream::msgType() = oldTag;
return interRegionAMI_[nbrRegionID][regionPatchi];
}
}
Foam::label Foam::regionModels::regionModel::nbrCoupledPatchID
(
const regionModel& nbrRegion,
@ -356,9 +268,7 @@ Foam::regionModels::regionModel::regionModel
primaryPatchIDs_(),
intCoupledPatchIDs_(),
regionName_("none"),
functions_(*this),
interRegionAMINames_(),
interRegionAMI_()
functions_(*this)
{}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -39,7 +39,6 @@ SourceFiles
#include "fvMesh.H"
#include "timeIOdictionary.H"
#include "AMIInterpolation.H"
#include "regionModelFunctionObjectList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -115,15 +114,6 @@ protected:
regionModelFunctionObjectList functions_;
// Inter-region AMI interpolation caching
//- List of region names this region is coupled to
mutable wordList interRegionAMINames_;
//- List of AMI objects per coupled region
mutable PtrList<PtrList<AMIInterpolation>> interRegionAMI_;
// Protected member functions
//- Read control parameters from dictionary
@ -132,15 +122,6 @@ protected:
//- Read control parameters from dictionary
virtual bool read(const dictionary& dict);
//- Create or return a new inter-region AMI object
virtual const AMIInterpolation& interRegionAMI
(
const regionModel& nbrRegion,
const label regionPatchi,
const label nbrPatchi,
const bool flip
) const;
public:
@ -244,38 +225,6 @@ public:
const label regionPatchi
) const;
//- Map patch field from another region model to local patch
template<class Type>
tmp<Foam::Field<Type>> mapRegionPatchField
(
const regionModel& nbrRegion,
const label regionPatchi,
const label nbrPatchi,
const Field<Type>& nbrField,
const bool flip = false
) const;
//- Map patch field from another region model to local patch
template<class Type>
tmp<Field<Type>> mapRegionPatchField
(
const regionModel& nbrRegion,
const word& fieldName,
const label regionPatchi,
const bool flip = false
) const;
//- Map patch internal field from another region model to local
// patch
template<class Type>
tmp<Field<Type>> mapRegionPatchInternalField
(
const regionModel& nbrRegion,
const word& fieldName,
const label regionPatchi,
const bool flip = false
) const;
//- Convert a local region field to the primary region
template<class Type>
void toPrimary

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -27,139 +27,6 @@ License
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class Type>
Foam::tmp<Foam::Field<Type>>
Foam::regionModels::regionModel::mapRegionPatchField
(
const regionModel& nbrRegion,
const label regionPatchi,
const label nbrPatchi,
const Field<Type>& nbrField,
const bool flip
) const
{
int oldTag = UPstream::msgType();
UPstream::msgType() = oldTag + 1;
const AMIInterpolation& ami =
interRegionAMI(nbrRegion, regionPatchi, nbrPatchi, flip);
tmp<Field<Type>> tresult(ami.interpolateToSource(nbrField));
UPstream::msgType() = oldTag;
return tresult;
}
template<class Type>
Foam::tmp<Foam::Field<Type>>
Foam::regionModels::regionModel::mapRegionPatchField
(
const regionModel& nbrRegion,
const word& fieldName,
const label regionPatchi,
const bool flip
) const
{
typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
const fvMesh& nbrRegionMesh = nbrRegion.regionMesh();
if (nbrRegionMesh.foundObject<fieldType>(fieldName))
{
const label nbrPatchi = nbrCoupledPatchID(nbrRegion, regionPatchi);
int oldTag = UPstream::msgType();
UPstream::msgType() = oldTag + 1;
const AMIInterpolation& ami =
interRegionAMI(nbrRegion, regionPatchi, nbrPatchi, flip);
const fieldType& nbrField =
nbrRegionMesh.lookupObject<fieldType>(fieldName);
const Field<Type>& nbrFieldp = nbrField.boundaryField()[nbrPatchi];
tmp<Field<Type>> tresult(ami.interpolateToSource(nbrFieldp));
UPstream::msgType() = oldTag;
return tresult;
}
else
{
const polyPatch& p = regionMesh().boundaryMesh()[regionPatchi];
return
tmp<Field<Type>>
(
new Field<Type>
(
p.size(),
Zero
)
);
}
}
template<class Type>
Foam::tmp<Foam::Field<Type>>
Foam::regionModels::regionModel::mapRegionPatchInternalField
(
const regionModel& nbrRegion,
const word& fieldName,
const label regionPatchi,
const bool flip
) const
{
typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
const fvMesh& nbrRegionMesh = nbrRegion.regionMesh();
if (nbrRegionMesh.foundObject<fieldType>(fieldName))
{
const label nbrPatchi = nbrCoupledPatchID(nbrRegion, regionPatchi);
int oldTag = UPstream::msgType();
UPstream::msgType() = oldTag + 1;
const AMIInterpolation& ami =
interRegionAMI(nbrRegion, regionPatchi, nbrPatchi, flip);
const fieldType& nbrField =
nbrRegionMesh.lookupObject<fieldType>(fieldName);
const fvPatchField<Type>& nbrFieldp =
nbrField.boundaryField()[nbrPatchi];
tmp<Field<Type>> tresult
(
ami.interpolateToSource(nbrFieldp.patchInternalField())
);
UPstream::msgType() = oldTag;
return tresult;
}
else
{
const polyPatch& p = regionMesh().boundaryMesh()[regionPatchi];
return
tmp<Field<Type>>
(
new Field<Type>
(
p.size(),
Zero
)
);
}
}
template<class Type>
void Foam::regionModels::regionModel::toPrimary
(