vtkPLANLHaloFinder.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
3 // SPDX-FileCopyrightText: Copyright (c) 2007, 2009 Los Alamos National Security, LLC
4 // SPDX-License-Identifier: LicenseRef-BSD-3-Clause-LANL-USGov
14 #ifndef vtkPLANLHaloFinder_h
15 #define vtkPLANLHaloFinder_h
16 
17 #include "vtkPVVTKExtensionsCosmoToolsModule.h" // For export macro
19 
20 // Forward declarations
22 class vtkIndent;
23 class vtkInformation;
26 
27 // CosmoTools Forward declarations
28 namespace cosmotk
29 {
30 class CosmoHaloFinderP;
31 }
32 
33 // HaloFinderInternals Forward declarations
35 {
36 class ParticleData;
37 class HaloData;
38 }
39 
40 class VTKPVVTKEXTENSIONSCOSMOTOOLS_EXPORT vtkPLANLHaloFinder : public vtkUnstructuredGridAlgorithm
41 {
42 public:
43  enum
44  {
45  AVERAGE = 0,
46  CENTER_OF_MASS = 1,
47  MBP = 2,
48  MCP = 3,
49  NUMBER_OF_CENTER_FINDING_METHODS
50  } CenterDetectionAlgorithm;
51 
52  static vtkPLANLHaloFinder* New();
53 
55  void PrintSelf(ostream& os, vtkIndent indent);
56 
58 
61  virtual vtkMultiProcessController* GetController();
62  virtual void SetController(vtkMultiProcessController*);
64 
66 
70  vtkSetMacro(NP, int);
71  vtkGetMacro(NP, int);
73 
75 
79  vtkSetMacro(RL, float);
80  vtkGetMacro(RL, float);
82 
84 
89  vtkSetMacro(Overlap, float);
90  vtkGetMacro(Overlap, float);
92 
94 
98  vtkSetMacro(PMin, int);
99  vtkGetMacro(PMin, int);
101 
103 
107  vtkSetMacro(BB, float);
108  vtkGetMacro(BB, float);
110 
112 
116  vtkSetMacro(ComputeSOD, int);
117  vtkGetMacro(ComputeSOD, int);
119 
121 
125  vtkSetMacro(CenterFindingMethod, int);
126  vtkGetMacro(CenterFindingMethod, int);
128 
130 
134  vtkSetMacro(RhoC, float);
135  vtkGetMacro(RhoC, float);
137 
139 
143  vtkSetMacro(SODMass, float);
144  vtkGetMacro(SODMass, float);
146 
148 
152  vtkSetMacro(MinRadiusFactor, float);
153  vtkGetMacro(MinRadiusFactor, float);
155 
157 
161  vtkSetMacro(MaxRadiusFactor, float);
162  vtkGetMacro(MaxRadiusFactor, float);
164 
166 
170  vtkSetMacro(SODBins, int);
171  vtkGetMacro(SODBins, int);
173 
175 
179  vtkSetMacro(MinFOFSize, int);
180  vtkGetMacro(MinFOFSize, int);
182 
184 
188  vtkSetMacro(MinFOFMass, float);
189  vtkGetMacro(MinFOFMass, float);
191 
192 protected:
195 
196  virtual int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*);
197 
202  bool CheckOutputIntegrity(vtkUnstructuredGrid* outputParticles);
203 
208  void ComputeFOFHalos(vtkUnstructuredGrid* particles, vtkUnstructuredGrid* haloCenters);
209 
213  void ComputeSODHalos(vtkUnstructuredGrid* particles, vtkUnstructuredGrid* haloCenters);
214 
219  void VectorizeData(vtkUnstructuredGrid* particles);
220 
224  void ComputeFOFHaloProperties();
225 
231  void InitializeHaloCenters(vtkUnstructuredGrid* haloCenters, unsigned int N);
232 
237  void MarkHaloParticlesAndGetCenter(const unsigned int halo, const int internalHaloIdx,
238  double center[3], vtkUnstructuredGrid* particles);
239 
243  void ResetHaloFinderInternals();
244 
248  void InitializeSODHaloArrays(vtkUnstructuredGrid* haloCenters);
249 
251 
252  int NP; // num particles in the original simulation
253  float RL; // The physical box dimensions (rL)
254  float Overlap; // The ghost cell boundary space
255  int PMin; // The minimum particles for a halo
256  float BB; // The linking length
257 
258  int CenterFindingMethod; // Halo center detection method
259  int ComputeSOD; // Turn on Spherical OverDensity (SOD) halos
260 
261  float RhoC; // SOD rho_C (2.77536627e11)
262  float SODMass; // Initial SOD mass (1.0e14)
263  float MinRadiusFactor; // Minimum factor of SOD radius (0.5)
264  float MaxRadiusFactor; // Maximum factor of SOD radius (2.0)
265  int SODBins; // Number of log scale bins for SOD (20)
266  int MinFOFSize; // Minimum FOF size for SOD (1000)
267  float MinFOFMass; // Minimum FOF mass for SOD (5.0e12)
268 
269  HaloFinderInternals::ParticleData* Particles;
270  HaloFinderInternals::HaloData* Halos;
271  cosmotk::CosmoHaloFinderP* HaloFinder;
272 
273 private:
274  vtkPLANLHaloFinder(const vtkPLANLHaloFinder&) = delete;
275  void operator=(const vtkPLANLHaloFinder&) = delete;
276 };
277 
278 #endif // vtkPLANLHaloFinder_h
cosmotk::CosmoHaloFinderP * HaloFinder
HaloFinderInternals::HaloData * Halos
find halos within a cosmology data file
vtkMultiProcessController * Controller
HaloFinderInternals::ParticleData * Particles