Remove trailing whitespace systematically
[foam-extend-3.2.git] / applications / solvers / solidMechanics / elasticOrthoAcpSolidFoam / writeFields.H
blobc785d6175be5588dfae0a7f4bef9f8a4e2824d45
1 if (runTime.outputTime() || topoChange)
3     volScalarField sigmaEq
4     (
5         IOobject
6         (
7             "sigmaEq",
8             runTime.timeName(),
9             mesh,
10             IOobject::NO_READ,
11             IOobject::AUTO_WRITE
12         ),
13         sqrt((3.0/2.0)*magSqr(dev(sigma)))
14     );
16     Info<< "Max sigmaEq = " << max(sigmaEq).value()
17         << endl;
19     volScalarField epsilonEq
20     (
21         IOobject
22         (
23             "epsilonEq",
24             runTime.timeName(),
25             mesh,
26             IOobject::NO_READ,
27             IOobject::AUTO_WRITE
28         ),
29         sqrt((2.0/3.0)*magSqr(dev(epsilon)))
30     );
32     Info<< "Max epsilonEq = " << max(epsilonEq).value()
33         << endl;
35 //     Info << "\nCalculate maximal principal stress ..." << flush;
36 //     // Principal stresses
37 //     volVectorField sigmaMax
38 //     (
39 //         IOobject
40 //         (
41 //             "sigmaMax",
42 //             runTime.timeName(),
43 //             mesh,
44 //             IOobject::NO_READ,
45 //             IOobject::AUTO_WRITE
46 //         ),
47 //         mesh,
48 //         dimensionedVector("sigmaMax", dimPressure, vector::zero)
49 //     );
50 //     vectorField& sigmaMaxI = sigmaMax.internalField();
52 //     forAll (sigmaMaxI, cellI)
53 //     {
54 //         vector eValues = eigenValues(sigma.internalField()[cellI]);
55 //         tensor eVectors = eigenVectors(sigma.internalField()[cellI]);
57 //         scalar maxEValue = 0;
58 //         label iMax = -1;
59 //         forAll(eValues, i)
60 //         {
61 //             if (eValues[i] > maxEValue)
62 //             {
63 //                 maxEValue = eValues[i];
64 //                 iMax = i;
65 //             }
66 //         }
68 //         if (iMax != -1)
69 //         {
70 //             if (iMax == 0)
71 //             {
72 //                 sigmaMaxI[cellI] = eVectors.x()*eValues.x();
73 //             }
74 //             else if (iMax == 1)
75 //             {
76 //                 sigmaMaxI[cellI] = eVectors.y()*eValues.y();
77 //             }
78 //             else if (iMax == 2)
79 //             {
80 //                 sigmaMaxI[cellI] = eVectors.z()*eValues.z();
81 //             }
82 //         }
83 //     }
86     //- cohesive damage and cracking, and GII and GII
87     volScalarField damageAndCracks
88       (
89        IOobject
90        (
91         "damageAndCracks",
92         runTime.timeName(),
93         mesh,
94         IOobject::NO_READ,
95         IOobject::AUTO_WRITE
96         ),
97        mesh,
98        dimensionedScalar("zero", dimless, 0.0),
99        calculatedFvPatchVectorField::typeName
100        );
101     volScalarField GI
102       (
103        IOobject
104        (
105         "GI",
106         runTime.timeName(),
107         mesh,
108         IOobject::NO_READ,
109         IOobject::AUTO_WRITE
110         ),
111        mesh,
112        dimensionedScalar("zero", dimless, 0.0),
113        calculatedFvPatchVectorField::typeName
114        );
115     volScalarField GII
116       (
117        IOobject
118        (
119         "GII",
120         runTime.timeName(),
121         mesh,
122         IOobject::NO_READ,
123         IOobject::AUTO_WRITE
124         ),
125        mesh,
126        dimensionedScalar("zero", dimless, 0.0),
127        calculatedFvPatchVectorField::typeName
128        );
129     forAll(U.boundaryField(), patchi)
130       {
131         // if(U.boundaryField()[patchi].type() == cohesiveLawMultiMatFvPatchVectorField::typeName)
132         if(U.boundaryField()[patchi].type() == solidCohesiveFvPatchVectorField::typeName)
133           {
134             // cohesiveLawMultiMatFvPatchVectorField& Upatch =
135             //   refCast<cohesiveLawMultiMatFvPatchVectorField>(U.boundaryField()[patchi]);
136             solidCohesiveFvPatchVectorField& Upatch =
137               refCast<solidCohesiveFvPatchVectorField>(U.boundaryField()[patchi]);
139             GI.boundaryField()[patchi] = Upatch.GI();
140             GII.boundaryField()[patchi] = Upatch.GII();
141             damageAndCracks.boundaryField()[patchi] = Upatch.crackingAndDamage();
142           }
143       }
144     volScalarField GTotal("GTotal", GI + GII);
145     GTotal.write();
148     runTime.writeNow();