mapFields, mapFieldPar: Support meshes with non-conformal couplings

Resolves bug report https://bugs.openfoam.org/view.php?id=4209
This commit is contained in:
Will Bainbridge
2025-02-04 17:43:20 +00:00
parent c25313dc14
commit 3538462d50
2 changed files with 54 additions and 2 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2025 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -198,6 +198,12 @@ int main(int argc, char *argv[])
false
);
meshTarget.postConstruct
(
false,
fvMesh::stitchType::nonGeometric
);
Info<< "Target mesh size: " << meshTarget.nCells() << endl;
for (int proci=0; proci<nProcs; proci++)
@ -224,6 +230,12 @@ int main(int argc, char *argv[])
false
);
meshSource.postConstruct
(
false,
fvMesh::stitchType::nonGeometric
);
Info<< "mesh size: " << meshSource.nCells() << endl;
if (consistent)
@ -273,6 +285,12 @@ int main(int argc, char *argv[])
false
);
meshSource.postConstruct
(
false,
fvMesh::stitchType::nonGeometric
);
Info<< "Source mesh size: " << meshSource.nCells() << endl;
for (int proci=0; proci<nProcs; proci++)
@ -297,6 +315,12 @@ int main(int argc, char *argv[])
false
);
meshTarget.postConstruct
(
false,
fvMesh::stitchType::nonGeometric
);
Info<< "mesh size: " << meshTarget.nCells() << endl;
if (consistent)
@ -366,6 +390,12 @@ int main(int argc, char *argv[])
false
);
meshSource.postConstruct
(
false,
fvMesh::stitchType::nonGeometric
);
Info<< "mesh size: " << meshSource.nCells() << endl;
boundBox bbSource(meshSource.bounds());
@ -402,6 +432,12 @@ int main(int argc, char *argv[])
false
);
meshTarget.postConstruct
(
false,
fvMesh::stitchType::nonGeometric
);
Info<< "mesh size: " << meshTarget.nCells() << endl;
bbsTarget[procITarget] = meshTarget.bounds();
@ -451,6 +487,12 @@ int main(int argc, char *argv[])
false
);
meshSource.postConstruct
(
false,
fvMesh::stitchType::nonGeometric
);
fvMesh meshTarget
(
IOobject
@ -462,6 +504,12 @@ int main(int argc, char *argv[])
false
);
meshTarget.postConstruct
(
false,
fvMesh::stitchType::nonGeometric
);
Info<< "Source mesh size: " << meshSource.nCells() << tab
<< "Target mesh size: " << meshTarget.nCells() << nl << endl;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2025 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -229,6 +229,8 @@ int main(int argc, char *argv[])
false
);
srcMesh.postConstruct(false, fvMesh::stitchType::nonGeometric);
fvMesh tgtMesh
(
IOobject
@ -240,6 +242,8 @@ int main(int argc, char *argv[])
false
);
tgtMesh.postConstruct(false, fvMesh::stitchType::nonGeometric);
Info<< "Source mesh size: "
<< returnReduce(srcMesh.nCells(), sumOp<label>())
<< ", Target mesh size: "