MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / writeFileHeader

Function writeFileHeader

src/functionObjects/forces/forces/forces.C:75–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73
74
75void Foam::functionObjects::forces::writeFileHeader(const label i)
76{
77 switch (fileID(i))
78 {
79 case MAIN_FILE:
80 {
81 // force data
82
83 writeHeader(file(i), "Forces");
84 writeHeaderValue(file(i), "CofR", coordSys_.origin());
85 writeCommented(file(i), "Time");
86
87 const word forceTypes("(pressure viscous porous)");
88 file(i)
89 << "forces" << forceTypes << tab
90 << "moments" << forceTypes;
91
92 if (localSystem_)
93 {
94 file(i)
95 << tab
96 << "localForces" << forceTypes << tab
97 << "localMoments" << forceTypes;
98 }
99
100 break;
101 }
102 case BINS_FILE:
103 {
104 // bin data
105
106 writeHeader(file(i), "Force bins");
107 writeHeaderValue(file(i), "bins", nBin_);
108 writeHeaderValue(file(i), "start", binMin_);
109 writeHeaderValue(file(i), "delta", binDx_);
110 writeHeaderValue(file(i), "direction", binDir_);
111
112 vectorField binPoints(nBin_);
113 writeCommented(file(i), "x co-ords :");
114 forAll(binPoints, pointi)
115 {
116 binPoints[pointi] = (binMin_ + (pointi + 1)*binDx_)*binDir_;
117 file(i) << tab << binPoints[pointi].x();
118 }
119 file(i) << nl;
120
121 writeCommented(file(i), "y co-ords :");
122 forAll(binPoints, pointi)
123 {
124 file(i) << tab << binPoints[pointi].y();
125 }
126 file(i) << nl;
127
128 writeCommented(file(i), "z co-ords :");
129 forAll(binPoints, pointi)
130 {
131 file(i) << tab << binPoints[pointi].z();
132 }

Callers

nothing calls this directly

Calls 8

writeCommentedFunction · 0.85
fileIDEnum · 0.70
forAllFunction · 0.70
writeHeaderFunction · 0.50
abortClass · 0.50
xMethod · 0.45
yMethod · 0.45
zMethod · 0.45

Tested by

no test coverage detected