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

Function track

src/functionObjects/field/streamLine/streamLine.C:101–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99
100
101void Foam::functionObjects::streamLine::track()
102{
103 IDLList<streamLineParticle> initialParticles;
104 streamLineParticleCloud particles
105 (
106 mesh_,
107 cloudName_,
108 initialParticles
109 );
110
111 const sampledSet& seedPoints = sampledSetPtr_();
112
113 forAll(seedPoints, i)
114 {
115 particles.addParticle
116 (
117 new streamLineParticle
118 (
119 mesh_,
120 seedPoints[i],
121 seedPoints.cells()[i],
122 lifeTime_
123 )
124 );
125 }
126
127 label nSeeds = returnReduce(particles.size(), sumOp<label>());
128
129 Info << " seeded " << nSeeds << " particles" << endl;
130
131 // Read or lookup fields
132 PtrList<volScalarField> vsFlds;
133 PtrList<interpolation<scalar>> vsInterp;
134 PtrList<volVectorField> vvFlds;
135 PtrList<interpolation<vector>> vvInterp;
136
137 label UIndex = -1;
138
139 label nScalar = 0;
140 label nVector = 0;
141
142 forAll(fields_, i)
143 {
144 if (mesh_.foundObject<volScalarField>(fields_[i]))
145 {
146 nScalar++;
147 }
148 else if (mesh_.foundObject<volVectorField>(fields_[i]))
149 {
150 nVector++;
151 }
152 else
153 {
154 FatalErrorInFunction
155 << "Cannot find field " << fields_[i] << nl
156 << "Valid scalar fields are:"
157 << mesh_.names(volScalarField::typeName) << nl
158 << "Valid vector fields are:"

Callers 3

writeFunction · 0.70
locateFunction · 0.50
constrainToMeshCentreFunction · 0.50

Calls 13

streamLineParticleClass · 0.85
returnReduceFunction · 0.85
sqrtFunction · 0.85
forAllFunction · 0.50
exitFunction · 0.50
NewFunction · 0.50
sizeMethod · 0.45
setSizeMethod · 0.45
setMethod · 0.45
nameMethod · 0.45
psiMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected