Zone: Moved generic functionality from derived zone types into Zone

This commit is contained in:
Henry Weller
2024-03-26 18:40:56 +00:00
parent df6d3bf9d2
commit 5292cbdb5b
19 changed files with 97 additions and 753 deletions

View File

@ -514,15 +514,12 @@ zone = $(polyMesh)/zones/zone
cellZone = $(polyMesh)/zones/cellZone
$(cellZone)/cellZone.C
$(cellZone)/cellZoneNew.C
faceZone = $(polyMesh)/zones/faceZone
$(faceZone)/faceZone.C
$(faceZone)/faceZoneNew.C
pointZone = $(polyMesh)/zones/pointZone
$(pointZone)/pointZone.C
$(pointZone)/pointZoneNew.C
$(polyMesh)/polyMesh.C
$(polyMesh)/polyMeshFromShapeMesh.C

View File

@ -101,11 +101,10 @@ Foam::Zone<ZoneType, ZonesType>::Zone
(
const word& name,
const dictionary& dict,
const word& labelsName,
const ZonesType& zones
)
:
labelList(dict.lookup(labelsName)),
labelList(dict.lookup(ZoneType::labelsName)),
name_(name),
zones_(zones),
lookupMapPtr_(nullptr)
@ -142,6 +141,41 @@ Foam::Zone<ZoneType, ZonesType>::Zone
{}
template<class ZoneType, class ZonesType>
Foam::autoPtr<ZoneType> Foam::Zone<ZoneType, ZonesType>::New
(
const word& name,
const dictionary& dict,
const ZonesType& mz
)
{
if (ZoneType::debug)
{
InfoInFunction
<< "Constructing " << ZoneType::typeName << " " << name << endl;
}
const word type(dict.lookup("type"));
typename dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(type);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalIOErrorInFunction
(
dict
) << "Unknown " << ZoneType::typeName << " type "
<< type << nl << nl
<< "Valid " << ZoneType::typeName << " types are:" << nl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalIOError);
}
return autoPtr<ZoneType>(cstrIter()(name, dict, mz));
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class ZoneType, class ZonesType>
@ -268,14 +302,6 @@ void Foam::Zone<ZoneType, ZonesType>::distribute(const polyDistributionMap&)
}
template<class ZoneType, class ZonesType>
void Foam::Zone<ZoneType, ZonesType>::write(Ostream& os) const
{
os << nl << name_
<< nl << static_cast<const labelList&>(*this);
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class ZoneType, class ZonesType>
@ -315,7 +341,7 @@ void Foam::Zone<ZoneType, ZonesType>::operator=(labelList&& indices)
template<class ZoneType, class ZonesType>
Foam::Ostream& Foam::operator<<(Ostream& os, const Zone<ZoneType, ZonesType>& z)
{
z.write(os);
z.writeDict(os);
os.check("Ostream& operator<<(Ostream& f, const Zone& z");
return os;
}

View File

@ -92,6 +92,22 @@ protected:
public:
// Declare run-time constructor selection tables
declareRunTimeSelectionTable
(
autoPtr,
ZoneType,
dictionary,
(
const word& name,
const dictionary& dict,
const ZonesType& mz
),
(name, dict, mz)
);
// Constructors
//- Construct from components
@ -115,7 +131,6 @@ public:
(
const word& name,
const dictionary&,
const word& labelsName,
const ZonesType& zones
);
@ -141,6 +156,18 @@ public:
Zone(const Zone&) = delete;
// Selectors
//- Return a pointer to a new cell zone
// created on freestore from dictionary
static autoPtr<ZoneType> New
(
const word& name,
const dictionary&,
const ZonesType&
);
//- Destructor
virtual ~Zone();
@ -196,9 +223,6 @@ public:
//- Redistribute or update using the given distribution map
virtual void distribute(const polyDistributionMap&);
//- Write
virtual void write(Ostream&) const;
//- Write dictionary
virtual void writeDict(Ostream&) const = 0;

View File

@ -35,6 +35,20 @@ Description
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// class faceZones
// :
// public Zones<faceZone, polyMesh>
// {
// public:
// using Zones<faceZone, polyMesh>::Zones;
// };
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -43,15 +43,6 @@ namespace Foam
class polyMesh;
typedef Zones<faceZone, polyMesh> faceZones;
// class faceZones
// :
// public Zones<faceZone, polyMesh>
// {
// public:
// using Zones<faceZone, polyMesh>::Zones;
// };
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -33,75 +33,15 @@ License
namespace Foam
{
typedef Zone<cellZone, cellZones> cellZoneType;
defineTemplateRunTimeSelectionTable(cellZoneType, dictionary);
defineTypeNameAndDebug(cellZone, 0);
defineRunTimeSelectionTable(cellZone, dictionary);
addToRunTimeSelectionTable(cellZone, cellZone, dictionary);
}
const char * const Foam::cellZone::labelsName = "cellLabels";
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::cellZone::cellZone
(
const word& name,
const labelUList& addr,
const cellZones& mz
)
:
Zone<cellZone, cellZones>(name, addr, mz)
{}
Foam::cellZone::cellZone
(
const word& name,
labelList&& addr,
const cellZones& mz
)
:
Zone<cellZone, cellZones>(name, move(addr), mz)
{}
Foam::cellZone::cellZone
(
const word& name,
const dictionary& dict,
const cellZones& mz
)
:
Zone<cellZone, cellZones>(name, dict, this->labelsName, mz)
{}
Foam::cellZone::cellZone
(
const cellZone& cz,
const labelUList& addr,
const cellZones& mz
)
:
Zone<cellZone, cellZones>(cz, addr, mz)
{}
Foam::cellZone::cellZone
(
const cellZone& cz,
labelList&& addr,
const cellZones& mz
)
:
Zone<cellZone, cellZones>(cz, move(addr), mz)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::cellZone::~cellZone()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
@ -160,18 +100,4 @@ void Foam::cellZone::writeDict(Ostream& os) const
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
void Foam::cellZone::operator=(const cellZone& zn)
{
Zone<cellZone, cellZones>::operator=(zn);
}
void Foam::cellZone::operator=(cellZone&& zn)
{
Zone<cellZone, cellZones>::operator=(move(zn));
}
// ************************************************************************* //

View File

@ -60,81 +60,18 @@ class cellZone
public:
typedef cellZones ZonesType;
// Static Data Members
//- The name associated with the zone-labels dictionary entry
static const char* const labelsName;
//- Runtime type information
TypeName("cellZone");
// Declare run-time constructor selection tables
declareRunTimeSelectionTable
(
autoPtr,
cellZone,
dictionary,
(
const word& name,
const dictionary& dict,
const cellZones& mz
),
(name, dict, mz)
);
// Constructors
//- Construct from components
cellZone
(
const word& name,
const labelUList& addr,
const cellZones&
);
//- Construct from components, transferring contents
cellZone
(
const word& name,
labelList&& addr,
const cellZones&
);
//- Construct from dictionary
cellZone
(
const word& name,
const dictionary&,
const cellZones&
);
//- Construct given the original zone and resetting the
// cell list and mesh zones information
cellZone
(
const cellZone&,
const labelUList& addr,
const cellZones&
);
//- Construct given the original zone, resetting the
// cell list and mesh zones information
cellZone
(
const cellZone&,
labelList&& addr,
const cellZones&
);
//- Disallow default bitwise copy construction
cellZone(const cellZone&) = delete;
using Zone<cellZone, cellZones>::Zone;
//- Construct and return a clone, resetting the mesh zones
virtual autoPtr<cellZone> clone(const cellZones& mz) const
@ -160,22 +97,6 @@ public:
}
// Selectors
//- Return a pointer to a new cell zone
// created on freestore from dictionary
static autoPtr<cellZone> New
(
const word& name,
const dictionary&,
const cellZones&
);
//- Destructor
virtual ~cellZone();
// Member Functions
//- Convenient renaming of zone::localIndex(globalIndex)
@ -201,12 +122,6 @@ public:
// Member Operators
using Zone<cellZone, cellZones>::operator=;
//- Assignment to zone, clearing demand-driven data
void operator=(const cellZone&);
//- Move assignment to zone, clearing demand-driven data
void operator=(cellZone&&);
};

