------------------------------------------------------------------------------
| 228 | |
| 229 | //------------------------------------------------------------------------------ |
| 230 | int vtkLagrangianBasicIntegrationModel::FunctionValues(double* x, double* f, void* userData) |
| 231 | { |
| 232 | // Sanity check |
| 233 | if (this->DataSets->empty()) |
| 234 | { |
| 235 | vtkErrorMacro(<< "Please add a dataset to the integration model before integrating."); |
| 236 | return 0; |
| 237 | } |
| 238 | vtkLagrangianParticle* particle = static_cast<vtkLagrangianParticle*>(userData); |
| 239 | if (!particle) |
| 240 | { |
| 241 | vtkErrorMacro(<< "Could not recover vtkLagrangianParticle"); |
| 242 | return 0; |
| 243 | } |
| 244 | vtkAbstractCellLocator* loc; |
| 245 | vtkDataSet* ds; |
| 246 | vtkIdType cellId; |
| 247 | double* weights; |
| 248 | if (this->FindInLocators(x, particle, ds, cellId, loc, weights)) |
| 249 | { |
| 250 | // Evaluate integration model velocity field with the found cell |
| 251 | return this->FunctionValues(particle, ds, cellId, weights, x, f); |
| 252 | } |
| 253 | |
| 254 | // Can't evaluate |
| 255 | return 0; |
| 256 | } |
| 257 | |
| 258 | //------------------------------------------------------------------------------ |
| 259 | void vtkLagrangianBasicIntegrationModel::SetLocator(vtkAbstractCellLocator* locator) |
nothing calls this directly
no test coverage detected