mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
mapFieldsPar: updated to enable mapping from source patches (instead of recreating)
- patchFields now get mapped (instead of created)
- with -consistent it now maps all patches except for processor ones (they are
the only ones that are processor-local)
- all constraint patches get evaluated after mapping to bring them up to date.
Patch contributed by Mattijs Janssens
This commit is contained in:
@ -72,21 +72,15 @@ bool Foam::directMethod::findInitialSeeds
|
||||
|
||||
if (mapFlag[srcI])
|
||||
{
|
||||
const pointField
|
||||
pts(srcCells[srcI].points(srcFaces, srcPts).xfer());
|
||||
|
||||
forAll(pts, ptI)
|
||||
{
|
||||
const point& pt = pts[ptI];
|
||||
label tgtI = tgt_.cellTree().findInside(pt);
|
||||
const point srcCtr(srcCells[srcI].centre(srcPts, srcFaces));
|
||||
label tgtI = tgt_.cellTree().findInside(srcCtr);
|
||||
|
||||
if (tgtI != -1 && intersect(srcI, tgtI))
|
||||
{
|
||||
srcSeedI = srcI;
|
||||
tgtSeedI = tgtI;
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -178,8 +172,6 @@ void Foam::directMethod::appendToDirectSeeds
|
||||
const labelList& srcNbr = src_.cellCells()[srcSeedI];
|
||||
const labelList& tgtNbr = tgt_.cellCells()[tgtSeedI];
|
||||
|
||||
const vectorField& srcCentre = src_.cellCentres();
|
||||
|
||||
forAll(srcNbr, i)
|
||||
{
|
||||
label srcI = srcNbr[i];
|
||||
@ -194,15 +186,7 @@ void Foam::directMethod::appendToDirectSeeds
|
||||
{
|
||||
label tgtI = tgtNbr[j];
|
||||
|
||||
if
|
||||
(
|
||||
tgt_.pointInCell
|
||||
(
|
||||
srcCentre[srcI],
|
||||
tgtI,
|
||||
polyMesh::FACE_PLANES
|
||||
)
|
||||
)
|
||||
if (intersect(srcI, tgtI))
|
||||
{
|
||||
// new match - append to lists
|
||||
found = true;
|
||||
|
||||
170
src/sampling/meshToMesh/distributedWeightedFvPatchFieldMapper.H
Normal file
170
src/sampling/meshToMesh/distributedWeightedFvPatchFieldMapper.H
Normal file
@ -0,0 +1,170 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::distributedWeightedFvPatchFieldMapper
|
||||
|
||||
Description
|
||||
FieldMapper with weighted mapping from (optionally remote) quantities.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef distributedWeightedFvPatchFieldMapper_H
|
||||
#define distributedWeightedFvPatchFieldMapper_H
|
||||
|
||||
#include "fvPatchFieldMapper.H"
|
||||
#include "mapDistributeBase.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class distributedWeightedFvPatchFieldMapper Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class distributedWeightedFvPatchFieldMapper
|
||||
:
|
||||
public fvPatchFieldMapper
|
||||
{
|
||||
const label singlePatchProc_;
|
||||
|
||||
const mapDistributeBase* distMapPtr_;
|
||||
|
||||
const labelListList& addressing_;
|
||||
|
||||
const scalarListList& weights_;
|
||||
|
||||
bool hasUnmapped_;
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct given addressing
|
||||
distributedWeightedFvPatchFieldMapper
|
||||
(
|
||||
const label singlePatchProc,
|
||||
const mapDistributeBase* distMapPtr,
|
||||
const labelListList& addressing,
|
||||
const scalarListList& weights
|
||||
)
|
||||
:
|
||||
singlePatchProc_(singlePatchProc),
|
||||
distMapPtr_(distMapPtr),
|
||||
addressing_(addressing),
|
||||
weights_(weights),
|
||||
hasUnmapped_(false)
|
||||
{
|
||||
forAll(addressing_, i)
|
||||
{
|
||||
if (addressing_[i].size() == 0)
|
||||
{
|
||||
hasUnmapped_ = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ((singlePatchProc_ == -1) != (distMapPtr_ != NULL))
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"distributedWeightedFvPatchFieldMapper::"
|
||||
"distributedWeightedFvPatchFieldMapper(..)"
|
||||
) << "Supply a mapDistributeBase if and only if "
|
||||
<< "singlePatchProc is -1"
|
||||
<< " singlePatchProc_:" << singlePatchProc_
|
||||
<< " distMapPtr_:" << (distMapPtr_ != NULL)
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
//- Destructor
|
||||
virtual ~distributedWeightedFvPatchFieldMapper()
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
virtual label size() const
|
||||
{
|
||||
if (distributed())
|
||||
{
|
||||
return distributeMap().constructSize();
|
||||
}
|
||||
else
|
||||
{
|
||||
return addressing().size();
|
||||
}
|
||||
}
|
||||
|
||||
virtual bool direct() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual bool distributed() const
|
||||
{
|
||||
return singlePatchProc_ == -1;
|
||||
}
|
||||
|
||||
virtual const mapDistributeBase& distributeMap() const
|
||||
{
|
||||
if (!distMapPtr_)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"distributedWeightedFvPatchFieldMapper::"
|
||||
"distributeMap()"
|
||||
) << "Cannot ask for distributeMap on a non-distributed"
|
||||
<< " mapper" << exit(FatalError);
|
||||
}
|
||||
return *distMapPtr_;
|
||||
}
|
||||
|
||||
virtual bool hasUnmapped() const
|
||||
{
|
||||
return hasUnmapped_;
|
||||
}
|
||||
|
||||
virtual const labelListList& addressing() const
|
||||
{
|
||||
return addressing_;
|
||||
}
|
||||
|
||||
virtual const scalarListList& weights() const
|
||||
{
|
||||
return weights_;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -53,6 +53,116 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<>
|
||||
void Foam::meshToMesh::mapAndOpSrcToTgt
|
||||
(
|
||||
const AMIPatchToPatchInterpolation& AMI,
|
||||
const Field<scalar>& srcField,
|
||||
Field<scalar>& tgtField,
|
||||
const plusEqOp<scalar>& cop
|
||||
) const
|
||||
{}
|
||||
|
||||
|
||||
template<>
|
||||
void Foam::meshToMesh::mapAndOpSrcToTgt
|
||||
(
|
||||
const AMIPatchToPatchInterpolation& AMI,
|
||||
const Field<vector>& srcField,
|
||||
Field<vector>& tgtField,
|
||||
const plusEqOp<vector>& cop
|
||||
) const
|
||||
{}
|
||||
|
||||
|
||||
template<>
|
||||
void Foam::meshToMesh::mapAndOpSrcToTgt
|
||||
(
|
||||
const AMIPatchToPatchInterpolation& AMI,
|
||||
const Field<sphericalTensor>& srcField,
|
||||
Field<sphericalTensor>& tgtField,
|
||||
const plusEqOp<sphericalTensor>& cop
|
||||
) const
|
||||
{}
|
||||
|
||||
|
||||
template<>
|
||||
void Foam::meshToMesh::mapAndOpSrcToTgt
|
||||
(
|
||||
const AMIPatchToPatchInterpolation& AMI,
|
||||
const Field<symmTensor>& srcField,
|
||||
Field<symmTensor>& tgtField,
|
||||
const plusEqOp<symmTensor>& cop
|
||||
) const
|
||||
{}
|
||||
|
||||
|
||||
template<>
|
||||
void Foam::meshToMesh::mapAndOpSrcToTgt
|
||||
(
|
||||
const AMIPatchToPatchInterpolation& AMI,
|
||||
const Field<tensor>& srcField,
|
||||
Field<tensor>& tgtField,
|
||||
const plusEqOp<tensor>& cop
|
||||
) const
|
||||
{}
|
||||
|
||||
|
||||
template<>
|
||||
void Foam::meshToMesh::mapAndOpTgtToSrc
|
||||
(
|
||||
const AMIPatchToPatchInterpolation& AMI,
|
||||
Field<scalar>& srcField,
|
||||
const Field<scalar>& tgtField,
|
||||
const plusEqOp<scalar>& cop
|
||||
) const
|
||||
{}
|
||||
|
||||
|
||||
template<>
|
||||
void Foam::meshToMesh::mapAndOpTgtToSrc
|
||||
(
|
||||
const AMIPatchToPatchInterpolation& AMI,
|
||||
Field<vector>& srcField,
|
||||
const Field<vector>& tgtField,
|
||||
const plusEqOp<vector>& cop
|
||||
) const
|
||||
{}
|
||||
|
||||
|
||||
template<>
|
||||
void Foam::meshToMesh::mapAndOpTgtToSrc
|
||||
(
|
||||
const AMIPatchToPatchInterpolation& AMI,
|
||||
Field<sphericalTensor>& srcField,
|
||||
const Field<sphericalTensor>& tgtField,
|
||||
const plusEqOp<sphericalTensor>& cop
|
||||
) const
|
||||
{}
|
||||
|
||||
|
||||
template<>
|
||||
void Foam::meshToMesh::mapAndOpTgtToSrc
|
||||
(
|
||||
const AMIPatchToPatchInterpolation& AMI,
|
||||
Field<symmTensor>& srcField,
|
||||
const Field<symmTensor>& tgtField,
|
||||
const plusEqOp<symmTensor>& cop
|
||||
) const
|
||||
{}
|
||||
|
||||
|
||||
template<>
|
||||
void Foam::meshToMesh::mapAndOpTgtToSrc
|
||||
(
|
||||
const AMIPatchToPatchInterpolation& AMI,
|
||||
Field<tensor>& srcField,
|
||||
const Field<tensor>& tgtField,
|
||||
const plusEqOp<tensor>& cop
|
||||
) const
|
||||
{}
|
||||
|
||||
|
||||
Foam::labelList Foam::meshToMesh::maskCells
|
||||
(
|
||||
const polyMesh& src,
|
||||
@ -443,7 +553,11 @@ void Foam::meshToMesh::constructNoCuttingPatches
|
||||
forAll(srcBM, patchi)
|
||||
{
|
||||
const polyPatch& pp = srcBM[patchi];
|
||||
if (!polyPatch::constraintType(pp.type()))
|
||||
|
||||
// We want to map all the global patches, including constraint
|
||||
// patches (since they might have mappable properties, e.g.
|
||||
// jumpCyclic). We'll fix the value afterwards.
|
||||
if (!isA<processorPolyPatch>(pp))
|
||||
{
|
||||
srcPatchID.append(pp.index());
|
||||
|
||||
|
||||
@ -129,6 +129,28 @@ private:
|
||||
template<class Type>
|
||||
void add(UList<Type>& fld, const label offset) const;
|
||||
|
||||
//- Helper function to interpolate patch field. Template
|
||||
// specialisations below
|
||||
template<class Type, class CombineOp>
|
||||
void mapAndOpSrcToTgt
|
||||
(
|
||||
const AMIPatchToPatchInterpolation& AMI,
|
||||
const Field<Type>& srcField,
|
||||
Field<Type>& tgtField,
|
||||
const CombineOp& cop
|
||||
) const;
|
||||
|
||||
//- Helper function to interpolate patch field. Template
|
||||
// specialisations below
|
||||
template<class Type, class CombineOp>
|
||||
void mapAndOpTgtToSrc
|
||||
(
|
||||
const AMIPatchToPatchInterpolation& AMI,
|
||||
Field<Type>& srcField,
|
||||
const Field<Type>& tgtField,
|
||||
const CombineOp& cop
|
||||
) const;
|
||||
|
||||
//- Return src cell IDs for the overlap region
|
||||
labelList maskCells(const polyMesh& src, const polyMesh& tgt) const;
|
||||
|
||||
@ -524,6 +546,91 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// Disable fvPatchField value override after rmap
|
||||
|
||||
template<>
|
||||
void meshToMesh::mapAndOpSrcToTgt
|
||||
(
|
||||
const AMIPatchToPatchInterpolation& AMI,
|
||||
const Field<scalar>& srcField,
|
||||
Field<scalar>& tgtField,
|
||||
const plusEqOp<scalar>& cop
|
||||
) const;
|
||||
template<>
|
||||
void meshToMesh::mapAndOpSrcToTgt
|
||||
(
|
||||
const AMIPatchToPatchInterpolation& AMI,
|
||||
const Field<vector>& srcField,
|
||||
Field<vector>& tgtField,
|
||||
const plusEqOp<vector>& cop
|
||||
) const;
|
||||
template<>
|
||||
void meshToMesh::mapAndOpSrcToTgt
|
||||
(
|
||||
const AMIPatchToPatchInterpolation& AMI,
|
||||
const Field<sphericalTensor>& srcField,
|
||||
Field<sphericalTensor>& tgtField,
|
||||
const plusEqOp<sphericalTensor>& cop
|
||||
) const;
|
||||
template<>
|
||||
void meshToMesh::mapAndOpSrcToTgt
|
||||
(
|
||||
const AMIPatchToPatchInterpolation& AMI,
|
||||
const Field<symmTensor>& srcField,
|
||||
Field<symmTensor>& tgtField,
|
||||
const plusEqOp<symmTensor>& cop
|
||||
) const;
|
||||
template<>
|
||||
void meshToMesh::mapAndOpSrcToTgt
|
||||
(
|
||||
const AMIPatchToPatchInterpolation& AMI,
|
||||
const Field<tensor>& srcField,
|
||||
Field<tensor>& tgtField,
|
||||
const plusEqOp<tensor>& cop
|
||||
) const;
|
||||
|
||||
|
||||
template<>
|
||||
void meshToMesh::mapAndOpTgtToSrc
|
||||
(
|
||||
const AMIPatchToPatchInterpolation& AMI,
|
||||
Field<scalar>& srcField,
|
||||
const Field<scalar>& tgtField,
|
||||
const plusEqOp<scalar>& cop
|
||||
) const;
|
||||
template<>
|
||||
void meshToMesh::mapAndOpTgtToSrc
|
||||
(
|
||||
const AMIPatchToPatchInterpolation& AMI,
|
||||
Field<vector>& srcField,
|
||||
const Field<vector>& tgtField,
|
||||
const plusEqOp<vector>& cop
|
||||
) const;
|
||||
template<>
|
||||
void meshToMesh::mapAndOpTgtToSrc
|
||||
(
|
||||
const AMIPatchToPatchInterpolation& AMI,
|
||||
Field<sphericalTensor>& srcField,
|
||||
const Field<sphericalTensor>& tgtField,
|
||||
const plusEqOp<sphericalTensor>& cop
|
||||
) const;
|
||||
template<>
|
||||
void meshToMesh::mapAndOpTgtToSrc
|
||||
(
|
||||
const AMIPatchToPatchInterpolation& AMI,
|
||||
Field<symmTensor>& srcField,
|
||||
const Field<symmTensor>& tgtField,
|
||||
const plusEqOp<symmTensor>& cop
|
||||
) const;
|
||||
template<>
|
||||
void meshToMesh::mapAndOpTgtToSrc
|
||||
(
|
||||
const AMIPatchToPatchInterpolation& AMI,
|
||||
Field<tensor>& srcField,
|
||||
const Field<tensor>& tgtField,
|
||||
const plusEqOp<tensor>& cop
|
||||
) const;
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -27,7 +27,7 @@ License
|
||||
#include "volFields.H"
|
||||
#include "directFvPatchFieldMapper.H"
|
||||
#include "calculatedFvPatchField.H"
|
||||
#include "weightedFvPatchFieldMapper.H"
|
||||
#include "distributedWeightedFvPatchFieldMapper.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -317,6 +317,27 @@ Foam::tmp<Foam::Field<Type>> Foam::meshToMesh::mapTgtToSrc
|
||||
}
|
||||
|
||||
|
||||
template<class Type, class CombineOp>
|
||||
void Foam::meshToMesh::mapAndOpSrcToTgt
|
||||
(
|
||||
const AMIPatchToPatchInterpolation& AMI,
|
||||
const Field<Type>& srcField,
|
||||
Field<Type>& tgtField,
|
||||
const CombineOp& cop
|
||||
) const
|
||||
{
|
||||
tgtField = pTraits<Type>::zero;
|
||||
|
||||
AMI.interpolateToTarget
|
||||
(
|
||||
srcField,
|
||||
multiplyWeightedOp<Type, CombineOp>(cop),
|
||||
tgtField,
|
||||
UList<Type>::null()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class Type, class CombineOp>
|
||||
void Foam::meshToMesh::mapSrcToTgt
|
||||
(
|
||||
@ -340,40 +361,35 @@ void Foam::meshToMesh::mapSrcToTgt
|
||||
const fvPatchField<Type>& srcField = field.boundaryField()[srcPatchi];
|
||||
fvPatchField<Type>& tgtField = resultBf[tgtPatchi];
|
||||
|
||||
// 2.3 does not do distributed mapping yet so only do if
|
||||
// running on single processor
|
||||
if (AMIList[i].singlePatchProc() != -1)
|
||||
{
|
||||
// Clone and map (since rmap does not do general mapping)
|
||||
tmp<fvPatchField<Type>> tnewTgt
|
||||
(
|
||||
fvPatchField<Type>::New
|
||||
(
|
||||
srcField,
|
||||
tgtField.patch(),
|
||||
result(),
|
||||
weightedFvPatchFieldMapper
|
||||
(
|
||||
AMIList[i].tgtAddress(),
|
||||
AMIList[i].tgtWeights()
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Transfer all mapped quantities (value and e.g. gradient) onto
|
||||
// tgtField. Value will get overwritten below.
|
||||
tgtField.rmap(tnewTgt(), identity(tgtField.size()));
|
||||
}
|
||||
|
||||
tgtField == Type(Zero);
|
||||
|
||||
AMIList[i].interpolateToTarget
|
||||
// Clone and map (since rmap does not do general mapping)
|
||||
tmp<fvPatchField<Type>> tnewTgt
|
||||
(
|
||||
srcField,
|
||||
multiplyWeightedOp<Type, CombineOp>(cop),
|
||||
tgtField,
|
||||
UList<Type>::null()
|
||||
fvPatchField<Type>::New
|
||||
(
|
||||
srcField,
|
||||
tgtField.patch(),
|
||||
result(),
|
||||
distributedWeightedFvPatchFieldMapper
|
||||
(
|
||||
AMIList[i].singlePatchProc(),
|
||||
(
|
||||
AMIList[i].singlePatchProc() == -1
|
||||
? &AMIList[i].srcMap()
|
||||
: NULL
|
||||
),
|
||||
AMIList[i].tgtAddress(),
|
||||
AMIList[i].tgtWeights()
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Transfer all mapped quantities (value and e.g. gradient) onto
|
||||
// tgtField. Value will get overwritten below.
|
||||
tgtField.rmap(tnewTgt(), identity(tgtField.size()));
|
||||
|
||||
// Override value to account for CombineOp (note: is dummy template
|
||||
// specialisation for plusEqOp)
|
||||
mapAndOpSrcToTgt(AMIList[i], srcField, tgtField, cop);
|
||||
}
|
||||
|
||||
forAll(cuttingPatches_, i)
|
||||
@ -403,7 +419,7 @@ Foam::meshToMesh::mapSrcToTgt
|
||||
|
||||
PtrList<fvPatchField<Type>> tgtPatchFields(tgtBm.size());
|
||||
|
||||
// constuct tgt boundary patch types as copy of 'field' boundary types
|
||||
// construct tgt boundary patch types as copy of 'field' boundary types
|
||||
// note: this will provide place holders for fields with additional
|
||||
// entries, but these values will need to be reset
|
||||
forAll(tgtPatchID_, i)
|
||||
@ -509,6 +525,27 @@ Foam::meshToMesh::mapSrcToTgt
|
||||
}
|
||||
|
||||
|
||||
template<class Type, class CombineOp>
|
||||
void Foam::meshToMesh::mapAndOpTgtToSrc
|
||||
(
|
||||
const AMIPatchToPatchInterpolation& AMI,
|
||||
Field<Type>& srcField,
|
||||
const Field<Type>& tgtField,
|
||||
const CombineOp& cop
|
||||
) const
|
||||
{
|
||||
srcField = pTraits<Type>::zero;
|
||||
|
||||
AMI.interpolateToSource
|
||||
(
|
||||
tgtField,
|
||||
multiplyWeightedOp<Type, CombineOp>(cop),
|
||||
srcField,
|
||||
UList<Type>::null()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class Type, class CombineOp>
|
||||
void Foam::meshToMesh::mapTgtToSrc
|
||||
(
|
||||
@ -529,40 +566,37 @@ void Foam::meshToMesh::mapTgtToSrc
|
||||
fvPatchField<Type>& srcField = result.boundaryField()[srcPatchi];
|
||||
const fvPatchField<Type>& tgtField = field.boundaryField()[tgtPatchi];
|
||||
|
||||
// 2.3 does not do distributed mapping yet so only do if
|
||||
// running on single processor
|
||||
if (AMIList[i].singlePatchProc() != -1)
|
||||
{
|
||||
// Clone and map (since rmap does not do general mapping)
|
||||
tmp<fvPatchField<Type>> tnewSrc
|
||||
(
|
||||
fvPatchField<Type>::New
|
||||
(
|
||||
tgtField,
|
||||
srcField.patch(),
|
||||
result(),
|
||||
weightedFvPatchFieldMapper
|
||||
(
|
||||
AMIList[i].srcAddress(),
|
||||
AMIList[i].srcWeights()
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Transfer all mapped quantities (value and e.g. gradient) onto
|
||||
// srcField. Value will get overwritten below
|
||||
srcField.rmap(tnewSrc(), identity(srcField.size()));
|
||||
}
|
||||
|
||||
srcField == Type(Zero);
|
||||
|
||||
AMIList[i].interpolateToSource
|
||||
// Clone and map (since rmap does not do general mapping)
|
||||
tmp<fvPatchField<Type>> tnewSrc
|
||||
(
|
||||
tgtField,
|
||||
multiplyWeightedOp<Type, CombineOp>(cop),
|
||||
srcField,
|
||||
UList<Type>::null()
|
||||
fvPatchField<Type>::New
|
||||
(
|
||||
tgtField,
|
||||
srcField.patch(),
|
||||
result(),
|
||||
distributedWeightedFvPatchFieldMapper
|
||||
(
|
||||
AMIList[i].singlePatchProc(),
|
||||
(
|
||||
AMIList[i].singlePatchProc() == -1
|
||||
? &AMIList[i].tgtMap()
|
||||
: NULL
|
||||
),
|
||||
AMIList[i].srcAddress(),
|
||||
AMIList[i].srcWeights()
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Transfer all mapped quantities (value and e.g. gradient) onto
|
||||
// srcField. Value will get overwritten below
|
||||
srcField.rmap(tnewSrc(), identity(srcField.size()));
|
||||
|
||||
|
||||
// Override value to account for CombineOp (could be dummy for
|
||||
// plusEqOp)
|
||||
mapAndOpTgtToSrc(AMIList[i], srcField, tgtField, cop);
|
||||
}
|
||||
|
||||
forAll(cuttingPatches_, i)
|
||||
|
||||
Reference in New Issue
Block a user