Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop

This commit is contained in:
mattijs
2017-10-09 14:16:19 +01:00
43 changed files with 801 additions and 315 deletions

View File

@ -76,100 +76,102 @@ Description
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
label addPointZone(const polyMesh& mesh, const word& name) label addPointZone(polyMesh& mesh, const word& name)
{ {
label zoneID = mesh.pointZones().findZoneID(name); pointZoneMesh& zones = mesh.pointZones();
label zoneID = zones.findZoneID(name);
if (zoneID != -1) if (zoneID != -1)
{ {
Info<< "Reusing existing pointZone " Info<< "Reusing existing pointZone " << zones[zoneID].name()
<< mesh.pointZones()[zoneID].name()
<< " at index " << zoneID << endl; << " at index " << zoneID << endl;
}
else
{
pointZoneMesh& pointZones = const_cast<polyMesh&>(mesh).pointZones();
zoneID = pointZones.size();
Info<< "Adding pointZone " << name << " at index " << zoneID << endl;
pointZones.setSize(zoneID+1); return zoneID;
pointZones.set
(
zoneID,
new pointZone
(
name,
labelList(0),
zoneID,
pointZones
)
);
} }
zoneID = zones.size();
Info<< "Adding pointZone " << name << " at index " << zoneID << endl;
zones.setSize(zoneID+1);
zones.set
(
zoneID,
new pointZone
(
name,
labelList(0),
zoneID,
zones
)
);
return zoneID; return zoneID;
} }
label addFaceZone(const polyMesh& mesh, const word& name) label addFaceZone(polyMesh& mesh, const word& name)
{ {
label zoneID = mesh.faceZones().findZoneID(name); faceZoneMesh& zones = mesh.faceZones();
label zoneID = zones.findZoneID(name);
if (zoneID != -1) if (zoneID != -1)
{ {
Info<< "Reusing existing faceZone " << mesh.faceZones()[zoneID].name() Info<< "Reusing existing faceZone " << zones[zoneID].name()
<< " at index " << zoneID << endl; << " at index " << zoneID << endl;
}
else
{
faceZoneMesh& faceZones = const_cast<polyMesh&>(mesh).faceZones();
zoneID = faceZones.size();
Info<< "Adding faceZone " << name << " at index " << zoneID << endl;
faceZones.setSize(zoneID+1); return zoneID;
faceZones.set
(
zoneID,
new faceZone
(
name,
labelList(0),
boolList(),
zoneID,
faceZones
)
);
} }
zoneID = zones.size();
Info<< "Adding faceZone " << name << " at index " << zoneID << endl;
zones.setSize(zoneID+1);
zones.set
(
zoneID,
new faceZone
(
name,
labelList(0),
boolList(),
zoneID,
zones
)
);
return zoneID; return zoneID;
} }
label addCellZone(const polyMesh& mesh, const word& name) label addCellZone(polyMesh& mesh, const word& name)
{ {
label zoneID = mesh.cellZones().findZoneID(name); cellZoneMesh& zones = mesh.cellZones();
label zoneID = zones.findZoneID(name);
if (zoneID != -1) if (zoneID != -1)
{ {
Info<< "Reusing existing cellZone " << mesh.cellZones()[zoneID].name() Info<< "Reusing existing cellZone " << zones[zoneID].name()
<< " at index " << zoneID << endl; << " at index " << zoneID << endl;
}
else
{
cellZoneMesh& cellZones = const_cast<polyMesh&>(mesh).cellZones();
zoneID = cellZones.size();
Info<< "Adding cellZone " << name << " at index " << zoneID << endl;
cellZones.setSize(zoneID+1); return zoneID;
cellZones.set
(
zoneID,
new cellZone
(
name,
labelList(0),
zoneID,
cellZones
)
);
} }
zoneID = zones.size();
Info<< "Adding cellZone " << name << " at index " << zoneID << endl;
zones.setSize(zoneID+1);
zones.set
(
zoneID,
new cellZone
(
name,
labelList(0),
zoneID,
zones
)
);
return zoneID; return zoneID;
} }
@ -340,13 +342,9 @@ int main(int argc, char *argv[])
if (perfectCover) if (perfectCover)
{ {
// Add empty zone for resulting internal faces // Add empty zone for resulting internal faces
label cutZoneID = addFaceZone(mesh, cutZoneName); const label cutZoneID = addFaceZone(mesh, cutZoneName);
mesh.faceZones()[cutZoneID].resetAddressing mesh.faceZones()[cutZoneID].resetAddressing(isf.xfer(), false);
(
isf,
boolList(masterPatch.size(), false)
);
// Add the perfect interface mesh modifier // Add the perfect interface mesh modifier
stitcher.set stitcher.set
@ -370,11 +368,7 @@ int main(int argc, char *argv[])
label masterZoneID = addFaceZone(mesh, mergePatchName + "MasterZone"); label masterZoneID = addFaceZone(mesh, mergePatchName + "MasterZone");
mesh.faceZones()[masterZoneID].resetAddressing mesh.faceZones()[masterZoneID].resetAddressing(isf.xfer(), false);
(
isf,
boolList(masterPatch.size(), false)
);
// Slave patch // Slave patch
const polyPatch& slavePatch = mesh.boundaryMesh()[slavePatchName]; const polyPatch& slavePatch = mesh.boundaryMesh()[slavePatchName];
@ -387,19 +381,11 @@ int main(int argc, char *argv[])
} }
label slaveZoneID = addFaceZone(mesh, mergePatchName + "SlaveZone"); label slaveZoneID = addFaceZone(mesh, mergePatchName + "SlaveZone");
mesh.faceZones()[slaveZoneID].resetAddressing mesh.faceZones()[slaveZoneID].resetAddressing(osf.xfer(), false);
(
osf,
boolList(slavePatch.size(), false)
);
// Add empty zone for cut faces // Add empty zone for cut faces
label cutZoneID = addFaceZone(mesh, cutZoneName); const label cutZoneID = addFaceZone(mesh, cutZoneName);
mesh.faceZones()[cutZoneID].resetAddressing mesh.faceZones()[cutZoneID].resetAddressing(labelList(0), false);
(
labelList(0),
boolList(0, false)
);
// Add the sliding interface mesh modifier // Add the sliding interface mesh modifier

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -22,23 +22,33 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Typedef Typedef
Foam::indirectFaceList Foam::cellIndList
Description Description
An IndirectList of cells.
Typedef
Foam::cellUIndList
Description
A UIndirectList of cells.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef indirectFaceList_H #ifndef cellIndList_H
#define indirectFaceList_H #define cellIndList_H
#include "face.H" // Include all normal list typedefs as well
#include "cellList.H"
#include "IndirectList.H" #include "IndirectList.H"
#include "UIndirectList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
typedef IndirectList<face> indirectFaceList; typedef IndirectList<cell> cellIndList;
typedef UIndirectList<cell> cellUIndList;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -25,7 +25,25 @@ Typedef
Foam::cellList Foam::cellList
Description Description
list of cells A List of cells.
Typedef
Foam::cellUList
Description
A UList of cells.
Typedef
Foam::cellSubList
Description
A SubList of cells.
Typedef
Foam::cellListList
Description
A List of cellList.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -34,15 +52,8 @@ Description
#include "cell.H" #include "cell.H"
#include "List.H" #include "List.H"
#include "SubList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #include "cellListFwd.H"
namespace Foam
{
typedef List<cell> cellList;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif #endif

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -21,24 +21,30 @@ License
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Typedef Header
Foam::indirectCellList cellListFwd.H
Description Description
Forwards for various types of cell lists
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef indirectCellList_H #ifndef cellListFwd_H
#define indirectCellList_H #define cellListFwd_H
#include "cell.H" #include "List.H"
#include "IndirectList.H" #include "SubList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
typedef IndirectList<cell> indirectCellList; class cell;
typedef UList<cell> cellUList;
typedef List<cell> cellList;
typedef SubList<cell> cellSubList;
typedef List<cellList> cellListList;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -22,23 +22,33 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Typedef Typedef
Foam::indirectPointList Foam::edgeIndList
Description Description
An IndirectList of edges.
Typedef
Foam::edgeUIndList
Description
A UIndirectList of edges.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef indirectPointList_H #ifndef edgeIndList_H
#define indirectPointList_H #define edgeIndList_H
#include "point.H" // Include all normal list typedefs as well
#include "edgeList.H"
#include "IndirectList.H" #include "IndirectList.H"
#include "UIndirectList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
typedef IndirectList<point> indirectPointList; typedef IndirectList<edge> edgeIndList;
typedef UIndirectList<edge> edgeUIndList;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -24,18 +24,42 @@ License
Typedef Typedef
Foam::edgeList Foam::edgeList
Description
A List of edges.
Typedef
Foam::edgeUList
Description
A UList of edges.
Typedef
Foam::edgeSubList
Description
A SubList of edges.
Typedef
Foam::edgeListList
Description
A List of edgeList.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef edgeList_H #ifndef edgeList_H
#define edgeList_H #define edgeList_H
#include "edge.H" #include "edge.H"
#include "SubList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
typedef UList<edge> edgeUList;
typedef List<edge> edgeList; typedef List<edge> edgeList;
typedef SubList<edge> edgeSubList;
typedef List<edgeList> edgeListList; typedef List<edgeList> edgeListList;
} }

