mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: meshToMesh - updated mapping of boundary field when constructed from tmp
This commit is contained in:
@ -26,6 +26,7 @@ License
|
|||||||
#include "fvMesh.H"
|
#include "fvMesh.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
#include "directFvPatchFieldMapper.H"
|
#include "directFvPatchFieldMapper.H"
|
||||||
|
#include "calculatedFvPatchField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -381,30 +382,21 @@ Foam::meshToMesh::mapSrcToTgt
|
|||||||
|
|
||||||
const fvMesh& tgtMesh = static_cast<const fvMesh&>(tgtRegion_);
|
const fvMesh& tgtMesh = static_cast<const fvMesh&>(tgtRegion_);
|
||||||
|
|
||||||
const typename fieldType::GeometricBoundaryField& bfld =
|
const fvBoundaryMesh& tgtBm = tgtMesh.boundary();
|
||||||
|
const typename fieldType::GeometricBoundaryField& srcBfld =
|
||||||
field.boundaryField();
|
field.boundaryField();
|
||||||
|
|
||||||
PtrList<fvPatchField<Type> > patchFields(bfld.size());
|
wordList patchTypes(tgtBm.size(), calculatedFvPatchField<Type>::typeName);
|
||||||
|
|
||||||
// constuct tgt boundary patch types as copy of field boundary types
|
// constuct tgt boundary patch types as copy of 'field' boundary types
|
||||||
// note: this will provide place holders for fields with additional
|
// note: this will provide place holders for fields with additional
|
||||||
// entries, but these values will need to be reset
|
// entries, but these values will need to be reset
|
||||||
forAll(bfld, patchI)
|
forAll(tgtPatchID_, i)
|
||||||
{
|
{
|
||||||
patchFields.set
|
label srcPatchI = srcPatchID_[i];
|
||||||
(
|
label tgtPatchI = tgtPatchID_[i];
|
||||||
patchI,
|
|
||||||
fvPatchField<Type>::New
|
patchTypes[tgtPatchI] = srcBfld[srcPatchI].type();
|
||||||
(
|
|
||||||
bfld[patchI],
|
|
||||||
tgtMesh.boundary()[patchI],
|
|
||||||
DimensionedField<Type, volMesh>::null(),
|
|
||||||
directFvPatchFieldMapper
|
|
||||||
(
|
|
||||||
labelList(tgtMesh.boundary()[patchI].size(), -1)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp<fieldType> tresult
|
tmp<fieldType> tresult
|
||||||
@ -420,9 +412,8 @@ Foam::meshToMesh::mapSrcToTgt
|
|||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE
|
||||||
),
|
),
|
||||||
tgtMesh,
|
tgtMesh,
|
||||||
field.dimensions(),
|
dimensioned<Type>("0", field.dimensions(), pTraits<Type>::zero),
|
||||||
Field<Type>(tgtMesh.nCells(), pTraits<Type>::zero),
|
patchTypes
|
||||||
patchFields
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -517,30 +508,21 @@ Foam::meshToMesh::mapTgtToSrc
|
|||||||
|
|
||||||
const fvMesh& srcMesh = static_cast<const fvMesh&>(srcRegion_);
|
const fvMesh& srcMesh = static_cast<const fvMesh&>(srcRegion_);
|
||||||
|
|
||||||
const typename fieldType::GeometricBoundaryField& bfld =
|
const fvBoundaryMesh& srcBm = srcMesh.boundary();
|
||||||
|
const typename fieldType::GeometricBoundaryField& tgtBfld =
|
||||||
field.boundaryField();
|
field.boundaryField();
|
||||||
|
|
||||||
PtrList<fvPatchField<Type> > patchFields(bfld.size());
|
wordList patchTypes(srcBm.size(), calculatedFvPatchField<Type>::typeName);
|
||||||
|
|
||||||
// constuct src boundary patch types as copy of field boundary types
|
// constuct src boundary patch types as copy of 'field' boundary types
|
||||||
// note: this will provide place holders for fields with additional
|
// note: this will provide place holders for fields with additional
|
||||||
// entries, but these values will need to be reset
|
// entries, but these values will need to be reset
|
||||||
forAll(bfld, patchI)
|
forAll(srcPatchID_, i)
|
||||||
{
|
{
|
||||||
patchFields.set
|
label srcPatchI = srcPatchID_[i];
|
||||||
(
|
label tgtPatchI = tgtPatchID_[i];
|
||||||
patchI,
|
|
||||||
fvPatchField<Type>::New
|
patchTypes[srcPatchI] = tgtBfld[tgtPatchI].type();
|
||||||
(
|
|
||||||
bfld[patchI],
|
|
||||||
srcMesh.boundary()[patchI],
|
|
||||||
DimensionedField<Type, volMesh>::null(),
|
|
||||||
directFvPatchFieldMapper
|
|
||||||
(
|
|
||||||
labelList(srcMesh.boundary()[patchI].size(), -1)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp<fieldType> tresult
|
tmp<fieldType> tresult
|
||||||
@ -556,9 +538,8 @@ Foam::meshToMesh::mapTgtToSrc
|
|||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE
|
||||||
),
|
),
|
||||||
srcMesh,
|
srcMesh,
|
||||||
field.dimensions(),
|
dimensioned<Type>("0", field.dimensions(), pTraits<Type>::zero),
|
||||||
Field<Type>(srcMesh.nCells(), pTraits<Type>::zero),
|
patchTypes
|
||||||
patchFields
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user