From dfd38ad3aa306a9504161730226a22cbf41d5404 Mon Sep 17 00:00:00 2001
From: mattijs <mattijs>
Date: Thu, 29 Apr 2010 18:50:20 +0100
Subject: [PATCH] ENH: Build in check for old cyclics.

---
 .../GeometricField/GeometricBoundaryField.C   | 24 +++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C
index 44f9f9ba0c6..ea652841b00 100644
--- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C
+++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C
@@ -26,6 +26,7 @@ License
 #include "emptyPolyPatch.H"
 #include "commSchedule.H"
 #include "globalMeshData.H"
+#include "cyclicPolyPatch.H"
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
@@ -251,6 +252,29 @@ GeometricBoundaryField
     {
         if (bmesh_[patchi].type() != emptyPolyPatch::typeName)
         {
+            if
+            (
+                bmesh_[patchi].type() == cyclicPolyPatch::typeName
+             && !dict.found(bmesh_[patchi].name())
+            )
+            {
+                FatalIOErrorIn
+                (
+                    "GeometricField<Type, PatchField, GeoMesh>::\n"
+                    "GeometricBoundaryField::GeometricBoundaryField\n"
+                    "(\n"
+                    "    const BoundaryMesh&,\n"
+                    "    const DimensionedField<Type, GeoMesh>&,\n"
+                    "    const dictionary&\n"
+                    ")",
+                    dict
+                )   << "Cannot find patchField entry for cyclic "
+                    << bmesh_[patchi].name() << endl
+                    << "Is your field uptodate with split cyclics?" << endl
+                    << "Run foamUpgradeCyclics to convert mesh and fields"
+                    << " to split cyclics." << exit(FatalIOError);
+            }
+
             set
             (
                 patchi,
-- 
GitLab