Transferred copyright to the OpenFOAM Foundation
[OpenFOAM-2.0.x.git] / applications / utilities / postProcessing / dataConversion / foamToGMV / gmvOutputLagrangian.H
blob3d7c4827a026d35d8d4aca8d930b36a8dfb88e81
1 gmvFile << "tracers " << particles.size() << nl;
2 forAllConstIter(Cloud<passiveParticle>, particles, iter)
4     gmvFile << iter().position().x() << ' ';
6 gmvFile << nl;
8 forAllConstIter(Cloud<passiveParticle>, particles, iter)
10     gmvFile << iter().position().y() << ' ';
12 gmvFile << nl;
14 forAllConstIter(Cloud<passiveParticle>, particles, iter)
16     gmvFile << iter().position().z() << ' ';
18 gmvFile << nl;
20 forAll(lagrangianScalarNames, i)
22     const word& name = lagrangianScalarNames[i];
24     IOField<scalar> fld
25     (
26         IOobject
27         (
28             name,
29             runTime.timeName(),
30             cloud::prefix,
31             mesh,
32             IOobject::MUST_READ,
33             IOobject::NO_WRITE
34         )
35     );
37     if (fld.size())
38     {
39         gmvFile << name  << nl;
41         forAll(fld, n)
42         {
43             gmvFile << fld[n] << token::SPACE;
44         }
45         gmvFile << nl;
46     }
51 forAll(lagrangianVectorNames, i)
53     const word& name = lagrangianVectorNames[i];
55     IOField<vector> fld
56     (
57         IOobject
58         (
59             name,
60             runTime.timeName(),
61             cloud::prefix,
62             mesh,
63             IOobject::MUST_READ,
64             IOobject::NO_WRITE
65         )
66     );
68     if (fld.size())
69     {
70         gmvFile << name + "x" << nl;
72         forAll(fld, n)
73         {
74             gmvFile << fld[n].x() << token::SPACE;
75         }
76         gmvFile << nl;
78         gmvFile << name + "y" << nl;
80         forAll(fld, n)
81         {
82             gmvFile << fld[n].y() << token::SPACE;
83         }
84         gmvFile << nl;
86         gmvFile << name + "z" << nl;
88         forAll(fld, n)
89         {
90             gmvFile << fld[n].z() << token::SPACE;
91         }
92         gmvFile << nl;
93     }
98 gmvFile << "endtrace"<< nl;