View File

@ -1,64 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2024 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 "cellZone.H"
#include "dictionary.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::autoPtr<Foam::cellZone> Foam::cellZone::New
(
const word& name,
const dictionary& dict,
const cellZones& mz
)
{
if (debug)
{
InfoInFunction << "Constructing cellZone " << name << endl;
}
const word zoneType(dict.lookup("type"));
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(zoneType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalIOErrorInFunction
(
dict
) << "Unknown cellZone type "
<< zoneType << nl << nl
<< "Valid cellZone types are:" << nl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalIOError);
}
return autoPtr<cellZone>(cstrIter()(name, dict, mz));
}
// ************************************************************************* //

View File

@ -1,48 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 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/>.
Typedef
Foam::indirectCellList
Description
\*---------------------------------------------------------------------------*/
#ifndef indirectCellList_H
#define indirectCellList_H
#include "cell.H"
#include "IndirectList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
typedef IndirectList<cell> indirectCellList;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -34,8 +34,10 @@ License
namespace Foam
{
typedef Zone<faceZone, faceZones> faceZoneType;
defineTemplateRunTimeSelectionTable(faceZoneType, dictionary);
defineTypeNameAndDebug(faceZone, 0);
defineRunTimeSelectionTable(faceZone, dictionary);
addToRunTimeSelectionTable(faceZone, faceZone, dictionary);
}
@ -242,7 +244,7 @@ Foam::faceZone::faceZone
const faceZones& mz
)
:
Zone<faceZone, faceZones>(name, dict, this->labelsName, mz),
Zone<faceZone, faceZones>(name, dict, mz),
flipMap_(dict.lookup("flipMap")),
patchPtr_(nullptr),
masterCellsPtr_(nullptr),
@ -546,14 +548,6 @@ void Foam::faceZone::movePoints(const pointField& p)
}
void Foam::faceZone::write(Ostream& os) const
{
os << nl << name()
<< nl << static_cast<const labelList&>(*this)
<< nl << flipMap();
}
void Foam::faceZone::writeDict(Ostream& os) const
{
os << nl << name() << nl << token::BEGIN_BLOCK << nl
@ -582,14 +576,4 @@ void Foam::faceZone::operator=(faceZone&& zn)
}
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<(Ostream& os, const faceZone& zn)
{
zn.write(os);
os.check("Ostream& operator<<(Ostream&, const faceZone&");
return os;
}
// ************************************************************************* //

View File

@ -121,27 +121,10 @@ public:
//- The name associated with the zone-labels dictionary entry
static const char* const labelsName;
//- Runtime type information
TypeName("faceZone");
// Declare run-time constructor selection tables
declareRunTimeSelectionTable
(
autoPtr,
faceZone,
dictionary,
(
const word& name,
const dictionary& dict,
const faceZones& mz
),
(name, dict, mz)
);
// Constructors
//- Construct from components
@ -193,7 +176,6 @@ public:
//- Disallow default bitwise copy construction
faceZone(const faceZone&) = delete;
//- Construct and return a clone, resetting the mesh zones
virtual autoPtr<faceZone> clone(const faceZones& mz) const
{
@ -219,18 +201,6 @@ public:
}
// Selectors
//- Return a pointer to a new face zone
// created on freestore from dictionary
static autoPtr<faceZone> New
(
const word& name,
const dictionary&,
const faceZones&
);
//- Destructor
virtual ~faceZone();
@ -288,9 +258,6 @@ public:
//- Update zone using the given map
virtual void topoChange(const polyTopoChangeMap&);
//- Write
virtual void write(Ostream&) const;
//- Write dictionary
virtual void writeDict(Ostream&) const;
@ -302,12 +269,6 @@ public:
//- Move assignment to zone, clearing demand-driven data
void operator=(faceZone&&);
// I-O
//- Ostream Operator
friend Ostream& operator<<(Ostream&, const faceZone&);
};

View File

@ -1,64 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2024 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 "faceZone.H"
#include "dictionary.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::autoPtr<Foam::faceZone> Foam::faceZone::New
(
const word& name,
const dictionary& dict,
const faceZones& mz
)
{
if (debug)
{
InfoInFunction << "Constructing faceZone " << name << endl;
}
const word zoneType(dict.lookup("type"));
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(zoneType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalIOErrorInFunction
(
dict
) << "Unknown faceZone type "
<< zoneType << nl << nl
<< "Valid faceZone types are:" << nl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalIOError);
}
return autoPtr<faceZone>(cstrIter()(name, dict, mz));
}
// ************************************************************************* //

View File