View File

@ -0,0 +1,58 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
\\/ 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::faceIndList
Description
An IndirectList of faces.
Typedef
Foam::faceUIndList
Description
A UIndirectList of faces.
\*---------------------------------------------------------------------------*/
#ifndef faceIndList_H
#define faceIndList_H
// Include all normal list typedefs as well
#include "faceList.H"
#include "IndirectList.H"
#include "UIndirectList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
typedef IndirectList<face> faceIndList;
typedef UIndirectList<face> faceUIndList;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -25,6 +25,25 @@ Typedef
Foam::faceList Foam::faceList
Description Description
A List of faces.
Typedef
Foam::faceUList
Description
A UList of faces.
Typedef
Foam::faceSubList
Description
A SubList of faces.
Typedef
Foam::faceListList
Description
A List of faceList.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -36,8 +55,6 @@ Description
#include "SubList.H" #include "SubList.H"
#include "faceListFwd.H" #include "faceListFwd.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif #endif
// ************************************************************************* // // ************************************************************************* //

View File

@ -21,10 +21,11 @@ License
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Typedef Header
Foam::faceListFwd faceListFwd.H
Description Description
Forwards for various types of face lists
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -39,6 +40,7 @@ Description
namespace Foam namespace Foam
{ {
class face; class face;
typedef UList<face> faceUList; typedef UList<face> faceUList;
typedef List<face> faceList; typedef List<face> faceList;
typedef SubList<face> faceSubList; typedef SubList<face> faceSubList;

View File

@ -247,17 +247,7 @@ Foam::label Foam::ZoneMesh<ZoneType, MeshType>::whichZone
const label objectIndex const label objectIndex
) const ) const
{ {
const Map<label>& zm = zoneMap(); return zoneMap().lookup(objectIndex, -1);
Map<label>::const_iterator zmIter = zm.find(objectIndex);
if (zmIter == zm.end())
{
return -1;
}
else
{
return zmIter();
}
} }
@ -579,13 +569,13 @@ bool Foam::ZoneMesh<ZoneType, MeshType>::checkParallelSync
template<class ZoneType, class MeshType> template<class ZoneType, class MeshType>
void Foam::ZoneMesh<ZoneType, MeshType>::movePoints(const pointField& p) void Foam::ZoneMesh<ZoneType, MeshType>::movePoints(const pointField& pts)
{ {
PtrList<ZoneType>& zones = *this; PtrList<ZoneType>& zones = *this;
forAll(zones, zonei) forAll(zones, zonei)
{ {
zones[zonei].movePoints(p); zones[zonei].movePoints(pts);
} }
} }

View File

@ -176,7 +176,7 @@ public:
//- Return zone index for the first match, return -1 if not found //- Return zone index for the first match, return -1 if not found
label findIndex(const keyType& key) const; label findIndex(const keyType& key) const;
//- Find zone index given a name //- Find zone index given a name, return -1 if not found
label findZoneID(const word& zoneName) const; label findZoneID(const word& zoneName) const;
//- Mark cells that match the zone specification //- Mark cells that match the zone specification
@ -191,12 +191,12 @@ public:
//- Check zone definition. Return true if in error. //- Check zone definition. Return true if in error.
bool checkDefinition(const bool report = false) const; bool checkDefinition(const bool report = false) const;
//- Check whether all procs have all zones and in same order. Return //- Check whether all procs have all zones and in same order.
// true if in error. // \return True if any errors.
bool checkParallelSync(const bool report = false) const; bool checkParallelSync(const bool report = false) const;
//- Correct zone mesh after moving points //- Correct zone mesh after moving points
void movePoints(const pointField& p); void movePoints(const pointField& pts);
//- writeData member function required by regIOobject //- writeData member function required by regIOobject
bool writeData(Ostream& os) const; bool writeData(Ostream& os) const;

View File

@ -33,8 +33,6 @@ Description
#include "cellZone.H" #include "cellZone.H"
#include "cellZoneMeshFwd.H" #include "cellZoneMeshFwd.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif #endif
// ************************************************************************* // // ************************************************************************* //

View File

@ -36,10 +36,10 @@ Description
namespace Foam namespace Foam
{ {
template<class Zone, class MeshType> class ZoneMesh;
class cellZone; class cellZone;
class polyMesh; class polyMesh;
template<class Zone, class MeshType> class ZoneMesh;
typedef ZoneMesh<cellZone, polyMesh> cellZoneMesh; typedef ZoneMesh<cellZone, polyMesh> cellZoneMesh;
} }

View File

@ -33,8 +33,6 @@ Description
#include "faceZone.H" #include "faceZone.H"
#include "faceZoneMeshFwd.H" #include "faceZoneMeshFwd.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif #endif
// ************************************************************************* // // ************************************************************************* //

View File

@ -36,10 +36,10 @@ Description
namespace Foam namespace Foam
{ {
template<class Zone, class MeshType> class ZoneMesh;
class faceZone; class faceZone;
class polyMesh; class polyMesh;
template<class Zone, class MeshType> class ZoneMesh;
typedef ZoneMesh<faceZone, polyMesh> faceZoneMesh; typedef ZoneMesh<faceZone, polyMesh> faceZoneMesh;
} }

View File

@ -33,8 +33,6 @@ Description
#include "pointZone.H" #include "pointZone.H"
#include "pointZoneMeshFwd.H" #include "pointZoneMeshFwd.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif #endif
// ************************************************************************* // // ************************************************************************* //

View File

@ -36,10 +36,10 @@ Description
namespace Foam namespace Foam
{ {
template<class Zone, class MeshType> class ZoneMesh;
class pointZone; class pointZone;
class polyMesh; class polyMesh;
template<class Zone, class MeshType> class ZoneMesh;
typedef ZoneMesh<pointZone, polyMesh> pointZoneMesh; typedef ZoneMesh<pointZone, polyMesh> pointZoneMesh;
} }

View File

@ -42,6 +42,7 @@ namespace Foam
const char * const Foam::cellZone::labelsName = "cellLabels"; const char * const Foam::cellZone::labelsName = "cellLabels";
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::cellZone::cellZone Foam::cellZone::cellZone

View File

@ -52,7 +52,7 @@ namespace Foam
// Forward declaration of friend functions and operators // Forward declaration of friend functions and operators
class cellZone; class cellZone;
Ostream& operator<<(Ostream&, const cellZone&); Ostream& operator<<(Ostream& os, const cellZone& zn);
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
@ -64,6 +64,12 @@ class cellZone
public zone public zone
{ {
// Private Member Functions
//- Disallow default bitwise copy construct
cellZone(const cellZone&) = delete;
protected: protected:
// Protected data // Protected data
@ -72,14 +78,6 @@ protected:
const cellZoneMesh& zoneMesh_; const cellZoneMesh& zoneMesh_;
private:
// Private Member Functions
//- Disallow default bitwise copy construct
cellZone(const cellZone&);
public: public:
// Static data members // Static data members
@ -117,7 +115,7 @@ public:
const word& name, const word& name,
const labelUList& addr, const labelUList& addr,
const label index, const label index,
const cellZoneMesh& const cellZoneMesh& zm
); );
//- Construct from components, transferring contents //- Construct from components, transferring contents
@ -126,36 +124,36 @@ public:
const word& name, const word& name,
const Xfer<labelList>& addr, const Xfer<labelList>& addr,
const label index, const label index,
const cellZoneMesh& const cellZoneMesh& zm
); );
//- Construct from dictionary //- Construct from dictionary
cellZone cellZone
( (
const word& name, const word& name,
const dictionary&, const dictionary& dict,
const label index, const label index,
const cellZoneMesh& const cellZoneMesh& zm
); );
//- Construct given the original zone and resetting the //- Construct given the original zone,
// cell list and zone mesh information // resetting the cell list and zone mesh information
cellZone cellZone
( (
const cellZone&, const cellZone& cz,
const labelUList& addr, const labelUList& addr,
const label index, const label index,
const cellZoneMesh& const cellZoneMesh& zm
); );
//- Construct given the original zone, resetting the //- Construct given the original zone,
// cell list and zone mesh information // resetting the cell list and zone mesh information
cellZone cellZone
( (
const cellZone&, const cellZone& cz,
const Xfer<labelList>& addr, const Xfer<labelList>& addr,
const label index, const label index,
const cellZoneMesh& const cellZoneMesh& zm
); );
//- Construct and return a clone, resetting the zone mesh //- Construct and return a clone, resetting the zone mesh
@ -190,9 +188,9 @@ public:
static autoPtr<cellZone> New static autoPtr<cellZone> New
( (
const word& name, const word& name,
const dictionary&, const dictionary& dict,
const label index, const label index,
const cellZoneMesh& const cellZoneMesh& zm
); );
@ -211,33 +209,33 @@ public:
//- Check zone definition. Return true if in error. //- Check zone definition. Return true if in error.
virtual bool checkDefinition(const bool report = false) const; virtual bool checkDefinition(const bool report = false) const;
//- Check whether zone is synchronised across coupled boundaries. Return //- Check whether zone is synchronised across coupled boundaries.
// true if in error. // \return True if any errors.
virtual bool checkParallelSync(const bool report = false) const virtual bool checkParallelSync(const bool report = false) const
{ {
return false; return false;
} }
//- Write dictionary //- Write dictionary
virtual void writeDict(Ostream&) const; virtual void writeDict(Ostream& os) const;
// Member Operators // Member Operators
//- Assign to zone, clearing demand-driven data //- Assign to zone, clearing demand-driven data
void operator=(const cellZone&); void operator=(const cellZone& zn);
//- Assign addressing, clearing demand-driven data //- Assign addressing, clearing demand-driven data
void operator=(const labelUList&); void operator=(const labelUList& addr);
//- Assign addressing, clearing demand-driven data //- Assign addressing, clearing demand-driven data
void operator=(const Xfer<labelList>&); void operator=(const Xfer<labelList>& addr);
// I-O // I-O
//- Ostream Operator //- Ostream Operator
friend Ostream& operator<<(Ostream&, const cellZone&); friend Ostream& operator<<(Ostream& os, const cellZone& zn);
}; };

View File

@ -43,6 +43,23 @@ namespace Foam
const char* const Foam::faceZone::labelsName = "faceLabels"; const char* const Foam::faceZone::labelsName = "faceLabels";
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::faceZone::setFlipMap(const bool flipValue)
{
// Match size for flipMap
if (flipMap_.size() == this->size())
{
flipMap_ = flipValue;
}
else
{
// Avoid copying old values on resize
flipMap_.clear();
flipMap_.setSize(this->size(), flipValue);
}
}
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
@ -128,8 +145,8 @@ void Foam::faceZone::calcCellLayers() const
forAll(mf, facei) forAll(mf, facei)
{ {
label ownCelli = own[mf[facei]]; const label ownCelli = own[mf[facei]];
label neiCelli = const label neiCelli =
( (
zoneMesh().mesh().isInternalFace(mf[facei]) zoneMesh().mesh().isInternalFace(mf[facei])
? nei[mf[facei]] ? nei[mf[facei]]
@ -386,6 +403,30 @@ void Foam::faceZone::resetAddressing
} }
void Foam::faceZone::resetAddressing
(
const labelUList& addr,
const bool flipValue
)
{
clearAddressing();
labelList::operator=(addr);
setFlipMap(flipValue);
}
void Foam::faceZone::resetAddressing
(
const Xfer<labelList>& addr,
const bool flipValue
)
{
clearAddressing();
labelList::operator=(addr);
setFlipMap(flipValue);
}
void Foam::faceZone::updateMesh(const mapPolyMesh& mpm) void Foam::faceZone::updateMesh(const mapPolyMesh& mpm)
{ {
clearAddressing(); clearAddressing();
@ -511,11 +552,11 @@ bool Foam::faceZone::checkParallelSync(const bool report) const
} }
void Foam::faceZone::movePoints(const pointField& p) void Foam::faceZone::movePoints(const pointField& pts)
{ {
if (patchPtr_) if (patchPtr_)
{ {
patchPtr_->movePoints(p); patchPtr_->movePoints(pts);
} }
} }

View File

@ -55,7 +55,7 @@ class mapPolyMesh;
// Forward declaration of friend functions and operators // Forward declaration of friend functions and operators
class faceZone; class faceZone;
Ostream& operator<<(Ostream&, const faceZone&); Ostream& operator<<(Ostream& os, const faceZone& zn);
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
@ -66,46 +66,43 @@ class faceZone
: :
public zone public zone
{ {
// Private data
//- The name associated with the zone-labels dictionary entry
static const word labelsName_;
// Private Member Functions // Private Member Functions
//- Set flip-map to constant value
void setFlipMap(const bool flipValue);
//- Disallow default bitwise copy construct //- Disallow default bitwise copy construct
faceZone(const faceZone&); faceZone(const faceZone&) = delete;
//- Disallow default bitwise assignment //- Disallow default bitwise assignment
void operator=(const faceZone&); void operator=(const faceZone&) = delete;
protected: protected:
// Protected data // Protected data
//- Flip map for all faces in the zone. Set to true if the //- Flip map for all faces in the zone.
// face needs to be flipped to achieve the correct orientation. // Use true if the face needs flipping for the correct orientation.
boolList flipMap_; boolList flipMap_;
//- Reference to zone list //- Reference to zone list
const faceZoneMesh& zoneMesh_; const faceZoneMesh& zoneMesh_;
// Demand-driven private data // Demand-driven data
//- Primitive patch made out of correctly flipped faces //- Primitive patch made out of correctly flipped faces
mutable primitiveFacePatch* patchPtr_; mutable primitiveFacePatch* patchPtr_;
//- Master cell layer //- Master cell layer
mutable labelList* masterCellsPtr_; mutable labelList* masterCellsPtr_;
//- Slave cell layer //- Slave cell layer
mutable labelList* slaveCellsPtr_; mutable labelList* slaveCellsPtr_;
//- Global edge addressing //- Global edge addressing
mutable labelList* mePtr_; mutable labelList* mePtr_;
// Protected Member Functions // Protected Member Functions
@ -168,38 +165,38 @@ public:
const Xfer<labelList>& addr, const Xfer<labelList>& addr,
const Xfer<boolList>& fm, const Xfer<boolList>& fm,
const label index, const label index,
const faceZoneMesh& const faceZoneMesh& zm
); );
//- Construct from dictionary //- Construct from dictionary
faceZone faceZone
( (
const word& name, const word& name,
const dictionary&, const dictionary& dict,
const label index, const label index,
const faceZoneMesh& const faceZoneMesh& zm
); );
//- Construct given the original zone and resetting the //- Construct given the original zone and resetting the
// face list and zone mesh information // face list and zone mesh information
faceZone faceZone
( (
const faceZone&, const faceZone& fz,
const labelUList& addr, const labelUList& addr,
const boolList& fm, const boolList& fm,
const label index, const label index,
const faceZoneMesh& const faceZoneMesh& zm
); );
//- Construct given the original zone, resetting the //- Construct given the original zone,
// face list and zone mesh information // resetting the face list and zone mesh information
faceZone faceZone
( (
const faceZone&, const faceZone& fz,
const Xfer<labelList>& addr, const Xfer<labelList>& addr,
const Xfer<boolList>& fm, const Xfer<boolList>& fm,
const label index, const label index,
const faceZoneMesh& const faceZoneMesh& zm
); );
//- Construct and return a clone, resetting the zone mesh //- Construct and return a clone, resetting the zone mesh
@ -235,9 +232,9 @@ public:
static autoPtr<faceZone> New static autoPtr<faceZone> New
( (
const word& name, const word& name,
const dictionary&, const dictionary& dict,
const label index, const label index,
const faceZoneMesh& const faceZoneMesh& zm
); );
@ -247,6 +244,9 @@ public:
// Member Functions // Member Functions
//- Return zoneMesh reference
const faceZoneMesh& zoneMesh() const;
//- Return face flip map //- Return face flip map
const boolList& flipMap() const const boolList& flipMap() const
{ {
@ -259,52 +259,71 @@ public:
//- Return reference to primitive patch //- Return reference to primitive patch
const primitiveFacePatch& operator()() const; const primitiveFacePatch& operator()() const;
//- Return zoneMesh reference
const faceZoneMesh& zoneMesh() const;
// Addressing into mesh
// Addressing into mesh //- Return labels of master cells (cells next to the master face
// zone in the prescribed direction)
const labelList& masterCells() const;
//- Return labels of master cells (cells next to the master face //- Return labels of slave cells
// zone in the prescribed direction) const labelList& slaveCells() const;
const labelList& masterCells() const;
//- Return labels of slave cells //- Return global edge index for local edges
const labelList& slaveCells() const; const labelList& meshEdges() const;
//- Return global edge index for local edges
const labelList& meshEdges() const;
//- Clear addressing //- Clear addressing
virtual void clearAddressing(); virtual void clearAddressing();
//- Reset addressing and flip map (clearing demand-driven data) //- Reset addressing and flip map.
virtual void resetAddressing(const labelUList&, const boolList&); // Clears demand-driven data.
virtual void resetAddressing
(
const labelUList& addr,
const boolList& flipMap
);
//- Reset addressing - use constant flip map
// Clears demand-driven data.
virtual void resetAddressing
(
const labelUList& addr,
const bool flipValue
);
//- Reset addressing - use constant flip map
// Clears demand-driven data.
virtual void resetAddressing
(
const Xfer<labelList>& addr,
const bool flipValue
);
//- Check zone definition. Return true if in error. //- Check zone definition. Return true if in error.
virtual bool checkDefinition(const bool report = false) const; virtual bool checkDefinition(const bool report = false) const;
//- Check whether all procs have faces synchronised. Return //- Check whether all procs have faces synchronised.
// true if in error. // \return True if any errors.
virtual bool checkParallelSync(const bool report = false) const; virtual bool checkParallelSync(const bool report = false) const;
//- Correct patch after moving points //- Correct patch after moving points
virtual void movePoints(const pointField&); virtual void movePoints(const pointField& pts);
//- Update for changes in topology //- Update for changes in topology
virtual void updateMesh(const mapPolyMesh&); virtual void updateMesh(const mapPolyMesh& mpm);
//- Write //- Write
virtual void write(Ostream&) const; virtual void write(Ostream& os) const;
//- Write dictionary //- Write dictionary
virtual void writeDict(Ostream&) const; virtual void writeDict(Ostream& os) const;
// I-O // I-O
//- Ostream Operator //- Ostream Operator
friend Ostream& operator<<(Ostream&, const faceZone&); friend Ostream& operator<<(Ostream& os, const faceZone& zn);
}; };

View File

@ -33,7 +33,7 @@ Description
#include "face.H" #include "face.H"
#include "PrimitivePatch.H" #include "PrimitivePatch.H"
#include "indirectFaceList.H" #include "IndirectList.H"
#include "pointField.H" #include "pointField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -42,6 +42,7 @@ namespace Foam
const char* const Foam::pointZone::labelsName = "pointLabels"; const char* const Foam::pointZone::labelsName = "pointLabels";
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::pointZone::pointZone Foam::pointZone::pointZone

View File

@ -53,7 +53,7 @@ namespace Foam
// Forward declaration of friend functions and operators // Forward declaration of friend functions and operators
class pointZone; class pointZone;
Ostream& operator<<(Ostream&, const pointZone&); Ostream& operator<<(Ostream& os, const pointZone& zn);
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
@ -64,6 +64,11 @@ class pointZone
: :
public zone public zone
{ {
// Private Member Functions
//- Disallow default bitwise copy construct
pointZone(const pointZone&) = delete;
protected: protected:
@ -72,10 +77,6 @@ protected:
//- Reference to zone list //- Reference to zone list
const pointZoneMesh& zoneMesh_; const pointZoneMesh& zoneMesh_;
// Private Member Functions
//- Disallow default bitwise copy construct
pointZone(const pointZone&);
public: public:
@ -114,7 +115,7 @@ public:
const word& name, const word& name,
const labelUList& addr, const labelUList& addr,
const label index, const label index,
const pointZoneMesh& const pointZoneMesh& zm
); );
//- Construct from components, transferring contents //- Construct from components, transferring contents
@ -123,36 +124,36 @@ public:
const word& name, const word& name,
const Xfer<labelList>& addr, const Xfer<labelList>& addr,
const label index, const label index,
const pointZoneMesh& const pointZoneMesh& zm
); );
//- Construct from dictionary //- Construct from dictionary
pointZone pointZone
( (
const word& name, const word& name,
const dictionary&, const dictionary& dict,
const label index, const label index,
const pointZoneMesh& const pointZoneMesh& zm
); );
//- Construct given the original zone and resetting the //- Construct given the original zone and resetting the
// point list and zone mesh information // point list and zone mesh information
pointZone pointZone
( (
const pointZone&, const pointZone& pz,
const labelUList& addr, const labelUList& addr,
const label index, const label index,
const pointZoneMesh& const pointZoneMesh& zm
); );
//- Construct given the original zone, resetting the //- Construct given the original zone,
// face list and zone mesh information // resetting the point list and zone mesh information
pointZone pointZone
( (
const pointZone&, const pointZone& pz,
const Xfer<labelList>& addr, const Xfer<labelList>& addr,
const label index, const label index,
const pointZoneMesh& const pointZoneMesh& zm
); );
//- Construct and return a clone, resetting the zone mesh //- Construct and return a clone, resetting the zone mesh
@ -187,9 +188,9 @@ public:
static autoPtr<pointZone> New static autoPtr<pointZone> New
( (
const word& name, const word& name,
const dictionary&, const dictionary& dict,
const label index, const label index,
const pointZoneMesh& const pointZoneMesh& zm
); );
@ -208,8 +209,8 @@ public:
//- Check zone definition. Return true if in error. //- Check zone definition. Return true if in error.
virtual bool checkDefinition(const bool report = false) const; virtual bool checkDefinition(const bool report = false) const;
//- Check whether zone is synchronised across coupled boundaries. Return //- Check whether zone is synchronised across coupled boundaries.
// true if in error. // \return True if any errors.
virtual bool checkParallelSync(const bool report = false) const; virtual bool checkParallelSync(const bool report = false) const;
//- Correct patch after moving points //- Correct patch after moving points
@ -217,25 +218,25 @@ public:
{} {}
//- Write dictionary //- Write dictionary
virtual void writeDict(Ostream&) const; virtual void writeDict(Ostream& os) const;
// Member Operators // Member Operators
//- Assign to zone, clearing demand-driven data //- Assign to zone, clearing demand-driven data
void operator=(const pointZone&); void operator=(const pointZone& zn);
//- Assign addressing, clearing demand-driven data //- Assign addressing, clearing demand-driven data
void operator=(const labelUList&); void operator=(const labelUList& addr);
//- Assign addressing, clearing demand-driven data //- Assign addressing, clearing demand-driven data
void operator=(const Xfer<labelList>&); void operator=(const Xfer<labelList>& addr);
// I-O // I-O
//- Ostream Operator //- Ostream Operator
friend Ostream& operator<<(Ostream&, const pointZone&); friend Ostream& operator<<(Ostream& os, const pointZone& zn);
}; };

View File

@ -127,13 +127,13 @@ Foam::zone::zone
Foam::zone::zone Foam::zone::zone
( (
const zone& z, const zone& zn,
const labelUList& addr, const labelUList& addr,
const label index const label index
) )
: :
labelList(addr), labelList(addr),
name_(z.name()), name_(zn.name()),
index_(index), index_(index),
lookupMapPtr_(nullptr) lookupMapPtr_(nullptr)
{} {}
@ -141,13 +141,13 @@ Foam::zone::zone
Foam::zone::zone Foam::zone::zone
( (
const zone& z, const zone& zn,
const Xfer<labelList>& addr, const Xfer<labelList>& addr,
const label index const label index
) )
: :
labelList(addr), labelList(addr),
name_(z.name()), name_(zn.name()),
index_(index), index_(index),
lookupMapPtr_(nullptr) lookupMapPtr_(nullptr)
{} {}
@ -165,18 +165,7 @@ Foam::zone::~zone()
Foam::label Foam::zone::localID(const label globalCellID) const Foam::label Foam::zone::localID(const label globalCellID) const
{ {
const Map<label>& lm = lookupMap(); return lookupMap().lookup(globalCellID, -1);
Map<label>::const_iterator lmIter = lm.find(globalCellID);
if (lmIter == lm.end())
{
return -1;
}
else
{
return lmIter();
}
} }
@ -197,7 +186,8 @@ bool Foam::zone::checkDefinition(const label maxSize, const bool report) const
forAll(addr, i) forAll(addr, i)
{ {
if (addr[i] < 0 || addr[i] >= maxSize) const label idx = addr[i];
if (idx < 0 || idx >= maxSize)
{ {
hasError = true; hasError = true;
@ -205,7 +195,7 @@ bool Foam::zone::checkDefinition(const label maxSize, const bool report) const
{ {
SeriousErrorInFunction SeriousErrorInFunction
<< "Zone " << name_ << "Zone " << name_
<< " contains invalid index label " << addr[i] << nl << " contains invalid index label " << idx << nl
<< "Valid index labels are 0.." << "Valid index labels are 0.."
<< maxSize-1 << endl; << maxSize-1 << endl;
} }
@ -215,13 +205,13 @@ bool Foam::zone::checkDefinition(const label maxSize, const bool report) const
break; break;
} }
} }
else if (!elems.insert(addr[i])) else if (!elems.insert(idx))
{ {
if (report) if (report)
{ {
WarningInFunction WarningInFunction
<< "Zone " << name_ << "Zone " << name_
<< " contains duplicate index label " << addr[i] << endl; << " contains duplicate index label " << idx << endl;
} }
} }
} }
@ -239,9 +229,9 @@ void Foam::zone::write(Ostream& os) const
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<(Ostream& os, const zone& z) Foam::Ostream& Foam::operator<<(Ostream& os, const zone& zn)
{ {
z.write(os); zn.write(os);
os.check(FUNCTION_NAME); os.check(FUNCTION_NAME);
return os; return os;
} }

View File

@ -49,7 +49,7 @@ namespace Foam
// Forward declaration of friend functions and operators // Forward declaration of friend functions and operators
class zone; class zone;
Ostream& operator<<(Ostream&, const zone&); Ostream& operator<<(Ostream& os, const zone& zn);
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class zone Declaration Class zone Declaration
@ -59,6 +59,11 @@ class zone
: :
public labelList public labelList
{ {
// Private Member Functions
//- Disallow default bitwise copy construct
zone(const zone&) = delete;
protected: protected:
@ -71,10 +76,10 @@ protected:
label index_; label index_;
// Demand-driven private data // Demand-driven private data
//- Map of labels in zone for fast location lookup //- Map of labels in zone for fast location lookup
mutable Map<label>* lookupMapPtr_; mutable Map<label>* lookupMapPtr_;
// Protected Member Functions // Protected Member Functions
@ -82,9 +87,6 @@ protected:
//- Construct the look-up map //- Construct the look-up map
void calcLookupMap() const; void calcLookupMap() const;
//- Disallow default bitwise copy construct
zone(const zone&);
public: public:
@ -114,7 +116,7 @@ public:
zone zone
( (
const word& name, const word& name,
const dictionary&, const dictionary& dict,
const word& labelsName, const word& labelsName,
const label index const label index
); );
@ -123,7 +125,7 @@ public:
// cell list and zone mesh information // cell list and zone mesh information
zone zone
( (
const zone&, const zone& zn,
const labelUList& addr, const labelUList& addr,
const label index const label index
); );
@ -132,7 +134,7 @@ public:
// cell list and zone mesh information // cell list and zone mesh information
zone zone
( (
const zone&, const zone& zn,
const Xfer<labelList>& addr, const Xfer<labelList>& addr,
const label index const label index
); );
@ -178,20 +180,20 @@ public:
) const; ) const;
//- Correct patch after moving points //- Correct patch after moving points
virtual void movePoints(const pointField&) virtual void movePoints(const pointField& pts)
{} {}
//- Write //- Write
virtual void write(Ostream&) const; virtual void write(Ostream& os) const;
//- Write dictionary //- Write dictionary
virtual void writeDict(Ostream&) const = 0; virtual void writeDict(Ostream& os) const = 0;
// I-O // I-O
//- Ostream Operator //- Ostream Operator
friend Ostream& operator<<(Ostream&, const zone&); friend Ostream& operator<<(Ostream& os, const zone& zn);
}; };

View File

@ -25,7 +25,7 @@ Typedef
Foam::indirectPrimitivePatch Foam::indirectPrimitivePatch
Description Description
Foam::indirectPrimitivePatch A PrimitivePatch using an IndirectList for the faces.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -25,7 +25,7 @@ Typedef
Foam::uindirectPrimitivePatch Foam::uindirectPrimitivePatch
Description Description
Foam::uindirectPrimitivePatch A PrimitivePatch using a UIndirectList for the faces.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -117,6 +117,8 @@ public:
// Member Functions // Member Functions
// Access
//- Is there a hit //- Is there a hit
bool hit() const bool hit() const
{ {
@ -167,6 +169,8 @@ public:
return eligibleMiss_; return eligibleMiss_;
} }
// Edit
void setHit() void setHit()
{ {
hit_ = true; hit_ = true;

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -83,6 +83,8 @@ public:
// Member Functions // Member Functions
// Access
//- Is there a hit //- Is there a hit
inline bool hit() const inline bool hit() const
{ {
@ -96,6 +98,19 @@ public:
} }
// Edit
void setHit()
{
hit_ = true;
}
void setMiss()
{
hit_ = false;
}
// Ostream operator // Ostream operator
inline friend Ostream& operator<<(Ostream& os, const objectHit& obj) inline friend Ostream& operator<<(Ostream& os, const objectHit& obj)

View File

@ -0,0 +1,58 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
\\/ 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::pointIndList
Description
An IndirectList of points.
Typedef
Foam::pointUIndList
Description
A UIndirectList of points.
\*---------------------------------------------------------------------------*/
#ifndef pointIndList_H
#define pointIndList_H
// Include all normal list typedefs as well
#include "pointList.H"
#include "IndirectList.H"
#include "UIndirectList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
typedef IndirectList<point> pointIndList;
typedef UIndirectList<point> pointUIndList;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -25,13 +25,25 @@ Typedef
Foam::pointList Foam::pointList
Description Description
A List of points A List of points.
Typedef
Foam::pointUList
Description
A UList of points.
Typedef
Foam::pointSubList
Description
A SubList of points.
Typedef Typedef
Foam::pointListList Foam::pointListList
Description Description
A List of labelList A List of pointList.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -40,14 +52,15 @@ Description
#include "point.H" #include "point.H"
#include "List.H" #include "List.H"
#include "SubList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
// Note: frequently used UList version is located in container itself typedef UList<point> pointUList;
typedef List<point> pointList; typedef List<point> pointList;
typedef SubList<point> pointSubList;
typedef List<pointList> pointListList; typedef List<pointList> pointListList;
} }

View File

@ -37,13 +37,19 @@ Typedef
Foam::labelPairList Foam::labelPairList
Description Description
List of labelPairs List of labelPairs.
Typedef Typedef
Foam::labelPairUList Foam::labelPairUList
Description Description
UList of labelPairs UList of labelPairs.
Typedef
Foam::labelPairSubList
Description
A SubList of labelPairs.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -51,6 +57,7 @@ Description
#define labelPair_H #define labelPair_H
#include "List.H" #include "List.H"
#include "SubList.H"
#include "Pair.H" #include "Pair.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -61,6 +68,7 @@ namespace Foam
typedef Pair<labelPair> labelPairPair; typedef Pair<labelPair> labelPairPair;
typedef List<labelPair> labelPairList; typedef List<labelPair> labelPairList;
typedef UList<labelPair> labelPairUList; typedef UList<labelPair> labelPairUList;
typedef SubList<labelPair> labelPairSubList;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -0,0 +1,58 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
\\/ 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::scalarIndList
Description
An IndirectList of scalars.
Typedef
Foam::scalarUIndList
Description
A UIndirectList of scalars.
\*---------------------------------------------------------------------------*/
#ifndef scalarIndList_H
#define scalarIndList_H
// Include all normal list typedefs as well
#include "scalarList.H"
#include "IndirectList.H"
#include "UIndirectList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
typedef IndirectList<scalar> scalarIndList;
typedef UIndirectList<scalar> scalarUIndList;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -21,9 +21,6 @@ License
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
Specialisation of List\<T\> for scalar.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "scalarList.H" #include "scalarList.H"

View File

@ -33,6 +33,18 @@ Typedef
Description Description
A List of scalars. A List of scalars.
Typedef
Foam::scalarSubList
Description
A SubList of scalars.
Typedef
Foam::scalarListList
Description
A List of scalarList.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef scalarList_H #ifndef scalarList_H
@ -40,14 +52,15 @@ Description
#include "scalar.H" #include "scalar.H"
#include "List.H" #include "List.H"
#include "SubList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
typedef UList<scalar> scalarUList; typedef UList<scalar> scalarUList;
typedef List<scalar> scalarList; typedef List<scalar> scalarList;
typedef SubList<scalar> scalarSubList;
typedef List<scalarList> scalarListList; typedef List<scalarList> scalarListList;
} }

View File

@ -0,0 +1,58 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
\\/ 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::vectorIndList
Description
An IndirectList of vectors.
Typedef
Foam::vectorUIndList
Description
A UIndirectList of vectors.
\*---------------------------------------------------------------------------*/
#ifndef vectorIndList_H
#define vectorIndList_H
// Include all normal list typedefs as well
#include "vectorList.H"
#include "IndirectList.H"
#include "UIndirectList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
typedef IndirectList<vector> vectorIndList;
typedef UIndirectList<vector> vectorUIndList;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -33,6 +33,18 @@ Typedef
Description Description
A List of vectors. A List of vectors.
Typedef
Foam::vectorSubList
Description
A SubList of vectors.
Typedef
Foam::vectorListList
Description
A List of vectorList.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef vectorList_H #ifndef vectorList_H
@ -40,14 +52,16 @@ Description
#include "vector.H" #include "vector.H"
#include "List.H" #include "List.H"
#include "SubList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
typedef UList<vector> vectorUList; typedef UList<vector> vectorUList;
typedef List<vector> vectorList; typedef List<vector> vectorList;
typedef SubList<vector> vectorSubList;
typedef List<vectorList> vectorListList;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -0,0 +1,58 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
\\/ 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::labelIndList
Description
A IndirectList of labels.
Typedef
Foam::labelUIndList
Description
An UIndirectList of labels.
\*---------------------------------------------------------------------------*/
#ifndef labelIndList_H
#define labelIndList_H
// Include all normal list typedefs as well
#include "labelList.H"
#include "IndirectList.H"
#include "UIndirectList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
typedef IndirectList<label> labelIndList;
typedef UIndirectList<label> labelUIndList;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -25,19 +25,25 @@ Typedef
Foam::labelList Foam::labelList
Description Description
A List of labels A List of labels.
Typedef
Foam::labelSubList
Description
A SubList of labels.
Typedef Typedef
Foam::labelListList Foam::labelListList
Description Description
A List of labelList A List of labelList.
Typedef Typedef
Foam::labelListListList Foam::labelListListList
Description Description
A List of labelListList A List of labelListList.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -46,14 +52,16 @@ Description
#include "label.H" #include "label.H"
#include "List.H" #include "List.H"
#include "SubList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
// Note: frequently used UList version is located in container itself // Note: frequently used labelUList is defined in UList itself
typedef List<label> labelList; typedef List<label> labelList;
typedef SubList<label> labelSubList;
typedef List<labelList> labelListList; typedef List<labelList> labelListList;
typedef List<labelListList> labelListListList; typedef List<labelListList> labelListListList;
} }

View File

@ -33,6 +33,12 @@ Typedef
Description Description
A List of fileNames. A List of fileNames.
Typedef
Foam::fileNameSubList
Description
A SubList of fileNames.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef fileNameList_H #ifndef fileNameList_H
@ -40,14 +46,15 @@ Description
#include "fileName.H" #include "fileName.H"
#include "List.H" #include "List.H"
#include "SubList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
typedef UList<fileName> fileNameUList; typedef UList<fileName> fileNameUList;
typedef List<fileName> fileNameList; typedef List<fileName> fileNameList;
typedef SubList<fileName> fileNameSubList;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -33,6 +33,12 @@ Typedef
Description Description
A List of strings. A List of strings.
Typedef
Foam::stringSubList
Description
A SubList of strings.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef stringList_H #ifndef stringList_H
@ -40,14 +46,15 @@ Description
#include "string.H" #include "string.H"
#include "List.H" #include "List.H"
#include "SubList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
typedef UList<string> stringUList; typedef UList<string> stringUList;
typedef List<string> stringList; typedef List<string> stringList;
typedef SubList<string> stringSubList;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -33,6 +33,12 @@ Typedef
Description Description
A List of words. A List of words.
Typedef
Foam::wordSubList
Description
A SubList of words.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef wordList_H #ifndef wordList_H
@ -40,14 +46,15 @@ Description
#include "word.H" #include "word.H"
#include "List.H" #include "List.H"
#include "SubList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
typedef UList<word> wordUList; typedef UList<word> wordUList;
typedef List<word> wordList; typedef List<word> wordList;
typedef SubList<word> wordSubList;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //