Removed unneeded lib dependency from mdInitialise
[foam-extend-3.2.git] / applications / solvers / solidMechanics / elasticSolidFoam / writeFields.H
blob8aa83806e71e18b446a4987769c75270ededa089
1 if (runTime.outputTime())
2   {
3     volScalarField epsilonEq
4       (
5        IOobject
6        (
7         "epsilonEq",
8         runTime.timeName(),
9         mesh,
10         IOobject::NO_READ,
11         IOobject::AUTO_WRITE
12         ),
13        sqrt((2.0/3.0)*magSqr(dev(epsilon)))
14        );
16     Info<< "Max epsilonEq = " << max(epsilonEq).value()
17         << endl;
19     volScalarField sigmaEq
20       (
21        IOobject
22        (
23         "sigmaEq",
24         runTime.timeName(),
25         mesh,
26         IOobject::NO_READ,
27         IOobject::AUTO_WRITE
28         ),
29        sqrt((3.0/2.0)*magSqr(dev(sigma)))
30        );
31     
32     Info<< "Max sigmaEq = " << max(sigmaEq).value()
33         << endl;
34     
35     //- boundary traction
36     // volVectorField traction
37     //   (
38     //    IOobject
39     //    (
40     //  "traction",
41     //  runTime.timeName(),
42     //  mesh,
43     //  IOobject::NO_READ,
44     //  IOobject::AUTO_WRITE
45     //  ),
46     //    mesh,
47     //    dimensionedVector("zero", dimForce/dimArea, vector::zero)
48     //    );
49     // forAll(traction.boundaryField(), patchi)
50     //   {
51     //  traction.boundaryField()[patchi] =
52     //    n.boundaryField()[patchi] & sigma.boundaryField()[patchi];
53     //   }
55     // contact fields
56     // if(contactBoundaries)
57     //   {
58     //  volScalarField stickSlipFaces
59     //    (
60     //     IOobject
61     //     (
62     //      "stickSlipFaces",
63     //      runTime.timeName(),
64     //      mesh,
65     //      IOobject::NO_READ,
66     //      IOobject::AUTO_WRITE
67     //      ),
68     //     mesh,
69     //     dimensionedScalar("zero", dimless, 0.0)
70     //     );
71     //  forAll(stickSlipFaces.boundaryField(), patchi)
72     //    {
73     //      if(U.boundaryField()[patchi].type()
74     //         ==
75     //         solidContactFvPatchVectorField::typeName)
76     //        {
77     //          const solidContactFvPatchVectorField& Upatch =
78     //            refCast<const solidContactFvPatchVectorField>
79     //            (U.boundaryField()[patchi]);
81     //          if(!Upatch.master())
82     //            {
83     //              stickSlipFaces.boundaryField()[patchi] =
84     //                Upatch.frictionContactModelPtr()->stickSlipFaces();
85     //            }
86     //        }
87     //    }
88     //  stickSlipFaces.write();
89     //   }
92     //- boundary forces
93 //     Info << nl;
94 //     forAll(mesh.boundary(), patchi)
95 //       {
96 //      Info << "Patch " << mesh.boundary()[patchi].name() << endl;
97 //      vectorField totalForce = mesh.Sf().boundaryField()[patchi] & sigma.boundaryField()[patchi];
99 //      vector force = sum( totalForce );
100 //      Info << "\ttotal force is " << force << " N" << endl;
101         
102 //      const vectorField& nb = n.boundaryField()[patchi];
103 //      scalar normalForce = sum( nb & totalForce );
104 //      Info << "\tnormal force is " << normalForce << " N" << endl;
105 //      scalar shearForce = mag(sum( (I - sqr(nb)) & totalForce ));
106 //      Info << "\tshear force is " << shearForce << " N" << endl;
107 //      }
109     runTime.write();
110   }