@ -1,48 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 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/>.
Typedef
Foam::indirectFaceList
Description
\*---------------------------------------------------------------------------*/
#ifndef indirectFaceList_H
#define indirectFaceList_H
#include "face.H"
#include "IndirectList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
typedef IndirectList<face> indirectFaceList;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,48 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 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/>.
Typedef
Foam::indirectPointList
Description
\*---------------------------------------------------------------------------*/
#ifndef indirectPointList_H
#define indirectPointList_H
#include "point.H"
#include "IndirectList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
typedef IndirectList<point> indirectPointList;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -34,75 +34,15 @@ License
namespace Foam
{
typedef Zone<pointZone, pointZones> pointZoneType;
defineTemplateRunTimeSelectionTable(pointZoneType, dictionary);
defineTypeNameAndDebug(pointZone, 0);
defineRunTimeSelectionTable(pointZone, dictionary);
addToRunTimeSelectionTable(pointZone, pointZone, dictionary);
}
const char* const Foam::pointZone::labelsName = "pointLabels";
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::pointZone::pointZone
(
const word& name,
const labelUList& addr,
const pointZones& mz
)
:
Zone<pointZone, pointZones>(name, addr, mz)
{}
Foam::pointZone::pointZone
(
const word& name,
labelList&& addr,
const pointZones& mz
)
:
Zone<pointZone, pointZones>(name, move(addr), mz)
{}
Foam::pointZone::pointZone
(
const word& name,
const dictionary& dict,
const pointZones& mz
)
:
Zone<pointZone, pointZones>(name, dict, this->labelsName, mz)
{}
Foam::pointZone::pointZone
(
const pointZone& pz,
const labelUList& addr,
const pointZones& mz
)
:
Zone<pointZone, pointZones>(pz, addr, mz)
{}
Foam::pointZone::pointZone
(
const pointZone& pz,
labelList&& addr,
const pointZones& mz
)
:
Zone<pointZone, pointZones>(pz, move(addr), mz)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::pointZone::~pointZone()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
@ -213,18 +153,4 @@ void Foam::pointZone::writeDict(Ostream& os) const
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
void Foam::pointZone::operator=(const pointZone& zn)
{
Zone<pointZone, pointZones>::operator=(zn);
}
void Foam::pointZone::operator=(pointZone&& zn)
{
Zone<pointZone, pointZones>::operator=(move(zn));
}
// ************************************************************************* //

View File

@ -61,8 +61,6 @@ class pointZone
public:
typedef pointZones ZonesType;
// Static Data Members
//- The name associated with the zone-labels dictionary entry
@ -73,69 +71,9 @@ public:
TypeName("pointZone");
// Declare run-time constructor selection tables
declareRunTimeSelectionTable
(
autoPtr,
pointZone,
dictionary,
(
const word& name,
const dictionary& dict,
const pointZones& mz
),
(name, dict, mz)
);
// Constructors
//- Construct from components
pointZone
(
const word& name,
const labelUList& addr,
const pointZones&
);
//- Construct from components, transferring contents
pointZone
(
const word& name,
labelList&& addr,
const pointZones&
);
//- Construct from dictionary
pointZone
(
const word& name,
const dictionary&,
const pointZones&
);
//- Construct given the original zone and resetting the
// point list and mesh zones information
pointZone
(
const pointZone&,
const labelUList& addr,
const pointZones&
);
//- Construct given the original zone, resetting the
// face list and mesh zones information
pointZone
(
const pointZone&,
labelList&& addr,
const pointZones&
);
//- Disallow default bitwise copy construction
pointZone(const pointZone&) = delete;
using Zone<pointZone, pointZones>::Zone;
//- Construct and return a clone, resetting the mesh zones
virtual autoPtr<pointZone> clone(const pointZones& mz) const
@ -150,8 +88,8 @@ public:
// and mesh zones
virtual autoPtr<pointZone> clone
(
const pointZones& mz,
const labelUList& addr
const labelUList& addr,
const pointZones& mz
) const
{
return autoPtr<pointZone>
@ -161,22 +99,6 @@ public:
}
// Selectors
//- Return a pointer to a new point zone
// created on freestore from dictionary
static autoPtr<pointZone> New
(
const word& name,
const dictionary&,
const pointZones&
);
//- Destructor
virtual ~pointZone();
// Member Functions
//- Convenient renaming of zone::localIndex(globalIndex)
@ -199,12 +121,6 @@ public:
// Member Operators
using Zone<pointZone, pointZones>::operator=;
//- Assignment to zone, clearing demand-driven data
void operator=(const pointZone&);
//- Move assignment to zone, clearing demand-driven data
void operator=(pointZone&&);
};

View File

@ -1,64 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2024 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 "pointZone.H"
#include "dictionary.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::autoPtr<Foam::pointZone> Foam::pointZone::New
(
const word& name,
const dictionary& dict,
const pointZones& mz
)
{
if (debug)
{
InfoInFunction << "Constructing pointZone " << name << endl;
}
const word zoneType(dict.lookup("type"));
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(zoneType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalIOErrorInFunction
(
dict
) << "Unknown pointZone type "
<< zoneType << nl << nl
<< "Valid pointZone types are:" << nl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalIOError);
}
return autoPtr<pointZone>(cstrIter()(name, dict, mz));
}
// ************************************************************************* //

View File

@ -366,8 +366,8 @@ void Foam::singleCellFvMesh::agglomerateMesh
zoneI,
oldFz.clone
(
pointZones(),
newAddressing
newAddressing,
pointZones()
)
);
}

View File

@ -984,8 +984,8 @@ void Foam::domainDecomposition::decompose()
zoneI,
pz[zoneI].clone
(
procMesh.pointZones(),
zonePoints[zoneI].shrink()
zonePoints[zoneI].shrink(),
procMesh.pointZones()
)
);
}