Remove trailing whitespace systematically
[foam-extend-3.2.git] / applications / solvers / solidMechanics / deprecatedSolvers / materialModels / cohesiveLaws / cohesiveLaw / cohesiveLaw.C
blob125b3e86efed0130d5bb68c0fc7cb8a1adbdb349
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     |
5     \\  /    A nd           | For copyright notice see file Copyright
6      \\/     M anipulation  |
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 Description
25     Virtual base class for cohesive law.
27 \*---------------------------------------------------------------------------*/
29 #include "cohesiveLaw.H"
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33 namespace Foam
35     defineTypeNameAndDebug(cohesiveLaw, 0);
36     defineRunTimeSelectionTable(cohesiveLaw, dictionary);
40 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
42 Foam::autoPtr<Foam::cohesiveLaw> Foam::cohesiveLaw::New
44     const word& cohesiveLawName,
45     const dictionary& dict
48     Info << "Selecting cohesive law: " << cohesiveLawName << endl;
50     dictionaryConstructorTable::iterator cstrIter =
51         dictionaryConstructorTablePtr_->find(cohesiveLawName);
53     if (cstrIter == dictionaryConstructorTablePtr_->end())
54     {
55         FatalErrorIn
56         (
57             "cohesiveLaw::New(const word& cohesiveLawName, "
58             "const dictionary& dict)"
59         )   << "Unknown cohesive law " << cohesiveLawName
60             << endl << endl
61             << "Valid cohesive laws are :" << endl
62             << dictionaryConstructorTablePtr_->toc()
63             << exit(FatalError);
64     }
66     return autoPtr<cohesiveLaw>(cstrIter()(cohesiveLawName, dict));
70 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
72 // Construct from components
73 Foam::cohesiveLaw::cohesiveLaw
75     const word& cohesiveLawName,
76     const dictionary& dict
79     cohesiveLawCoeffs_(dict.subDict(cohesiveLawName + "Coeffs")),
80     GIc_(cohesiveLawCoeffs_.lookup("GIc")),
81     sigmaMax_(cohesiveLawCoeffs_.lookup("sigmaMax"))
85 Foam::cohesiveLaw::cohesiveLaw
87     const cohesiveLaw& cl
90     refCount(),
91     cohesiveLawCoeffs_(cl.cohesiveLawCoeffs_),
92     GIc_(cl.GIc_),
93     sigmaMax_(cl.sigmaMax_)
97 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
99 Foam::cohesiveLaw::~cohesiveLaw()
102 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
104 void Foam::cohesiveLaw::writeDict(Ostream& os) const
106     os.writeKeyword(word(type() + "Coeffs"))
107         << cohesiveLawCoeffs();
111 // ************************************************************************* //