mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: FieldMapper: extend with unmapped checking flag
This commit is contained in:
@ -175,48 +175,6 @@ public:
|
||||
~meshToMesh();
|
||||
|
||||
|
||||
//- Patch-field interpolation class
|
||||
class patchFieldInterpolator
|
||||
:
|
||||
public fvPatchFieldMapper
|
||||
{
|
||||
const labelList& directAddressing_;
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct given addressing
|
||||
patchFieldInterpolator(const labelList& addr)
|
||||
:
|
||||
directAddressing_(addr)
|
||||
{}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~patchFieldInterpolator()
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
label size() const
|
||||
{
|
||||
return directAddressing_.size();
|
||||
}
|
||||
|
||||
bool direct() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
const labelList& directAddressing() const
|
||||
{
|
||||
return directAddressing_;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -28,6 +28,7 @@ License
|
||||
#include "interpolationCellPoint.H"
|
||||
#include "SubField.H"
|
||||
#include "mixedFvPatchField.H"
|
||||
#include "directFvPatchFieldMapper.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
@ -408,7 +409,7 @@ Foam::meshToMesh::interpolate
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
// Create and map the patch field values
|
||||
// 1. Create the complete field with dummy patch fields
|
||||
PtrList<fvPatchField<Type> > patchFields
|
||||
(
|
||||
boundaryAddressing_.size()
|
||||
@ -421,13 +422,9 @@ Foam::meshToMesh::interpolate
|
||||
patchI,
|
||||
fvPatchField<Type>::New
|
||||
(
|
||||
fromVf.boundaryField()[patchI],
|
||||
calculatedFvPatchField<Type>::typeName,
|
||||
toMesh_.boundary()[patchI],
|
||||
DimensionedField<Type, volMesh>::null(),
|
||||
patchFieldInterpolator
|
||||
(
|
||||
boundaryAddressing_[patchI]
|
||||
)
|
||||
DimensionedField<Type, volMesh>::null()
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -452,6 +449,31 @@ Foam::meshToMesh::interpolate
|
||||
patchFields
|
||||
)
|
||||
);
|
||||
GeometricField<Type, fvPatchField, volMesh>& toF = ttoF();
|
||||
|
||||
// 2. Change the fvPatchFields to the correct type using a mapper
|
||||
// constructor (with reference to the now correct internal field)
|
||||
|
||||
typename GeometricField<Type, fvPatchField, volMesh>::
|
||||
GeometricBoundaryField& bf = toF.boundaryField();
|
||||
|
||||
forAll(boundaryAddressing_, patchI)
|
||||
{
|
||||
bf.set
|
||||
(
|
||||
patchI,
|
||||
fvPatchField<Type>::New
|
||||
(
|
||||
fromVf.boundaryField()[patchI],
|
||||
toMesh_.boundary()[patchI],
|
||||
toF.dimensionedInternalField(),
|
||||
directFvPatchFieldMapper
|
||||
(
|
||||
boundaryAddressing_[patchI]
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return ttoF;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user