From 411057424db0fb63b25fd26bc98273c28f6f3925 Mon Sep 17 00:00:00 2001 From: mattijs <mattijs> Date: Fri, 31 Jan 2025 16:52:43 +0000 Subject: [PATCH 1/2] ENH: assignable: extend to pointPatchFields and fvsPatchFields --- .../basic/fixedValue/fixedValuePointPatchField.H | 3 +++ .../pointPatchFields/basic/value/valuePointPatchField.H | 9 +++++++++ .../pointPatchFields/pointPatchField/pointPatchField.H | 6 ++++++ .../basic/fixedValue/fixedValueFvsPatchField.H | 3 +++ .../fvsPatchFields/basic/sliced/slicedFvsPatchField.H | 3 +++ .../fields/fvsPatchFields/fvsPatchField/fvsPatchField.H | 6 ++++++ 6 files changed, 30 insertions(+) diff --git a/src/OpenFOAM/fields/pointPatchFields/basic/fixedValue/fixedValuePointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/basic/fixedValue/fixedValuePointPatchField.H index e8f269edbba..ccd933ceabd 100644 --- a/src/OpenFOAM/fields/pointPatchFields/basic/fixedValue/fixedValuePointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/basic/fixedValue/fixedValuePointPatchField.H @@ -138,6 +138,9 @@ public: // Member Functions + //- True if the value of the patch field is altered by assignment + virtual bool assignable() const { return false; } + //- True: this patch field fixes a value. virtual bool fixesValue() const { return true; } diff --git a/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.H index 4a71dd37665..abc38185294 100644 --- a/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.H @@ -167,6 +167,15 @@ public: // Member Functions + // Attributes + + //- True if the value of the patch field is altered by assignment + virtual bool assignable() const + { + return true; + } + + // Access //- Return size diff --git a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.H index c2a47ce4125..fa064ba77e8 100644 --- a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.H @@ -165,6 +165,12 @@ public: // Attributes + //- True if the value of the patch field is altered by assignment + virtual bool assignable() const + { + return false; + } + //- True if the patch field fixes a value virtual bool fixesValue() const { diff --git a/src/finiteVolume/fields/fvsPatchFields/basic/fixedValue/fixedValueFvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/basic/fixedValue/fixedValueFvsPatchField.H index 600abc3ba6c..256a53ad48d 100644 --- a/src/finiteVolume/fields/fvsPatchFields/basic/fixedValue/fixedValueFvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/basic/fixedValue/fixedValueFvsPatchField.H @@ -144,6 +144,9 @@ public: // Member Functions + //- True if the value of the patch field is altered by assignment + virtual bool assignable() const { return false; } + //- True: this patch field fixes a value. virtual bool fixesValue() const { return true; } diff --git a/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchField.H index 809d4e0db33..777651d908a 100644 --- a/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchField.H @@ -140,6 +140,9 @@ public: // Member Functions + //- True if the value of the patch field is altered by assignment + virtual bool assignable() const { return false; } + //- True: this patch field fixes a value. virtual bool fixesValue() const { return true; } diff --git a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.H index 63cc9f794c9..65f170e7d5d 100644 --- a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.H @@ -145,6 +145,12 @@ public: // Attributes + //- True if the value of the patch field is altered by assignment + virtual bool assignable() const + { + return true; + } + //- True if the patch field fixes a value. // Needed to check if a level has to be specified while solving // Poissons equations. -- GitLab From aec6805e91166851864226f5917035c6627878df Mon Sep 17 00:00:00 2001 From: mattijs <mattijs> Date: Wed, 5 Feb 2025 10:26:47 +0000 Subject: [PATCH 2/2] COMMENT: changed for concrete patch fields --- .../basic/fixedValue/fixedValuePointPatchField.H | 6 +++--- .../pointPatchFields/basic/value/valuePointPatchField.H | 2 +- .../basic/fixedValue/fixedValueFvsPatchField.H | 6 +++--- .../fvsPatchFields/basic/sliced/slicedFvsPatchField.H | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/OpenFOAM/fields/pointPatchFields/basic/fixedValue/fixedValuePointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/basic/fixedValue/fixedValuePointPatchField.H index ccd933ceabd..1e30f2a63d5 100644 --- a/src/OpenFOAM/fields/pointPatchFields/basic/fixedValue/fixedValuePointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/basic/fixedValue/fixedValuePointPatchField.H @@ -138,12 +138,12 @@ public: // Member Functions - //- True if the value of the patch field is altered by assignment - virtual bool assignable() const { return false; } - //- True: this patch field fixes a value. virtual bool fixesValue() const { return true; } + //- False: this patch field is not altered by assignment. + virtual bool assignable() const { return false; } + // Member Operators diff --git a/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.H index abc38185294..bcbb710f85c 100644 --- a/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.H @@ -169,7 +169,7 @@ public: // Attributes - //- True if the value of the patch field is altered by assignment + //- True: this patch field is altered by assignment by default. virtual bool assignable() const { return true; diff --git a/src/finiteVolume/fields/fvsPatchFields/basic/fixedValue/fixedValueFvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/basic/fixedValue/fixedValueFvsPatchField.H index 256a53ad48d..300caa3b112 100644 --- a/src/finiteVolume/fields/fvsPatchFields/basic/fixedValue/fixedValueFvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/basic/fixedValue/fixedValueFvsPatchField.H @@ -144,12 +144,12 @@ public: // Member Functions - //- True if the value of the patch field is altered by assignment - virtual bool assignable() const { return false; } - //- True: this patch field fixes a value. virtual bool fixesValue() const { return true; } + //- False: this patch field is not altered by assignment. + virtual bool assignable() const { return false; } + //- Write includes "value" entry virtual void write(Ostream&) const; diff --git a/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchField.H index 777651d908a..5354a8f8c29 100644 --- a/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchField.H @@ -140,12 +140,12 @@ public: // Member Functions - //- True if the value of the patch field is altered by assignment - virtual bool assignable() const { return false; } - //- True: this patch field fixes a value. virtual bool fixesValue() const { return true; } + //- False: this patch field is not altered by assignment. + virtual bool assignable() const { return false; } + //- Write includes "value" entry virtual void write(Ostream&) const; -- GitLab