ENH: extend type aliases to include geometric boundary fields (#2348)

STYLE: LduInterfaceFieldPtrsList as alias instead of a class

STYLE: define patch lists typedefs when defining the base patch

- eg, polyPatchList typedef within polyPatch.H

INT: relocate GeometricField::Boundary -> GeometricBoundaryField

- was internal to GeometricField but moving it outside simplifies
  forward declarations etc. Code adapted from openfoam.org
This commit is contained in:
Mark Olesen
2022-03-25 19:26:25 +01:00
parent 39064f65e9
commit e98acdc4fc
58 changed files with 666 additions and 722 deletions

View File

@ -419,7 +419,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
nInterProcPatches += curSubPatchIDs[procPatchi].size();
}
PtrList<polyPatch> procPatches
polyPatchList procPatches
(
curPatchSizes.size() + nInterProcPatches
);

View File

@ -129,8 +129,7 @@ Foam::parFvFieldReconstructor::reconstructFvVolumeField
PtrList<fvPatchField<Type>> patchFields(fld.mesh().boundary().size());
const typename GeometricField<Type, fvPatchField, volMesh>::Boundary&
bfld = fld.boundaryField();
const auto& bfld = fld.boundaryField();
forAll(bfld, patchI)
{
@ -293,8 +292,7 @@ Foam::parFvFieldReconstructor::reconstructFvSurfaceField
PtrList<fvsPatchField<Type>> patchFields(fld.mesh().boundary().size());
const typename GeometricField<Type, fvsPatchField, surfaceMesh>::Boundary&
bfld = fld.boundaryField();
const auto& bfld = fld.boundaryField();
forAll(bfld, patchI)
{

View File

@ -0,0 +1,101 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2022 OpenFOAM Foundation
Copyright (C) 2022 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/>.
Class
Foam::SlicedDimensionedField
Description
Specialisation of DimensionedField that holds a slice of a given
field so that it acts as a DimensionedField.
\*---------------------------------------------------------------------------*/
#ifndef Foam_SlicedDimensionedField_H
#define Foam_SlicedDimensionedField_H
#include "DimensionedField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class SlicedDimensionedField Declaration
\*---------------------------------------------------------------------------*/
template<class Type, class GeoMesh>
class SlicedDimensionedField
:
public DimensionedField<Type, GeoMesh>
{
public:
// Public Typedefs
//- Type of mesh on which this SlicedDimensionedField is instantiated
typedef typename GeoMesh::Mesh Mesh;
// Constructors
//- Construct from components and field to slice
SlicedDimensionedField
(
const IOobject& io,
const Mesh& mesh,
const dimensionSet& ds,
const Field<Type>& iField
)
:
DimensionedField<Type, GeoMesh>(io, mesh, ds, Field<Type>())
{
// Set internalField to the slice of the complete field
UList<Type>::shallowCopy
(
SubList<Type>(iField, GeoMesh::size(mesh))
);
}
//- Destructor
~SlicedDimensionedField()
{
// Set internalField to nullptr to avoid deletion of underlying field
UList<Type>::shallowCopy(UList<Type>());
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -5,8 +5,8 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2016-2020 OpenCFD Ltd.
Copyright (C) 2011-2017,2022 OpenFOAM Foundation
Copyright (C) 2016-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -26,23 +26,29 @@ License
\*---------------------------------------------------------------------------*/
#include "emptyPolyPatch.H"
#include "GeometricBoundaryField.H"
#include "globalMeshData.H"
#include "cyclicPolyPatch.H"
#include "emptyPolyPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type, template<class> class PatchField, class GeoMesh>
void Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::readField
void Foam::GeometricBoundaryField<Type, PatchField, GeoMesh>::readField
(
const DimensionedField<Type, GeoMesh>& field,
const dictionary& dict
)
{
DebugInFunction << nl;
///if (GeometricField<Type, PatchField, GeoMesh::debug)
///{
/// InfoInFunction << nl;
///}
// Clear the boundary field if already initialised
this->clear();
this->setSize(bmesh_.size());
this->resize(bmesh_.size());
label nUnset = this->size();
@ -180,7 +186,7 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::readField
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type, template<class> class PatchField, class GeoMesh>
Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::Boundary
Foam::GeometricBoundaryField<Type, PatchField, GeoMesh>::GeometricBoundaryField
(
const BoundaryMesh& bmesh
)
@ -191,7 +197,7 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::Boundary
template<class Type, template<class> class PatchField, class GeoMesh>
Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::Boundary
Foam::GeometricBoundaryField<Type, PatchField, GeoMesh>::GeometricBoundaryField
(
const BoundaryMesh& bmesh,
const DimensionedField<Type, GeoMesh>& field,
@ -201,7 +207,10 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::Boundary
FieldField<PatchField, Type>(bmesh.size()),
bmesh_(bmesh)
{
DebugInFunction << nl;
///if (GeometricField<Type, PatchField, GeoMesh::debug)
///{
/// InfoInFunction << nl;
///}
forAll(bmesh_, patchi)
{
@ -220,7 +229,7 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::Boundary
template<class Type, template<class> class PatchField, class GeoMesh>
Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::Boundary
Foam::GeometricBoundaryField<Type, PatchField, GeoMesh>::GeometricBoundaryField
(
const BoundaryMesh& bmesh,
const DimensionedField<Type, GeoMesh>& field,
@ -231,7 +240,10 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::Boundary
FieldField<PatchField, Type>(bmesh.size()),
bmesh_(bmesh)
{
DebugInFunction << nl;
///if (GeometricField<Type, PatchField, GeoMesh::debug)
///{
/// InfoInFunction << nl;
///}
if
(
@ -284,7 +296,7 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::Boundary
template<class Type, template<class> class PatchField, class GeoMesh>
Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::Boundary
Foam::GeometricBoundaryField<Type, PatchField, GeoMesh>::GeometricBoundaryField
(
const BoundaryMesh& bmesh,
const DimensionedField<Type, GeoMesh>& field,
@ -294,7 +306,10 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::Boundary
FieldField<PatchField, Type>(bmesh.size()),
bmesh_(bmesh)
{
DebugInFunction << nl;
///if (GeometricField<Type, PatchField, GeoMesh::debug)
///{
/// InfoInFunction << nl;
///}
forAll(bmesh_, patchi)
{
@ -304,16 +319,19 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::Boundary
template<class Type, template<class> class PatchField, class GeoMesh>
Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::Boundary
Foam::GeometricBoundaryField<Type, PatchField, GeoMesh>::GeometricBoundaryField
(
const DimensionedField<Type, GeoMesh>& field,
const typename GeometricField<Type, PatchField, GeoMesh>::Boundary& btf
const GeometricBoundaryField<Type, PatchField, GeoMesh>& btf
)
:
FieldField<PatchField, Type>(btf.size()),
bmesh_(btf.bmesh_)
{
DebugInFunction << nl;
///if (GeometricField<Type, PatchField, GeoMesh::debug)
///{
/// InfoInFunction << nl;
///}
forAll(bmesh_, patchi)
{
@ -323,10 +341,10 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::Boundary
template<class Type, template<class> class PatchField, class GeoMesh>
Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::Boundary
Foam::GeometricBoundaryField<Type, PatchField, GeoMesh>::GeometricBoundaryField
(
const DimensionedField<Type, GeoMesh>& field,
const typename GeometricField<Type, PatchField, GeoMesh>::Boundary& btf,
const GeometricBoundaryField<Type, PatchField, GeoMesh>& btf,
const labelList& patchIDs,
const word& patchFieldType
)
@ -334,7 +352,10 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::Boundary
FieldField<PatchField, Type>(btf.size()),
bmesh_(btf.bmesh_)
{
DebugInFunction << nl;
///if (GeometricField<Type, PatchField, GeoMesh::debug)
///{
/// InfoInFunction << nl;
///}
for (const label patchi : patchIDs)
{
@ -361,20 +382,23 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::Boundary
template<class Type, template<class> class PatchField, class GeoMesh>
Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::Boundary
Foam::GeometricBoundaryField<Type, PatchField, GeoMesh>::GeometricBoundaryField
(
const typename GeometricField<Type, PatchField, GeoMesh>::Boundary& btf
const GeometricBoundaryField<Type, PatchField, GeoMesh>& btf
)
:
FieldField<PatchField, Type>(btf),
bmesh_(btf.bmesh_)
{
DebugInFunction << nl;
///if (GeometricField<Type, PatchField, GeoMesh::debug)
///{
/// InfoInFunction << nl;
///}
}
template<class Type, template<class> class PatchField, class GeoMesh>
Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::Boundary
Foam::GeometricBoundaryField<Type, PatchField, GeoMesh>::GeometricBoundaryField
(
const BoundaryMesh& bmesh,
const DimensionedField<Type, GeoMesh>& field,
@ -391,9 +415,12 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::Boundary
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type, template<class> class PatchField, class GeoMesh>
void Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::updateCoeffs()
void Foam::GeometricBoundaryField<Type, PatchField, GeoMesh>::updateCoeffs()
{
DebugInFunction << nl;
///if (GeometricField<Type, PatchField, GeoMesh::debug)
///{
/// InfoInFunction << nl;
///}
forAll(*this, patchi)
{
@ -403,9 +430,12 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::updateCoeffs()
template<class Type, template<class> class PatchField, class GeoMesh>
void Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::evaluate()
void Foam::GeometricBoundaryField<Type, PatchField, GeoMesh>::evaluate()
{
DebugInFunction << nl;
///if (GeometricField<Type, PatchField, GeoMesh::debug)
///{
/// InfoInFunction << nl;
///}
if
(
@ -468,7 +498,7 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::evaluate()
template<class Type, template<class> class PatchField, class GeoMesh>
Foam::wordList
Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::types() const
Foam::GeometricBoundaryField<Type, PatchField, GeoMesh>::types() const
{
const FieldField<PatchField, Type>& pff = *this;
@ -484,32 +514,30 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::types() const
template<class Type, template<class> class PatchField, class GeoMesh>
typename Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary
Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::
Foam::GeometricBoundaryField<Type, PatchField, GeoMesh>
Foam::GeometricBoundaryField<Type, PatchField, GeoMesh>::
boundaryInternalField() const
{
typename GeometricField<Type, PatchField, GeoMesh>::Boundary
BoundaryInternalField(*this);
GeometricBoundaryField<Type, PatchField, GeoMesh> result(*this);
forAll(BoundaryInternalField, patchi)
forAll(result, patchi)
{
BoundaryInternalField[patchi] ==
this->operator[](patchi).patchInternalField();
result[patchi] == this->operator[](patchi).patchInternalField();
}
return BoundaryInternalField;
return result;
}
template<class Type, template<class> class PatchField, class GeoMesh>
Foam::LduInterfaceFieldPtrsList<Type>
Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::interfaces() const
Foam::GeometricBoundaryField<Type, PatchField, GeoMesh>::interfaces() const
{
LduInterfaceFieldPtrsList<Type> list(this->size());
forAll(list, patchi)
{
const LduInterfaceField<Type>* lduPtr =
const auto* lduPtr =
isA<LduInterfaceField<Type>>(this->operator[](patchi));
if (lduPtr)
@ -524,14 +552,14 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::interfaces() const
template<class Type, template<class> class PatchField, class GeoMesh>
Foam::lduInterfaceFieldPtrsList
Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::
Foam::GeometricBoundaryField<Type, PatchField, GeoMesh>::
scalarInterfaces() const
{
lduInterfaceFieldPtrsList list(this->size());
forAll(list, patchi)
{
const lduInterfaceField* lduPtr =
const auto* lduPtr =
isA<lduInterfaceField>(this->operator[](patchi));
if (lduPtr)
@ -545,7 +573,7 @@ scalarInterfaces() const
template<class Type, template<class> class PatchField, class GeoMesh>
void Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::writeEntry
void Foam::GeometricBoundaryField<Type, PatchField, GeoMesh>::writeEntry
(
const word& keyword,
Ostream& os
@ -560,7 +588,7 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::writeEntry
template<class Type, template<class> class PatchField, class GeoMesh>
void Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::writeEntries
void Foam::GeometricBoundaryField<Type, PatchField, GeoMesh>::writeEntries
(
Ostream& os
) const
@ -577,10 +605,9 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::writeEntries
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class Type, template<class> class PatchField, class GeoMesh>
void Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::operator=
void Foam::GeometricBoundaryField<Type, PatchField, GeoMesh>::operator=
(
const typename GeometricField<Type, PatchField, GeoMesh>::
Boundary& bf
const GeometricBoundaryField<Type, PatchField, GeoMesh>& bf
)
{
FieldField<PatchField, Type>::operator=(bf);
@ -588,30 +615,29 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::operator=
template<class Type, template<class> class PatchField, class GeoMesh>
void Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::operator=
void Foam::GeometricBoundaryField<Type, PatchField, GeoMesh>::operator=
(
const FieldField<PatchField, Type>& ptff
const FieldField<PatchField, Type>& bf
)
{
FieldField<PatchField, Type>::operator=(ptff);
FieldField<PatchField, Type>::operator=(bf);
}
template<class Type, template<class> class PatchField, class GeoMesh>
void Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::operator=
void Foam::GeometricBoundaryField<Type, PatchField, GeoMesh>::operator=
(
const Type& t
const Type& val
)
{
FieldField<PatchField, Type>::operator=(t);
FieldField<PatchField, Type>::operator=(val);
}
template<class Type, template<class> class PatchField, class GeoMesh>
void Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::operator==
void Foam::GeometricBoundaryField<Type, PatchField, GeoMesh>::operator==
(
const typename GeometricField<Type, PatchField, GeoMesh>::
Boundary& bf
const GeometricBoundaryField<Type, PatchField, GeoMesh>& bf
)
{
forAll(*this, patchi)
@ -622,27 +648,27 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::operator==
template<class Type, template<class> class PatchField, class GeoMesh>
void Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::operator==
void Foam::GeometricBoundaryField<Type, PatchField, GeoMesh>::operator==
(
const FieldField<PatchField, Type>& ptff
const FieldField<PatchField, Type>& bf
)
{
forAll(*this, patchi)
{
this->operator[](patchi) == ptff[patchi];
this->operator[](patchi) == bf[patchi];
}
}
template<class Type, template<class> class PatchField, class GeoMesh>
void Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::operator==
void Foam::GeometricBoundaryField<Type, PatchField, GeoMesh>::operator==
(
const Type& t
const Type& val
)
{
forAll(*this, patchi)
{
this->operator[](patchi) == t;
this->operator[](patchi) == val;
}
}
@ -653,8 +679,7 @@ template<class Type, template<class> class PatchField, class GeoMesh>
Foam::Ostream& Foam::operator<<
(
Ostream& os,
const typename GeometricField<Type, PatchField, GeoMesh>::
Boundary& bf
const GeometricBoundaryField<Type, PatchField, GeoMesh>& bf
)
{
os << static_cast<const FieldField<PatchField, Type>&>(bf);

View File

@ -0,0 +1,238 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017,2022 OpenFOAM Foundation
Copyright (C) 2015-2022 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/>.
Class
Foam::GeometricBoundaryField
Description
Generic GeometricBoundaryField class.
SourceFiles
GeometricBoundaryField.C
\*---------------------------------------------------------------------------*/
#ifndef Foam_GeometricBoundaryField_H
#define Foam_GeometricBoundaryField_H
#include "dimensionedTypes.H"
#include "DimensionedField.H"
#include "FieldField.H"
#include "lduInterfaceFieldPtrsList.H"
#include "LduInterfaceFieldPtrsList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward Declarations
class dictionary;
template<class Type, template<class> class PatchField, class GeoMesh>
class GeometricField;
/*---------------------------------------------------------------------------*\
Class GeometricBoundaryField Declaration
\*---------------------------------------------------------------------------*/
template<class Type, template<class> class PatchField, class GeoMesh>
class GeometricBoundaryField
:
public FieldField<PatchField, Type>
{
public:
// Public Typedefs
//- The boundary mesh type for the boundary fields
typedef typename GeoMesh::BoundaryMesh BoundaryMesh;
//- The internal field type associated with the boundary fields
typedef DimensionedField<Type, GeoMesh> Internal;
//- The patch field type for the boundary fields
typedef PatchField<Type> Patch;
private:
// Private Data
//- Reference to BoundaryMesh for which this field is defined
const BoundaryMesh& bmesh_;
public:
// Constructors
//- Construct from a BoundaryMesh, setting patches later
explicit GeometricBoundaryField(const BoundaryMesh& bmesh);
//- Construct from a BoundaryMesh, reference to the internal field
//- and a patch type
GeometricBoundaryField
(
const BoundaryMesh& bmesh,
const DimensionedField<Type, GeoMesh>& field,
const word& patchFieldType = PatchField<Type>::calculatedType()
);
//- Construct from a BoundaryMesh, reference to the internal field
//- and a wordList of patch types and optional the actual patch
//- types (to override constraint patches)
GeometricBoundaryField
(
const BoundaryMesh& bmesh,
const DimensionedField<Type, GeoMesh>& field,
const wordList& wantedPatchTypes,
const wordList& actualPatchTypes = wordList()
);
//- Construct from a BoundaryMesh, reference to the internal field
//- and a PtrList<PatchField<Type>>
GeometricBoundaryField
(
const BoundaryMesh& bmesh,
const DimensionedField<Type, GeoMesh>& field,
const PtrList<PatchField<Type>>&
);
//- Construct as copy setting the reference to the internal field
GeometricBoundaryField
(
const DimensionedField<Type, GeoMesh>& field,
const GeometricBoundaryField<Type, PatchField, GeoMesh>& btf
);
//- Construct as copy setting the reference to the internal field
//- and resetting type of field for given patch IDs
GeometricBoundaryField
(
const DimensionedField<Type, GeoMesh>& field,
const GeometricBoundaryField<Type, PatchField, GeoMesh>& btf,
const labelList& patchIDs,
const word& patchFieldName
);
//- Copy construct
// Dangerous because Field may be set to a field which gets deleted
// Need new type of BoundaryField, one which is part of a geometric
// field for which snGrad etc. may be called and a free standing
// BoundaryField for which such operations are unavailable.
GeometricBoundaryField(const GeometricBoundaryField& btf);
//- Construct from dictionary
GeometricBoundaryField
(
const BoundaryMesh& bmesh,
const DimensionedField<Type, GeoMesh>& field,
const dictionary& dict
);
// Member Functions
//- Read the boundary field
void readField
(
const DimensionedField<Type, GeoMesh>& field,
const dictionary& dict
);
//- Update the boundary condition coefficients
void updateCoeffs();
//- Evaluate boundary conditions
void evaluate();
//- Return a list of the patch types
wordList types() const;
//- Return boundary field of cell values neighbouring the boundary
GeometricBoundaryField boundaryInternalField() const;
//- Return a list of pointers for each patch field with only those
//- pointing to interfaces being set
LduInterfaceFieldPtrsList<Type> interfaces() const;
//- Return a list of pointers for each patch field with only those
//- pointing to interfaces being set
lduInterfaceFieldPtrsList scalarInterfaces() const;
//- Write boundary field as dictionary entry
void writeEntry(const word& keyword, Ostream& os) const;
//- Write dictionary entries of the individual boundary fields.
void writeEntries(Ostream& os) const;
// Member Operators
//- Copy assignment from GeometricBoundaryField
void operator=(const GeometricBoundaryField& bf);
//- Copy assignment from FieldField\<PatchField, Type\>
void operator=(const FieldField<PatchField, Type>& bf);
//- Assignment to uniform value
void operator=(const Type& val);
//- Forced assignment from GeometricBoundaryField
void operator==(const GeometricBoundaryField& bf);
//- Forced assignment from FieldField\<PatchField, Type\>
void operator==(const FieldField<PatchField, Type>& bf);
//- Forced assignment to uniform value
void operator==(const Type& val);
};
template<class Type, template<class> class PatchField, class GeoMesh>
Ostream& operator<<
(
Ostream&,
const GeometricBoundaryField<Type, PatchField, GeoMesh>&
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "GeometricBoundaryField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1372,7 +1372,6 @@ Foam::Ostream& Foam::operator<<
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "GeometricFieldNew.C"
#include "GeometricBoundaryField.C"
#include "GeometricFieldFunctions.C"
// ************************************************************************* //

View File

@ -33,21 +33,16 @@ Description
SourceFiles
GeometricFieldI.H
GeometricField.C
GeometricBoundaryField.C
GeometricFieldFunctions.H
GeometricFieldFunctions.C
\*---------------------------------------------------------------------------*/
#ifndef GeometricField_H
#define GeometricField_H
#ifndef Foam_GeometricField_H
#define Foam_GeometricField_H
#include "regIOobject.H"
#include "dimensionedTypes.H"
#include "DimensionedField.H"
#include "FieldField.H"
#include "lduInterfaceFieldPtrsList.H"
#include "LduInterfaceFieldPtrsList.H"
#include "GeometricBoundaryField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -84,178 +79,32 @@ class GeometricField
:
public DimensionedField<Type, GeoMesh>
{
// Private Member Functions
//- Read from file if it is present
bool readIfPresent();
//- Read old time field from file if it is present
bool readOldTimeIfPresent();
public:
// Public Typedefs
//- Type of mesh on which this GeometricField is instantiated
//- The mesh type for the GeometricField
typedef typename GeoMesh::Mesh Mesh;
//- Type of boundary mesh on which this GeometricField::Boundary is
//- instantiated
//- The boundary mesh type for the boundary fields
typedef typename GeoMesh::BoundaryMesh BoundaryMesh;
//- Type of the internal field from which this GeometricField is derived
//- The internal field type from which this GeometricField is derived
typedef DimensionedField<Type, GeoMesh> Internal;
//- Type of the patch field of which the GeometricField::Boundary is
//- composed
//- Type of boundary fields
typedef GeometricBoundaryField<Type, PatchField, GeoMesh> Boundary;
//- The patch field type for the GeometricBoundaryField
typedef PatchField<Type> Patch;
//- The boundary fields
class Boundary
:
public FieldField<PatchField, Type>
{
// Private Data
//- Reference to BoundaryMesh for which this field is defined
const BoundaryMesh& bmesh_;
public:
// Constructors
//- Construct from a BoundaryMesh, setting patches later
explicit Boundary(const BoundaryMesh& bmesh);
//- Construct from a BoundaryMesh, reference to the internal field
//- and a patch type
Boundary
(
const BoundaryMesh& bmesh,
const Internal& field,
const word& patchFieldType = PatchField<Type>::calculatedType()
);
//- Construct from a BoundaryMesh, reference to the internal field
//- and a wordList of patch types and optional the actual patch
//- types (to override constraint patches)
Boundary
(
const BoundaryMesh& bmesh,
const Internal& field,
const wordList& wantedPatchTypes,
const wordList& actualPatchTypes = wordList()
);
//- Construct from a BoundaryMesh, reference to the internal field
//- and a PtrList<PatchField<Type>>
Boundary
(
const BoundaryMesh& bmesh,
const Internal& field,
const PtrList<PatchField<Type>>&
);
//- Construct as copy setting the reference to the internal field
Boundary
(
const Internal& field,
const Boundary& btf
);
//- Construct as copy setting the reference to the internal field
//- and resetting type of field for given patch IDs
Boundary
(
const Internal& field,
const Boundary& btf,
const labelList& patchIDs,
const word& patchFieldName
);
//- Copy construct
// Dangerous because Field may be set to a field which gets deleted
// Need new type of BoundaryField, one which is part of a geometric
// field for which snGrad etc. may be called and a free standing
// BoundaryField for which such operations are unavailable.
Boundary(const Boundary& btf);
//- Construct from dictionary
Boundary
(
const BoundaryMesh& bmesh,
const Internal& field,
const dictionary& dict
);
// Member Functions
//- Read the boundary field
void readField
(
const Internal& field,
const dictionary& dict
);
//- Update the boundary condition coefficients
void updateCoeffs();
//- Evaluate boundary conditions
void evaluate();
//- Return a list of the patch types
wordList types() const;
//- Return BoundaryField of the cell values neighbouring
//- the boundary
Boundary boundaryInternalField() const;
//- Return a list of pointers for each patch field with only those
//- pointing to interfaces being set
LduInterfaceFieldPtrsList<Type> interfaces() const;
//- Return a list of pointers for each patch field with only those
//- pointing to interfaces being set
lduInterfaceFieldPtrsList scalarInterfaces() const;
//- Write boundary field as dictionary entry
void writeEntry(const word& keyword, Ostream& os) const;
//- Write dictionary entries of the individual boundary fields.
void writeEntries(Ostream& os) const;
// Member Operators
//- Assignment to BoundaryField<Type, PatchField, BoundaryMesh>
void operator=(const Boundary&);
//- Assignment to FieldField<PatchField, Type>
void operator=(const FieldField<PatchField, Type>&);
//- Assignment to Type
void operator=(const Type&);
//- Forced assignment to
// BoundaryField<Type, PatchField, BoundaryMesh>
void operator==(const Boundary&);
//- Forced assignment to FieldField<PatchField, Type>
void operator==(const FieldField<PatchField, Type>&);
//- Forced assignment to Type
void operator==(const Type&);
};
//- The field component type
typedef typename Field<Type>::cmptType cmptType;
private:
// Private data
// Private Data
//- Current time index.
// Used to trigger the storing of the old-time value
@ -267,12 +116,18 @@ private:
//- Pointer to previous iteration (used for under-relaxation)
mutable GeometricField<Type, PatchField, GeoMesh>* fieldPrevIterPtr_;
//- Boundary Type field containing boundary field values
//- Boundary field containing boundary field values
Boundary boundaryField_;
// Private Member Functions
//- Read from file if it is present
bool readIfPresent();
//- Read old time field from file if it is present
bool readOldTimeIfPresent();
//- Read the field from the dictionary
void readFields(const dictionary& dict);
@ -286,10 +141,6 @@ public:
TypeName("GeometricField");
// Public typedefs
typedef typename Field<Type>::cmptType cmptType;
// Static Member Functions
//- Return a null geometric field

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -47,11 +48,8 @@ slicedBoundaryField
const bool preserveProcessorOnly
)
{
tmp<FieldField<PatchField, Type>> tbf
(
new FieldField<PatchField, Type>(mesh.boundary().size())
);
FieldField<PatchField, Type>& bf = tbf.ref();
auto tbf = tmp<FieldField<PatchField, Type>>::New(mesh.boundary().size());
auto& bf = tbf.ref();
forAll(mesh.boundary(), patchi)
{
@ -123,11 +121,8 @@ slicedBoundaryField
const bool preserveCouples
)
{
tmp<FieldField<PatchField, Type>> tbf
(
new FieldField<PatchField, Type>(mesh.boundary().size())
);
FieldField<PatchField, Type>& bf = tbf.ref();
auto tbf = tmp<FieldField<PatchField, Type>>::New(mesh.boundary().size());
auto& bf = tbf.ref();
forAll(mesh.boundary(), patchi)
{
@ -157,10 +152,10 @@ slicedBoundaryField
new SlicedPatchField<Type>
(
mesh.boundary()[patchi],
DimensionedField<Type, GeoMesh>::null()
DimensionedField<Type, GeoMesh>::null(),
bField[patchi]
)
);
bf[patchi].UList<Type>::shallowCopy(bField[patchi]);
}
}
@ -170,38 +165,6 @@ slicedBoundaryField
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template
<
class Type,
template<class> class PatchField,
template<class> class SlicedPatchField,
class GeoMesh
>
Foam::SlicedGeometricField<Type, PatchField, SlicedPatchField, GeoMesh>::
Internal::Internal
(
const IOobject& io,
const Mesh& mesh,
const dimensionSet& ds,
const Field<Type>& iField
)
:
DimensionedField<Type, GeoMesh>
(
io,
mesh,
ds,
Field<Type>()
)
{
// Set the internalField to the slice of the complete field
UList<Type>::shallowCopy
(
typename Field<Type>::subField(iField, GeoMesh::size(mesh))
);
}
template
<
class Type,
@ -228,10 +191,10 @@ SlicedGeometricField
slicedBoundaryField(mesh, completeField, preserveCouples)
)
{
// Set the internalField to the slice of the complete field
// Set internalField to the slice of the complete field
UList<Type>::shallowCopy
(
typename Field<Type>::subField(completeField, GeoMesh::size(mesh))
SubList<Type>(completeField, GeoMesh::size(mesh))
);
correctBoundaryConditions();
@ -272,10 +235,10 @@ SlicedGeometricField
)
)
{
// Set the internalField to the slice of the complete field
// Set internalField to the slice of the complete field
UList<Type>::shallowCopy
(
typename Field<Type>::subField(completeIField, GeoMesh::size(mesh))
SubList<Type>(completeIField, GeoMesh::size(mesh))
);
correctBoundaryConditions();
@ -306,7 +269,7 @@ SlicedGeometricField
slicedBoundaryField(gf.mesh(), gf.boundaryField(), preserveCouples)
)
{
// Set the internalField to the supplied internal field
// Set internalField to the internal field
UList<Type>::shallowCopy(gf.primitiveField());
correctBoundaryConditions();
@ -335,7 +298,7 @@ SlicedGeometricField
slicedBoundaryField(gf.mesh(), gf.boundaryField(), true)
)
{
// Set the internalField to the supplied internal field
// Set internalField to the internal field
UList<Type>::shallowCopy(gf.primitiveField());
}
@ -357,12 +320,9 @@ clone() const
return tmp
<
SlicedGeometricField<Type, PatchField, SlicedPatchField, GeoMesh>
>
>::New
(
new SlicedGeometricField<Type, PatchField, SlicedPatchField, GeoMesh>
(
*this
)
*this
);
}
@ -379,25 +339,8 @@ template
Foam::SlicedGeometricField<Type, PatchField, SlicedPatchField, GeoMesh>::
~SlicedGeometricField()
{
// Set the internalField storage pointer to nullptr before its destruction
// to protect the field it a slice of.
UList<Type>::shallowCopy(UList<Type>(nullptr, 0));
}
template
<
class Type,
template<class> class PatchField,
template<class> class SlicedPatchField,
class GeoMesh
>
Foam::SlicedGeometricField<Type, PatchField, SlicedPatchField, GeoMesh>::
Internal::~Internal()
{
// Set the internalField storage pointer to nullptr before its destruction
// to protect the field it a slice of.
UList<Type>::shallowCopy(UList<Type>(nullptr, 0));
// Set internalField to nullptr to avoid deletion of underlying field
UList<Type>::shallowCopy(UList<Type>());
}

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2011-2017,2022 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -42,10 +42,11 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef SlicedGeometricField_H
#define SlicedGeometricField_H
#ifndef Foam_SlicedGeometricField_H
#define Foam_SlicedGeometricField_H
#include "GeometricField.H"
#include "SlicedDimensionedField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -69,10 +70,13 @@ class SlicedGeometricField
{
public:
typedef typename GeoMesh::Mesh Mesh;
typedef typename GeoMesh::BoundaryMesh BoundaryMesh;
// Public Typedefs
class Internal;
typedef typename GeoMesh::Mesh Mesh;
typedef typename GeoMesh::BoundaryMesh BoundaryMesh;
//- The internal field slice for this SlicedGeometricField
typedef SlicedDimensionedField<Type, GeoMesh> Internal;
private:
@ -81,7 +85,8 @@ private:
//- Slice the given field and a create a PtrList of SlicedPatchField
// from which the boundary field is built
tmp<FieldField<PatchField, Type>> slicedBoundaryField
tmp<FieldField<PatchField, Type>>
slicedBoundaryField
(
const Mesh& mesh,
const Field<Type>& completeField,
@ -91,7 +96,8 @@ private:
//- Slice the given field and a create a PtrList of SlicedPatchField
// from which the boundary field is built
tmp<FieldField<PatchField, Type>> slicedBoundaryField
tmp<FieldField<PatchField, Type>>
slicedBoundaryField
(
const Mesh& mesh,
const FieldField<PatchField, Type>& bField,
@ -133,7 +139,7 @@ public:
);
//- Construct from components and separate fields to slice for the
// internal field and boundary field
//- internal field and boundary field
SlicedGeometricField
(
const IOobject&,
@ -146,7 +152,7 @@ public:
);
//- Construct from GeometricField. Reuses full internal and
// patch fields except on couples (preserveCouples=true).
//- patch fields except on couples (preserveCouples=true).
SlicedGeometricField
(
const IOobject&,
@ -154,7 +160,7 @@ public:
const bool preserveCouples=true
);
//- Construct as copy
//- Copy construct
SlicedGeometricField
(
const SlicedGeometricField
@ -168,57 +174,20 @@ public:
//- Clone
tmp<SlicedGeometricField<Type, PatchField, SlicedPatchField, GeoMesh>>
clone() const;
clone() const;
//- Destructor
~SlicedGeometricField();
// Member functions
// Member Functions
//- Correct boundary field
void correctBoundaryConditions();
};
/*---------------------------------------------------------------------------*\
Class SlicedGeometricField::Internal Declaration
\*---------------------------------------------------------------------------*/
//- The internalField of a SlicedGeometricField
template
<
class Type,
template<class> class PatchField,
template<class> class SlicedPatchField,
class GeoMesh
>
class SlicedGeometricField<Type, PatchField, SlicedPatchField, GeoMesh>::
Internal
:
public GeometricField<Type, PatchField, GeoMesh>::Internal
{
public:
// Constructors
//- Construct from components and field to slice
Internal
(
const IOobject&,
const Mesh&,
const dimensionSet&,
const Field<Type>& iField
);
//- Destructor
~Internal();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View File

@ -45,7 +45,14 @@ SourceFiles
namespace Foam
{
// Geometric internal field
template<class Type, class GeoMesh> class DimensionedField;
// Geometric boundary field
template<class Type, template<class> class PatchField, class GeoMesh>
class GeometricBoundaryField;
// Geometric field (internal + boundary)
template<class Type, template<class> class PatchField, class GeoMesh>
class GeometricField;
@ -61,6 +68,11 @@ template<class Type> class pointPatchField;
template<class Type>
using PointField = GeometricField<Type, pointPatchField, pointMesh>;
//- A point boundary field for a given Type
template<class Type>
using PointBoundaryField =
GeometricBoundaryField<Type, pointPatchField, pointMesh>;
//- A point internal field for a given type
template<class Type>
using PointInternalField = DimensionedField<Type, pointMesh>;

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -36,8 +36,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef LduInterfaceField_H
#define LduInterfaceField_H
#ifndef Foam_LduInterfaceField_H
#define Foam_LduInterfaceField_H
#include "lduInterfaceField.H"
#include "primitiveFieldsFwd.H"
@ -48,8 +48,9 @@ SourceFiles
namespace Foam
{
// Forward declarations
// Forward Declarations
class lduMatrix;
template<class Type> class LduInterfaceField;
/*---------------------------------------------------------------------------*\
Class LduInterfaceField Declaration

View File

@ -24,15 +24,15 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Type
lduInterfaceFieldPtrsList
LduInterfaceFieldPtrsList
Description
List of coupled interface fields to be used in coupling.
\*---------------------------------------------------------------------------*/
#ifndef LduInterfaceFieldPtrsList_H
#define LduInterfaceFieldPtrsList_H
#ifndef Foam_LduInterfaceFieldPtrsList_H
#define Foam_LduInterfaceFieldPtrsList_H
#include "LduInterfaceField.H"
#include "UPtrList.H"
@ -42,25 +42,9 @@ Description
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class LduInterfaceFieldPtrsList Declaration
\*---------------------------------------------------------------------------*/
//- Store lists of LduInterfaceField as a UPtrList
template<class Type>
class LduInterfaceFieldPtrsList
:
public UPtrList<const LduInterfaceField<Type>>
{
public:
LduInterfaceFieldPtrsList(label size)
:
UPtrList<const LduInterfaceField<Type>>(size)
{}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
using LduInterfaceFieldPtrsList = UPtrList<const LduInterfaceField<Type>>;
} // End namespace Foam

View File

@ -50,8 +50,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef LduMatrix_H
#define LduMatrix_H
#ifndef Foam_LduMatrix_H
#define Foam_LduMatrix_H
#include "lduMesh.H"
#include "Field.H"

View File

@ -27,7 +27,6 @@ License
\*---------------------------------------------------------------------------*/
#include "LduMatrix.H"
#include "LduInterfaceFieldPtrsList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -36,8 +36,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef lduInterface_H
#define lduInterface_H
#ifndef Foam_lduInterface_H
#define Foam_lduInterface_H
#include "labelField.H"
#include "typeInfo.H"
@ -48,8 +48,11 @@ SourceFiles
namespace Foam
{
// Forward Declarations
class lduInterface;
/*---------------------------------------------------------------------------*\
Class lduInterface Declaration
Class lduInterface Declaration
\*---------------------------------------------------------------------------*/
class lduInterface

View File

@ -31,8 +31,8 @@ Description
\*---------------------------------------------------------------------------*/
#ifndef lduInterfacePtrsList_H
#define lduInterfacePtrsList_H
#ifndef Foam_lduInterfacePtrsList_H
#define Foam_lduInterfacePtrsList_H
#include "lduInterface.H"
#include "UPtrList.H"
@ -41,8 +41,11 @@ Description
namespace Foam
{
typedef UPtrList<const lduInterface> lduInterfacePtrsList;
}
//- Store lists of lduInterface as a UPtrList
typedef UPtrList<const lduInterface> lduInterfacePtrsList;
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -35,10 +35,10 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef pointBoundaryMesh_H
#define pointBoundaryMesh_H
#ifndef Foam_pointBoundaryMesh_H
#define Foam_pointBoundaryMesh_H
#include "pointPatchList.H"
#include "pointPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -35,12 +35,13 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef pointPatch_H
#define pointPatch_H
#ifndef Foam_pointPatch_H
#define Foam_pointPatch_H
#include "labelList.H"
#include "vectorField.H"
#include "pointField.H"
#include "PtrList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -50,8 +51,12 @@ namespace Foam
// Forward Declarations
class pointBoundaryMesh;
class pointConstraint;
class pointPatch;
class PstreamBuffers;
//- Store lists of pointPatch as a PtrList
typedef PtrList<pointPatch> pointPatchList;
/*---------------------------------------------------------------------------*\
Class pointPatch Declaration
\*---------------------------------------------------------------------------*/

View File

@ -1,57 +1,9 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
-------------------------------------------------------------------------------
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/>.
Typedef
Foam::pointPatchList
Description
container classes for pointPatch
Compatibility include (MAR-2022)
\*---------------------------------------------------------------------------*/
#ifndef pointPatchList_H
#define pointPatchList_H
#include "pointPatch.H"
#include "PtrList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
typedef PtrList<pointPatch> pointPatchList;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -39,8 +39,8 @@ SourceFiles
#ifndef Foam_polyBoundaryMesh_H
#define Foam_polyBoundaryMesh_H
#include "polyPatchList.H"
#include "regIOobject.H"
#include "polyPatch.H"
#include "labelPair.H"
#include "HashSet.H"
@ -56,7 +56,6 @@ class wordRes;
Ostream& operator<<(Ostream& os, const polyBoundaryMesh& pbm);
/*---------------------------------------------------------------------------*\
Class polyBoundaryMesh Declaration
\*---------------------------------------------------------------------------*/

View File

@ -959,7 +959,7 @@ Foam::polyMesh::cellTree() const
void Foam::polyMesh::addPatches
(
PtrList<polyPatch>& plist,
polyPatchList& plist,
const bool validBoundary
)
{
@ -1060,7 +1060,7 @@ void Foam::polyMesh::addPatches
)
{
// Acquire ownership of the pointers
PtrList<polyPatch> plist(const_cast<List<polyPatch*>&>(p));
polyPatchList plist(const_cast<List<polyPatch*>&>(p));
addPatches(plist, validBoundary);
}

View File

@ -583,7 +583,7 @@ public:
//- Add boundary patches
void addPatches
(
PtrList<polyPatch>& plist,
polyPatchList& plist,
const bool validBoundary = true
);

View File

@ -39,14 +39,15 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef polyPatch_H
#define polyPatch_H
#ifndef Foam_polyPatch_H
#define Foam_polyPatch_H
#include "patchIdentifier.H"
#include "primitivePatch.H"
#include "typeInfo.H"
#include "runTimeSelectionTables.H"
#include "SubField.H"
#include "PtrList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -59,8 +60,10 @@ class polyPatch;
class polyTopoChange;
class PstreamBuffers;
Ostream& operator<<(Ostream&, const polyPatch&);
//- Store lists of polyPatch as a PtrList
typedef PtrList<polyPatch> polyPatchList;
Ostream& operator<<(Ostream&, const polyPatch&);
/*---------------------------------------------------------------------------*\
Class polyPatch Declaration

View File

@ -1,57 +1,9 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
-------------------------------------------------------------------------------
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/>.
Typedef
Foam::polyPatchList
Description
container classes for polyPatch
Compatibility include (MAR-2022)
\*---------------------------------------------------------------------------*/
#ifndef polyPatchList_H
#define polyPatchList_H
#include "polyPatch.H"
#include "PtrList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
typedef PtrList<polyPatch> polyPatchList;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -36,15 +36,15 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef boundaryMesh_H
#define boundaryMesh_H
#ifndef Foam_boundaryMesh_H
#define Foam_boundaryMesh_H
#include "bMesh.H"
#include "boundaryPatch.H"
#include "className.H"
#include "polyPatch.H"
#include "PrimitivePatch.H"
#include "PtrList.H"
#include "polyPatchList.H"
#include "className.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -37,8 +37,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef boundaryPatch_H
#define boundaryPatch_H
#ifndef Foam_boundaryPatch_H
#define Foam_boundaryPatch_H
#include "patchIdentifier.H"
#include "autoPtr.H"

View File

@ -42,7 +42,7 @@ Author
#ifndef Foam_faBoundaryMesh_H
#define Foam_faBoundaryMesh_H
#include "faPatchList.H"
#include "faPatch.H"
#include "lduInterfacePtrsList.H"
#include "wordList.H"
#include "pointField.H"

View File

@ -34,11 +34,10 @@ Author
\*---------------------------------------------------------------------------*/
#ifndef faProcessorTopology_H
#define faProcessorTopology_H
#ifndef Foam_faProcessorTopology_H
#define Foam_faProcessorTopology_H
#include "ProcessorTopology.H"
#include "faPatchList.H"
#include "processorFaPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -438,7 +438,7 @@ Foam::faMesh::faMesh(const polyPatch& pp)
DebugInFunction << "Creating from polyPatch:" << pp.name() << endl;
// Add single faPatch "default", but with processor connections
PtrList<faPatch> newPatches
faPatchList newPatches
(
createOnePatch("default")
);
@ -479,7 +479,7 @@ Foam::faMesh::faMesh
{
DebugInFunction << "Creating from definition (dictionary)" << endl;
PtrList<faPatch> newPatches
faPatchList newPatches
(
createPatchList
(

View File

@ -414,14 +414,14 @@ class faMesh
// Helpers
//- Create a single patch
PtrList<faPatch> createOnePatch
faPatchList createOnePatch
(
const word& patchName,
const word& patchType = ""
) const;
//- Create list of patches from boundary definition
PtrList<faPatch> createPatchList
faPatchList createPatchList
(
const dictionary& bndDict,
const word& emptyPatchName = "",
@ -526,7 +526,7 @@ public:
//- Add boundary patches. Constructor helper
void addFaPatches
(
PtrList<faPatch>& plist,
faPatchList& plist,
const bool validBoundary = true
);

View File

@ -36,7 +36,7 @@ License
void Foam::faMesh::addFaPatches
(
PtrList<faPatch>& plist,
faPatchList& plist,
const bool validBoundary
)
{
@ -67,13 +67,13 @@ void Foam::faMesh::addFaPatches
)
{
// Acquire ownership of the pointers
PtrList<faPatch> plist(const_cast<List<faPatch*>&>(p));
faPatchList plist(const_cast<List<faPatch*>&>(p));
addFaPatches(plist, validBoundary);
}
Foam::PtrList<Foam::faPatch> Foam::faMesh::createOnePatch
Foam::faPatchList Foam::faMesh::createOnePatch
(
const word& patchName,
const word& patchType
@ -98,7 +98,7 @@ Foam::PtrList<Foam::faPatch> Foam::faMesh::createOnePatch
}
Foam::PtrList<Foam::faPatch> Foam::faMesh::createPatchList
Foam::faPatchList Foam::faMesh::createPatchList
(
const dictionary& bndDict,
const word& emptyPatchName,
@ -495,7 +495,7 @@ Foam::PtrList<Foam::faPatch> Foam::faMesh::createPatchList
// Now convert list of definitions to list of patches
label nPatches = 0;
PtrList<faPatch> newPatches(faPatchDefs.size());
faPatchList newPatches(faPatchDefs.size());
for (faPatchData& patchDef : faPatchDefs)
{

View File

@ -49,6 +49,7 @@ SourceFiles
#include "labelList.H"
#include "pointField.H"
#include "typeInfo.H"
#include "PtrList.H"
#include "faPatchFieldsFwd.H"
#include "autoPtr.H"
#include "runTimeSelectionTables.H"
@ -61,6 +62,10 @@ namespace Foam
// Forward Declarations
class faBoundaryMesh;
class faPatch;
//- Store lists of faPatch as a PtrList
typedef PtrList<faPatch> faPatchList;
Ostream& operator<<(Ostream&, const faPatch&);
/*---------------------------------------------------------------------------*\

View File

@ -1,57 +1,9 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2017 Wikki 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/>.
Typedef
foam::faPatchList
Description
Container classes for faPatch
Compatibility include (MAR-2022)
\*---------------------------------------------------------------------------*/
#ifndef faPatchList_H
#define faPatchList_H
#include "faPatch.H"
#include "PtrList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
typedef PtrList<faPatch> faPatchList;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -42,7 +42,14 @@ SourceFiles
namespace Foam
{
// Geometric internal field
template<class Type, class GeoMesh> class DimensionedField;
// Geometric boundary field
template<class Type, template<class> class PatchField, class GeoMesh>
class GeometricBoundaryField;
// Geometric field (internal + boundary)
template<class Type, template<class> class PatchField, class GeoMesh>
class GeometricField;
@ -57,6 +64,10 @@ template<class Type> class faPatchField;
template<class Type>
using AreaField = GeometricField<Type, faPatchField, areaMesh>;
//- An area boundary field for a given Type
template<class Type>
using AreaBoundaryField = GeometricBoundaryField<Type, faPatchField, areaMesh>;
//- An area internal field for a given type
template<class Type>
using AreaInternalField = DimensionedField<Type, areaMesh>;

View File

@ -41,6 +41,7 @@ Description
namespace Foam
{
// Geometric field (internal + boundary)
template<class Type, template<class> class PatchField, class GeoMesh>
class GeometricField;

View File

@ -138,8 +138,7 @@ lnGradScheme<Type>::lnGrad
deltaCoeffs[faceI]*(vf[neighbour[faceI]] - vf[owner[faceI]]);
}
typename GeometricField<Type, faePatchField, edgeMesh>::Boundary& ssfb =
ssf.boundaryFieldRef();
auto& ssfb = ssf.boundaryFieldRef();
forAll(vf.boundaryField(), patchI)
{

View File

@ -317,8 +317,7 @@ Foam::edgeInterpolationScheme<Type>::interpolate
// Interpolate across coupled patches using given lambdas
const typename GeometricField<Type, faPatchField, areaMesh>::Boundary&
vfb = vf.boundaryField();
const auto& vfb = vf.boundaryField();
forAll(lambdas.boundaryField(), pi)
{

View File

@ -123,8 +123,7 @@ Foam::tmp<Foam::edgeScalarField> Foam::faNVDscheme<Type,NVDweight>::weights
}
GeometricField<scalar, faePatchField, edgeMesh>::Boundary&
bWeights = weightingFactors.boundaryFieldRef();
auto& bWeights = weightingFactors.boundaryFieldRef();
forAll(bWeights, patchI)
{

View File

@ -33,7 +33,7 @@ License
template<class Type>
Foam::tmp<Foam::Field<Type>> Foam::volSurfaceMapping::mapToSurface
(
const typename GeometricField<Type, fvPatchField, volMesh>::Boundary& df
const GeometricBoundaryField<Type, fvPatchField, volMesh>& df
) const
{
// Grab labels for all faces in faMesh
@ -98,7 +98,7 @@ Foam::tmp<Foam::Field<Type>> Foam::volSurfaceMapping::mapToSurface
template<class Type>
Foam::tmp<Foam::Field<Type>> Foam::volSurfaceMapping::mapInternalToSurface
(
const typename GeometricField<Type, fvPatchField, volMesh>::Boundary& df
const GeometricBoundaryField<Type, fvPatchField, volMesh>& df
) const
{
// Grab labels for all faces in faMesh
@ -134,7 +134,7 @@ template<class Type>
void Foam::volSurfaceMapping::mapToVolume
(
const GeometricField<Type, faPatchField, areaMesh>& af,
typename GeometricField<Type, fvPatchField, volMesh>::Boundary& bf
GeometricBoundaryField<Type, fvPatchField, volMesh>& bf
) const
{
// Grab labels for all faces in faMesh
@ -166,7 +166,7 @@ template<class Type>
void Foam::volSurfaceMapping::mapToVolume
(
const tmp<GeometricField<Type, faPatchField, areaMesh>>& taf,
typename GeometricField<Type, fvPatchField, volMesh>::Boundary& bf
GeometricBoundaryField<Type, fvPatchField, volMesh>& bf
) const
{
mapToVolume(taf(), bf);

View File

@ -38,8 +38,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef volSurfaceMapping_H
#define volSurfaceMapping_H
#ifndef Foam_volSurfaceMapping_H
#define Foam_volSurfaceMapping_H
#include "faMesh.H"
#include "volMesh.H"
@ -49,6 +49,7 @@ SourceFiles
namespace Foam
{
// Forward Declarations
template<class Type> class fvPatchField;
/*---------------------------------------------------------------------------*\
@ -86,12 +87,11 @@ public:
// Member Functions
//- Map Boundary field to surface
//- Map volume boundary field to surface
template<class Type>
tmp<Field<Type>> mapToSurface
(
const typename
GeometricField<Type, fvPatchField, volMesh>::Boundary& df
const GeometricBoundaryField<Type, fvPatchField, volMesh>& df
) const;
//- Map vol Field to surface Field
@ -102,8 +102,7 @@ public:
template<class Type>
tmp<Field<Type>> mapInternalToSurface
(
const typename
GeometricField<Type, fvPatchField, volMesh>::Boundary& df
const GeometricBoundaryField<Type, fvPatchField, volMesh>& df
) const;
//- Map surface field to volume boundary field
@ -111,7 +110,7 @@ public:
void mapToVolume
(
const GeometricField<Type, faPatchField, areaMesh>& af,
typename GeometricField<Type, fvPatchField, volMesh>::Boundary& bf
GeometricBoundaryField<Type, fvPatchField, volMesh>& bf
) const;
//- Map surface tmp field to volume boundary field
@ -119,7 +118,7 @@ public:
void mapToVolume
(
const tmp<GeometricField<Type, faPatchField, areaMesh>>& taf,
typename GeometricField<Type, fvPatchField, volMesh>::Boundary& bf
GeometricBoundaryField<Type, fvPatchField, volMesh>& bf
) const;
//- Map surface field to field

View File

@ -227,8 +227,7 @@ void Foam::MRFZone::zero
phii[internalFaces_[i]] = Zero;
}
typename GeometricField<Type, fvsPatchField, surfaceMesh>::Boundary& phibf =
phi.boundaryFieldRef();
auto& phibf = phi.boundaryFieldRef();
forAll(includedFaces_, patchi)
{

View File

@ -40,7 +40,7 @@ Foam::slicedFvPatchField<Type>::slicedFvPatchField
:
fvPatchField<Type>(p, iF, Field<Type>())
{
// Set the fvPatchField to a slice of the given complete field
// Set fvPatchField to a slice of the given complete field
UList<Type>::shallowCopy(p.patchSlice(completeField));
}
@ -145,9 +145,8 @@ Foam::slicedFvPatchField<Type>::clone
template<class Type>
Foam::slicedFvPatchField<Type>::~slicedFvPatchField()
{
// Set the fvPatchField storage pointer to nullptr before its destruction
// to protect the field it a slice of.
UList<Type>::shallowCopy(UList<Type>(nullptr, 0));
// Set fvPatchField to nullptr to avoid deletion of underlying field
UList<Type>::shallowCopy(UList<Type>());
}

View File

@ -39,7 +39,7 @@ Foam::slicedFvsPatchField<Type>::slicedFvsPatchField
:
fvsPatchField<Type>(p, iF, Field<Type>())
{
// Set the fvsPatchField to a slice of the given complete field
// Set fvsPatchField to a slice of the given complete field
UList<Type>::shallowCopy(p.patchSlice(completeField));
}
@ -144,9 +144,8 @@ Foam::slicedFvsPatchField<Type>::clone
template<class Type>
Foam::slicedFvsPatchField<Type>::~slicedFvsPatchField()
{
// Set the fvsPatchField storage pointer to nullptr before its destruction
// to protect the field it a slice of.
UList<Type>::shallowCopy(UList<Type>(nullptr, 0));
// Set fvsPatchField to nullptr to avoid deletion of underlying field
UList<Type>::shallowCopy(UList<Type>());
}

View File

@ -44,6 +44,7 @@ SourceFiles
namespace Foam
{
// Geometric field (internal + boundary)
template<class Type, template<class> class PatchField, class GeoMesh>
class GeometricField;

View File

@ -45,7 +45,14 @@ SourceFiles
namespace Foam
{
// Geometric internal field
template<class Type, class GeoMesh> class DimensionedField;
// Geometric boundary field
template<class Type, template<class> class PatchField, class GeoMesh>
class GeometricBoundaryField;
// Geometric field (internal + boundary)
template<class Type, template<class> class PatchField, class GeoMesh>
class GeometricField;
@ -61,6 +68,10 @@ template<class Type> class fvPatchField;
template<class Type>
using VolumeField = GeometricField<Type, fvPatchField, volMesh>;
//- A volume boundary field for a given Type
template<class Type>
using VolumeBoundaryField = GeometricBoundaryField<Type, fvPatchField, volMesh>;
//- A volume internal field for a given Type
template<class Type>
using VolumeInternalField = DimensionedField<Type, volMesh>;

View File

@ -150,10 +150,7 @@ void Foam::fv::gaussGrad<Type>::correctBoundaryConditions
>& gGrad
)
{
typename GeometricField
<
typename outerProduct<vector, Type>::type, fvPatchField, volMesh
>::Boundary& gGradbf = gGrad.boundaryFieldRef();
auto& gGradbf = gGrad.boundaryFieldRef();
forAll(vsf.boundaryField(), patchi)
{

View File

@ -122,8 +122,7 @@ Foam::fv::cellLimitedGrad<Type, Limiter>::calcGrad
}
const typename GeometricField<Type, fvPatchField, volMesh>::Boundary& bsf =
vsf.boundaryField();
const auto& bsf = vsf.boundaryField();
forAll(bsf, patchi)
{

View File

@ -35,10 +35,10 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef fvBoundaryMesh_H
#define fvBoundaryMesh_H
#ifndef Foam_fvBoundaryMesh_H
#define Foam_fvBoundaryMesh_H
#include "fvPatchList.H"
#include "fvPatch.H"
#include "lduInterfacePtrsList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -5,8 +5,8 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2016-2021 OpenCFD Ltd.
Copyright (C) 2011-2017,2022 OpenFOAM Foundation
Copyright (C) 2016-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -67,11 +67,7 @@ void Foam::fvMesh::clearGeomNotOldVol()
MoveableMeshObject
>(*this);
slicedVolScalarField::Internal* VPtr =
static_cast<slicedVolScalarField::Internal*>(VPtr_);
deleteDemandDrivenData(VPtr);
VPtr_ = nullptr;
deleteDemandDrivenData(VPtr_);
deleteDemandDrivenData(SfPtr_);
deleteDemandDrivenData(magSfPtr_);
deleteDemandDrivenData(CPtr_);
@ -81,11 +77,11 @@ void Foam::fvMesh::clearGeomNotOldVol()
void Foam::fvMesh::updateGeomNotOldVol()
{
bool haveV = (VPtr_ != nullptr);
bool haveSf = (SfPtr_ != nullptr);
bool haveMagSf = (magSfPtr_ != nullptr);
bool haveCP = (CPtr_ != nullptr);
bool haveCf = (CfPtr_ != nullptr);
const bool haveV = (VPtr_ != nullptr);
const bool haveSf = (SfPtr_ != nullptr);
const bool haveMagSf = (magSfPtr_ != nullptr);
const bool haveCP = (CPtr_ != nullptr);
const bool haveCf = (CfPtr_ != nullptr);
clearGeomNotOldVol();
@ -603,7 +599,7 @@ Foam::SolverPerformance<Foam::tensor> Foam::fvMesh::solve
void Foam::fvMesh::addFvPatches
(
PtrList<polyPatch>& plist,
polyPatchList& plist,
const bool validBoundary
)
{
@ -626,7 +622,7 @@ void Foam::fvMesh::addFvPatches
)
{
// Acquire ownership of the pointers
PtrList<polyPatch> plist(const_cast<List<polyPatch*>&>(p));
polyPatchList plist(const_cast<List<polyPatch*>&>(p));
addFvPatches(plist, validBoundary);
}
@ -970,10 +966,10 @@ void Foam::fvMesh::updateMesh(const mapPolyMesh& mpm)
storeOldVol(mpm.oldCellVolumes());
// Few checks
if (VPtr_ && (V().size() != mpm.nOldCells()))
if (VPtr_ && (VPtr_->size() != mpm.nOldCells()))
{
FatalErrorInFunction
<< "V:" << V().size()
<< "V:" << VPtr_->size()
<< " not equal to the number of old cells "
<< mpm.nOldCells()
<< exit(FatalError);

View File

@ -5,8 +5,8 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2016-2021 OpenCFD Ltd.
Copyright (C) 2011-2017,2022 OpenFOAM Foundation
Copyright (C) 2016-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -47,8 +47,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef fvMesh_H
#define fvMesh_H
#ifndef Foam_fvMesh_H
#define Foam_fvMesh_H
#include "polyMesh.H"
#include "lduMesh.H"
@ -58,26 +58,24 @@ SourceFiles
#include "fvSchemes.H"
#include "fvSolution.H"
#include "data.H"
#include "DimensionedField.H"
#include "volFieldsFwd.H"
#include "surfaceFieldsFwd.H"
#include "pointFieldsFwd.H"
#include "SlicedDimensionedField.H"
#include "slicedVolFieldsFwd.H"
#include "slicedSurfaceFieldsFwd.H"
#include "className.H"
#include "SolverPerformance.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward Declarations
class fvMeshLduAddressing;
class volMesh;
template<class Type>
class fvMatrix;
template<class Type> class fvMatrix;
/*---------------------------------------------------------------------------*\
Class fvMesh Declaration
@ -109,8 +107,8 @@ protected:
// will take care of the old-time levels.
mutable label curTimeIndex_;
//- Cell volumes old time level
mutable void* VPtr_;
//- Cell volumes
mutable SlicedDimensionedField<scalar, volMesh>* VPtr_;
//- Cell volumes old time level
mutable DimensionedField<scalar, volMesh>* V0Ptr_;
@ -259,7 +257,7 @@ public:
//- Add boundary patches. Constructor helper
void addFvPatches
(
PtrList<polyPatch>& plist,
polyPatchList& plist,
const bool validBoundary = true
);

View File

@ -5,8 +5,8 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2020-2021 OpenCFD Ltd.
Copyright (C) 2011-2017,2022 OpenFOAM Foundation
Copyright (C) 2020-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -183,7 +183,7 @@ const Foam::volScalarField::Internal& Foam::fvMesh::V() const
DebugInFunction
<< "Constructing from primitiveMesh::cellVolumes()" << endl;
VPtr_ = new slicedVolScalarField::Internal
VPtr_ = new SlicedDimensionedField<scalar, volMesh>
(
IOobject
(
@ -200,7 +200,7 @@ const Foam::volScalarField::Internal& Foam::fvMesh::V() const
);
}
return *static_cast<slicedVolScalarField::Internal*>(VPtr_);
return *VPtr_;
}
@ -275,15 +275,9 @@ Foam::tmp<Foam::volScalarField::Internal> Foam::fvMesh::Vsc() const
{
return V0() + tFrac*(V() - V0());
}
else
{
return V();
}
}
else
{
return V();
}
return V();
}
@ -304,15 +298,9 @@ Foam::tmp<Foam::volScalarField::Internal> Foam::fvMesh::Vsc0() const
{
return V0() + t0Frac*(V() - V0());
}
else
{
return V0();
}
}
else
{
return V0();
}
return V0();
}

View File

@ -36,18 +36,19 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef fvPatch_H
#define fvPatch_H
#ifndef Foam_fvPatch_H
#define Foam_fvPatch_H
#include "polyPatch.H"
#include "labelList.H"
#include "SubList.H"
#include "SubField.H"
#include "PtrList.H"
#include "typeInfo.H"
#include "autoPtr.H"
#include "tmp.H"
#include "primitiveFields.H"
#include "SubField.H"
#include "fvPatchFieldsFwd.H"
#include "autoPtr.H"
#include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -57,8 +58,12 @@ namespace Foam
// Forward Declarations
class fvBoundaryMesh;
class fvPatch;
class surfaceInterpolation;
//- Store lists of fvPatch as a PtrList
typedef PtrList<fvPatch> fvPatchList;
/*---------------------------------------------------------------------------*\
Class fvPatch Declaration
\*---------------------------------------------------------------------------*/

View File

@ -1,57 +1,9 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
-------------------------------------------------------------------------------
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/>.
Typedef
Foam::fvPatchList
Description
container classes for fvPatch
Compatibility include (MAR-2022)
\*---------------------------------------------------------------------------*/
#ifndef fvPatchList_H
#define fvPatchList_H
#include "fvPatch.H"
#include "PtrList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
typedef PtrList<fvPatch> fvPatchList;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -37,8 +37,7 @@ bool Foam::functionObjects::zeroGradient::accept
const GeometricField<Type, fvPatchField, volMesh>& input
)
{
const typename GeometricField<Type, fvPatchField, volMesh>::Boundary&
patches = input.boundaryField();
const auto& patches = input.boundaryField();
forAll(patches, patchi)
{

View File

@ -343,7 +343,7 @@ Foam::PDRblock::innerMesh(const IOobject& io) const
);
polyMesh& pmesh = *meshPtr;
PtrList<polyPatch> patches(patches_.size());
polyPatchList patches(patches_.size());
label startFace = nInternalFaces();

View File

@ -333,7 +333,7 @@ Foam::blockMesh::topology(bool applyTransform) const
const polyBoundaryMesh& pbmOld = origTopo.boundaryMesh();
const polyBoundaryMesh& pbmNew = topoMesh.boundaryMesh();
PtrList<polyPatch> newPatches(pbmOld.size());
polyPatchList newPatches(pbmOld.size());
forAll(pbmOld, patchi)
{

View File

@ -1225,7 +1225,7 @@ bool Foam::faMeshDecomposition::writeDecomposition()
const faPatchList& meshPatches = boundary();
PtrList<faPatch> procPatches
faPatchList procPatches
(
curPatchSizes.size() + curProcessorPatchSizes.size()
);

View File

@ -495,7 +495,7 @@ void Foam::faMeshReconstructor::createMesh()
auto& completeMesh = *serialAreaMesh_;
// Add in non-processor boundary patches
PtrList<faPatch> completePatches(singlePatchEdgeLabels_.size());
faPatchList completePatches(singlePatchEdgeLabels_.size());
forAll(completePatches, patchi)
{
const labelList& patchEdgeLabels = singlePatchEdgeLabels_[patchi];