diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files
index 8b83cf7d76..d203b8fe23 100644
--- a/src/finiteVolume/Make/files
+++ b/src/finiteVolume/Make/files
@@ -123,6 +123,9 @@ fvMeshStitchers = fvMesh/fvMeshStitchers
$(fvMeshStitchers)/fvMeshStitcher/fvMeshStitcher.C
$(fvMeshStitchers)/fvMeshStitcher/fvMeshStitcherNew.C
+$(fvMeshStitchers)/fvMeshStitcher/fvMeshStitcherTools.C
+$(fvMeshStitchers)/fvMeshStitcher/conformedFvsPatchFields.C
+#$(fvMeshStitchers)/fvMeshStitcher/conformalisingFvPatchFieldMapper.C
$(fvMeshStitchers)/stationary/fvMeshStitchersStationary.C
functionObjects/fvMeshFunctionObject/fvMeshFunctionObject.C
diff --git a/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/conformedFvsPatchField.C b/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/conformedFvsPatchField.C
new file mode 100644
index 0000000000..8356e4140a
--- /dev/null
+++ b/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/conformedFvsPatchField.C
@@ -0,0 +1,299 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Copyright (C) 2011-2023 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#include "conformedFvsPatchField.H"
+#include "fvMeshStitcherTools.H"
+#include "nonConformalBoundary.H"
+#include "nonConformalFvPatch.H"
+#include "nonConformalErrorFvPatch.H"
+#include "surfaceFields.H"
+
+// * * * * * * * * * * * * * Private Constructors * * * * * * * * * * * * * //
+
+template
+Foam::conformedFvsPatchField::conformedFvsPatchField
+(
+ const fvPatch& p,
+ const DimensionedField& iF,
+ autoPtr>&& origFieldPtr,
+ autoPtr>&& ncFieldPtr
+)
+:
+ fvsPatchField(p, iF),
+ origFieldPtr_(origFieldPtr),
+ ncFieldPtr_(ncFieldPtr)
+{}
+
+
+// * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * //
+
+template
+void Foam::conformedFvsPatchField::conform
+(
+ typename SurfaceField::Boundary& bF
+)
+{
+ const DimensionedField& iF = bF[0].internalField();
+
+ const fvBoundaryMesh& fvbm = iF.mesh().boundary();
+
+ const labelList origPatchIDs =
+ nonConformalBoundary::New(iF.mesh()).allOrigPatchIDs();
+
+ // Evaluate the conformed orig and non-conformal boundary fields
+ const typename SurfaceField::Boundary origBf
+ (
+ SurfaceField::Internal::null(),
+ fvMeshStitcherTools::conformedOrigBoundaryField(bF)
+ );
+ const typename SurfaceField::Boundary ncBf
+ (
+ SurfaceField::Internal::null(),
+ fvMeshStitcherTools::conformedNcBoundaryField(bF)
+ );
+
+ // Replace every original patch field with a conformed patch field
+ // containing the conformed orig and non-conformal fields
+ forAll(origPatchIDs, i)
+ {
+ const label origPatchi = origPatchIDs[i];
+ const fvPatch& origFvp = fvbm[origPatchi];
+
+ autoPtr> pF
+ (
+ new conformedFvsPatchField
+ (
+ origFvp,
+ iF,
+ bF.set(origPatchi, nullptr),
+ autoPtr>
+ (
+ new calculatedFvsPatchField(origFvp, iF)
+ )
+ )
+ );
+
+ pF->origFieldPtr_() == origBf[origPatchi];
+ pF->ncFieldPtr_() == ncBf[origPatchi];
+
+ bF.set(origPatchi, pF.ptr());
+ }
+}
+
+
+template
+void Foam::conformedFvsPatchField::unconform
+(
+ typename SurfaceField::Boundary& bF
+)
+{
+ const DimensionedField& iF = bF[0].internalField();
+
+ const fvBoundaryMesh& fvbm = iF.mesh().boundary();
+
+ const labelList origPatchIDs =
+ nonConformalBoundary::New(iF.mesh()).allOrigPatchIDs();
+
+ // Extract the conformalalised orig and non-conformal boundary fields from
+ // the stored conformed patch fields
+ PtrList> origPFs(fvbm.size());
+ PtrList> ncPFs(fvbm.size());
+ forAll(origPatchIDs, i)
+ {
+ const label origPatchi = origPatchIDs[i];
+
+ conformedFvsPatchField& cpF =
+ refCast>(bF[origPatchi]);
+
+ origPFs.set(origPatchi, cpF.origFieldPtr_.ptr());
+ ncPFs.set(origPatchi, cpF.ncFieldPtr_.ptr());
+ }
+ forAll(origPFs, patchi)
+ {
+ if (origPFs.set(patchi)) continue;
+
+ origPFs.set(patchi, bF.set(patchi, nullptr));
+ ncPFs.set
+ (
+ patchi,
+ fvsPatchField::New
+ (
+ calculatedFvsPatchField::typeName,
+ fvbm[patchi],
+ iF
+ )
+ );
+ }
+ typename SurfaceField::Boundary origBf(fvbm, iF, origPFs);
+ typename SurfaceField::Boundary ncBf(fvbm, iF, ncPFs);
+
+ // Combine the conformed boundary fields to create the non-conformal
+ // boundary field
+ typename SurfaceField::Boundary result
+ (
+ iF,
+ fvMeshStitcherTools::unconformedBoundaryField(ncBf, origBf)
+ );
+ bF.transfer(result);
+}
+
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+template
+Foam::conformedFvsPatchField::conformedFvsPatchField
+(
+ const fvPatch& p,
+ const DimensionedField& iF
+)
+:
+ fvsPatchField(p, iF)
+{
+ NotImplemented;
+}
+
+
+template
+Foam::conformedFvsPatchField::conformedFvsPatchField
+(
+ const fvPatch& p,
+ const DimensionedField& iF,
+ const dictionary& dict
+)
+:
+ fvsPatchField(p, iF, dict, false),
+ origFieldPtr_
+ (
+ fvsPatchField::New(p, iF, dict.subDict("origField")).ptr()
+ ),
+ ncFieldPtr_
+ (
+ new calculatedFvsPatchField(p, iF, dict.subDict("ncField"))
+ )
+{}
+
+
+template
+Foam::conformedFvsPatchField::conformedFvsPatchField
+(
+ const conformedFvsPatchField& ptf,
+ const fvPatch& p,
+ const DimensionedField& iF,
+ const fvPatchFieldMapper& mapper
+)
+:
+ fvsPatchField(ptf, p, iF, mapper, false),
+ origFieldPtr_
+ (
+ fvsPatchField::New(ptf.origFieldPtr_(), p, iF, mapper).ptr()
+ ),
+ ncFieldPtr_
+ (
+ new calculatedFvsPatchField
+ (
+ ptf.ncFieldPtr_(),
+ p,
+ iF,
+ mapper
+ )
+ )
+{}
+
+
+template
+Foam::conformedFvsPatchField::conformedFvsPatchField
+(
+ const conformedFvsPatchField& ptf,
+ const DimensionedField& iF
+)
+:
+ fvsPatchField(ptf, iF),
+ origFieldPtr_(ptf.origFieldPtr_->clone(iF).ptr()),
+ ncFieldPtr_(new calculatedFvsPatchField(ptf.ncFieldPtr_(), iF))
+{}
+
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+template
+void Foam::conformedFvsPatchField::map
+(
+ const fvsPatchField& ptf,
+ const fvPatchFieldMapper& mapper
+)
+{
+ if (isA>(ptf))
+ {
+ const conformedFvsPatchField& cptf =
+ refCast>(ptf);
+
+ origFieldPtr_->map(cptf.origFieldPtr_(), mapper);
+ ncFieldPtr_->map(cptf.ncFieldPtr_(), mapper);
+ }
+ else
+ {
+ origFieldPtr_->reset(ptf);
+ ncFieldPtr_() == origFieldPtr_();
+ }
+}
+
+
+template
+void Foam::conformedFvsPatchField::reset(const fvsPatchField& ptf)
+{
+ if (isA>(ptf))
+ {
+ const conformedFvsPatchField& cptf =
+ refCast>(ptf);
+
+ origFieldPtr_->reset(cptf.origFieldPtr_());
+ ncFieldPtr_->reset(cptf.ncFieldPtr_());
+ }
+ else
+ {
+ origFieldPtr_->reset(ptf);
+ ncFieldPtr_() == origFieldPtr_();
+ }
+}
+
+
+template
+void Foam::conformedFvsPatchField::write(Ostream& os) const
+{
+ fvsPatchField::write(os);
+
+ writeKeyword(os, "origField") << nl;
+ os << indent << token::BEGIN_BLOCK << incrIndent << nl;
+ origFieldPtr_->write(os);
+ os << decrIndent << indent << token::END_BLOCK << nl;
+
+ writeKeyword(os, "ncField") << nl;
+ os << indent << token::BEGIN_BLOCK << incrIndent << nl;
+ ncFieldPtr_->write(os);
+ os << decrIndent << indent << token::END_BLOCK << nl;
+}
+
+
+// ************************************************************************* //
diff --git a/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/conformedFvsPatchField.H b/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/conformedFvsPatchField.H
new file mode 100644
index 0000000000..505e4df89a
--- /dev/null
+++ b/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/conformedFvsPatchField.H
@@ -0,0 +1,182 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Copyright (C) 2011-2023 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 .
+
+Class
+ Foam::conformedFvsPatchField
+
+Description
+ This surface field boundary condition holds data from both the original
+ faces and any associated non-conformal faces, with the latter mapped to the
+ conformal faces in the original patch. It is used during mesh change
+ (between the un-stitch and stitch steps) to ensure that fields relating to
+ both the original and the non-conformal patches are retained and mapped.
+
+SourceFiles
+ conformedFvsPatchField.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef conformedFvsPatchField_H
+#define conformedFvsPatchField_H
+
+#include "fvsPatchField.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+/*---------------------------------------------------------------------------*\
+ Class conformedFvsPatch Declaration
+\*---------------------------------------------------------------------------*/
+
+template
+class conformedFvsPatchField
+:
+ public fvsPatchField
+{
+ // Private Data
+
+ //- The original patch field
+ autoPtr> origFieldPtr_;
+
+ //- The associated non-conformal patch field
+ autoPtr> ncFieldPtr_;
+
+
+ // Private Constructors
+
+ //- Construct from components
+ conformedFvsPatchField
+ (
+ const fvPatch&,
+ const DimensionedField&,
+ autoPtr>&& origFieldPtr,
+ autoPtr>&& ncFieldPtr
+ );
+
+
+public:
+
+ //- Runtime type information
+ TypeName("conformed");
+
+
+ // Static Member Functions
+
+ //- Conform the given boundary field
+ static void conform(typename SurfaceField::Boundary& bF);
+
+ //- Un-conform the given boundary field
+ static void unconform(typename SurfaceField::Boundary& bF);
+
+
+ // Constructors
+
+ //- Construct from patch and internal field
+ conformedFvsPatchField
+ (
+ const fvPatch&,
+ const DimensionedField&
+ );
+
+ //- Construct from patch, internal field and dictionary
+ conformedFvsPatchField
+ (
+ const fvPatch&,
+ const DimensionedField&,
+ const dictionary&
+ );
+
+ //- Construct by mapping the given conformedFvsPatchField
+ // onto a new patch
+ conformedFvsPatchField
+ (
+ const conformedFvsPatchField&,
+ const fvPatch&,
+ const DimensionedField&,
+ const fvPatchFieldMapper&
+ );
+
+ //- Disallow copy without setting internal field reference
+ conformedFvsPatchField
+ (
+ const conformedFvsPatchField&
+ ) = delete;
+
+ //- Copy constructor setting internal field reference
+ conformedFvsPatchField
+ (
+ const conformedFvsPatchField&,
+ const DimensionedField&
+ );
+
+ //- Construct and return a clone setting internal field reference
+ virtual tmp> clone
+ (
+ const DimensionedField& iF
+ ) const
+ {
+ return tmp>
+ (
+ new conformedFvsPatchField(*this, iF)
+ );
+ }
+
+
+ // Member Functions
+
+ // Mapping functions
+
+ //- Map the given fvsPatchField onto this fvsPatchField
+ virtual void map
+ (
+ const fvsPatchField&,
+ const fvPatchFieldMapper&
+ );
+
+ //- Reset the fvsPatchField to the given fvsPatchField
+ // Used for mesh to mesh mapping
+ virtual void reset(const fvsPatchField&);
+
+
+ //- Write
+ virtual void write(Ostream&) const;
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#ifdef NoRepository
+ #include "conformedFvsPatchField.C"
+#endif
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/conformedFvsPatchFields.C b/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/conformedFvsPatchFields.C
new file mode 100644
index 0000000000..d6bdf1bf29
--- /dev/null
+++ b/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/conformedFvsPatchFields.C
@@ -0,0 +1,43 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Copyright (C) 2011-2023 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#include "conformedFvsPatchFields.H"
+#include "surfaceFields.H"
+#include "addToRunTimeSelectionTable.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+makeFvsPatchFields(conformed);
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/conformedFvsPatchFields.H b/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/conformedFvsPatchFields.H
new file mode 100644
index 0000000000..48facee1d5
--- /dev/null
+++ b/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/conformedFvsPatchFields.H
@@ -0,0 +1,49 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Copyright (C) 2011-2023 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef conformedFvsPatchFields_H
+#define conformedFvsPatchFields_H
+
+#include "conformedFvsPatchField.H"
+#include "fieldTypes.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+makeFvsPatchTypeFieldTypedefs(conformed);
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/conformedFvsPatchFieldsFwd.H b/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/conformedFvsPatchFieldsFwd.H
new file mode 100644
index 0000000000..4f5af569c9
--- /dev/null
+++ b/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/conformedFvsPatchFieldsFwd.H
@@ -0,0 +1,50 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Copyright (C) 2011-2023 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef conformedFvsPatchFieldsFwd_H
+#define conformedFvsPatchFieldsFwd_H
+
+#include "fieldTypes.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+template class conformedFvsPatchField;
+
+makeFvsPatchTypeFieldTypedefs(conformed);
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/fvMeshStitcher.C b/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/fvMeshStitcher.C
index 4a17866f98..ffb469dc4f 100644
--- a/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/fvMeshStitcher.C
+++ b/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/fvMeshStitcher.C
@@ -26,8 +26,11 @@ License
#include "fvMeshStitcher.H"
#include "globalIndex.H"
#include "fvcSurfaceIntegrate.H"
+#include "fvMeshToFvMesh.H"
#include "meshObjects.H"
#include "polyTopoChangeMap.H"
+#include "polyMeshMap.H"
+#include "polyDistributionMap.H"
#include "syncTools.H"
#include "surfaceToVolVelocity.H"
@@ -62,10 +65,6 @@ namespace Foam
}
-const Foam::word Foam::fvMeshStitcher::nccFieldPrefix_ =
- fvMeshStitcher::typeName + ":";
-
-
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::fvMeshStitcher::intersectNonConformalCyclic
@@ -1084,6 +1083,58 @@ inline void Foam::fvMeshStitcher::createNonConformalStabilisationGeometry
}
+void Foam::fvMeshStitcher::preConformSurfaceFields()
+{
+ #define PreConformSurfaceFields(Type, nullArg) \
+ preConformSurfaceFields();
+ FOR_ALL_FIELD_TYPES(PreConformSurfaceFields);
+ #undef PreConformSurfaceFields
+}
+
+
+void Foam::fvMeshStitcher::postNonConformSurfaceFields()
+{
+ #define PostNonConformSurfaceFields(Type, nullArg) \
+ postNonConformSurfaceFields();
+ FOR_ALL_FIELD_TYPES(PostNonConformSurfaceFields);
+ #undef PostNonConformSurfaceFields
+}
+
+
+void Foam::fvMeshStitcher::evaluateVolFields()
+{
+ #define EvaluateVolFields(Type, nullArg) \
+ evaluateVolFields();
+ FOR_ALL_FIELD_TYPES(EvaluateVolFields);
+ #undef EvaluateVolFields
+}
+
+
+void Foam::fvMeshStitcher::postNonConformSurfaceVelocities()
+{
+ UPtrList Ufs(mesh_.fields());
+
+ forAll(Ufs, i)
+ {
+ surfaceVectorField& Uf = Ufs[i];
+
+ const volVectorField& U = surfaceToVolVelocity(Uf);
+
+ if (!isNull(U))
+ {
+ forAll(Uf.boundaryField(), patchi)
+ {
+ if (isA(mesh_.boundary()[patchi]))
+ {
+ boundaryFieldRefNoUpdate(Uf)[patchi] ==
+ U.boundaryField()[patchi];
+ }
+ }
+ }
+ }
+}
+
+
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
bool Foam::fvMeshStitcher::geometric() const
@@ -1605,7 +1656,7 @@ void Foam::fvMeshStitcher::topoChange(const polyTopoChangeMap&)
{}
-void Foam::fvMeshStitcher::mapMesh(const polyMeshMap&)
+void Foam::fvMeshStitcher::mapMesh(const polyMeshMap& map)
{}
diff --git a/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/fvMeshStitcher.H b/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/fvMeshStitcher.H
index bd4bf9d025..6aa228f49e 100644
--- a/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/fvMeshStitcher.H
+++ b/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/fvMeshStitcher.H
@@ -38,6 +38,7 @@ SourceFiles
#define fvMeshStitcher_H
#include "fvMesh.H"
+#include "HashPtrTable.H"
#include "intersectionPatchToPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -72,18 +73,73 @@ protected:
private:
- // Private Static Data
-
- //- Prefix applied to the names of non-conformal fields which are
- // stored for mapping purposes
- static const word nccFieldPrefix_;
-
-
// Private Data
//- Non-const fvMesh reference to allow update
fvMesh& mesh_;
+ //- Cache of the surface boundary fields with non-conformal parts
+ // averaged/summed (as appropriate) into the corresponding conformal
+ // faces. Maintained between disconnect and connect so that
+ // non-conformal fields can be reconstructed again at the new time.
+ class
+ :
+ #define PrivateTypeTable(Type, nullArg) \
+ private HashPtrTable>,
+ FOR_ALL_FIELD_TYPES(PrivateTypeTable)
+ #undef PrivateTypeTable
+ private nil
+ {
+ private:
+
+ template
+ using Base = HashPtrTable>;
+
+
+ public:
+
+ template
+ const HashPtrTable>& table() const
+ {
+ return *this;
+ }
+
+ template
+ HashPtrTable>& table()
+ {
+ return *this;
+ }
+
+ template
+ bool insert
+ (
+ const word& name,
+ SurfaceFieldBoundary* fieldPtr
+ )
+ {
+ return Base::insert(name, fieldPtr);
+ }
+
+ template
+ bool found(const word& name) const
+ {
+ return Base::found(name);
+ }
+
+ template
+ tmp> remove(const word& name)
+ {
+ typename Base::iterator iter = Base::find(name);
+
+ return
+ tmp>
+ (
+ Base::remove(iter)
+ );
+ }
+
+ } conformalNccBoundaryFields_;
+
// Private Member Functions
@@ -178,21 +234,12 @@ private:
// Field Mapping
- //- Return the boundary field reference for the given field,
- // without updating the time index, storing old time fields,
- // etc...
- template
- static typename GeoField::Boundary& boundaryFieldRefNoUpdate
- (
- GeoField& fld
- );
-
//- Resize the patch fields of a given type and class to match the
- // mesh
+ // sizes of the patches in the mesh
template class GeoField>
void resizePatchFields();
- //- Resize the patch fields of a given class to match the mesh
+ //- As above, for all types
template class GeoField>
void resizePatchFields();
@@ -202,10 +249,8 @@ private:
template
void preConformSurfaceFields();
- //- Pre-conform surface fields by separating NCC and original
- // parts of non-conformal couplings and storing them in the
- // database as separate fields
- inline void preConformSurfaceFields();
+ //- As above, for all types
+ void preConformSurfaceFields();
//- Post-non-conform surface fields of a given type by looking up
// NCC and original parts of non-conformal couplings and combining
@@ -213,110 +258,31 @@ private:
template
void postNonConformSurfaceFields();
- //- Post-non-conform surface fields by looking up NCC and
- // original parts of non-conformal couplings and combining them
- // into a single non-conformal boundary field
- inline void postNonConformSurfaceFields();
+ //- As above, for all types
+ void postNonConformSurfaceFields();
//- Evaluate all non-conformal vol patch fields of a given type
template
void evaluateVolFields();
- //- Evaluate all non-conformal vol patch fields
- inline void evaluateVolFields();
+ //- As above, for all types
+ void evaluateVolFields();
//- Special post-non-conform for surface velocities
- inline void postNonConformSurfaceVelocities();
+ void postNonConformSurfaceVelocities();
protected:
// Protected Member Functions
- // Field Mapping
-
- //- Resize the patch field of a given field to match the mesh
- template
- void resizeBoundaryFieldPatchFields
- (
- const SurfaceFieldBoundary