Forward compatibility: flex
[foam-extend-3.2.git] / src / solidModels / constitutiveModel / cohesiveLaws / cohesiveLaw / cohesiveLaw.H
blob115a75485a92da5bd852e9a51367c80cf1a2399d
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     cohesiveLaw
27 Description
28     Cohesive law for solids.
29     The cohesive properties are kept separate from the mechanical properties
30     which are kept in rheologyLaw.
32 SourceFiles
33     cohesiveLaw.C
34     newCohesiveLaw.C
36 Author
37     Philip Cardiff UCD
39 \*---------------------------------------------------------------------------*/
41 #ifndef cohesiveLaw_H
42 #define cohesiveLaw_H
44 #include "IOdictionary.H"
45 #include "typeInfo.H"
46 #include "runTimeSelectionTables.H"
47 #include "volFields.H"
48 #include "tmp.H"
49 #include "autoPtr.H"
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 namespace Foam
56 /*---------------------------------------------------------------------------*\
57                          Class cohesiveLaw Declaration
58 \*---------------------------------------------------------------------------*/
60 class cohesiveLaw
62     // Private data
64         //- Name
65         const word name_;
67         //- Reference to stress field
68         const volSymmTensorField& sigma_;
70     // Private Member Functions
72         //- Disallow copy construct
73         cohesiveLaw(const cohesiveLaw&);
75         //- Disallow default bitwise assignment
76         void operator=(const cohesiveLaw&);
79 protected:
81         //- Return reference to mesh
82         const fvMesh& mesh() const
83         {
84             return sigma_.mesh();
85         }
87         //- Return reference to stress field
88         const volSymmTensorField& sigma() const
89         {
90             return sigma_;
91         }
94 public:
96     //- Runtime type information
97     TypeName("cohesiveLaw");
100     // Declare run-time constructor selection table
102         declareRunTimeSelectionTable
103         (
104             autoPtr,
105             cohesiveLaw,
106             dictionary,
107             (
108                 const word name,
109                 const volSymmTensorField& sigma,
110                 const dictionary& dict
111             ),
112             (name, sigma, dict)
113         );
116     // Selectors
118         //- Return a reference to the selected rheology model
119         static autoPtr<cohesiveLaw> New
120         (
121             const word& name,
122             const volSymmTensorField& sigma,
123             const dictionary& dict
124         );
127     // Constructors
129         //- Construct from dictionary
130         cohesiveLaw
131         (
132             const word& name,
133             const volSymmTensorField& sigma,
134             const dictionary& dict
135         );
138     // Destructor
140         virtual ~cohesiveLaw()
141         {}
144     // Member Functions
146         //- Return name
147         const word& name() const
148         {
149             return name_;
150         }
152         //- Return materials
153     virtual tmp<volScalarField> materials() const = 0;
155         //-  Return sigmaMax for interface given two material indicators
156         virtual scalar interfaceSigmaMax(double mat1, double mat2) const
157     {
158         return 0;
159     }
161         //-  Return tauMax for interface given two material indicators
162         virtual scalar interfaceTauMax(double mat1, double mat2) const
163     {
164         return 0;
165     }
167         //-  Return GIc for interface given two material indicators
168         virtual scalar interfaceGIc(double mat1, double mat2) const
169     {
170         return 0;
171     }
173         //-  Return GIIc for interface given two material indicators
174         virtual scalar interfaceGIIc(double mat1, double mat2) const
175     {
176         return 0;
177     }
179         //- Return opening cohesive strength - surface field
180         virtual scalar sigmaMaxValue() const = 0;
181         virtual tmp<surfaceScalarField> sigmaMax() const = 0;
183         //- Return shearing cohesive strength - surface field
184         virtual scalar tauMaxValue() const = 0;
185         virtual tmp<surfaceScalarField> tauMax() const = 0;
187         //- Return Mode I fracture energy - surface field
188         virtual scalar GIcValue() const = 0;
189         virtual tmp<surfaceScalarField> GIc() const = 0;
191         //- Return Mode II fracture energy - surface field
192         virtual scalar GIIcValue() const = 0;
193         virtual tmp<surfaceScalarField> GIIc() const = 0;
195         //- Return tractions during damage given current deltas and Gs
196         virtual void damageTractions
197     (
198      scalar& tN, // current normal traction
199      scalar& tS, // current shear traction
200      const scalar deltaN, // current deltaN
201      const scalar deltaS, // current deltaS
202      const scalar GI, // current dissipated GI
203      const scalar GII, // current dissipated GII
204      const label faceID, // needed for multi-mat
205      const scalarField& globalPatchMaterials
206      ) const = 0;
208     //- Return interface traction
209         //- hmmnn this should not be here - maybe put in solidInterface
210     virtual tmp<surfaceVectorField> interfaceTraction
211     (
212      surfaceVectorField n,
213      volVectorField U,
214      volTensorField gradU,
215      volScalarField mu,
216      volScalarField lambda
217      ) const = 0;
219         //- Correct the rheological model
220         virtual void correct() = 0;
224 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
226 } // End namespace Foam
228 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
230 #endif
232 // ************************************************************************* //