mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
builds again
This commit is contained in:
@ -335,6 +335,7 @@ $(constraintPolyPatches)/empty/emptyPolyPatch.C
|
||||
$(constraintPolyPatches)/symmetry/symmetryPolyPatch.C
|
||||
$(constraintPolyPatches)/wedge/wedgePolyPatch.C
|
||||
$(constraintPolyPatches)/cyclic/cyclicPolyPatch.C
|
||||
$(constraintPolyPatches)/processorCyclic/processorCyclicPolyPatch.C
|
||||
$(constraintPolyPatches)/processor/processorPolyPatch.C
|
||||
|
||||
derivedPolyPatches = $(polyPatches)/derived
|
||||
@ -446,6 +447,7 @@ $(constraintPointPatches)/symmetry/symmetryPointPatch.C
|
||||
$(constraintPointPatches)/wedge/wedgePointPatch.C
|
||||
$(constraintPointPatches)/cyclic/cyclicPointPatch.C
|
||||
$(constraintPointPatches)/processor/processorPointPatch.C
|
||||
$(constraintPointPatches)/processorCyclic/processorCyclicPointPatch.C
|
||||
|
||||
derivedPointPatches = $(pointPatches)/derived
|
||||
$(derivedPointPatches)/coupled/coupledFacePointPatch.C
|
||||
@ -501,6 +503,7 @@ $(constraintPointPatchFields)/symmetry/symmetryPointPatchFields.C
|
||||
$(constraintPointPatchFields)/wedge/wedgePointPatchFields.C
|
||||
$(constraintPointPatchFields)/cyclic/cyclicPointPatchFields.C
|
||||
$(constraintPointPatchFields)/processor/processorPointPatchFields.C
|
||||
$(constraintPointPatchFields)/processorCyclic/processorCyclicPointPatchFields.C
|
||||
|
||||
derivedPointPatchFields = $(pointPatchFields)/derived
|
||||
$(derivedPointPatchFields)/slip/slipPointPatchFields.C
|
||||
|
||||
@ -132,7 +132,7 @@ public:
|
||||
inline label fcIndex(const label i) const;
|
||||
|
||||
//- Return the reverse circular index, i.e. the previous index
|
||||
// which returns to the last at the begining of the list
|
||||
// which returns to the last at the beginning of the list
|
||||
inline label rcIndex(const label i) const;
|
||||
|
||||
//- Return the binary size in number of characters of the UList
|
||||
@ -151,6 +151,18 @@ public:
|
||||
// This can be used (with caution) when interfacing with C code.
|
||||
inline T* data();
|
||||
|
||||
//- Return the first element of the list.
|
||||
inline T& first();
|
||||
|
||||
//- Return first element of the list.
|
||||
inline const T& first() const;
|
||||
|
||||
//- Return the last element of the list.
|
||||
inline T& last();
|
||||
|
||||
//- Return the last element of the list.
|
||||
inline const T& last() const;
|
||||
|
||||
|
||||
// Check
|
||||
|
||||
@ -184,12 +196,6 @@ public:
|
||||
// an out-of-range element returns false without any ill-effects
|
||||
inline const T& operator[](const label) const;
|
||||
|
||||
//- Return last element of UList.
|
||||
inline T& last();
|
||||
|
||||
//- Return last element of UList.
|
||||
inline const T& last() const;
|
||||
|
||||
//- Allow cast to a const List<T>&
|
||||
inline operator const Foam::List<T>&() const;
|
||||
|
||||
|
||||
@ -114,6 +114,20 @@ inline void Foam::UList<T>::checkIndex(const label i) const
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
inline T& Foam::UList<T>::first()
|
||||
{
|
||||
return this->operator[](0);
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
inline const T& Foam::UList<T>::first() const
|
||||
{
|
||||
return this->operator[](0);
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
inline T& Foam::UList<T>::last()
|
||||
{
|
||||
|
||||
@ -25,7 +25,7 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "processorPointPatchField.H"
|
||||
#include "transformField.H"
|
||||
//#include "transformField.H"
|
||||
#include "processorPolyPatch.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -131,125 +131,7 @@ void processorPointPatchField<Type>::swapAdd(Field<Type>& pField) const
|
||||
|
||||
if (doTransform())
|
||||
{
|
||||
const processorPolyPatch& ppp = procPatch_.procPolyPatch();
|
||||
const labelList& nonGlobalPatchPoints =
|
||||
procPatch_.nonGlobalPatchPoints();
|
||||
|
||||
// Mark patch that transformed point:
|
||||
// -3 : global patch point so handled in different patch
|
||||
// -2 : nonGlobalPatchPoints, initial value
|
||||
// -1 : originating from internal face, no transform necessary
|
||||
// >=0 : originating from coupled patch
|
||||
labelList hasTransformed(ppp.nPoints(), -3);
|
||||
forAll(nonGlobalPatchPoints, i)
|
||||
{
|
||||
hasTransformed[nonGlobalPatchPoints[i]] = -2;
|
||||
}
|
||||
|
||||
forAll(ppp.patchIDs(), subI)
|
||||
{
|
||||
label patchI = ppp.patchIDs()[subI];
|
||||
|
||||
if (patchI == -1)
|
||||
{
|
||||
for
|
||||
(
|
||||
label faceI = ppp.starts()[subI];
|
||||
faceI < ppp.starts()[subI+1];
|
||||
faceI++
|
||||
)
|
||||
{
|
||||
const face& f = ppp.localFaces()[faceI];
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
label pointI = f[fp];
|
||||
|
||||
if (hasTransformed[pointI] == -3)
|
||||
{
|
||||
// special point, handled elsewhere
|
||||
}
|
||||
else if (hasTransformed[pointI] == -2)
|
||||
{
|
||||
// first visit. Just mark.
|
||||
hasTransformed[pointI] = patchI;
|
||||
}
|
||||
else if (hasTransformed[pointI] == patchI)
|
||||
{
|
||||
// already done
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"processorPointPatchField<Type>::"
|
||||
"swapAdd(Field<Type>& pField) const"
|
||||
) << "Point " << pointI
|
||||
<< " on patch " << ppp.name()
|
||||
<< " already transformed by patch "
|
||||
<< hasTransformed[pointI]
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if
|
||||
(
|
||||
!refCast<const coupledPolyPatch>
|
||||
(
|
||||
ppp.boundaryMesh()[patchI]
|
||||
).parallel()
|
||||
)
|
||||
{
|
||||
const tensor& T = refCast<const coupledPolyPatch>
|
||||
(
|
||||
ppp.boundaryMesh()[patchI]
|
||||
).forwardT();
|
||||
|
||||
for
|
||||
(
|
||||
label faceI = ppp.starts()[subI];
|
||||
faceI < ppp.starts()[subI+1];
|
||||
faceI++
|
||||
)
|
||||
{
|
||||
const face& f = ppp.localFaces()[faceI];
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
label pointI = f[fp];
|
||||
|
||||
if (hasTransformed[pointI] == -3)
|
||||
{
|
||||
// special point, handled elsewhere
|
||||
}
|
||||
else if (hasTransformed[pointI] == -2)
|
||||
{
|
||||
pnf[pointI] = transform(T, pnf[pointI]);
|
||||
|
||||
hasTransformed[pointI] = patchI;
|
||||
}
|
||||
else if (hasTransformed[pointI] == patchI)
|
||||
{
|
||||
// already done
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"processorPointPatchField<Type>::"
|
||||
"swapAdd(Field<Type>& pField) const"
|
||||
) << "Point " << pointI
|
||||
<< " on patch " << ppp.name()
|
||||
<< " subPatch " << patchI
|
||||
<< " already transformed by patch "
|
||||
<< hasTransformed[pointI]
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
procPatch_.procPolyPatch().transform(pnf);
|
||||
}
|
||||
|
||||
addToInternalField(pField, pnf);
|
||||
|
||||
@ -149,13 +149,13 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
//- Does the patch field perform the transfromation
|
||||
//- Does the patch field perform the transformation
|
||||
virtual bool doTransform() const
|
||||
{
|
||||
return
|
||||
!(
|
||||
pTraits<Type>::rank == 0
|
||||
|| procPatch_.procPolyPatch().parallel()
|
||||
|| procPatch_.procPolyPatch().doTransform()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,267 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ 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 2 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "processorCyclicPointPatchField.H"
|
||||
#include "transformField.H"
|
||||
#include "processorPolyPatch.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
processorCyclicPointPatchField<Type>::processorCyclicPointPatchField
|
||||
(
|
||||
const pointPatch& p,
|
||||
const DimensionedField<Type, pointMesh>& iF
|
||||
)
|
||||
:
|
||||
coupledPointPatchField<Type>(p, iF),
|
||||
procPatch_(refCast<const processorCyclicPointPatch>(p))
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
processorCyclicPointPatchField<Type>::processorCyclicPointPatchField
|
||||
(
|
||||
const pointPatch& p,
|
||||
const DimensionedField<Type, pointMesh>& iF,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
coupledPointPatchField<Type>(p, iF, dict),
|
||||
procPatch_(refCast<const processorCyclicPointPatch>(p))
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
processorCyclicPointPatchField<Type>::processorCyclicPointPatchField
|
||||
(
|
||||
const processorCyclicPointPatchField<Type>& ptf,
|
||||
const pointPatch& p,
|
||||
const DimensionedField<Type, pointMesh>& iF,
|
||||
const pointPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
coupledPointPatchField<Type>(ptf, p, iF, mapper),
|
||||
procPatch_(refCast<const processorCyclicPointPatch>(ptf.patch()))
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
processorCyclicPointPatchField<Type>::processorCyclicPointPatchField
|
||||
(
|
||||
const processorCyclicPointPatchField<Type>& ptf,
|
||||
const DimensionedField<Type, pointMesh>& iF
|
||||
)
|
||||
:
|
||||
coupledPointPatchField<Type>(ptf, iF),
|
||||
procPatch_(refCast<const processorCyclicPointPatch>(ptf.patch()))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
processorCyclicPointPatchField<Type>::~processorCyclicPointPatchField()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
void processorCyclicPointPatchField<Type>::initSwapAdd(Field<Type>& pField)
|
||||
const
|
||||
{
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
// Get internal field into my point order
|
||||
Field<Type> pf(this->patchInternalField(pField));
|
||||
|
||||
OPstream::write
|
||||
(
|
||||
Pstream::blocking,
|
||||
procPatch_.neighbProcNo(),
|
||||
reinterpret_cast<const char*>(pf.begin()),
|
||||
pf.byteSize()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void processorCyclicPointPatchField<Type>::swapAdd(Field<Type>& pField) const
|
||||
{
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
Field<Type> pnf(this->size());
|
||||
|
||||
IPstream::read
|
||||
(
|
||||
Pstream::blocking,
|
||||
procPatch_.neighbProcNo(),
|
||||
reinterpret_cast<char*>(pnf.begin()),
|
||||
pnf.byteSize()
|
||||
);
|
||||
|
||||
if (doTransform())
|
||||
{
|
||||
procPatch_.procPolyPatch().transform(pnf);
|
||||
|
||||
//const processorPolyPatch& ppp = procPatch_.procPolyPatch();
|
||||
//const labelList& nonGlobalPatchPoints =
|
||||
// procPatch_.nonGlobalPatchPoints();
|
||||
//
|
||||
//// Mark patch that transformed point:
|
||||
//// -3 : global patch point so handled in different patch
|
||||
//// -2 : nonGlobalPatchPoints, initial value
|
||||
//// -1 : originating from internal face, no transform necessary
|
||||
//// >=0 : originating from coupled patch
|
||||
//labelList hasTransformed(ppp.nPoints(), -3);
|
||||
//forAll(nonGlobalPatchPoints, i)
|
||||
//{
|
||||
// hasTransformed[nonGlobalPatchPoints[i]] = -2;
|
||||
//}
|
||||
//
|
||||
//forAll(ppp.patchIDs(), subI)
|
||||
//{
|
||||
// label patchI = ppp.patchIDs()[subI];
|
||||
//
|
||||
// if (patchI == -1)
|
||||
// {
|
||||
// for
|
||||
// (
|
||||
// label faceI = ppp.starts()[subI];
|
||||
// faceI < ppp.starts()[subI+1];
|
||||
// faceI++
|
||||
// )
|
||||
// {
|
||||
// const face& f = ppp.localFaces()[faceI];
|
||||
//
|
||||
// forAll(f, fp)
|
||||
// {
|
||||
// label pointI = f[fp];
|
||||
//
|
||||
// if (hasTransformed[pointI] == -3)
|
||||
// {
|
||||
// // special point, handled elsewhere
|
||||
// }
|
||||
// else if (hasTransformed[pointI] == -2)
|
||||
// {
|
||||
// // first visit. Just mark.
|
||||
// hasTransformed[pointI] = patchI;
|
||||
// }
|
||||
// else if (hasTransformed[pointI] == patchI)
|
||||
// {
|
||||
// // already done
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// FatalErrorIn
|
||||
// (
|
||||
// "processorCyclicPointPatchField<Type>::"
|
||||
// "swapAdd(Field<Type>& pField) const"
|
||||
// ) << "Point " << pointI
|
||||
// << " on patch " << ppp.name()
|
||||
// << " already transformed by patch "
|
||||
// << hasTransformed[pointI]
|
||||
// << abort(FatalError);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// else if
|
||||
// (
|
||||
// !refCast<const coupledPolyPatch>
|
||||
// (
|
||||
// ppp.boundaryMesh()[patchI]
|
||||
// ).parallel()
|
||||
// )
|
||||
// {
|
||||
// const tensor& T = refCast<const coupledPolyPatch>
|
||||
// (
|
||||
// ppp.boundaryMesh()[patchI]
|
||||
// ).forwardT();
|
||||
//
|
||||
// for
|
||||
// (
|
||||
// label faceI = ppp.starts()[subI];
|
||||
// faceI < ppp.starts()[subI+1];
|
||||
// faceI++
|
||||
// )
|
||||
// {
|
||||
// const face& f = ppp.localFaces()[faceI];
|
||||
//
|
||||
// forAll(f, fp)
|
||||
// {
|
||||
// label pointI = f[fp];
|
||||
//
|
||||
// if (hasTransformed[pointI] == -3)
|
||||
// {
|
||||
// // special point, handled elsewhere
|
||||
// }
|
||||
// else if (hasTransformed[pointI] == -2)
|
||||
// {
|
||||
// pnf[pointI] = transform(T, pnf[pointI]);
|
||||
//
|
||||
// hasTransformed[pointI] = patchI;
|
||||
// }
|
||||
// else if (hasTransformed[pointI] == patchI)
|
||||
// {
|
||||
// // already done
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// FatalErrorIn
|
||||
// (
|
||||
// "processorCyclicPointPatchField<Type>::"
|
||||
// "swapAdd(Field<Type>& pField) const"
|
||||
// ) << "Point " << pointI
|
||||
// << " on patch " << ppp.name()
|
||||
// << " subPatch " << patchI
|
||||
// << " already transformed by patch "
|
||||
// << hasTransformed[pointI]
|
||||
// << abort(FatalError);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
addToInternalField(pField, pnf);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,194 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ 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 2 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::processorCyclicPointPatchField
|
||||
|
||||
Description
|
||||
Foam::processorCyclicPointPatchField
|
||||
|
||||
SourceFiles
|
||||
processorCyclicPointPatchField.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef processorCyclicPointPatchField_H
|
||||
#define processorCyclicPointPatchField_H
|
||||
|
||||
#include "coupledPointPatchField.H"
|
||||
#include "processorCyclicPointPatch.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class processorCyclicPointPatchField Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class Type>
|
||||
class processorCyclicPointPatchField
|
||||
:
|
||||
public coupledPointPatchField<Type>
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Local reference to processor patch
|
||||
const processorCyclicPointPatch& procPatch_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName(processorCyclicPointPatch::typeName_());
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from patch and internal field
|
||||
processorCyclicPointPatchField
|
||||
(
|
||||
const pointPatch&,
|
||||
const DimensionedField<Type, pointMesh>&
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
processorCyclicPointPatchField
|
||||
(
|
||||
const pointPatch&,
|
||||
const DimensionedField<Type, pointMesh>&,
|
||||
const dictionary&
|
||||
);
|
||||
|
||||
//- Construct by mapping given patchField<Type> onto a new patch
|
||||
processorCyclicPointPatchField
|
||||
(
|
||||
const processorCyclicPointPatchField<Type>&,
|
||||
const pointPatch&,
|
||||
const DimensionedField<Type, pointMesh>&,
|
||||
const pointPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Construct and return a clone
|
||||
virtual autoPtr<pointPatchField<Type> > clone() const
|
||||
{
|
||||
return autoPtr<pointPatchField<Type> >
|
||||
(
|
||||
new processorCyclicPointPatchField<Type>
|
||||
(
|
||||
*this
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
//- Construct as copy setting internal field reference
|
||||
processorCyclicPointPatchField
|
||||
(
|
||||
const processorCyclicPointPatchField<Type>&,
|
||||
const DimensionedField<Type, pointMesh>&
|
||||
);
|
||||
|
||||
//- Construct and return a clone setting internal field reference
|
||||
virtual autoPtr<pointPatchField<Type> > clone
|
||||
(
|
||||
const DimensionedField<Type, pointMesh>& iF
|
||||
) const
|
||||
{
|
||||
return autoPtr<pointPatchField<Type> >
|
||||
(
|
||||
new processorCyclicPointPatchField<Type>
|
||||
(
|
||||
*this,
|
||||
iF
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
~processorCyclicPointPatchField();
|
||||
|
||||
|
||||
// Member functions
|
||||
|
||||
// Access
|
||||
|
||||
//- Return true if running parallel
|
||||
virtual bool coupled() const
|
||||
{
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//- Does the patch field perform the transfromation
|
||||
virtual bool doTransform() const
|
||||
{
|
||||
return
|
||||
!(
|
||||
pTraits<Type>::rank == 0
|
||||
|| procPatch_.procPolyPatch().parallel()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Evaluation functions
|
||||
|
||||
//- Evaluate the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::blocking
|
||||
)
|
||||
{}
|
||||
|
||||
//- Initialise swap of patch point values
|
||||
virtual void initSwapAdd(Field<Type>&) const;
|
||||
|
||||
//- Complete swap of patch point values and add to local values
|
||||
virtual void swapAdd(Field<Type>&) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "processorCyclicPointPatchField.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,44 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ 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 2 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "processorCyclicPointPatchFields.H"
|
||||
#include "pointPatchFields.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
makePointPatchFields(processorCyclic);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,50 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ 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 2 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef processorCyclicPointPatchFields_H
|
||||
#define processorCyclicPointPatchFields_H
|
||||
|
||||
#include "processorCyclicPointPatchField.H"
|
||||
#include "fieldTypes.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makePointPatchFieldTypedefs(processorCyclic);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -36,6 +36,18 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
void Foam::processorLduInterface::resizeBuf
|
||||
(
|
||||
List<char>& buf,
|
||||
const label size
|
||||
) const
|
||||
{
|
||||
if (buf.size() < size)
|
||||
{
|
||||
buf.setSize(size);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -61,6 +61,9 @@ class processorLduInterface
|
||||
// Only sized and used when compressed or non-blocking comms used.
|
||||
mutable List<char> receiveBuf_;
|
||||
|
||||
//- Resize the buffer if required
|
||||
void resizeBuf(List<char>& buf, const label size) const;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -89,17 +92,20 @@ public:
|
||||
//- Return neigbour processor number
|
||||
virtual int neighbProcNo() const = 0;
|
||||
|
||||
//- Set send buffer to sufficient size to hold List<Type>(nElems).
|
||||
// Returns reference to buffer (note:buffer.size() is number
|
||||
// of characters, not nElems)
|
||||
template<class Type>
|
||||
List<Type>& setSendBuf(const label nElems) const;
|
||||
//- Return face transformation tensor
|
||||
virtual const tensor& forwardT() const = 0;
|
||||
|
||||
//- Set receive buffer to sufficient size to hold List<Type>(nElems)
|
||||
// Returns reference to buffer (note:buffer.size() is number
|
||||
// of characters, not nElems)
|
||||
template<class Type>
|
||||
List<Type>& setReceiveBuf(const label nElems) const;
|
||||
// //- Set send buffer to sufficient size to hold List<Type>(nElems).
|
||||
// // Returns reference to buffer (note:buffer.size() is number
|
||||
// // of characters, not nElems)
|
||||
// template<class Type>
|
||||
// List<Type>& setSendBuf(const label nElems) const;
|
||||
//
|
||||
// //- Set receive buffer to sufficient size to hold List<Type>(nElems)
|
||||
// // Returns reference to buffer (note:buffer.size() is number
|
||||
// // of characters, not nElems)
|
||||
// template<class Type>
|
||||
// List<Type>& setReceiveBuf(const label nElems) const;
|
||||
|
||||
|
||||
// Transfer functions
|
||||
@ -154,24 +160,24 @@ public:
|
||||
) const;
|
||||
|
||||
|
||||
//- Raw field send function of internal send buffer with data
|
||||
// compression.
|
||||
template<class Type>
|
||||
void compressedBufferSend
|
||||
(
|
||||
const Pstream::commsTypes commsType
|
||||
) const;
|
||||
|
||||
//- Raw field receive function of internal receive buffer with data
|
||||
// compression.
|
||||
// Returns reference to buffer (note:buffer.size() is number
|
||||
// of characters, not size)
|
||||
template<class Type>
|
||||
const List<Type>& compressedBufferReceive
|
||||
(
|
||||
const Pstream::commsTypes commsType,
|
||||
const label size
|
||||
) const;
|
||||
// //- Raw field send function of internal send buffer with data
|
||||
// // compression.
|
||||
// template<class Type>
|
||||
// void compressedBufferSend
|
||||
// (
|
||||
// const Pstream::commsTypes commsType
|
||||
// ) const;
|
||||
//
|
||||
// //- Raw field receive function of internal receive buffer with data
|
||||
// // compression.
|
||||
// // Returns reference to buffer (note:buffer.size() is number
|
||||
// // of characters, not size)
|
||||
// template<class Type>
|
||||
// const List<Type>& compressedBufferReceive
|
||||
// (
|
||||
// const Pstream::commsTypes commsType,
|
||||
// const label size
|
||||
// ) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -30,47 +30,47 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::List<Type>& Foam::processorLduInterface::setSendBuf(const label nElems)
|
||||
const
|
||||
{
|
||||
if (!contiguous<Type>())
|
||||
{
|
||||
FatalErrorIn("processorLduInterface::setSendBuf(const label) const")
|
||||
<< "Cannot return the binary size of a list of "
|
||||
"non-primitive elements"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
label nBytes = nElems*sizeof(Type);
|
||||
sendBuf_.setSize(nBytes);
|
||||
|
||||
return reinterpret_cast<List<Type>&>(sendBuf_);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::List<Type>& Foam::processorLduInterface::setReceiveBuf
|
||||
(
|
||||
const label nElems
|
||||
) const
|
||||
{
|
||||
if (!contiguous<Type>())
|
||||
{
|
||||
FatalErrorIn("processorLduInterface::setReceiveBuf(const label) const")
|
||||
<< "Cannot return the binary size of a list of "
|
||||
"non-primitive elements"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
label nBytes = nElems*sizeof(Type);
|
||||
|
||||
//receiveBuf_.setSize(nBytes, '\0'); // necessary because of expanding
|
||||
// compression?
|
||||
receiveBuf_.setSize(nBytes);
|
||||
|
||||
return reinterpret_cast<List<Type>&>(receiveBuf_);
|
||||
}
|
||||
// template<class Type>
|
||||
// Foam::List<Type>& Foam::processorLduInterface::setSendBuf(const label nElems)
|
||||
// const
|
||||
// {
|
||||
// if (!contiguous<Type>())
|
||||
// {
|
||||
// FatalErrorIn("processorLduInterface::setSendBuf(const label) const")
|
||||
// << "Cannot return the binary size of a list of "
|
||||
// "non-primitive elements"
|
||||
// << abort(FatalError);
|
||||
// }
|
||||
//
|
||||
// label nBytes = nElems*sizeof(Type);
|
||||
// sendBuf_.setSize(nBytes);
|
||||
//
|
||||
// return reinterpret_cast<List<Type>&>(sendBuf_);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// template<class Type>
|
||||
// Foam::List<Type>& Foam::processorLduInterface::setReceiveBuf
|
||||
// (
|
||||
// const label nElems
|
||||
// ) const
|
||||
// {
|
||||
// if (!contiguous<Type>())
|
||||
// {
|
||||
// FatalErrorIn("processorLduInterface::setReceiveBuf(const label) const")
|
||||
// << "Cannot return the binary size of a list of "
|
||||
// "non-primitive elements"
|
||||
// << abort(FatalError);
|
||||
// }
|
||||
//
|
||||
// label nBytes = nElems*sizeof(Type);
|
||||
//
|
||||
// //receiveBuf_.setSize(nBytes, '\0'); // necessary because of expanding
|
||||
// // compression?
|
||||
// receiveBuf_.setSize(nBytes);
|
||||
//
|
||||
// return reinterpret_cast<List<Type>&>(receiveBuf_);
|
||||
// }
|
||||
|
||||
|
||||
template<class Type>
|
||||
@ -92,17 +92,19 @@ void Foam::processorLduInterface::send
|
||||
}
|
||||
else if (commsType == Pstream::nonBlocking)
|
||||
{
|
||||
setReceiveBuf<Type>(f.size());
|
||||
//setReceiveBuf<Type>(f.size());
|
||||
resizeBuf(receiveBuf_, f.size()*sizeof(Type));
|
||||
|
||||
IPstream::read
|
||||
(
|
||||
commsType,
|
||||
neighbProcNo(),
|
||||
receiveBuf_.begin(),
|
||||
f.byteSize()
|
||||
receiveBuf_.size()
|
||||
);
|
||||
|
||||
setSendBuf<Type>(f.size());
|
||||
//setSendBuf<Type>(f.size());
|
||||
resizeBuf(sendBuf_, f.byteSize());
|
||||
memcpy(sendBuf_.begin(), f.begin(), f.byteSize());
|
||||
|
||||
OPstream::write
|
||||
@ -182,7 +184,8 @@ void Foam::processorLduInterface::compressedSend
|
||||
|
||||
const scalar *sArray = reinterpret_cast<const scalar*>(f.begin());
|
||||
const scalar *slast = &sArray[nm1];
|
||||
setSendBuf<float>(nFloats);
|
||||
//setSendBuf<float>(nFloats);
|
||||
resizeBuf(sendBuf_, nBytes);
|
||||
float *fArray = reinterpret_cast<float*>(sendBuf_.begin());
|
||||
|
||||
for (register label i=0; i<nm1; i++)
|
||||
@ -204,7 +207,8 @@ void Foam::processorLduInterface::compressedSend
|
||||
}
|
||||
else if (commsType == Pstream::nonBlocking)
|
||||
{
|
||||
setReceiveBuf<float>(nFloats);
|
||||
//setReceiveBuf<float>(nFloats);
|
||||
resizeBuf(receiveBuf_, nBytes);
|
||||
|
||||
IPstream::read
|
||||
(
|
||||
@ -235,7 +239,6 @@ void Foam::processorLduInterface::compressedSend
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::processorLduInterface::compressedReceive
|
||||
(
|
||||
@ -249,17 +252,19 @@ void Foam::processorLduInterface::compressedReceive
|
||||
label nm1 = (f.size() - 1)*nCmpts;
|
||||
label nlast = sizeof(Type)/sizeof(float);
|
||||
label nFloats = nm1 + nlast;
|
||||
label nBytes = nFloats*sizeof(float);
|
||||
|
||||
if (commsType == Pstream::blocking || commsType == Pstream::scheduled)
|
||||
{
|
||||
setReceiveBuf<float>(nFloats);
|
||||
//setReceiveBuf<float>(nFloats);
|
||||
resizeBuf(receiveBuf_, nBytes);
|
||||
|
||||
IPstream::read
|
||||
(
|
||||
commsType,
|
||||
neighbProcNo(),
|
||||
receiveBuf_.begin(),
|
||||
receiveBuf_.size()
|
||||
nBytes
|
||||
);
|
||||
}
|
||||
else if (commsType != Pstream::nonBlocking)
|
||||
@ -286,7 +291,6 @@ void Foam::processorLduInterface::compressedReceive
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> > Foam::processorLduInterface::compressedReceive
|
||||
(
|
||||
@ -300,155 +304,155 @@ Foam::tmp<Foam::Field<Type> > Foam::processorLduInterface::compressedReceive
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::processorLduInterface::compressedBufferSend
|
||||
(
|
||||
const Pstream::commsTypes commsType
|
||||
) const
|
||||
{
|
||||
// Optionally inline compress sendBuf
|
||||
if
|
||||
(
|
||||
sizeof(scalar) > sizeof(float)
|
||||
&& sendBuf_.size()
|
||||
&& Pstream::floatTransfer
|
||||
)
|
||||
{
|
||||
const List<Type>& f = reinterpret_cast<const List<Type>&>(sendBuf_);
|
||||
label fSize = f.size()/sizeof(Type);
|
||||
|
||||
// Inplace compress
|
||||
static const label nCmpts = sizeof(Type)/sizeof(scalar);
|
||||
label nm1 = (fSize - 1)*nCmpts;
|
||||
label nlast = sizeof(Type)/sizeof(float);
|
||||
label nFloats = nm1 + nlast;
|
||||
|
||||
const scalar *sArray = reinterpret_cast<const scalar*>(f.begin());
|
||||
const scalar *slast = &sArray[nm1];
|
||||
float *fArray = reinterpret_cast<float*>(sendBuf_.begin());
|
||||
|
||||
for (register label i=0; i<nm1; i++)
|
||||
{
|
||||
fArray[i] = sArray[i] - slast[i%nCmpts];
|
||||
}
|
||||
|
||||
reinterpret_cast<Type&>(fArray[nm1]) = f[fSize - 1];
|
||||
|
||||
// Trim
|
||||
setSendBuf<float>(nFloats);
|
||||
}
|
||||
|
||||
// Send sendBuf
|
||||
if (commsType == Pstream::blocking || commsType == Pstream::scheduled)
|
||||
{
|
||||
OPstream::write
|
||||
(
|
||||
commsType,
|
||||
neighbProcNo(),
|
||||
sendBuf_.begin(),
|
||||
sendBuf_.size()
|
||||
);
|
||||
}
|
||||
else if (commsType == Pstream::nonBlocking)
|
||||
{
|
||||
setReceiveBuf<char>(sendBuf_.size());
|
||||
|
||||
IPstream::read
|
||||
(
|
||||
commsType,
|
||||
neighbProcNo(),
|
||||
receiveBuf_.begin(),
|
||||
receiveBuf_.size()
|
||||
);
|
||||
|
||||
OPstream::write
|
||||
(
|
||||
commsType,
|
||||
neighbProcNo(),
|
||||
sendBuf_.begin(),
|
||||
sendBuf_.size()
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn("processorLduInterface::compressedBufferSend")
|
||||
<< "Unsupported communications type " << commsType
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
const Foam::List<Type>& Foam::processorLduInterface::compressedBufferReceive
|
||||
(
|
||||
const Pstream::commsTypes commsType,
|
||||
const label size
|
||||
) const
|
||||
{
|
||||
if (sizeof(scalar) > sizeof(float) && size && Pstream::floatTransfer)
|
||||
{
|
||||
static const label nCmpts = sizeof(Type)/sizeof(scalar);
|
||||
label nm1 = (size - 1)*nCmpts;
|
||||
label nlast = sizeof(Type)/sizeof(float);
|
||||
label nFloats = nm1 + nlast;
|
||||
|
||||
if (commsType == Pstream::blocking || commsType == Pstream::scheduled)
|
||||
{
|
||||
setReceiveBuf<float>(nFloats);
|
||||
|
||||
IPstream::read
|
||||
(
|
||||
commsType,
|
||||
neighbProcNo(),
|
||||
receiveBuf_.begin(),
|
||||
receiveBuf_.size()
|
||||
);
|
||||
}
|
||||
else if (commsType != Pstream::nonBlocking)
|
||||
{
|
||||
FatalErrorIn("processorLduInterface::compressedBufferReceive")
|
||||
<< "Unsupported communications type " << commsType
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
// Inline expand
|
||||
List<Type>& f = setReceiveBuf<Type>(size);
|
||||
label fSize = f.size()/sizeof(Type);
|
||||
|
||||
const float *fArray =
|
||||
reinterpret_cast<const float*>(receiveBuf_.begin());
|
||||
f[fSize - 1] = reinterpret_cast<const Type&>(fArray[nm1]);
|
||||
scalar *sArray = reinterpret_cast<scalar*>(f.begin());
|
||||
const scalar *slast = &sArray[nm1];
|
||||
|
||||
for (register label i=0; i<nm1; i++)
|
||||
{
|
||||
sArray[i] = fArray[i] + slast[i%nCmpts];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (commsType == Pstream::blocking || commsType == Pstream::scheduled)
|
||||
{
|
||||
setReceiveBuf<Type>(size);
|
||||
|
||||
IPstream::read
|
||||
(
|
||||
commsType,
|
||||
neighbProcNo(),
|
||||
receiveBuf_.begin(),
|
||||
receiveBuf_.size()
|
||||
);
|
||||
}
|
||||
else if (commsType != Pstream::nonBlocking)
|
||||
{
|
||||
FatalErrorIn("processorLduInterface::compressedBufferReceive")
|
||||
<< "Unsupported communications type " << commsType
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
return reinterpret_cast<List<Type>&>(receiveBuf_);
|
||||
}
|
||||
// template<class Type>
|
||||
// void Foam::processorLduInterface::compressedBufferSend
|
||||
// (
|
||||
// const Pstream::commsTypes commsType
|
||||
// ) const
|
||||
// {
|
||||
// // Optionally inline compress sendBuf
|
||||
// if
|
||||
// (
|
||||
// sizeof(scalar) > sizeof(float)
|
||||
// && sendBuf_.size()
|
||||
// && Pstream::floatTransfer
|
||||
// )
|
||||
// {
|
||||
// const List<Type>& f = reinterpret_cast<const List<Type>&>(sendBuf_);
|
||||
// label fSize = f.size()/sizeof(Type);
|
||||
//
|
||||
// // Inplace compress
|
||||
// static const label nCmpts = sizeof(Type)/sizeof(scalar);
|
||||
// label nm1 = (fSize - 1)*nCmpts;
|
||||
// label nlast = sizeof(Type)/sizeof(float);
|
||||
// label nFloats = nm1 + nlast;
|
||||
//
|
||||
// const scalar *sArray = reinterpret_cast<const scalar*>(f.begin());
|
||||
// const scalar *slast = &sArray[nm1];
|
||||
// float *fArray = reinterpret_cast<float*>(sendBuf_.begin());
|
||||
//
|
||||
// for (register label i=0; i<nm1; i++)
|
||||
// {
|
||||
// fArray[i] = sArray[i] - slast[i%nCmpts];
|
||||
// }
|
||||
//
|
||||
// reinterpret_cast<Type&>(fArray[nm1]) = f[fSize - 1];
|
||||
//
|
||||
// // Trim
|
||||
// setSendBuf<float>(nFloats);
|
||||
// }
|
||||
//
|
||||
// // Send sendBuf
|
||||
// if (commsType == Pstream::blocking || commsType == Pstream::scheduled)
|
||||
// {
|
||||
// OPstream::write
|
||||
// (
|
||||
// commsType,
|
||||
// neighbProcNo(),
|
||||
// sendBuf_.begin(),
|
||||
// sendBuf_.size()
|
||||
// );
|
||||
// }
|
||||
// else if (commsType == Pstream::nonBlocking)
|
||||
// {
|
||||
// setReceiveBuf<char>(sendBuf_.size());
|
||||
//
|
||||
// IPstream::read
|
||||
// (
|
||||
// commsType,
|
||||
// neighbProcNo(),
|
||||
// receiveBuf_.begin(),
|
||||
// receiveBuf_.size()
|
||||
// );
|
||||
//
|
||||
// OPstream::write
|
||||
// (
|
||||
// commsType,
|
||||
// neighbProcNo(),
|
||||
// sendBuf_.begin(),
|
||||
// sendBuf_.size()
|
||||
// );
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// FatalErrorIn("processorLduInterface::compressedBufferSend")
|
||||
// << "Unsupported communications type " << commsType
|
||||
// << exit(FatalError);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
// template<class Type>
|
||||
// const Foam::List<Type>& Foam::processorLduInterface::compressedBufferReceive
|
||||
// (
|
||||
// const Pstream::commsTypes commsType,
|
||||
// const label size
|
||||
// ) const
|
||||
// {
|
||||
// if (sizeof(scalar) > sizeof(float) && size && Pstream::floatTransfer)
|
||||
// {
|
||||
// static const label nCmpts = sizeof(Type)/sizeof(scalar);
|
||||
// label nm1 = (size - 1)*nCmpts;
|
||||
// label nlast = sizeof(Type)/sizeof(float);
|
||||
// label nFloats = nm1 + nlast;
|
||||
//
|
||||
// if (commsType == Pstream::blocking || commsType == Pstream::scheduled)
|
||||
// {
|
||||
// setReceiveBuf<float>(nFloats);
|
||||
//
|
||||
// IPstream::read
|
||||
// (
|
||||
// commsType,
|
||||
// neighbProcNo(),
|
||||
// receiveBuf_.begin(),
|
||||
// receiveBuf_.size()
|
||||
// );
|
||||
// }
|
||||
// else if (commsType != Pstream::nonBlocking)
|
||||
// {
|
||||
// FatalErrorIn("processorLduInterface::compressedBufferReceive")
|
||||
// << "Unsupported communications type " << commsType
|
||||
// << exit(FatalError);
|
||||
// }
|
||||
//
|
||||
// // Inline expand
|
||||
// List<Type>& f = setReceiveBuf<Type>(size);
|
||||
// label fSize = f.size()/sizeof(Type);
|
||||
//
|
||||
// const float *fArray =
|
||||
// reinterpret_cast<const float*>(receiveBuf_.begin());
|
||||
// f[fSize - 1] = reinterpret_cast<const Type&>(fArray[nm1]);
|
||||
// scalar *sArray = reinterpret_cast<scalar*>(f.begin());
|
||||
// const scalar *slast = &sArray[nm1];
|
||||
//
|
||||
// for (register label i=0; i<nm1; i++)
|
||||
// {
|
||||
// sArray[i] = fArray[i] + slast[i%nCmpts];
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (commsType == Pstream::blocking || commsType == Pstream::scheduled)
|
||||
// {
|
||||
// setReceiveBuf<Type>(size);
|
||||
//
|
||||
// IPstream::read
|
||||
// (
|
||||
// commsType,
|
||||
// neighbProcNo(),
|
||||
// receiveBuf_.begin(),
|
||||
// receiveBuf_.size()
|
||||
// );
|
||||
// }
|
||||
// else if (commsType != Pstream::nonBlocking)
|
||||
// {
|
||||
// FatalErrorIn("processorLduInterface::compressedBufferReceive")
|
||||
// << "Unsupported communications type " << commsType
|
||||
// << exit(FatalError);
|
||||
// }
|
||||
// }
|
||||
// return reinterpret_cast<List<Type>&>(receiveBuf_);
|
||||
// }
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -43,24 +43,17 @@ Foam::processorLduInterfaceField::~processorLduInterfaceField()
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
//void Foam::processorLduInterfaceField::transformCoupleField
|
||||
//(
|
||||
// scalarField& f,
|
||||
// const direction cmpt
|
||||
//) const
|
||||
//{
|
||||
// if (doTransform())
|
||||
// {
|
||||
// if (forwardT().size() == 1)
|
||||
// {
|
||||
// f *= pow(diag(forwardT()[0]).component(cmpt), rank());
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// f *= pow(diag(forwardT())().component(cmpt), rank());
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
void Foam::processorLduInterfaceField::transformCoupleField
|
||||
(
|
||||
scalarField& f,
|
||||
const direction cmpt
|
||||
) const
|
||||
{
|
||||
if (doTransform())
|
||||
{
|
||||
f *= pow(diag(forwardT()).component(cmpt), rank());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -79,22 +79,22 @@ public:
|
||||
//- Return neigbour processor number
|
||||
virtual int neighbProcNo() const = 0;
|
||||
|
||||
// //- Is the transform required
|
||||
// virtual bool doTransform() const = 0;
|
||||
//
|
||||
// //- Return face transformation tensor
|
||||
// virtual const tensorField& forwardT() const = 0;
|
||||
//- Is the transform required
|
||||
virtual bool doTransform() const = 0;
|
||||
|
||||
//- Return face transformation tensor
|
||||
virtual const tensor& forwardT() const = 0;
|
||||
|
||||
//- Return rank of component for transform
|
||||
virtual int rank() const = 0;
|
||||
|
||||
|
||||
// //- Transform given patch component field
|
||||
// virtual void transformCoupleField
|
||||
// (
|
||||
// scalarField& f,
|
||||
// const direction cmpt
|
||||
// ) const = 0;
|
||||
//- Transform given patch component field
|
||||
void transformCoupleField
|
||||
(
|
||||
scalarField& f,
|
||||
const direction cmpt
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -110,6 +110,26 @@ Foam::boundBox::boundBox(Istream& is)
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::pointField> Foam::boundBox::corners() const
|
||||
{
|
||||
tmp<pointField> tPts = tmp<pointField>(new pointField(8));
|
||||
pointField& pt = tPts();
|
||||
|
||||
pt[0] = min_; // min-x, min-y, min-z
|
||||
pt[1] = point(max_.x(), min_.y(), min_.z()); // max-x, min-y, min-z
|
||||
pt[2] = point(max_.x(), max_.y(), min_.z()); // max-x, max-y, min-z
|
||||
pt[3] = point(min_.x(), max_.y(), min_.z()); // min-x, max-y, min-z
|
||||
pt[4] = point(min_.x(), min_.y(), max_.z()); // min-x, min-y, max-z
|
||||
pt[5] = point(max_.x(), min_.y(), max_.z()); // max-x, min-y, max-z
|
||||
pt[6] = max_; // max-x, max-y, max-z
|
||||
pt[7] = point(min_.x(), max_.y(), max_.z()); // min-x, max-y, max-z
|
||||
|
||||
return tPts;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
||||
|
||||
Foam::Ostream& Foam::operator<<(Ostream& os, const boundBox& bb)
|
||||
|
||||
@ -171,6 +171,8 @@ public:
|
||||
return cmptAv(span());
|
||||
}
|
||||
|
||||
//- Return corner points in an order corresponding to a 'hex' cell
|
||||
tmp<pointField> corners() const;
|
||||
|
||||
// Query
|
||||
|
||||
|
||||
@ -0,0 +1,399 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ 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 2 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "processorCyclicPointPatch.H"
|
||||
#include "pointBoundaryMesh.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
//#include "pointMesh.H"
|
||||
//#include "globalPointPatch.H"
|
||||
//#include "faceList.H"
|
||||
//#include "primitiveFacePatch.H"
|
||||
//#include "emptyPolyPatch.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(processorCyclicPointPatch, 0);
|
||||
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
facePointPatch,
|
||||
processorCyclicPointPatch,
|
||||
polyPatch
|
||||
);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
|
||||
|
||||
//void Foam::processorCyclicPointPatch::initGeometry(PstreamBuffers& pBufs)
|
||||
//{
|
||||
// // Algorithm:
|
||||
// // Depending on whether the patch is a master or a slave, get the primitive
|
||||
// // patch points and filter away the points from the global patch.
|
||||
//
|
||||
// if (isMaster())
|
||||
// {
|
||||
// meshPoints_ = procPolyPatch_.meshPoints();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // Slave side. Create the reversed patch and pick up its points
|
||||
// // so that the order is correct
|
||||
// const polyPatch& pp = patch();
|
||||
//
|
||||
// faceList masterFaces(pp.size());
|
||||
//
|
||||
// forAll (pp, faceI)
|
||||
// {
|
||||
// masterFaces[faceI] = pp[faceI].reverseFace();
|
||||
// }
|
||||
//
|
||||
// meshPoints_ = primitiveFacePatch
|
||||
// (
|
||||
// masterFaces,
|
||||
// pp.points()
|
||||
// ).meshPoints();
|
||||
// }
|
||||
//
|
||||
// if (Pstream::parRun())
|
||||
// {
|
||||
// initPatchPatchPoints(pBufs);
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//
|
||||
//void Foam::processorCyclicPointPatch::calcGeometry(PstreamBuffers& pBufs)
|
||||
//{
|
||||
// if (Pstream::parRun())
|
||||
// {
|
||||
// calcPatchPatchPoints(pBufs);
|
||||
// }
|
||||
//
|
||||
// // If it is not runing parallel or there are no global points
|
||||
// // create a 1->1 map
|
||||
// if
|
||||
// (
|
||||
// !Pstream::parRun()
|
||||
// || !boundaryMesh().mesh().globalData().nGlobalPoints()
|
||||
// )
|
||||
// {
|
||||
// nonGlobalPatchPoints_.setSize(meshPoints_.size());
|
||||
// forAll(nonGlobalPatchPoints_, i)
|
||||
// {
|
||||
// nonGlobalPatchPoints_[i] = i;
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // Get reference to shared points
|
||||
// const labelList& sharedPoints =
|
||||
// boundaryMesh().globalPatch().meshPoints();
|
||||
//
|
||||
// nonGlobalPatchPoints_.setSize(meshPoints_.size());
|
||||
//
|
||||
// label noFiltPoints = 0;
|
||||
//
|
||||
// forAll (meshPoints_, pointI)
|
||||
// {
|
||||
// label curP = meshPoints_[pointI];
|
||||
//
|
||||
// bool found = false;
|
||||
//
|
||||
// forAll (sharedPoints, sharedI)
|
||||
// {
|
||||
// if (sharedPoints[sharedI] == curP)
|
||||
// {
|
||||
// found = true;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (!found)
|
||||
// {
|
||||
// nonGlobalPatchPoints_[noFiltPoints] = pointI;
|
||||
// meshPoints_[noFiltPoints] = curP;
|
||||
// noFiltPoints++;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// nonGlobalPatchPoints_.setSize(noFiltPoints);
|
||||
// meshPoints_.setSize(noFiltPoints);
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//
|
||||
//void processorCyclicPointPatch::initPatchPatchPoints(PstreamBuffers& pBufs)
|
||||
//{
|
||||
// if (debug)
|
||||
// {
|
||||
// Info<< "processorCyclicPointPatch::initPatchPatchPoints(PstreamBuffers&) : "
|
||||
// << "constructing patch-patch points"
|
||||
// << endl;
|
||||
// }
|
||||
//
|
||||
// const polyBoundaryMesh& bm = boundaryMesh().mesh()().boundaryMesh();
|
||||
//
|
||||
// // Get the mesh points for this patch corresponding to the faces
|
||||
// const labelList& ppmp = meshPoints();
|
||||
//
|
||||
// // Create a HashSet of the point labels for this patch
|
||||
// Map<label> patchPointSet(2*ppmp.size());
|
||||
//
|
||||
// forAll (ppmp, ppi)
|
||||
// {
|
||||
// patchPointSet.insert(ppmp[ppi], ppi);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// // Create the lists of patch-patch points
|
||||
// labelListList patchPatchPoints(bm.size());
|
||||
//
|
||||
// // Create the lists of patch-patch point normals
|
||||
// List<List<vector> > patchPatchPointNormals(bm.size());
|
||||
//
|
||||
// // Loop over all patches looking for other patches that share points
|
||||
// forAll(bm, patchi)
|
||||
// {
|
||||
// if
|
||||
// (
|
||||
// patchi != index() // Ignore self-self
|
||||
// && !isA<emptyPolyPatch>(bm[patchi]) // Ignore empty
|
||||
// && !bm[patchi].coupled() // Ignore other couples
|
||||
// )
|
||||
// {
|
||||
// // Get the meshPoints for the other patch
|
||||
// const labelList& meshPoints = bm[patchi].meshPoints();
|
||||
//
|
||||
// // Get the normals for the other patch
|
||||
// const vectorField& normals = bm[patchi].pointNormals();
|
||||
//
|
||||
// label pppi = 0;
|
||||
// forAll(meshPoints, pointi)
|
||||
// {
|
||||
// label ppp = meshPoints[pointi];
|
||||
//
|
||||
// // Check to see if the point of the other patch is shared with
|
||||
// // this patch
|
||||
// Map<label>::iterator iter = patchPointSet.find(ppp);
|
||||
//
|
||||
// if (iter != patchPointSet.end())
|
||||
// {
|
||||
// // If it is shared initialise the patchPatchPoints for this
|
||||
// // patch
|
||||
// if (!patchPatchPoints[patchi].size())
|
||||
// {
|
||||
// patchPatchPoints[patchi].setSize(ppmp.size());
|
||||
// patchPatchPointNormals[patchi].setSize(ppmp.size());
|
||||
// }
|
||||
//
|
||||
// // and add the entry
|
||||
// patchPatchPoints[patchi][pppi] = iter();
|
||||
// patchPatchPointNormals[patchi][pppi] = normals[pointi];
|
||||
// pppi++;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // Resise the list of shared points and normals for the patch
|
||||
// // being considerd
|
||||
// patchPatchPoints[patchi].setSize(pppi);
|
||||
// patchPatchPointNormals[patchi].setSize(pppi);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // Send the patchPatchPoints to the neighbouring processor
|
||||
//
|
||||
// UOPstream toNeighbProc(neighbProcNo(), pBufs);
|
||||
//
|
||||
// toNeighbProc
|
||||
// << ppmp.size() // number of points for checking
|
||||
// << patchPatchPoints
|
||||
// << patchPatchPointNormals;
|
||||
//
|
||||
// if (debug)
|
||||
// {
|
||||
// Info<< "processorCyclicPointPatch::initPatchPatchPoints() : "
|
||||
// << "constructed patch-patch points"
|
||||
// << endl;
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//
|
||||
//void Foam::processorCyclicPointPatch::calcPatchPatchPoints(PstreamBuffers& pBufs)
|
||||
//{
|
||||
// // Get the patchPatchPoints from the neighbouring processor
|
||||
// UIPstream fromNeighbProc(neighbProcNo(), pBufs);
|
||||
//
|
||||
// label nbrNPoints(readLabel(fromNeighbProc));
|
||||
// labelListList patchPatchPoints(fromNeighbProc);
|
||||
// List<List<vector> > patchPatchPointNormals(fromNeighbProc);
|
||||
//
|
||||
// pointBoundaryMesh& pbm = const_cast<pointBoundaryMesh&>(boundaryMesh());
|
||||
// const labelList& ppmp = meshPoints();
|
||||
//
|
||||
// // Simple check for the very rare situation when not the same number
|
||||
// // of points on both sides. This can happen with decomposed cyclics.
|
||||
// // If on one side the cyclic shares a point with proc faces coming from
|
||||
// // internal faces it will have a different number of points from
|
||||
// // the situation where the cyclic and the 'normal' proc faces are fully
|
||||
// // separate.
|
||||
// if (nbrNPoints != ppmp.size())
|
||||
// {
|
||||
// WarningIn("processorCyclicPointPatch::calcPatchPatchPoints(PstreamBuffers&)")
|
||||
// << "Processor patch " << name()
|
||||
// << " has " << ppmp.size() << " points; coupled patch has "
|
||||
// << nbrNPoints << " points." << endl
|
||||
// << " (usually due to decomposed cyclics)."
|
||||
// << " This might give problems" << endl
|
||||
// << " when using point fields (interpolation, mesh motion)."
|
||||
// << endl;
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
// // Loop over the patches looking for other patches that share points
|
||||
// forAll(patchPatchPoints, patchi)
|
||||
// {
|
||||
// const labelList& patchPoints = patchPatchPoints[patchi];
|
||||
// const List<vector>& patchPointNormals = patchPatchPointNormals[patchi];
|
||||
//
|
||||
// // If there are potentially shared points for the patch being considered
|
||||
// if (patchPoints.size())
|
||||
// {
|
||||
// // Get the current meshPoints list for the patch
|
||||
// facePointPatch& fpp = refCast<facePointPatch>(pbm[patchi]);
|
||||
// const labelList& fmp = fpp.meshPoints();
|
||||
// labelList& mp = fpp.meshPoints_;
|
||||
//
|
||||
// const vectorField& fnormals = fpp.pointNormals();
|
||||
// vectorField& normals = fpp.pointNormals_;
|
||||
//
|
||||
// // Create a HashSet of the point labels for the patch
|
||||
// Map<label> patchPointSet(2*fmp.size());
|
||||
//
|
||||
// forAll (fmp, ppi)
|
||||
// {
|
||||
// patchPointSet.insert(fmp[ppi], ppi);
|
||||
// }
|
||||
//
|
||||
// label nPoints = mp.size();
|
||||
// label lpi = 0;
|
||||
// bool resized = false;
|
||||
//
|
||||
// // For each potentially shared point...
|
||||
// forAll(patchPoints, ppi)
|
||||
// {
|
||||
// // Check if it is not already in the patch,
|
||||
// // i.e. not part of a face of the patch
|
||||
// if (!patchPointSet.found(ppmp[patchPoints[ppi]]))
|
||||
// {
|
||||
// // If it isn't already in the patch check if the local
|
||||
// // meshPoints is already set and if not initialise the
|
||||
// // meshPoints_ and pointNormals_
|
||||
// if (!resized)
|
||||
// {
|
||||
// if (!mp.size() && fmp.size())
|
||||
// {
|
||||
// mp = fmp;
|
||||
// normals = fnormals;
|
||||
//
|
||||
// nPoints = mp.size();
|
||||
// }
|
||||
//
|
||||
// mp.setSize(nPoints + patchPoints.size());
|
||||
// loneMeshPoints_.setSize(patchPoints.size());
|
||||
// normals.setSize(nPoints + patchPoints.size());
|
||||
// resized = true;
|
||||
// }
|
||||
//
|
||||
// // Add the new point to the patch
|
||||
// mp[nPoints] = ppmp[patchPoints[ppi]];
|
||||
// loneMeshPoints_[lpi++] = ppmp[patchPoints[ppi]];
|
||||
// normals[nPoints++] = patchPointNormals[ppi];
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // If the lists have been resized points have been added.
|
||||
// // Shrink the lists to the current size.
|
||||
// if (resized)
|
||||
// {
|
||||
// mp.setSize(nPoints);
|
||||
// loneMeshPoints_.setSize(lpi);
|
||||
// normals.setSize(nPoints);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
//void processorCyclicPointPatch::initMovePoints(PstreamBuffers&, const pointField&)
|
||||
//{}
|
||||
//
|
||||
//
|
||||
//void processorCyclicPointPatch::movePoints(PstreamBuffers&, const pointField&)
|
||||
//{}
|
||||
//
|
||||
//
|
||||
//void processorCyclicPointPatch::initUpdateMesh(PstreamBuffers& pBufs)
|
||||
//{
|
||||
// facePointPatch::initUpdateMesh(pBufs);
|
||||
// processorCyclicPointPatch::initGeometry(pBufs);
|
||||
//}
|
||||
//
|
||||
//
|
||||
//void processorCyclicPointPatch::updateMesh(PstreamBuffers& pBufs)
|
||||
//{
|
||||
// facePointPatch::updateMesh(pBufs);
|
||||
// processorCyclicPointPatch::calcGeometry(pBufs);
|
||||
//}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
processorCyclicPointPatch::processorCyclicPointPatch
|
||||
(
|
||||
const polyPatch& patch,
|
||||
const pointBoundaryMesh& bm
|
||||
)
|
||||
:
|
||||
processorPointPatch(patch, bm)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
processorCyclicPointPatch::~processorCyclicPointPatch()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,146 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ 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 2 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::processorCyclicPointPatch
|
||||
|
||||
Description
|
||||
Processor patch boundary needs to be such that the ordering of
|
||||
points in the patch is the same on both sides.
|
||||
|
||||
Looking at the creation of the faces on both sides of the processor
|
||||
patch they need to be identical on both sides with the normals pointing
|
||||
in opposite directions. This is achieved by calling the reverseFace
|
||||
function in the decomposition. It is therefore possible to re-create
|
||||
the ordering of patch points on the slave side by reversing all the
|
||||
patch faces of the owner.
|
||||
|
||||
SourceFiles
|
||||
processorCyclicPointPatch.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef processorCyclicPointPatch_H
|
||||
#define processorCyclicPointPatch_H
|
||||
|
||||
#include "processorPointPatch.H"
|
||||
#include "processorCyclicPolyPatch.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class processorCyclicPointPatch Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class processorCyclicPointPatch
|
||||
:
|
||||
public processorPointPatch
|
||||
{
|
||||
|
||||
//- Disallow default construct as copy
|
||||
processorCyclicPointPatch(const processorCyclicPointPatch&);
|
||||
|
||||
//- Disallow default assignment
|
||||
void operator=(const processorCyclicPointPatch&);
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName(processorCyclicPolyPatch::typeName_());
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
processorCyclicPointPatch
|
||||
(
|
||||
const polyPatch& patch,
|
||||
const pointBoundaryMesh& bm
|
||||
);
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
virtual ~processorCyclicPointPatch();
|
||||
|
||||
|
||||
// Member functions
|
||||
|
||||
// //- Return true if running parallel
|
||||
// virtual bool coupled() const
|
||||
// {
|
||||
// if (Pstream::parRun())
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// //- Return processor number
|
||||
// int myProcNo() const
|
||||
// {
|
||||
// return procPolyPatch_.myProcNo();
|
||||
// }
|
||||
//
|
||||
// //- Return neigbour processor number
|
||||
// int neighbProcNo() const
|
||||
// {
|
||||
// return procPolyPatch_.neighbProcNo();
|
||||
// }
|
||||
//
|
||||
// //- Is this a master patch
|
||||
// bool isMaster() const
|
||||
// {
|
||||
// return myProcNo() < neighbProcNo();
|
||||
// }
|
||||
//
|
||||
// //- Is this a slave patch
|
||||
// bool isSlave() const
|
||||
// {
|
||||
// return !isMaster();
|
||||
// }
|
||||
//
|
||||
// //- Return the underlying processorPolyPatch
|
||||
// const processorPolyPatch& procPolyPatch() const
|
||||
// {
|
||||
// return procPolyPatch_;
|
||||
// }
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -747,20 +747,10 @@ void Foam::globalMeshData::updateMesh()
|
||||
{
|
||||
label patchI = processorPatches_[i];
|
||||
|
||||
const processorPolyPatch& procPatch =
|
||||
refCast<const processorPolyPatch>(mesh_.boundaryMesh()[patchI]);
|
||||
|
||||
if (Pstream::myProcNo() > procPatch.neighbProcNo())
|
||||
if (isType<processorPolyPatch>(mesh_.boundaryMesh()[patchI]))
|
||||
{
|
||||
forAll(procPatch.patchIDs(), i)
|
||||
{
|
||||
if (procPatch.patchIDs()[i] == -1)
|
||||
{
|
||||
// Normal, unseparated processor patch. Remove duplicates.
|
||||
label sz = procPatch.starts()[i+1]-procPatch.starts()[i];
|
||||
nTotalFaces_ -= sz;
|
||||
}
|
||||
}
|
||||
// Normal, unseparated processor patch. Remove duplicates.
|
||||
nTotalFaces_ -= mesh_.boundaryMesh()[patchI].size();
|
||||
}
|
||||
}
|
||||
reduce(nTotalFaces_, sumOp<label>());
|
||||
|
||||
@ -654,8 +654,6 @@ void Foam::polyMesh::resetPrimitives
|
||||
const Xfer<labelList>& neighbour,
|
||||
const labelList& patchSizes,
|
||||
const labelList& patchStarts,
|
||||
const labelListList& subPatches,
|
||||
const labelListList& subPatchStarts,
|
||||
const bool validBoundary
|
||||
)
|
||||
{
|
||||
@ -697,17 +695,6 @@ void Foam::polyMesh::resetPrimitives
|
||||
patchI,
|
||||
boundary_
|
||||
);
|
||||
|
||||
if (isA<processorPolyPatch>(boundary_[patchI]))
|
||||
{
|
||||
// Set the sub-patch information
|
||||
processorPolyPatch& ppp = refCast<processorPolyPatch>
|
||||
(
|
||||
boundary_[patchI]
|
||||
);
|
||||
const_cast<labelList&>(ppp.patchIDs()) = subPatches[patchI];
|
||||
const_cast<labelList&>(ppp.starts()) = subPatchStarts[patchI];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -731,8 +718,6 @@ void Foam::polyMesh::resetPrimitives
|
||||
" const Xfer<labelList>& neighbour,\n"
|
||||
" const labelList& patchSizes,\n"
|
||||
" const labelList& patchStarts\n"
|
||||
" const labelListList& subPatches,\n"
|
||||
" const labelListList& subPatchStarts,\n"
|
||||
" const bool validBoundary\n"
|
||||
")\n"
|
||||
) << "Face " << faceI << " contains vertex labels out of range: "
|
||||
@ -772,8 +757,6 @@ void Foam::polyMesh::resetPrimitives
|
||||
" const Xfer<labelList>& neighbour,\n"
|
||||
" const labelList& patchSizes,\n"
|
||||
" const labelList& patchStarts\n"
|
||||
" const labelListList& subPatches,\n"
|
||||
" const labelListList& subPatchStarts,\n"
|
||||
" const bool validBoundary\n"
|
||||
")\n"
|
||||
) << "no points or no cells in mesh" << endl;
|
||||
|
||||
@ -471,8 +471,6 @@ public:
|
||||
//- Reset mesh primitive data. Assumes all patch info correct
|
||||
// (so does e.g. parallel communication). If not use
|
||||
// validBoundary=false
|
||||
// (still assumes patchStarts[0] = nInternalFaces and last
|
||||
// patch ends at nActiveFaces) and change patches with addPatches.
|
||||
void resetPrimitives
|
||||
(
|
||||
const Xfer<pointField>& points,
|
||||
@ -481,8 +479,6 @@ public:
|
||||
const Xfer<labelList>& neighbour,
|
||||
const labelList& patchSizes,
|
||||
const labelList& patchStarts,
|
||||
const labelListList& subPatches,
|
||||
const labelListList& subPatchStarts,
|
||||
const bool validBoundary = true
|
||||
);
|
||||
|
||||
|
||||
@ -112,21 +112,21 @@ void Foam::coupledPolyPatch::writeOBJ
|
||||
}
|
||||
|
||||
|
||||
Foam::pointField Foam::coupledPolyPatch::calcFaceCentres
|
||||
(
|
||||
const UList<face>& faces,
|
||||
const pointField& points
|
||||
)
|
||||
{
|
||||
pointField ctrs(faces.size());
|
||||
|
||||
forAll(faces, faceI)
|
||||
{
|
||||
ctrs[faceI] = faces[faceI].centre(points);
|
||||
}
|
||||
|
||||
return ctrs;
|
||||
}
|
||||
//Foam::pointField Foam::coupledPolyPatch::calcFaceCentres
|
||||
//(
|
||||
// const UList<face>& faces,
|
||||
// const pointField& points
|
||||
//)
|
||||
//{
|
||||
// pointField ctrs(faces.size());
|
||||
//
|
||||
// forAll(faces, faceI)
|
||||
// {
|
||||
// ctrs[faceI] = faces[faceI].centre(points);
|
||||
// }
|
||||
//
|
||||
// return ctrs;
|
||||
//}
|
||||
|
||||
|
||||
Foam::pointField Foam::coupledPolyPatch::getAnchorPoints
|
||||
|
||||
@ -126,13 +126,6 @@ protected:
|
||||
label& vertI
|
||||
);
|
||||
|
||||
//- Calculate face centres
|
||||
static pointField calcFaceCentres
|
||||
(
|
||||
const UList<face>&,
|
||||
const pointField&
|
||||
);
|
||||
|
||||
//- Get f[0] for all faces
|
||||
static pointField getAnchorPoints
|
||||
(
|
||||
@ -242,8 +235,9 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
//- Transform a patch-based field.
|
||||
//- Transform a patch-based field from other side to this side.
|
||||
//!! TDB with macros?
|
||||
virtual bool doTransform() const;
|
||||
virtual void transform(scalarField& l) const = 0;
|
||||
virtual void transform(vectorField& l) const = 0;
|
||||
virtual void transform(sphericalTensorField& l) const = 0;
|
||||
@ -251,7 +245,7 @@ public:
|
||||
virtual void transform(symmTensorField& l) const = 0;
|
||||
virtual void transform(tensorField& l) const = 0;
|
||||
|
||||
//- Transform a patch-based position
|
||||
//- Transform a patch-based position from other side to this side
|
||||
virtual void transformPosition(pointField& l) const = 0;
|
||||
|
||||
// Low level geometric information
|
||||
@ -272,14 +266,14 @@ public:
|
||||
virtual const tensor& reverseT() const = 0;
|
||||
|
||||
|
||||
//- Initialise the calculation of the patch geometry
|
||||
virtual void initGeometry
|
||||
(
|
||||
const primitivePatch& referPatch,
|
||||
UList<point>& nbrCtrs,
|
||||
UList<point>& nbrAreas,
|
||||
UList<point>& nbrCc
|
||||
) = 0;
|
||||
// //- Initialise the calculation of the patch geometry
|
||||
// virtual void initGeometry
|
||||
// (
|
||||
// const primitivePatch& referPatch,
|
||||
// UList<point>& nbrCtrs,
|
||||
// UList<point>& nbrAreas,
|
||||
// UList<point>& nbrCc
|
||||
// ) = 0;
|
||||
|
||||
//- Calculate the patch geometry
|
||||
virtual void calcGeometry
|
||||
|
||||
@ -93,7 +93,7 @@ void Foam::cyclicPolyPatch::calcTransforms()
|
||||
|
||||
const cyclicPolyPatch& half0 = *this;
|
||||
|
||||
pointField half0Ctrs(calcFaceCentres(half0, half0.points()));
|
||||
const pointField& half0Ctrs = half0.faceCentres();
|
||||
|
||||
if (debug)
|
||||
{
|
||||
@ -118,7 +118,7 @@ void Foam::cyclicPolyPatch::calcTransforms()
|
||||
|
||||
const cyclicPolyPatch& half1 = neighbPatch();
|
||||
|
||||
pointField half1Ctrs(calcFaceCentres(half1, half1.points()));
|
||||
const pointField& half1Ctrs = half1.faceCentres();
|
||||
|
||||
// Dump halves
|
||||
if (debug)
|
||||
@ -282,9 +282,9 @@ void Foam::cyclicPolyPatch::getCentresAndAnchors
|
||||
) const
|
||||
{
|
||||
// Get geometric data on both halves.
|
||||
half0Ctrs = calcFaceCentres(pp0, pp0.points());
|
||||
half0Ctrs = pp0.faceCentres();
|
||||
anchors0 = getAnchorPoints(pp0, pp0.points());
|
||||
half1Ctrs = calcFaceCentres(pp1, pp1.points());
|
||||
half1Ctrs = pp1.faceCentres();
|
||||
|
||||
switch (transform_)
|
||||
{
|
||||
@ -585,13 +585,14 @@ Foam::cyclicPolyPatch::cyclicPolyPatch
|
||||
)
|
||||
:
|
||||
coupledPolyPatch(pp, bm, index, mapAddressing, newStart),
|
||||
coupledPointsPtr_(NULL),
|
||||
coupledEdgesPtr_(NULL),
|
||||
featureCos_(pp.featureCos_),
|
||||
neighbPatchName_(pp.neighbPatchName_),
|
||||
neighbPatchID_(-1),
|
||||
transform_(pp.transform_),
|
||||
rotationAxis_(pp.rotationAxis_),
|
||||
rotationCentre_(pp.rotationCentre_),
|
||||
separationVector_(pp.separationVector_)
|
||||
separationVector_(pp.separationVector_),
|
||||
coupledPointsPtr_(NULL),
|
||||
coupledEdgesPtr_(NULL)
|
||||
{}
|
||||
|
||||
|
||||
@ -611,11 +612,11 @@ void Foam::cyclicPolyPatch::transformPosition(pointField& l) const
|
||||
{
|
||||
if (!parallel())
|
||||
{
|
||||
Foam::transform(reverseT_, l);
|
||||
Foam::transform(forwardT_, l);
|
||||
}
|
||||
else if (separated())
|
||||
{
|
||||
l += separation_;
|
||||
l -= separation_;
|
||||
}
|
||||
}
|
||||
|
||||
@ -647,7 +648,7 @@ void Foam::cyclicPolyPatch::calcGeometry
|
||||
const UList<point>& nbrCc
|
||||
)
|
||||
{
|
||||
polyPatch::calcGeometry();
|
||||
//polyPatch::calcGeometry();
|
||||
|
||||
Pout<< "cyclicPolyPatch::calcGeometry : name:" << name()
|
||||
<< " referred from:" << referPatch.size() << endl;
|
||||
|
||||
@ -48,8 +48,6 @@ SourceFiles
|
||||
#define cyclicPolyPatch_H
|
||||
|
||||
#include "coupledPolyPatch.H"
|
||||
//#include "SubField.H"
|
||||
//#include "FixedList.H"
|
||||
#include "edgeList.H"
|
||||
//#include "transform.H"
|
||||
#include "polyBoundaryMesh.H"
|
||||
@ -373,16 +371,21 @@ public:
|
||||
// calculation!
|
||||
const edgeList& coupledEdges() const;
|
||||
|
||||
//- Transform a patch-based field on this side to a field on the
|
||||
// other side.
|
||||
//- Transform a patch-based field from other side to this side.
|
||||
template<class T>
|
||||
void transform(Field<T>& l) const
|
||||
{
|
||||
if (!parallel())
|
||||
{
|
||||
transform(reverseT_, l);
|
||||
transform(forwardT_, l);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
virtual bool doTransform() const
|
||||
{
|
||||
return !parallel();
|
||||
}
|
||||
virtual void transform(scalarField& l) const
|
||||
{
|
||||
transform(l);
|
||||
@ -408,8 +411,7 @@ public:
|
||||
transform(l);
|
||||
}
|
||||
|
||||
//- Transform a patch-based position on this side to a position
|
||||
// the other side.
|
||||
//- Transform a patch-based position from other side to this side
|
||||
virtual void transformPosition(pointField& l) const;
|
||||
|
||||
|
||||
|
||||
@ -45,46 +45,6 @@ namespace Foam
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
void Foam::processorPolyPatch::checkSubPatches() const
|
||||
{
|
||||
if (starts_.size() != patchIDs_.size()+1)
|
||||
{
|
||||
FatalErrorIn("processorPolyPatch::checkPatches() const")
|
||||
<< "starts should have one more element than patchIDs." << endl
|
||||
<< "starts:" << starts_ << " patchIDs:" << patchIDs_
|
||||
<< exit(FatalError);
|
||||
}
|
||||
if (starts_[0] != 0)
|
||||
{
|
||||
FatalErrorIn("processorPolyPatch::checkPatches() const")
|
||||
<< "starts[0] should be 0." << endl
|
||||
<< "starts:" << starts_ << " patchIDs:" << patchIDs_
|
||||
<< exit(FatalError);
|
||||
}
|
||||
if (starts_[starts_.size()-1] != size())
|
||||
{
|
||||
FatalErrorIn("processorPolyPatch::checkPatches() const")
|
||||
<< "Last element in starts should be the size." << endl
|
||||
<< "starts:" << starts_ << " size:" << size()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
// If there are any faces from internal they should be first.
|
||||
for (label i = 1; i < patchIDs_.size(); i++)
|
||||
{
|
||||
if (patchIDs_[i] == -1)
|
||||
{
|
||||
FatalErrorIn("processorPolyPatch::checkPatches() const")
|
||||
<< "Faces originating from internal faces (subPatch is -1)"
|
||||
<< " should always be first in the patch."
|
||||
<< " The current list of subpatches " << patchIDs_
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::processorPolyPatch::processorPolyPatch
|
||||
@ -95,24 +55,18 @@ Foam::processorPolyPatch::processorPolyPatch
|
||||
const label index,
|
||||
const polyBoundaryMesh& bm,
|
||||
const int myProcNo,
|
||||
const int neighbProcNo,
|
||||
const labelList& patchIDs,
|
||||
const labelList& starts
|
||||
const int neighbProcNo
|
||||
)
|
||||
:
|
||||
coupledPolyPatch(name, size, start, index, bm),
|
||||
myProcNo_(myProcNo),
|
||||
neighbProcNo_(neighbProcNo),
|
||||
patchIDs_(patchIDs),
|
||||
starts_(starts),
|
||||
neighbFaceCentres_(),
|
||||
neighbFaceAreas_(),
|
||||
neighbFaceCellCentres_()
|
||||
// neighbPointsPtr_(NULL),
|
||||
// neighbEdgesPtr_(NULL)
|
||||
{
|
||||
checkSubPatches();
|
||||
}
|
||||
{}
|
||||
|
||||
|
||||
Foam::processorPolyPatch::processorPolyPatch
|
||||
@ -126,16 +80,12 @@ Foam::processorPolyPatch::processorPolyPatch
|
||||
coupledPolyPatch(name, dict, index, bm),
|
||||
myProcNo_(readLabel(dict.lookup("myProcNo"))),
|
||||
neighbProcNo_(readLabel(dict.lookup("neighbProcNo"))),
|
||||
patchIDs_(dict.lookup("patchIDs")),
|
||||
starts_(dict.lookup("starts")),
|
||||
neighbFaceCentres_(),
|
||||
neighbFaceAreas_(),
|
||||
neighbFaceCellCentres_()
|
||||
// neighbPointsPtr_(NULL),
|
||||
// neighbEdgesPtr_(NULL)
|
||||
{
|
||||
checkSubPatches();
|
||||
}
|
||||
{}
|
||||
|
||||
|
||||
Foam::processorPolyPatch::processorPolyPatch
|
||||
@ -147,8 +97,6 @@ Foam::processorPolyPatch::processorPolyPatch
|
||||
coupledPolyPatch(pp, bm),
|
||||
myProcNo_(pp.myProcNo_),
|
||||
neighbProcNo_(pp.neighbProcNo_),
|
||||
patchIDs_(pp.patchIDs_),
|
||||
starts_(pp.starts_),
|
||||
neighbFaceCentres_(),
|
||||
neighbFaceAreas_(),
|
||||
neighbFaceCellCentres_()
|
||||
@ -163,24 +111,18 @@ Foam::processorPolyPatch::processorPolyPatch
|
||||
const polyBoundaryMesh& bm,
|
||||
const label index,
|
||||
const label newSize,
|
||||
const label newStart,
|
||||
const labelList& patchIDs,
|
||||
const labelList& starts
|
||||
const label newStart
|
||||
)
|
||||
:
|
||||
coupledPolyPatch(pp, bm, index, newSize, newStart),
|
||||
myProcNo_(pp.myProcNo_),
|
||||
neighbProcNo_(pp.neighbProcNo_),
|
||||
patchIDs_(patchIDs),
|
||||
starts_(starts),
|
||||
neighbFaceCentres_(),
|
||||
neighbFaceAreas_(),
|
||||
neighbFaceCellCentres_()
|
||||
// neighbPointsPtr_(NULL),
|
||||
// neighbEdgesPtr_(NULL)
|
||||
{
|
||||
checkSubPatches();
|
||||
}
|
||||
{}
|
||||
|
||||
|
||||
Foam::processorPolyPatch::processorPolyPatch
|
||||
@ -188,7 +130,7 @@ Foam::processorPolyPatch::processorPolyPatch
|
||||
const processorPolyPatch& pp,
|
||||
const polyBoundaryMesh& bm,
|
||||
const label index,
|
||||
const unallocLabelList& mapAddressing,
|
||||
const unallocLabelList& mapAddressing,
|
||||
const label newStart
|
||||
)
|
||||
:
|
||||
@ -197,9 +139,9 @@ Foam::processorPolyPatch::processorPolyPatch
|
||||
neighbProcNo_(pp.neighbProcNo_),
|
||||
neighbFaceCentres_(),
|
||||
neighbFaceAreas_(),
|
||||
neighbFaceCellCentres_(),
|
||||
neighbPointsPtr_(NULL),
|
||||
neighbEdgesPtr_(NULL)
|
||||
neighbFaceCellCentres_()
|
||||
// neighbPointsPtr_(NULL),
|
||||
// neighbEdgesPtr_(NULL)
|
||||
{}
|
||||
|
||||
|
||||
@ -207,90 +149,24 @@ Foam::processorPolyPatch::processorPolyPatch
|
||||
|
||||
Foam::processorPolyPatch::~processorPolyPatch()
|
||||
{
|
||||
// deleteDemandDrivenData(neighbPointsPtr_);
|
||||
// deleteDemandDrivenData(neighbEdgesPtr_);
|
||||
neighbPointsPtr_.clear();
|
||||
neighbEdgesPtr_.clear();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::processorPolyPatch::transformPosition(pointField& l) const
|
||||
{
|
||||
if (l.size() != size())
|
||||
{
|
||||
FatalErrorIn("processorPolyPatch::transformPosition(pointField&) const")
|
||||
<< "Size of field " << l.size() << " differs from patch size "
|
||||
<< size() << abort(FatalError);
|
||||
}
|
||||
|
||||
forAll(patchIDs_, subI)
|
||||
{
|
||||
label patchI = patchIDs_[subI];
|
||||
|
||||
if (patchI != -1)
|
||||
{
|
||||
// Get field on patch
|
||||
SubField<point> subFld(subSlice(l, subI));
|
||||
|
||||
refCast<const coupledPolyPatch>
|
||||
(
|
||||
boundaryMesh()[patchI]
|
||||
).transformPosition(reinterpret_cast<pointField&>(subFld));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::processorPolyPatch::initGeometry(PstreamBuffers& pBufs)
|
||||
{
|
||||
Pout<< "**processorPolyPatch::initGeometry()" << endl;
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
pointField fc(size());
|
||||
vectorField fa(size());
|
||||
pointField cc(size());
|
||||
|
||||
forAll(patchIDs_, i)
|
||||
{
|
||||
label patchI = patchIDs_[i];
|
||||
|
||||
autoPtr<primitivePatch> subPp = subPatch(i);
|
||||
|
||||
SubField<point> subFc(subSlice(fc, i));
|
||||
SubField<vector> subFa(subSlice(fa, i));
|
||||
SubField<point> subCc(subSlice(cc, i));
|
||||
|
||||
subFc.assign(subSlice(faceCentres(), i));
|
||||
subFa.assign(subSlice(faceAreas(), i));
|
||||
subCc.assign(subSlice(faceCellCentres()(), i));
|
||||
|
||||
if (patchI != -1)
|
||||
{
|
||||
coupledPolyPatch& pp = const_cast<coupledPolyPatch&>
|
||||
(
|
||||
refCast<const coupledPolyPatch>
|
||||
(
|
||||
boundaryMesh()[patchI]
|
||||
)
|
||||
);
|
||||
|
||||
Pout<< name() << " calling initGeometry on " << pp.name()
|
||||
<< endl;
|
||||
|
||||
pp.initGeometry(subPp, subFc, subFa, subCc);
|
||||
|
||||
Pout<< name() << " from patchI:" << patchI
|
||||
<< " calculated fc:" << subFc
|
||||
<< " fa:" << subFa << " subCC:" << subCc << endl;
|
||||
Pout<< name() << " fc:" << fc << endl;
|
||||
}
|
||||
}
|
||||
|
||||
Pout<< name() << " fc:" << fc << " fa:" << fa << " cc:" << cc << endl;
|
||||
|
||||
UOPstream toNeighbProc(neighbProcNo(), pBufs);
|
||||
|
||||
toNeighbProc << fc << fa << cc;
|
||||
toNeighbProc
|
||||
<< faceCentres()
|
||||
<< faceAreas()
|
||||
<< faceCellCentres();
|
||||
}
|
||||
}
|
||||
|
||||
@ -312,41 +188,16 @@ Pout<< "processorPolyPatch::calcGeometry() for " << name() << endl;
|
||||
Pout<< "processorPolyPatch::calcGeometry() : received data for "
|
||||
<< neighbFaceCentres_.size() << " faces." << endl;
|
||||
|
||||
forAll(patchIDs_, i)
|
||||
{
|
||||
label patchI = patchIDs_[i];
|
||||
|
||||
if (patchI == -1)
|
||||
{
|
||||
// Anything needs doing for ex-internal faces?
|
||||
}
|
||||
else
|
||||
{
|
||||
coupledPolyPatch& pp = const_cast<coupledPolyPatch&>
|
||||
(
|
||||
refCast<const coupledPolyPatch>
|
||||
(
|
||||
boundaryMesh()[patchI]
|
||||
)
|
||||
);
|
||||
|
||||
Pout<< "processorPolyPatch::calcGeometry() : referring to " << pp.name()
|
||||
<< " for faces size:" << starts_[i+1]-starts_[i]
|
||||
<< " start:" << starts_[i]
|
||||
<< endl;
|
||||
|
||||
pp.calcGeometry
|
||||
(
|
||||
subPatch(i),
|
||||
subSlice(faceCentres(), i),
|
||||
subSlice(faceAreas(), i),
|
||||
subSlice(faceCellCentres()(), i),
|
||||
subSlice(neighbFaceCentres_, i),
|
||||
subSlice(neighbFaceAreas_, i),
|
||||
subSlice(neighbFaceCellCentres_, i)
|
||||
);
|
||||
}
|
||||
}
|
||||
calcGeometry
|
||||
(
|
||||
*this,
|
||||
faceCentres(),
|
||||
faceAreas(),
|
||||
faceCellCentres()(),
|
||||
neighbFaceCentres_,
|
||||
neighbFaceAreas_,
|
||||
neighbFaceCellCentres_
|
||||
);
|
||||
}
|
||||
Pout<< "**neighbFaceCentres_:" << neighbFaceCentres_ << endl;
|
||||
Pout<< "**neighbFaceAreas_:" << neighbFaceAreas_ << endl;
|
||||
@ -380,56 +231,46 @@ void Foam::processorPolyPatch::initUpdateMesh(PstreamBuffers& pBufs)
|
||||
{
|
||||
polyPatch::initUpdateMesh(pBufs);
|
||||
|
||||
// deleteDemandDrivenData(neighbPointsPtr_);
|
||||
// deleteDemandDrivenData(neighbEdgesPtr_);
|
||||
//
|
||||
// if (Pstream::parRun())
|
||||
// {
|
||||
// // Express all points as patch face and index in face.
|
||||
// labelList pointFace(nPoints());
|
||||
// labelList pointIndex(nPoints());
|
||||
//
|
||||
// for (label patchPointI = 0; patchPointI < nPoints(); patchPointI++)
|
||||
// {
|
||||
// label faceI = pointFaces()[patchPointI][0];
|
||||
//
|
||||
// pointFace[patchPointI] = faceI;
|
||||
//
|
||||
// const face& f = localFaces()[faceI];
|
||||
//
|
||||
// pointIndex[patchPointI] = findIndex(f, patchPointI);
|
||||
// }
|
||||
//
|
||||
// // Express all edges as patch face and index in face.
|
||||
// labelList edgeFace(nEdges());
|
||||
// labelList edgeIndex(nEdges());
|
||||
//
|
||||
// for (label patchEdgeI = 0; patchEdgeI < nEdges(); patchEdgeI++)
|
||||
// {
|
||||
// label faceI = edgeFaces()[patchEdgeI][0];
|
||||
//
|
||||
// edgeFace[patchEdgeI] = faceI;
|
||||
//
|
||||
// const labelList& fEdges = faceEdges()[faceI];
|
||||
//
|
||||
// edgeIndex[patchEdgeI] = findIndex(fEdges, patchEdgeI);
|
||||
// }
|
||||
//
|
||||
// OPstream toNeighbProc
|
||||
// (
|
||||
// Pstream::blocking,
|
||||
// neighbProcNo(),
|
||||
// 8*sizeof(label) // four headers of labelList
|
||||
// + 2*nPoints()*sizeof(label) // two point-based labellists
|
||||
// + 2*nEdges()*sizeof(label) // two edge-based labelLists
|
||||
// );
|
||||
//
|
||||
// toNeighbProc
|
||||
// << pointFace
|
||||
// << pointIndex
|
||||
// << edgeFace
|
||||
// << edgeIndex;
|
||||
// }
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
// Express all points as patch face and index in face.
|
||||
labelList pointFace(nPoints());
|
||||
labelList pointIndex(nPoints());
|
||||
|
||||
for (label patchPointI = 0; patchPointI < nPoints(); patchPointI++)
|
||||
{
|
||||
label faceI = pointFaces()[patchPointI][0];
|
||||
|
||||
pointFace[patchPointI] = faceI;
|
||||
|
||||
const face& f = localFaces()[faceI];
|
||||
|
||||
pointIndex[patchPointI] = findIndex(f, patchPointI);
|
||||
}
|
||||
|
||||
// Express all edges as patch face and index in face.
|
||||
labelList edgeFace(nEdges());
|
||||
labelList edgeIndex(nEdges());
|
||||
|
||||
for (label patchEdgeI = 0; patchEdgeI < nEdges(); patchEdgeI++)
|
||||
{
|
||||
label faceI = edgeFaces()[patchEdgeI][0];
|
||||
|
||||
edgeFace[patchEdgeI] = faceI;
|
||||
|
||||
const labelList& fEdges = faceEdges()[faceI];
|
||||
|
||||
edgeIndex[patchEdgeI] = findIndex(fEdges, patchEdgeI);
|
||||
}
|
||||
|
||||
UOPstream toNeighbProc(neighbProcNo(), pBufs);
|
||||
|
||||
toNeighbProc
|
||||
<< pointFace
|
||||
<< pointIndex
|
||||
<< edgeFace
|
||||
<< edgeIndex;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -438,187 +279,126 @@ void Foam::processorPolyPatch::updateMesh(PstreamBuffers& pBufs)
|
||||
// For completeness
|
||||
polyPatch::updateMesh(pBufs);
|
||||
|
||||
// if (Pstream::parRun())
|
||||
// {
|
||||
// labelList nbrPointFace;
|
||||
// labelList nbrPointIndex;
|
||||
// labelList nbrEdgeFace;
|
||||
// labelList nbrEdgeIndex;
|
||||
//
|
||||
// {
|
||||
// // Note cannot predict exact size since opposite nPoints might
|
||||
// // be different from one over here.
|
||||
// IPstream fromNeighbProc(Pstream::blocking, neighbProcNo());
|
||||
//
|
||||
// fromNeighbProc
|
||||
// >> nbrPointFace
|
||||
// >> nbrPointIndex
|
||||
// >> nbrEdgeFace
|
||||
// >> nbrEdgeIndex;
|
||||
// }
|
||||
//
|
||||
// // Convert neighbour faces and indices into face back into
|
||||
// // my edges and points.
|
||||
//
|
||||
// // Convert points.
|
||||
// // ~~~~~~~~~~~~~~~
|
||||
//
|
||||
// neighbPointsPtr_ = new labelList(nPoints(), -1);
|
||||
// labelList& neighbPoints = *neighbPointsPtr_;
|
||||
//
|
||||
// forAll(nbrPointFace, nbrPointI)
|
||||
// {
|
||||
// // Find face and index in face on this side.
|
||||
// const face& f = localFaces()[nbrPointFace[nbrPointI]];
|
||||
// label index = (f.size() - nbrPointIndex[nbrPointI]) % f.size();
|
||||
// label patchPointI = f[index];
|
||||
//
|
||||
// if (neighbPoints[patchPointI] == -1)
|
||||
// {
|
||||
// // First reference of point
|
||||
// neighbPoints[patchPointI] = nbrPointI;
|
||||
// }
|
||||
// else if (neighbPoints[patchPointI] >= 0)
|
||||
// {
|
||||
// // Point already visited. Mark as duplicate.
|
||||
// neighbPoints[patchPointI] = -2;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // Reset all duplicate entries to -1.
|
||||
// forAll(neighbPoints, patchPointI)
|
||||
// {
|
||||
// if (neighbPoints[patchPointI] == -2)
|
||||
// {
|
||||
// neighbPoints[patchPointI] = -1;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // Convert edges.
|
||||
// // ~~~~~~~~~~~~~~
|
||||
//
|
||||
// neighbEdgesPtr_ = new labelList(nEdges(), -1);
|
||||
// labelList& neighbEdges = *neighbEdgesPtr_;
|
||||
//
|
||||
// forAll(nbrEdgeFace, nbrEdgeI)
|
||||
// {
|
||||
// // Find face and index in face on this side.
|
||||
// const labelList& f = faceEdges()[nbrEdgeFace[nbrEdgeI]];
|
||||
// label index = (f.size() - nbrEdgeIndex[nbrEdgeI] - 1) % f.size();
|
||||
// label patchEdgeI = f[index];
|
||||
//
|
||||
// if (neighbEdges[patchEdgeI] == -1)
|
||||
// {
|
||||
// // First reference of edge
|
||||
// neighbEdges[patchEdgeI] = nbrEdgeI;
|
||||
// }
|
||||
// else if (neighbEdges[patchEdgeI] >= 0)
|
||||
// {
|
||||
// // Edge already visited. Mark as duplicate.
|
||||
// neighbEdges[patchEdgeI] = -2;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // Reset all duplicate entries to -1.
|
||||
// forAll(neighbEdges, patchEdgeI)
|
||||
// {
|
||||
// if (neighbEdges[patchEdgeI] == -2)
|
||||
// {
|
||||
// neighbEdges[patchEdgeI] = -1;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // Remove any addressing used for shared points/edges calculation
|
||||
// primitivePatch::clearOut();
|
||||
// }
|
||||
}
|
||||
neighbPointsPtr_.clear();
|
||||
neighbEdgesPtr_.clear();
|
||||
|
||||
|
||||
//const Foam::labelList& Foam::processorPolyPatch::neighbPoints() const
|
||||
//{
|
||||
// if (!neighbPointsPtr_)
|
||||
// {
|
||||
// FatalErrorIn("processorPolyPatch::neighbPoints() const")
|
||||
// << "No extended addressing calculated for patch " << name()
|
||||
// << abort(FatalError);
|
||||
// }
|
||||
// return *neighbPointsPtr_;
|
||||
//}
|
||||
//
|
||||
//
|
||||
//const Foam::labelList& Foam::processorPolyPatch::neighbEdges() const
|
||||
//{
|
||||
// if (!neighbEdgesPtr_)
|
||||
// {
|
||||
// FatalErrorIn("processorPolyPatch::neighbEdges() const")
|
||||
// << "No extended addressing calculated for patch " << name()
|
||||
// << abort(FatalError);
|
||||
// }
|
||||
// return *neighbEdgesPtr_;
|
||||
//}
|
||||
|
||||
|
||||
const Foam::labelListList& Foam::processorPolyPatch::subMeshPoints() const
|
||||
{
|
||||
if (!subMeshPointsPtr_.valid())
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
subMeshPointsPtr_.reset(new labelListList(patchIDs_.size()));
|
||||
labelListList& meshPoints = subMeshPointsPtr_();
|
||||
labelList nbrPointFace;
|
||||
labelList nbrPointIndex;
|
||||
labelList nbrEdgeFace;
|
||||
labelList nbrEdgeIndex;
|
||||
|
||||
forAll(patchIDs_, subI)
|
||||
{
|
||||
meshPoints[subI] = subPatch(subI)().meshPoints();
|
||||
// Note cannot predict exact size since opposite nPoints might
|
||||
// be different from one over here.
|
||||
IPstream fromNeighbProc(Pstream::blocking, neighbProcNo());
|
||||
|
||||
fromNeighbProc
|
||||
>> nbrPointFace
|
||||
>> nbrPointIndex
|
||||
>> nbrEdgeFace
|
||||
>> nbrEdgeIndex;
|
||||
}
|
||||
}
|
||||
return subMeshPointsPtr_();
|
||||
}
|
||||
|
||||
// Convert neighbour faces and indices into face back into
|
||||
// my edges and points.
|
||||
|
||||
const Foam::labelListList& Foam::processorPolyPatch::reverseSubMeshPoints()
|
||||
const
|
||||
{
|
||||
if (!reverseSubMeshPointsPtr_.valid())
|
||||
{
|
||||
reverseSubMeshPointsPtr_.reset(new labelListList(patchIDs_.size()));
|
||||
labelListList& meshPoints = reverseSubMeshPointsPtr_();
|
||||
// Convert points.
|
||||
// ~~~~~~~~~~~~~~~
|
||||
|
||||
forAll(patchIDs_, subI)
|
||||
neighbPointsPtr_.reset(new labelList(nPoints(), -1));
|
||||
labelList& neighbPoints = neighbPointsPtr_();
|
||||
|
||||
forAll(nbrPointFace, nbrPointI)
|
||||
{
|
||||
label subStart = starts()[subI];
|
||||
label subSize = starts()[subI+1]-subStart;
|
||||
// Find face and index in face on this side.
|
||||
const face& f = localFaces()[nbrPointFace[nbrPointI]];
|
||||
label index = (f.size() - nbrPointIndex[nbrPointI]) % f.size();
|
||||
label patchPointI = f[index];
|
||||
|
||||
faceList reverseFaces(subSize);
|
||||
forAll(reverseFaces, i)
|
||||
if (neighbPoints[patchPointI] == -1)
|
||||
{
|
||||
reverseFaces[i] = operator[](subStart+i).reverseFace();
|
||||
// First reference of point
|
||||
neighbPoints[patchPointI] = nbrPointI;
|
||||
}
|
||||
else if (neighbPoints[patchPointI] >= 0)
|
||||
{
|
||||
// Point already visited. Mark as duplicate.
|
||||
neighbPoints[patchPointI] = -2;
|
||||
}
|
||||
meshPoints[subI] = primitivePatch
|
||||
(
|
||||
faceSubList
|
||||
(
|
||||
reverseFaces,
|
||||
reverseFaces.size()
|
||||
),
|
||||
points()
|
||||
).meshPoints();
|
||||
}
|
||||
|
||||
// Reset all duplicate entries to -1.
|
||||
forAll(neighbPoints, patchPointI)
|
||||
{
|
||||
if (neighbPoints[patchPointI] == -2)
|
||||
{
|
||||
neighbPoints[patchPointI] = -1;
|
||||
}
|
||||
}
|
||||
|
||||
// Convert edges.
|
||||
// ~~~~~~~~~~~~~~
|
||||
|
||||
neighbEdgesPtr_.reset(new labelList(nEdges(), -1));
|
||||
labelList& neighbEdges = neighbEdgesPtr_();
|
||||
|
||||
forAll(nbrEdgeFace, nbrEdgeI)
|
||||
{
|
||||
// Find face and index in face on this side.
|
||||
const labelList& f = faceEdges()[nbrEdgeFace[nbrEdgeI]];
|
||||
label index = (f.size() - nbrEdgeIndex[nbrEdgeI] - 1) % f.size();
|
||||
label patchEdgeI = f[index];
|
||||
|
||||
if (neighbEdges[patchEdgeI] == -1)
|
||||
{
|
||||
// First reference of edge
|
||||
neighbEdges[patchEdgeI] = nbrEdgeI;
|
||||
}
|
||||
else if (neighbEdges[patchEdgeI] >= 0)
|
||||
{
|
||||
// Edge already visited. Mark as duplicate.
|
||||
neighbEdges[patchEdgeI] = -2;
|
||||
}
|
||||
}
|
||||
|
||||
// Reset all duplicate entries to -1.
|
||||
forAll(neighbEdges, patchEdgeI)
|
||||
{
|
||||
if (neighbEdges[patchEdgeI] == -2)
|
||||
{
|
||||
neighbEdges[patchEdgeI] = -1;
|
||||
}
|
||||
}
|
||||
|
||||
// Remove any addressing used for shared points/edges calculation
|
||||
primitivePatch::clearOut();
|
||||
}
|
||||
return reverseSubMeshPointsPtr_();
|
||||
}
|
||||
|
||||
|
||||
Foam::label Foam::processorPolyPatch::whichSubPatch(const label facei) const
|
||||
const Foam::labelList& Foam::processorPolyPatch::neighbPoints() const
|
||||
{
|
||||
label index = findSortedIndex(starts_, facei);
|
||||
|
||||
if (index < 0 || index >= starts_.size())
|
||||
if (!neighbPointsPtr_.valid())
|
||||
{
|
||||
FatalErrorIn("processorPolyPatch::whichSubPatch(const label) const")
|
||||
<< "Illegal local face index " << facei << " for patch " << name()
|
||||
<< endl << "Face index should be between 0 and "
|
||||
<< starts_[starts_.size()-1]-1 << abort(FatalError);
|
||||
FatalErrorIn("processorPolyPatch::neighbPoints() const")
|
||||
<< "No extended addressing calculated for patch " << name()
|
||||
<< abort(FatalError);
|
||||
}
|
||||
return patchIDs_[index];
|
||||
return neighbPointsPtr_();
|
||||
}
|
||||
|
||||
|
||||
const Foam::labelList& Foam::processorPolyPatch::neighbEdges() const
|
||||
{
|
||||
if (!neighbEdgesPtr_.valid())
|
||||
{
|
||||
FatalErrorIn("processorPolyPatch::neighbEdges() const")
|
||||
<< "No extended addressing calculated for patch " << name()
|
||||
<< abort(FatalError);
|
||||
}
|
||||
return neighbEdgesPtr_();
|
||||
}
|
||||
|
||||
|
||||
@ -645,7 +425,7 @@ void Foam::processorPolyPatch::initOrder
|
||||
writeOBJ(nm, pp, pp.points());
|
||||
|
||||
// Calculate my face centres
|
||||
pointField ctrs(calcFaceCentres(pp, pp.points()));
|
||||
const pointField& fc = pp.faceCentres();
|
||||
|
||||
OFstream localStr
|
||||
(
|
||||
@ -653,24 +433,22 @@ void Foam::processorPolyPatch::initOrder
|
||||
/name() + "_localFaceCentres.obj"
|
||||
);
|
||||
Pout<< "processorPolyPatch::order : "
|
||||
<< "Dumping " << ctrs.size()
|
||||
<< "Dumping " << fc.size()
|
||||
<< " local faceCentres to " << localStr.name() << endl;
|
||||
|
||||
forAll(ctrs, faceI)
|
||||
forAll(fc, faceI)
|
||||
{
|
||||
writeOBJ(localStr, ctrs[faceI]);
|
||||
writeOBJ(localStr, fc[faceI]);
|
||||
}
|
||||
}
|
||||
|
||||
if (owner())
|
||||
{
|
||||
pointField ctrs(calcFaceCentres(pp, pp.points()));
|
||||
|
||||
pointField anchors(getAnchorPoints(pp, pp.points()));
|
||||
|
||||
// Now send all info over to the neighbour
|
||||
UOPstream toNeighbour(neighbProcNo(), pBufs);
|
||||
toNeighbour << ctrs << anchors;
|
||||
toNeighbour << pp.faceCentres() << anchors;
|
||||
}
|
||||
}
|
||||
|
||||
@ -722,11 +500,8 @@ bool Foam::processorPolyPatch::order
|
||||
fromNeighbour >> masterCtrs >> masterAnchors;
|
||||
}
|
||||
|
||||
// Calculate my face centres
|
||||
pointField ctrs(calcFaceCentres(pp, pp.points()));
|
||||
|
||||
// Calculate typical distance from face centre
|
||||
scalarField tols(calcFaceTol(pp, pp.points(), ctrs));
|
||||
scalarField tols(calcFaceTol(pp, pp.points(), pp.faceCentres()));
|
||||
|
||||
if (debug || masterCtrs.size() != pp.size())
|
||||
{
|
||||
@ -764,7 +539,14 @@ bool Foam::processorPolyPatch::order
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
// 1. Try existing ordering and transformation
|
||||
bool matchedAll = matchPoints(ctrs, masterCtrs, tols, true, faceMap);
|
||||
bool matchedAll = matchPoints
|
||||
(
|
||||
pp.faceCentres(),
|
||||
masterCtrs,
|
||||
tols,
|
||||
true,
|
||||
faceMap
|
||||
);
|
||||
|
||||
if (!matchedAll || debug)
|
||||
{
|
||||
@ -791,14 +573,14 @@ bool Foam::processorPolyPatch::order
|
||||
|
||||
label vertI = 0;
|
||||
|
||||
forAll(ctrs, faceI)
|
||||
forAll(pp.faceCentres(), faceI)
|
||||
{
|
||||
label masterFaceI = faceMap[faceI];
|
||||
|
||||
if (masterFaceI != -1)
|
||||
{
|
||||
const point& c0 = masterCtrs[masterFaceI];
|
||||
const point& c1 = ctrs[faceI];
|
||||
const point& c1 = pp.faceCentres()[faceI];
|
||||
writeOBJ(ccStr, c0, c1, vertI);
|
||||
}
|
||||
}
|
||||
@ -814,7 +596,7 @@ bool Foam::processorPolyPatch::order
|
||||
<< "Cannot match vectors to faces on both sides of patch"
|
||||
<< endl
|
||||
<< " masterCtrs[0]:" << masterCtrs[0] << endl
|
||||
<< " ctrs[0]:" << ctrs[0] << endl
|
||||
<< " ctrs[0]:" << pp.faceCentres()[0] << endl
|
||||
<< " Please check your topology changes or maybe you have"
|
||||
<< " multiple separated (from cyclics) processor patches"
|
||||
<< endl
|
||||
@ -883,10 +665,6 @@ void Foam::processorPolyPatch::write(Ostream& os) const
|
||||
<< token::END_STATEMENT << nl;
|
||||
os.writeKeyword("neighbProcNo") << neighbProcNo_
|
||||
<< token::END_STATEMENT << nl;
|
||||
os.writeKeyword("patchIDs") << patchIDs_
|
||||
<< token::END_STATEMENT << nl;
|
||||
os.writeKeyword("starts") << starts_
|
||||
<< token::END_STATEMENT << nl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -34,7 +34,6 @@ Description
|
||||
|
||||
SourceFiles
|
||||
processorPolyPatch.C
|
||||
processorPolyPatchMorph.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -63,14 +62,6 @@ class processorPolyPatch
|
||||
int myProcNo_;
|
||||
int neighbProcNo_;
|
||||
|
||||
// Per patch information
|
||||
|
||||
//- Originating patches
|
||||
labelList patchIDs_;
|
||||
|
||||
//- Slice starts
|
||||
labelList starts_;
|
||||
|
||||
//- Processor-neighbbour patch face centres
|
||||
vectorField neighbFaceCentres_;
|
||||
|
||||
@ -80,20 +71,13 @@ class processorPolyPatch
|
||||
//- Processor-neighbbour patch neighbour cell centres
|
||||
vectorField neighbFaceCellCentres_;
|
||||
|
||||
//- Corresponding mesh point per local point
|
||||
mutable autoPtr<labelListList> subMeshPointsPtr_;
|
||||
//- Corresponding neighbouring local point label for every local point
|
||||
// (so localPoints()[i] == neighb.localPoints()[neighbPoints_[i]])
|
||||
mutable autoPtr<labelList> neighbPointsPtr_;
|
||||
|
||||
//- Corresponding mesh point per local point on reverse patch
|
||||
mutable autoPtr<labelListList> reverseSubMeshPointsPtr_;
|
||||
|
||||
// //- Corresponding neighbouring local edge label for every local edge
|
||||
// // (so edges()[i] == neighb.edges()[neighbEdges_[i]])
|
||||
// mutable labelList* neighbEdgesPtr_;
|
||||
|
||||
|
||||
// Private member functions
|
||||
|
||||
void checkSubPatches() const;
|
||||
//- Corresponding neighbouring local edge label for every local edge
|
||||
// (so edges()[i] == neighb.edges()[neighbEdges_[i]])
|
||||
mutable autoPtr<labelList> neighbEdgesPtr_;
|
||||
|
||||
protected:
|
||||
|
||||
@ -102,18 +86,18 @@ protected:
|
||||
//- Initialise the calculation of the patch geometry
|
||||
void initGeometry(PstreamBuffers&);
|
||||
|
||||
//- Initialise the calculation of the patch geometry with externally
|
||||
// provided geometry
|
||||
virtual void initGeometry
|
||||
(
|
||||
const primitivePatch& referPatch,
|
||||
UList<point>&,
|
||||
UList<point>&,
|
||||
UList<point>&
|
||||
)
|
||||
{
|
||||
notImplemented("processorPolyPatch::initGeometry(..)");
|
||||
}
|
||||
// //- Initialise the calculation of the patch geometry with externally
|
||||
// // provided geometry
|
||||
// virtual void initGeometry
|
||||
// (
|
||||
// const primitivePatch& referPatch,
|
||||
// UList<point>&,
|
||||
// UList<point>&,
|
||||
// UList<point>&
|
||||
// )
|
||||
// {
|
||||
// notImplemented("processorPolyPatch::initGeometry(..)");
|
||||
// }
|
||||
|
||||
//- Calculate the patch geometry
|
||||
void calcGeometry(PstreamBuffers&);
|
||||
@ -164,9 +148,7 @@ public:
|
||||
const label index,
|
||||
const polyBoundaryMesh& bm,
|
||||
const int myProcNo,
|
||||
const int neighbProcNo,
|
||||
const labelList& patchIDs,
|
||||
const labelList& starts
|
||||
const int neighbProcNo
|
||||
);
|
||||
|
||||
//- Construct from dictionary
|
||||
@ -179,11 +161,7 @@ public:
|
||||
);
|
||||
|
||||
//- Construct as copy, resetting the boundary mesh
|
||||
processorPolyPatch
|
||||
(
|
||||
const processorPolyPatch&,
|
||||
const polyBoundaryMesh&
|
||||
);
|
||||
processorPolyPatch(const processorPolyPatch&, const polyBoundaryMesh&);
|
||||
|
||||
//- Construct as given the original patch and resetting the
|
||||
// face list and boundary mesh information
|
||||
@ -193,9 +171,7 @@ public:
|
||||
const polyBoundaryMesh& bm,
|
||||
const label index,
|
||||
const label newSize,
|
||||
const label newStart,
|
||||
const labelList& patchIDs,
|
||||
const labelList& starts
|
||||
const label newStart
|
||||
);
|
||||
|
||||
//- Construct given the original patch and a map
|
||||
@ -221,9 +197,7 @@ public:
|
||||
const polyBoundaryMesh& bm,
|
||||
const label index,
|
||||
const label newSize,
|
||||
const label newStart,
|
||||
const labelList& patchIDs,
|
||||
const labelList& starts
|
||||
const label newStart
|
||||
) const
|
||||
{
|
||||
return autoPtr<polyPatch>
|
||||
@ -234,9 +208,7 @@ public:
|
||||
bm,
|
||||
index,
|
||||
newSize,
|
||||
newStart,
|
||||
patchIDs,
|
||||
starts
|
||||
newStart
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -296,16 +268,6 @@ public:
|
||||
return !owner();
|
||||
}
|
||||
|
||||
const labelList& patchIDs() const
|
||||
{
|
||||
return patchIDs_;
|
||||
}
|
||||
|
||||
const labelList& starts() const
|
||||
{
|
||||
return starts_;
|
||||
}
|
||||
|
||||
//- Return processor-neighbbour patch face centres
|
||||
const vectorField& neighbFaceCentres() const
|
||||
{
|
||||
@ -324,37 +286,33 @@ public:
|
||||
return neighbFaceCellCentres_;
|
||||
}
|
||||
|
||||
//- Transform a patch-based field
|
||||
template<class T>
|
||||
void transform(Field<T>& l) const;
|
||||
//- Return neighbour point labels. WIP.
|
||||
const labelList& neighbPoints() const;
|
||||
|
||||
//- Return neighbour edge labels. WIP.
|
||||
const labelList& neighbEdges() const;
|
||||
|
||||
//- Transform a patch-based field from other side to this side.
|
||||
virtual bool doTransform() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
virtual void transform(scalarField& l) const
|
||||
{
|
||||
transform(l);
|
||||
}
|
||||
{}
|
||||
virtual void transform(vectorField& l) const
|
||||
{
|
||||
transform(l);
|
||||
}
|
||||
{}
|
||||
virtual void transform(sphericalTensorField& l) const
|
||||
{
|
||||
transform(l);
|
||||
}
|
||||
{}
|
||||
virtual void transform(diagTensorField& l) const
|
||||
{
|
||||
transform(l);
|
||||
}
|
||||
{}
|
||||
virtual void transform(symmTensorField& l) const
|
||||
{
|
||||
transform(l);
|
||||
}
|
||||
{}
|
||||
virtual void transform(tensorField& l) const
|
||||
{
|
||||
transform(l);
|
||||
}
|
||||
{}
|
||||
|
||||
//- Transform a patch-based position
|
||||
virtual void transformPosition(pointField& l) const;
|
||||
//- Transform a patch-based position from other side to this side
|
||||
virtual void transformPosition(pointField& l) const
|
||||
{}
|
||||
|
||||
//- Are the planes separated.
|
||||
virtual bool separated() const
|
||||
@ -373,24 +331,7 @@ public:
|
||||
//- Are the cyclic planes parallel.
|
||||
virtual bool parallel() const
|
||||
{
|
||||
forAll(patchIDs_, i)
|
||||
{
|
||||
label patchI = patchIDs_[i];
|
||||
|
||||
if (patchI != -1)
|
||||
{
|
||||
if
|
||||
(
|
||||
!refCast<const coupledPolyPatch>
|
||||
(
|
||||
boundaryMesh()[patchI]
|
||||
).parallel()
|
||||
)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
notImplemented("processorPolyPatch::parallel()");
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -408,104 +349,6 @@ public:
|
||||
return tensor::zero;
|
||||
}
|
||||
|
||||
//- Find sub patch for local face. -1 for internal faces or label of
|
||||
// cyclic patch.
|
||||
label whichSubPatch(const label facei) const;
|
||||
|
||||
//- Slice patch
|
||||
autoPtr<primitivePatch> subPatch(const label subI) const
|
||||
{
|
||||
const faceList& thisFaces = static_cast<const faceList&>(*this);
|
||||
|
||||
return autoPtr<primitivePatch>
|
||||
(
|
||||
new primitivePatch
|
||||
(
|
||||
faceSubList
|
||||
(
|
||||
thisFaces,
|
||||
this->starts_[subI+1]-this->starts_[subI],
|
||||
this->starts_[subI]
|
||||
),
|
||||
this->points()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
//- Slice patchlist to subpatch
|
||||
template<class T>
|
||||
const typename List<T>::subList subSlice
|
||||
(
|
||||
const UList<T>& l,
|
||||
const label subI
|
||||
) const
|
||||
{
|
||||
return typename List<T>::subList
|
||||
(
|
||||
l,
|
||||
this->starts_[subI+1]-this->starts_[subI],
|
||||
this->starts_[subI]
|
||||
);
|
||||
}
|
||||
|
||||
//- Slice patchlist to subpatch
|
||||
template<class T>
|
||||
typename List<T>::subList subSlice
|
||||
(
|
||||
UList<T>& l,
|
||||
const label subI
|
||||
)
|
||||
{
|
||||
return typename List<T>::subList
|
||||
(
|
||||
l,
|
||||
this->starts_[subI+1]-this->starts_[subI],
|
||||
this->starts_[subI]
|
||||
);
|
||||
}
|
||||
|
||||
//- Slice patchField to subpatch
|
||||
template<class T>
|
||||
const typename Field<T>::subField subSlice
|
||||
(
|
||||
const Field<T>& l,
|
||||
const label subI
|
||||
) const
|
||||
{
|
||||
return typename Field<T>::subList
|
||||
(
|
||||
l,
|
||||
this->starts_[subI+1]-this->starts_[subI],
|
||||
this->starts_[subI]
|
||||
);
|
||||
}
|
||||
|
||||
//- Slice patchField to subpatch
|
||||
template<class T>
|
||||
typename Field<T>::subField subSlice
|
||||
(
|
||||
Field<T>& l,
|
||||
const label subI
|
||||
)
|
||||
{
|
||||
return typename Field<T>::subList
|
||||
(
|
||||
l,
|
||||
this->starts_[subI+1]-this->starts_[subI],
|
||||
this->starts_[subI]
|
||||
);
|
||||
}
|
||||
|
||||
// //- Return neighbour edge labels. This is for my local edge (-1 or) the
|
||||
// // corresponding local edge on the other side. See above for -1 cause.
|
||||
// const labelList& neighbEdges() const;
|
||||
|
||||
//- Mesh point labels per local point per sub patch.
|
||||
const labelListList& subMeshPoints() const;
|
||||
|
||||
//- Mesh point labels per local point on reversed faces per sub patch.
|
||||
const labelListList& reverseSubMeshPoints() const;
|
||||
|
||||
//- Initialize ordering for primitivePatch. Does not
|
||||
// refer to *this (except for name() and type() etc.)
|
||||
virtual void initOrder(PstreamBuffers&, const primitivePatch&) const;
|
||||
@ -535,12 +378,6 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "processorPolyPatchTemplates.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -0,0 +1,227 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ 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 2 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "processorCyclicPolyPatch.H"
|
||||
#include "SubField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
//namespace Foam
|
||||
//{
|
||||
// defineTypeNameAndDebug(processorCyclicPolyPatch, 0);
|
||||
// addToRunTimeSelectionTable(polyPatch, processorCyclicPolyPatch, dictionary);
|
||||
//}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
|
||||
(
|
||||
const word& name,
|
||||
const label size,
|
||||
const label start,
|
||||
const label index,
|
||||
const polyBoundaryMesh& bm,
|
||||
const int myProcNo,
|
||||
const int neighbProcNo,
|
||||
const word& referPatchName
|
||||
)
|
||||
:
|
||||
processorPolyPatch(name, size, start, index, bm, myProcNo, neighbProcNo),
|
||||
referPatchName_(referPatchName),
|
||||
referPatchID_(-1)
|
||||
{}
|
||||
|
||||
|
||||
Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
|
||||
(
|
||||
const word& name,
|
||||
const dictionary& dict,
|
||||
const label index,
|
||||
const polyBoundaryMesh& bm
|
||||
)
|
||||
:
|
||||
processorPolyPatch(name, dict, index, bm),
|
||||
referPatchName_(dict.lookup("referPatch")),
|
||||
referPatchID_(-1)
|
||||
{}
|
||||
|
||||
|
||||
Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
|
||||
(
|
||||
const processorCyclicPolyPatch& pp,
|
||||
const polyBoundaryMesh& bm
|
||||
)
|
||||
:
|
||||
processorPolyPatch(pp, bm),
|
||||
referPatchName_(pp.referPatchName()),
|
||||
referPatchID_(-1)
|
||||
{}
|
||||
|
||||
|
||||
Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
|
||||
(
|
||||
const processorCyclicPolyPatch& pp,
|
||||
const polyBoundaryMesh& bm,
|
||||
const label index,
|
||||
const label newSize,
|
||||
const label newStart,
|
||||
const word& referPatchName
|
||||
)
|
||||
:
|
||||
processorPolyPatch(pp, bm, index, newSize, newStart),
|
||||
referPatchName_(referPatchName),
|
||||
referPatchID_(-1)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::processorCyclicPolyPatch::~processorCyclicPolyPatch()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
void Foam::processorCyclicPolyPatch::initGeometry(PstreamBuffers& pBufs)
|
||||
{
|
||||
Pout<< "**processorCyclicPolyPatch::initGeometry()" << endl;
|
||||
|
||||
// Send over processorPolyPatch data
|
||||
processorPolyPatch::initGeometry(pBufs);
|
||||
}
|
||||
|
||||
|
||||
void Foam::processorCyclicPolyPatch::calcGeometry(PstreamBuffers& pBufs)
|
||||
{
|
||||
Pout<< "processorCyclicPolyPatch::calcGeometry() for " << name() << endl;
|
||||
|
||||
// Receive and initialise processorPolyPatch data
|
||||
processorPolyPatch::calcGeometry(pBufs);
|
||||
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
|
||||
// Where do we store the calculated transformation?
|
||||
// - on the processor patch?
|
||||
// - on the underlying cyclic patch?
|
||||
// - or do we not auto-calculate the transformation but
|
||||
// have option of reading it.
|
||||
|
||||
// Update underlying cyclic
|
||||
coupledPolyPatch& pp = const_cast<coupledPolyPatch&>(referPatch());
|
||||
|
||||
Pout<< "updating geometry on refered patch:" << pp.name() << endl;
|
||||
|
||||
pp.calcGeometry
|
||||
(
|
||||
pp,
|
||||
faceCentres(),
|
||||
faceAreas(),
|
||||
faceCellCentres(),
|
||||
neighbFaceCentres(),
|
||||
neighbFaceAreas(),
|
||||
neighbFaceCellCentres()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::processorCyclicPolyPatch::initMovePoints
|
||||
(
|
||||
PstreamBuffers& pBufs,
|
||||
const pointField& p
|
||||
)
|
||||
{
|
||||
// Recalculate geometry
|
||||
initGeometry(pBufs);
|
||||
}
|
||||
|
||||
|
||||
void Foam::processorCyclicPolyPatch::movePoints
|
||||
(
|
||||
PstreamBuffers& pBufs,
|
||||
const pointField&
|
||||
)
|
||||
{
|
||||
calcGeometry(pBufs);
|
||||
}
|
||||
|
||||
|
||||
void Foam::processorCyclicPolyPatch::initUpdateMesh(PstreamBuffers& pBufs)
|
||||
{
|
||||
processorPolyPatch::initUpdateMesh(pBufs);
|
||||
}
|
||||
|
||||
|
||||
void Foam::processorCyclicPolyPatch::updateMesh(PstreamBuffers& pBufs)
|
||||
{
|
||||
referPatchID_ = -1;
|
||||
processorPolyPatch::updateMesh(pBufs);
|
||||
}
|
||||
|
||||
|
||||
void Foam::processorCyclicPolyPatch::initOrder
|
||||
(
|
||||
PstreamBuffers& pBufs,
|
||||
const primitivePatch& pp
|
||||
) const
|
||||
{
|
||||
// For now use the same algorithm as processorPolyPatch
|
||||
processorPolyPatch::initOrder(pBufs, pp);
|
||||
}
|
||||
|
||||
|
||||
// Return new ordering. Ordering is -faceMap: for every face index
|
||||
// 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)
|
||||
bool Foam::processorCyclicPolyPatch::order
|
||||
(
|
||||
PstreamBuffers& pBufs,
|
||||
const primitivePatch& pp,
|
||||
labelList& faceMap,
|
||||
labelList& rotation
|
||||
) const
|
||||
{
|
||||
// For now use the same algorithm as processorPolyPatch
|
||||
return processorPolyPatch::order(pBufs, pp, faceMap, rotation);
|
||||
}
|
||||
|
||||
|
||||
void Foam::processorCyclicPolyPatch::write(Ostream& os) const
|
||||
{
|
||||
processorPolyPatch::write(os);
|
||||
os.writeKeyword("referPatch") << referPatchName_
|
||||
<< token::END_STATEMENT << nl;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,339 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ 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 2 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::processorCyclicPolyPatch
|
||||
|
||||
Description
|
||||
Neighbour processor patch.
|
||||
|
||||
Note: morph patch face ordering is geometric.
|
||||
|
||||
SourceFiles
|
||||
processorCyclicPolyPatch.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef processorCyclicPolyPatch_H
|
||||
#define processorCyclicPolyPatch_H
|
||||
|
||||
#include "processorPolyPatch.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class processorCyclicPolyPatch Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class processorCyclicPolyPatch
|
||||
:
|
||||
public processorPolyPatch
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Name of originating patch
|
||||
const word referPatchName_;
|
||||
|
||||
//- Index of originating patch
|
||||
mutable label referPatchID_;
|
||||
|
||||
|
||||
// Private member functions
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Protected Member functions
|
||||
|
||||
//- Initialise the calculation of the patch geometry
|
||||
void initGeometry(PstreamBuffers&);
|
||||
|
||||
// //- Initialise the calculation of the patch geometry with externally
|
||||
// // provided geometry
|
||||
// virtual void initGeometry
|
||||
// (
|
||||
// const primitivePatch& referPatch,
|
||||
// UList<point>&,
|
||||
// UList<point>&,
|
||||
// UList<point>&
|
||||
// )
|
||||
// {
|
||||
// notImplemented("processorCyclicPolyPatch::initGeometry(..)");
|
||||
// }
|
||||
|
||||
//- Calculate the patch geometry
|
||||
void calcGeometry(PstreamBuffers&);
|
||||
|
||||
//- Calculate the patch geometry with externally
|
||||
// provided geometry
|
||||
virtual void calcGeometry
|
||||
(
|
||||
const primitivePatch& referPatch,
|
||||
const UList<point>& thisCtrs,
|
||||
const UList<point>& thisAreas,
|
||||
const UList<point>& thisCc,
|
||||
const UList<point>& nbrCtrs,
|
||||
const UList<point>& nbrAreas,
|
||||
const UList<point>& nbrCc
|
||||
)
|
||||
{
|
||||
notImplemented("processorCyclicPolyPatch::calcGeometry(..)");
|
||||
}
|
||||
|
||||
//- Initialise the patches for moving points
|
||||
void initMovePoints(PstreamBuffers&, const pointField&);
|
||||
|
||||
//- Correct patches after moving points
|
||||
void movePoints(PstreamBuffers&, const pointField&);
|
||||
|
||||
//- Initialise the update of the patch topology
|
||||
virtual void initUpdateMesh(PstreamBuffers&);
|
||||
|
||||
//- Update of the patch topology
|
||||
virtual void updateMesh(PstreamBuffers&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("processorCyclic");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
processorCyclicPolyPatch
|
||||
(
|
||||
const word& name,
|
||||
const label size,
|
||||
const label start,
|
||||
const label index,
|
||||
const polyBoundaryMesh& bm,
|
||||
const int myProcNo,
|
||||
const int neighbProcNo,
|
||||
const word& referPatchName
|
||||
);
|
||||
|
||||
//- Construct from dictionary
|
||||
processorCyclicPolyPatch
|
||||
(
|
||||
const word& name,
|
||||
const dictionary& dict,
|
||||
const label index,
|
||||
const polyBoundaryMesh&
|
||||
);
|
||||
|
||||
//- Construct as copy, resetting the boundary mesh
|
||||
processorCyclicPolyPatch
|
||||
(
|
||||
const processorCyclicPolyPatch&,
|
||||
const polyBoundaryMesh&
|
||||
);
|
||||
|
||||
//- Construct as given the original patch and resetting the
|
||||
// face list and boundary mesh information
|
||||
processorCyclicPolyPatch
|
||||
(
|
||||
const processorCyclicPolyPatch& pp,
|
||||
const polyBoundaryMesh& bm,
|
||||
const label index,
|
||||
const label newSize,
|
||||
const label newStart,
|
||||
const word& referPatchName
|
||||
);
|
||||
|
||||
//- Construct and return a clone, resetting the boundary mesh
|
||||
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
|
||||
{
|
||||
return autoPtr<polyPatch>(new processorCyclicPolyPatch(*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 word& referPatchName
|
||||
) const
|
||||
{
|
||||
return autoPtr<polyPatch>
|
||||
(
|
||||
new processorCyclicPolyPatch
|
||||
(
|
||||
refCast<const processorCyclicPolyPatch>(*this),
|
||||
bm,
|
||||
index,
|
||||
newSize,
|
||||
newStart,
|
||||
referPatchName
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
virtual ~processorCyclicPolyPatch();
|
||||
|
||||
|
||||
// Member functions
|
||||
|
||||
const word& referPatchName() const
|
||||
{
|
||||
return referPatchName_;
|
||||
}
|
||||
|
||||
//- Referring patchID.
|
||||
label referPatchID() const
|
||||
{
|
||||
if (referPatchID_ == -1)
|
||||
{
|
||||
referPatchID_ = this->boundaryMesh().findPatchID
|
||||
(
|
||||
referPatchName_
|
||||
);
|
||||
if (referPatchID_ == -1)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"processorCyclicPolyPatch::referPatchID() const"
|
||||
) << "Illegal referPatch name " << referPatchName_
|
||||
<< endl << "Valid patch names are "
|
||||
<< this->boundaryMesh().names()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
return referPatchID_;
|
||||
}
|
||||
|
||||
const coupledPolyPatch& referPatch() const
|
||||
{
|
||||
const polyPatch& pp = this->boundaryMesh()[referPatchID()];
|
||||
return refCast<const processorCyclicPolyPatch>(pp);
|
||||
}
|
||||
|
||||
//- Transform a patch-based field from other side to this side.
|
||||
virtual bool doTransform() const
|
||||
{
|
||||
return referPatch().doTransform();
|
||||
}
|
||||
virtual void transform(scalarField& l) const
|
||||
{
|
||||
referPatch().transform(l);
|
||||
}
|
||||
virtual void transform(vectorField& l) const
|
||||
{
|
||||
referPatch().transform(l);
|
||||
}
|
||||
virtual void transform(sphericalTensorField& l) const
|
||||
{
|
||||
referPatch().transform(l);
|
||||
}
|
||||
virtual void transform(diagTensorField& l) const
|
||||
{
|
||||
referPatch().transform(l);
|
||||
}
|
||||
virtual void transform(symmTensorField& l) const
|
||||
{
|
||||
referPatch().transform(l);
|
||||
}
|
||||
virtual void transform(tensorField& l) const
|
||||
{
|
||||
referPatch().transform(l);
|
||||
}
|
||||
|
||||
//- Transform a patch-based position from other side to this side
|
||||
virtual void transformPosition(pointField& l) const
|
||||
{
|
||||
referPatch().transform(l);
|
||||
}
|
||||
|
||||
//- Are the planes separated.
|
||||
virtual bool separated() const
|
||||
{
|
||||
return referPatch().separated();
|
||||
}
|
||||
|
||||
//- If the planes are separated the separation vector.
|
||||
virtual const vector& separation() const
|
||||
{
|
||||
return referPatch().separation();
|
||||
}
|
||||
|
||||
//- Are the cyclic planes parallel.
|
||||
virtual bool parallel() const
|
||||
{
|
||||
return referPatch().parallel();
|
||||
}
|
||||
|
||||
//- Return face transformation tensor.
|
||||
virtual const tensor& forwardT() const
|
||||
{
|
||||
return referPatch().forwardT();
|
||||
}
|
||||
|
||||
//- Return neighbour-cell transformation tensor.
|
||||
virtual const tensor& reverseT() const
|
||||
{
|
||||
return referPatch().reverseT();
|
||||
}
|
||||
|
||||
//- Initialize ordering for primitivePatch. Does not
|
||||
// refer to *this (except for name() and type() etc.)
|
||||
virtual void initOrder(PstreamBuffers&, const primitivePatch&) 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;
|
||||
|
||||
|
||||
//- Write the polyPatch data as a dictionary
|
||||
virtual void write(Ostream&) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -90,8 +90,8 @@ class polyPatch
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Calculate labels of mesh edges
|
||||
void calcMeshEdges() const;
|
||||
// //- Calculate labels of mesh edges
|
||||
// void calcMeshEdges() const;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
@ -100,11 +100,14 @@ public:
|
||||
class transform
|
||||
{
|
||||
public:
|
||||
//- Transform Field
|
||||
template<class T>
|
||||
void operator()(const coupledPolyPatch& cpp, Field<T>& fld) const
|
||||
{
|
||||
cpp.transform(fld);
|
||||
}
|
||||
|
||||
//- Transform generic container
|
||||
template<class T, template<class> class Container>
|
||||
void operator()(const coupledPolyPatch& cpp, Container<T>& map)
|
||||
const
|
||||
|
||||
@ -114,43 +114,23 @@ void Foam::syncTools::syncPointMap
|
||||
const processorPolyPatch& procPatch =
|
||||
refCast<const processorPolyPatch>(patches[patchI]);
|
||||
|
||||
//TBD: optimisation for single subpatch.
|
||||
// Get data per patchPoint in neighbouring point numbers.
|
||||
|
||||
List<Map<T> > patchInfo(procPatch.patchIDs().size());
|
||||
const labelList& meshPts = procPatch.meshPoints();
|
||||
const labelList& nbrPts = procPatch.neighbPoints();
|
||||
|
||||
forAll(procPatch.patchIDs(), subI)
|
||||
// Extract local values. Create map from nbrPoint to value.
|
||||
// Note: how small initial size?
|
||||
Map<T> patchInfo(meshPts.size() / 20);
|
||||
|
||||
forAll(meshPts, i)
|
||||
{
|
||||
label subPatchI = procPatch.patchIDs()[subI];
|
||||
typename Map<T>::const_iterator iter =
|
||||
pointValues.find(meshPts[i]);
|
||||
|
||||
const labelList& subMeshPts =
|
||||
procPatch.subMeshPoints()[subI];
|
||||
|
||||
Map<T>& subPatchInfo = patchInfo[subI];
|
||||
subPatchInfo.resize(subMeshPts.size()/20);
|
||||
forAll(subMeshPts, patchPointI)
|
||||
if (iter != pointValues.end())
|
||||
{
|
||||
label pointI = subMeshPts[patchPointI];
|
||||
|
||||
typename Map<T>::const_iterator iter =
|
||||
pointValues.find(pointI);
|
||||
|
||||
if (iter != pointValues.end())
|
||||
{
|
||||
subPatchInfo.insert(patchPointI, iter());
|
||||
}
|
||||
}
|
||||
|
||||
if (subPatchI != -1)
|
||||
{
|
||||
// Apply transform.
|
||||
top
|
||||
(
|
||||
refCast<const coupledPolyPatch>
|
||||
(
|
||||
patches[subPatchI]
|
||||
),
|
||||
subPatchInfo
|
||||
);
|
||||
patchInfo.insert(nbrPts[i], iter());
|
||||
}
|
||||
}
|
||||
|
||||
@ -173,34 +153,29 @@ void Foam::syncTools::syncPointMap
|
||||
const processorPolyPatch& procPatch =
|
||||
refCast<const processorPolyPatch>(patches[patchI]);
|
||||
|
||||
List<Map<T> > nbrPatchInfo;
|
||||
IPstream fromNb(Pstream::blocking, procPatch.neighbProcNo());
|
||||
Map<T> nbrPatchInfo(fromNb);
|
||||
|
||||
// Transform
|
||||
top(procPatch, nbrPatchInfo);
|
||||
|
||||
const labelList& meshPts = procPatch.meshPoints();
|
||||
|
||||
// Only update those values which come from neighbour
|
||||
forAllConstIter
|
||||
(
|
||||
typename Map<T>,
|
||||
nbrPatchInfo,
|
||||
nbrIter
|
||||
)
|
||||
{
|
||||
IPstream fromNbr
|
||||
combine
|
||||
(
|
||||
Pstream::blocking,
|
||||
procPatch.neighbProcNo()
|
||||
pointValues,
|
||||
cop,
|
||||
meshPts[nbrIter.key()],
|
||||
nbrIter()
|
||||
);
|
||||
fromNbr >> nbrPatchInfo;
|
||||
}
|
||||
|
||||
forAll(procPatch.patchIDs(), subI)
|
||||
{
|
||||
const labelList& subMeshPts =
|
||||
procPatch.reverseSubMeshPoints()[subI];
|
||||
|
||||
const Map<T>& nbrSubInfo = nbrPatchInfo[subI];
|
||||
|
||||
forAllConstIter(typename Map<T>, nbrSubInfo, iter)
|
||||
{
|
||||
label meshPointI = subMeshPts[iter.key()];
|
||||
combine
|
||||
(
|
||||
pointValues,
|
||||
cop,
|
||||
meshPointI,
|
||||
iter()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -217,6 +192,7 @@ void Foam::syncTools::syncPointMap
|
||||
if (cycPatch.owner())
|
||||
{
|
||||
// Owner does all.
|
||||
|
||||
const cyclicPolyPatch& nbrPatch = cycPatch.neighbPatch();
|
||||
const edgeList& coupledPoints = cycPatch.coupledPoints();
|
||||
const labelList& meshPtsA = cycPatch.meshPoints();
|
||||
@ -247,9 +223,9 @@ void Foam::syncTools::syncPointMap
|
||||
}
|
||||
}
|
||||
|
||||
// Transform
|
||||
top(cycPatch, half0Values);
|
||||
top(nbrPatch, half1Values);
|
||||
// Transform to receiving side
|
||||
top(cycPatch, half1Values);
|
||||
top(nbrPatch, half0Values);
|
||||
|
||||
forAll(coupledPoints, i)
|
||||
{
|
||||
@ -365,7 +341,7 @@ void Foam::syncTools::syncPointMap
|
||||
}
|
||||
else
|
||||
{
|
||||
// Send to master
|
||||
// Slave: send to master
|
||||
{
|
||||
OPstream toMaster(Pstream::blocking, Pstream::masterNo());
|
||||
toMaster << sharedPointValues;
|
||||
@ -453,56 +429,27 @@ void Foam::syncTools::syncEdgeMap
|
||||
const processorPolyPatch& procPatch =
|
||||
refCast<const processorPolyPatch>(patches[patchI]);
|
||||
|
||||
// Data per sub patch
|
||||
List<EdgeMap<T> > patchInfo(procPatch.patchIDs().size());
|
||||
|
||||
forAll(procPatch.patchIDs(), subI)
|
||||
// Get data per patch edge in neighbouring edge.
|
||||
|
||||
const edgeList& edges = procPatch.edges();
|
||||
const labelList& meshPts = procPatch.meshPoints();
|
||||
const labelList& nbrPts = procPatch.neighbPoints();
|
||||
|
||||
EdgeMap<T> patchInfo(edges.size() / 20);
|
||||
|
||||
forAll(edges, i)
|
||||
{
|
||||
label subPatchI = procPatch.patchIDs()[subI];
|
||||
label subStart = procPatch.starts()[subI];
|
||||
label subSize = procPatch.starts()[subI+1]-subStart;
|
||||
const edge& e = edges[i];
|
||||
const edge meshEdge(meshPts[e[0]], meshPts[e[1]]);
|
||||
|
||||
primitivePatch subPatch
|
||||
(
|
||||
faceSubList
|
||||
(
|
||||
procPatch,
|
||||
subSize,
|
||||
subStart
|
||||
),
|
||||
procPatch.points()
|
||||
);
|
||||
const labelList& subMeshPts = subPatch.meshPoints();
|
||||
const edgeList& subEdges = subPatch.edges();
|
||||
typename EdgeMap<T>::const_iterator iter =
|
||||
edgeValues.find(meshEdge);
|
||||
|
||||
EdgeMap<T>& subPatchInfo = patchInfo[subI];
|
||||
subPatchInfo.resize(subEdges.size());
|
||||
|
||||
forAll(subEdges, i)
|
||||
if (iter != edgeValues.end())
|
||||
{
|
||||
const edge& e = subEdges[i];
|
||||
const edge meshEdge(subMeshPts[e[0]], subMeshPts[e[1]]);
|
||||
|
||||
typename EdgeMap<T>::const_iterator iter =
|
||||
edgeValues.find(meshEdge);
|
||||
|
||||
if (iter != edgeValues.end())
|
||||
{
|
||||
subPatchInfo.insert(e, iter());
|
||||
}
|
||||
}
|
||||
|
||||
if (subPatchI != -1)
|
||||
{
|
||||
// Apply transform.
|
||||
top
|
||||
(
|
||||
refCast<const coupledPolyPatch>
|
||||
(
|
||||
patches[subPatchI]
|
||||
),
|
||||
subPatchInfo
|
||||
);
|
||||
const edge nbrEdge(nbrPts[e[0]], nbrPts[e[1]]);
|
||||
patchInfo.insert(nbrEdge, iter());
|
||||
}
|
||||
}
|
||||
|
||||
@ -525,7 +472,7 @@ void Foam::syncTools::syncEdgeMap
|
||||
const processorPolyPatch& procPatch =
|
||||
refCast<const processorPolyPatch>(patches[patchI]);
|
||||
|
||||
List<EdgeMap<T> > nbrPatchInfo;
|
||||
EdgeMap<T> nbrPatchInfo;
|
||||
{
|
||||
IPstream fromNbr
|
||||
(
|
||||
@ -535,26 +482,30 @@ void Foam::syncTools::syncEdgeMap
|
||||
fromNbr >> nbrPatchInfo;
|
||||
}
|
||||
|
||||
forAll(procPatch.patchIDs(), subI)
|
||||
// Apply transform to convert to this side properties.
|
||||
top(procPatch, nbrPatchInfo);
|
||||
|
||||
|
||||
// Only update those values which come from neighbour
|
||||
const labelList& meshPts = procPatch.meshPoints();
|
||||
|
||||
forAllConstIter
|
||||
(
|
||||
typename EdgeMap<T>,
|
||||
nbrPatchInfo,
|
||||
nbrIter
|
||||
)
|
||||
{
|
||||
const labelList& subMeshPts =
|
||||
procPatch.subMeshPoints()[subI];
|
||||
const edge& e = nbrIter.key();
|
||||
const edge meshEdge(meshPts[e[0]], meshPts[e[1]]);
|
||||
|
||||
const EdgeMap<T>& nbrSubInfo = nbrPatchInfo[subI];
|
||||
|
||||
forAllConstIter(typename EdgeMap<T>, nbrSubInfo, iter)
|
||||
{
|
||||
const edge& e = iter.key();
|
||||
const edge meshEdge(subMeshPts[e[0]], subMeshPts[e[1]]);
|
||||
|
||||
combine
|
||||
(
|
||||
edgeValues,
|
||||
cop,
|
||||
meshEdge, // edge
|
||||
iter() // value
|
||||
);
|
||||
}
|
||||
combine
|
||||
(
|
||||
edgeValues,
|
||||
cop,
|
||||
meshEdge, // edge
|
||||
nbrIter() // value
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -616,9 +567,9 @@ void Foam::syncTools::syncEdgeMap
|
||||
}
|
||||
}
|
||||
|
||||
// Transform
|
||||
top(cycPatch, half0Values);
|
||||
top(nbrPatch, half1Values);
|
||||
// Transform to this side
|
||||
top(cycPatch, half1Values);
|
||||
top(nbrPatch, half0Values);
|
||||
|
||||
|
||||
// Extract and combine information
|
||||
@ -869,38 +820,16 @@ void Foam::syncTools::syncPointList
|
||||
const processorPolyPatch& procPatch =
|
||||
refCast<const processorPolyPatch>(patches[patchI]);
|
||||
|
||||
//TBD: optimisation for single subpatch.
|
||||
// Get data per patchPoint in neighbouring point numbers.
|
||||
Field<T> patchInfo(procPatch.nPoints());
|
||||
|
||||
// Data per sub patch
|
||||
List<List<T> > patchInfo(procPatch.patchIDs().size());
|
||||
const labelList& meshPts = procPatch.meshPoints();
|
||||
const labelList& nbrPts = procPatch.neighbPoints();
|
||||
|
||||
forAll(procPatch.patchIDs(), subI)
|
||||
forAll(nbrPts, pointI)
|
||||
{
|
||||
label subPatchI = procPatch.patchIDs()[subI];
|
||||
|
||||
const labelList& subMeshPts =
|
||||
procPatch.subMeshPoints()[subI];
|
||||
|
||||
List<T>& subPatchInfo = patchInfo[subI];
|
||||
subPatchInfo.setSize(subMeshPts.size());
|
||||
forAll(subPatchInfo, i)
|
||||
{
|
||||
subPatchInfo[i] = pointValues[subMeshPts[i]];
|
||||
}
|
||||
|
||||
if (subPatchI != -1)
|
||||
{
|
||||
// Apply transform.
|
||||
SubField<T> slice(subPatchInfo, subPatchInfo.size());
|
||||
top
|
||||
(
|
||||
refCast<const coupledPolyPatch>
|
||||
(
|
||||
patches[subPatchI]
|
||||
),
|
||||
reinterpret_cast<Field<T>&>(slice)
|
||||
);
|
||||
}
|
||||
label nbrPointI = nbrPts[pointI];
|
||||
patchInfo[nbrPointI] = pointValues[meshPts[pointI]];
|
||||
}
|
||||
|
||||
OPstream toNbr(Pstream::blocking, procPatch.neighbProcNo());
|
||||
@ -922,10 +851,8 @@ void Foam::syncTools::syncPointList
|
||||
const processorPolyPatch& procPatch =
|
||||
refCast<const processorPolyPatch>(patches[patchI]);
|
||||
|
||||
List<List<T> > nbrPatchInfo;
|
||||
Field<T> nbrPatchInfo(procPatch.nPoints());
|
||||
{
|
||||
// We do not know the number of points on the other side
|
||||
// so cannot use Pstream::read.
|
||||
IPstream fromNbr
|
||||
(
|
||||
Pstream::blocking,
|
||||
@ -934,17 +861,15 @@ void Foam::syncTools::syncPointList
|
||||
fromNbr >> nbrPatchInfo;
|
||||
}
|
||||
|
||||
forAll(procPatch.patchIDs(), subI)
|
||||
{
|
||||
const labelList& subMeshPts =
|
||||
procPatch.reverseSubMeshPoints()[subI];
|
||||
const List<T>& nbrSubInfo = nbrPatchInfo[subI];
|
||||
// Transform to this side
|
||||
top(procPatch, nbrPatchInfo);
|
||||
|
||||
forAll(subMeshPts, i)
|
||||
{
|
||||
label meshPointI = subMeshPts[i];
|
||||
cop(pointValues[meshPointI], nbrSubInfo[i]);
|
||||
}
|
||||
const labelList& meshPts = procPatch.meshPoints();
|
||||
|
||||
forAll(meshPts, pointI)
|
||||
{
|
||||
label meshPointI = meshPts[pointI];
|
||||
cop(pointValues[meshPointI], nbrPatchInfo[pointI]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -979,11 +904,11 @@ void Foam::syncTools::syncPointList
|
||||
|
||||
//SubField<T> slice0(half0Values, half0Values.size());
|
||||
//SubField<T> slice1(half1Values, half1Values.size());
|
||||
//top(cycPatch, reinterpret_cast<Field<T>&>(slice0));
|
||||
//top(nbrPatch, reinterpret_cast<Field<T>&>(slice1));
|
||||
//top(cycPatch, reinterpret_cast<Field<T>&>(slice1));
|
||||
//top(nbrPatch, reinterpret_cast<Field<T>&>(slice0));
|
||||
|
||||
top(cycPatch, half0Values);
|
||||
top(nbrPatch, half1Values);
|
||||
top(cycPatch, half1Values);
|
||||
top(nbrPatch, half0Values);
|
||||
|
||||
forAll(coupledPoints, i)
|
||||
{
|
||||
@ -1001,7 +926,7 @@ void Foam::syncTools::syncPointList
|
||||
if (pd.nGlobalPoints() > 0)
|
||||
{
|
||||
// Values on shared points.
|
||||
List<T> sharedPts(pd.nGlobalPoints(), nullValue);
|
||||
Field<T> sharedPts(pd.nGlobalPoints(), nullValue);
|
||||
|
||||
forAll(pd.sharedPointLabels(), i)
|
||||
{
|
||||
@ -1053,7 +978,7 @@ void Foam::syncTools::syncPointList
|
||||
return;
|
||||
}
|
||||
|
||||
List<T> meshValues(mesh.nPoints(), nullValue);
|
||||
Field<T> meshValues(mesh.nPoints(), nullValue);
|
||||
|
||||
forAll(meshPoints, i)
|
||||
{
|
||||
@ -1120,56 +1045,17 @@ void Foam::syncTools::syncEdgeList
|
||||
const processorPolyPatch& procPatch =
|
||||
refCast<const processorPolyPatch>(patches[patchI]);
|
||||
|
||||
//TBD: optimisation for single subpatch.
|
||||
const labelList& meshEdges = procPatch.meshEdges();
|
||||
const labelList& neighbEdges = procPatch.neighbEdges();
|
||||
|
||||
// Data per sub patch
|
||||
List<List<T> > patchInfo(procPatch.patchIDs().size());
|
||||
// Get region per patch edge in neighbouring edge numbers.
|
||||
Field<T> patchInfo(procPatch.nEdges(), nullValue);
|
||||
|
||||
forAll(procPatch.patchIDs(), subI)
|
||||
forAll(neighbEdges, edgeI)
|
||||
{
|
||||
label subPatchI = procPatch.patchIDs()[subI];
|
||||
label subStart = procPatch.starts()[subI];
|
||||
label subSize = procPatch.starts()[subI+1]-subStart;
|
||||
label nbrEdgeI = neighbEdges[edgeI];
|
||||
|
||||
primitivePatch subPatch
|
||||
(
|
||||
faceSubList
|
||||
(
|
||||
procPatch,
|
||||
subSize,
|
||||
subStart
|
||||
),
|
||||
procPatch.points()
|
||||
);
|
||||
labelList subMeshEdges
|
||||
(
|
||||
subPatch.meshEdges
|
||||
(
|
||||
mesh.edges(),
|
||||
mesh.pointEdges()
|
||||
)
|
||||
);
|
||||
|
||||
List<T>& subPatchInfo = patchInfo[subI];
|
||||
subPatchInfo.setSize(subMeshEdges.size());
|
||||
forAll(subPatchInfo, i)
|
||||
{
|
||||
subPatchInfo[i] = edgeValues[subMeshEdges[i]];
|
||||
}
|
||||
|
||||
if (subPatchI != -1)
|
||||
{
|
||||
// Apply transform.
|
||||
SubField<T> slice(subPatchInfo, subPatchInfo.size());
|
||||
top
|
||||
(
|
||||
refCast<const coupledPolyPatch>
|
||||
(
|
||||
patches[subPatchI]
|
||||
),
|
||||
reinterpret_cast<Field<T>&>(slice)
|
||||
);
|
||||
}
|
||||
patchInfo[nbrEdgeI] = edgeValues[meshEdges[edgeI]];
|
||||
}
|
||||
|
||||
OPstream toNbr(Pstream::blocking, procPatch.neighbProcNo());
|
||||
@ -1190,8 +1076,11 @@ void Foam::syncTools::syncEdgeList
|
||||
const processorPolyPatch& procPatch =
|
||||
refCast<const processorPolyPatch>(patches[patchI]);
|
||||
|
||||
// Receive from neighbour.
|
||||
List<List<T> > nbrPatchInfo(procPatch.nEdges());
|
||||
const labelList& meshEdges = procPatch.meshEdges();
|
||||
|
||||
// Receive from neighbour. Is per patch edge the region of the
|
||||
// neighbouring patch edge.
|
||||
Field<T> nbrPatchInfo(procPatch.nEdges());
|
||||
|
||||
{
|
||||
IPstream fromNeighb
|
||||
@ -1202,41 +1091,13 @@ void Foam::syncTools::syncEdgeList
|
||||
fromNeighb >> nbrPatchInfo;
|
||||
}
|
||||
|
||||
forAll(procPatch.patchIDs(), subI)
|
||||
// Transform to this side
|
||||
top(procPatch, nbrPatchInfo);
|
||||
|
||||
forAll(meshEdges, edgeI)
|
||||
{
|
||||
label subStart = procPatch.starts()[subI];
|
||||
label subSize = procPatch.starts()[subI+1]-subStart;
|
||||
|
||||
faceList reverseFaces(subSize);
|
||||
forAll(reverseFaces, i)
|
||||
{
|
||||
reverseFaces[i] = procPatch[subStart+i].reverseFace();
|
||||
}
|
||||
primitivePatch subPatch
|
||||
(
|
||||
faceSubList
|
||||
(
|
||||
reverseFaces,
|
||||
reverseFaces.size()
|
||||
),
|
||||
procPatch.points()
|
||||
);
|
||||
labelList subMeshEdges
|
||||
(
|
||||
subPatch.meshEdges
|
||||
(
|
||||
mesh.edges(),
|
||||
mesh.pointEdges()
|
||||
)
|
||||
);
|
||||
|
||||
const List<T>& nbrSubInfo = nbrPatchInfo[subI];
|
||||
|
||||
forAll(subMeshEdges, i)
|
||||
{
|
||||
label meshEdgeI = subMeshEdges[i];
|
||||
cop(edgeValues[meshEdgeI], nbrSubInfo[i]);
|
||||
}
|
||||
label meshEdgeI = meshEdges[edgeI];
|
||||
cop(edgeValues[meshEdgeI], nbrPatchInfo[edgeI]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1270,11 +1131,11 @@ void Foam::syncTools::syncEdgeList
|
||||
|
||||
//SubField<T> slice0(half0Values, half0Values.size());
|
||||
//SubField<T> slice1(half1Values, half1Values.size());
|
||||
//top(cycPatch, reinterpret_cast<Field<T>&>(slice0));
|
||||
//top(nbrPatch, reinterpret_cast<Field<T>&>(slice1));
|
||||
//top(cycPatch, reinterpret_cast<Field<T>&>(slice1));
|
||||
//top(nbrPatch, reinterpret_cast<Field<T>&>(slice0));
|
||||
|
||||
top(cycPatch, half0Values);
|
||||
top(nbrPatch, half1Values);
|
||||
top(cycPatch, half1Values);
|
||||
top(nbrPatch, half0Values);
|
||||
|
||||
forAll(coupledEdges, i)
|
||||
{
|
||||
@ -1296,7 +1157,7 @@ void Foam::syncTools::syncEdgeList
|
||||
if (pd.nGlobalEdges() > 0)
|
||||
{
|
||||
// Values on shared edges.
|
||||
List<T> sharedPts(pd.nGlobalEdges(), nullValue);
|
||||
Field<T> sharedPts(pd.nGlobalEdges(), nullValue);
|
||||
|
||||
forAll(pd.sharedEdgeLabels(), i)
|
||||
{
|
||||
@ -1383,7 +1244,12 @@ void Foam::syncTools::syncBoundaryFaceList
|
||||
{
|
||||
OPstream toNbr(Pstream::blocking, procPatch.neighbProcNo());
|
||||
toNbr <<
|
||||
SubList<T>(faceValues, procPatch.size(), patchStart);
|
||||
SubField<T>
|
||||
(
|
||||
faceValues,
|
||||
procPatch.size(),
|
||||
patchStart
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1399,17 +1265,17 @@ void Foam::syncTools::syncBoundaryFaceList
|
||||
&& patches[patchI].size() > 0
|
||||
)
|
||||
{
|
||||
const processorPolyPatch& ppp =
|
||||
const processorPolyPatch& procPatch =
|
||||
refCast<const processorPolyPatch>(patches[patchI]);
|
||||
|
||||
List<T> nbrPatchInfo(ppp.size());
|
||||
Field<T> nbrPatchInfo(procPatch.size());
|
||||
|
||||
if (contiguous<T>())
|
||||
{
|
||||
IPstream::read
|
||||
(
|
||||
Pstream::blocking,
|
||||
ppp.neighbProcNo(),
|
||||
procPatch.neighbProcNo(),
|
||||
reinterpret_cast<char*>(nbrPatchInfo.begin()),
|
||||
nbrPatchInfo.byteSize()
|
||||
);
|
||||
@ -1419,33 +1285,14 @@ void Foam::syncTools::syncBoundaryFaceList
|
||||
IPstream fromNeighb
|
||||
(
|
||||
Pstream::blocking,
|
||||
ppp.neighbProcNo()
|
||||
procPatch.neighbProcNo()
|
||||
);
|
||||
fromNeighb >> nbrPatchInfo;
|
||||
}
|
||||
|
||||
// Apply any transforms
|
||||
forAll(ppp.patchIDs(), i)
|
||||
{
|
||||
label subPatchI = ppp.patchIDs()[i];
|
||||
label subStart = ppp.starts()[i];
|
||||
label subSize = ppp.starts()[i+1]-subStart;
|
||||
top(procPatch, nbrPatchInfo);
|
||||
|
||||
if (subPatchI != -1)
|
||||
{
|
||||
SubField<T> slice(nbrPatchInfo, subStart, subSize);
|
||||
top
|
||||
(
|
||||
refCast<const coupledPolyPatch>
|
||||
(
|
||||
patches[subPatchI]
|
||||
),
|
||||
reinterpret_cast<Field<T>&>(slice)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
label bFaceI = ppp.start()-mesh.nInternalFaces();
|
||||
label bFaceI = procPatch.start()-mesh.nInternalFaces();
|
||||
|
||||
forAll(nbrPatchInfo, i)
|
||||
{
|
||||
@ -1473,13 +1320,11 @@ void Foam::syncTools::syncBoundaryFaceList
|
||||
label sz = cycPatch.size();
|
||||
|
||||
// Transform (copy of) data on both sides
|
||||
Field<T> ownVals(SubList<T>(faceValues, sz, ownStart));
|
||||
//SubField<T> ownSlice(ownVals, ownVals.size());
|
||||
top(cycPatch, ownVals);
|
||||
Field<T> ownVals(SubField<T>(faceValues, sz, ownStart));
|
||||
top(nbrPatch, ownVals);
|
||||
|
||||
Field<T> nbrVals(SubList<T>(faceValues, sz, nbrStart));
|
||||
//SubField<T> nbrSlice(nbrVals, nbrVals.size());
|
||||
top(nbrPatch, nbrVals);
|
||||
Field<T> nbrVals(SubField<T>(faceValues, sz, nbrStart));
|
||||
top(cycPatch, nbrVals);
|
||||
|
||||
label i0 = ownStart;
|
||||
forAll(nbrVals, i)
|
||||
@ -1526,10 +1371,6 @@ void Foam::syncTools::syncFaceList
|
||||
return;
|
||||
}
|
||||
|
||||
// Patch data (proc patches only) for ease of sending/receiving.
|
||||
// Note:should just send slice of packedList itself.
|
||||
List<List<unsigned int> > patchValues(patches.size());
|
||||
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
// Send
|
||||
@ -1545,14 +1386,14 @@ void Foam::syncTools::syncFaceList
|
||||
const processorPolyPatch& procPatch =
|
||||
refCast<const processorPolyPatch>(patches[patchI]);
|
||||
|
||||
patchValues[patchI].setSize(procPatch.size());
|
||||
List<unsigned int> patchInfo(procPatch.size());
|
||||
forAll(procPatch, i)
|
||||
{
|
||||
patchValues[patchI][i] = faceValues[procPatch.start()+i];
|
||||
patchInfo[i] = faceValues[procPatch.start()+i];
|
||||
}
|
||||
|
||||
OPstream toNbr(Pstream::blocking, procPatch.neighbProcNo());
|
||||
toNbr << patchValues[patchI];
|
||||
toNbr << patchInfo;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1570,19 +1411,20 @@ void Foam::syncTools::syncFaceList
|
||||
const processorPolyPatch& procPatch =
|
||||
refCast<const processorPolyPatch>(patches[patchI]);
|
||||
|
||||
List<unsigned int> patchInfo(procPatch.size());
|
||||
{
|
||||
IPstream fromNbr
|
||||
(
|
||||
Pstream::blocking,
|
||||
procPatch.neighbProcNo()
|
||||
);
|
||||
fromNbr >> patchValues[patchI];
|
||||
fromNbr >> patchInfo;
|
||||
}
|
||||
|
||||
// Combine (bitwise)
|
||||
forAll(procPatch, i)
|
||||
{
|
||||
unsigned int patchVal = patchValues[patchI][i];
|
||||
unsigned int patchVal = patchInfo[i];
|
||||
label meshFaceI = procPatch.start()+i;
|
||||
unsigned int faceVal = faceValues[meshFaceI];
|
||||
cop(faceVal, patchVal);
|
||||
@ -1679,19 +1521,15 @@ void Foam::syncTools::syncPointList
|
||||
const processorPolyPatch& procPatch =
|
||||
refCast<const processorPolyPatch>(patches[patchI]);
|
||||
|
||||
List<List<unsigned int> > patchInfo(procPatch.patchIDs().size());
|
||||
List<unsigned int> patchInfo(procPatch.nPoints());
|
||||
|
||||
forAll(procPatch.patchIDs(), subI)
|
||||
const labelList& meshPts = procPatch.meshPoints();
|
||||
const labelList& nbrPts = procPatch.neighbPoints();
|
||||
|
||||
forAll(nbrPts, pointI)
|
||||
{
|
||||
const labelList& subMeshPts =
|
||||
procPatch.subMeshPoints()[subI];
|
||||
|
||||
List<unsigned int>& subInfo = patchInfo[subI];
|
||||
subInfo.setSize(subMeshPts.size());
|
||||
forAll(subInfo, i)
|
||||
{
|
||||
subInfo[i] = pointValues[subMeshPts[i]];
|
||||
}
|
||||
label nbrPointI = nbrPts[pointI];
|
||||
patchInfo[nbrPointI] = pointValues[meshPts[pointI]];
|
||||
}
|
||||
|
||||
OPstream toNbr(Pstream::blocking, procPatch.neighbProcNo());
|
||||
@ -1713,7 +1551,7 @@ void Foam::syncTools::syncPointList
|
||||
const processorPolyPatch& procPatch =
|
||||
refCast<const processorPolyPatch>(patches[patchI]);
|
||||
|
||||
List<List<unsigned int> > nbrPatchInfo(procPatch.nPoints());
|
||||
List<unsigned int> nbrPatchInfo(procPatch.nPoints());
|
||||
{
|
||||
// We do not know the number of points on the other side
|
||||
// so cannot use Pstream::read.
|
||||
@ -1725,19 +1563,14 @@ void Foam::syncTools::syncPointList
|
||||
fromNbr >> nbrPatchInfo;
|
||||
}
|
||||
|
||||
forAll(procPatch.patchIDs(), subI)
|
||||
{
|
||||
const labelList& subMeshPts =
|
||||
procPatch.reverseSubMeshPoints()[subI];
|
||||
const List<unsigned int>& nbrSubInfo = nbrPatchInfo[subI];
|
||||
const labelList& meshPts = procPatch.meshPoints();
|
||||
|
||||
forAll(subMeshPts, i)
|
||||
{
|
||||
label meshPointI = subMeshPts[i];
|
||||
unsigned int pointVal = pointValues[meshPointI];
|
||||
cop(pointVal, nbrSubInfo[i]);
|
||||
pointValues[meshPointI] = pointVal;
|
||||
}
|
||||
forAll(meshPts, pointI)
|
||||
{
|
||||
label meshPointI = meshPts[pointI];
|
||||
unsigned int pointVal = pointValues[meshPointI];
|
||||
cop(pointVal, nbrPatchInfo[pointI]);
|
||||
pointValues[meshPointI] = pointVal;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1852,38 +1685,15 @@ void Foam::syncTools::syncEdgeList
|
||||
const processorPolyPatch& procPatch =
|
||||
refCast<const processorPolyPatch>(patches[patchI]);
|
||||
|
||||
List<List<unsigned int> > patchInfo(procPatch.patchIDs().size());
|
||||
List<unsigned int> patchInfo(procPatch.nEdges());
|
||||
|
||||
forAll(procPatch.patchIDs(), subI)
|
||||
const labelList& meshEdges = procPatch.meshEdges();
|
||||
const labelList& neighbEdges = procPatch.neighbEdges();
|
||||
|
||||
forAll(neighbEdges, edgeI)
|
||||
{
|
||||
label subStart = procPatch.starts()[subI];
|
||||
label subSize = procPatch.starts()[subI+1]-subStart;
|
||||
|
||||
primitivePatch subPatch
|
||||
(
|
||||
faceSubList
|
||||
(
|
||||
procPatch,
|
||||
subSize,
|
||||
subStart
|
||||
),
|
||||
procPatch.points()
|
||||
);
|
||||
labelList subMeshEdges
|
||||
(
|
||||
subPatch.meshEdges
|
||||
(
|
||||
mesh.edges(),
|
||||
mesh.pointEdges()
|
||||
)
|
||||
);
|
||||
|
||||
List<unsigned int>& subPatchInfo = patchInfo[subI];
|
||||
subPatchInfo.setSize(subMeshEdges.size());
|
||||
forAll(subPatchInfo, i)
|
||||
{
|
||||
subPatchInfo[i] = edgeValues[subMeshEdges[i]];
|
||||
}
|
||||
label nbrEdgeI = neighbEdges[edgeI];
|
||||
patchInfo[nbrEdgeI] = edgeValues[meshEdges[edgeI]];
|
||||
}
|
||||
|
||||
OPstream toNbr(Pstream::blocking, procPatch.neighbProcNo());
|
||||
@ -1906,7 +1716,7 @@ void Foam::syncTools::syncEdgeList
|
||||
refCast<const processorPolyPatch>(patches[patchI]);
|
||||
|
||||
// Receive from neighbour.
|
||||
List<List<unsigned int> > nbrPatchInfo(procPatch.nEdges());
|
||||
List<unsigned int> nbrPatchInfo(procPatch.nEdges());
|
||||
|
||||
{
|
||||
IPstream fromNeighb
|
||||
@ -1917,43 +1727,15 @@ void Foam::syncTools::syncEdgeList
|
||||
fromNeighb >> nbrPatchInfo;
|
||||
}
|
||||
|
||||
forAll(procPatch.patchIDs(), subI)
|
||||
const labelList& meshEdges = procPatch.meshEdges();
|
||||
|
||||
forAll(meshEdges, edgeI)
|
||||
{
|
||||
label subStart = procPatch.starts()[subI];
|
||||
label subSize = procPatch.starts()[subI+1]-subStart;
|
||||
|
||||
faceList reverseFaces(subSize);
|
||||
forAll(reverseFaces, i)
|
||||
{
|
||||
reverseFaces[i] = procPatch[subStart+i].reverseFace();
|
||||
}
|
||||
primitivePatch subPatch
|
||||
(
|
||||
faceSubList
|
||||
(
|
||||
reverseFaces,
|
||||
reverseFaces.size()
|
||||
),
|
||||
procPatch.points()
|
||||
);
|
||||
labelList subMeshEdges
|
||||
(
|
||||
subPatch.meshEdges
|
||||
(
|
||||
mesh.edges(),
|
||||
mesh.pointEdges()
|
||||
)
|
||||
);
|
||||
|
||||
const List<unsigned int>& nbrSubInfo = nbrPatchInfo[subI];
|
||||
|
||||
forAll(subMeshEdges, i)
|
||||
{
|
||||
label meshEdgeI = subMeshEdges[i];
|
||||
unsigned int edgeVal = edgeValues[meshEdgeI];
|
||||
cop(edgeVal, nbrSubInfo[i]);
|
||||
edgeValues[meshEdgeI] = edgeVal;
|
||||
}
|
||||
unsigned int patchVal = nbrPatchInfo[edgeI];
|
||||
label meshEdgeI = meshEdges[edgeI];
|
||||
unsigned int edgeVal = edgeValues[meshEdgeI];
|
||||
cop(edgeVal, patchVal);
|
||||
edgeValues[meshEdgeI] = edgeVal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -898,7 +898,7 @@ void Foam::parMetisDecomp::calcMetisDistributedCSR
|
||||
}
|
||||
|
||||
// Get the cell on the other side of coupled patches
|
||||
syncTools::swapBoundaryFaceList(mesh, globalNeighbour, false);
|
||||
syncTools::swapBoundaryFaceList(mesh, globalNeighbour);
|
||||
|
||||
|
||||
// Count number of faces (internal + coupled)
|
||||
|
||||
@ -119,8 +119,7 @@ void Foam::attachDetach::attachInterface
|
||||
-1, // patch for face
|
||||
false, // remove from zone
|
||||
faceZoneID_.index(), // zone for face
|
||||
mfFlip[faceI], // face flip in zone
|
||||
-1 // subpatch
|
||||
mfFlip[faceI] // face flip in zone
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -139,8 +138,7 @@ void Foam::attachDetach::attachInterface
|
||||
-1, // patch for face
|
||||
false, // remove from zone
|
||||
faceZoneID_.index(), // zone for face
|
||||
!mfFlip[faceI], // face flip in zone
|
||||
-1 // subpatch
|
||||
!mfFlip[faceI] // face flip in zone
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -210,13 +208,10 @@ void Foam::attachDetach::attachInterface
|
||||
];
|
||||
}
|
||||
|
||||
labelPair patchIDs = polyTopoChange::whichPatch
|
||||
(
|
||||
mesh.boundaryMesh(),
|
||||
curFaceID
|
||||
);
|
||||
|
||||
label patchID = mesh.boundaryMesh().whichPatch(curFaceID);
|
||||
label neiCell;
|
||||
if (patchIDs[0] == -1)
|
||||
if (patchID == -1)
|
||||
{
|
||||
neiCell = nei[curFaceID];
|
||||
}
|
||||
@ -225,6 +220,7 @@ void Foam::attachDetach::attachInterface
|
||||
neiCell = -1;
|
||||
}
|
||||
|
||||
|
||||
// Modify the face
|
||||
ref.setAction
|
||||
(
|
||||
@ -235,11 +231,10 @@ void Foam::attachDetach::attachInterface
|
||||
own[curFaceID], // owner
|
||||
neiCell, // neighbour
|
||||
false, // face flip
|
||||
patchIDs[0], // patch for face
|
||||
patchID, // patch for face
|
||||
false, // remove from zone
|
||||
modifiedFaceZone, // zone for face
|
||||
modifiedFaceZoneFlip, // face flip in zone
|
||||
patchIDs[1]
|
||||
modifiedFaceZoneFlip // face flip in zone
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -211,8 +211,7 @@ void Foam::attachDetach::detachInterface
|
||||
masterPatchID_.index(), // patch for face
|
||||
false, // remove from zone
|
||||
faceZoneID_.index(), // zone for face
|
||||
!mfFlip[faceI], // face flip in zone
|
||||
-1 // sub patch
|
||||
!mfFlip[faceI] // face flip in zone
|
||||
)
|
||||
);
|
||||
|
||||
@ -231,8 +230,7 @@ void Foam::attachDetach::detachInterface
|
||||
false, // flip flux
|
||||
slavePatchID_.index(), // patch to add the face to
|
||||
-1, // zone for face
|
||||
false, // zone flip
|
||||
-1 // sub patch
|
||||
false // zone flip
|
||||
)
|
||||
);
|
||||
//{
|
||||
@ -260,8 +258,7 @@ void Foam::attachDetach::detachInterface
|
||||
masterPatchID_.index(), // patch for face
|
||||
false, // remove from zone
|
||||
faceZoneID_.index(), // zone for face
|
||||
mfFlip[faceI], // face flip in zone
|
||||
-1 // sub patch
|
||||
mfFlip[faceI] // face flip in zone
|
||||
)
|
||||
);
|
||||
|
||||
@ -280,8 +277,7 @@ void Foam::attachDetach::detachInterface
|
||||
true, // flip flux
|
||||
slavePatchID_.index(), // patch to add the face to
|
||||
-1, // zone for face
|
||||
false, // face flip in zone
|
||||
-1 // sub patch
|
||||
false // face flip in zone
|
||||
)
|
||||
);
|
||||
//{
|
||||
@ -442,8 +438,7 @@ void Foam::attachDetach::detachInterface
|
||||
-1, // patch for face
|
||||
false, // remove from zone
|
||||
-1, // zone for face
|
||||
false, // face zone flip
|
||||
-1 // sub patch
|
||||
false // face zone flip
|
||||
)
|
||||
);
|
||||
// Pout << "modifying stick-out face. Internal Old face: " << oldFace << " new face: " << newFace << " own: " << own[curFaceID] << " nei: " << nei[curFaceID] << endl;
|
||||
@ -462,8 +457,7 @@ void Foam::attachDetach::detachInterface
|
||||
mesh.boundaryMesh().whichPatch(curFaceID), // patch
|
||||
false, // remove from zone
|
||||
-1, // zone for face
|
||||
false, // face zone flip
|
||||
-1 // sub patch
|
||||
false // face zone flip
|
||||
)
|
||||
);
|
||||
// Pout << "modifying stick-out face. Boundary Old face: " << oldFace << " new face: " << newFace << " own: " << own[curFaceID] << " patch: " << mesh.boundaryMesh().whichPatch(curFaceID) << endl;
|
||||
|
||||
@ -390,7 +390,7 @@ void Foam::boundaryMesh::markZone
|
||||
// Zones on all edges.
|
||||
labelList edgeZone(mesh().nEdges(), -1);
|
||||
|
||||
while(1)
|
||||
while (true)
|
||||
{
|
||||
changedEdges = faceToEdge
|
||||
(
|
||||
|
||||
@ -448,8 +448,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::deleteProcPatches
|
||||
// Repatch the mesh.
|
||||
Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::repatch
|
||||
(
|
||||
const labelList& newPatchID, // per boundary face -1 or new patchID
|
||||
const labelList& newSubPatchID, // ,, -1 or new subpatchID
|
||||
const labelList& newPatchID, // per boundary face -1 or new patchID
|
||||
labelListList& constructFaceMap
|
||||
)
|
||||
{
|
||||
@ -482,8 +481,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::repatch
|
||||
newPatchID[bFaceI], // patch for face
|
||||
false, // remove from zone
|
||||
zoneID, // zone for face
|
||||
zoneFlip, // face flip in zone
|
||||
newSubPatchID
|
||||
zoneFlip // face flip in zone
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -627,8 +625,7 @@ void Foam::fvMeshDistribute::getNeighbourData
|
||||
const labelList& distribution,
|
||||
labelList& sourceFace,
|
||||
labelList& sourceProc,
|
||||
labelList& sourceNewProc,
|
||||
labelList& sourceSubPatch
|
||||
labelList& sourceNewProc
|
||||
) const
|
||||
{
|
||||
label nBnd = mesh_.nFaces() - mesh_.nInternalFaces();
|
||||
@ -736,18 +733,15 @@ void Foam::fvMeshDistribute::subsetBoundaryData
|
||||
const labelList& sourceFace,
|
||||
const labelList& sourceProc,
|
||||
const labelList& sourceNewProc,
|
||||
const labelList& sourceSubPatch,
|
||||
|
||||
labelList& subFace,
|
||||
labelList& subProc,
|
||||
labelList& subNewProc,
|
||||
labelList& subSubPatch
|
||||
labelList& subNewProc
|
||||
)
|
||||
{
|
||||
subFace.setSize(mesh.nFaces() - mesh.nInternalFaces());
|
||||
subProc.setSize(mesh.nFaces() - mesh.nInternalFaces());
|
||||
subNewProc.setSize(mesh.nFaces() - mesh.nInternalFaces());
|
||||
subSubPatch.setSize(mesh.nFaces() - mesh.nInternalFaces());
|
||||
|
||||
forAll(subFace, newBFaceI)
|
||||
{
|
||||
@ -760,7 +754,6 @@ void Foam::fvMeshDistribute::subsetBoundaryData
|
||||
{
|
||||
subFace[newBFaceI] = oldFaceI;
|
||||
subProc[newBFaceI] = Pstream::myProcNo();
|
||||
subSubPatch[newBFaceI] = -1;
|
||||
|
||||
label oldOwn = oldFaceOwner[oldFaceI];
|
||||
label oldNei = oldFaceNeighbour[oldFaceI];
|
||||
@ -784,7 +777,6 @@ void Foam::fvMeshDistribute::subsetBoundaryData
|
||||
subFace[newBFaceI] = sourceFace[oldBFaceI];
|
||||
subProc[newBFaceI] = sourceProc[oldBFaceI];
|
||||
subNewProc[newBFaceI] = sourceNewProc[oldBFaceI];
|
||||
subSubPatch[newBFaceI] = sourceSubPatch[oldBFaceI];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1065,7 +1057,6 @@ void Foam::fvMeshDistribute::sendMesh
|
||||
const labelList& sourceFace,
|
||||
const labelList& sourceProc,
|
||||
const labelList& sourceNewProc,
|
||||
const labelList& sourceSubPatch,
|
||||
UOPstream& toDomain
|
||||
)
|
||||
{
|
||||
@ -1201,8 +1192,6 @@ void Foam::fvMeshDistribute::sendMesh
|
||||
|
||||
<< sourceFace
|
||||
<< sourceProc
|
||||
<< sourceNewProc
|
||||
<< sourceSubPatch
|
||||
<< sourceNewProc;
|
||||
|
||||
|
||||
@ -1225,7 +1214,6 @@ Foam::autoPtr<Foam::fvMesh> Foam::fvMeshDistribute::receiveMesh
|
||||
labelList& domainSourceFace,
|
||||
labelList& domainSourceProc,
|
||||
labelList& domainSourceNewProc,
|
||||
labelList& domainSourceSubPatch,
|
||||
UIPstream& fromNbr
|
||||
)
|
||||
{
|
||||
@ -1243,8 +1231,7 @@ Foam::autoPtr<Foam::fvMesh> Foam::fvMeshDistribute::receiveMesh
|
||||
fromNbr
|
||||
>> domainSourceFace
|
||||
>> domainSourceProc
|
||||
>> domainSourceNewProc
|
||||
>> domainSourceSubPatch;
|
||||
>> domainSourceNewProc;
|
||||
|
||||
// Construct fvMesh
|
||||
autoPtr<fvMesh> domainMeshPtr
|
||||
@ -1464,24 +1451,14 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::fvMeshDistribute::distribute
|
||||
// sourceProc = -1
|
||||
// sourceNewProc = -1
|
||||
// sourceFace = patchID
|
||||
// sourceSubPatch = -1
|
||||
// coupled boundary:
|
||||
// sourceProc = proc
|
||||
// sourceNewProc = distribution[cell on proc]
|
||||
// sourceFace = face
|
||||
// sourceSubPatch = sub patch (only if processor face)
|
||||
labelList sourceFace;
|
||||
labelList sourceProc;
|
||||
labelList sourceNewProc;
|
||||
labelList sourceSubPatch;
|
||||
getNeighbourData
|
||||
(
|
||||
distribution,
|
||||
sourceFace,
|
||||
sourceProc,
|
||||
sourceNewProc,
|
||||
sourceSubPatch
|
||||
);
|
||||
getNeighbourData(distribution, sourceFace, sourceProc, sourceNewProc);
|
||||
|
||||
|
||||
// Remove meshPhi. Since this would otherwise disappear anyway
|
||||
@ -1554,7 +1531,6 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::fvMeshDistribute::distribute
|
||||
inplaceReorder(bFaceMap, sourceFace);
|
||||
inplaceReorder(bFaceMap, sourceProc);
|
||||
inplaceReorder(bFaceMap, sourceNewProc);
|
||||
inplaceReorder(bFaceMap, sourceSubPatch);
|
||||
}
|
||||
|
||||
|
||||
@ -1658,7 +1634,6 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::fvMeshDistribute::distribute
|
||||
labelList procSourceFace;
|
||||
labelList procSourceProc;
|
||||
labelList procSourceNewProc;
|
||||
labelList procSourceSubPatch;
|
||||
|
||||
subsetBoundaryData
|
||||
(
|
||||
@ -1674,12 +1649,10 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::fvMeshDistribute::distribute
|
||||
sourceFace,
|
||||
sourceProc,
|
||||
sourceNewProc,
|
||||
sourceSubPatch,
|
||||
|
||||
procSourceFace,
|
||||
procSourceProc,
|
||||
procSourceNewProc,
|
||||
procSourceSubPatch
|
||||
procSourceNewProc
|
||||
);
|
||||
|
||||
|
||||
@ -1697,7 +1670,6 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::fvMeshDistribute::distribute
|
||||
procSourceFace,
|
||||
procSourceProc,
|
||||
procSourceNewProc,
|
||||
procSourceSubPatch,
|
||||
str
|
||||
);
|
||||
sendFields<volScalarField>(recvProc, volScalars, subsetter, str);
|
||||
@ -1801,7 +1773,6 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::fvMeshDistribute::distribute
|
||||
labelList domainSourceFace;
|
||||
labelList domainSourceProc;
|
||||
labelList domainSourceNewProc;
|
||||
labelList domainSourceSubPatch;
|
||||
|
||||
subsetBoundaryData
|
||||
(
|
||||
@ -1817,18 +1788,15 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::fvMeshDistribute::distribute
|
||||
sourceFace,
|
||||
sourceProc,
|
||||
sourceNewProc,
|
||||
sourceSubPatch,
|
||||
|
||||
domainSourceFace,
|
||||
domainSourceProc,
|
||||
domainSourceNewProc,
|
||||
domainSourceSubPatch
|
||||
domainSourceNewProc
|
||||
);
|
||||
|
||||
sourceFace.transfer(domainSourceFace);
|
||||
sourceProc.transfer(domainSourceProc);
|
||||
sourceNewProc.transfer(domainSourceNewProc);
|
||||
sourceSubPatch.transfer(domainSourceSubPatch);
|
||||
}
|
||||
|
||||
|
||||
@ -1882,8 +1850,8 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::fvMeshDistribute::distribute
|
||||
labelList domainSourceFace;
|
||||
labelList domainSourceProc;
|
||||
labelList domainSourceNewProc;
|
||||
labelList domainSourceSubPatch;
|
||||
|
||||
autoPtr<fvMesh> domainMeshPtr;
|
||||
PtrList<volScalarField> vsf;
|
||||
PtrList<volVectorField> vvf;
|
||||
PtrList<volSphericalTensorField> vsptf;
|
||||
@ -1908,7 +1876,6 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::fvMeshDistribute::distribute
|
||||
domainSourceFace,
|
||||
domainSourceProc,
|
||||
domainSourceNewProc,
|
||||
domainSourceSubPatch
|
||||
str
|
||||
);
|
||||
fvMesh& domainMesh = domainMeshPtr();
|
||||
|
||||
@ -54,7 +54,6 @@ SourceFiles
|
||||
#define fvMeshDistribute_H
|
||||
|
||||
#include "Field.H"
|
||||
#include "uLabel.H"
|
||||
#include "fvMeshSubset.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -167,11 +167,11 @@ void Foam::layerAdditionRemoval::addCellLayer
|
||||
(
|
||||
polyAddCell
|
||||
(
|
||||
-1, // master point
|
||||
-1, // master edge
|
||||
mf[faceI], // master face
|
||||
-1, // master cell
|
||||
-1 // zone for cell
|
||||
-1, // master point
|
||||
-1, // master edge
|
||||
mf[faceI], // master face
|
||||
-1, // master cell
|
||||
-1 // zone for cell
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -216,17 +216,16 @@ void Foam::layerAdditionRemoval::addCellLayer
|
||||
(
|
||||
polyAddFace
|
||||
(
|
||||
newFace, // face
|
||||
mc[faceI], // owner
|
||||
addedCells[faceI], // neighbour
|
||||
-1, // master point
|
||||
-1, // master edge
|
||||
mf[faceI], // master face for addition
|
||||
flipFaceFlux, // flux flip
|
||||
-1, // patch for face
|
||||
-1, // zone for face
|
||||
false, // face zone flip
|
||||
-1 // sub patch for face
|
||||
newFace, // face
|
||||
mc[faceI], // owner
|
||||
addedCells[faceI], // neighbour
|
||||
-1, // master point
|
||||
-1, // master edge
|
||||
mf[faceI], // master face for addition
|
||||
flipFaceFlux, // flux flip
|
||||
-1, // patch for face
|
||||
-1, // zone for face
|
||||
false // face zone flip
|
||||
)
|
||||
);
|
||||
|
||||
@ -241,15 +240,6 @@ void Foam::layerAdditionRemoval::addCellLayer
|
||||
{
|
||||
const label curfaceID = mf[faceI];
|
||||
|
||||
labelPair patchIDs
|
||||
(
|
||||
polyTopoChange::whichPatch
|
||||
(
|
||||
mesh.boundaryMesh(),
|
||||
curfaceID
|
||||
)
|
||||
);
|
||||
|
||||
// If the face is internal, modify its owner to be the newly
|
||||
// created cell. No flip is necessary
|
||||
if (!mesh.isInternalFace(curfaceID))
|
||||
@ -258,16 +248,15 @@ void Foam::layerAdditionRemoval::addCellLayer
|
||||
(
|
||||
polyModifyFace
|
||||
(
|
||||
faces[curfaceID], // modified face
|
||||
curfaceID, // label of face being modified
|
||||
addedCells[faceI], // owner
|
||||
-1, // neighbour
|
||||
false, // face flip
|
||||
patchIDs[0], // patch for face
|
||||
false, // remove from zone
|
||||
faceZoneID_.index(), // zone for face
|
||||
mfFlip[faceI], // face flip in zone
|
||||
patchIDs[1] // subpatch id
|
||||
faces[curfaceID], // modified face
|
||||
curfaceID, // label of face being modified
|
||||
addedCells[faceI], // owner
|
||||
-1, // neighbour
|
||||
false, // face flip
|
||||
mesh.boundaryMesh().whichPatch(curfaceID),// patch for face
|
||||
false, // remove from zone
|
||||
faceZoneID_.index(), // zone for face
|
||||
mfFlip[faceI] // face flip in zone
|
||||
)
|
||||
);
|
||||
// Pout << "Modifying a boundary face. Face: " << curfaceID << " flip: " << mfFlip[faceI] << endl;
|
||||
@ -282,16 +271,15 @@ void Foam::layerAdditionRemoval::addCellLayer
|
||||
(
|
||||
polyModifyFace
|
||||
(
|
||||
faces[curfaceID], // modified face
|
||||
curfaceID, // label of face being modified
|
||||
own[curfaceID], // owner
|
||||
addedCells[faceI], // neighbour
|
||||
false, // face flip
|
||||
patchIDs[0], // patch for face
|
||||
false, // remove from zone
|
||||
faceZoneID_.index(), // zone for face
|
||||
mfFlip[faceI], // face flip in zone
|
||||
patchIDs[1] // subpatch id
|
||||
faces[curfaceID], // modified face
|
||||
curfaceID, // label of face being modified
|
||||
own[curfaceID], // owner
|
||||
addedCells[faceI], // neighbour
|
||||
false, // face flip
|
||||
mesh.boundaryMesh().whichPatch(curfaceID),// patch for face
|
||||
false, // remove from zone
|
||||
faceZoneID_.index(), // zone for face
|
||||
mfFlip[faceI] // face flip in zone
|
||||
)
|
||||
);
|
||||
|
||||
@ -305,15 +293,14 @@ void Foam::layerAdditionRemoval::addCellLayer
|
||||
polyModifyFace
|
||||
(
|
||||
faces[curfaceID].reverseFace(), // modified face
|
||||
curfaceID, // label of face being modified
|
||||
curfaceID, // label of face being modified
|
||||
nei[curfaceID], // owner
|
||||
addedCells[faceI], // neighbour
|
||||
true, // face flip
|
||||
patchIDs[0], // patch for face
|
||||
mesh.boundaryMesh().whichPatch(curfaceID), // patch for face
|
||||
false, // remove from zone
|
||||
faceZoneID_.index(), // zone for face
|
||||
!mfFlip[faceI], // face flip in zone
|
||||
patchIDs[1] // subpatch id
|
||||
!mfFlip[faceI] // face flip in zone
|
||||
)
|
||||
);
|
||||
// Pout << "modify face, with flip " << curfaceID << " own: " << own[curfaceID] << " nei: " << addedCells[faceI] << endl;
|
||||
@ -345,17 +332,16 @@ void Foam::layerAdditionRemoval::addCellLayer
|
||||
(
|
||||
polyAddFace
|
||||
(
|
||||
newFace, // face
|
||||
addedCells[edgeFaces[curEdgeID][0]], // owner
|
||||
addedCells[edgeFaces[curEdgeID][1]], // neighbour
|
||||
-1, // master point
|
||||
meshEdges[curEdgeID], // master edge
|
||||
-1, // master face
|
||||
false, // flip flux
|
||||
-1, // patch for face
|
||||
-1, // zone for face
|
||||
false, // face zone flip
|
||||
-1 // subpatch id
|
||||
newFace, // face
|
||||
addedCells[edgeFaces[curEdgeID][0]], // owner
|
||||
addedCells[edgeFaces[curEdgeID][1]], // neighbour
|
||||
-1, // master point
|
||||
meshEdges[curEdgeID], // master edge
|
||||
-1, // master face
|
||||
false, // flip flux
|
||||
-1, // patch for face
|
||||
-1, // zone for face
|
||||
false // face zone flip
|
||||
)
|
||||
);
|
||||
|
||||
@ -393,7 +379,7 @@ void Foam::layerAdditionRemoval::addCellLayer
|
||||
// Determine the patch for insertion
|
||||
const labelList& curFaces = meshEdgeFaces[meshEdges[curEdgeID]];
|
||||
|
||||
labelPair patchIDs(-1, -1);
|
||||
label patchID = -1;
|
||||
label zoneID = -1;
|
||||
|
||||
forAll (curFaces, faceI)
|
||||
@ -406,11 +392,7 @@ void Foam::layerAdditionRemoval::addCellLayer
|
||||
if (zoneMesh.whichZone(cf) != faceZoneID_.index())
|
||||
{
|
||||
// Found the face in a boundary patch which is not in zone
|
||||
patchIDs = polyTopoChange::whichPatch
|
||||
(
|
||||
mesh.boundaryMesh(),
|
||||
cf
|
||||
);
|
||||
patchID = mesh.boundaryMesh().whichPatch(cf);
|
||||
zoneID = mesh.faceZones().whichZone(cf);
|
||||
|
||||
break;
|
||||
@ -418,7 +400,7 @@ void Foam::layerAdditionRemoval::addCellLayer
|
||||
}
|
||||
}
|
||||
|
||||
if (patchIDs[0] < 0)
|
||||
if (patchID < 0)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
@ -433,17 +415,16 @@ void Foam::layerAdditionRemoval::addCellLayer
|
||||
(
|
||||
polyAddFace
|
||||
(
|
||||
newFace, // face
|
||||
addedCells[edgeFaces[curEdgeID][0]], // owner
|
||||
-1, // neighbour
|
||||
-1, // master point
|
||||
meshEdges[curEdgeID], // master edge
|
||||
-1, // master face
|
||||
false, // flip flux
|
||||
patchIDs[0], // patch for face
|
||||
zoneID, // zone
|
||||
false, // zone face flip
|
||||
patchIDs[1] // subpatch id
|
||||
newFace, // face
|
||||
addedCells[edgeFaces[curEdgeID][0]], // owner
|
||||
-1, // neighbour
|
||||
-1, // master point
|
||||
meshEdges[curEdgeID], // master edge
|
||||
-1, // master face
|
||||
false, // flip flux
|
||||
patchID, // patch for face
|
||||
zoneID, // zone
|
||||
false // zone face flip
|
||||
)
|
||||
);
|
||||
// Pout << "add boundary face: " << newFace << " into patch " << patchID << " own: " << addedCells[edgeFaces[curEdgeID][0]] << endl;
|
||||
@ -553,20 +534,13 @@ void Foam::layerAdditionRemoval::addCellLayer
|
||||
-1, // patch for face
|
||||
false, // remove from zone
|
||||
modifiedFaceZone, // zone for face
|
||||
modifiedFaceZoneFlip, // face flip in zone
|
||||
-1 // subpatch ID
|
||||
modifiedFaceZoneFlip // face flip in zone
|
||||
)
|
||||
);
|
||||
// Pout << "modifying stick-out face. Internal Old face: " << oldFace << " new face: " << newFace << " own: " << own[curFaceID] << " nei: " << nei[curFaceID] << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
labelPair patchIDs = polyTopoChange::whichPatch
|
||||
(
|
||||
mesh.boundaryMesh(),
|
||||
curFaceID
|
||||
);
|
||||
|
||||
ref.setAction
|
||||
(
|
||||
polyModifyFace
|
||||
@ -576,11 +550,10 @@ void Foam::layerAdditionRemoval::addCellLayer
|
||||
own[curFaceID], // owner
|
||||
-1, // neighbour
|
||||
false, // face flip
|
||||
patchIDs[0], // patch for face
|
||||
mesh.boundaryMesh().whichPatch(curFaceID), // patch for face
|
||||
false, // remove from zone
|
||||
modifiedFaceZone, // zone for face
|
||||
modifiedFaceZoneFlip, // face flip in zone
|
||||
patchIDs[1] // subpatch
|
||||
modifiedFaceZoneFlip // face flip in zone
|
||||
)
|
||||
);
|
||||
// Pout << "modifying stick-out face. Boundary Old face: " << oldFace << " new face: " << newFace << " own: " << own[curFaceID] << " patch: " << mesh.boundaryMesh().whichPatch(curFaceID) << endl;
|
||||
|
||||
@ -247,12 +247,6 @@ void Foam::layerAdditionRemoval::removeCellLayer
|
||||
newNei = -1;
|
||||
}
|
||||
|
||||
labelPair patchIDs = polyTopoChange::whichPatch
|
||||
(
|
||||
mesh.boundaryMesh(),
|
||||
curFaceID
|
||||
);
|
||||
|
||||
// Modify the face
|
||||
ref.setAction
|
||||
(
|
||||
@ -263,11 +257,10 @@ void Foam::layerAdditionRemoval::removeCellLayer
|
||||
own[curFaceID], // owner
|
||||
newNei, // neighbour
|
||||
false, // face flip
|
||||
patchIDs[0], // patch for face
|
||||
mesh.boundaryMesh().whichPatch(curFaceID),// patch for face
|
||||
false, // remove from zone
|
||||
modifiedFaceZone, // zone for face
|
||||
modifiedFaceZoneFlip, // face flip in zone
|
||||
patchIDs[1] // subpatch
|
||||
modifiedFaceZoneFlip // face flip in zone
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -303,9 +296,7 @@ void Foam::layerAdditionRemoval::removeCellLayer
|
||||
label newOwner = -1;
|
||||
label newNeighbour = -1;
|
||||
bool flipFace = false;
|
||||
labelPair newPatchIDs(-1, -1);
|
||||
//label newPatchID = -1;
|
||||
//label newSubPatchID = -1;
|
||||
label newPatchID = -1;
|
||||
label newZoneID = -1;
|
||||
|
||||
// Is any of the faces a boundary face? If so, grab the patch
|
||||
@ -318,11 +309,7 @@ void Foam::layerAdditionRemoval::removeCellLayer
|
||||
newOwner = slaveSideCell;
|
||||
newNeighbour = -1;
|
||||
flipFace = false;
|
||||
newPatchIDs = polyTopoChange::whichPatch
|
||||
(
|
||||
mesh.boundaryMesh(),
|
||||
mf[faceI]
|
||||
);
|
||||
newPatchID = mesh.boundaryMesh().whichPatch(mf[faceI]);
|
||||
newZoneID = mesh.faceZones().whichZone(mf[faceI]);
|
||||
}
|
||||
else if (!mesh.isInternalFace(ftc[faceI]))
|
||||
@ -341,11 +328,7 @@ void Foam::layerAdditionRemoval::removeCellLayer
|
||||
flipFace = true;
|
||||
}
|
||||
|
||||
newPatchIDs = polyTopoChange::whichPatch
|
||||
(
|
||||
mesh.boundaryMesh(),
|
||||
ftc[faceI]
|
||||
);
|
||||
newPatchID = mesh.boundaryMesh().whichPatch(ftc[faceI]);
|
||||
|
||||
// The zone of the master face is preserved
|
||||
newZoneID = mesh.faceZones().whichZone(mf[faceI]);
|
||||
@ -366,7 +349,7 @@ void Foam::layerAdditionRemoval::removeCellLayer
|
||||
flipFace = true;
|
||||
}
|
||||
|
||||
newPatchIDs = labelPair(-1, -1);
|
||||
newPatchID = -1;
|
||||
|
||||
// The zone of the master face is preserved
|
||||
newZoneID = mesh.faceZones().whichZone(mf[faceI]);
|
||||
@ -396,16 +379,15 @@ void Foam::layerAdditionRemoval::removeCellLayer
|
||||
(
|
||||
polyModifyFace
|
||||
(
|
||||
newFace, // modified face
|
||||
mf[faceI], // label of face being modified
|
||||
newOwner, // owner
|
||||
newNeighbour, // neighbour
|
||||
flipFace, // flip
|
||||
newPatchIDs[0], // patch for face
|
||||
false, // remove from zone
|
||||
newZoneID, // new zone
|
||||
zoneFlip, // face flip in zone
|
||||
newPatchIDs[1] // subpatch for face
|
||||
newFace, // modified face
|
||||
mf[faceI], // label of face being modified
|
||||
newOwner, // owner
|
||||
newNeighbour, // neighbour
|
||||
flipFace, // flip
|
||||
newPatchID, // patch for face
|
||||
false, // remove from zone
|
||||
newZoneID, // new zone
|
||||
zoneFlip // face flip in zone
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -22,8 +22,6 @@ License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "cellLooper.H"
|
||||
|
||||
@ -22,8 +22,6 @@ License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "edgeVertex.H"
|
||||
|
||||
@ -22,8 +22,6 @@ License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "boundaryCutter.H"
|
||||
@ -39,12 +37,7 @@ Description
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
defineTypeNameAndDebug(boundaryCutter, 0);
|
||||
|
||||
}
|
||||
defineTypeNameAndDebug(Foam::boundaryCutter, 0);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Static Functions * * * * * * * * * * * //
|
||||
@ -55,12 +48,17 @@ defineTypeNameAndDebug(boundaryCutter, 0);
|
||||
void Foam::boundaryCutter::getFaceInfo
|
||||
(
|
||||
const label faceI,
|
||||
labelPair& patchIDs,
|
||||
label& patchID,
|
||||
label& zoneID,
|
||||
label& zoneFlip
|
||||
) const
|
||||
{
|
||||
patchIDs = polyTopoChange::whichPatch(mesh_.boundaryMesh(), faceI);
|
||||
patchID = -1;
|
||||
|
||||
if (!mesh_.isInternalFace(faceI))
|
||||
{
|
||||
patchID = mesh_.boundaryMesh().whichPatch(faceI);
|
||||
}
|
||||
|
||||
zoneID = mesh_.faceZones().whichZone(faceI);
|
||||
|
||||
@ -150,9 +148,8 @@ void Foam::boundaryCutter::addFace
|
||||
) const
|
||||
{
|
||||
// Information about old face
|
||||
label zoneID, zoneFlip;
|
||||
labelPair patchIDs;
|
||||
getFaceInfo(faceI, patchIDs, zoneID, zoneFlip);
|
||||
label patchID, zoneID, zoneFlip;
|
||||
getFaceInfo(faceI, patchID, zoneID, zoneFlip);
|
||||
label own = mesh_.faceOwner()[faceI];
|
||||
label masterPoint = mesh_.faces()[faceI][0];
|
||||
|
||||
@ -162,16 +159,15 @@ void Foam::boundaryCutter::addFace
|
||||
(
|
||||
polyModifyFace
|
||||
(
|
||||
newFace, // face
|
||||
newFace, // face
|
||||
faceI,
|
||||
own, // owner
|
||||
-1, // neighbour
|
||||
false, // flux flip
|
||||
patchIDs[0], // patch for face
|
||||
false, // remove from zone
|
||||
zoneID, // zone for face
|
||||
zoneFlip, // face zone flip
|
||||
patchIDs[1] // subPatch ID
|
||||
own, // owner
|
||||
-1, // neighbour
|
||||
false, // flux flip
|
||||
patchID, // patch for face
|
||||
false, // remove from zone
|
||||
zoneID, // zone for face
|
||||
zoneFlip // face zone flip
|
||||
)
|
||||
);
|
||||
|
||||
@ -190,10 +186,9 @@ void Foam::boundaryCutter::addFace
|
||||
-1, // master edge
|
||||
-1, // master face for addition
|
||||
false, // flux flip
|
||||
patchIDs[0], // patch for face
|
||||
patchID, // patch for face
|
||||
zoneID, // zone for face
|
||||
zoneFlip, // face zone flip
|
||||
patchIDs[1]
|
||||
zoneFlip // face zone flip
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -271,6 +266,10 @@ bool Foam::boundaryCutter::splitFace
|
||||
// - walk to next cut. Make face
|
||||
// - loop until face done.
|
||||
|
||||
// Information about old face
|
||||
label patchID, zoneID, zoneFlip;
|
||||
getFaceInfo(faceI, patchID, zoneID, zoneFlip);
|
||||
|
||||
// Get face with new points on cut edges for ease of looping
|
||||
face extendedFace(addEdgeCutsToFace(faceI, edgeToAddedPoints));
|
||||
|
||||
@ -565,9 +564,8 @@ void Foam::boundaryCutter::setRefinement
|
||||
label addedPointI = iter();
|
||||
|
||||
// Information about old face
|
||||
labelPair patchIDs;
|
||||
label zoneID, zoneFlip;
|
||||
getFaceInfo(faceI, patchIDs, zoneID, zoneFlip);
|
||||
label patchID, zoneID, zoneFlip;
|
||||
getFaceInfo(faceI, patchID, zoneID, zoneFlip);
|
||||
label own = mesh_.faceOwner()[faceI];
|
||||
label masterPoint = mesh_.faces()[faceI][0];
|
||||
|
||||
@ -595,11 +593,10 @@ void Foam::boundaryCutter::setRefinement
|
||||
own, // owner
|
||||
-1, // neighbour
|
||||
false, // flux flip
|
||||
patchIDs[0], // patch for face
|
||||
patchID, // patch for face
|
||||
false, // remove from zone
|
||||
zoneID, // zone for face
|
||||
zoneFlip, // face zone flip
|
||||
patchIDs[1]
|
||||
zoneFlip // face zone flip
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -617,10 +614,9 @@ void Foam::boundaryCutter::setRefinement
|
||||
-1, // master edge
|
||||
-1, // master face for addition
|
||||
false, // flux flip
|
||||
patchIDs[0], // patch for face
|
||||
patchID, // patch for face
|
||||
zoneID, // zone for face
|
||||
zoneFlip, // face zone flip
|
||||
patchIDs[1]
|
||||
zoneFlip // face zone flip
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -651,9 +647,8 @@ void Foam::boundaryCutter::setRefinement
|
||||
face newFace(addEdgeCutsToFace(faceI, edgeToAddedPoints));
|
||||
|
||||
// Information about old face
|
||||
labelPair patchIDs;
|
||||
label zoneID, zoneFlip;
|
||||
getFaceInfo(faceI, patchIDs, zoneID, zoneFlip);
|
||||
label patchID, zoneID, zoneFlip;
|
||||
getFaceInfo(faceI, patchID, zoneID, zoneFlip);
|
||||
label own = mesh_.faceOwner()[faceI];
|
||||
label masterPoint = mesh_.faces()[faceI][0];
|
||||
|
||||
@ -701,11 +696,10 @@ void Foam::boundaryCutter::setRefinement
|
||||
own, // owner
|
||||
-1, // neighbour
|
||||
false, // flux flip
|
||||
patchIDs[0], // patch for face
|
||||
patchID, // patch for face
|
||||
false, // remove from zone
|
||||
zoneID, // zone for face
|
||||
zoneFlip, // face zone flip
|
||||
patchIDs[1]
|
||||
zoneFlip // face zone flip
|
||||
)
|
||||
);
|
||||
|
||||
@ -736,10 +730,9 @@ void Foam::boundaryCutter::setRefinement
|
||||
-1, // master edge
|
||||
-1, // master face for addition
|
||||
false, // flux flip
|
||||
patchIDs[0], // patch for face
|
||||
patchID, // patch for face
|
||||
zoneID, // zone for face
|
||||
zoneFlip, // face zone flip
|
||||
patchIDs[1]
|
||||
zoneFlip // face zone flip
|
||||
)
|
||||
);
|
||||
|
||||
@ -799,9 +792,8 @@ void Foam::boundaryCutter::setRefinement
|
||||
nei = mesh_.faceNeighbour()[faceI];
|
||||
}
|
||||
|
||||
labelPair patchIDs;
|
||||
label zoneID, zoneFlip;
|
||||
getFaceInfo(faceI, patchIDs, zoneID, zoneFlip);
|
||||
label patchID, zoneID, zoneFlip;
|
||||
getFaceInfo(faceI, patchID, zoneID, zoneFlip);
|
||||
|
||||
meshMod.setAction
|
||||
(
|
||||
@ -812,11 +804,10 @@ void Foam::boundaryCutter::setRefinement
|
||||
own, // owner
|
||||
nei, // neighbour
|
||||
false, // face flip
|
||||
patchIDs[0], // patch for face
|
||||
patchID, // patch for face
|
||||
false, // remove from zone
|
||||
zoneID, // zone for face
|
||||
zoneFlip, // face flip in zone
|
||||
patchIDs[1]
|
||||
zoneFlip // face flip in zone
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@ -84,7 +84,7 @@ class boundaryCutter
|
||||
void getFaceInfo
|
||||
(
|
||||
const label faceI,
|
||||
labelPair& patchID,
|
||||
label& patchID,
|
||||
label& zoneID,
|
||||
label& zoneFlip
|
||||
) const;
|
||||
|
||||
@ -183,7 +183,7 @@ void Foam::meshCutAndRemove::faceCells
|
||||
const label faceI,
|
||||
label& own,
|
||||
label& nei,
|
||||
labelPair& patchIDs
|
||||
label& patchID
|
||||
) const
|
||||
{
|
||||
const labelListList& anchorPts = cuts.cellAnchorPoints();
|
||||
@ -211,12 +211,12 @@ void Foam::meshCutAndRemove::faceCells
|
||||
}
|
||||
}
|
||||
|
||||
patchIDs = polyTopoChange::whichPatch(mesh().boundaryMesh(), faceI);
|
||||
patchID = mesh().boundaryMesh().whichPatch(faceI);
|
||||
|
||||
if (patchIDs[0] == -1 && (own == -1 || nei == -1))
|
||||
if (patchID == -1 && (own == -1 || nei == -1))
|
||||
{
|
||||
// Face was internal but becomes external
|
||||
patchIDs[0] = exposedPatchI;
|
||||
patchID = exposedPatchI;
|
||||
}
|
||||
}
|
||||
|
||||
@ -250,7 +250,7 @@ void Foam::meshCutAndRemove::addFace
|
||||
const face& newFace,
|
||||
const label own,
|
||||
const label nei,
|
||||
const labelPair& patchIDs
|
||||
const label patchID
|
||||
)
|
||||
{
|
||||
label zoneID;
|
||||
@ -266,7 +266,7 @@ void Foam::meshCutAndRemove::addFace
|
||||
Pout<< "Adding face " << newFace
|
||||
<< " with new owner:" << own
|
||||
<< " with new neighbour:" << nei
|
||||
<< " patchIDs:" << patchIDs
|
||||
<< " patchID:" << patchID
|
||||
<< " anchor:" << masterPointI
|
||||
<< " zoneID:" << zoneID
|
||||
<< " zoneFlip:" << zoneFlip
|
||||
@ -284,10 +284,9 @@ void Foam::meshCutAndRemove::addFace
|
||||
-1, // master edge
|
||||
-1, // master face for addition
|
||||
false, // flux flip
|
||||
patchIDs[0], // patch for face
|
||||
patchID, // patch for face
|
||||
zoneID, // zone for face
|
||||
zoneFlip, // face zone flip
|
||||
patchIDs[1]
|
||||
zoneFlip // face zone flip
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -299,7 +298,7 @@ void Foam::meshCutAndRemove::addFace
|
||||
Pout<< "Adding (reversed) face " << newFace.reverseFace()
|
||||
<< " with new owner:" << nei
|
||||
<< " with new neighbour:" << own
|
||||
<< " patchIDs:" << patchIDs
|
||||
<< " patchID:" << patchID
|
||||
<< " anchor:" << masterPointI
|
||||
<< " zoneID:" << zoneID
|
||||
<< " zoneFlip:" << zoneFlip
|
||||
@ -317,10 +316,9 @@ void Foam::meshCutAndRemove::addFace
|
||||
-1, // master edge
|
||||
-1, // master face for addition
|
||||
false, // flux flip
|
||||
patchIDs[0], // patch for face
|
||||
patchID, // patch for face
|
||||
zoneID, // zone for face
|
||||
zoneFlip, // face zone flip
|
||||
patchIDs[1]
|
||||
zoneFlip // face zone flip
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -335,7 +333,7 @@ void Foam::meshCutAndRemove::modFace
|
||||
const face& newFace,
|
||||
const label own,
|
||||
const label nei,
|
||||
const labelPair& patchIDs
|
||||
const label patchID
|
||||
)
|
||||
{
|
||||
label zoneID;
|
||||
@ -360,7 +358,7 @@ void Foam::meshCutAndRemove::modFace
|
||||
<< " new vertices:" << newFace
|
||||
<< " new owner:" << own
|
||||
<< " new neighbour:" << nei
|
||||
<< " new patch:" << patchIDs[0]
|
||||
<< " new patch:" << patchID
|
||||
<< " new zoneID:" << zoneID
|
||||
<< " new zoneFlip:" << zoneFlip
|
||||
<< endl;
|
||||
@ -377,11 +375,10 @@ void Foam::meshCutAndRemove::modFace
|
||||
own, // owner
|
||||
nei, // neighbour
|
||||
false, // face flip
|
||||
patchIDs[0], // patch for face
|
||||
patchID, // patch for face
|
||||
false, // remove from zone
|
||||
zoneID, // zone for face
|
||||
zoneFlip, // face flip in zone
|
||||
patchIDs[1] // subPatch
|
||||
zoneFlip // face flip in zone
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -396,11 +393,10 @@ void Foam::meshCutAndRemove::modFace
|
||||
nei, // owner
|
||||
own, // neighbour
|
||||
false, // face flip
|
||||
patchIDs[0], // patch for face
|
||||
patchID, // patch for face
|
||||
false, // remove from zone
|
||||
zoneID, // zone for face
|
||||
zoneFlip, // face flip in zone
|
||||
patchIDs[1] // subPatch
|
||||
zoneFlip // face flip in zone
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -846,8 +842,7 @@ void Foam::meshCutAndRemove::setRefinement
|
||||
false, // flux flip
|
||||
cutPatch[cellI], // patch for face
|
||||
-1, // zone for face
|
||||
false, // face zone flip
|
||||
-1 //? TBD
|
||||
false // face zone flip
|
||||
)
|
||||
);
|
||||
|
||||
@ -1069,11 +1064,11 @@ void Foam::meshCutAndRemove::setRefinement
|
||||
|
||||
// If faces were internal but now become external set a patch.
|
||||
// If they were external already keep the patch.
|
||||
labelPair patchIDs = polyTopoChange::whichPatch(patches, faceI);
|
||||
label patchID = patches.whichPatch(faceI);
|
||||
|
||||
if (patchIDs[0] == -1)
|
||||
if (patchID == -1)
|
||||
{
|
||||
patchIDs[0] = exposedPatchI;
|
||||
patchID = exposedPatchI;
|
||||
}
|
||||
|
||||
|
||||
@ -1087,7 +1082,7 @@ void Foam::meshCutAndRemove::setRefinement
|
||||
if (f0Nei != -1)
|
||||
{
|
||||
// f0 becomes external face (note:modFace will reverse face)
|
||||
modFace(meshMod, faceI, f0, f0Own, f0Nei, patchIDs);
|
||||
modFace(meshMod, faceI, f0, f0Own, f0Nei, patchID);
|
||||
modifiedFaceI = true;
|
||||
}
|
||||
}
|
||||
@ -1096,13 +1091,13 @@ void Foam::meshCutAndRemove::setRefinement
|
||||
if (f0Nei == -1)
|
||||
{
|
||||
// f0 becomes external face
|
||||
modFace(meshMod, faceI, f0, f0Own, f0Nei, patchIDs);
|
||||
modFace(meshMod, faceI, f0, f0Own, f0Nei, patchID);
|
||||
modifiedFaceI = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// f0 stays internal face.
|
||||
modFace(meshMod, faceI, f0, f0Own, f0Nei, labelPair(-1, -1));
|
||||
modFace(meshMod, faceI, f0, f0Own, f0Nei, -1);
|
||||
modifiedFaceI = true;
|
||||
}
|
||||
}
|
||||
@ -1121,12 +1116,12 @@ void Foam::meshCutAndRemove::setRefinement
|
||||
// f1 becomes external face (note:modFace will reverse face)
|
||||
if (!modifiedFaceI)
|
||||
{
|
||||
modFace(meshMod, faceI, f1, f1Own, f1Nei, patchIDs);
|
||||
modFace(meshMod, faceI, f1, f1Own, f1Nei, patchID);
|
||||
modifiedFaceI = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
label masterPointI = findPatchFacePoint(f1, patchIDs[0]);
|
||||
label masterPointI = findPatchFacePoint(f1, patchID);
|
||||
|
||||
addFace
|
||||
(
|
||||
@ -1136,7 +1131,7 @@ void Foam::meshCutAndRemove::setRefinement
|
||||
f1, // vertices of face
|
||||
f1Own,
|
||||
f1Nei,
|
||||
patchIDs // patch for new face
|
||||
patchID // patch for new face
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1148,12 +1143,12 @@ void Foam::meshCutAndRemove::setRefinement
|
||||
// f1 becomes external face
|
||||
if (!modifiedFaceI)
|
||||
{
|
||||
modFace(meshMod, faceI, f1, f1Own, f1Nei, patchIDs);
|
||||
modFace(meshMod, faceI, f1, f1Own, f1Nei, patchID);
|
||||
modifiedFaceI = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
label masterPointI = findPatchFacePoint(f1, patchIDs[0]);
|
||||
label masterPointI = findPatchFacePoint(f1, patchID);
|
||||
|
||||
addFace
|
||||
(
|
||||
@ -1163,7 +1158,7 @@ void Foam::meshCutAndRemove::setRefinement
|
||||
f1,
|
||||
f1Own,
|
||||
f1Nei,
|
||||
patchIDs
|
||||
patchID
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1172,31 +1167,14 @@ void Foam::meshCutAndRemove::setRefinement
|
||||
// f1 is internal face.
|
||||
if (!modifiedFaceI)
|
||||
{
|
||||
modFace
|
||||
(
|
||||
meshMod,
|
||||
faceI,
|
||||
f1,
|
||||
f1Own,
|
||||
f1Nei,
|
||||
labelPair(-1, -1)
|
||||
);
|
||||
modFace(meshMod, faceI, f1, f1Own, f1Nei, -1);
|
||||
modifiedFaceI = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
label masterPointI = findPatchFacePoint(f1, -1);
|
||||
|
||||
addFace
|
||||
(
|
||||
meshMod,
|
||||
faceI,
|
||||
masterPointI,
|
||||
f1,
|
||||
f1Own,
|
||||
f1Nei,
|
||||
labelPair(-1, -1)
|
||||
);
|
||||
addFace(meshMod, faceI, masterPointI, f1, f1Own, f1Nei, -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1239,9 +1217,8 @@ void Foam::meshCutAndRemove::setRefinement
|
||||
// borders by edge a cell which has been split.
|
||||
|
||||
// Get (new or original) owner and neighbour of faceI
|
||||
label own, nei;
|
||||
labelPair patchIDs;
|
||||
faceCells(cuts, exposedPatchI, faceI, own, nei, patchIDs);
|
||||
label own, nei, patchID;
|
||||
faceCells(cuts, exposedPatchI, faceI, own, nei, patchID);
|
||||
|
||||
|
||||
if (own == -1 && nei == -1)
|
||||
@ -1272,7 +1249,7 @@ void Foam::meshCutAndRemove::setRefinement
|
||||
newFace,
|
||||
own,
|
||||
nei,
|
||||
patchIDs
|
||||
patchID
|
||||
);
|
||||
}
|
||||
|
||||
@ -1296,9 +1273,8 @@ void Foam::meshCutAndRemove::setRefinement
|
||||
if (!faceUptodate[faceI])
|
||||
{
|
||||
// Get (new or original) owner and neighbour of faceI
|
||||
labelPair patchIDs;
|
||||
label own, nei;
|
||||
faceCells(cuts, exposedPatchI, faceI, own, nei, patchIDs);
|
||||
label own, nei, patchID;
|
||||
faceCells(cuts, exposedPatchI, faceI, own, nei, patchID);
|
||||
|
||||
if (own == -1 && nei == -1)
|
||||
{
|
||||
@ -1311,7 +1287,7 @@ void Foam::meshCutAndRemove::setRefinement
|
||||
}
|
||||
else
|
||||
{
|
||||
modFace(meshMod, faceI, faces[faceI], own, nei, patchIDs);
|
||||
modFace(meshMod, faceI, faces[faceI], own, nei, patchID);
|
||||
}
|
||||
|
||||
faceUptodate[faceI] = true;
|
||||
|
||||
@ -106,7 +106,7 @@ class meshCutAndRemove
|
||||
const label faceI,
|
||||
label& own,
|
||||
label& nei,
|
||||
labelPair& patchIDs
|
||||
label& patchID
|
||||
) const;
|
||||
|
||||
//- Get zone information for face.
|
||||
@ -126,7 +126,7 @@ class meshCutAndRemove
|
||||
const face& newFace,
|
||||
const label owner,
|
||||
const label neighbour,
|
||||
const labelPair& patchIDs
|
||||
const label patchID
|
||||
);
|
||||
|
||||
//- Modifies existing faceI for either new owner/neighbour or
|
||||
@ -139,7 +139,7 @@ class meshCutAndRemove
|
||||
const face& newFace,
|
||||
const label owner,
|
||||
const label neighbour,
|
||||
const labelPair& patchIDs
|
||||
const label patchID
|
||||
);
|
||||
|
||||
// Copies face starting from startFp. Jumps cuts. Marks visited
|
||||
|
||||
@ -22,8 +22,6 @@ License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "meshCutter.H"
|
||||
@ -177,12 +175,17 @@ void Foam::meshCutter::faceCells
|
||||
void Foam::meshCutter::getFaceInfo
|
||||
(
|
||||
const label faceI,
|
||||
labelPair& patchIDs,
|
||||
label& patchID,
|
||||
label& zoneID,
|
||||
label& zoneFlip
|
||||
) const
|
||||
{
|
||||
patchIDs = polyTopoChange::whichPatch(mesh().boundaryMesh(), faceI);
|
||||
patchID = -1;
|
||||
|
||||
if (!mesh().isInternalFace(faceI))
|
||||
{
|
||||
patchID = mesh().boundaryMesh().whichPatch(faceI);
|
||||
}
|
||||
|
||||
zoneID = mesh().faceZones().whichZone(faceI);
|
||||
|
||||
@ -207,9 +210,9 @@ void Foam::meshCutter::addFace
|
||||
const label nei
|
||||
)
|
||||
{
|
||||
labelPair patchIDs;
|
||||
label zoneID, zoneFlip;
|
||||
getFaceInfo(faceI, patchIDs, zoneID, zoneFlip);
|
||||
label patchID, zoneID, zoneFlip;
|
||||
|
||||
getFaceInfo(faceI, patchID, zoneID, zoneFlip);
|
||||
|
||||
if ((nei == -1) || (own < nei))
|
||||
{
|
||||
@ -219,7 +222,7 @@ void Foam::meshCutter::addFace
|
||||
Pout<< "Adding face " << newFace
|
||||
<< " with new owner:" << own
|
||||
<< " with new neighbour:" << nei
|
||||
<< " patchIDs:" << patchIDs
|
||||
<< " patchID:" << patchID
|
||||
<< " zoneID:" << zoneID
|
||||
<< " zoneFlip:" << zoneFlip
|
||||
<< endl;
|
||||
@ -236,10 +239,9 @@ void Foam::meshCutter::addFace
|
||||
-1, // master edge
|
||||
faceI, // master face for addition
|
||||
false, // flux flip
|
||||
patchIDs[0], // patch for face
|
||||
patchID, // patch for face
|
||||
zoneID, // zone for face
|
||||
zoneFlip, // face zone flip
|
||||
patchIDs[1] // subPatch
|
||||
zoneFlip // face zone flip
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -251,7 +253,7 @@ void Foam::meshCutter::addFace
|
||||
Pout<< "Adding (reversed) face " << newFace.reverseFace()
|
||||
<< " with new owner:" << nei
|
||||
<< " with new neighbour:" << own
|
||||
<< " patchIDs:" << patchIDs
|
||||
<< " patchID:" << patchID
|
||||
<< " zoneID:" << zoneID
|
||||
<< " zoneFlip:" << zoneFlip
|
||||
<< endl;
|
||||
@ -268,10 +270,9 @@ void Foam::meshCutter::addFace
|
||||
-1, // master edge
|
||||
faceI, // master face for addition
|
||||
false, // flux flip
|
||||
patchIDs[0], // patch for face
|
||||
patchID, // patch for face
|
||||
zoneID, // zone for face
|
||||
zoneFlip, // face zone flip
|
||||
patchIDs[1] // subPatch
|
||||
zoneFlip // face zone flip
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -288,9 +289,9 @@ void Foam::meshCutter::modFace
|
||||
const label nei
|
||||
)
|
||||
{
|
||||
labelPair patchIDs;
|
||||
label zoneID, zoneFlip;
|
||||
getFaceInfo(faceI, patchIDs, zoneID, zoneFlip);
|
||||
label patchID, zoneID, zoneFlip;
|
||||
|
||||
getFaceInfo(faceI, patchID, zoneID, zoneFlip);
|
||||
|
||||
if
|
||||
(
|
||||
@ -325,11 +326,10 @@ void Foam::meshCutter::modFace
|
||||
own, // owner
|
||||
nei, // neighbour
|
||||
false, // face flip
|
||||
patchIDs[0], // patch for face
|
||||
patchID, // patch for face
|
||||
false, // remove from zone
|
||||
zoneID, // zone for face
|
||||
zoneFlip, // face flip in zone
|
||||
patchIDs[1] // subPatch
|
||||
zoneFlip // face flip in zone
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -344,11 +344,10 @@ void Foam::meshCutter::modFace
|
||||
nei, // owner
|
||||
own, // neighbour
|
||||
false, // face flip
|
||||
patchIDs[0], // patch for face
|
||||
patchID, // patch for face
|
||||
false, // remove from zone
|
||||
zoneID, // zone for face
|
||||
zoneFlip, // face flip in zone
|
||||
patchIDs[1] // subPatch
|
||||
zoneFlip // face flip in zone
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -694,8 +693,7 @@ void Foam::meshCutter::setRefinement
|
||||
false, // flux flip
|
||||
-1, // patch for face
|
||||
-1, // zone for face
|
||||
false, // face zone flip
|
||||
-1 // subpatch
|
||||
false // face zone flip
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@ -185,7 +185,7 @@ class meshCutter
|
||||
void getFaceInfo
|
||||
(
|
||||
const label faceI,
|
||||
labelPair& patchIDs,
|
||||
label& patchID,
|
||||
label& zoneID,
|
||||
label& zoneFlip
|
||||
) const;
|
||||
|
||||
@ -22,8 +22,6 @@ License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "refineCell.H"
|
||||
@ -31,7 +29,6 @@ Description
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
// Null
|
||||
Foam::refineCell::refineCell()
|
||||
:
|
||||
cellNo_(-1),
|
||||
@ -39,7 +36,6 @@ Foam::refineCell::refineCell()
|
||||
{}
|
||||
|
||||
|
||||
// from components
|
||||
Foam::refineCell::refineCell(const label cellI, const vector& direction)
|
||||
:
|
||||
cellNo_(cellI),
|
||||
@ -61,7 +57,6 @@ Foam::refineCell::refineCell(const label cellI, const vector& direction)
|
||||
}
|
||||
|
||||
|
||||
// from Istream
|
||||
Foam::refineCell::refineCell(Istream& is)
|
||||
:
|
||||
cellNo_(readLabel(is)),
|
||||
|
||||
@ -135,7 +135,7 @@ void Foam::motionSmoother::makePatchPatchAddressing()
|
||||
|
||||
forAll(bm, patchi)
|
||||
{
|
||||
if(!isA<emptyPolyPatch>(bm[patchi]))
|
||||
if (!isA<emptyPolyPatch>(bm[patchi]))
|
||||
{
|
||||
nPatchPatchPoints += bm[patchi].boundaryPoints().size();
|
||||
}
|
||||
@ -153,7 +153,7 @@ void Foam::motionSmoother::makePatchPatchAddressing()
|
||||
|
||||
forAll(bm, patchi)
|
||||
{
|
||||
if(!isA<emptyPolyPatch>(bm[patchi]))
|
||||
if (!isA<emptyPolyPatch>(bm[patchi]))
|
||||
{
|
||||
const labelList& bp = bm[patchi].boundaryPoints();
|
||||
const labelList& meshPoints = bm[patchi].meshPoints();
|
||||
@ -1175,7 +1175,7 @@ void Foam::motionSmoother::updateMesh()
|
||||
|
||||
forAll(meshPoints, i)
|
||||
{
|
||||
isInternalPoint_.set(meshPoints[i], 0);
|
||||
isInternalPoint_.unset(meshPoints[i]);
|
||||
}
|
||||
|
||||
// Calculate master edge addressing
|
||||
|
||||
@ -179,7 +179,7 @@ class motionSmoother
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Average value (not positions!) of connected points.
|
||||
//- Average of connected points.
|
||||
template <class Type>
|
||||
tmp<GeometricField<Type, pointPatchField, pointMesh> > avg
|
||||
(
|
||||
|
||||
@ -51,7 +51,7 @@ void Foam::motionSmoother::checkConstraints
|
||||
|
||||
forAll(bm, patchi)
|
||||
{
|
||||
if(!isA<emptyPolyPatch>(bm[patchi]))
|
||||
if (!isA<emptyPolyPatch>(bm[patchi]))
|
||||
{
|
||||
nPatchPatchPoints += bm[patchi].boundaryPoints().size();
|
||||
}
|
||||
@ -81,7 +81,7 @@ void Foam::motionSmoother::checkConstraints
|
||||
|
||||
forAll(bm, patchi)
|
||||
{
|
||||
if(!isA<emptyPolyPatch>(bm[patchi]))
|
||||
if (!isA<emptyPolyPatch>(bm[patchi]))
|
||||
{
|
||||
const labelList& bp = bm[patchi].boundaryPoints();
|
||||
const labelList& meshPoints = bm[patchi].meshPoints();
|
||||
@ -106,7 +106,7 @@ void Foam::motionSmoother::checkConstraints
|
||||
|
||||
forAll(bm, patchi)
|
||||
{
|
||||
if(!isA<emptyPolyPatch>(bm[patchi]))
|
||||
if (!isA<emptyPolyPatch>(bm[patchi]))
|
||||
{
|
||||
const labelList& bp = bm[patchi].boundaryPoints();
|
||||
const labelList& meshPoints = bm[patchi].meshPoints();
|
||||
@ -229,6 +229,7 @@ Foam::motionSmoother::avg
|
||||
scalar(0) // null value
|
||||
);
|
||||
|
||||
|
||||
// Average
|
||||
// ~~~~~~~
|
||||
|
||||
|
||||
@ -1276,7 +1276,7 @@ bool Foam::polyMeshGeometry::checkFaceAngles
|
||||
faceNormal /= mag(faceNormal) + VSMALL;
|
||||
|
||||
// Get edge from f[0] to f[size-1];
|
||||
vector ePrev(p[f[0]] - p[f[f.size()-1]]);
|
||||
vector ePrev(p[f.first()] - p[f.last()]);
|
||||
scalar magEPrev = mag(ePrev);
|
||||
ePrev /= magEPrev + VSMALL;
|
||||
|
||||
|
||||
@ -78,7 +78,7 @@ Foam::autoPtr<Foam::motionSolver> Foam::motionSolver::New(const polyMesh& mesh)
|
||||
|
||||
word solverTypeName(msData);
|
||||
|
||||
Info << "Selecting motion solver: " << solverTypeName << endl;
|
||||
Info<< "Selecting motion solver: " << solverTypeName << endl;
|
||||
|
||||
dlLibraryTable::open
|
||||
(
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*---------------------------------------------------------------------------* \
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
@ -1790,7 +1790,7 @@ void Foam::faceCoupleInfo::subDivisionMatch
|
||||
|
||||
cutPointI = cutEdges[cutEdgeI].otherVertex(cutPointI);
|
||||
|
||||
} while(cutPointI != cutPoint1);
|
||||
} while (cutPointI != cutPoint1);
|
||||
}
|
||||
|
||||
if (debug)
|
||||
|
||||
@ -86,8 +86,6 @@ class polyAddFace
|
||||
//- Face zone flip
|
||||
bool zoneFlip_;
|
||||
|
||||
//- Sub patch ID (for proc patches)
|
||||
label subPatchID_;
|
||||
|
||||
public:
|
||||
|
||||
@ -111,8 +109,7 @@ public:
|
||||
flipFaceFlux_(false),
|
||||
patchID_(-1),
|
||||
zoneID_(-1),
|
||||
zoneFlip_(false),
|
||||
subPatchID_(-1)
|
||||
zoneFlip_(false)
|
||||
{}
|
||||
|
||||
|
||||
@ -128,8 +125,7 @@ public:
|
||||
const bool flipFaceFlux,
|
||||
const label patchID,
|
||||
const label zoneID,
|
||||
const bool zoneFlip,
|
||||
const label subPatchID
|
||||
const bool zoneFlip
|
||||
)
|
||||
:
|
||||
face_(f),
|
||||
@ -141,8 +137,7 @@ public:
|
||||
flipFaceFlux_(flipFaceFlux),
|
||||
patchID_(patchID),
|
||||
zoneID_(zoneID),
|
||||
zoneFlip_(zoneFlip),
|
||||
subPatchID_(subPatchID)
|
||||
zoneFlip_(zoneFlip)
|
||||
{
|
||||
if (face_.size() < 3)
|
||||
{
|
||||
@ -159,8 +154,7 @@ public:
|
||||
" const bool flipFaceFlux,\n"
|
||||
" const label patchID,\n"
|
||||
" const label zoneID,\n"
|
||||
" const bool zoneFlip,\n"
|
||||
" const label subPatchID\n"
|
||||
" const bool zoneFlip\n"
|
||||
")"
|
||||
) << "Invalid face: less than 3 points. "
|
||||
<< "This is not allowed.\n"
|
||||
@ -189,8 +183,7 @@ public:
|
||||
" const bool flipFaceFlux,\n"
|
||||
" const label patchID,\n"
|
||||
" const label zoneID,\n"
|
||||
" const bool zoneFlip,\n"
|
||||
" const label subPatchID\n"
|
||||
" const bool zoneFlip\n"
|
||||
")"
|
||||
) << "Face contains invalid vertex ID: " << face_ << ". "
|
||||
<< "This is not allowed.\n"
|
||||
@ -219,8 +212,7 @@ public:
|
||||
" const bool flipFaceFlux,\n"
|
||||
" const label patchID,\n"
|
||||
" const label zoneID,\n"
|
||||
" const bool zoneFlip,\n"
|
||||
" const label subPatchID\n"
|
||||
" const bool zoneFlip\n"
|
||||
")"
|
||||
) << "Face owner and neighbour are identical. "
|
||||
<< "This is not allowed.\n"
|
||||
@ -249,8 +241,7 @@ public:
|
||||
" const bool flipFaceFlux,\n"
|
||||
" const label patchID,\n"
|
||||
" const label zoneID,\n"
|
||||
" const bool zoneFlip,\n"
|
||||
" const label subPatchID\n"
|
||||
" const bool zoneFlip\n"
|
||||
")"
|
||||
) << "Patch face has got a neighbour. Patch ID: " << patchID
|
||||
<< ". This is not allowed.\n"
|
||||
@ -278,9 +269,7 @@ public:
|
||||
" const label masterFaceID,\n"
|
||||
" const bool flipFaceFlux,\n"
|
||||
" const label patchID,\n"
|
||||
" const label zoneID,\n"
|
||||
" const bool zoneFlip,\n"
|
||||
" const label subPatchID\n"
|
||||
" const label zoneID"
|
||||
")"
|
||||
) << "Face has no owner and is not in a zone. "
|
||||
<< "This is not allowed.\n"
|
||||
@ -310,9 +299,7 @@ public:
|
||||
" const bool flipFaceFlux,\n"
|
||||
" const label patchID,\n"
|
||||
" const label zoneID,\n"
|
||||
" const bool zoneFlip,\n"
|
||||
" const label subPatchID\n"
|
||||
")"
|
||||
" const bool zoneFlip\n"
|
||||
")"
|
||||
) << "Specified zone flip for a face that does not "
|
||||
<< "belong to zone. This is not allowed.\n"
|
||||
@ -439,13 +426,6 @@ public:
|
||||
{
|
||||
return zoneFlip_;
|
||||
}
|
||||
|
||||
//- Boundary sub patch ID
|
||||
label subPatchID() const
|
||||
{
|
||||
return subPatchID_;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -263,7 +263,7 @@ Foam::labelPair Foam::addPatchCellLayer::getEdgeString
|
||||
// - which hasn't been handled yet
|
||||
// - with same neighbour
|
||||
// - that needs extrusion
|
||||
while(true)
|
||||
while (true)
|
||||
{
|
||||
label prevFp = fEdges.rcIndex(startFp);
|
||||
|
||||
@ -287,7 +287,7 @@ Foam::labelPair Foam::addPatchCellLayer::getEdgeString
|
||||
|
||||
// Search forward for end of string
|
||||
endFp = startFp;
|
||||
while(true)
|
||||
while (true)
|
||||
{
|
||||
label nextFp = fEdges.fcIndex(endFp);
|
||||
|
||||
@ -1276,7 +1276,7 @@ void Foam::addPatchCellLayer::setRefinement
|
||||
doneEdge[fEdges[fp]] = true;
|
||||
fp = f.fcIndex(fp);
|
||||
}
|
||||
stringedVerts[stringedVerts.size()-1] = f[fp];
|
||||
stringedVerts.last() = f[fp];
|
||||
|
||||
|
||||
// Now stringedVerts contains the vertices in order of face f.
|
||||
@ -1294,7 +1294,7 @@ void Foam::addPatchCellLayer::setRefinement
|
||||
|
||||
for (label i = 0; i < numEdgeSideFaces; i++)
|
||||
{
|
||||
label vEnd = stringedVerts[stringedVerts.size()-1];
|
||||
label vEnd = stringedVerts.last();
|
||||
label vStart = stringedVerts[0];
|
||||
|
||||
// calculate number of points making up a face
|
||||
|
||||
@ -193,7 +193,7 @@ class addPatchCellLayer
|
||||
label addSideFace
|
||||
(
|
||||
const indirectPrimitivePatch&,
|
||||
const List<labelPair>& patchIDs,
|
||||
const labelList& patchID,
|
||||
const labelListList& addedCells,
|
||||
const face& newFace,
|
||||
const label ownFaceI,
|
||||
|
||||
@ -62,7 +62,7 @@ bool Foam::combineFaces::convexFace
|
||||
n /= mag(n);
|
||||
|
||||
// Get edge from f[0] to f[size-1];
|
||||
vector ePrev(points[f[0]] - points[f[f.size()-1]]);
|
||||
vector ePrev(points[f.first()] - points[f.last()]);
|
||||
scalar magEPrev = mag(ePrev);
|
||||
ePrev /= magEPrev + VSMALL;
|
||||
|
||||
@ -658,11 +658,7 @@ void Foam::combineFaces::setRefinement
|
||||
zoneFlip = fZone.flipMap()[fZone.whichFace(masterFaceI)];
|
||||
}
|
||||
|
||||
labelPair patchIDs = polyTopoChange::whichPatch
|
||||
(
|
||||
mesh_.boundaryMesh(),
|
||||
masterFaceI
|
||||
);
|
||||
label patchI = mesh_.boundaryMesh().whichPatch(masterFaceI);
|
||||
|
||||
meshMod.setAction
|
||||
(
|
||||
@ -673,11 +669,10 @@ void Foam::combineFaces::setRefinement
|
||||
mesh_.faceOwner()[masterFaceI], // owner
|
||||
-1, // neighbour
|
||||
false, // face flip
|
||||
patchIDs[0], // patch for face
|
||||
patchI, // patch for face
|
||||
false, // remove from zone
|
||||
zoneID, // zone for face
|
||||
zoneFlip, // face flip in zone
|
||||
patchIDs[1]
|
||||
zoneFlip // face flip in zone
|
||||
)
|
||||
);
|
||||
|
||||
@ -961,13 +956,9 @@ void Foam::combineFaces::setUnrefinement
|
||||
const faceZone& fZone = mesh_.faceZones()[zoneID];
|
||||
zoneFlip = fZone.flipMap()[fZone.whichFace(masterFaceI)];
|
||||
}
|
||||
labelPair patchIDs = polyTopoChange::whichPatch
|
||||
(
|
||||
mesh_.boundaryMesh(),
|
||||
masterFaceI
|
||||
);
|
||||
label patchI = mesh_.boundaryMesh().whichPatch(masterFaceI);
|
||||
|
||||
if (mesh_.boundaryMesh()[patchIDs[0]].coupled())
|
||||
if (mesh_.boundaryMesh()[patchI].coupled())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
@ -975,7 +966,7 @@ void Foam::combineFaces::setUnrefinement
|
||||
"(const labelList&, polyTopoChange&"
|
||||
", Map<label>&, Map<label>&, Map<label>&)"
|
||||
) << "Master face " << masterFaceI << " is on coupled patch "
|
||||
<< mesh_.boundaryMesh()[patchIDs[0]].name()
|
||||
<< mesh_.boundaryMesh()[patchI].name()
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
@ -992,11 +983,10 @@ void Foam::combineFaces::setUnrefinement
|
||||
own, // owner
|
||||
-1, // neighbour
|
||||
false, // face flip
|
||||
patchIDs[0], // patch for face
|
||||
patchI, // patch for face
|
||||
false, // remove from zone
|
||||
zoneID, // zone for face
|
||||
zoneFlip, // face flip in zone
|
||||
patchIDs[1] // subPatchID
|
||||
zoneFlip // face flip in zone
|
||||
)
|
||||
);
|
||||
|
||||
@ -1010,17 +1000,16 @@ void Foam::combineFaces::setUnrefinement
|
||||
(
|
||||
polyAddFace
|
||||
(
|
||||
faces[i], // vertices
|
||||
own, // owner,
|
||||
-1, // neighbour,
|
||||
-1, // masterPointID,
|
||||
-1, // masterEdgeID,
|
||||
masterFaceI, // masterFaceID,
|
||||
false, // flipFaceFlux,
|
||||
patchIDs[0], // patchID,
|
||||
zoneID, // zoneID,
|
||||
zoneFlip, // zoneFlip
|
||||
patchIDs[1] // subPatchID
|
||||
faces[i], // vertices
|
||||
own, // owner,
|
||||
-1, // neighbour,
|
||||
-1, // masterPointID,
|
||||
-1, // masterEdgeID,
|
||||
masterFaceI, // masterFaceID,
|
||||
false, // flipFaceFlux,
|
||||
patchI, // patchID,
|
||||
zoneID, // zoneID,
|
||||
zoneFlip // zoneFlip
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -154,36 +154,34 @@ void Foam::duplicatePoints::setRefinement
|
||||
const faceZone& fZone = mesh_.faceZones()[zoneID];
|
||||
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
|
||||
}
|
||||
labelPair patchIDs = polyTopoChange::whichPatch(patches, faceI);
|
||||
|
||||
|
||||
if (mesh_.isInternalFace(faceI))
|
||||
{
|
||||
meshMod.modifyFace
|
||||
(
|
||||
newFace, // modified face
|
||||
faceI, // label of face being modified
|
||||
mesh_.faceOwner()[faceI], // owner
|
||||
newFace, // modified face
|
||||
faceI, // label of face being modified
|
||||
mesh_.faceOwner()[faceI], // owner
|
||||
mesh_.faceNeighbour()[faceI], // neighbour
|
||||
false, // face flip
|
||||
-1, // patch for face
|
||||
zoneID, // zone for face
|
||||
zoneFlip, // face flip in zone
|
||||
-1 // subPatch
|
||||
false, // face flip
|
||||
-1, // patch for face
|
||||
zoneID, // zone for face
|
||||
zoneFlip // face flip in zone
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
meshMod.modifyFace
|
||||
(
|
||||
newFace, // modified face
|
||||
faceI, // label of face being modified
|
||||
mesh_.faceOwner()[faceI], // owner
|
||||
-1, // neighbour
|
||||
false, // face flip
|
||||
patchIDs[0], // patch for face
|
||||
zoneID, // zone for face
|
||||
zoneFlip, // face flip in zone
|
||||
patchIDs[1]
|
||||
newFace, // modified face
|
||||
faceI, // label of face being modified
|
||||
mesh_.faceOwner()[faceI], // owner
|
||||
-1, // neighbour
|
||||
false, // face flip
|
||||
patches.whichPatch(faceI), // patch for face
|
||||
zoneID, // zone for face
|
||||
zoneFlip // face flip in zone
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -456,7 +456,7 @@ bool Foam::edgeCollapser::setRefinement(polyTopoChange& meshMod)
|
||||
{
|
||||
break;
|
||||
}
|
||||
} while(true);
|
||||
} while (true);
|
||||
|
||||
|
||||
// Keep track of faces that have been done already.
|
||||
@ -558,16 +558,16 @@ bool Foam::edgeCollapser::setRefinement(polyTopoChange& meshMod)
|
||||
// Get current connectivity
|
||||
label own = faceOwner[faceI];
|
||||
label nei = -1;
|
||||
labelPair patchIDs = polyTopoChange::whichPatch
|
||||
(
|
||||
boundaryMesh,
|
||||
faceI
|
||||
);
|
||||
label patchID = -1;
|
||||
|
||||
if (mesh_.isInternalFace(faceI))
|
||||
{
|
||||
nei = faceNeighbour[faceI];
|
||||
}
|
||||
else
|
||||
{
|
||||
patchID = boundaryMesh.whichPatch(faceI);
|
||||
}
|
||||
|
||||
meshMod.modifyFace
|
||||
(
|
||||
@ -576,10 +576,9 @@ bool Foam::edgeCollapser::setRefinement(polyTopoChange& meshMod)
|
||||
own, // owner
|
||||
nei, // neighbour
|
||||
false, // flipFaceFlux
|
||||
patchIDs[0], // patch
|
||||
patchID, // patch
|
||||
zoneID,
|
||||
zoneFlip,
|
||||
patchIDs[1] // subpatch for face
|
||||
zoneFlip
|
||||
);
|
||||
meshChanged = true;
|
||||
}
|
||||
|
||||
@ -22,8 +22,6 @@ License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "faceCollapser.H"
|
||||
@ -156,16 +154,16 @@ void Foam::faceCollapser::filterFace
|
||||
{
|
||||
label nei = -1;
|
||||
|
||||
labelPair patchIDs = polyTopoChange::whichPatch
|
||||
(
|
||||
mesh_.boundaryMesh(),
|
||||
faceI
|
||||
);
|
||||
label patchI = -1;
|
||||
|
||||
if (mesh_.isInternalFace(faceI))
|
||||
{
|
||||
nei = mesh_.faceNeighbour()[faceI];
|
||||
}
|
||||
else
|
||||
{
|
||||
patchI = mesh_.boundaryMesh().whichPatch(faceI);
|
||||
}
|
||||
|
||||
// Get current zone info
|
||||
label zoneID = mesh_.faceZones().whichZone(faceI);
|
||||
@ -188,11 +186,10 @@ void Foam::faceCollapser::filterFace
|
||||
mesh_.faceOwner()[faceI], // owner
|
||||
nei, // neighbour
|
||||
false, // face flip
|
||||
patchIDs[0], // patch for face
|
||||
patchI, // patch for face
|
||||
false, // remove from zone
|
||||
zoneID, // zone for face
|
||||
zoneFlip, // face flip in zone
|
||||
patchIDs[1]
|
||||
zoneFlip // face flip in zone
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -97,12 +97,17 @@ void Foam::hexRef8::reorder
|
||||
void Foam::hexRef8::getFaceInfo
|
||||
(
|
||||
const label faceI,
|
||||
labelPair& patchIDs,
|
||||
label& patchID,
|
||||
label& zoneID,
|
||||
label& zoneFlip
|
||||
) const
|
||||
{
|
||||
patchIDs = polyTopoChange::whichPatch(mesh_.boundaryMesh(), faceI);
|
||||
patchID = -1;
|
||||
|
||||
if (!mesh_.isInternalFace(faceI))
|
||||
{
|
||||
patchID = mesh_.boundaryMesh().whichPatch(faceI);
|
||||
}
|
||||
|
||||
zoneID = mesh_.faceZones().whichZone(faceI);
|
||||
|
||||
@ -127,9 +132,9 @@ Foam::label Foam::hexRef8::addFace
|
||||
const label nei
|
||||
) const
|
||||
{
|
||||
labelPair patchIDs;
|
||||
label zoneID, zoneFlip;
|
||||
getFaceInfo(faceI, patchIDs, zoneID, zoneFlip);
|
||||
label patchID, zoneID, zoneFlip;
|
||||
|
||||
getFaceInfo(faceI, patchID, zoneID, zoneFlip);
|
||||
|
||||
label newFaceI = -1;
|
||||
|
||||
@ -147,10 +152,9 @@ Foam::label Foam::hexRef8::addFace
|
||||
-1, // master edge
|
||||
faceI, // master face for addition
|
||||
false, // flux flip
|
||||
patchIDs[0], // patch for face
|
||||
patchID, // patch for face
|
||||
zoneID, // zone for face
|
||||
zoneFlip, // face zone flip
|
||||
patchIDs[1] // subPatch
|
||||
zoneFlip // face zone flip
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -168,10 +172,9 @@ Foam::label Foam::hexRef8::addFace
|
||||
-1, // master edge
|
||||
faceI, // master face for addition
|
||||
false, // flux flip
|
||||
patchIDs[0], // patch for face
|
||||
patchID, // patch for face
|
||||
zoneID, // zone for face
|
||||
zoneFlip, // face zone flip
|
||||
patchIDs[1] // subPatch
|
||||
zoneFlip // face zone flip
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -210,8 +213,7 @@ Foam::label Foam::hexRef8::addInternalFace
|
||||
false, // flux flip
|
||||
-1, // patch for face
|
||||
-1, // zone for face
|
||||
false, // face zone flip
|
||||
-1 // subPatch
|
||||
false // face zone flip
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -239,8 +241,7 @@ Foam::label Foam::hexRef8::addInternalFace
|
||||
false, // flux flip
|
||||
-1, // patch for face
|
||||
-1, // zone for face
|
||||
false, // face zone flip
|
||||
-1 // subPatch
|
||||
false // face zone flip
|
||||
)
|
||||
);
|
||||
|
||||
@ -275,8 +276,7 @@ Foam::label Foam::hexRef8::addInternalFace
|
||||
// false, // flux flip
|
||||
// -1, // patch for face
|
||||
// -1, // zone for face
|
||||
// false, // face zone flip
|
||||
// -1 // subPatch
|
||||
// false // face zone flip
|
||||
// )
|
||||
//);
|
||||
}
|
||||
@ -293,9 +293,9 @@ void Foam::hexRef8::modFace
|
||||
const label nei
|
||||
) const
|
||||
{
|
||||
labelPair patchIDs;
|
||||
label zoneID, zoneFlip;
|
||||
getFaceInfo(faceI, patchIDs, zoneID, zoneFlip);
|
||||
label patchID, zoneID, zoneFlip;
|
||||
|
||||
getFaceInfo(faceI, patchID, zoneID, zoneFlip);
|
||||
|
||||
if
|
||||
(
|
||||
@ -318,11 +318,10 @@ void Foam::hexRef8::modFace
|
||||
own, // owner
|
||||
nei, // neighbour
|
||||
false, // face flip
|
||||
patchIDs[0], // patch for face
|
||||
patchID, // patch for face
|
||||
false, // remove from zone
|
||||
zoneID, // zone for face
|
||||
zoneFlip, // face flip in zone
|
||||
patchIDs[1] // subPatch
|
||||
zoneFlip // face flip in zone
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -337,11 +336,10 @@ void Foam::hexRef8::modFace
|
||||
nei, // owner
|
||||
own, // neighbour
|
||||
false, // face flip
|
||||
patchIDs[0], // patch for face
|
||||
patchID, // patch for face
|
||||
false, // remove from zone
|
||||
zoneID, // zone for face
|
||||
zoneFlip, // face flip in zone
|
||||
patchIDs[1] // subPatch
|
||||
zoneFlip // face flip in zone
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -1585,11 +1583,11 @@ Foam::label Foam::hexRef8::faceConsistentRefinement
|
||||
{
|
||||
if (maxSet)
|
||||
{
|
||||
refineCell.set(nei, 1);
|
||||
refineCell.set(nei);
|
||||
}
|
||||
else
|
||||
{
|
||||
refineCell.set(own, 0);
|
||||
refineCell.unset(own);
|
||||
}
|
||||
nChanged++;
|
||||
}
|
||||
@ -1597,11 +1595,11 @@ Foam::label Foam::hexRef8::faceConsistentRefinement
|
||||
{
|
||||
if (maxSet)
|
||||
{
|
||||
refineCell.set(own, 1);
|
||||
refineCell.set(own);
|
||||
}
|
||||
else
|
||||
{
|
||||
refineCell.set(nei, 0);
|
||||
refineCell.unset(nei);
|
||||
}
|
||||
nChanged++;
|
||||
}
|
||||
@ -1632,7 +1630,7 @@ Foam::label Foam::hexRef8::faceConsistentRefinement
|
||||
{
|
||||
if (!maxSet)
|
||||
{
|
||||
refineCell.set(own, 0);
|
||||
refineCell.unset(own);
|
||||
nChanged++;
|
||||
}
|
||||
}
|
||||
@ -1640,7 +1638,7 @@ Foam::label Foam::hexRef8::faceConsistentRefinement
|
||||
{
|
||||
if (maxSet)
|
||||
{
|
||||
refineCell.set(own, 1);
|
||||
refineCell.set(own);
|
||||
nChanged++;
|
||||
}
|
||||
}
|
||||
@ -1659,7 +1657,7 @@ void Foam::hexRef8::checkWantedRefinementLevels
|
||||
PackedBoolList refineCell(mesh_.nCells());
|
||||
forAll(cellsToRefine, i)
|
||||
{
|
||||
refineCell.set(cellsToRefine[i], 1);
|
||||
refineCell.set(cellsToRefine[i]);
|
||||
}
|
||||
|
||||
for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
|
||||
@ -2044,7 +2042,7 @@ Foam::labelList Foam::hexRef8::consistentRefinement
|
||||
PackedBoolList refineCell(mesh_.nCells());
|
||||
forAll(cellsToRefine, i)
|
||||
{
|
||||
refineCell.set(cellsToRefine[i], 1);
|
||||
refineCell.set(cellsToRefine[i]);
|
||||
}
|
||||
|
||||
while (true)
|
||||
@ -2072,7 +2070,7 @@ Foam::labelList Foam::hexRef8::consistentRefinement
|
||||
|
||||
forAll(refineCell, cellI)
|
||||
{
|
||||
if (refineCell.get(cellI) == 1)
|
||||
if (refineCell.get(cellI))
|
||||
{
|
||||
nRefined++;
|
||||
}
|
||||
@ -2083,7 +2081,7 @@ Foam::labelList Foam::hexRef8::consistentRefinement
|
||||
|
||||
forAll(refineCell, cellI)
|
||||
{
|
||||
if (refineCell.get(cellI) == 1)
|
||||
if (refineCell.get(cellI))
|
||||
{
|
||||
newCellsToRefine[nRefined++] = cellI;
|
||||
}
|
||||
@ -2223,7 +2221,7 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement
|
||||
faceCount
|
||||
)
|
||||
);
|
||||
allFaceInfo[faceI] = seedFacesInfo[seedFacesInfo.size()-1];
|
||||
allFaceInfo[faceI] = seedFacesInfo.last();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2239,7 +2237,7 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement
|
||||
faceCount
|
||||
)
|
||||
);
|
||||
allFaceInfo[faceI] = seedFacesInfo[seedFacesInfo.size()-1];
|
||||
allFaceInfo[faceI] = seedFacesInfo.last();
|
||||
}
|
||||
}
|
||||
|
||||
@ -2320,7 +2318,7 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement
|
||||
allCellInfo
|
||||
);
|
||||
|
||||
while(true)
|
||||
while (true)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
@ -2895,7 +2893,7 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement2
|
||||
|
||||
if (wanted > cellLevel_[cellI]+1)
|
||||
{
|
||||
refineCell.set(cellI, 1);
|
||||
refineCell.set(cellI);
|
||||
}
|
||||
}
|
||||
faceConsistentRefinement(true, refineCell);
|
||||
@ -2924,7 +2922,7 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement2
|
||||
|
||||
forAll(refineCell, cellI)
|
||||
{
|
||||
if (refineCell.get(cellI) == 1)
|
||||
if (refineCell.get(cellI))
|
||||
{
|
||||
nRefined++;
|
||||
}
|
||||
@ -2935,7 +2933,7 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement2
|
||||
|
||||
forAll(refineCell, cellI)
|
||||
{
|
||||
if (refineCell.get(cellI) == 1)
|
||||
if (refineCell.get(cellI))
|
||||
{
|
||||
newCellsToRefine[nRefined++] = cellI;
|
||||
}
|
||||
@ -2968,7 +2966,7 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement2
|
||||
PackedBoolList refineCell(mesh_.nCells());
|
||||
forAll(newCellsToRefine, i)
|
||||
{
|
||||
refineCell.set(newCellsToRefine[i], 1);
|
||||
refineCell.set(newCellsToRefine[i]);
|
||||
}
|
||||
const PackedBoolList savedRefineCell(refineCell);
|
||||
|
||||
@ -2981,7 +2979,7 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement2
|
||||
);
|
||||
forAll(refineCell, cellI)
|
||||
{
|
||||
if (refineCell.get(cellI) == 1)
|
||||
if (refineCell.get(cellI))
|
||||
{
|
||||
cellsOut2.insert(cellI);
|
||||
}
|
||||
@ -2996,11 +2994,7 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement2
|
||||
{
|
||||
forAll(refineCell, cellI)
|
||||
{
|
||||
if
|
||||
(
|
||||
refineCell.get(cellI) == 1
|
||||
&& savedRefineCell.get(cellI) == 0
|
||||
)
|
||||
if (refineCell.get(cellI) && !savedRefineCell.get(cellI))
|
||||
{
|
||||
dumpCell(cellI);
|
||||
FatalErrorIn
|
||||
@ -3602,7 +3596,7 @@ Foam::labelListList Foam::hexRef8::setRefinement
|
||||
|
||||
forAll(cFaces, i)
|
||||
{
|
||||
affectedFace.set(cFaces[i], 1);
|
||||
affectedFace.set(cFaces[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3611,7 +3605,7 @@ Foam::labelListList Foam::hexRef8::setRefinement
|
||||
{
|
||||
if (faceMidPoint[faceI] >= 0)
|
||||
{
|
||||
affectedFace.set(faceI, 1);
|
||||
affectedFace.set(faceI);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3623,7 +3617,7 @@ Foam::labelListList Foam::hexRef8::setRefinement
|
||||
|
||||
forAll(eFaces, i)
|
||||
{
|
||||
affectedFace.set(eFaces[i], 1);
|
||||
affectedFace.set(eFaces[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3640,7 +3634,7 @@ Foam::labelListList Foam::hexRef8::setRefinement
|
||||
|
||||
forAll(faceMidPoint, faceI)
|
||||
{
|
||||
if (faceMidPoint[faceI] >= 0 && affectedFace.get(faceI) == 1)
|
||||
if (faceMidPoint[faceI] >= 0 && affectedFace.get(faceI))
|
||||
{
|
||||
// Face needs to be split and hasn't yet been done in some way
|
||||
// (affectedFace - is impossible since this is first change but
|
||||
@ -3761,7 +3755,7 @@ Foam::labelListList Foam::hexRef8::setRefinement
|
||||
}
|
||||
|
||||
// Mark face as having been handled
|
||||
affectedFace.set(faceI, 0);
|
||||
affectedFace.unset(faceI);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3791,7 +3785,7 @@ Foam::labelListList Foam::hexRef8::setRefinement
|
||||
{
|
||||
label faceI = eFaces[i];
|
||||
|
||||
if (faceMidPoint[faceI] < 0 && affectedFace.get(faceI) == 1)
|
||||
if (faceMidPoint[faceI] < 0 && affectedFace.get(faceI))
|
||||
{
|
||||
// Unsplit face. Add edge splits to face.
|
||||
|
||||
@ -3872,7 +3866,7 @@ Foam::labelListList Foam::hexRef8::setRefinement
|
||||
modFace(meshMod, faceI, newFace, own, nei);
|
||||
|
||||
// Mark face as having been handled
|
||||
affectedFace.set(faceI, 0);
|
||||
affectedFace.unset(faceI);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3891,7 +3885,7 @@ Foam::labelListList Foam::hexRef8::setRefinement
|
||||
|
||||
forAll(affectedFace, faceI)
|
||||
{
|
||||
if (affectedFace.get(faceI) == 1)
|
||||
if (affectedFace.get(faceI))
|
||||
{
|
||||
const face& f = mesh_.faces()[faceI];
|
||||
|
||||
@ -3914,7 +3908,7 @@ Foam::labelListList Foam::hexRef8::setRefinement
|
||||
modFace(meshMod, faceI, f, own, nei);
|
||||
|
||||
// Mark face as having been handled
|
||||
affectedFace.set(faceI, 0);
|
||||
affectedFace.unset(faceI);
|
||||
}
|
||||
}
|
||||
|
||||
@ -5096,7 +5090,7 @@ Foam::labelList Foam::hexRef8::consistentUnrefinement
|
||||
{
|
||||
label pointI = pointsToUnrefine[i];
|
||||
|
||||
unrefinePoint.set(pointI, 1);
|
||||
unrefinePoint.set(pointI);
|
||||
}
|
||||
|
||||
|
||||
@ -5109,13 +5103,13 @@ Foam::labelList Foam::hexRef8::consistentUnrefinement
|
||||
|
||||
forAll(unrefinePoint, pointI)
|
||||
{
|
||||
if (unrefinePoint.get(pointI) == 1)
|
||||
if (unrefinePoint.get(pointI))
|
||||
{
|
||||
const labelList& pCells = mesh_.pointCells(pointI);
|
||||
|
||||
forAll(pCells, j)
|
||||
{
|
||||
unrefineCell.set(pCells[j], 1);
|
||||
unrefineCell.set(pCells[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -5143,17 +5137,24 @@ Foam::labelList Foam::hexRef8::consistentUnrefinement
|
||||
|
||||
if (maxSet)
|
||||
{
|
||||
unrefineCell.set(nei, 1);
|
||||
unrefineCell.set(nei);
|
||||
}
|
||||
else
|
||||
{
|
||||
// could also combine with unset:
|
||||
// if (!unrefineCell.unset(own))
|
||||
// {
|
||||
// FatalErrorIn("hexRef8::consistentUnrefinement(..)")
|
||||
// << "problem cell already unset"
|
||||
// << abort(FatalError);
|
||||
// }
|
||||
if (unrefineCell.get(own) == 0)
|
||||
{
|
||||
FatalErrorIn("hexRef8::consistentUnrefinement(..)")
|
||||
<< "problem" << abort(FatalError);
|
||||
}
|
||||
|
||||
unrefineCell.set(own, 0);
|
||||
unrefineCell.unset(own);
|
||||
}
|
||||
nChanged++;
|
||||
}
|
||||
@ -5161,7 +5162,7 @@ Foam::labelList Foam::hexRef8::consistentUnrefinement
|
||||
{
|
||||
if (maxSet)
|
||||
{
|
||||
unrefineCell.set(own, 1);
|
||||
unrefineCell.set(own);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -5171,7 +5172,7 @@ Foam::labelList Foam::hexRef8::consistentUnrefinement
|
||||
<< "problem" << abort(FatalError);
|
||||
}
|
||||
|
||||
unrefineCell.set(nei, 0);
|
||||
unrefineCell.unset(nei);
|
||||
}
|
||||
nChanged++;
|
||||
}
|
||||
@ -5207,7 +5208,7 @@ Foam::labelList Foam::hexRef8::consistentUnrefinement
|
||||
<< "problem" << abort(FatalError);
|
||||
}
|
||||
|
||||
unrefineCell.set(own, 0);
|
||||
unrefineCell.unset(own);
|
||||
nChanged++;
|
||||
}
|
||||
}
|
||||
@ -5221,7 +5222,7 @@ Foam::labelList Foam::hexRef8::consistentUnrefinement
|
||||
<< "problem" << abort(FatalError);
|
||||
}
|
||||
|
||||
unrefineCell.set(own, 1);
|
||||
unrefineCell.set(own);
|
||||
nChanged++;
|
||||
}
|
||||
}
|
||||
@ -5249,15 +5250,15 @@ Foam::labelList Foam::hexRef8::consistentUnrefinement
|
||||
// Knock out any point whose cell neighbour cannot be unrefined.
|
||||
forAll(unrefinePoint, pointI)
|
||||
{
|
||||
if (unrefinePoint.get(pointI) == 1)
|
||||
if (unrefinePoint.get(pointI))
|
||||
{
|
||||
const labelList& pCells = mesh_.pointCells(pointI);
|
||||
|
||||
forAll(pCells, j)
|
||||
{
|
||||
if (unrefineCell.get(pCells[j]) == 0)
|
||||
if (!unrefineCell.get(pCells[j]))
|
||||
{
|
||||
unrefinePoint.set(pointI, 0);
|
||||
unrefinePoint.unset(pointI);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -5271,7 +5272,7 @@ Foam::labelList Foam::hexRef8::consistentUnrefinement
|
||||
|
||||
forAll(unrefinePoint, pointI)
|
||||
{
|
||||
if (unrefinePoint.get(pointI) == 1)
|
||||
if (unrefinePoint.get(pointI))
|
||||
{
|
||||
nSet++;
|
||||
}
|
||||
@ -5282,7 +5283,7 @@ Foam::labelList Foam::hexRef8::consistentUnrefinement
|
||||
|
||||
forAll(unrefinePoint, pointI)
|
||||
{
|
||||
if (unrefinePoint.get(pointI) == 1)
|
||||
if (unrefinePoint.get(pointI))
|
||||
{
|
||||
newPointsToUnrefine[nSet++] = pointI;
|
||||
}
|
||||
@ -5320,8 +5321,7 @@ void Foam::hexRef8::setUnrefinement
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"hexRef8::setUnrefinement"
|
||||
"(const labelList&, polyTopoChange&)"
|
||||
"hexRef8::setUnrefinement(const labelList&, polyTopoChange&)"
|
||||
) << "Illegal cell level " << cellLevel_[cellI]
|
||||
<< " for cell " << cellI
|
||||
<< abort(FatalError);
|
||||
|
||||
@ -105,7 +105,7 @@ class hexRef8
|
||||
void getFaceInfo
|
||||
(
|
||||
const label faceI,
|
||||
labelPair& patchIDs,
|
||||
label& patchID,
|
||||
label& zoneID,
|
||||
label& zoneFlip
|
||||
) const;
|
||||
|
||||
@ -61,7 +61,6 @@ public:
|
||||
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
// Are two lists identical either in forward or in reverse order.
|
||||
|
||||
@ -80,9 +80,6 @@ class polyModifyFace
|
||||
//- Face zone flip
|
||||
bool zoneFlip_;
|
||||
|
||||
//- Sub patch ID (for proc patches)
|
||||
label subPatchID_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -105,8 +102,7 @@ public:
|
||||
patchID_(-1),
|
||||
removeFromZone_(false),
|
||||
zoneID_(-1),
|
||||
zoneFlip_(false),
|
||||
subPatchID_(-1)
|
||||
zoneFlip_(false)
|
||||
{}
|
||||
|
||||
//- Construct from components
|
||||
@ -120,8 +116,7 @@ public:
|
||||
const label patchID,
|
||||
const bool removeFromZone,
|
||||
const label zoneID,
|
||||
const bool zoneFlip,
|
||||
const label subPatchID
|
||||
const bool zoneFlip
|
||||
)
|
||||
:
|
||||
face_(f),
|
||||
@ -132,8 +127,7 @@ public:
|
||||
patchID_(patchID),
|
||||
removeFromZone_(removeFromZone),
|
||||
zoneID_(zoneID),
|
||||
zoneFlip_(zoneFlip),
|
||||
subPatchID_(subPatchID)
|
||||
zoneFlip_(zoneFlip)
|
||||
{
|
||||
if (face_.size() < 3)
|
||||
{
|
||||
@ -149,8 +143,7 @@ public:
|
||||
" const label patchID,\n"
|
||||
" const bool removeFromZone,\n"
|
||||
" const label zoneID,\n"
|
||||
" const bool zoneFlip,\n"
|
||||
" const label subPatchID\n"
|
||||
" const bool zoneFlip\n"
|
||||
")"
|
||||
) << "Invalid face: less than 3 points. This is not allowed\n"
|
||||
<< "Face: " << face_
|
||||
@ -174,8 +167,7 @@ public:
|
||||
" const label patchID,\n"
|
||||
" const bool removeFromZone,\n"
|
||||
" const label zoneID,\n"
|
||||
" const bool zoneFlip,\n"
|
||||
" const label subPatchID\n"
|
||||
" const bool zoneFlip\n"
|
||||
")"
|
||||
) << "Face contains invalid vertex ID: " << face_ << ". "
|
||||
<< "This is not allowed.\n"
|
||||
@ -199,8 +191,7 @@ public:
|
||||
" const label patchID,\n"
|
||||
" const bool removeFromZone,\n"
|
||||
" const label zoneID,\n"
|
||||
" const bool zoneFlip,\n"
|
||||
" const label subPatchID\n"
|
||||
" const bool zoneFlip\n"
|
||||
")"
|
||||
) << "Face owner and neighbour are identical. "
|
||||
<< "This is not allowed.\n"
|
||||
@ -225,8 +216,7 @@ public:
|
||||
" const label patchID,\n"
|
||||
" const bool removeFromZone,\n"
|
||||
" const label zoneID,\n"
|
||||
" const bool zoneFlip,\n"
|
||||
" const label subPatchID\n"
|
||||
" const bool zoneFlip\n"
|
||||
")"
|
||||
) << "Patch face has got a neighbour "
|
||||
<< "This is not allowed.\n"
|
||||
@ -252,8 +242,7 @@ public:
|
||||
" const label patchID,\n"
|
||||
" const bool removeFromZone,\n"
|
||||
" const label zoneID,\n"
|
||||
" const bool zoneFlip,\n"
|
||||
" const label subPatchID\n"
|
||||
" const bool zoneFlip\n"
|
||||
")"
|
||||
) << "Specified zone flip for a face that does not "
|
||||
<< "belong to zone. This is not allowed.\n"
|
||||
@ -263,32 +252,6 @@ public:
|
||||
<< " neighbour:" << neighbour_
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
if (patchID < 0 && subPatchID_ >= 0)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"polyModifyFace::polyModifyFace\n"
|
||||
"(\n"
|
||||
" const face& f,\n"
|
||||
" const label faceID,\n"
|
||||
" const label owner,\n"
|
||||
" const label neighbour,\n"
|
||||
" const bool flipFaceFlux,\n"
|
||||
" const label patchID,\n"
|
||||
" const bool removeFromZone,\n"
|
||||
" const label zoneID,\n"
|
||||
" const bool zoneFlip,\n"
|
||||
" const label subPatchID\n"
|
||||
")"
|
||||
) << "Specified subPatchID on an internal face (patchID < 0"
|
||||
<< ". This is not allowed.\n"
|
||||
<< "Face: " << face_
|
||||
<< " faceID:" << faceID_
|
||||
<< " owner:" << owner_
|
||||
<< " neighbour:" << neighbour_
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
//- Construct and return a clone
|
||||
@ -372,12 +335,6 @@ public:
|
||||
{
|
||||
return zoneFlip_;
|
||||
}
|
||||
|
||||
//- Boundary sub patch ID
|
||||
label subPatchID() const
|
||||
{
|
||||
return subPatchID_;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -1828,43 +1828,6 @@ Foam::face Foam::polyTopoChange::rotateFace
|
||||
}
|
||||
|
||||
|
||||
bool Foam::polyTopoChange::orderAndMerge
|
||||
(
|
||||
const polyPatch& pp,
|
||||
const primitivePatch& faces,
|
||||
const label start,
|
||||
|
||||
labelList& oldToNew,
|
||||
labelList& rotation
|
||||
) const
|
||||
{
|
||||
labelList patchFaceMap(faces.size(), -1);
|
||||
labelList patchFaceRotation(faces.size(), 0);
|
||||
|
||||
bool changed = pp.order
|
||||
(
|
||||
faces,
|
||||
patchFaceMap,
|
||||
patchFaceRotation
|
||||
);
|
||||
|
||||
if (changed)
|
||||
{
|
||||
// Merge patch face reordering into mesh face reordering table
|
||||
forAll(patchFaceMap, patchFaceI)
|
||||
{
|
||||
oldToNew[patchFaceI + start] = start + patchFaceMap[patchFaceI];
|
||||
}
|
||||
|
||||
forAll(patchFaceRotation, patchFaceI)
|
||||
{
|
||||
rotation[patchFaceI + start] = patchFaceRotation[patchFaceI];
|
||||
}
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
|
||||
|
||||
void Foam::polyTopoChange::reorderCoupledFaces
|
||||
(
|
||||
const bool syncParallel,
|
||||
@ -2244,6 +2207,7 @@ void Foam::polyTopoChange::addMesh
|
||||
// Extend
|
||||
points_.setCapacity(points_.size() + points.size());
|
||||
pointMap_.setCapacity(pointMap_.size() + points.size());
|
||||
reversePointMap_.setCapacity(reversePointMap_.size() + points.size());
|
||||
pointZone_.resize(pointZone_.size() + points.size()/100);
|
||||
|
||||
// Precalc offset zones
|
||||
@ -2283,6 +2247,7 @@ void Foam::polyTopoChange::addMesh
|
||||
label nAllCells = mesh.nCells();
|
||||
|
||||
cellMap_.setCapacity(cellMap_.size() + nAllCells);
|
||||
reverseCellMap_.setCapacity(reverseCellMap_.size() + nAllCells);
|
||||
cellFromPoint_.resize(cellFromPoint_.size() + nAllCells/100);
|
||||
cellFromEdge_.resize(cellFromEdge_.size() + nAllCells/100);
|
||||
cellFromFace_.resize(cellFromFace_.size() + nAllCells/100);
|
||||
@ -2347,6 +2312,7 @@ void Foam::polyTopoChange::addMesh
|
||||
faceOwner_.setCapacity(faceOwner_.size() + nAllFaces);
|
||||
faceNeighbour_.setCapacity(faceNeighbour_.size() + nAllFaces);
|
||||
faceMap_.setCapacity(faceMap_.size() + nAllFaces);
|
||||
reverseFaceMap_.setCapacity(reverseFaceMap_.size() + nAllFaces);
|
||||
faceFromPoint_.resize(faceFromPoint_.size() + nAllFaces/100);
|
||||
faceFromEdge_.resize(faceFromEdge_.size() + nAllFaces/100);
|
||||
flipFaceFlux_.setCapacity(faces_.size() + nAllFaces);
|
||||
@ -2431,6 +2397,39 @@ void Foam::polyTopoChange::addMesh
|
||||
}
|
||||
|
||||
|
||||
void Foam::polyTopoChange::setCapacity
|
||||
(
|
||||
const label nPoints,
|
||||
const label nFaces,
|
||||
const label nCells
|
||||
)
|
||||
{
|
||||
points_.setCapacity(nPoints);
|
||||
pointMap_.setCapacity(nPoints);
|
||||
reversePointMap_.setCapacity(nPoints);
|
||||
pointZone_.resize(pointZone_.size() + nPoints/100);
|
||||
|
||||
faces_.setCapacity(nFaces);
|
||||
region_.setCapacity(nFaces);
|
||||
faceOwner_.setCapacity(nFaces);
|
||||
faceNeighbour_.setCapacity(nFaces);
|
||||
faceMap_.setCapacity(nFaces);
|
||||
reverseFaceMap_.setCapacity(nFaces);
|
||||
faceFromPoint_.resize(faceFromPoint_.size() + nFaces/100);
|
||||
faceFromEdge_.resize(faceFromEdge_.size() + nFaces/100);
|
||||
flipFaceFlux_.setCapacity(nFaces);
|
||||
faceZone_.resize(faceZone_.size() + nFaces/100);
|
||||
faceZoneFlip_.setCapacity(nFaces);
|
||||
|
||||
cellMap_.setCapacity(nCells);
|
||||
reverseCellMap_.setCapacity(nCells);
|
||||
cellFromPoint_.resize(cellFromPoint_.size() + nCells/100);
|
||||
cellFromEdge_.resize(cellFromEdge_.size() + nCells/100);
|
||||
cellFromFace_.resize(cellFromFace_.size() + nCells/100);
|
||||
cellZone_.setCapacity(nCells);
|
||||
}
|
||||
|
||||
|
||||
Foam::label Foam::polyTopoChange::setAction(const topoAction& action)
|
||||
{
|
||||
if (isType<polyAddPoint>(action))
|
||||
|
||||
@ -50,8 +50,9 @@ Description
|
||||
To see if point is equal to above value we don't use == (which might give
|
||||
problems with roundoff error) but instead compare the individual component
|
||||
with >.
|
||||
- coupled patches: the reorderCoupledFaces routine reorders coupled patch
|
||||
faces and uses the cyclicPolyPatch,processorPolyPatch functionality.
|
||||
- coupled patches: the reorderCoupledFaces routine (borrowed from
|
||||
the couplePatches utility) reorders coupled patch faces and
|
||||
uses the cyclicPolyPatch,processorPolyPatch functionality.
|
||||
|
||||
SourceFiles
|
||||
polyTopoChange.C
|
||||
@ -471,6 +472,15 @@ public:
|
||||
const labelList& cellZoneMap
|
||||
);
|
||||
|
||||
//- Explicitly pre-size the dynamic storage for expected mesh
|
||||
// size for if construct-without-mesh
|
||||
void setCapacity
|
||||
(
|
||||
const label nPoints,
|
||||
const label nFaces,
|
||||
const label nCells
|
||||
);
|
||||
|
||||
//- Move all points. Incompatible with other topology changes.
|
||||
void movePoints(const pointField& newPoints);
|
||||
|
||||
|
||||
@ -22,8 +22,6 @@ License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "polyTopoChange.H"
|
||||
|
||||
@ -745,7 +745,7 @@ Pout<< "refinementHistory::distribute :"
|
||||
newSplitCells.append(splitCells_[index]);
|
||||
|
||||
Pout<< "Added oldCell " << index
|
||||
<< " info " << newSplitCells[newSplitCells.size()-1]
|
||||
<< " info " << newSplitCells.last()
|
||||
<< " at position " << newSplitCells.size()-1
|
||||
<< endl;
|
||||
}
|
||||
|
||||
@ -342,8 +342,7 @@ void Foam::removeCells::setRefinement
|
||||
newPatchID[faceI], // patch for face
|
||||
false, // remove from zone
|
||||
zoneID, // zone for face
|
||||
zoneFlip, // face flip in zone
|
||||
-1
|
||||
zoneFlip // face flip in zone
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -389,8 +388,7 @@ void Foam::removeCells::setRefinement
|
||||
newPatchID[faceI], // patch for face
|
||||
false, // remove from zone
|
||||
zoneID, // zone for face
|
||||
zoneFlip, // face flip in zone
|
||||
-1
|
||||
zoneFlip // face flip in zone
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -433,8 +431,7 @@ void Foam::removeCells::setRefinement
|
||||
newPatchID[faceI], // patch for face
|
||||
false, // remove from zone
|
||||
zoneID, // zone for face
|
||||
zoneFlip, // face flip in zone
|
||||
-1
|
||||
zoneFlip // face flip in zone
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -330,9 +330,9 @@ void Foam::removeFaces::mergeFaces
|
||||
own = cellRegionMaster[cellRegion[own]];
|
||||
}
|
||||
|
||||
labelPair patchIDs;
|
||||
label zoneID, zoneFlip;
|
||||
getFaceInfo(faceI, patchIDs, zoneID, zoneFlip);
|
||||
label patchID, zoneID, zoneFlip;
|
||||
|
||||
getFaceInfo(faceI, patchID, zoneID, zoneFlip);
|
||||
|
||||
label nei = -1;
|
||||
|
||||
@ -390,7 +390,7 @@ void Foam::removeFaces::mergeFaces
|
||||
own, // owner
|
||||
nei, // neighbour
|
||||
false, // face flip
|
||||
patchIDs, // patch info for face
|
||||
patchID, // patch for face
|
||||
false, // remove from zone
|
||||
zoneID, // zone for face
|
||||
zoneFlip, // face flip in zone
|
||||
@ -416,12 +416,18 @@ void Foam::removeFaces::mergeFaces
|
||||
void Foam::removeFaces::getFaceInfo
|
||||
(
|
||||
const label faceI,
|
||||
labelPair& patchIDs,
|
||||
|
||||
label& patchID,
|
||||
label& zoneID,
|
||||
label& zoneFlip
|
||||
) const
|
||||
{
|
||||
patchIDs = polyTopoChange::whichPatch(mesh_.boundaryMesh(), faceI);
|
||||
patchID = -1;
|
||||
|
||||
if (!mesh_.isInternalFace(faceI))
|
||||
{
|
||||
patchID = mesh_.boundaryMesh().whichPatch(faceI);
|
||||
}
|
||||
|
||||
zoneID = mesh_.faceZones().whichZone(faceI);
|
||||
|
||||
@ -473,7 +479,7 @@ void Foam::removeFaces::modFace
|
||||
const label own,
|
||||
const label nei,
|
||||
const bool flipFaceFlux,
|
||||
const labelPair& newPatchIDs,
|
||||
const label newPatchID,
|
||||
const bool removeFromZone,
|
||||
const label zoneID,
|
||||
const bool zoneFlip,
|
||||
@ -491,7 +497,7 @@ void Foam::removeFaces::modFace
|
||||
// << " own:" << own
|
||||
// << " nei:" << nei
|
||||
// << " flipFaceFlux:" << flipFaceFlux
|
||||
// << " newPatchIDs:" << newPatchIDs
|
||||
// << " newPatchID:" << newPatchID
|
||||
// << " removeFromZone:" << removeFromZone
|
||||
// << " zoneID:" << zoneID
|
||||
// << " zoneFlip:" << zoneFlip
|
||||
@ -507,11 +513,10 @@ void Foam::removeFaces::modFace
|
||||
own, // owner
|
||||
nei, // neighbour
|
||||
flipFaceFlux, // face flip
|
||||
newPatchIDs[0], // patch for face
|
||||
newPatchID, // patch for face
|
||||
removeFromZone, // remove from zone
|
||||
zoneID, // zone for face
|
||||
zoneFlip, // face flip in zone
|
||||
newPatchIDs[1]
|
||||
zoneFlip // face flip in zone
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -525,7 +530,7 @@ void Foam::removeFaces::modFace
|
||||
// << " own:" << nei
|
||||
// << " nei:" << own
|
||||
// << " flipFaceFlux:" << flipFaceFlux
|
||||
// << " newPatchIDs:" << newPatchIDs
|
||||
// << " newPatchID:" << newPatchID
|
||||
// << " removeFromZone:" << removeFromZone
|
||||
// << " zoneID:" << zoneID
|
||||
// << " zoneFlip:" << zoneFlip
|
||||
@ -541,11 +546,10 @@ void Foam::removeFaces::modFace
|
||||
nei, // owner
|
||||
own, // neighbour
|
||||
flipFaceFlux, // face flip
|
||||
newPatchIDs[0], // patch for face
|
||||
newPatchID, // patch for face
|
||||
removeFromZone, // remove from zone
|
||||
zoneID, // zone for face
|
||||
zoneFlip, // face flip in zone
|
||||
newPatchIDs[1]
|
||||
zoneFlip // face flip in zone
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -1461,9 +1465,9 @@ void Foam::removeFaces::setRefinement
|
||||
own = cellRegionMaster[cellRegion[own]];
|
||||
}
|
||||
|
||||
labelPair patchIDs;
|
||||
label zoneID, zoneFlip;
|
||||
getFaceInfo(faceI, patchIDs, zoneID, zoneFlip);
|
||||
label patchID, zoneID, zoneFlip;
|
||||
|
||||
getFaceInfo(faceI, patchID, zoneID, zoneFlip);
|
||||
|
||||
label nei = -1;
|
||||
|
||||
@ -1494,7 +1498,7 @@ void Foam::removeFaces::setRefinement
|
||||
own, // owner
|
||||
nei, // neighbour
|
||||
false, // face flip
|
||||
patchIDs, // patchinfo for face
|
||||
patchID, // patch for face
|
||||
false, // remove from zone
|
||||
zoneID, // zone for face
|
||||
zoneFlip, // face flip in zone
|
||||
|
||||
@ -44,7 +44,6 @@ SourceFiles
|
||||
#include "Map.H"
|
||||
#include "boolList.H"
|
||||
#include "indirectPrimitivePatch.H"
|
||||
#include "labelPair.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -132,7 +131,7 @@ class removeFaces
|
||||
void getFaceInfo
|
||||
(
|
||||
const label faceI,
|
||||
labelPair& patchIDs,
|
||||
label& patchID,
|
||||
label& zoneID,
|
||||
label& zoneFlip
|
||||
) const;
|
||||
@ -148,7 +147,7 @@ class removeFaces
|
||||
const label own,
|
||||
const label nei,
|
||||
const bool flipFaceFlux,
|
||||
const labelPair& newPatchIDs,
|
||||
const label newPatchID,
|
||||
const bool removeFromZone,
|
||||
const label zoneID,
|
||||
const bool zoneFlip,
|
||||
|
||||
@ -106,11 +106,7 @@ void Foam::removePoints::modifyFace
|
||||
) const
|
||||
{
|
||||
// Get other face data.
|
||||
labelPair patchIDs = polyTopoChange::whichPatch
|
||||
(
|
||||
mesh_.boundaryMesh(),
|
||||
faceI
|
||||
);
|
||||
label patchI = -1;
|
||||
label owner = mesh_.faceOwner()[faceI];
|
||||
label neighbour = -1;
|
||||
|
||||
@ -118,6 +114,10 @@ void Foam::removePoints::modifyFace
|
||||
{
|
||||
neighbour = mesh_.faceNeighbour()[faceI];
|
||||
}
|
||||
else
|
||||
{
|
||||
patchI = mesh_.boundaryMesh().whichPatch(faceI);
|
||||
}
|
||||
|
||||
label zoneID = mesh_.faceZones().whichZone(faceI);
|
||||
|
||||
@ -139,11 +139,10 @@ void Foam::removePoints::modifyFace
|
||||
owner, // owner
|
||||
neighbour, // neighbour
|
||||
false, // face flip
|
||||
patchIDs[0], // patch for face
|
||||
patchI, // patch for face
|
||||
false, // remove from zone
|
||||
zoneID, // zone for face
|
||||
zoneFlip, // face flip in zone
|
||||
patchIDs[1]
|
||||
zoneFlip // face flip in zone
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -177,11 +177,11 @@ bool Foam::polyTopoChanger::changeTopology() const
|
||||
|
||||
if (curTriggerChange)
|
||||
{
|
||||
Info << " morphing" << endl;
|
||||
Info<< " morphing" << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
Info << " unchanged" << endl;
|
||||
Info<< " unchanged" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -132,8 +132,7 @@ void Foam::repatchPolyTopoChanger::changePatchID
|
||||
patchID, // patch ID
|
||||
false, // remove from zone
|
||||
zoneID, // zone ID
|
||||
zoneFlip, // zone flip
|
||||
-1 //? subPatch TBD.
|
||||
zoneFlip // zone flip
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -165,12 +164,6 @@ void Foam::repatchPolyTopoChanger::setFaceZone
|
||||
}
|
||||
}
|
||||
|
||||
labelPair patchIDs = polyTopoChange::whichPatch
|
||||
(
|
||||
mesh_.boundaryMesh(),
|
||||
faceID
|
||||
);
|
||||
|
||||
meshMod().setAction
|
||||
(
|
||||
polyModifyFace
|
||||
@ -180,11 +173,10 @@ void Foam::repatchPolyTopoChanger::setFaceZone
|
||||
mesh_.faceOwner()[faceID], // owner
|
||||
mesh_.faceNeighbour()[faceID], // neighbour
|
||||
false, // flip flux
|
||||
patchIDs[0], // patch ID
|
||||
mesh_.boundaryMesh().whichPatch(faceID), // patch ID
|
||||
true, // remove from zone
|
||||
zoneID, // zone ID
|
||||
zoneFlip, // zone flip
|
||||
patchIDs[1]
|
||||
zoneFlip // zone flip
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -231,11 +223,7 @@ void Foam::repatchPolyTopoChanger::changeAnchorPoint
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
labelPair patchIDs = polyTopoChange::whichPatch
|
||||
(
|
||||
mesh_.boundaryMesh(),
|
||||
faceID
|
||||
);
|
||||
label patchID = mesh_.boundaryMesh().whichPatch(faceID);
|
||||
|
||||
const label zoneID = mesh_.faceZones().whichZone(faceID);
|
||||
|
||||
@ -260,11 +248,10 @@ void Foam::repatchPolyTopoChanger::changeAnchorPoint
|
||||
mesh_.faceOwner()[faceID], // owner
|
||||
-1, // neighbour
|
||||
false, // flip flux
|
||||
patchIDs[0], // patch ID
|
||||
patchID, // patch ID
|
||||
false, // remove from zone
|
||||
zoneID, // zone ID
|
||||
zoneFlip, // zone flip
|
||||
patchIDs[1]
|
||||
zoneFlip // zone flip
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -296,11 +283,10 @@ void Foam::repatchPolyTopoChanger::changeAnchorPoint
|
||||
mesh_.faceOwner()[faceID], // owner
|
||||
-1, // neighbour
|
||||
false, // flip flux
|
||||
patchIDs[0], // patch ID
|
||||
patchID, // patch ID
|
||||
false, // remove from zone
|
||||
zoneID, // zone ID
|
||||
zoneFlip, // zone flip
|
||||
patchIDs[1]
|
||||
zoneFlip // zone flip
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -831,8 +831,7 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
|
||||
-1, // patch ID
|
||||
false, // remove from zone
|
||||
masterFaceZoneID_.index(), // zone ID
|
||||
masterPatchFlip[curMaster], // zone flip
|
||||
-1 // subPatch ID
|
||||
masterPatchFlip[curMaster] // zone flip
|
||||
)
|
||||
);
|
||||
// Pout << "modifying master face. Old master: " << masterPatch[curMaster] << " new face: " << curCutFace.reverseFace() << " own: " << masterFc[curMaster] << " nei: " << slaveFc[curSlave] << endl;
|
||||
@ -853,8 +852,7 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
|
||||
-1, // patch ID
|
||||
false, // remove from zone
|
||||
masterFaceZoneID_.index(), // zone ID
|
||||
!masterPatchFlip[curMaster], // zone flip
|
||||
-1 // subPatch ID
|
||||
!masterPatchFlip[curMaster] // zone flip
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -877,8 +875,7 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
|
||||
masterPatchID_.index(), // patch ID
|
||||
false, // remove from zone
|
||||
masterFaceZoneID_.index(), // zone ID
|
||||
masterPatchFlip[curMaster], // zone flip
|
||||
-1 // subPatchID - TBD
|
||||
masterPatchFlip[curMaster] // zone flip
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -925,8 +922,7 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
|
||||
-1, // patch ID
|
||||
false, // remove from zone
|
||||
slaveFaceZoneID_.index(), // zone ID
|
||||
!slavePatchFlip[curMaster], // zone flip
|
||||
-1 // subPatch ID
|
||||
!slavePatchFlip[curMaster] // zone flip
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -947,8 +943,7 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
|
||||
-1, // patch ID
|
||||
false, // remove from zone
|
||||
slaveFaceZoneID_.index(), // zone ID
|
||||
slavePatchFlip[curSlave], // zone flip
|
||||
-1 // subPatch ID
|
||||
slavePatchFlip[curSlave] // zone flip
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -971,8 +966,7 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
|
||||
slavePatchID_.index(), // patch ID
|
||||
false, // remove from zone
|
||||
slaveFaceZoneID_.index(), // zone ID
|
||||
slavePatchFlip[curSlave], // zone flip
|
||||
-1 // subPatchID - TBD
|
||||
slavePatchFlip[curSlave] // zone flip
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -1018,8 +1012,7 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
|
||||
false, // flux flip
|
||||
-1, // patch ID
|
||||
cutFaceZoneID_.index(), // zone ID
|
||||
false, // zone flip
|
||||
-1 // subPatch ID
|
||||
false // zone flip
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -1039,8 +1032,7 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
|
||||
true, // flux flip
|
||||
-1, // patch ID
|
||||
cutFaceZoneID_.index(), // zone ID
|
||||
true, // zone flip
|
||||
-1 // subPatch ID
|
||||
true // zone flip
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -1065,8 +1057,7 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
|
||||
false, // flux flip
|
||||
masterPatchID_.index(), // patch ID
|
||||
cutFaceZoneID_.index(), // zone ID
|
||||
false, // zone flip
|
||||
-1 // subPatchID - TBD
|
||||
false // zone flip
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -1091,8 +1082,7 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
|
||||
false, // flux flip
|
||||
slavePatchID_.index(), // patch ID
|
||||
cutFaceZoneID_.index(), // zone ID
|
||||
false, // zone flip
|
||||
-1 // subPatchID - TBD
|
||||
false // zone flip
|
||||
)
|
||||
);
|
||||
|
||||
@ -1137,8 +1127,7 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
|
||||
// -1, // patch ID
|
||||
// false, // remove from zone
|
||||
// masterFaceZoneID_.index(), // zone ID
|
||||
// false, // zone flip
|
||||
// -1 // subPatch ID
|
||||
// false // zone flip
|
||||
// )
|
||||
//);
|
||||
|
||||
@ -1169,8 +1158,7 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
|
||||
// -1, // patch ID
|
||||
// false, // remove from zone
|
||||
// slaveFaceZoneID_.index(), // zone ID
|
||||
// false, // zone flip
|
||||
// -1 // subPatch ID
|
||||
// false // zone flip
|
||||
// )
|
||||
//);
|
||||
|
||||
@ -1428,12 +1416,6 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
|
||||
//Pout << "Modifying master stick-out face " << curFaceID
|
||||
// << " old face: " << oldFace << " new face: " << newFace << endl;
|
||||
|
||||
labelPair patchIDs = polyTopoChange::whichPatch
|
||||
(
|
||||
mesh.boundaryMesh(),
|
||||
curFaceID
|
||||
);
|
||||
|
||||
// Modify the face
|
||||
if (mesh.isInternalFace(curFaceID))
|
||||
{
|
||||
@ -1449,8 +1431,7 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
|
||||
-1, // patch for face
|
||||
false, // remove from zone
|
||||
modifiedFaceZone, // zone for face
|
||||
modifiedFaceZoneFlip, // face flip in zone
|
||||
patchIDs[1] // subPatch ID
|
||||
modifiedFaceZoneFlip // face flip in zone
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -1468,8 +1449,7 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
|
||||
mesh.boundaryMesh().whichPatch(curFaceID), // patch for face
|
||||
false, // remove from zone
|
||||
modifiedFaceZone, // zone for face
|
||||
modifiedFaceZoneFlip, // face flip in zone
|
||||
patchIDs[1] // subPatch ID
|
||||
modifiedFaceZoneFlip // face flip in zone
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -1741,11 +1721,6 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
|
||||
newFace.transfer(newFaceLabels);
|
||||
|
||||
// Pout << "Modifying slave stick-out face " << curFaceID << " old face: " << oldFace << " new face: " << newFace << endl;
|
||||
labelPair patchIDs = polyTopoChange::whichPatch
|
||||
(
|
||||
mesh.boundaryMesh(),
|
||||
curFaceID
|
||||
);
|
||||
|
||||
// Modify the face
|
||||
if (mesh.isInternalFace(curFaceID))
|
||||
@ -1762,8 +1737,7 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
|
||||
-1, // patch for face
|
||||
false, // remove from zone
|
||||
modifiedFaceZone, // zone for face
|
||||
modifiedFaceZoneFlip, // face flip in zone
|
||||
patchIDs[1] // subPatch ID
|
||||
modifiedFaceZoneFlip // face flip in zone
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -1781,8 +1755,7 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
|
||||
mesh.boundaryMesh().whichPatch(curFaceID), // patch for face
|
||||
false, // remove from zone
|
||||
modifiedFaceZone, // zone for face
|
||||
modifiedFaceZoneFlip, // face flip in zone
|
||||
patchIDs[1] // subPatch ID
|
||||
modifiedFaceZoneFlip // face flip in zone
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -97,16 +97,15 @@ void Foam::slidingInterface::decoupleInterface
|
||||
(
|
||||
polyModifyFace
|
||||
(
|
||||
newFace, // new face
|
||||
masterPatchAddr[faceI], // master face index
|
||||
masterFc[faceI], // owner
|
||||
-1, // neighbour
|
||||
false, // flux flip
|
||||
masterPatchID_.index(), // patch ID
|
||||
false, // remove from zone
|
||||
masterFaceZoneID_.index(), // zone ID
|
||||
false, // zone flip. Face corrected
|
||||
-1 //?TBD subPatch
|
||||
newFace, // new face
|
||||
masterPatchAddr[faceI], // master face index
|
||||
masterFc[faceI], // owner
|
||||
-1, // neighbour
|
||||
false, // flux flip
|
||||
masterPatchID_.index(), // patch ID
|
||||
false, // remove from zone
|
||||
masterFaceZoneID_.index(), // zone ID
|
||||
false // zone flip. Face corrected
|
||||
)
|
||||
);
|
||||
// Pout << "Modifying master patch face no " << masterPatchAddr[faceI] << " face: " << faces[masterPatchAddr[faceI]] << " old owner: " << own[masterPatchAddr[faceI]] << " new owner: " << masterFc[faceI] << endl;
|
||||
@ -156,16 +155,15 @@ void Foam::slidingInterface::decoupleInterface
|
||||
(
|
||||
polyModifyFace
|
||||
(
|
||||
newFace, // new face
|
||||
slavePatchAddr[faceI], // master face index
|
||||
slaveFc[faceI], // owner
|
||||
-1, // neighbour
|
||||
false, // flux flip
|
||||
slavePatchID_.index(), // patch ID
|
||||
false, // remove from zone
|
||||
slaveFaceZoneID_.index(), // zone ID
|
||||
false, // zone flip. Face corrected
|
||||
-1 //?TBD subPatch
|
||||
newFace, // new face
|
||||
slavePatchAddr[faceI], // master face index
|
||||
slaveFc[faceI], // owner
|
||||
-1, // neighbour
|
||||
false, // flux flip
|
||||
slavePatchID_.index(), // patch ID
|
||||
false, // remove from zone
|
||||
slaveFaceZoneID_.index(), // zone ID
|
||||
false // zone flip. Face corrected
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -233,12 +231,6 @@ void Foam::slidingInterface::decoupleInterface
|
||||
|
||||
// Pout << "Modifying master stick-out face " << curFaceID << " old face: " << oldFace << " new face: " << newFace << endl;
|
||||
|
||||
labelPair patchIDs = polyTopoChange::whichPatch
|
||||
(
|
||||
mesh.boundaryMesh(),
|
||||
curFaceID
|
||||
);
|
||||
|
||||
// Modify the face
|
||||
ref.setAction
|
||||
(
|
||||
@ -249,11 +241,10 @@ void Foam::slidingInterface::decoupleInterface
|
||||
own[curFaceID], // owner
|
||||
nei[curFaceID], // neighbour
|
||||
false, // face flip
|
||||
patchIDs[0], // patch for face
|
||||
mesh.boundaryMesh().whichPatch(curFaceID), // patch for face
|
||||
false, // remove from zone
|
||||
modifiedFaceZone, // zone for face
|
||||
modifiedFaceZoneFlip, // face flip in zone
|
||||
patchIDs[1]
|
||||
modifiedFaceZoneFlip // face flip in zone
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -363,12 +354,6 @@ void Foam::slidingInterface::decoupleInterface
|
||||
|
||||
// Pout << "Modifying slave stick-out face " << curFaceID << " old face: " << oldFace << " new face: " << newFace << endl;
|
||||
|
||||
labelPair patchIDs = polyTopoChange::whichPatch
|
||||
(
|
||||
mesh.boundaryMesh(),
|
||||
curFaceID
|
||||
);
|
||||
|
||||
// Modify the face
|
||||
ref.setAction
|
||||
(
|
||||
@ -379,11 +364,10 @@ void Foam::slidingInterface::decoupleInterface
|
||||
own[curFaceID], // owner
|
||||
nei[curFaceID], // neighbour
|
||||
false, // face flip
|
||||
patchIDs[0], // patch for face
|
||||
mesh.boundaryMesh().whichPatch(curFaceID), // patch for face
|
||||
false, // remove from zone
|
||||
modifiedFaceZone, // zone for face
|
||||
modifiedFaceZoneFlip, // face flip in zone
|
||||
patchIDs[1]
|
||||
modifiedFaceZoneFlip // face flip in zone
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -22,8 +22,6 @@ License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "enrichedPatch.H"
|
||||
|
||||
@ -22,8 +22,6 @@ License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "enrichedPatch.H"
|
||||
@ -91,7 +89,7 @@ void Foam::enrichedPatch::calcEnrichedFaces
|
||||
{
|
||||
const face oldFace = slavePatch_[faceI];
|
||||
const face oldLocalFace = slaveLocalFaces[faceI];
|
||||
// Info << "old slave face " << faceI << ": " << oldFace << endl;
|
||||
// Info<< "old slave face " << faceI << ": " << oldFace << endl;
|
||||
const labelList& curEdges = slaveFaceEdges[faceI];
|
||||
|
||||
DynamicList<label> newFace(oldFace.size()*enrichedFaceRatio_);
|
||||
@ -133,7 +131,7 @@ void Foam::enrichedPatch::calcEnrichedFaces
|
||||
|
||||
const labelList& slavePointsOnEdge =
|
||||
pointsIntoSlaveEdges[curEdges[i]];
|
||||
// Info << "slavePointsOnEdge for " << curEdges[i] << ": " << slavePointsOnEdge << endl;
|
||||
// Info<< "slavePointsOnEdge for " << curEdges[i] << ": " << slavePointsOnEdge << endl;
|
||||
// If there are no points on the edge, skip everything
|
||||
// If there is only one point, no need for sorting
|
||||
if (slavePointsOnEdge.size())
|
||||
@ -246,7 +244,7 @@ void Foam::enrichedPatch::calcEnrichedFaces
|
||||
{
|
||||
const face& oldFace = masterPatch_[faceI];
|
||||
const face& oldLocalFace = masterLocalFaces[faceI];
|
||||
// Info << "old master face: " << oldFace << endl;
|
||||
// Info<< "old master face: " << oldFace << endl;
|
||||
const labelList& curEdges = masterFaceEdges[faceI];
|
||||
|
||||
DynamicList<label> newFace(oldFace.size()*enrichedFaceRatio_);
|
||||
|
||||
@ -22,8 +22,6 @@ License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "enrichedPatch.H"
|
||||
|
||||
@ -22,8 +22,6 @@ License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "enrichedPatch.H"
|
||||
|
||||
@ -22,8 +22,6 @@ License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "enrichedPatch.H"
|
||||
|
||||
@ -771,7 +771,7 @@ void Foam::slidingInterface::write(Ostream& os) const
|
||||
|
||||
// To write out all those tolerances
|
||||
#define WRITE_NON_DEFAULT(name) \
|
||||
if( name ## _ != name ## Default_ )\
|
||||
if ( name ## _ != name ## Default_ )\
|
||||
{ \
|
||||
os << " " #name " " << name ## _ << token::END_STATEMENT << nl; \
|
||||
}
|
||||
|
||||
@ -29,6 +29,7 @@ License
|
||||
#include "volFields.H"
|
||||
#include "surfaceFields.H"
|
||||
#include "fvMatrices.H"
|
||||
#include "syncTools.H"
|
||||
#include "faceSet.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -22,8 +22,6 @@ License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "SRFModel.H"
|
||||
|
||||
@ -107,7 +107,7 @@ bool Foam::adjustPhi
|
||||
{
|
||||
massCorr = (massIn - fixedMassOut)/adjustableMassOut;
|
||||
}
|
||||
else if(mag(fixedMassOut - massIn)/totalFlux > 1e-10)
|
||||
else if (mag(fixedMassOut - massIn)/totalFlux > 1e-10)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
Info << "\nReading g" << endl;
|
||||
Info<< "\nReading g" << endl;
|
||||
uniformDimensionedVectorField g
|
||||
(
|
||||
IOobject
|
||||
|
||||
@ -42,7 +42,7 @@ Description
|
||||
|
||||
Darcy-Forchheimer (@e d and @e f parameters)
|
||||
@f[
|
||||
S = - (\mu \, d \, U + \frac{\rho |U|}{2} \, f) U
|
||||
S = - (\mu \, d + \frac{\rho |U|}{2} \, f) U
|
||||
@f]
|
||||
|
||||
|
||||
|
||||
@ -110,105 +110,105 @@ coupledFvPatchField<Type>::coupledFvPatchField
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
// Referred patch functionality
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
template<class Type>
|
||||
void coupledFvPatchField<Type>::patchInternalField
|
||||
(
|
||||
Field<Type>& exchangeBuf,
|
||||
const coupledFvPatch& referringPatch,
|
||||
const label size,
|
||||
const label start
|
||||
) const
|
||||
{
|
||||
if (start+size > referringPatch.size())
|
||||
{
|
||||
FatalErrorIn("coupledFvPatchField<Type>::patchInternalField(..)")
|
||||
<< "patch size:" << referringPatch.size()
|
||||
<< " start:" << start << " size:" << size
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
const unallocLabelList& faceCells = referringPatch.faceCells();
|
||||
|
||||
exchangeBuf.setSize(this->size());
|
||||
|
||||
label facei = start;
|
||||
forAll(exchangeBuf, i)
|
||||
{
|
||||
exchangeBuf[i] = this->internalField()[faceCells[facei++]];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
tmp<Field<Type> > coupledFvPatchField<Type>::valueInternalCoeffs
|
||||
(
|
||||
const coupledFvPatch& referringPatch,
|
||||
const label size,
|
||||
const label start,
|
||||
const tmp<scalarField>& w
|
||||
) const
|
||||
{
|
||||
// ? check what is passed in!
|
||||
if (w().size() != size)
|
||||
{
|
||||
FatalErrorIn("coupledFvPatchField<Type>::valueInternalCoeffs(..)")
|
||||
<< "Call with correct slice size." << abort(FatalError);
|
||||
}
|
||||
return Type(pTraits<Type>::one)*w;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
tmp<Field<Type> > coupledFvPatchField<Type>::valueBoundaryCoeffs
|
||||
(
|
||||
const coupledFvPatch& referringPatch,
|
||||
const label size,
|
||||
const label start,
|
||||
const tmp<scalarField>& w
|
||||
) const
|
||||
{
|
||||
// ? check what is passed in!
|
||||
if (w().size() != size)
|
||||
{
|
||||
FatalErrorIn("coupledFvPatchField<Type>::valueBoundaryCoeffs(..)")
|
||||
<< "Call with correct slice size." << abort(FatalError);
|
||||
}
|
||||
return Type(pTraits<Type>::one)*(1.0 - w);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
tmp<Field<Type> > coupledFvPatchField<Type>::gradientInternalCoeffs
|
||||
(
|
||||
const coupledFvPatch& referringPatch,
|
||||
const label size,
|
||||
const label start
|
||||
) const
|
||||
{
|
||||
SubField<scalar> subDc(referringPatch.deltaCoeffs(), size, start);
|
||||
|
||||
return -Type(pTraits<Type>::one)*subDc;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
tmp<Field<Type> > coupledFvPatchField<Type>::gradientBoundaryCoeffs
|
||||
(
|
||||
const coupledFvPatch& referringPatch,
|
||||
const label size,
|
||||
const label start
|
||||
) const
|
||||
{
|
||||
return -this->gradientInternalCoeffs
|
||||
(
|
||||
referringPatch,
|
||||
size,
|
||||
start
|
||||
);
|
||||
}
|
||||
// // Referred patch functionality
|
||||
// // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
//
|
||||
// template<class Type>
|
||||
// void coupledFvPatchField<Type>::patchInternalField
|
||||
// (
|
||||
// Field<Type>& exchangeBuf,
|
||||
// const coupledFvPatch& referringPatch,
|
||||
// const label size,
|
||||
// const label start
|
||||
// ) const
|
||||
// {
|
||||
// if (start+size > referringPatch.size())
|
||||
// {
|
||||
// FatalErrorIn("coupledFvPatchField<Type>::patchInternalField(..)")
|
||||
// << "patch size:" << referringPatch.size()
|
||||
// << " start:" << start << " size:" << size
|
||||
// << abort(FatalError);
|
||||
// }
|
||||
//
|
||||
// const unallocLabelList& faceCells = referringPatch.faceCells();
|
||||
//
|
||||
// exchangeBuf.setSize(this->size());
|
||||
//
|
||||
// label facei = start;
|
||||
// forAll(exchangeBuf, i)
|
||||
// {
|
||||
// exchangeBuf[i] = this->internalField()[faceCells[facei++]];
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
// template<class Type>
|
||||
// tmp<Field<Type> > coupledFvPatchField<Type>::valueInternalCoeffs
|
||||
// (
|
||||
// const coupledFvPatch& referringPatch,
|
||||
// const label size,
|
||||
// const label start,
|
||||
// const tmp<scalarField>& w
|
||||
// ) const
|
||||
// {
|
||||
// // ? check what is passed in!
|
||||
// if (w().size() != size)
|
||||
// {
|
||||
// FatalErrorIn("coupledFvPatchField<Type>::valueInternalCoeffs(..)")
|
||||
// << "Call with correct slice size." << abort(FatalError);
|
||||
// }
|
||||
// return Type(pTraits<Type>::one)*w;
|
||||
// }
|
||||
//
|
||||
//
|
||||
// template<class Type>
|
||||
// tmp<Field<Type> > coupledFvPatchField<Type>::valueBoundaryCoeffs
|
||||
// (
|
||||
// const coupledFvPatch& referringPatch,
|
||||
// const label size,
|
||||
// const label start,
|
||||
// const tmp<scalarField>& w
|
||||
// ) const
|
||||
// {
|
||||
// // ? check what is passed in!
|
||||
// if (w().size() != size)
|
||||
// {
|
||||
// FatalErrorIn("coupledFvPatchField<Type>::valueBoundaryCoeffs(..)")
|
||||
// << "Call with correct slice size." << abort(FatalError);
|
||||
// }
|
||||
// return Type(pTraits<Type>::one)*(1.0 - w);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// template<class Type>
|
||||
// tmp<Field<Type> > coupledFvPatchField<Type>::gradientInternalCoeffs
|
||||
// (
|
||||
// const coupledFvPatch& referringPatch,
|
||||
// const label size,
|
||||
// const label start
|
||||
// ) const
|
||||
// {
|
||||
// SubField<scalar> subDc(referringPatch.deltaCoeffs(), size, start);
|
||||
//
|
||||
// return -Type(pTraits<Type>::one)*subDc;
|
||||
// }
|
||||
//
|
||||
//
|
||||
// template<class Type>
|
||||
// tmp<Field<Type> > coupledFvPatchField<Type>::gradientBoundaryCoeffs
|
||||
// (
|
||||
// const coupledFvPatch& referringPatch,
|
||||
// const label size,
|
||||
// const label start
|
||||
// ) const
|
||||
// {
|
||||
// return -this->gradientInternalCoeffs
|
||||
// (
|
||||
// referringPatch,
|
||||
// size,
|
||||
// start
|
||||
// );
|
||||
// }
|
||||
|
||||
|
||||
// Local patch functionality
|
||||
@ -218,10 +218,7 @@ template<class Type>
|
||||
tmp<Field<Type> > coupledFvPatchField<Type>::snGrad() const
|
||||
{
|
||||
return
|
||||
(
|
||||
this->patchNeighbourField()
|
||||
- this->fvPatchField<Type>::patchInternalField()
|
||||
)
|
||||
(this->patchNeighbourField() - this->patchInternalField())
|
||||
*this->patch().deltaCoeffs();
|
||||
}
|
||||
|
||||
@ -246,14 +243,8 @@ void coupledFvPatchField<Type>::evaluate(const Pstream::commsTypes)
|
||||
|
||||
Field<Type>::operator=
|
||||
(
|
||||
(
|
||||
this->patch().weights()
|
||||
* this->fvPatchField<Type>::patchInternalField()
|
||||
)
|
||||
+ (
|
||||
(1.0 - this->patch().weights())
|
||||
* this->patchNeighbourField()
|
||||
)
|
||||
this->patch().weights()*this->patchInternalField()
|
||||
+ (1.0 - this->patch().weights())*this->patchNeighbourField()
|
||||
);
|
||||
|
||||
fvPatchField<Type>::evaluate();
|
||||
|
||||
@ -121,122 +121,122 @@ public:
|
||||
|
||||
// Member functions
|
||||
|
||||
|
||||
// Referred-patch functionality. Get called with a slice (size, start)
|
||||
// of a patch that supplies fields and geometry/topology.
|
||||
|
||||
// Evaluation functions
|
||||
|
||||
//- Return internal field next to patch as patch field
|
||||
virtual void patchInternalField
|
||||
(
|
||||
Field<Type>& exchangeBuf,
|
||||
const coupledFvPatch& referringPatch,
|
||||
const label size,
|
||||
const label start
|
||||
) const;
|
||||
|
||||
//- Get patch-normal gradient
|
||||
virtual void snGrad
|
||||
(
|
||||
Field<Type>& exchangeBuf,
|
||||
const Field<Type>& subFld,
|
||||
const coupledFvPatch& referringPatch,
|
||||
const label size,
|
||||
const label start
|
||||
) const = 0;
|
||||
|
||||
//- Initialise the evaluation of the patch field.
|
||||
virtual void initEvaluate
|
||||
(
|
||||
Field<Type>& exchangeBuf,
|
||||
const coupledFvPatch& referringPatch,
|
||||
const label size,
|
||||
const label start
|
||||
) const = 0;
|
||||
|
||||
//- Evaluate the patch field.
|
||||
virtual void evaluate
|
||||
(
|
||||
Field<Type>& exchangeBuf,
|
||||
const coupledFvPatch& referringPatch,
|
||||
const label size,
|
||||
const label start
|
||||
) const = 0;
|
||||
|
||||
//- Return the matrix diagonal coefficients corresponding to the
|
||||
// evaluation of the value of this patchField with given weights
|
||||
virtual tmp<Field<Type> > valueInternalCoeffs
|
||||
(
|
||||
const coupledFvPatch& referringPatch,
|
||||
const label size,
|
||||
const label start,
|
||||
const tmp<scalarField>&
|
||||
) const;
|
||||
|
||||
//- Return the matrix source coefficients corresponding to the
|
||||
// evaluation of the value of this patchField with given weights
|
||||
virtual tmp<Field<Type> > valueBoundaryCoeffs
|
||||
(
|
||||
const coupledFvPatch& referringPatch,
|
||||
const label size,
|
||||
const label start,
|
||||
const tmp<scalarField>&
|
||||
) const;
|
||||
|
||||
//- Return the matrix diagonal coefficients corresponding to the
|
||||
// evaluation of the gradient of this patchField
|
||||
virtual tmp<Field<Type> > gradientInternalCoeffs
|
||||
(
|
||||
const coupledFvPatch& referringPatch,
|
||||
const label size,
|
||||
const label start
|
||||
) const;
|
||||
|
||||
//- Return the matrix source coefficients corresponding to the
|
||||
// evaluation of the gradient of this patchField
|
||||
virtual tmp<Field<Type> > gradientBoundaryCoeffs
|
||||
(
|
||||
const coupledFvPatch& referringPatch,
|
||||
const label size,
|
||||
const label start
|
||||
) const;
|
||||
|
||||
|
||||
// Coupled interface functionality
|
||||
|
||||
//- Initialise neighbour matrix update
|
||||
virtual void initInterfaceMatrixUpdate
|
||||
(
|
||||
const scalarField& psiInternal,
|
||||
scalarField& result,
|
||||
const lduMatrix& m,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
const coupledFvPatch& referringPatch,
|
||||
const label size,
|
||||
const label start,
|
||||
scalarField& exchangeBuf
|
||||
) const = 0;
|
||||
|
||||
//- Update result field based on interface functionality
|
||||
virtual void updateInterfaceMatrix
|
||||
(
|
||||
const scalarField& psiInternal,
|
||||
scalarField& result,
|
||||
const lduMatrix&,
|
||||
const scalarField& coeffs,
|
||||
const direction,
|
||||
const coupledFvPatch& referringPatch,
|
||||
const label size,
|
||||
const label start,
|
||||
scalarField& exchangeBuf
|
||||
) const = 0;
|
||||
|
||||
//- Write
|
||||
//?virtual void write(Ostream&) const;
|
||||
//XXXX
|
||||
|
||||
//
|
||||
// // Referred-patch functionality. Get called with a slice (size, start)
|
||||
// // of a patch that supplies fields and geometry/topology.
|
||||
//
|
||||
// // Evaluation functions
|
||||
//
|
||||
// //- Return internal field next to patch as patch field
|
||||
// virtual void patchInternalField
|
||||
// (
|
||||
// Field<Type>& exchangeBuf,
|
||||
// const coupledFvPatch& referringPatch,
|
||||
// const label size,
|
||||
// const label start
|
||||
// ) const;
|
||||
//
|
||||
// //- Get patch-normal gradient
|
||||
// virtual void snGrad
|
||||
// (
|
||||
// Field<Type>& exchangeBuf,
|
||||
// const Field<Type>& subFld,
|
||||
// const coupledFvPatch& referringPatch,
|
||||
// const label size,
|
||||
// const label start
|
||||
// ) const = 0;
|
||||
//
|
||||
// //- Initialise the evaluation of the patch field.
|
||||
// virtual void initEvaluate
|
||||
// (
|
||||
// Field<Type>& exchangeBuf,
|
||||
// const coupledFvPatch& referringPatch,
|
||||
// const label size,
|
||||
// const label start
|
||||
// ) const = 0;
|
||||
//
|
||||
// //- Evaluate the patch field.
|
||||
// virtual void evaluate
|
||||
// (
|
||||
// Field<Type>& exchangeBuf,
|
||||
// const coupledFvPatch& referringPatch,
|
||||
// const label size,
|
||||
// const label start
|
||||
// ) const = 0;
|
||||
//
|
||||
// //- Return the matrix diagonal coefficients corresponding to the
|
||||
// // evaluation of the value of this patchField with given weights
|
||||
// virtual tmp<Field<Type> > valueInternalCoeffs
|
||||
// (
|
||||
// const coupledFvPatch& referringPatch,
|
||||
// const label size,
|
||||
// const label start,
|
||||
// const tmp<scalarField>&
|
||||
// ) const;
|
||||
//
|
||||
// //- Return the matrix source coefficients corresponding to the
|
||||
// // evaluation of the value of this patchField with given weights
|
||||
// virtual tmp<Field<Type> > valueBoundaryCoeffs
|
||||
// (
|
||||
// const coupledFvPatch& referringPatch,
|
||||
// const label size,
|
||||
// const label start,
|
||||
// const tmp<scalarField>&
|
||||
// ) const;
|
||||
//
|
||||
// //- Return the matrix diagonal coefficients corresponding to the
|
||||
// // evaluation of the gradient of this patchField
|
||||
// virtual tmp<Field<Type> > gradientInternalCoeffs
|
||||
// (
|
||||
// const coupledFvPatch& referringPatch,
|
||||
// const label size,
|
||||
// const label start
|
||||
// ) const;
|
||||
//
|
||||
// //- Return the matrix source coefficients corresponding to the
|
||||
// // evaluation of the gradient of this patchField
|
||||
// virtual tmp<Field<Type> > gradientBoundaryCoeffs
|
||||
// (
|
||||
// const coupledFvPatch& referringPatch,
|
||||
// const label size,
|
||||
// const label start
|
||||
// ) const;
|
||||
//
|
||||
//
|
||||
// // Coupled interface functionality
|
||||
//
|
||||
// //- Initialise neighbour matrix update
|
||||
// virtual void initInterfaceMatrixUpdate
|
||||
// (
|
||||
// const scalarField& psiInternal,
|
||||
// scalarField& result,
|
||||
// const lduMatrix& m,
|
||||
// const scalarField& coeffs,
|
||||
// const direction cmpt,
|
||||
// const coupledFvPatch& referringPatch,
|
||||
// const label size,
|
||||
// const label start,
|
||||
// scalarField& exchangeBuf
|
||||
// ) const = 0;
|
||||
//
|
||||
// //- Update result field based on interface functionality
|
||||
// virtual void updateInterfaceMatrix
|
||||
// (
|
||||
// const scalarField& psiInternal,
|
||||
// scalarField& result,
|
||||
// const lduMatrix&,
|
||||
// const scalarField& coeffs,
|
||||
// const direction,
|
||||
// const coupledFvPatch& referringPatch,
|
||||
// const label size,
|
||||
// const label start,
|
||||
// scalarField& exchangeBuf
|
||||
// ) const = 0;
|
||||
//
|
||||
// //- Write
|
||||
// //?virtual void write(Ostream&) const;
|
||||
////XXXX
|
||||
//
|
||||
|
||||
|
||||
// Access
|
||||
|
||||
@ -55,7 +55,7 @@ slicedFvPatchField<Type>::slicedFvPatchField
|
||||
const DimensionedField<Type, volMesh>& iF
|
||||
)
|
||||
:
|
||||
fvPatchField<Type>(p, iF)
|
||||
fvPatchField<Type>(p, iF, Field<Type>())
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -143,200 +143,200 @@ cyclicFvPatchField<Type>::cyclicFvPatchField
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
// Referred patch functionality
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
template<class Type>
|
||||
void cyclicFvPatchField<Type>::snGrad
|
||||
(
|
||||
Field<Type>& exchangeBuf,
|
||||
const Field<Type>& subFld,
|
||||
const coupledFvPatch& referringPatch,
|
||||
const label size,
|
||||
const label start
|
||||
) const
|
||||
{
|
||||
if (subFld.size() != size)
|
||||
{
|
||||
FatalErrorIn("cyclicFvPatchField<Type>::snGrad(..)")
|
||||
<< "Call with correct slice size." << abort(FatalError);
|
||||
}
|
||||
|
||||
// Slice delta coeffs
|
||||
SubField<scalar> subDc(referringPatch.deltaCoeffs(), size, start);
|
||||
|
||||
// Get internal field
|
||||
tmp<Field<Type> > patchFld(new Field<Type>(size));
|
||||
this->patchInternalField(patchFld(), referringPatch, size, start);
|
||||
|
||||
exchangeBuf = subDc * (subFld - patchFld);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void cyclicFvPatchField<Type>::initEvaluate
|
||||
(
|
||||
Field<Type>& exchangeBuf,
|
||||
const coupledFvPatch& referringPatch,
|
||||
const label size,
|
||||
const label start
|
||||
) const
|
||||
{
|
||||
//? What about updateCoeffs? What if patch holds face-wise additional
|
||||
// information? Where is it stored? Who updates it?
|
||||
// if (!this->updated())
|
||||
// {
|
||||
// this->updateCoeffs();
|
||||
// }
|
||||
|
||||
if (exchangeBuf.size() != size)
|
||||
{
|
||||
FatalErrorIn("cyclicFvPatchField<Type>::initEvaluate(..)")
|
||||
<< "Call with correct slice size." << abort(FatalError);
|
||||
}
|
||||
|
||||
// Get sender side. Equivalent to (1-w)*patchNeighbourField() in non-remote
|
||||
// version (so includes the transformation!).
|
||||
|
||||
//Pout<< "initEvaluate name:" << cyclicPatch_.name()
|
||||
// << " size:" << size << " start:" << start
|
||||
// << " referringPatch.weights():" << referringPatch.weights() << endl;
|
||||
|
||||
const SubField<scalar> subWeights
|
||||
(
|
||||
referringPatch.weights(),
|
||||
size,
|
||||
start
|
||||
);
|
||||
|
||||
tmp<Field<Type> > patchFld(new Field<Type>(size));
|
||||
this->patchInternalField(patchFld(), referringPatch, size, start);
|
||||
|
||||
//Pout<< "initEvaluate name:" << cyclicPatch_.name()
|
||||
// << " patchFld:" << patchFld()
|
||||
// << " subWeights:" << subWeights << endl;
|
||||
|
||||
if (doTransform())
|
||||
{
|
||||
//Pout<< "initEvaluate name:" << cyclicPatch_.name()
|
||||
// << " reverseT:" << reverseT() << endl;
|
||||
tmp<Field<Type> > tfld =
|
||||
(1.0-subWeights)
|
||||
* transform(reverseT(), patchFld);
|
||||
|
||||
forAll(tfld(), i)
|
||||
{
|
||||
exchangeBuf[i] = tfld()[i];
|
||||
}
|
||||
//Pout<< "initEvaluate name:" << cyclicPatch_.name()
|
||||
// << " exchangeBuf:" << exchangeBuf << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
//Pout<< "initEvaluate name:" << cyclicPatch_.name()
|
||||
// << " no transform" << endl;
|
||||
tmp<Field<Type> > tfld = (1.0-subWeights)*patchFld;
|
||||
|
||||
forAll(tfld(), i)
|
||||
{
|
||||
exchangeBuf[i] = tfld()[i];
|
||||
}
|
||||
//Pout<< "initEvaluate name:" << cyclicPatch_.name()
|
||||
// << " exchangeBuf:" << exchangeBuf << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void cyclicFvPatchField<Type>::evaluate
|
||||
(
|
||||
Field<Type>& exchangeBuf,
|
||||
const coupledFvPatch& referringPatch,
|
||||
const label size,
|
||||
const label start
|
||||
) const
|
||||
{
|
||||
// if (!this->updated())
|
||||
// {
|
||||
// this->updateCoeffs();
|
||||
// }
|
||||
|
||||
if (exchangeBuf.size() != size)
|
||||
{
|
||||
FatalErrorIn("cyclicFvPatchField<Type>::evaluate(..)")
|
||||
<< "Call with correct slice size." << abort(FatalError);
|
||||
}
|
||||
|
||||
const SubField<scalar> subWeights
|
||||
(
|
||||
referringPatch.weights(),
|
||||
size,
|
||||
start
|
||||
);
|
||||
|
||||
tmp<Field<Type> > patchFld(new Field<Type>(size));
|
||||
this->patchInternalField(patchFld(), referringPatch, size, start);
|
||||
|
||||
exchangeBuf += subWeights * patchFld;
|
||||
|
||||
//?? fvPatchField<Type>::evaluate();
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void cyclicFvPatchField<Type>::initInterfaceMatrixUpdate
|
||||
(
|
||||
const scalarField& psiInternal,
|
||||
scalarField& result,
|
||||
const lduMatrix&,
|
||||
const scalarField& coeffs,
|
||||
const direction,
|
||||
const coupledFvPatch& referringPatch,
|
||||
const label size,
|
||||
const label start,
|
||||
scalarField& exchangeBuf
|
||||
) const
|
||||
{
|
||||
const unallocLabelList& faceCells = referringPatch.faceCells();
|
||||
|
||||
label facei = start;
|
||||
|
||||
forAll(exchangeBuf, elemI)
|
||||
{
|
||||
exchangeBuf[elemI] = psiInternal[faceCells[facei++]];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void cyclicFvPatchField<Type>::updateInterfaceMatrix
|
||||
(
|
||||
const scalarField& psiInternal,
|
||||
scalarField& result,
|
||||
const lduMatrix&,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
const coupledFvPatch& referringPatch,
|
||||
const label size,
|
||||
const label start,
|
||||
scalarField& exchangeBuf
|
||||
) const
|
||||
{
|
||||
// Transform according to the transformation tensor
|
||||
transformCoupleField(exchangeBuf, cmpt);
|
||||
|
||||
// Multiply the field by coefficients and add into the result
|
||||
|
||||
const unallocLabelList& faceCells = referringPatch.faceCells();
|
||||
|
||||
label facei = start;
|
||||
|
||||
forAll(exchangeBuf, elemI)
|
||||
{
|
||||
result[faceCells[facei]] -= coeffs[facei]*exchangeBuf[elemI];
|
||||
facei++;
|
||||
}
|
||||
}
|
||||
// // Referred patch functionality
|
||||
// // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
//
|
||||
// template<class Type>
|
||||
// void cyclicFvPatchField<Type>::snGrad
|
||||
// (
|
||||
// Field<Type>& exchangeBuf,
|
||||
// const Field<Type>& subFld,
|
||||
// const coupledFvPatch& referringPatch,
|
||||
// const label size,
|
||||
// const label start
|
||||
// ) const
|
||||
// {
|
||||
// if (subFld.size() != size)
|
||||
// {
|
||||
// FatalErrorIn("cyclicFvPatchField<Type>::snGrad(..)")
|
||||
// << "Call with correct slice size." << abort(FatalError);
|
||||
// }
|
||||
//
|
||||
// // Slice delta coeffs
|
||||
// SubField<scalar> subDc(referringPatch.deltaCoeffs(), size, start);
|
||||
//
|
||||
// // Get internal field
|
||||
// tmp<Field<Type> > patchFld(new Field<Type>(size));
|
||||
// this->patchInternalField(patchFld(), referringPatch, size, start);
|
||||
//
|
||||
// exchangeBuf = subDc * (subFld - patchFld);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// template<class Type>
|
||||
// void cyclicFvPatchField<Type>::initEvaluate
|
||||
// (
|
||||
// Field<Type>& exchangeBuf,
|
||||
// const coupledFvPatch& referringPatch,
|
||||
// const label size,
|
||||
// const label start
|
||||
// ) const
|
||||
// {
|
||||
// //? What about updateCoeffs? What if patch holds face-wise additional
|
||||
// // information? Where is it stored? Who updates it?
|
||||
// // if (!this->updated())
|
||||
// // {
|
||||
// // this->updateCoeffs();
|
||||
// // }
|
||||
//
|
||||
// if (exchangeBuf.size() != size)
|
||||
// {
|
||||
// FatalErrorIn("cyclicFvPatchField<Type>::initEvaluate(..)")
|
||||
// << "Call with correct slice size." << abort(FatalError);
|
||||
// }
|
||||
//
|
||||
// // Get sender side. Equivalent to (1-w)*patchNeighbourField() in non-remote
|
||||
// // version (so includes the transformation!).
|
||||
//
|
||||
// //Pout<< "initEvaluate name:" << cyclicPatch_.name()
|
||||
// // << " size:" << size << " start:" << start
|
||||
// // << " referringPatch.weights():" << referringPatch.weights() << endl;
|
||||
//
|
||||
// const SubField<scalar> subWeights
|
||||
// (
|
||||
// referringPatch.weights(),
|
||||
// size,
|
||||
// start
|
||||
// );
|
||||
//
|
||||
// tmp<Field<Type> > patchFld(new Field<Type>(size));
|
||||
// this->patchInternalField(patchFld(), referringPatch, size, start);
|
||||
//
|
||||
// //Pout<< "initEvaluate name:" << cyclicPatch_.name()
|
||||
// // << " patchFld:" << patchFld()
|
||||
// // << " subWeights:" << subWeights << endl;
|
||||
//
|
||||
// if (doTransform())
|
||||
// {
|
||||
// //Pout<< "initEvaluate name:" << cyclicPatch_.name()
|
||||
// // << " reverseT:" << reverseT() << endl;
|
||||
// tmp<Field<Type> > tfld =
|
||||
// (1.0-subWeights)
|
||||
// * transform(reverseT(), patchFld);
|
||||
//
|
||||
// forAll(tfld(), i)
|
||||
// {
|
||||
// exchangeBuf[i] = tfld()[i];
|
||||
// }
|
||||
// //Pout<< "initEvaluate name:" << cyclicPatch_.name()
|
||||
// // << " exchangeBuf:" << exchangeBuf << endl;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// //Pout<< "initEvaluate name:" << cyclicPatch_.name()
|
||||
// // << " no transform" << endl;
|
||||
// tmp<Field<Type> > tfld = (1.0-subWeights)*patchFld;
|
||||
//
|
||||
// forAll(tfld(), i)
|
||||
// {
|
||||
// exchangeBuf[i] = tfld()[i];
|
||||
// }
|
||||
// //Pout<< "initEvaluate name:" << cyclicPatch_.name()
|
||||
// // << " exchangeBuf:" << exchangeBuf << endl;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
// template<class Type>
|
||||
// void cyclicFvPatchField<Type>::evaluate
|
||||
// (
|
||||
// Field<Type>& exchangeBuf,
|
||||
// const coupledFvPatch& referringPatch,
|
||||
// const label size,
|
||||
// const label start
|
||||
// ) const
|
||||
// {
|
||||
// // if (!this->updated())
|
||||
// // {
|
||||
// // this->updateCoeffs();
|
||||
// // }
|
||||
//
|
||||
// if (exchangeBuf.size() != size)
|
||||
// {
|
||||
// FatalErrorIn("cyclicFvPatchField<Type>::evaluate(..)")
|
||||
// << "Call with correct slice size." << abort(FatalError);
|
||||
// }
|
||||
//
|
||||
// const SubField<scalar> subWeights
|
||||
// (
|
||||
// referringPatch.weights(),
|
||||
// size,
|
||||
// start
|
||||
// );
|
||||
//
|
||||
// tmp<Field<Type> > patchFld(new Field<Type>(size));
|
||||
// this->patchInternalField(patchFld(), referringPatch, size, start);
|
||||
//
|
||||
// exchangeBuf += subWeights * patchFld;
|
||||
//
|
||||
// //?? fvPatchField<Type>::evaluate();
|
||||
// }
|
||||
//
|
||||
//
|
||||
// template<class Type>
|
||||
// void cyclicFvPatchField<Type>::initInterfaceMatrixUpdate
|
||||
// (
|
||||
// const scalarField& psiInternal,
|
||||
// scalarField& result,
|
||||
// const lduMatrix&,
|
||||
// const scalarField& coeffs,
|
||||
// const direction,
|
||||
// const coupledFvPatch& referringPatch,
|
||||
// const label size,
|
||||
// const label start,
|
||||
// scalarField& exchangeBuf
|
||||
// ) const
|
||||
// {
|
||||
// const unallocLabelList& faceCells = referringPatch.faceCells();
|
||||
//
|
||||
// label facei = start;
|
||||
//
|
||||
// forAll(exchangeBuf, elemI)
|
||||
// {
|
||||
// exchangeBuf[elemI] = psiInternal[faceCells[facei++]];
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
// template<class Type>
|
||||
// void cyclicFvPatchField<Type>::updateInterfaceMatrix
|
||||
// (
|
||||
// const scalarField& psiInternal,
|
||||
// scalarField& result,
|
||||
// const lduMatrix&,
|
||||
// const scalarField& coeffs,
|
||||
// const direction cmpt,
|
||||
// const coupledFvPatch& referringPatch,
|
||||
// const label size,
|
||||
// const label start,
|
||||
// scalarField& exchangeBuf
|
||||
// ) const
|
||||
// {
|
||||
// // Transform according to the transformation tensor
|
||||
// transformCoupleField(exchangeBuf, cmpt);
|
||||
//
|
||||
// // Multiply the field by coefficients and add into the result
|
||||
//
|
||||
// const unallocLabelList& faceCells = referringPatch.faceCells();
|
||||
//
|
||||
// label facei = start;
|
||||
//
|
||||
// forAll(exchangeBuf, elemI)
|
||||
// {
|
||||
// result[faceCells[facei]] -= coeffs[facei]*exchangeBuf[elemI];
|
||||
// facei++;
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// Local patch functionality
|
||||
|
||||
@ -151,64 +151,64 @@ public:
|
||||
|
||||
// Evaluation functions
|
||||
|
||||
// Referred-patch functionality. Get called with a slice (size, start)
|
||||
// of a patch that supplies fields and geometry/topology.
|
||||
|
||||
//- Get patch-normal gradient
|
||||
virtual void snGrad
|
||||
(
|
||||
Field<Type>& exchangeBuf,
|
||||
const Field<Type>& subFld,
|
||||
const coupledFvPatch& referringPatch,
|
||||
const label size,
|
||||
const label start
|
||||
) const;
|
||||
|
||||
//- Initialise the evaluation of the patch field.
|
||||
virtual void initEvaluate
|
||||
(
|
||||
Field<Type>& exchangeBuf,
|
||||
const coupledFvPatch& referringPatch,
|
||||
const label size,
|
||||
const label start
|
||||
) const;
|
||||
|
||||
//- Evaluate the patch field.
|
||||
virtual void evaluate
|
||||
(
|
||||
Field<Type>& exchangeBuf,
|
||||
const coupledFvPatch& referringPatch,
|
||||
const label size,
|
||||
const label start
|
||||
) const;
|
||||
|
||||
//- Initialise neighbour matrix update
|
||||
virtual void initInterfaceMatrixUpdate
|
||||
(
|
||||
const scalarField& psiInternal,
|
||||
scalarField& result,
|
||||
const lduMatrix& m,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
const coupledFvPatch& referringPatch,
|
||||
const label size,
|
||||
const label start,
|
||||
scalarField& exchangeBuf
|
||||
) const;
|
||||
|
||||
//- Update result field based on interface functionality
|
||||
virtual void updateInterfaceMatrix
|
||||
(
|
||||
const scalarField& psiInternal,
|
||||
scalarField& result,
|
||||
const lduMatrix&,
|
||||
const scalarField& coeffs,
|
||||
const direction,
|
||||
const coupledFvPatch& referringPatch,
|
||||
const label size,
|
||||
const label start,
|
||||
scalarField& exchangeBuf
|
||||
) const;
|
||||
// // Referred-patch functionality. Get called with a slice (size, start)
|
||||
// // of a patch that supplies fields and geometry/topology.
|
||||
//
|
||||
// //- Get patch-normal gradient
|
||||
// virtual void snGrad
|
||||
// (
|
||||
// Field<Type>& exchangeBuf,
|
||||
// const Field<Type>& subFld,
|
||||
// const coupledFvPatch& referringPatch,
|
||||
// const label size,
|
||||
// const label start
|
||||
// ) const;
|
||||
//
|
||||
// //- Initialise the evaluation of the patch field.
|
||||
// virtual void initEvaluate
|
||||
// (
|
||||
// Field<Type>& exchangeBuf,
|
||||
// const coupledFvPatch& referringPatch,
|
||||
// const label size,
|
||||
// const label start
|
||||
// ) const;
|
||||
//
|
||||
// //- Evaluate the patch field.
|
||||
// virtual void evaluate
|
||||
// (
|
||||
// Field<Type>& exchangeBuf,
|
||||
// const coupledFvPatch& referringPatch,
|
||||
// const label size,
|
||||
// const label start
|
||||
// ) const;
|
||||
//
|
||||
// //- Initialise neighbour matrix update
|
||||
// virtual void initInterfaceMatrixUpdate
|
||||
// (
|
||||
// const scalarField& psiInternal,
|
||||
// scalarField& result,
|
||||
// const lduMatrix& m,
|
||||
// const scalarField& coeffs,
|
||||
// const direction cmpt,
|
||||
// const coupledFvPatch& referringPatch,
|
||||
// const label size,
|
||||
// const label start,
|
||||
// scalarField& exchangeBuf
|
||||
// ) const;
|
||||
//
|
||||
// //- Update result field based on interface functionality
|
||||
// virtual void updateInterfaceMatrix
|
||||
// (
|
||||
// const scalarField& psiInternal,
|
||||
// scalarField& result,
|
||||
// const lduMatrix&,
|
||||
// const scalarField& coeffs,
|
||||
// const direction,
|
||||
// const coupledFvPatch& referringPatch,
|
||||
// const label size,
|
||||
// const label start,
|
||||
// scalarField& exchangeBuf
|
||||
// ) const;
|
||||
|
||||
|
||||
//- Return neighbour coupled given internal cell data
|
||||
|
||||
@ -28,41 +28,12 @@ License
|
||||
#include "processorFvPatch.H"
|
||||
#include "demandDrivenData.H"
|
||||
#include "transformField.H"
|
||||
#include "diagTensorField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
const coupledFvPatchField<Type>& processorFvPatchField<Type>::patchField
|
||||
(
|
||||
const label patchID
|
||||
) const
|
||||
{
|
||||
//const GeometricField<Type, fvPatchField, volMesh>& field =
|
||||
//this->db().objectRegistry::
|
||||
//lookupObject<GeometricField<Type, fvPatchField, volMesh> >
|
||||
//(
|
||||
// this->dimensionedInternalField().name()
|
||||
//);
|
||||
const GeometricField<Type, fvPatchField, volMesh>& field =
|
||||
static_cast
|
||||
<
|
||||
const GeometricField<Type, fvPatchField, volMesh>&
|
||||
>(this->dimensionedInternalField());
|
||||
|
||||
return refCast<const coupledFvPatchField<Type> >
|
||||
(
|
||||
field.boundaryField()[patchID]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
@ -204,52 +175,7 @@ void processorFvPatchField<Type>::initEvaluate
|
||||
{
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
const processorPolyPatch& pp = procPatch_.procPolyPatch();
|
||||
|
||||
// Get reference to proc patch built-in buffer
|
||||
List<Type>& sendBuf = procPatch_.setSendBuf<Type>(this->size());
|
||||
|
||||
forAll(pp.patchIDs(), i)
|
||||
{
|
||||
SubField<Type> subSendFld(pp.subSlice(sendBuf, i));
|
||||
Field<Type>& subFld = static_cast<Field<Type>&>
|
||||
(
|
||||
static_cast<UList<Type>&>(subSendFld)
|
||||
);
|
||||
|
||||
label patchI = pp.patchIDs()[i];
|
||||
|
||||
//Pout<< "initEvaluate on "
|
||||
// << this->dimensionedInternalField().name()
|
||||
// << " patch:" << pp.name()
|
||||
// << " subSize:" << (pp.starts()[i+1]-pp.starts()[i])
|
||||
// << " subStart:" << pp.starts()[i]
|
||||
// << " subPatch:" << patchI << endl;
|
||||
|
||||
if (patchI == -1)
|
||||
{
|
||||
// Assign internal field
|
||||
this->patchInternalField
|
||||
(
|
||||
subFld,
|
||||
procPatch_,
|
||||
subSendFld.size(),
|
||||
pp.starts()[i]
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Assign evaluation of referred patch
|
||||
patchField(patchI).initEvaluate
|
||||
(
|
||||
subFld,
|
||||
procPatch_,
|
||||
subSendFld.size(),
|
||||
pp.starts()[i]
|
||||
);
|
||||
}
|
||||
}
|
||||
procPatch_.compressedBufferSend<Type>(commsType);
|
||||
procPatch_.compressedSend(commsType, this->patchInternalField()());
|
||||
}
|
||||
}
|
||||
|
||||
@ -264,39 +190,9 @@ void processorFvPatchField<Type>::evaluate
|
||||
{
|
||||
procPatch_.compressedReceive<Type>(commsType, *this);
|
||||
|
||||
const processorPolyPatch& pp = procPatch_.procPolyPatch();
|
||||
|
||||
forAll(pp.patchIDs(), i)
|
||||
if (doTransform())
|
||||
{
|
||||
label patchI = pp.patchIDs()[i];
|
||||
|
||||
//Pout<< "evaluate on " << this->dimensionedInternalField().name()
|
||||
// << " patch:" << pp.name()
|
||||
// << " subSize:" << (pp.starts()[i+1]-pp.starts()[i])
|
||||
// << " subStart:" << pp.starts()[i]
|
||||
// << " subPatch:" << patchI << endl;
|
||||
|
||||
if (patchI == -1)
|
||||
{
|
||||
// No evaluation needed.
|
||||
}
|
||||
else
|
||||
{
|
||||
SubField<Type> subRecvFld(pp.subSlice(*this, i));
|
||||
|
||||
Field<Type>& subFld = static_cast<Field<Type>&>
|
||||
(
|
||||
static_cast<UList<Type>&>(subRecvFld)
|
||||
);
|
||||
|
||||
patchField(patchI).evaluate
|
||||
(
|
||||
subFld,
|
||||
procPatch_,
|
||||
subRecvFld.size(),
|
||||
pp.starts()[i]
|
||||
);
|
||||
}
|
||||
transform(*this, procPatch_.forwardT(), *this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -305,58 +201,7 @@ void processorFvPatchField<Type>::evaluate
|
||||
template<class Type>
|
||||
tmp<Field<Type> > processorFvPatchField<Type>::snGrad() const
|
||||
{
|
||||
tmp<Field<Type> > tpnf(new Field<Type>(this->size()));
|
||||
Field<Type>& pnf = tpnf();
|
||||
|
||||
const processorPolyPatch& pp = procPatch_.procPolyPatch();
|
||||
|
||||
forAll(pp.patchIDs(), i)
|
||||
{
|
||||
label patchI = pp.patchIDs()[i];
|
||||
label subStart = pp.starts()[i];
|
||||
label subSize = pp.starts()[i+1] - pp.starts()[i];
|
||||
|
||||
const SubField<Type> subThis(pp.subSlice(*this, i));
|
||||
|
||||
SubField<Type> subPnf(pp.subSlice(pnf, i));
|
||||
Field<Type>& subFld = static_cast<Field<Type>&>
|
||||
(
|
||||
static_cast<UList<Type>&>(subPnf)
|
||||
);
|
||||
|
||||
//Pout<< "snGrad on " << this->dimensionedInternalField().name()
|
||||
// << " patch:" << pp.name()
|
||||
// << " subSize:" << (pp.starts()[i+1]-pp.starts()[i])
|
||||
// << " subStart:" << pp.starts()[i]
|
||||
// << " subPatch:" << patchI << endl;
|
||||
|
||||
|
||||
if (patchI == -1)
|
||||
{
|
||||
// Slice delta coeffs
|
||||
const SubField<scalar> subDc
|
||||
(
|
||||
pp.subSlice(procPatch_.deltaCoeffs(), i)
|
||||
);
|
||||
tmp<Field<Type> > subInt(new Field<Type>(subSize));
|
||||
this->patchInternalField(subInt(), procPatch_, subSize, subStart);
|
||||
|
||||
subFld = (subDc*(subThis-subInt))();
|
||||
}
|
||||
else
|
||||
{
|
||||
patchField(patchI).snGrad
|
||||
(
|
||||
subFld,
|
||||
subThis,
|
||||
procPatch_,
|
||||
subSize,
|
||||
subStart
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return tpnf;
|
||||
return this->patch().deltaCoeffs()*(*this - this->patchInternalField());
|
||||
}
|
||||
|
||||
|
||||
@ -364,181 +209,51 @@ template<class Type>
|
||||
void processorFvPatchField<Type>::initInterfaceMatrixUpdate
|
||||
(
|
||||
const scalarField& psiInternal,
|
||||
scalarField& result,
|
||||
const lduMatrix& m,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
scalarField&,
|
||||
const lduMatrix&,
|
||||
const scalarField&,
|
||||
const direction,
|
||||
const Pstream::commsTypes commsType
|
||||
) const
|
||||
{
|
||||
// Get reference to proc patch built-in buffer
|
||||
List<scalar>& sendFld = procPatch_.setSendBuf<scalar>(this->size());
|
||||
|
||||
const processorPolyPatch& pp = procPatch_.procPolyPatch();
|
||||
|
||||
forAll(pp.patchIDs(), i)
|
||||
{
|
||||
label subStart = pp.starts()[i];
|
||||
label subSize = pp.starts()[i+1] - pp.starts()[i];
|
||||
SubField<scalar> subSendFld(sendFld, subSize, subStart);
|
||||
Field<scalar>& subFld = static_cast<Field<scalar>&>
|
||||
(
|
||||
static_cast<UList<scalar>&>(subSendFld)
|
||||
);
|
||||
|
||||
label patchI = pp.patchIDs()[i];
|
||||
|
||||
//Pout<< "initInterfaceMatrixUpdate on "
|
||||
// << this->dimensionedInternalField().name()
|
||||
// << " patch:" << pp.name()
|
||||
// << " subSize:" << (pp.starts()[i+1]-pp.starts()[i])
|
||||
// << " subStart:" << pp.starts()[i]
|
||||
// << " subPatch:" << patchI << endl;
|
||||
|
||||
if (patchI == -1)
|
||||
{
|
||||
const unallocLabelList& faceCells = pp.faceCells();
|
||||
|
||||
label facei = subStart;
|
||||
|
||||
forAll(subFld, i)
|
||||
{
|
||||
subFld[i] = psiInternal[faceCells[facei++]];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
patchField(patchI).initInterfaceMatrixUpdate
|
||||
(
|
||||
psiInternal,
|
||||
result,
|
||||
m,
|
||||
coeffs,
|
||||
cmpt,
|
||||
procPatch_,
|
||||
subSize,
|
||||
subStart,
|
||||
subFld
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
procPatch_.compressedBufferSend<scalar>(commsType);
|
||||
procPatch_.compressedSend
|
||||
(
|
||||
commsType,
|
||||
this->patch().patchInternalField(psiInternal)()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void processorFvPatchField<Type>::updateInterfaceMatrix
|
||||
(
|
||||
const scalarField& psiInternal,
|
||||
const scalarField&,
|
||||
scalarField& result,
|
||||
const lduMatrix& m,
|
||||
const lduMatrix&,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
const Pstream::commsTypes commsType
|
||||
) const
|
||||
{
|
||||
const List<scalar>& recvFld = procPatch_.compressedBufferReceive<scalar>
|
||||
scalarField pnf
|
||||
(
|
||||
commsType,
|
||||
this->size()
|
||||
procPatch_.compressedReceive<scalar>(commsType, this->size())()
|
||||
);
|
||||
|
||||
const processorPolyPatch& pp = procPatch_.procPolyPatch();
|
||||
// Transform according to the transformation tensor
|
||||
transformCoupleField(pnf, cmpt);
|
||||
|
||||
forAll(pp.patchIDs(), i)
|
||||
// Multiply the field by coefficients and add into the result
|
||||
|
||||
const unallocLabelList& faceCells = this->patch().faceCells();
|
||||
|
||||
forAll(faceCells, elemI)
|
||||
{
|
||||
label subStart = pp.starts()[i];
|
||||
label subSize = pp.starts()[i+1] - pp.starts()[i];
|
||||
|
||||
SubField<scalar> subRecvFld(recvFld, subSize, subStart);
|
||||
Field<scalar>& subFld = static_cast<Field<scalar>&>
|
||||
(
|
||||
static_cast<UList<scalar>&>(subRecvFld)
|
||||
);
|
||||
|
||||
label patchI = pp.patchIDs()[i];
|
||||
|
||||
//Pout<< "updateInterfaceMatrix on "
|
||||
// << this->dimensionedInternalField().name()
|
||||
// << " patch:" << pp.name()
|
||||
// << " subSize:" << (pp.starts()[i+1]-pp.starts()[i])
|
||||
// << " subStart:" << pp.starts()[i]
|
||||
// << " subPatch:" << patchI << endl;
|
||||
|
||||
if (patchI == -1)
|
||||
{
|
||||
const unallocLabelList& faceCells = pp.faceCells();
|
||||
|
||||
label facei = subStart;
|
||||
|
||||
forAll(subFld, elemI)
|
||||
{
|
||||
result[faceCells[facei]] -= coeffs[facei]*subFld[elemI];
|
||||
|
||||
facei++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
patchField(patchI).updateInterfaceMatrix
|
||||
(
|
||||
psiInternal,
|
||||
result,
|
||||
m,
|
||||
coeffs,
|
||||
cmpt,
|
||||
procPatch_,
|
||||
subSize,
|
||||
subStart,
|
||||
subFld
|
||||
);
|
||||
}
|
||||
result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//template<class Type>
|
||||
//void Foam::processorFvPatchField<Type>::transformCoupleField
|
||||
//(
|
||||
// scalarField& f,
|
||||
// const direction cmpt
|
||||
//) const
|
||||
//{
|
||||
// if (pTraits<Type>::rank > 0)
|
||||
// {
|
||||
// const processorPolyPatch& pp = procPatch_.procPolyPatch();
|
||||
//
|
||||
// forAll(pp.patchIDs(), i)
|
||||
// {
|
||||
// label patchI = pp.patchIDs()[i];
|
||||
//
|
||||
// if (patchI == -1)
|
||||
// {
|
||||
// // ? anything needs to be transformed?
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// const coupledPolyPatch& cpp =
|
||||
// refCast<const coupledPolyPatch>(pp.boundaryMesh()[patchI]);
|
||||
//
|
||||
// if (!cpp.parallel())
|
||||
// {
|
||||
// const tensor& T = cpp.forwardT();
|
||||
//
|
||||
// SubField<scalar> subFld(pp.subSlice(f, i));
|
||||
// const scalarField& fld =
|
||||
// static_cast<const scalarField&>(subFld);
|
||||
//
|
||||
// const_cast<scalarField&>(fld) *=
|
||||
// pow(diag(T).component(cmpt), rank());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
@ -60,10 +60,7 @@ class processorFvPatchField
|
||||
//- Local reference cast into the processor patch
|
||||
const processorFvPatch& procPatch_;
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Get other patchfield
|
||||
const coupledFvPatchField<Type>& patchField(const label patchID) const;
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
@ -209,100 +206,23 @@ public:
|
||||
return procPatch_.neighbProcNo();
|
||||
}
|
||||
|
||||
//- Does the patch field perform the transfromation
|
||||
virtual bool doTransform() const
|
||||
{
|
||||
return !(procPatch_.parallel() || pTraits<Type>::rank == 0);
|
||||
}
|
||||
|
||||
//- Return face transformation tensor
|
||||
virtual const tensor& forwardT() const
|
||||
{
|
||||
return procPatch_.forwardT();
|
||||
}
|
||||
|
||||
//- Return rank of component for transform
|
||||
virtual int rank() const
|
||||
{
|
||||
return pTraits<Type>::rank;
|
||||
}
|
||||
|
||||
// //- Transform given patch component field
|
||||
// void transformCoupleField
|
||||
// (
|
||||
// scalarField& f,
|
||||
// const direction cmpt
|
||||
// ) const;
|
||||
|
||||
// Referred-patch functionality. Get called with a slice (size, start)
|
||||
// of a patch that supplies fields and geometry/topology.
|
||||
|
||||
//- Get patch-normal gradient
|
||||
virtual void snGrad
|
||||
(
|
||||
Field<Type>& exchangeBuf,
|
||||
const Field<Type>& subFld,
|
||||
const coupledFvPatch& referringPatch,
|
||||
const label size,
|
||||
const label start
|
||||
) const
|
||||
{
|
||||
notImplemented("processorFvPatchField::snGrad(..)");
|
||||
}
|
||||
|
||||
//- Initialise the evaluation of the patch field.
|
||||
virtual void initEvaluate
|
||||
(
|
||||
Field<Type>& exchangeBuf,
|
||||
const coupledFvPatch& referringPatch,
|
||||
const label size,
|
||||
const label start
|
||||
) const
|
||||
{
|
||||
notImplemented("processorFvPatchField::initEvaluate(..)");
|
||||
}
|
||||
|
||||
//- Evaluate the patch field.
|
||||
virtual void evaluate
|
||||
(
|
||||
Field<Type>& exchangeBuf,
|
||||
const coupledFvPatch& referringPatch,
|
||||
const label size,
|
||||
const label start
|
||||
) const
|
||||
{
|
||||
notImplemented("processorFvPatchField::evaluate(..)");
|
||||
}
|
||||
|
||||
//- Initialise neighbour matrix update
|
||||
virtual void initInterfaceMatrixUpdate
|
||||
(
|
||||
const scalarField& psiInternal,
|
||||
scalarField& result,
|
||||
const lduMatrix& m,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
const coupledFvPatch& referringPatch,
|
||||
const label size,
|
||||
const label start,
|
||||
scalarField& exchangeBuf
|
||||
) const
|
||||
{
|
||||
notImplemented
|
||||
(
|
||||
"processorFvPatchField::initInterfaceMatrixUpdate(..)"
|
||||
);
|
||||
}
|
||||
|
||||
//- Update result field based on interface functionality
|
||||
virtual void updateInterfaceMatrix
|
||||
(
|
||||
const scalarField& psiInternal,
|
||||
scalarField& result,
|
||||
const lduMatrix&,
|
||||
const scalarField& coeffs,
|
||||
const direction,
|
||||
const coupledFvPatch& referringPatch,
|
||||
const label size,
|
||||
const label start,
|
||||
scalarField& exchangeBuf
|
||||
) const
|
||||
{
|
||||
notImplemented
|
||||
(
|
||||
"processorFvPatchField::updateInterfaceMatrix(..)"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,546 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ 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 2 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "processorFvPatchField.H"
|
||||
#include "processorFvPatch.H"
|
||||
#include "demandDrivenData.H"
|
||||
#include "transformField.H"
|
||||
#include "diagTensorField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
const coupledFvPatchField<Type>& processorFvPatchField<Type>::patchField
|
||||
(
|
||||
const label patchID
|
||||
) const
|
||||
{
|
||||
//const GeometricField<Type, fvPatchField, volMesh>& field =
|
||||
//this->db().objectRegistry::
|
||||
//lookupObject<GeometricField<Type, fvPatchField, volMesh> >
|
||||
//(
|
||||
// this->dimensionedInternalField().name()
|
||||
//);
|
||||
const GeometricField<Type, fvPatchField, volMesh>& field =
|
||||
static_cast
|
||||
<
|
||||
const GeometricField<Type, fvPatchField, volMesh>&
|
||||
>(this->dimensionedInternalField());
|
||||
|
||||
return refCast<const coupledFvPatchField<Type> >
|
||||
(
|
||||
field.boundaryField()[patchID]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
processorFvPatchField<Type>::processorFvPatchField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, volMesh>& iF
|
||||
)
|
||||
:
|
||||
coupledFvPatchField<Type>(p, iF),
|
||||
procPatch_(refCast<const processorFvPatch>(p))
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
processorFvPatchField<Type>::processorFvPatchField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, volMesh>& iF,
|
||||
const Field<Type>& f
|
||||
)
|
||||
:
|
||||
coupledFvPatchField<Type>(p, iF, f),
|
||||
procPatch_(refCast<const processorFvPatch>(p))
|
||||
{}
|
||||
|
||||
|
||||
// Construct by mapping given processorFvPatchField<Type>
|
||||
template<class Type>
|
||||
processorFvPatchField<Type>::processorFvPatchField
|
||||
(
|
||||
const processorFvPatchField<Type>& ptf,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, volMesh>& iF,
|
||||
const fvPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
coupledFvPatchField<Type>(ptf, p, iF, mapper),
|
||||
procPatch_(refCast<const processorFvPatch>(p))
|
||||
{
|
||||
if (!isType<processorFvPatch>(this->patch()))
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"processorFvPatchField<Type>::processorFvPatchField\n"
|
||||
"(\n"
|
||||
" const processorFvPatchField<Type>& ptf,\n"
|
||||
" const fvPatch& p,\n"
|
||||
" const DimensionedField<Type, volMesh>& iF,\n"
|
||||
" const fvPatchFieldMapper& mapper\n"
|
||||
")\n"
|
||||
) << "\n patch type '" << p.type()
|
||||
<< "' not constraint type '" << typeName << "'"
|
||||
<< "\n for patch " << p.name()
|
||||
<< " of field " << this->dimensionedInternalField().name()
|
||||
<< " in file " << this->dimensionedInternalField().objectPath()
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
processorFvPatchField<Type>::processorFvPatchField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, volMesh>& iF,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
coupledFvPatchField<Type>(p, iF, dict),
|
||||
procPatch_(refCast<const processorFvPatch>(p))
|
||||
{
|
||||
if (!isType<processorFvPatch>(p))
|
||||
{
|
||||
FatalIOErrorIn
|
||||
(
|
||||
"processorFvPatchField<Type>::processorFvPatchField\n"
|
||||
"(\n"
|
||||
" const fvPatch& p,\n"
|
||||
" const Field<Type>& field,\n"
|
||||
" const dictionary& dict\n"
|
||||
")\n",
|
||||
dict
|
||||
) << "\n patch type '" << p.type()
|
||||
<< "' not constraint type '" << typeName << "'"
|
||||
<< "\n for patch " << p.name()
|
||||
<< " of field " << this->dimensionedInternalField().name()
|
||||
<< " in file " << this->dimensionedInternalField().objectPath()
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
processorFvPatchField<Type>::processorFvPatchField
|
||||
(
|
||||
const processorFvPatchField<Type>& ptf
|
||||
)
|
||||
:
|
||||
processorLduInterfaceField(),
|
||||
coupledFvPatchField<Type>(ptf),
|
||||
procPatch_(refCast<const processorFvPatch>(ptf.patch()))
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
processorFvPatchField<Type>::processorFvPatchField
|
||||
(
|
||||
const processorFvPatchField<Type>& ptf,
|
||||
const DimensionedField<Type, volMesh>& iF
|
||||
)
|
||||
:
|
||||
coupledFvPatchField<Type>(ptf, iF),
|
||||
procPatch_(refCast<const processorFvPatch>(ptf.patch()))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
processorFvPatchField<Type>::~processorFvPatchField()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
tmp<Field<Type> > processorFvPatchField<Type>::patchNeighbourField() const
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void processorFvPatchField<Type>::initEvaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType
|
||||
)
|
||||
{
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
const processorPolyPatch& pp = procPatch_.procPolyPatch();
|
||||
|
||||
// Get reference to proc patch built-in buffer
|
||||
List<Type>& sendBuf = procPatch_.setSendBuf<Type>(this->size());
|
||||
|
||||
forAll(pp.patchIDs(), i)
|
||||
{
|
||||
SubField<Type> subSendFld(pp.subSlice(sendBuf, i));
|
||||
Field<Type>& subFld = static_cast<Field<Type>&>
|
||||
(
|
||||
static_cast<UList<Type>&>(subSendFld)
|
||||
);
|
||||
|
||||
label patchI = pp.patchIDs()[i];
|
||||
|
||||
//Pout<< "initEvaluate on "
|
||||
// << this->dimensionedInternalField().name()
|
||||
// << " patch:" << pp.name()
|
||||
// << " subSize:" << (pp.starts()[i+1]-pp.starts()[i])
|
||||
// << " subStart:" << pp.starts()[i]
|
||||
// << " subPatch:" << patchI << endl;
|
||||
|
||||
if (patchI == -1)
|
||||
{
|
||||
// Assign internal field
|
||||
this->patchInternalField
|
||||
(
|
||||
subFld,
|
||||
procPatch_,
|
||||
subSendFld.size(),
|
||||
pp.starts()[i]
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Assign evaluation of referred patch
|
||||
patchField(patchI).initEvaluate
|
||||
(
|
||||
subFld,
|
||||
procPatch_,
|
||||
subSendFld.size(),
|
||||
pp.starts()[i]
|
||||
);
|
||||
}
|
||||
}
|
||||
procPatch_.compressedBufferSend<Type>(commsType);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void processorFvPatchField<Type>::evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType
|
||||
)
|
||||
{
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
procPatch_.compressedReceive<Type>(commsType, *this);
|
||||
|
||||
const processorPolyPatch& pp = procPatch_.procPolyPatch();
|
||||
|
||||
forAll(pp.patchIDs(), i)
|
||||
{
|
||||
label patchI = pp.patchIDs()[i];
|
||||
|
||||
//Pout<< "evaluate on " << this->dimensionedInternalField().name()
|
||||
// << " patch:" << pp.name()
|
||||
// << " subSize:" << (pp.starts()[i+1]-pp.starts()[i])
|
||||
// << " subStart:" << pp.starts()[i]
|
||||
// << " subPatch:" << patchI << endl;
|
||||
|
||||
if (patchI == -1)
|
||||
{
|
||||
// No evaluation needed.
|
||||
}
|
||||
else
|
||||
{
|
||||
SubField<Type> subRecvFld(pp.subSlice(*this, i));
|
||||
|
||||
Field<Type>& subFld = static_cast<Field<Type>&>
|
||||
(
|
||||
static_cast<UList<Type>&>(subRecvFld)
|
||||
);
|
||||
|
||||
patchField(patchI).evaluate
|
||||
(
|
||||
subFld,
|
||||
procPatch_,
|
||||
subRecvFld.size(),
|
||||
pp.starts()[i]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
tmp<Field<Type> > processorFvPatchField<Type>::snGrad() const
|
||||
{
|
||||
tmp<Field<Type> > tpnf(new Field<Type>(this->size()));
|
||||
Field<Type>& pnf = tpnf();
|
||||
|
||||
const processorPolyPatch& pp = procPatch_.procPolyPatch();
|
||||
|
||||
forAll(pp.patchIDs(), i)
|
||||
{
|
||||
label patchI = pp.patchIDs()[i];
|
||||
label subStart = pp.starts()[i];
|
||||
label subSize = pp.starts()[i+1] - pp.starts()[i];
|
||||
|
||||
const SubField<Type> subThis(pp.subSlice(*this, i));
|
||||
|
||||
SubField<Type> subPnf(pp.subSlice(pnf, i));
|
||||
Field<Type>& subFld = static_cast<Field<Type>&>
|
||||
(
|
||||
static_cast<UList<Type>&>(subPnf)
|
||||
);
|
||||
|
||||
//Pout<< "snGrad on " << this->dimensionedInternalField().name()
|
||||
// << " patch:" << pp.name()
|
||||
// << " subSize:" << (pp.starts()[i+1]-pp.starts()[i])
|
||||
// << " subStart:" << pp.starts()[i]
|
||||
// << " subPatch:" << patchI << endl;
|
||||
|
||||
|
||||
if (patchI == -1)
|
||||
{
|
||||
// Slice delta coeffs
|
||||
const SubField<scalar> subDc
|
||||
(
|
||||
pp.subSlice(procPatch_.deltaCoeffs(), i)
|
||||
);
|
||||
tmp<Field<Type> > subInt(new Field<Type>(subSize));
|
||||
this->patchInternalField(subInt(), procPatch_, subSize, subStart);
|
||||
|
||||
subFld = (subDc*(subThis-subInt))();
|
||||
}
|
||||
else
|
||||
{
|
||||
patchField(patchI).snGrad
|
||||
(
|
||||
subFld,
|
||||
subThis,
|
||||
procPatch_,
|
||||
subSize,
|
||||
subStart
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return tpnf;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void processorFvPatchField<Type>::initInterfaceMatrixUpdate
|
||||
(
|
||||
const scalarField& psiInternal,
|
||||
scalarField& result,
|
||||
const lduMatrix& m,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
const Pstream::commsTypes commsType
|
||||
) const
|
||||
{
|
||||
// Get reference to proc patch built-in buffer
|
||||
List<scalar>& sendFld = procPatch_.setSendBuf<scalar>(this->size());
|
||||
|
||||
const processorPolyPatch& pp = procPatch_.procPolyPatch();
|
||||
|
||||
forAll(pp.patchIDs(), i)
|
||||
{
|
||||
label subStart = pp.starts()[i];
|
||||
label subSize = pp.starts()[i+1] - pp.starts()[i];
|
||||
SubField<scalar> subSendFld(sendFld, subSize, subStart);
|
||||
Field<scalar>& subFld = static_cast<Field<scalar>&>
|
||||
(
|
||||
static_cast<UList<scalar>&>(subSendFld)
|
||||
);
|
||||
|
||||
label patchI = pp.patchIDs()[i];
|
||||
|
||||
//Pout<< "initInterfaceMatrixUpdate on "
|
||||
// << this->dimensionedInternalField().name()
|
||||
// << " patch:" << pp.name()
|
||||
// << " subSize:" << (pp.starts()[i+1]-pp.starts()[i])
|
||||
// << " subStart:" << pp.starts()[i]
|
||||
// << " subPatch:" << patchI << endl;
|
||||
|
||||
if (patchI == -1)
|
||||
{
|
||||
const unallocLabelList& faceCells = pp.faceCells();
|
||||
|
||||
label facei = subStart;
|
||||
|
||||
forAll(subFld, i)
|
||||
{
|
||||
subFld[i] = psiInternal[faceCells[facei++]];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
patchField(patchI).initInterfaceMatrixUpdate
|
||||
(
|
||||
psiInternal,
|
||||
result,
|
||||
m,
|
||||
coeffs,
|
||||
cmpt,
|
||||
procPatch_,
|
||||
subSize,
|
||||
subStart,
|
||||
subFld
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
procPatch_.compressedBufferSend<scalar>(commsType);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void processorFvPatchField<Type>::updateInterfaceMatrix
|
||||
(
|
||||
const scalarField& psiInternal,
|
||||
scalarField& result,
|
||||
const lduMatrix& m,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
const Pstream::commsTypes commsType
|
||||
) const
|
||||
{
|
||||
const List<scalar>& recvFld = procPatch_.compressedBufferReceive<scalar>
|
||||
(
|
||||
commsType,
|
||||
this->size()
|
||||
);
|
||||
|
||||
const processorPolyPatch& pp = procPatch_.procPolyPatch();
|
||||
|
||||
forAll(pp.patchIDs(), i)
|
||||
{
|
||||
label subStart = pp.starts()[i];
|
||||
label subSize = pp.starts()[i+1] - pp.starts()[i];
|
||||
|
||||
SubField<scalar> subRecvFld(recvFld, subSize, subStart);
|
||||
Field<scalar>& subFld = static_cast<Field<scalar>&>
|
||||
(
|
||||
static_cast<UList<scalar>&>(subRecvFld)
|
||||
);
|
||||
|
||||
label patchI = pp.patchIDs()[i];
|
||||
|
||||
//Pout<< "updateInterfaceMatrix on "
|
||||
// << this->dimensionedInternalField().name()
|
||||
// << " patch:" << pp.name()
|
||||
// << " subSize:" << (pp.starts()[i+1]-pp.starts()[i])
|
||||
// << " subStart:" << pp.starts()[i]
|
||||
// << " subPatch:" << patchI << endl;
|
||||
|
||||
if (patchI == -1)
|
||||
{
|
||||
const unallocLabelList& faceCells = pp.faceCells();
|
||||
|
||||
label facei = subStart;
|
||||
|
||||
forAll(subFld, elemI)
|
||||
{
|
||||
result[faceCells[facei]] -= coeffs[facei]*subFld[elemI];
|
||||
|
||||
facei++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
patchField(patchI).updateInterfaceMatrix
|
||||
(
|
||||
psiInternal,
|
||||
result,
|
||||
m,
|
||||
coeffs,
|
||||
cmpt,
|
||||
procPatch_,
|
||||
subSize,
|
||||
subStart,
|
||||
subFld
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//template<class Type>
|
||||
//void Foam::processorFvPatchField<Type>::transformCoupleField
|
||||
//(
|
||||
// scalarField& f,
|
||||
// const direction cmpt
|
||||
//) const
|
||||
//{
|
||||
// if (pTraits<Type>::rank > 0)
|
||||
// {
|
||||
// const processorPolyPatch& pp = procPatch_.procPolyPatch();
|
||||
//
|
||||
// forAll(pp.patchIDs(), i)
|
||||
// {
|
||||
// label patchI = pp.patchIDs()[i];
|
||||
//
|
||||
// if (patchI == -1)
|
||||
// {
|
||||
// // ? anything needs to be transformed?
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// const coupledPolyPatch& cpp =
|
||||
// refCast<const coupledPolyPatch>(pp.boundaryMesh()[patchI]);
|
||||
//
|
||||
// if (!cpp.parallel())
|
||||
// {
|
||||
// const tensor& T = cpp.forwardT();
|
||||
//
|
||||
// SubField<scalar> subFld(pp.subSlice(f, i));
|
||||
// const scalarField& fld =
|
||||
// static_cast<const scalarField&>(subFld);
|
||||
//
|
||||
// const_cast<scalarField&>(fld) *=
|
||||
// pow(diag(T).component(cmpt), rank());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,323 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ 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 2 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::processorFvPatchField
|
||||
|
||||
Description
|
||||
Foam::processorFvPatchField
|
||||
|
||||
SourceFiles
|
||||
processorFvPatchField.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef processorFvPatchField_H
|
||||
#define processorFvPatchField_H
|
||||
|
||||
#include "coupledFvPatchField.H"
|
||||
#include "processorLduInterfaceField.H"
|
||||
#include "processorFvPatch.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class processorFvPatch Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class Type>
|
||||
class processorFvPatchField
|
||||
:
|
||||
public processorLduInterfaceField,
|
||||
public coupledFvPatchField<Type>
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Local reference cast into the processor patch
|
||||
const processorFvPatch& procPatch_;
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Get other patchfield
|
||||
const coupledFvPatchField<Type>& patchField(const label patchID) const;
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName(processorFvPatch::typeName_());
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from patch and internal field
|
||||
processorFvPatchField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<Type, volMesh>&
|
||||
);
|
||||
|
||||
//- Construct from patch and internal field and patch field
|
||||
processorFvPatchField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<Type, volMesh>&,
|
||||
const Field<Type>&
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
processorFvPatchField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<Type, volMesh>&,
|
||||
const dictionary&
|
||||
);
|
||||
|
||||
//- Construct by mapping given processorFvPatchField onto a new patch
|
||||
processorFvPatchField
|
||||
(
|
||||
const processorFvPatchField<Type>&,
|
||||
const fvPatch&,
|
||||
const DimensionedField<Type, volMesh>&,
|
||||
const fvPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Construct as copy
|
||||
processorFvPatchField(const processorFvPatchField<Type>&);
|
||||
|
||||
//- Construct and return a clone
|
||||
virtual tmp<fvPatchField<Type> > clone() const
|
||||
{
|
||||
return tmp<fvPatchField<Type> >
|
||||
(
|
||||
new processorFvPatchField<Type>(*this)
|
||||
);
|
||||
}
|
||||
|
||||
//- Construct as copy setting internal field reference
|
||||
processorFvPatchField
|
||||
(
|
||||
const processorFvPatchField<Type>&,
|
||||
const DimensionedField<Type, volMesh>&
|
||||
);
|
||||
|
||||
//- Construct and return a clone setting internal field reference
|
||||
virtual tmp<fvPatchField<Type> > clone
|
||||
(
|
||||
const DimensionedField<Type, volMesh>& iF
|
||||
) const
|
||||
{
|
||||
return tmp<fvPatchField<Type> >
|
||||
(
|
||||
new processorFvPatchField<Type>(*this, iF)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
~processorFvPatchField();
|
||||
|
||||
|
||||
// Member functions
|
||||
|
||||
// Access
|
||||
|
||||
//- Return true if running parallel
|
||||
virtual bool coupled() const
|
||||
{
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//- Return neighbour field given internal field
|
||||
tmp<Field<Type> > patchNeighbourField() const;
|
||||
|
||||
|
||||
// Evaluation functions
|
||||
|
||||
//- Initialise the evaluation of the patch field
|
||||
virtual void initEvaluate(const Pstream::commsTypes commsType);
|
||||
|
||||
//- Evaluate the patch field
|
||||
virtual void evaluate(const Pstream::commsTypes commsType);
|
||||
|
||||
//- Return patch-normal gradient
|
||||
virtual tmp<Field<Type> > snGrad() const;
|
||||
|
||||
//- Initialise neighbour matrix update
|
||||
virtual void initInterfaceMatrixUpdate
|
||||
(
|
||||
const scalarField& psiInternal,
|
||||
scalarField& result,
|
||||
const lduMatrix& m,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
const Pstream::commsTypes commsType
|
||||
) const;
|
||||
|
||||
//- Update result field based on interface functionality
|
||||
virtual void updateInterfaceMatrix
|
||||
(
|
||||
const scalarField& psiInternal,
|
||||
scalarField& result,
|
||||
const lduMatrix& m,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
const Pstream::commsTypes commsType
|
||||
) const;
|
||||
|
||||
//- Processor coupled interface functions
|
||||
|
||||
//- Return processor number
|
||||
virtual int myProcNo() const
|
||||
{
|
||||
return procPatch_.myProcNo();
|
||||
}
|
||||
|
||||
//- Return neigbour processor number
|
||||
virtual int neighbProcNo() const
|
||||
{
|
||||
return procPatch_.neighbProcNo();
|
||||
}
|
||||
|
||||
//- Return rank of component for transform
|
||||
virtual int rank() const
|
||||
{
|
||||
return pTraits<Type>::rank;
|
||||
}
|
||||
|
||||
// //- Transform given patch component field
|
||||
// void transformCoupleField
|
||||
// (
|
||||
// scalarField& f,
|
||||
// const direction cmpt
|
||||
// ) const;
|
||||
|
||||
// Referred-patch functionality. Get called with a slice (size, start)
|
||||
// of a patch that supplies fields and geometry/topology.
|
||||
|
||||
//- Get patch-normal gradient
|
||||
virtual void snGrad
|
||||
(
|
||||
Field<Type>& exchangeBuf,
|
||||
const Field<Type>& subFld,
|
||||
const coupledFvPatch& referringPatch,
|
||||
const label size,
|
||||
const label start
|
||||
) const
|
||||
{
|
||||
notImplemented("processorFvPatchField::snGrad(..)");
|
||||
}
|
||||
|
||||
//- Initialise the evaluation of the patch field.
|
||||
virtual void initEvaluate
|
||||
(
|
||||
Field<Type>& exchangeBuf,
|
||||
const coupledFvPatch& referringPatch,
|
||||
const label size,
|
||||
const label start
|
||||
) const
|
||||
{
|
||||
notImplemented("processorFvPatchField::initEvaluate(..)");
|
||||
}
|
||||
|
||||
//- Evaluate the patch field.
|
||||
virtual void evaluate
|
||||
(
|
||||
Field<Type>& exchangeBuf,
|
||||
const coupledFvPatch& referringPatch,
|
||||
const label size,
|
||||
const label start
|
||||
) const
|
||||
{
|
||||
notImplemented("processorFvPatchField::evaluate(..)");
|
||||
}
|
||||
|
||||
//- Initialise neighbour matrix update
|
||||
virtual void initInterfaceMatrixUpdate
|
||||
(
|
||||
const scalarField& psiInternal,
|
||||
scalarField& result,
|
||||
const lduMatrix& m,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
const coupledFvPatch& referringPatch,
|
||||
const label size,
|
||||
const label start,
|
||||
scalarField& exchangeBuf
|
||||
) const
|
||||
{
|
||||
notImplemented
|
||||
(
|
||||
"processorFvPatchField::initInterfaceMatrixUpdate(..)"
|
||||
);
|
||||
}
|
||||
|
||||
//- Update result field based on interface functionality
|
||||
virtual void updateInterfaceMatrix
|
||||
(
|
||||
const scalarField& psiInternal,
|
||||
scalarField& result,
|
||||
const lduMatrix&,
|
||||
const scalarField& coeffs,
|
||||
const direction,
|
||||
const coupledFvPatch& referringPatch,
|
||||
const label size,
|
||||
const label start,
|
||||
scalarField& exchangeBuf
|
||||
) const
|
||||
{
|
||||
notImplemented
|
||||
(
|
||||
"processorFvPatchField::updateInterfaceMatrix(..)"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "processorFvPatchField.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,45 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ 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 2 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "processorFvPatchFields.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "volFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
makePatchFields(processor);
|
||||
//makePatchTypeField(fvPatchScalarField, processorFvPatchScalarField);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,50 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ 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 2 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef processorFvPatchFields_H
|
||||
#define processorFvPatchFields_H
|
||||
|
||||
#include "processorFvPatchScalarField.H"
|
||||
#include "fieldTypes.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makePatchTypeFieldTypedefs(processor)
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user