Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / src / solidModels / arbitraryCrack / faceCracker / faceCracker.H
blobb80f5aa953f6831c56c2e192bf73eeaf29cd748a
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     | Version:     3.2
5     \\  /    A nd           | Web:         http://www.foam-extend.org
6      \\/     M anipulation  | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9     This file is part of foam-extend.
11     foam-extend is free software: you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation, either version 3 of the License, or (at your
14     option) any later version.
16     foam-extend is distributed in the hope that it will be useful, but
17     WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19     General Public License for more details.
21     You should have received a copy of the GNU General Public License
22     along with foam-extend.  If not, see <http://www.gnu.org/licenses/>.
24 Class
25     faceCracker
27 Description
28     Face cracker mesh modifier.  This modifier takes a set of
29     internal face labels and converts them into boundary faces.
31 SourceFiles
32     faceCracker.C
33     detachFaceCracker.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef faceCracker_H
38 #define faceCracker_H
40 #include "polyMeshModifier.H"
41 #include "polyPatchID.H"
42 #include "ZoneIDs.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace Foam
49 /*---------------------------------------------------------------------------*\
50                           Class faceCracker Declaration
51 \*---------------------------------------------------------------------------*/
53 class faceCracker
55     public polyMeshModifier
57     // Private data
59         //- Crack face zone ID
60         faceZoneID crackZoneID_;
62         //- Crack patch ID.  Holds faces after cracking
63         polyPatchID crackPatchID_;
65         //- Open patch ID.  Holds faces after cracking
66         polyPatchID openPatchID_;
68         //- List of boundary faces to move to open patch
69         mutable labelList coupledFacesToBreak_;
71         //- Topology change trigger
72         mutable bool trigger_;
75     // Private Member Functions
77         //- Disallow default bitwise copy construct
78         faceCracker(const faceCracker&);
80         //- Disallow default bitwise assignment
81         void operator=(const faceCracker&);
83         //- Check validity of construction data
84         void checkDefinition();
86         //- Detach faces
87         void detachFaceCracker(polyTopoChange&) const;
90 public:
92     //- Runtime type information
93     TypeName("faceCracker");
96     // Constructors
98         //- Construct from components
99         faceCracker
100         (
101             const word& name,
102             const label index,
103             const polyTopoChanger& mme,
104             const word& faceZoneName,
105             const word& crackPatchName,
106             const word& openPatchName
107         );
109         //- Construct from dictionary
110         faceCracker
111         (
112             const word& name,
113             const dictionary& dict,
114             const label index,
115             const polyTopoChanger& mesh
116         );
119     // Destructor
121         virtual ~faceCracker();
124     // Member Functions
126         //- Return master patch ID
127         const polyPatchID& crackPatchID() const
128         {
129             return crackPatchID_;
130         }
132         //- Set faces to break and open on next update
133         //  break = convert internal face into two boundary faces in
134         // the crack patch
135         //  open = move crack faces into the open patch
136         void setBreak
137         (
138             const labelList& facesToBreak,
139             const boolList& faceFlip,
140             const labelList& coupledFacesToBreak
141         );
143         //- Set cracked faces to open on next update
144         void setOpen();
146         //- Check for topology change
147         virtual bool changeTopology() const;
149         //- Set topological change
150         virtual void setRefinement(polyTopoChange&) const;
152         //- Modify motion points to comply with the topological change
153         virtual void modifyMotionPoints(pointField& motionPoints) const;
155         //- Force recalculation of locally stored data on topological change
156         virtual void updateMesh(const mapPolyMesh&);
159         //- Write
160         virtual void write(Ostream&) const;
162         //- Write dictionary
163         virtual void writeDict(Ostream&) const;
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 } // End namespace Foam
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 #endif
175 // ************************************************************************* //