From ffbd05f72a1d19c305ac5bd75e27134d1ab54e4d Mon Sep 17 00:00:00 2001
From: Mark Olesen <Mark.Olesen@esi-group.com>
Date: Wed, 14 Jun 2023 09:47:01 +0200
Subject: [PATCH] DOC: add deprecation notes for exprFixed/exprMixed BCs
 (#2703)

- this functionality can now be handled directly within
  uniformMixedFvPatchField etc, which are also more flexible.
---
 .../exprFixedValueFvPatchField.H              |  9 ++--
 .../exprFixedValueFvPatchFields.C             |  4 +-
 .../exprFixedValueFvPatchFields.H             | 51 -------------------
 .../fvPatchFields/exprMixedFvPatchField.C     |  4 ++
 .../fvPatchFields/exprMixedFvPatchField.H     | 16 +++---
 .../fvPatchFields/exprMixedFvPatchFields.C    |  4 +-
 .../fvPatchFields/exprMixedFvPatchFields.H    | 51 -------------------
 7 files changed, 22 insertions(+), 117 deletions(-)
 delete mode 100644 src/finiteVolume/expressions/fields/fvPatchFields/exprFixedValueFvPatchFields.H
 delete mode 100644 src/finiteVolume/expressions/fields/fvPatchFields/exprMixedFvPatchFields.H

diff --git a/src/finiteVolume/expressions/fields/fvPatchFields/exprFixedValueFvPatchField.H b/src/finiteVolume/expressions/fields/fvPatchFields/exprFixedValueFvPatchField.H
index fba2f2ed988..b4d375eefcf 100644
--- a/src/finiteVolume/expressions/fields/fvPatchFields/exprFixedValueFvPatchField.H
+++ b/src/finiteVolume/expressions/fields/fvPatchFields/exprFixedValueFvPatchField.H
@@ -37,16 +37,17 @@ Usage
     \endtable
 
 Note
-    Can also just use uniformFixedValueFvPatchField with an expression
-    for the PatchFunction1.
+    This boundary condition is deprecated in favour of
+    Foam::uniformFixedValueFvPatchField
+    with expression entries.
 
 SourceFiles
     exprFixedValueFvPatchField.C
 
 \*---------------------------------------------------------------------------*/
 
-#ifndef exprFixedValueFvPatchField_H
-#define exprFixedValueFvPatchField_H
+#ifndef FoamDeprecated_exprFixedValueFvPatchField_H
+#define FoamDeprecated_exprFixedValueFvPatchField_H
 
 #include "fixedValueFvPatchField.H"
 #include "patchExprFieldBase.H"
diff --git a/src/finiteVolume/expressions/fields/fvPatchFields/exprFixedValueFvPatchFields.C b/src/finiteVolume/expressions/fields/fvPatchFields/exprFixedValueFvPatchFields.C
index 5695a23af92..6ea6507b992 100644
--- a/src/finiteVolume/expressions/fields/fvPatchFields/exprFixedValueFvPatchFields.C
+++ b/src/finiteVolume/expressions/fields/fvPatchFields/exprFixedValueFvPatchFields.C
@@ -25,7 +25,8 @@ License
 
 \*---------------------------------------------------------------------------*/
 
-#include "exprFixedValueFvPatchFields.H"
+#include "exprFixedValueFvPatchField.H"
+#include "fieldTypes.H"
 #include "volFields.H"
 #include "addToRunTimeSelectionTable.H"
 
@@ -36,6 +37,7 @@ namespace Foam
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
+makePatchTypeFieldTypedefs(exprFixedValue);
 makePatchFields(exprFixedValue);
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/finiteVolume/expressions/fields/fvPatchFields/exprFixedValueFvPatchFields.H b/src/finiteVolume/expressions/fields/fvPatchFields/exprFixedValueFvPatchFields.H
deleted file mode 100644
index cab541738ed..00000000000
--- a/src/finiteVolume/expressions/fields/fvPatchFields/exprFixedValueFvPatchFields.H
+++ /dev/null
@@ -1,51 +0,0 @@
-/*---------------------------------------------------------------------------*\
-  =========                 |
-  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
-   \\    /   O peration     |
-    \\  /    A nd           | www.openfoam.com
-     \\/     M anipulation  |
--------------------------------------------------------------------------------
-    Copyright (C) 2019 OpenCFD Ltd.
--------------------------------------------------------------------------------
-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 <http://www.gnu.org/licenses/>.
-
-\*---------------------------------------------------------------------------*/
-
-#ifndef exprFixedValueFvPatchFields_H
-#define exprFixedValueFvPatchFields_H
-
-#include "exprFixedValueFvPatchField.H"
-#include "fieldTypes.H"
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-namespace Foam
-{
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-makePatchTypeFieldTypedefs(exprFixedValue);
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-} // End namespace Foam
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-#endif
-
-// ************************************************************************* //
diff --git a/src/finiteVolume/expressions/fields/fvPatchFields/exprMixedFvPatchField.C b/src/finiteVolume/expressions/fields/fvPatchFields/exprMixedFvPatchField.C
index acfa22fd2c3..80e4db62ba8 100644
--- a/src/finiteVolume/expressions/fields/fvPatchFields/exprMixedFvPatchField.C
+++ b/src/finiteVolume/expressions/fields/fvPatchFields/exprMixedFvPatchField.C
@@ -109,6 +109,10 @@ Foam::exprMixedFvPatchField<Type>::exprMixedFvPatchField
     ),
     driver_(this->patch(), dict_)
 {
+    DeprecatedInFunction(2212)
+        << "Use uniformMixed with Function1 expressions instead." << nl
+        << "    This boundary condition will be removed in the future" << endl;
+
     setDebug();
     DebugInFunction << nl;
 
diff --git a/src/finiteVolume/expressions/fields/fvPatchFields/exprMixedFvPatchField.H b/src/finiteVolume/expressions/fields/fvPatchFields/exprMixedFvPatchField.H
index 6d395e078fe..437d0dc4c58 100644
--- a/src/finiteVolume/expressions/fields/fvPatchFields/exprMixedFvPatchField.H
+++ b/src/finiteVolume/expressions/fields/fvPatchFields/exprMixedFvPatchField.H
@@ -38,21 +38,19 @@ Usage
     \endtable
 
 Note
-    For fixed-value boundary conditions, can also just use
-    uniformFixedValueFvPatchField with an expression for the
-    PatchFunction1, or a exprMixedFvPatchField.
-
-    For gradient boundary conditions, can also just use
-    uniformFixedGradientFvPatchField with an expression for the
-    PatchFunction1.
+    This boundary condition is deprecated in favour of
+    Foam::uniformMixedFvPatchField,
+    Foam::uniformFixedValueFvPatchField,
+    Foam::uniformFixedGradientFvPatchField
+    with expression entries.
 
 SourceFiles
     exprMixedFvPatchField.C
 
 \*---------------------------------------------------------------------------*/
 
-#ifndef exprMixedFvPatchField_H
-#define exprMixedFvPatchField_H
+#ifndef FoamDeprecated_exprMixedFvPatchField_H
+#define FoamDeprecated_exprMixedFvPatchField_H
 
 #include "mixedFvPatchField.H"
 #include "patchExprFieldBase.H"
diff --git a/src/finiteVolume/expressions/fields/fvPatchFields/exprMixedFvPatchFields.C b/src/finiteVolume/expressions/fields/fvPatchFields/exprMixedFvPatchFields.C
index 730fee6baa9..de7626578ac 100644
--- a/src/finiteVolume/expressions/fields/fvPatchFields/exprMixedFvPatchFields.C
+++ b/src/finiteVolume/expressions/fields/fvPatchFields/exprMixedFvPatchFields.C
@@ -25,7 +25,8 @@ License
 
 \*---------------------------------------------------------------------------*/
 
-#include "exprMixedFvPatchFields.H"
+#include "exprMixedFvPatchField.H"
+#include "fieldTypes.H"
 #include "volFields.H"
 #include "addToRunTimeSelectionTable.H"
 
@@ -36,6 +37,7 @@ namespace Foam
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
+makePatchTypeFieldTypedefs(exprMixed);
 makePatchFields(exprMixed);
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/finiteVolume/expressions/fields/fvPatchFields/exprMixedFvPatchFields.H b/src/finiteVolume/expressions/fields/fvPatchFields/exprMixedFvPatchFields.H
deleted file mode 100644
index 40531f0295a..00000000000
--- a/src/finiteVolume/expressions/fields/fvPatchFields/exprMixedFvPatchFields.H
+++ /dev/null
@@ -1,51 +0,0 @@
-/*---------------------------------------------------------------------------*\
-  =========                 |
-  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
-   \\    /   O peration     |
-    \\  /    A nd           | www.openfoam.com
-     \\/     M anipulation  |
--------------------------------------------------------------------------------
-    Copyright (C) 2019 OpenCFD Ltd.
--------------------------------------------------------------------------------
-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 <http://www.gnu.org/licenses/>.
-
-\*---------------------------------------------------------------------------*/
-
-#ifndef exprMixedFvPatchFields_H
-#define exprMixedFvPatchFields_H
-
-#include "exprMixedFvPatchField.H"
-#include "fieldTypes.H"
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-namespace Foam
-{
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-makePatchTypeFieldTypedefs(exprMixed);
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-} // End namespace Foam
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-#endif
-
-// ************************************************************************* //
-- 
GitLab