| 170 | |
| 171 | |
| 172 | void Foam::functionObjects::forces::initialise() |
| 173 | { |
| 174 | if (initialised_) |
| 175 | { |
| 176 | return; |
| 177 | } |
| 178 | |
| 179 | if (directForceDensity_) |
| 180 | { |
| 181 | if (!obr_.foundObject<volVectorField>(fDName_)) |
| 182 | { |
| 183 | FatalErrorInFunction |
| 184 | << "Could not find " << fDName_ << " in database." |
| 185 | << exit(FatalError); |
| 186 | } |
| 187 | } |
| 188 | else |
| 189 | { |
| 190 | if |
| 191 | ( |
| 192 | !obr_.foundObject<volVectorField>(UName_) |
| 193 | || !obr_.foundObject<volScalarField>(pName_) |
| 194 | |
| 195 | ) |
| 196 | { |
| 197 | FatalErrorInFunction |
| 198 | << "Could not find " << UName_ << ", " << pName_ |
| 199 | << exit(FatalError); |
| 200 | } |
| 201 | |
| 202 | if |
| 203 | ( |
| 204 | rhoName_ != "rhoInf" |
| 205 | && !obr_.foundObject<volScalarField>(rhoName_) |
| 206 | ) |
| 207 | { |
| 208 | FatalErrorInFunction |
| 209 | << "Could not find " << rhoName_ |
| 210 | << exit(FatalError); |
| 211 | } |
| 212 | } |
| 213 | |
| 214 | initialised_ = true; |
| 215 | } |
| 216 | |
| 217 | |
| 218 | Foam::tmp<Foam::volSymmTensorField> |
no test coverage detected