gmvOutputLagrangian.H
Go to the documentation of this file.
1gmvFile << "tracers " << particles.size() << nl;
2for (const passiveParticle& p : particles)
3{
4 gmvFile << p.position().x() << ' ';
5}
6gmvFile << nl;
7
8for (const passiveParticle& p : particles)
9{
10 gmvFile << p.position().y() << ' ';
11}
12gmvFile << nl;
13
14for (const passiveParticle& p : particles)
15{
16 gmvFile << p.position().z() << ' ';
17}
18gmvFile << nl;
19
20for (const word& name : lagrangianScalarNames)
21{
22 IOField<scalar> fld
23 (
24 IOobject
25 (
26 name,
27 runTime.timeName(),
28 cloud::prefix,
29 mesh,
30 IOobject::MUST_READ,
31 IOobject::NO_WRITE
32 )
33 );
34
35 if (fld.size())
36 {
37 gmvFile << name << nl;
38
39 for (const scalar& val : fld)
40 {
41 gmvFile << val << token::SPACE;
42 }
43 gmvFile << nl;
44 }
45
46
47}
48
49for (const word& name : lagrangianVectorNames)
50{
51 IOField<vector> fld
52 (
53 IOobject
54 (
55 name,
56 runTime.timeName(),
57 cloud::prefix,
58 mesh,
59 IOobject::MUST_READ,
60 IOobject::NO_WRITE
61 )
62 );
63
64 if (fld.size())
65 {
66 gmvFile << name + "x" << nl;
67
68 forAll(fld, n)
69 {
70 gmvFile << fld[n].x() << token::SPACE;
71 }
72 gmvFile << nl;
73
74 gmvFile << name + "y" << nl;
75
76 forAll(fld, n)
77 {
78 gmvFile << fld[n].y() << token::SPACE;
79 }
80 gmvFile << nl;
81
82 gmvFile << name + "z" << nl;
83
84 forAll(fld, n)
85 {
86 gmvFile << fld[n].z() << token::SPACE;
87 }
88 gmvFile << nl;
89 }
90
91}
92
93
94gmvFile << "endtrace"<< nl;
label n
volScalarField & p
dynamicFvMesh & mesh
engineTime & runTime
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
constexpr char nl
The newline '\n' character (0x0a)
Definition: Ostream.H:53
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:333