gmvOutputLagrangian.H
Go to the documentation of this file.
1 gmvFile << "tracers " << particles.size() << nl;
2 
3 {
4  pointField positions(particles.size());
5 
6  label particlei = 0;
7  forAllConstIter(Cloud<passiveParticle>, particles, iter)
8  {
9  positions[particlei ++] = iter().position(mesh);
10  }
11 
12  for (i = 0; i < pTraits<point>::nComponents; i ++)
13  {
14  forAll(positions, particlei)
15  {
16  gmvFile << component(positions[particlei], i) << ' ';
17  }
18  gmvFile << nl;
19  }
20 }
21 
23 {
24  const word& name = lagrangianScalarNames[i];
25 
26  IOField<scalar> fld
27  (
28  IOobject
29  (
30  name,
31  runTime.name(),
32  cloud::prefix,
33  mesh,
34  IOobject::MUST_READ,
35  IOobject::NO_WRITE
36  )
37  );
38 
39  if (fld.size())
40  {
41  gmvFile << name << nl;
42 
43  forAll(fld, n)
44  {
45  gmvFile << fld[n] << token::SPACE;
46  }
47  gmvFile << nl;
48  }
49 }
50 
52 {
53  const word& name = lagrangianVectorNames[i];
54 
55  IOField<vector> fld
56  (
57  IOobject
58  (
59  name,
60  runTime.name(),
61  cloud::prefix,
62  mesh,
63  IOobject::MUST_READ,
64  IOobject::NO_WRITE
65  )
66  );
67 
68  if (fld.size())
69  {
70  gmvFile << name + "x" << nl;
71 
72  forAll(fld, n)
73  {
74  gmvFile << fld[n].x() << token::SPACE;
75  }
76  gmvFile << nl;
77 
78  gmvFile << name + "y" << nl;
79 
80  forAll(fld, n)
81  {
82  gmvFile << fld[n].y() << token::SPACE;
83  }
84  gmvFile << nl;
85 
86  gmvFile << name + "z" << nl;
87 
88  forAll(fld, n)
89  {
90  gmvFile << fld[n].z() << token::SPACE;
91  }
92  gmvFile << nl;
93  }
94 
95 }
96 
97 
98 gmvFile << "endtrace"<< nl;
label n
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
Definition: UList.H:477
static List< word > lagrangianScalarNames
Definition: globalFoam.H:47
static List< word > lagrangianVectorNames
Definition: globalFoam.H:48
gmvFile<< "tracers "<< particles.size()<< nl;{ pointField positions(particles.size());label particlei=0;forAllConstIter(Cloud< passiveParticle >, particles, iter) { positions[particlei++]=iter().position(mesh);} for(i=0;i< pTraits< point >::nComponents;i++) { forAll(positions, particlei) { gmvFile<< component(positions[particlei], i)<< ' ';} gmvFile<< nl;}}forAll(lagrangianScalarNames, i){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
forAll(lagrangianVectorNames, i)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
word name(const bool)
Return a word representation of a bool.
Definition: boolIO.C:39
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
vectorField pointField
pointField is a vectorField.
Definition: pointFieldFwd.H:42
static const char nl
Definition: Ostream.H:266