From 88d0192129285003edba38a60b06d62fb9821cc0 Mon Sep 17 00:00:00 2001 From: mattijs <mattijs> Date: Fri, 9 Mar 2012 09:11:29 +0000 Subject: [PATCH] STYLE: mixedPointPatchField: nonsense bc since patchInternalField == patch field --- src/OpenFOAM/Make/files | 1 - .../basic/mixed/mixedPointPatchField.C | 178 --------------- .../basic/mixed/mixedPointPatchField.H | 208 ------------------ .../basic/mixed/mixedPointPatchFields.C | 43 ---- .../basic/mixed/mixedPointPatchFields.H | 49 ----- 5 files changed, 479 deletions(-) delete mode 100644 src/OpenFOAM/fields/pointPatchFields/basic/mixed/mixedPointPatchField.C delete mode 100644 src/OpenFOAM/fields/pointPatchFields/basic/mixed/mixedPointPatchField.H delete mode 100644 src/OpenFOAM/fields/pointPatchFields/basic/mixed/mixedPointPatchFields.C delete mode 100644 src/OpenFOAM/fields/pointPatchFields/basic/mixed/mixedPointPatchFields.H diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index 4e138824b60..b08260f813c 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -548,7 +548,6 @@ $(basicPointPatchFields)/coupled/coupledPointPatchFields.C $(basicPointPatchFields)/value/valuePointPatchFields.C $(basicPointPatchFields)/fixedValue/fixedValuePointPatchFields.C $(basicPointPatchFields)/zeroGradient/zeroGradientPointPatchFields.C -$(basicPointPatchFields)/mixed/mixedPointPatchFields.C constraintPointPatchFields = $(pointPatchFields)/constraint $(constraintPointPatchFields)/cyclic/cyclicPointPatchFields.C diff --git a/src/OpenFOAM/fields/pointPatchFields/basic/mixed/mixedPointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/basic/mixed/mixedPointPatchField.C deleted file mode 100644 index 5deff120546..00000000000 --- a/src/OpenFOAM/fields/pointPatchFields/basic/mixed/mixedPointPatchField.C +++ /dev/null @@ -1,178 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -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/>. - -\*---------------------------------------------------------------------------*/ - -#include "mixedPointPatchField.H" -#include "pointPatchFieldMapper.H" - - -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - -template<class Type> -void Foam::mixedPointPatchField<Type>::checkFieldSize() const -{ - if - ( - this->size() != this->patch().size() - || refValue_.size() != this->patch().size() - || valueFraction_.size() != this->patch().size() - ) - { - FatalErrorIn - ( - "void mixedPointPatchField<Type>::checkField() const" - ) << "field does not correspond to patch. " << endl - << "Field size: " << this->size() << " value size: " - << refValue_.size() - << " valueFraction size: " << valueFraction_.size() - << " patch size: " << this->patch().size() - << abort(FatalError); - } -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template<class Type> -Foam::mixedPointPatchField<Type>::mixedPointPatchField -( - const pointPatch& p, - const DimensionedField<Type, pointMesh>& iF -) -: - valuePointPatchField<Type>(p, iF), - refValue_(p.size()), - valueFraction_(p.size()) -{} - - -template<class Type> -Foam::mixedPointPatchField<Type>::mixedPointPatchField -( - const pointPatch& p, - const DimensionedField<Type, pointMesh>& iF, - const dictionary& dict -) -: - valuePointPatchField<Type>(p, iF, dict, false), - refValue_("refValue", dict, p.size()), - valueFraction_("valueFraction", dict, p.size()) -{} - - -template<class Type> -Foam::mixedPointPatchField<Type>::mixedPointPatchField -( - const mixedPointPatchField<Type>& ptf, - const pointPatch& p, - const DimensionedField<Type, pointMesh>& iF, - const pointPatchFieldMapper& mapper -) -: - valuePointPatchField<Type> - ( - ptf, - p, - iF, - mapper - ), - refValue_(ptf.refValue_, mapper), - valueFraction_(ptf.valueFraction_, mapper) - -{} - - -template<class Type> -Foam::mixedPointPatchField<Type>::mixedPointPatchField -( - const mixedPointPatchField<Type>& ptf, - const DimensionedField<Type, pointMesh>& iF -) -: - valuePointPatchField<Type>(ptf, iF), - refValue_(ptf.refValue_), - valueFraction_(ptf.valueFraction_) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -// Map and resize from self given a mapper -template<class Type> -void Foam::mixedPointPatchField<Type>::autoMap -( - const pointPatchFieldMapper& m -) -{ - Field<Type>::autoMap(m); - refValue_.autoMap(m); - valueFraction_.autoMap(m); -} - - -// Grab the values using rmap -template<class Type> -void Foam::mixedPointPatchField<Type>::rmap -( - const pointPatchField<Type>& ptf, - const labelList& addr -) -{ - const mixedPointPatchField<Type>& mptf = - refCast<const mixedPointPatchField<Type> >(ptf); - - Field<Type>::rmap(mptf, addr); - refValue_.rmap(mptf.refValue_, addr); - valueFraction_.rmap(mptf.valueFraction_, addr); -} - - -// Evaluate patch field -template<class Type> -void Foam::mixedPointPatchField<Type>::evaluate(const Pstream::commsTypes) -{ - Field<Type>::operator= - ( - valueFraction_*refValue_ - + (1.0 - valueFraction_)*this->patchInternalField() - ); - - // Get internal field to insert values into - Field<Type>& iF = const_cast<Field<Type>&>(this->internalField()); - - this->setInInternalField(iF, *this); -} - - -// Write -template<class Type> -void Foam::mixedPointPatchField<Type>::write(Ostream& os) const -{ - pointPatchField<Type>::write(os); - refValue_.writeEntry("refValue", os); - valueFraction_.writeEntry("valueFraction", os); -} - - -// ************************************************************************* // diff --git a/src/OpenFOAM/fields/pointPatchFields/basic/mixed/mixedPointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/basic/mixed/mixedPointPatchField.H deleted file mode 100644 index 1c997eb90dd..00000000000 --- a/src/OpenFOAM/fields/pointPatchFields/basic/mixed/mixedPointPatchField.H +++ /dev/null @@ -1,208 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -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/>. - -Class - Foam::mixedPointPatchField - -Description - A mixed FixedValue / ZeroGradient boundary condition for pointField. - - I am still not sure how to do the FixedValue-fixedGradient combination. - -SourceFiles - mixedPointPatchField.C - -\*---------------------------------------------------------------------------*/ - -#ifndef mixedPointPatchField_H -#define mixedPointPatchField_H - -#include "valuePointPatchField.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class mixedPointPatchField Declaration -\*---------------------------------------------------------------------------*/ - -template<class Type> -class mixedPointPatchField -: - public valuePointPatchField<Type> -{ - // Private data - - //- Value field - Field<Type> refValue_; - - //- Fraction (0-1) of value used for boundary condition - scalarField valueFraction_; - - - // Private Member Functions - - void checkFieldSize() const; - - -public: - - //- Runtime type information - TypeName("mixed"); - - - // Constructors - - //- Construct from patch and internal field - mixedPointPatchField - ( - const pointPatch&, - const DimensionedField<Type, pointMesh>& - ); - - //- Construct from patch, internal field and dictionary - mixedPointPatchField - ( - const pointPatch&, - const DimensionedField<Type, pointMesh>&, - const dictionary& - ); - - //- Construct by mapping given patchField<Type> onto a new patch - mixedPointPatchField - ( - const mixedPointPatchField<Type>&, - const pointPatch&, - const DimensionedField<Type, pointMesh>&, - const pointPatchFieldMapper& - ); - - //- Construct and return a clone - virtual autoPtr<pointPatchField<Type> > clone() const - { - return autoPtr<pointPatchField<Type> > - ( - new mixedPointPatchField<Type> - ( - *this - ) - ); - } - - //- Construct as copy setting internal field reference - mixedPointPatchField - ( - const mixedPointPatchField<Type>&, - const DimensionedField<Type, pointMesh>& - ); - - //- Construct and return a clone setting internal field reference - virtual autoPtr<pointPatchField<Type> > clone - ( - const DimensionedField<Type, pointMesh>& iF - ) const - { - return autoPtr<pointPatchField<Type> > - ( - new mixedPointPatchField<Type> - ( - *this, - iF - ) - ); - } - - - // Member functions - - // Return defining fields - - virtual Field<Type>& refValue() - { - return refValue_; - } - - virtual const Field<Type>& refValue() const - { - return refValue_; - } - - virtual scalarField& valueFraction() - { - return valueFraction_; - } - - virtual const scalarField& valueFraction() const - { - return valueFraction_; - } - - - // Mapping functions - - //- Map (and resize as needed) from self given a mapping object - virtual void autoMap - ( - const pointPatchFieldMapper& - ); - - //- Reverse map the given PointPatchField onto - // this PointPatchField - virtual void rmap - ( - const pointPatchField<Type>&, - const labelList& - ); - - - // Evaluation functions - - //- Update the patch field - virtual void evaluate - ( - const Pstream::commsTypes commsType=Pstream::blocking - ); - - - //- Write - virtual void write(Ostream&) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository -# include "mixedPointPatchField.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/OpenFOAM/fields/pointPatchFields/basic/mixed/mixedPointPatchFields.C b/src/OpenFOAM/fields/pointPatchFields/basic/mixed/mixedPointPatchFields.C deleted file mode 100644 index 377e147ac72..00000000000 --- a/src/OpenFOAM/fields/pointPatchFields/basic/mixed/mixedPointPatchFields.C +++ /dev/null @@ -1,43 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -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/>. - -\*---------------------------------------------------------------------------*/ - -#include "mixedPointPatchFields.H" -#include "pointPatchFields.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -makePointPatchFields(mixed); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/OpenFOAM/fields/pointPatchFields/basic/mixed/mixedPointPatchFields.H b/src/OpenFOAM/fields/pointPatchFields/basic/mixed/mixedPointPatchFields.H deleted file mode 100644 index 245f4f7763d..00000000000 --- a/src/OpenFOAM/fields/pointPatchFields/basic/mixed/mixedPointPatchFields.H +++ /dev/null @@ -1,49 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -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 mixedPointPatchFields_H -#define mixedPointPatchFields_H - -#include "mixedPointPatchField.H" -#include "fieldTypes.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -makePointPatchFieldTypedefs(mixed); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // -- GitLab