Commit b5dc2a5e authored by mattijs's avatar mattijs
Browse files

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

parents caf49712 24577907
......@@ -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)
{
Info<< "Reusing existing pointZone "
<< mesh.pointZones()[zoneID].name()
Info<< "Reusing existing pointZone " << zones[zoneID].name()
<< " at index " << zoneID << endl;
return zoneID;
}
else
{
pointZoneMesh& pointZones = const_cast<polyMesh&>(mesh).pointZones();
zoneID = pointZones.size();
Info<< "Adding pointZone " << name << " at index " << zoneID << endl;
pointZones.setSize(zoneID+1);
pointZones.set
zoneID = zones.size();
Info<< "Adding pointZone " << name << " at index " << zoneID << endl;
zones.setSize(zoneID+1);
zones.set
(
zoneID,
new pointZone
(
name,
labelList(0),
zoneID,
new pointZone
(
name,
labelList(0),
zoneID,
pointZones
)
);
}
zones
)
);
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)
{
Info<< "Reusing existing faceZone " << mesh.faceZones()[zoneID].name()
Info<< "Reusing existing faceZone " << zones[zoneID].name()
<< " at index " << zoneID << endl;
return zoneID;
}
else
{
faceZoneMesh& faceZones = const_cast<polyMesh&>(mesh).faceZones();
zoneID = faceZones.size();
Info<< "Adding faceZone " << name << " at index " << zoneID << endl;
faceZones.setSize(zoneID+1);
faceZones.set
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,
new faceZone
(
name,
labelList(0),
boolList(),
zoneID,
faceZones
)
);
}
zones
)
);
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)
{
Info<< "Reusing existing cellZone " << mesh.cellZones()[zoneID].name()
Info<< "Reusing existing cellZone " << zones[zoneID].name()
<< " at index " << zoneID << endl;
return zoneID;
}
else
{
cellZoneMesh& cellZones = const_cast<polyMesh&>(mesh).cellZones();
zoneID = cellZones.size();
Info<< "Adding cellZone " << name << " at index " << zoneID << endl;
cellZones.setSize(zoneID+1);
cellZones.set
zoneID = zones.size();
Info<< "Adding cellZone " << name << " at index " << zoneID << endl;
zones.setSize(zoneID+1);
zones.set
(
zoneID,
new cellZone
(
name,
labelList(0),
zoneID,
new cellZone
(
name,
labelList(0),
zoneID,
cellZones
)
);
}
zones
)
);
return zoneID;
}
......@@ -340,13 +342,9 @@ int main(int argc, char *argv[])
if (perfectCover)
{
// Add empty zone for resulting internal faces
label cutZoneID = addFaceZone(mesh, cutZoneName);
const label cutZoneID = addFaceZone(mesh, cutZoneName);
mesh.faceZones()[cutZoneID].resetAddressing
(
isf,
boolList(masterPatch.size(), false)
);
mesh.faceZones()[cutZoneID].resetAddressing(isf.xfer(), false);
// Add the perfect interface mesh modifier
stitcher.set
......@@ -370,11 +368,7 @@ int main(int argc, char *argv[])
label masterZoneID = addFaceZone(mesh, mergePatchName + "MasterZone");
mesh.faceZones()[masterZoneID].resetAddressing
(
isf,
boolList(masterPatch.size(), false)
);
mesh.faceZones()[masterZoneID].resetAddressing(isf.xfer(), false);
// Slave patch
const polyPatch& slavePatch = mesh.boundaryMesh()[slavePatchName];
......@@ -387,19 +381,11 @@ int main(int argc, char *argv[])
}
label slaveZoneID = addFaceZone(mesh, mergePatchName + "SlaveZone");
mesh.faceZones()[slaveZoneID].resetAddressing
(
osf,
boolList(slavePatch.size(), false)
);
mesh.faceZones()[slaveZoneID].resetAddressing(osf.xfer(), false);
// Add empty zone for cut faces
label cutZoneID = addFaceZone(mesh, cutZoneName);
mesh.faceZones()[cutZoneID].resetAddressing
(
labelList(0),
boolList(0, false)
);
const label cutZoneID = addFaceZone(mesh, cutZoneName);
mesh.faceZones()[cutZoneID].resetAddressing(labelList(0), false);
// Add the sliding interface mesh modifier
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -22,23 +22,33 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Typedef
Foam::indirectFaceList
Foam::cellIndList
Description
An IndirectList of cells.
Typedef
Foam::cellUIndList
Description
A UIndirectList of cells.
\*---------------------------------------------------------------------------*/
#ifndef indirectFaceList_H
#define indirectFaceList_H
#ifndef cellIndList_H
#define cellIndList_H
#include "face.H"
// Include all normal list typedefs as well
#include "cellList.H"
#include "IndirectList.H"
#include "UIndirectList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
typedef IndirectList<face> indirectFaceList;
typedef IndirectList<cell> cellIndList;
typedef UIndirectList<cell> cellUIndList;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -25,7 +25,25 @@ Typedef
Foam::cellList
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 "List.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
typedef List<cell> cellList;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "SubList.H"
#include "cellListFwd.H"
#endif
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -21,24 +21,30 @@ License
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
Header
cellListFwd.H
Description
Forwards for various types of cell lists
\*---------------------------------------------------------------------------*/
#ifndef indirectCellList_H
#define indirectCellList_H
#ifndef cellListFwd_H
#define cellListFwd_H
#include "cell.H"
#include "IndirectList.H"
#include "List.H"
#include "SubList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
typedef IndirectList<cell> indirectCellList;
class cell;
typedef UList<cell> cellUList;
typedef List<cell> cellList;
typedef SubList<cell> cellSubList;
typedef List<cellList> cellListList;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -22,23 +22,33 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Typedef
Foam::indirectPointList
Foam::edgeIndList
Description
An IndirectList of edges.
Typedef
Foam::edgeUIndList
Description
A UIndirectList of edges.
\*---------------------------------------------------------------------------*/
#ifndef indirectPointList_H
#define indirectPointList_H
#ifndef edgeIndList_H
#define edgeIndList_H
#include "point.H"
// Include all normal list typedefs as well
#include "edgeList.H"
#include "IndirectList.H"
#include "UIndirectList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
typedef IndirectList<point> indirectPointList;
typedef IndirectList<edge> edgeIndList;
typedef UIndirectList<edge> edgeUIndList;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -24,18 +24,42 @@ License
Typedef
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
#define edgeList_H
#include "edge.H"
#include "SubList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
typedef UList<edge> edgeUList;
typedef List<edge> edgeList;
typedef SubList<edge> edgeSubList;
typedef List<edgeList> edgeListList;
}
......
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
// ************************************************************************* //
......@@ -25,6 +25,25 @@ Typedef
Foam::faceList
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 "faceListFwd.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
......@@ -21,10 +21,11 @@ License
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::faceListFwd
Header
faceListFwd.H
Description
Forwards for various types of face lists
\*---------------------------------------------------------------------------*/
......@@ -39,6 +40,7 @@ Description
namespace Foam
{
class face;
typedef UList<face> faceUList;
typedef List<face> faceList;
typedef SubList<face> faceSubList;
......
......@@ -247,17 +247,7 @@ Foam::label Foam::ZoneMesh<ZoneType, MeshType>::whichZone
const label objectIndex
) const
{
const Map<label>& zm = zoneMap();
Map<label>::const_iterator zmIter = zm.find(objectIndex);
if (zmIter == zm.end())
{
return -1;
}
else
{
return zmIter();
}
return zoneMap().lookup(objectIndex, -1);
}
......@@ -579,13 +569,13 @@ bool Foam::ZoneMesh<ZoneType, MeshType>::checkParallelSync
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;
forAll(zones, zonei)
{
zones[zonei].movePoints(p);
zones[zonei].movePoints(pts);
}
}
......
......@@ -176,7 +176,7 @@ public:
//- Return zone index for the first match, return -1 if not found
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;
//- Mark cells that match the zone specification
......@@ -191,12 +191,12 @@ public:
//- Check zone definition. Return true if in error.
bool checkDefinition(const bool report = false) const;
//- Check whether all procs have all zones and in same order. Return
// true if in error.