| 99 | |
| 100 | |
| 101 | void 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:" |