fvMeshTopoChangers::meshToMesh: Added support for changes in decomposition between meshes

If the sequence of meshes are decomposed independently the number, order and
potentially type of processor patches is likely to change.  Thus the processor
patches and patch fields must be replaced with those of the new mesh.
This commit is contained in:
Henry Weller
2022-07-10 16:06:17 +01:00
parent c70a7b83d6
commit f0e693176d
165 changed files with 1948 additions and 233 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-2021 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -30,6 +30,7 @@ License
#include "mergePoints.H"
#include "indirectPrimitivePatch.H"
#include "PatchTools.H"
#include "polyTopoChangeMap.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -655,6 +656,7 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::surfaceFieldValue
)
:
fieldValue(name, runTime, dict, typeName),
dict_(dict),
surfaceWriterPtr_(nullptr),
regionType_(regionTypeNames_.read(dict.lookup("regionType"))),
operation_(operationTypeNames_.read(dict.lookup("operation"))),
@ -666,7 +668,7 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::surfaceFieldValue
facePatchId_(),
faceSign_()
{
read(dict);
read(dict_);
}
Foam::functionObjects::fieldValues::surfaceFieldValue::surfaceFieldValue
@ -677,6 +679,7 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::surfaceFieldValue
)
:
fieldValue(name, obr, dict, typeName),
dict_(dict),
surfaceWriterPtr_(nullptr),
regionType_(regionTypeNames_.read(dict.lookup("regionType"))),
operation_(operationTypeNames_.read(dict.lookup("operation"))),
@ -688,7 +691,7 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::surfaceFieldValue
facePatchId_(),
faceSign_()
{
read(dict);
read(dict_);
}
@ -824,4 +827,32 @@ bool Foam::functionObjects::fieldValues::surfaceFieldValue::write()
}
void Foam::functionObjects::fieldValues::surfaceFieldValue::movePoints
(
const polyMesh& mesh
)
{
// Moving mesh might affect patch or region area
totalArea_ = totalArea();
}
void Foam::functionObjects::fieldValues::surfaceFieldValue::topoChange
(
const polyTopoChangeMap& map
)
{
initialise(dict_);
}
void Foam::functionObjects::fieldValues::surfaceFieldValue::mapMesh
(
const polyMeshMap& map
)
{
initialise(dict_);
}
// ************************************************************************* //

View File

@ -259,6 +259,9 @@ protected:
// Protected data
//- Input dictionary
dictionary dict_;
//- Surface writer
autoPtr<surfaceWriter> surfaceWriterPtr_;
@ -486,6 +489,15 @@ public:
//- Calculate and write
virtual bool write();
//- Update for mesh point-motion
virtual void movePoints(const polyMesh&);
//- Update topology using the given map
virtual void topoChange(const polyTopoChangeMap&);
//- Update from another mesh using the given map
virtual void mapMesh(const polyMeshMap&);
};