slidingInterfaceClearCouple.C
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2016 OpenFOAM Foundation
9 Copyright (C) 2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27\*---------------------------------------------------------------------------*/
28
29#include "slidingInterface.H"
30#include "polyTopoChange.H"
31#include "polyMesh.H"
32#include "polyTopoChanger.H"
33#include "polyRemovePoint.H"
34#include "polyRemoveFace.H"
35
36// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
37
38void Foam::slidingInterface::clearCouple
39(
40 polyTopoChange& ref
41) const
42{
43 if (debug)
44 {
45 Pout<< "void slidingInterface::clearCouple("
46 << "polyTopoChange& ref) const for object " << name() << " : "
47 << "Clearing old couple points and faces." << endl;
48 }
49
50 const polyMesh& mesh = topoChanger().mesh();
51
52 // Remove all points from the point zone
53 for
54 (
55 const label pointi
56 : mesh.pointZones()[cutPointZoneID_.index()]
57 )
58 {
59 ref.setAction(polyRemovePoint(pointi));
60 }
61
62 // Remove all faces from the face zone
63 for
64 (
65 const label facei
66 : mesh.faceZones()[cutFaceZoneID_.index()]
67 )
68 {
69 ref.setAction(polyRemoveFace(facei));
70 }
71
72 if (debug)
73 {
74 Pout<< "void slidingInterface::clearCouple("
75 << "polyTopoChange& ref) const for object " << name() << " : "
76 << "Finished clearing old couple points and faces." << endl;
77 }
78}
79
80
81// ************************************************************************* //
label index() const
The index of the first matching items, -1 if no matches.
Definition: DynamicID.H:123
const word & name() const
Return name of this modifier.
const polyTopoChanger & topoChanger() const
Return reference to morph engine.
const faceZoneMesh & faceZones() const noexcept
Return face zone mesh.
Definition: polyMesh.H:498
const pointZoneMesh & pointZones() const noexcept
Return point zone mesh.
Definition: polyMesh.H:492
const polyMesh & mesh() const
Return the mesh reference.
rDeltaT ref()
dynamicFvMesh & mesh
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.