/usr/include/paraview/vtkSQFieldTracer.h is in paraview-dev 5.0.1+dfsg1-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 | /*
* Copyright 2012 SciberQuest Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither name of SciberQuest Inc. nor the names of any contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// .NAME vtkSQFieldTracer - Streamline generator
// .SECTION Description
//
// Scalable field line tracer using RK45 Adds capability to
// terminate trace upon intersection with one of a set of
// surfaces.
// TODO verify that VTK rk45 implementation increases step size!!
#ifndef vtkSQFieldTracer_h
#define vtkSQFieldTracer_h
#include "vtkSciberQuestModule.h" // for export macro
#include "vtkDataSetAlgorithm.h"
class vtkUnstructuredGrid;
class vtkSQOOCReader;
class vtkMultiProcessController;
class vtkInitialValueProblemSolver;
class vtkPointSet;
class vtkPVXMLElement;
//BTX
class IdBlock;
class FieldLine;
class FieldTraceData;
class TerminationCondition;
//ETX
class VTKSCIBERQUEST_EXPORT vtkSQFieldTracer : public vtkDataSetAlgorithm
{
public:
vtkTypeMacro(vtkSQFieldTracer,vtkDataSetAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent);
static vtkSQFieldTracer *New();
// Description:
// Specify the dataset with the vector field to analyze.
void AddVectorInputConnection(vtkAlgorithmOutput* algOutput);
void ClearVectorInputConnections();
// Description:
// Specify a set of seed points to use.
void AddSeedPointInputConnection(vtkAlgorithmOutput* algOutput);
void ClearSeedPointInputConnections();
// Description:
// Specify a set of surfaces to use.
void AddTerminatorInputConnection(vtkAlgorithmOutput* algOutput);
void ClearTerminatorInputConnections();
// Description:
// Initialize the object from an xml document.
int Initialize(vtkPVXMLElement *root);
// Description:
// Set the run mode of the filter.
// The enumeration is as follows:
// 1 STREAM filter produces stream lines
// 2 TOPOLOGY filter produces field topology map
// 3 POINCARE filter produces a displacement map
// 4 DISPLACEMENT filter produces a poincare map
// This allows this filter to serve as multiple ParaView filters,
// the OOCFieldTracer, OOCDTopologyMapper, and OOCDPoincareMapper
// NOTE This only works if Mode is set before the filter runs.
// PV gets confused if you try to change Mode later.
vtkSetMacro(Mode,int);
vtkGetMacro(Mode,int);
//BTX
enum
{
MODE_STREAM=1,
MODE_TOPOLOGY=2,
MODE_POINCARE=3,
MODE_DISPLACEMENT=4
};
//ETX
// Description:
// If set then only forward traces is carried out.
vtkSetMacro(ForwardOnly,int);
vtkGetMacro(ForwardOnly,int);
// Description:
// Set integrator type. RK2=1, RK4=2, RK45=3
void SetIntegratorType(int type);
int GetIntegratorType(){ return this->IntegratorType; }
//BTX
enum
{
INTEGRATOR_NONE=0,
INTEGRATOR_RK2=1,
INTEGRATOR_RK4=2,
INTEGRATOR_RK45=3
};
//ETX
// Description:
// Specify a uniform integration step unit for MinimumIntegrationStep,
// InitialIntegrationStep, and MaximumIntegrationStep. NOTE: The valid
// units are LENGTH_UNIT (1) and CELL_LENGTH_UNIT (2).
void SetStepUnit(int unit);
vtkGetMacro(StepUnit,int);
// Description:
// Specify the Minimum step size used for line integration.
vtkSetMacro(MinStep,double);
vtkGetMacro(MinStep,double);
// Description:
// Specify the Maximum step size used for line integration.
vtkSetMacro(MaxStep,double);
vtkGetMacro(MaxStep,double);
// Description
// Specify the maximum error tolerated throughout streamline integration.
vtkSetMacro(MaxError,double);
vtkGetMacro(MaxError,double);
// Description
// Specify the maximum number of steps for integrating a streamline.
vtkSetMacro(MaxNumberOfSteps,vtkIdType);
vtkGetMacro(MaxNumberOfSteps,vtkIdType);
// Description:
// Specify the maximum length of a streamline expressed in LENGTH_UNIT.
vtkSetMacro(MaxLineLength,double);
vtkGetMacro(MaxLineLength,double);
// Description:
// Specify the maximum time interval to integrate over.
vtkSetMacro(MaxIntegrationInterval,double);
vtkGetMacro(MaxIntegrationInterval,double);
// Description
// Specify the terminal speed value, below which integration is terminated.
vtkSetMacro(NullThreshold,double);
vtkGetMacro(NullThreshold,double);
// Description:
// Specify the minimum segment length
vtkSetMacro(MinSegmentLength,double);
vtkGetMacro(MinSegmentLength,double);
// Description:
// If set then comm world is used during reads. This will result in better
// in-core preformance when there is enough memory for each process to
// have it's own copy of the data. Note: use of comm world precludes
// out-of-core operation.
vtkSetMacro(UseCommWorld,int);
vtkGetMacro(UseCommWorld,int);
// Descrition:
// If set then segments of field lines that are the result of a
// periodic boundary condition are removed from the output.
vtkSetMacro(CullPeriodicTransitions,int);
vtkGetMacro(CullPeriodicTransitions,int);
// Description:
// If on then color map produced will only contain used colors.
// NOTE: requires a global communication,
vtkSetMacro(SqueezeColorMap,int);
vtkGetMacro(SqueezeColorMap,int);
// Description:
// Sets the work unit (in number of seed points) for slave processes.
vtkSetClampMacro(WorkerBlockSize,int,1,VTK_INT_MAX);
vtkGetMacro(WorkerBlockSize,int);
// Description:
// Sets the work unit (in number of seed points) for the master. This should
// be much less than the slave block size, so that the master can respond
// timely to slave requests.
vtkSetClampMacro(MasterBlockSize,int,0,VTK_INT_MAX);
vtkGetMacro(MasterBlockSize,int);
// Description:
// Enable/disable the dynamic scheduler. The dynamic scheduler requires that
// a seed generator be inserted into the pipeline, or that all seed points
// are generated on all ranks.
vtkSetMacro(UseDynamicScheduler,int);
vtkGetMacro(UseDynamicScheduler,int);
// Description:
// Set the log level.
// 0 -- no logging
// 1 -- basic logging
// .
// n -- advanced logging
vtkSetMacro(LogLevel,int);
vtkGetMacro(LogLevel,int);
protected:
vtkSQFieldTracer();
~vtkSQFieldTracer();
// VTK Pipeline
int FillInputPortInformation(int port,vtkInformation *info);
int FillOutputPortInformation(int port,vtkInformation *info);
int RequestData(vtkInformation *req, vtkInformationVector **input, vtkInformationVector *output);
int RequestInformation(vtkInformation* req, vtkInformationVector** input, vtkInformationVector* output);
int RequestUpdateExtent(vtkInformation* req, vtkInformationVector** input, vtkInformationVector* output);
int RequestDataObject(vtkInformation *info,vtkInformationVector** input,vtkInformationVector* output);
private:
//BTX
// Description:
// Integrate over all local cells. This assumes that each process has a unique
// subset of the work (i.e. seed source cells are statically distributed),
int IntegrateStatic(
vtkIdType nCells,
const char *fieldName,
vtkSQOOCReader *oocr,
vtkDataSet *&oocrCache,
FieldTraceData *topoMap);
// Description:
// Distribute the work load according to a master-slave self scheduling scheme. All
// seed cells must be present on all process, work is dished out by process 0 in
// contiguous blocks of cell ids.
int IntegrateDynamic(
int procId,
int nProcs,
vtkIdType nCells,
const char *fieldName,
vtkSQOOCReader *oocr,
vtkDataSet *&oocrCache,
FieldTraceData *topoMap);
// Description:
// Integrate field lines seeded from a block of consecutive cell ids.
int IntegrateBlock(
IdBlock *sourceIds,
FieldTraceData *topoMap,
const char *fieldName,
vtkSQOOCReader *oocr,
vtkDataSet *&oocrCache);
// Description:
// Trace one field line from the given seed point, using the given out-of-core
// reader. As segments are generated they are tested using the stermination
// condition and terminated imediately. The last neighborhood read is stored
// in the nhood parameter. It is up to the caller to delete this.
void IntegrateOne(
vtkSQOOCReader *oocR,
vtkDataSet *&oocRCache,
const char *fieldName,
FieldLine *line,
TerminationCondition *tcon);
//ETX
// Description:
// Determine the start id of the cells in data relative
// to the cells on all other processes in COMM_WORLD.
// Requires a global communcation.
unsigned long GetGlobalCellId(vtkDataSet *data);
// Description:
// Convert from cell fractional unit into length.
void ClipStep(
double& step,
int stepSign,
double& minStep,
double& maxStep,
double cellLength,
double lineLength);
// Description:
// Convert from cell fractional unit into length.
static double ConvertToLength(double interval,int unit,double cellLength);
vtkSQFieldTracer(const vtkSQFieldTracer&); // Not implemented.
void operator=(const vtkSQFieldTracer&); // Not implemented.
private:
int WorldSize;
int WorldRank;
// Parameter controlling load balance
int UseDynamicScheduler;
int WorkerBlockSize;
int MasterBlockSize;
// Parameters controlling integration
int ForwardOnly;
int StepUnit;
double MinStep;
double MaxStep;
double MaxError;
vtkIdType MaxNumberOfSteps;
double MaxLineLength;
double MaxIntegrationInterval;
double NullThreshold;
int IntegratorType;
vtkInitialValueProblemSolver* Integrator;
double MinSegmentLength;
static const double EPSILON;
// Reader related
int UseCommWorld;
TerminationCondition *TermCon;
// Output controls
int Mode;
int CullPeriodicTransitions;
int SqueezeColorMap;
int LogLevel;
//BTX
// units
enum
{
ARC_LENGTH=1,
CELL_FRACTION=2
};
//ETX
};
#endif
|