FreeFOAM The Cross-Platform CFD Toolkit
gmvOutputLagrangian.H
Go to the documentation of this file.
1 gmvFile << "tracers " << particles.size() << nl;
2 for
3 (
4  Cloud<passiveParticle>::iterator elmnt = particles.begin();
5  elmnt != particles.end();
6  ++elmnt
7 )
8 {
9  gmvFile << elmnt().position().x() << " ";
10 }
11 gmvFile << nl;
12 
13 for
14 (
15  Cloud<passiveParticle>::iterator elmnt = particles.begin();
16  elmnt != particles.end();
17  ++elmnt
18 )
19 {
20  gmvFile << elmnt().position().y() << " ";
21 }
22 gmvFile << nl;
23 
24 for
25 (
26  Cloud<passiveParticle>::iterator elmnt = particles.begin();
27  elmnt != particles.end();
28  ++elmnt
29 )
30 {
31  gmvFile << elmnt().position().z() << " ";
32 }
33 gmvFile << nl;
34 
36 {
37  word name = lagrangianScalarNames[i];
38 
39  IOField<scalar> s
40  (
41  IOobject
42  (
43  name,
44  runTime.timeName(),
45  cloud::prefix,
46  mesh,
47  IOobject::MUST_READ,
48  IOobject::NO_WRITE
49  )
50  );
51 
52  if (s.size())
53  {
54  gmvFile << name << nl;
55 
56  for (label n = 0; n < s.size(); n++)
57  {
58  gmvFile << s[n] << token::SPACE;
59  }
60  gmvFile << nl;
61  }
62 
63 
64 }
65 
67 {
68  word name = lagrangianVectorNames[i];
69 
70  IOField<vector> v
71  (
72  IOobject
73  (
74  name,
75  runTime.timeName(),
76  cloud::prefix,
77  mesh,
78  IOobject::MUST_READ,
79  IOobject::NO_WRITE
80  )
81  );
82 
83  if (v.size())
84  {
85  gmvFile << name + "x" << nl;
86 
87  for (label n = 0; n < v.size(); n++)
88  {
89  gmvFile << v[n].x() << token::SPACE;
90  }
91  gmvFile << nl;
92 
93  gmvFile << name + "y" << nl;
94 
95  for (label n = 0; n < v.size(); n++)
96  {
97  gmvFile << v[n].y() << token::SPACE;
98  }
99  gmvFile << nl;
100 
101  gmvFile << name + "z" << nl;
102 
103  for (label n = 0; n < v.size(); n++)
104  {
105  gmvFile << v[n].z() << token::SPACE;
106  }
107  gmvFile << nl;
108  }
109 
110 }
111 
112 
113 gmvFile << "endtrace"<< nl;
114 
115 // ************************ vim: set sw=4 sts=4 et: ************************ //