From 7dec67e9d7fd935bebd474b2acf19fb4f68bbee8 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Thu, 16 Nov 2023 14:30:47 +0000 Subject: [PATCH] Residuals: Updated from a GeometricMeshObject to a UpdateableMeshObject so that the stack of residuals is maintained following any kind of mesh change. Resolves bug-report https://bugs.openfoam.org/view.php?id=4034 --- src/OpenFOAM/meshes/Residuals/Residuals.C | 34 +++++++++++++++++++---- src/OpenFOAM/meshes/Residuals/Residuals.H | 19 ++++++++++--- 2 files changed, 43 insertions(+), 10 deletions(-) diff --git a/src/OpenFOAM/meshes/Residuals/Residuals.C b/src/OpenFOAM/meshes/Residuals/Residuals.C index 21674d517e..20d2402d4a 100644 --- a/src/OpenFOAM/meshes/Residuals/Residuals.C +++ b/src/OpenFOAM/meshes/Residuals/Residuals.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -34,7 +34,7 @@ Foam::Residuals::Residuals(const polyMesh& mesh) DemandDrivenMeshObject < polyMesh, - GeometricMeshObject, + UpdateableMeshObject, Residuals >(mesh), prevTimeIndex_(-1) @@ -49,7 +49,7 @@ Foam::List Foam::Residuals::fieldNames(const polyMesh& mesh) return DemandDrivenMeshObject < polyMesh, - GeometricMeshObject, + UpdateableMeshObject, Residuals >::New ( @@ -64,7 +64,7 @@ bool Foam::Residuals::found(const polyMesh& mesh, const word& fieldName) return DemandDrivenMeshObject < polyMesh, - GeometricMeshObject, + UpdateableMeshObject, Residuals >::New ( @@ -84,7 +84,7 @@ Foam::Residuals::field return DemandDrivenMeshObject < polyMesh, - GeometricMeshObject, + UpdateableMeshObject, Residuals >::New ( @@ -105,7 +105,7 @@ void Foam::Residuals::append DemandDrivenMeshObject < polyMesh, - GeometricMeshObject, + UpdateableMeshObject, Residuals >::New ( @@ -142,4 +142,26 @@ void Foam::Residuals::append } +template +bool Foam::Residuals::movePoints() +{ + return true; +} + + +template +void Foam::Residuals::distribute(const polyDistributionMap&) +{} + + +template +void Foam::Residuals::topoChange(const polyTopoChangeMap&) +{} + + +template +void Foam::Residuals::mapMesh(const polyMeshMap&) +{} + + // ************************************************************************* // diff --git a/src/OpenFOAM/meshes/Residuals/Residuals.H b/src/OpenFOAM/meshes/Residuals/Residuals.H index 0dcc064d9d..752141e909 100644 --- a/src/OpenFOAM/meshes/Residuals/Residuals.H +++ b/src/OpenFOAM/meshes/Residuals/Residuals.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -55,7 +55,7 @@ class Residuals public DemandDrivenMeshObject < polyMesh, - GeometricMeshObject, + UpdateableMeshObject, Residuals >, public HashTable>> @@ -71,7 +71,7 @@ protected: friend class DemandDrivenMeshObject < polyMesh, - GeometricMeshObject, + UpdateableMeshObject, Residuals >; @@ -117,6 +117,18 @@ public: const SolverPerformance& ); + //- Update for mesh motion + virtual bool movePoints(); + + //- Redistribute or update using the given distribution map + virtual void distribute(const polyDistributionMap& map); + + //- Update topology using the given map + virtual void topoChange(const polyTopoChangeMap& map); + + //- Update from another mesh using the given map + virtual void mapMesh(const polyMeshMap& map); + // Member Operators @@ -135,7 +147,6 @@ public: #include "Residuals.C" #endif - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif