GIT: moved polyTopoChange from dynamicMesh -> meshTools

This commit is contained in:
Andrew Heather
2020-04-06 09:23:59 +01:00
committed by Mark Olesen
parent 44b225604d
commit 3688957e01
18 changed files with 405 additions and 403 deletions

View File

@ -21,9 +21,7 @@ polyMeshModifier = polyTopoChange/polyMeshModifier
$(polyMeshModifier)/polyMeshModifier.C
$(polyMeshModifier)/polyMeshModifierNew.C
polyTopoChange/polyTopoChange/topoAction/topoActions.C
polyTopoChange/polyTopoChanger/polyTopoChanger.C
polyTopoChange/polyTopoChange/polyTopoChange.C
polyTopoChange/polyTopoChange/addPatchCellLayer.C
polyTopoChange/polyTopoChange/pointEdgeCollapse/pointEdgeCollapse.C
polyTopoChange/polyTopoChange/edgeCollapser.C

View File

@ -1,199 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::polyAddCell
Description
Class containing data for cell addition.
\*---------------------------------------------------------------------------*/
#ifndef polyAddCell_H
#define polyAddCell_H
#include "label.H"
#include "topoAction.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class polyAddCell Declaration
\*---------------------------------------------------------------------------*/
class polyAddCell
:
public topoAction
{
// Private data
//- Master point ID for cells blown up from points
label masterPointID_;
//- Master edge ID for cells blown up from edges
label masterEdgeID_;
//- Master face ID for cells blown up from faces
label masterFaceID_;
//- Master cell ID for cells blown up from cells
label masterCellID_;
//- Cell zone ID
label zoneID_;
public:
// Static data members
//- Runtime type information
TypeName("addCell");
// Constructors
//- Construct null. Used for constructing lists
polyAddCell()
:
masterPointID_(-1),
masterEdgeID_(-1),
masterFaceID_(-1),
masterCellID_(-1),
zoneID_(-1)
{}
//- Construct from components
polyAddCell
(
const label masterPointID,
const label masterEdgeID,
const label masterFaceID,
const label masterCellID,
const label zoneID
)
:
masterPointID_(masterPointID),
masterEdgeID_(masterEdgeID),
masterFaceID_(masterFaceID),
masterCellID_(masterCellID),
zoneID_(zoneID)
{}
//- Construct and return a clone
virtual autoPtr<topoAction> clone() const
{
return autoPtr<topoAction>(new polyAddCell(*this));
}
// Default Destructor
// Member Functions
//- Is the cell mastered by a point
bool isPointMaster() const
{
return masterPointID_ >= 0;
}
//- Is the cell mastered by an edge
bool isEdgeMaster() const
{
return masterEdgeID_ >= 0;
}
//- Is the cell mastered by another face
bool isFaceMaster() const
{
return masterFaceID_ >= 0;
}
//- Is the cell mastered by another cell
bool isCellMaster() const
{
return masterCellID_ >= 0;
}
//- Is the cell appended with no master
bool appended() const
{
return
!isPointMaster() && !isEdgeMaster()
&& !isFaceMaster() && !isCellMaster();
}
//- Return master point ID
label masterPointID() const
{
return masterPointID_;
}
//- Return master edge ID
label masterEdgeID() const
{
return masterEdgeID_;
}
//- Return master face ID
label masterFaceID() const
{
return masterFaceID_;
}
//- Return master cell ID
label masterCellID() const
{
return masterCellID_;
}
//- Does the cell belong to a zone?
bool isInZone() const
{
return zoneID_ >= 0;
}
//- Cell zone ID
label zoneID() const
{
return zoneID_;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,352 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::polyAddFace
Description
A face addition data class. A face can be inflated either from a
point or from another face and can either be in internal or a
boundary face.
\*---------------------------------------------------------------------------*/
#ifndef polyAddFace_H
#define polyAddFace_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "label.H"
#include "face.H"
#include "topoAction.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class polyAddFace Declaration
\*---------------------------------------------------------------------------*/
class polyAddFace
:
public topoAction
{
// Private data
//- Face identifier
face face_;
//- Face owner
label owner_;
//- Face neighbour
label neighbour_;
//- Master point ID for faces blown up from points
label masterPointID_;
//- Master edge ID for faces blown up from edges
label masterEdgeID_;
//- Master face ID for faces blown up from faces
label masterFaceID_;
//- Does the face flux need to be flipped
bool flipFaceFlux_;
//- Boundary patch ID
label patchID_;
//- Face zone ID
label zoneID_;
//- Face zone flip
bool zoneFlip_;
public:
// Static data members
//- Runtime type information
TypeName("addFace");
// Constructors
//- Construct null. Used for constructing lists
polyAddFace()
:
face_(0),
owner_(-1),
neighbour_(-1),
masterPointID_(-1),
masterEdgeID_(-1),
masterFaceID_(-1),
flipFaceFlux_(false),
patchID_(-1),
zoneID_(-1),
zoneFlip_(false)
{}
//- Construct from components
polyAddFace
(
const face& f,
const label owner,
const label neighbour,
const label masterPointID,
const label masterEdgeID,
const label masterFaceID,
const bool flipFaceFlux,
const label patchID,
const label zoneID,
const bool zoneFlip
)
:
face_(f),
owner_(owner),
neighbour_(neighbour),
masterPointID_(masterPointID),
masterEdgeID_(masterEdgeID),
masterFaceID_(masterFaceID),
flipFaceFlux_(flipFaceFlux),
patchID_(patchID),
zoneID_(zoneID),
zoneFlip_(zoneFlip)
{
if (face_.size() < 3)
{
FatalErrorInFunction
<< "This is not allowed.\n"
<< "Face: " << face_
<< " masterPointID:" << masterPointID_
<< " masterEdgeID:" << masterEdgeID_
<< " masterFaceID:" << masterFaceID_
<< " patchID:" << patchID_
<< " owner:" << owner_
<< " neighbour:" << neighbour_
<< abort(FatalError);
}
if (min(face_) < 0)
{
FatalErrorInFunction
<< "This is not allowed.\n"
<< "Face: " << face_
<< " masterPointID:" << masterPointID_
<< " masterEdgeID:" << masterEdgeID_
<< " masterFaceID:" << masterFaceID_
<< " patchID:" << patchID_
<< " owner:" << owner_
<< " neighbour:" << neighbour_
<< abort(FatalError);
}
if (min(owner_, neighbour_) >= 0 && owner_ == neighbour_)
{
FatalErrorInFunction
<< "This is not allowed.\n"
<< "Face: " << face_
<< " masterPointID:" << masterPointID_
<< " masterEdgeID:" << masterEdgeID_
<< " masterFaceID:" << masterFaceID_
<< " patchID:" << patchID_
<< " owner:" << owner_
<< " neighbour:" << neighbour_
<< abort(FatalError);
}
if (neighbour_ >= 0 && patchID >= 0)
{
FatalErrorInFunction
<< ". This is not allowed.\n"
<< "Face: " << face_
<< " masterPointID:" << masterPointID_
<< " masterEdgeID:" << masterEdgeID_
<< " masterFaceID:" << masterFaceID_
<< " patchID:" << patchID_
<< " owner:" << owner_
<< " neighbour:" << neighbour_
<< abort(FatalError);
}
if (owner_ < 0 && zoneID < 0)
{
FatalErrorInFunction
<< "This is not allowed.\n"
<< "Face: " << face_
<< "Face: " << face_
<< " masterPointID:" << masterPointID_
<< " masterEdgeID:" << masterEdgeID_
<< " masterFaceID:" << masterFaceID_
<< " patchID:" << patchID_
<< " owner:" << owner_
<< " neighbour:" << neighbour_
<< abort(FatalError);
}
if (zoneID_ == -1 && zoneFlip)
{
FatalErrorInFunction
<< "belong to zone. This is not allowed.\n"
<< "Face: " << face_
<< " masterPointID:" << masterPointID_
<< " masterEdgeID:" << masterEdgeID_
<< " masterFaceID:" << masterFaceID_
<< " patchID:" << patchID_
<< " owner:" << owner_
<< " neighbour:" << neighbour_
<< abort(FatalError);
}
}
//- Construct and return a clone
virtual autoPtr<topoAction> clone() const
{
return autoPtr<topoAction>(new polyAddFace(*this));
}
// Default Destructor
// Member Functions
//- Return face
const face& newFace() const
{
return face_;
}
//- Return owner cell
label owner() const
{
return owner_;
}
//- Return neighbour cell
label neighbour() const
{
return neighbour_;
}
//- Is the face mastered by a point
bool isPointMaster() const
{
return masterPointID_ >= 0;
}
//- Is the face mastered by an edge
bool isEdgeMaster() const
{
return masterEdgeID_ >= 0;
}
//- Is the face mastered by another face
bool isFaceMaster() const
{
return masterFaceID_ >= 0;
}
//- Is the face appended with no master
bool appended() const
{
return !isPointMaster() && !isEdgeMaster() && !isFaceMaster();
}
//- Return master point ID
label masterPointID() const
{
return masterPointID_;
}
//- Return master edge ID
label masterEdgeID() const
{
return masterEdgeID_;
}
//- Return master face ID
label masterFaceID() const
{
return masterFaceID_;
}
//- Does the face flux need to be flipped
bool flipFaceFlux() const
{
return flipFaceFlux_;
}
//- Does the face belong to a boundary patch?
bool isInPatch() const
{
return patchID_ >= 0;
}
//- Boundary patch ID
label patchID() const
{
return patchID_;
}
//- Does the face belong to a zone?
bool isInZone() const
{
return zoneID_ >= 0;
}
//- Is the face only a zone face (i.e. not belonging to a cell)
bool onlyInZone() const
{
return zoneID_ >= 0 && owner_ < 0 && neighbour_ < 0;
}
//- Face zone ID
label zoneID() const
{
return zoneID_;
}
//- Face zone flip
label zoneFlip() const
{
return zoneFlip_;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,172 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::polyAddPoint
Description
Class containing data for point addition.
\*---------------------------------------------------------------------------*/
#ifndef polyAddPoint_H
#define polyAddPoint_H
#include "label.H"
#include "point.H"
#include "topoAction.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class polyAddPoint Declaration
\*---------------------------------------------------------------------------*/
class polyAddPoint
:
public topoAction
{
// Private data
//- Point to add
point p_;
//- Master point
label masterPointID_;
//- Point zone ID
label zoneID_;
//- Does the point support a cell
bool inCell_;
public:
// Static data members
//- Runtime type information
TypeName("addPoint");
// Constructors
//- Construct null. Used only for list construction
polyAddPoint()
:
p_(Zero),
masterPointID_(-1),
zoneID_(-1),
inCell_(false)
{}
//- Construct from components
polyAddPoint
(
const point& p,
const label masterPointID,
const label zoneID,
const bool inCell
)
:
p_(p),
masterPointID_(masterPointID),
zoneID_(zoneID),
inCell_(inCell)
{
if (zoneID_ < 0 && !inCell)
{
FatalErrorInFunction
<< "This is not allowed.\n"
<< "point: " << p
<< " master: " << masterPointID_
<< " zone: " << zoneID_
<< abort(FatalError);
}
}
//- Construct and return a clone
virtual autoPtr<topoAction> clone() const
{
return autoPtr<topoAction>(new polyAddPoint(*this));
}
// Default Destructor
// Member Functions
//- Point location
const point& newPoint() const
{
return p_;
}
//- Master point label
label masterPointID() const
{
return masterPointID_;
}
//- Is the point appended with no master
bool appended() const
{
return masterPointID_ < 0;
}
//- Does the point belong to a zone?
bool isInZone() const
{
return zoneID_ >= 0;
}
//- Point zone ID
label zoneID() const
{
return zoneID_;
}
//- Does the point support a cell
bool inCell() const
{
return inCell_;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,140 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::polyModifyCell
Description
Class describing modification of a cell.
\*---------------------------------------------------------------------------*/
#ifndef polyModifyCell_H
#define polyModifyCell_H
#include "label.H"
#include "topoAction.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class polyModifyCell Declaration
\*---------------------------------------------------------------------------*/
class polyModifyCell
:
public topoAction
{
// Private data
//- Cell ID
label cellID_;
//- Remove from current zone
bool removeFromZone_;
//- New zone ID
label zoneID_;
public:
// Static data members
//- Runtime type information
TypeName("modifyCell");
// Constructors
//- Construct null. Used only for list construction
polyModifyCell()
:
cellID_(-1),
removeFromZone_(false),
zoneID_(-1)
{}
//- Construct from components
polyModifyCell
(
const label cellID,
const bool removeFromZone,
const label newZoneID
)
:
cellID_(cellID),
removeFromZone_(removeFromZone),
zoneID_(newZoneID)
{}
//- Construct and return a clone
virtual autoPtr<topoAction> clone() const
{
return autoPtr<topoAction>(new polyModifyCell(*this));
}
// Default Destructor
// Member Functions
//- Cell ID
label cellID() const
{
return cellID_;
}
//- Does the cell belong to a zone?
bool isInZone() const
{
return zoneID_ >= 0;
}
bool removeFromZone() const
{
return removeFromZone_;
}
//- Cell zone ID
label zoneID() const
{
return zoneID_;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,281 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::polyModifyFace
Description
Class describing modification of a face.
\*---------------------------------------------------------------------------*/
#ifndef polyModifyFace_H
#define polyModifyFace_H
#include "label.H"
#include "face.H"
#include "topoAction.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class polyModifyFace Declaration
\*---------------------------------------------------------------------------*/
class polyModifyFace
:
public topoAction
{
// Private data
//- Face
face face_;
//- Master face ID
label faceID_;
//- Face owner
label owner_;
//- Face neighbour
label neighbour_;
//- Does the face flux need to be flipped
bool flipFaceFlux_;
//- Boundary patch ID
label patchID_;
//- Remove from current zone
bool removeFromZone_;
//- Face zone ID
label zoneID_;
//- Face zone flip
bool zoneFlip_;
public:
// Static data members
//- Runtime type information
TypeName("modifyFace");
// Constructors
//- Construct null. Used in constructing lists
polyModifyFace()
:
face_(0),
faceID_(-1),
owner_(-1),
neighbour_(-1),
flipFaceFlux_(false),
patchID_(-1),
removeFromZone_(false),
zoneID_(-1),
zoneFlip_(false)
{}
//- Construct from components
polyModifyFace
(
const face& f,
const label faceID,
const label owner,
const label neighbour,
const bool flipFaceFlux,
const label patchID,
const bool removeFromZone,
const label zoneID,
const bool zoneFlip
)
:
face_(f),
faceID_(faceID),
owner_(owner),
neighbour_(neighbour),
flipFaceFlux_(flipFaceFlux),
patchID_(patchID),
removeFromZone_(removeFromZone),
zoneID_(zoneID),
zoneFlip_(zoneFlip)
{
if (face_.size() < 3)
{
FatalErrorInFunction
<< "Invalid face: less than 3 points. This is not allowed\n"
<< "Face: " << face_
<< " faceID:" << faceID_
<< " owner:" << owner_
<< " neighbour:" << neighbour_
<< abort(FatalError);
}
if (min(face_) < 0)
{
FatalErrorInFunction
<< "This is not allowed.\n"
<< " faceID:" << faceID_
<< " owner:" << owner_
<< " neighbour:" << neighbour_
<< abort(FatalError);
}
if (min(owner_, neighbour_) >= 0 && owner_ == neighbour_)
{
FatalErrorInFunction
<< "This is not allowed.\n"
<< "Face: " << face_
<< " faceID:" << faceID_
<< " owner:" << owner_
<< " neighbour:" << neighbour_
<< abort(FatalError);
}
if (neighbour_ >= 0 && patchID_ >= 0)
{
FatalErrorInFunction
<< "This is not allowed.\n"
<< "Face: " << face_
<< " faceID:" << faceID_
<< " owner:" << owner_
<< " neighbour:" << neighbour_
<< " patchID:" << patchID_
<< abort(FatalError);
}
if (zoneID_ < 0 && zoneFlip )
{
FatalErrorInFunction
<< "belong to zone. This is not allowed.\n"
<< "Face: " << face_
<< " faceID:" << faceID_
<< " owner:" << owner_
<< " neighbour:" << neighbour_
<< abort(FatalError);
}
}
//- Construct and return a clone
virtual autoPtr<topoAction> clone() const
{
return autoPtr<topoAction>(new polyModifyFace(*this));
}
// Default Destructor
// Member Functions
//- Return face
const face& newFace() const
{
return face_;
}
//- Return master face ID
label faceID() const
{
return faceID_;
}
//- Return owner cell ID
label owner() const
{
return owner_;
}
//- Return owner cell ID
label neighbour() const
{
return neighbour_;
}
//- Does the face flux need to be flipped
bool flipFaceFlux() const
{
return flipFaceFlux_;
}
//- Does the face belong to a boundary patch?
bool isInPatch() const
{
return patchID_ >= 0;
}
//- Boundary patch ID
label patchID() const
{
return patchID_;
}
//- Does the face belong to a zone?
bool isInZone() const
{
return zoneID_ >= 0;
}
//- Is the face only a zone face (i.e. not belonging to a cell)
bool onlyInZone() const
{
return zoneID_ >= 0 && owner_ < 0 && neighbour_ < 0;
}
bool removeFromZone() const
{
return removeFromZone_;
}
//- Face zone ID
label zoneID() const
{
return zoneID_;
}
//- Face zone flip
label zoneFlip() const
{
return zoneFlip_;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,166 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::polyModifyPoint
Description
Class describing modification of a point.
\*---------------------------------------------------------------------------*/
#ifndef polyModifyPoint_H
#define polyModifyPoint_H
#include "label.H"
#include "point.H"
#include "topoAction.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class polyModifyPoint Declaration
\*---------------------------------------------------------------------------*/
class polyModifyPoint
:
public topoAction
{
// Private data
//- Point ID
label pointID_;
//- New point location
point location_;
//- Remove from current zone
bool removeFromZone_;
//- New zone ID
label zoneID_;
//- Does the point support a cell
bool inCell_;
public:
// Static data members
//- Runtime type information
TypeName("modifyPoint");
// Constructors
//- Construct null. Used only for list construction
polyModifyPoint()
:
pointID_(-1),
location_(Zero),
removeFromZone_(false),
zoneID_(-1),
inCell_(false)
{}
//- Construct from components
polyModifyPoint
(
const label pointID,
const point& newP,
const bool removeFromZone,
const label newZoneID,
const bool inCell
)
:
pointID_(pointID),
location_(newP),
removeFromZone_(removeFromZone),
zoneID_(newZoneID),
inCell_(inCell)
{}
//- Construct and return a clone
virtual autoPtr<topoAction> clone() const
{
return autoPtr<topoAction>(new polyModifyPoint(*this));
}
// Default Destructor
// Member Functions
//- Point ID
label pointID() const
{
return pointID_;
}
//- New point location
const point& newPoint() const
{
return location_;
}
//- Does the point belong to a zone?
bool isInZone() const
{
return zoneID_ >= 0;
}
//- Should the point be removed from current zone
bool removeFromZone() const
{
return removeFromZone_;
}
//- Point zone ID
label zoneID() const
{
return zoneID_;
}
//- Does the point support a cell
bool inCell() const
{
return inCell_;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

File diff suppressed because it is too large Load Diff

View File

@ -1,651 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::polyTopoChange
Description
Direct mesh changes based on v1.3 polyTopoChange syntax.
Instead of recording changes and executing them all in one go (as did
v1.3 polyTopoChange) this class actually holds the current
points/faces/cells and does the change immediately.
It can be asked to compress out all unused points/faces/cells and
renumber everything to be consistent.
Note:
- polyTopoChange can be copied.
- adding a face using non-existing cells causes all intermediate cells
to be added. So always first add cells/points and then faces.
(or set strict checking)
- strict checking:
- any added/modified face can only use already existing vertices
- any added face can only use already existing cells
- no item can be removed more than once.
- removed cell: cell set to 0 faces.
- removed face: face set to 0 vertices.
- removed point: coordinate set to vector::max (VGREAT,VGREAT,VGREAT).
Note that this might give problems if this value is used already.
To see if point is equal to above value we don't use == (which might give
problems with roundoff error) but instead compare the individual component
with >.
- coupled patches: the reorderCoupledFaces routine (borrowed from
the couplePatches utility) reorders coupled patch faces and
uses the cyclicPolyPatch,processorPolyPatch functionality.
SourceFiles
polyTopoChange.C
polyTopoChangeI.H
polyTopoChangeTemplates.C
\*---------------------------------------------------------------------------*/
#ifndef polyTopoChange_H
#define polyTopoChange_H
#include "DynamicList.H"
#include "labelList.H"
#include "pointField.H"
#include "Map.H"
#include "HashSet.H"
#include "mapPolyMesh.H"
#include "bitSet.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declarations
class face;
class primitiveMesh;
class polyMesh;
class fvMesh;
class Time;
class fileName;
class polyBoundaryMesh;
class polyPatch;
class dictionary;
class topoAction;
class objectMap;
class IOobject;
template<class T, class Container> class CompactListList;
/*---------------------------------------------------------------------------*\
Class polyTopoChange Declaration
\*---------------------------------------------------------------------------*/
class polyTopoChange
{
// Private data
//- Whether to allow referencing illegal points/cells/faces
// when adding/removing data.
bool strict_;
// Patches
//- Number of patches
label nPatches_;
// Points
//- Current point set
DynamicList<point> points_;
//- Original point label (or masterpoint for added points)
DynamicList<label> pointMap_;
//- For all original and added points contains new point label.
// (used to map return value of addPoint to new mesh point)
DynamicList<label> reversePointMap_;
//- Zone of point
Map<label> pointZone_;
//- Retired points
labelHashSet retiredPoints_;
// Faces
//- Current faceList
DynamicList<face> faces_;
//- Patch for every external face (-1 for internal faces)
DynamicList<label> region_;
//- Owner for all faces
DynamicList<label> faceOwner_;
//- Neighbour for internal faces (-1 for external faces)
DynamicList<label> faceNeighbour_;
//- Original face label. Or master face for added-from-faces;
// -1 for faces added-from-edge or added-from-point)
DynamicList<label> faceMap_;
//- For all original and added faces contains new face label
// (used to map return value of addFace to new mesh face)
DynamicList<label> reverseFaceMap_;
//- Faces added from point (corresponding faceMap_ will
// be -1)
Map<label> faceFromPoint_;
//- Faces added from edge (corresponding faceMap_ will
// be -1)
Map<label> faceFromEdge_;
//- In mapping whether to reverse the flux.
bitSet flipFaceFlux_;
//- Zone of face
Map<label> faceZone_;
//- Orientation of face in zone
bitSet faceZoneFlip_;
//- Active faces
label nActiveFaces_;
// Cells
//- Original cell label or master cell for added-from-cell;
// -1 for cells added from face or edge.
DynamicList<label> cellMap_;
//- For all original and added cells contains new cell label
// (used to map return value of addCell to new mesh cell)
DynamicList<label> reverseCellMap_;
//- Cells added from point
Map<label> cellFromPoint_;
//- Cells added from edge
Map<label> cellFromEdge_;
//- Cells added from face
Map<label> cellFromFace_;
//- Zone of cell
DynamicList<label> cellZone_;
// Private Member Functions
//- Reorder contents of container according to oldToNew map
template<class T>
static void reorder
(
const labelUList& oldToNew,
DynamicList<T>& lst
);
template<class T>
static void reorder
(
const labelUList& oldToNew,
List<DynamicList<T>>& lst
);
template<class T>
static void renumberKey
(
const labelUList& oldToNew,
Map<T>& map
);
//- Renumber elements of container according to oldToNew map
static void renumber
(
const labelUList& oldToNew,
labelHashSet& labels
);
//- Special handling of reverse maps which have <-1 in them
static void renumberReverseMap
(
const labelUList& oldToNew,
DynamicList<label>& elems
);
//- Renumber & compact elements of list according to map
static void renumberCompact
(
const labelUList& oldToNew,
labelList& elems
);
//- Count number of added and removed quantities from maps.
static void countMap
(
const labelUList& map,
const labelUList& reverseMap,
label& nAdd,
label& nInflate,
label& nMerge,
label& nRemove
);
//- Print some stats about mesh
static void writeMeshStats(const polyMesh& mesh, Ostream& os);
//- Calculate object maps. Requires reverseMap to have destination
// to be marked with <-1.
static void getMergeSets
(
const labelUList& reverseCellMap,
const labelUList& cellMap,
List<objectMap>& cellsFromCells
);
//- Are all face vertices valid
bool hasValidPoints(const face& f) const;
//- Return face points
pointField facePoints(const face& f) const;
//- Check inputs to modFace or addFace
void checkFace
(
const face& f,
const label facei,
const label own,
const label nei,
const label patchi,
const label zoneI
) const;
//- Construct cells (in packed storage)
void makeCells
(
const label nActiveFaces,
labelList& cellFaces,
labelList& cellFaceOffsets
) const;
//- Construct cellCells (in packed storage)
void makeCellCells
(
const label nActiveFaces,
CompactListList<label, labelList>& cellCells
) const;
//- Cell ordering (bandCompression). Returns number of remaining cells.
label getCellOrder
(
const CompactListList<label, labelList>& cellCellAddressing,
labelList& oldToNew
) const;
//- Do upper-triangular ordering and patch ordering.
void getFaceOrder
(
const label nActiveFaces,
const labelUList& cellFaces,
const labelUList& cellFaceOffsets,
labelList& oldToNew,
labelList& patchSizes,
labelList& patchStarts
) const;
//- Compact and reorder faces according to map
void reorderCompactFaces
(
const label newSize,
const labelUList& oldToNew
);
//- Remove all unused/removed points/faces/cells and update
// face ordering (always), cell ordering (bandcompression,
// orderCells=true),
// point ordering (sorted into internal and boundary points,
// orderPoints=true)
void compact
(
const bool orderCells,
const bool orderPoints,
label& nInternalPoints,
labelList& patchSizes,
labelList& patchStarts
);
//- Select either internal or external faces out of faceLabels
static labelList selectFaces
(
const primitiveMesh& mesh,
const labelUList& faceLabels,
const bool internalFacesOnly
);
//- Calculate mapping for patchpoints only
void calcPatchPointMap
(
const UList<Map<label>>& oldPatchMeshPointMaps,
const polyBoundaryMesh& boundary,
labelListList& patchPointMap
) const;
void calcFaceInflationMaps
(
const polyMesh& mesh,
List<objectMap>& facesFromPoints,
List<objectMap>& facesFromEdges,
List<objectMap>& facesFromFaces
) const;
void calcCellInflationMaps
(
const polyMesh& mesh,
List<objectMap>& cellsFromPoints,
List<objectMap>& cellsFromEdges,
List<objectMap>& cellsFromFaces,
List<objectMap>& cellsFromCells
) const;
void resetZones
(
const polyMesh& mesh, // mesh to get existing info from
polyMesh& newMesh, // mesh to change zones on
labelListList& pointZoneMap,
labelListList& faceZoneFaceMap,
labelListList& cellZoneMap
) const;
void calcFaceZonePointMap
(
const polyMesh& mesh,
const UList<Map<label>>& oldFaceZoneMeshPointMaps,
labelListList& faceZonePointMap
) const;
// Coupling
//- Do all coupled patch face reordering
void reorderCoupledFaces
(
const bool syncParallel,
const polyBoundaryMesh& boundary,
const labelUList& patchStarts,
const labelUList& patchSizes,
const pointField& points
);
void compactAndReorder
(
const polyMesh& mesh,
const bool syncParallel,
const bool orderCells,
const bool orderPoints,
label& nInternalPoints,
pointField& newPoints,
labelList& patchSizes,
labelList& patchStarts,
List<objectMap>& pointsFromPoints,
List<objectMap>& facesFromPoints,
List<objectMap>& facesFromEdges,
List<objectMap>& facesFromFaces,
List<objectMap>& cellsFromPoints,
List<objectMap>& cellsFromEdges,
List<objectMap>& cellsFromFaces,
List<objectMap>& cellsFromCells,
List<Map<label>>& oldPatchMeshPointMaps,
labelList& oldPatchNMeshPoints,
labelList& oldPatchStarts,
List<Map<label>>& oldFaceZoneMeshPointMaps
);
public:
//- Runtime type information
ClassName("polyTopoChange");
// Constructors
//- Construct without mesh. Either specify nPatches or use
// setNumPatches before trying to make a mesh (makeMesh, changeMesh)
polyTopoChange(const label nPatches, const bool strict = true);
//- Construct from mesh. Adds all points/face/cells from mesh.
polyTopoChange(const polyMesh& mesh, const bool strict = true);
// Member Functions
// Access
//- Points. Shrunk after constructing mesh (or calling of compact())
const DynamicList<point>& points() const
{
return points_;
}
const DynamicList<face>& faces() const
{
return faces_;
}
const DynamicList<label>& region() const
{
return region_;
}
const DynamicList<label>& faceOwner() const
{
return faceOwner_;
}
const DynamicList<label>& faceNeighbour() const
{
return faceNeighbour_;
}
//- Is point removed?
// Considered removed if point is GREAT.
inline bool pointRemoved(const label pointi) const;
//- Is face removed?
// Considered removed if face is empty
inline bool faceRemoved(const label facei) const;
//- Is cell removed?
// Considered removed if the cellMap is -2
inline bool cellRemoved(const label celli) const;
// Edit
//- Clear all storage
void clear();
//- Add all points/faces/cells of mesh. Additional offset for patch
// or zone ids.
void addMesh
(
const polyMesh& mesh,
const labelUList& patchMap,
const labelUList& pointZoneMap,
const labelUList& faceZoneMap,
const labelUList& cellZoneMap
);
//- Explicitly pre-size the dynamic storage for expected mesh
// size for if construct-without-mesh
void setCapacity
(
const label nPoints,
const label nFaces,
const label nCells
);
//- Move all points. Incompatible with other topology changes.
void movePoints(const pointField& newPoints);
//- For compatibility with polyTopoChange: set topological action.
label setAction(const topoAction& action);
//- Add point. Return new point label.
// Notes:
// - masterPointID can be < 0 (appended points)
// - inCell = false: add retired point (to end of point list)
label addPoint
(
const point& pt,
const label masterPointID,
const label zoneID,
const bool inCell
);
//- Modify coordinate.
// Notes:
// - zoneID = +ve (add to zoneID), -ve (remove from zones)
// - inCell = false: add retired point (to end of point list)
void modifyPoint
(
const label pointi,
const point& pt,
const label zoneID,
const bool inCell
);
//- Remove/merge point.
void removePoint(const label pointi, const label mergePointi);
//- Add face to cells. Return new face label.
// own,nei<0, zoneID>=0 : add inactive face (to end of face list)
label addFace
(
const face& f,
const label own,
const label nei,
const label masterPointID,
const label masterEdgeID,
const label masterFaceID,
const bool flipFaceFlux,
const label patchID,
const label zoneID,
const bool zoneFlip
);
//- Modify vertices or cell of face.
void modifyFace
(
const face& f,
const label facei,
const label own,
const label nei,
const bool flipFaceFlux,
const label patchID,
const label zoneID,
const bool zoneFlip
);
//- Remove/merge face.
void removeFace(const label facei, const label mergeFacei);
//- Add cell. Return new cell label.
label addCell
(
const label masterPointID,
const label masterEdgeID,
const label masterFaceID,
const label masterCellID,
const label zoneID
);
//- Modify zone of cell
void modifyCell(const label celli, const label zoneID);
//- Remove/merge cell.
void removeCell(const label celli, const label mergeCelli);
//- Explicitly set the number of patches if construct-without-mesh
// used.
inline void setNumPatches(const label nPatches);
// Other
//- Inplace changes mesh without change of patches.
// Adapts patch start/end and by default does parallel matching.
// Clears all data. Returns map.
// inflate = true : keep old mesh points. Put new points into the
// returned map (preMotionPoints) so we can use inflation. Any
// points out of nothing (appended points) are vector::zero.
// inflate = false: set mesh points directly. Empty preMotionPoints
// in the map.
// orderCells : whether to order the cells (see bandCompression.H)
// orderPoints : whether to order the points into internal first
// followed by boundary points. This is not fully consistent
// with upper-triangular ordering of points and edges so
// is only done when explicitly asked for.
autoPtr<mapPolyMesh> changeMesh
(
polyMesh& mesh,
const bool inflate,
const bool syncParallel = true,
const bool orderCells = false,
const bool orderPoints = false
);
//- Create new mesh with old mesh patches
autoPtr<mapPolyMesh> makeMesh
(
autoPtr<fvMesh>& newMesh,
const IOobject& io,
const polyMesh& mesh,
const bool syncParallel = true,
const bool orderCells = false,
const bool orderPoints = false
);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "polyTopoChangeI.H"
#ifdef NoRepository
#include "polyTopoChangeTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,61 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "face.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
inline bool Foam::polyTopoChange::pointRemoved(const label pointi) const
{
const point& pt = points_[pointi];
return
pt.x() > 0.5*vector::max.x()
&& pt.y() > 0.5*vector::max.y()
&& pt.z() > 0.5*vector::max.z();
}
inline bool Foam::polyTopoChange::faceRemoved(const label facei) const
{
return faces_[facei].empty();
}
inline bool Foam::polyTopoChange::cellRemoved(const label celli) const
{
return cellMap_[celli] == -2;
}
inline void Foam::polyTopoChange::setNumPatches(const label nPatches)
{
nPatches_ = nPatches;
}
// ************************************************************************* //

View File

@ -1,100 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "polyTopoChange.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class T>
void Foam::polyTopoChange::reorder
(
const labelUList& oldToNew,
DynamicList<T>& lst
)
{
// Create copy
DynamicList<T> oldLst(lst);
forAll(oldToNew, i)
{
const label newIdx = oldToNew[i];
if (newIdx >= 0)
{
lst[newIdx] = oldLst[i];
}
}
}
template<class T>
void Foam::polyTopoChange::reorder
(
const labelUList& oldToNew,
List<DynamicList<T>>& lst
)
{
// Create copy
List<DynamicList<T>> oldLst(lst);
forAll(oldToNew, i)
{
const label newIdx = oldToNew[i];
if (newIdx >= 0)
{
lst[newIdx].transfer(oldLst[i]);
}
}
}
template<class T>
void Foam::polyTopoChange::renumberKey
(
const labelUList& oldToNew,
Map<T>& map
)
{
Map<T> newMap(map.capacity());
forAllConstIters(map, iter)
{
const label newKey = oldToNew[iter.key()];
if (newKey >= 0)
{
newMap.insert(newKey, iter.val());
}
}
map.transfer(newMap);
}
// ************************************************************************* //

View File

@ -1,119 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::polyRemoveCell
Description
Class containing data for cell removal.
\*---------------------------------------------------------------------------*/
#ifndef polyRemoveCell_H
#define polyRemoveCell_H
#include "label.H"
#include "topoAction.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class polyRemoveCell Declaration
\*---------------------------------------------------------------------------*/
class polyRemoveCell
:
public topoAction
{
// Private data
//- Cell ID
label cellID_;
//- Merge cell ID or -1
label mergeCellID_;
public:
// Static data members
//- Runtime type information
TypeName("removeCell");
// Constructors
//- Construct null. Used for constructing lists
polyRemoveCell()
:
cellID_(-1),
mergeCellID_(-1)
{}
//- Construct from components
polyRemoveCell(const label cellID, const label mergeCellID = -1)
:
cellID_(cellID),
mergeCellID_(mergeCellID)
{}
//- Construct and return a clone
virtual autoPtr<topoAction> clone() const
{
return autoPtr<topoAction>(new polyRemoveCell(*this));
}
// Default Destructor
// Member Functions
//- Return cell ID
label cellID() const
{
return cellID_;
}
//- Return cell ID
label mergeCellID() const
{
return mergeCellID_;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,119 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::polyRemoveFace
Description
Class containing data for face removal.
\*---------------------------------------------------------------------------*/
#ifndef polyRemoveFace_H
#define polyRemoveFace_H
#include "label.H"
#include "topoAction.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class polyRemoveFace Declaration
\*---------------------------------------------------------------------------*/
class polyRemoveFace
:
public topoAction
{
// Private data
//- Face ID
label faceID_;
//- Merge faceID or -1
label mergeFaceID_;
public:
// Static data members
//- Runtime type information
TypeName("removeFace");
// Constructors
//- Construct null. Used for constructing lists
polyRemoveFace()
:
faceID_(-1),
mergeFaceID_(-1)
{}
//- Construct from components
polyRemoveFace(const label faceID, const label mergeFaceID = -1)
:
faceID_(faceID),
mergeFaceID_(mergeFaceID)
{}
//- Construct and return a clone
virtual autoPtr<topoAction> clone() const
{
return autoPtr<topoAction>(new polyRemoveFace(*this));
}
// Default Destructor
// Member Functions
//- Return face ID
label faceID() const
{
return faceID_;
}
//- Return merge face ID
label mergeFaceID() const
{
return mergeFaceID_;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,119 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::polyRemovePoint
Description
Class containing data for point removal.
\*---------------------------------------------------------------------------*/
#ifndef polyRemovePoint_H
#define polyRemovePoint_H
#include "label.H"
#include "topoAction.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class polyRemovePoint Declaration
\*---------------------------------------------------------------------------*/
class polyRemovePoint
:
public topoAction
{
// Private data
//- Point ID
label pointID_;
//- Merge point ID or -1
label mergePointID_;
public:
// Static data members
//- Runtime type information
TypeName("removePoint");
// Constructors
//- Construct null. Used for constructing lists
polyRemovePoint()
:
pointID_(-1),
mergePointID_(-1)
{}
//- Construct from components
polyRemovePoint(const label pointID, const label mergePointID = -1)
:
pointID_(pointID),
mergePointID_(mergePointID)
{}
//- Construct and return a clone
virtual autoPtr<topoAction> clone() const
{
return autoPtr<topoAction>(new polyRemovePoint(*this));
}
// Default Destructor
// Member Functions
//- Return point ID
label pointID() const
{
return pointID_;
}
label mergePointID() const
{
return mergePointID_;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,86 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::topoAction
Description
A virtual base class for topological actions
SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef topoAction_H
#define topoAction_H
#include "typeInfo.H"
#include "autoPtr.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class topoAction Declaration
\*---------------------------------------------------------------------------*/
class topoAction
{
public:
// Static data members
//- Runtime type information
TypeName("topoAction");
// Constructors
//- Construct null
topoAction()
{}
//- Construct and return a clone
virtual autoPtr<topoAction> clone() const = 0;
//- Destructor
virtual ~topoAction() = default;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,59 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "topoAction.H"
#include "polyAddPoint.H"
#include "polyAddFace.H"
#include "polyAddCell.H"
#include "polyModifyPoint.H"
#include "polyModifyFace.H"
#include "polyModifyCell.H"
#include "polyRemovePoint.H"
#include "polyRemoveFace.H"
#include "polyRemoveCell.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(topoAction, 0);
defineTypeNameAndDebug(polyAddPoint, 0);
defineTypeNameAndDebug(polyModifyPoint, 0);
defineTypeNameAndDebug(polyRemovePoint, 0);
defineTypeNameAndDebug(polyAddFace, 0);
defineTypeNameAndDebug(polyModifyFace, 0);
defineTypeNameAndDebug(polyRemoveFace, 0);
defineTypeNameAndDebug(polyAddCell, 0);
defineTypeNameAndDebug(polyModifyCell, 0);
defineTypeNameAndDebug(polyRemoveCell, 0);
}
// ************************************************************************* //