vtkPLANLHaloFinder.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPLANLHaloFinder.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 /*=========================================================================
16 
17  Program: VTK/ParaView Los Alamos National Laboratory Modules (PVLANL)
18  Module: vtkPLANLHaloFinder.h
19 
20 Copyright (c) 2007, 2009, Los Alamos National Security, LLC
21 
22 All rights reserved.
23 
24 Copyright 2007, 2009. Los Alamos National Security, LLC.
25 This software was produced under U.S. Government contract DE-AC52-06NA25396
26 for Los Alamos National Laboratory (LANL), which is operated by
27 Los Alamos National Security, LLC for the U.S. Department of Energy.
28 The U.S. Government has rights to use, reproduce, and distribute this software.
29 NEITHER THE GOVERNMENT NOR LOS ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY,
30 EXPRESS OR IMPLIED, OR ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE.
31 If software is modified to produce derivative works, such modified software
32 should be clearly marked, so as not to confuse it with the version available
33 from LANL.
34 
35 Additionally, redistribution and use in source and binary forms, with or
36 without modification, are permitted provided that the following conditions
37 are met:
38 - Redistributions of source code must retain the above copyright notice,
39  this list of conditions and the following disclaimer.
40 - Redistributions in binary form must reproduce the above copyright notice,
41  this list of conditions and the following disclaimer in the documentation
42  and/or other materials provided with the distribution.
43 - Neither the name of Los Alamos National Security, LLC, Los Alamos National
44  Laboratory, LANL, the U.S. Government, nor the names of its contributors
45  may be used to endorse or promote products derived from this software
46  without specific prior written permission.
47 
48 THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND CONTRIBUTORS
49 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
50 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
51 ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL SECURITY, LLC OR
52 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
53 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
54 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
55 OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
56 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
57 OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
58 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
59 
60 =========================================================================*/
70 #ifndef vtkPLANLHaloFinder_h
71 #define vtkPLANLHaloFinder_h
72 
73 #include "vtkPVVTKExtensionsCosmoToolsModule.h" // For export macro
75 
76 // Forward declarations
78 class vtkIndent;
79 class vtkInformation;
82 
83 // CosmoTools Forward declarations
84 namespace cosmotk
85 {
86 class CosmoHaloFinderP;
87 }
88 
89 // HaloFinderInternals Forward declarations
91 {
92 class ParticleData;
93 class HaloData;
94 }
95 
96 class VTKPVVTKEXTENSIONSCOSMOTOOLS_EXPORT vtkPLANLHaloFinder : public vtkUnstructuredGridAlgorithm
97 {
98 public:
99  enum
100  {
101  AVERAGE = 0,
102  CENTER_OF_MASS = 1,
103  MBP = 2,
104  MCP = 3,
105  NUMBER_OF_CENTER_FINDING_METHODS
106  } CenterDetectionAlgorithm;
107 
108  static vtkPLANLHaloFinder* New();
109 
111  void PrintSelf(ostream& os, vtkIndent indent);
112 
114 
117  virtual vtkMultiProcessController* GetController();
118  virtual void SetController(vtkMultiProcessController*);
120 
122 
126  vtkSetMacro(NP, int);
127  vtkGetMacro(NP, int);
129 
131 
135  vtkSetMacro(RL, float);
136  vtkGetMacro(RL, float);
138 
140 
145  vtkSetMacro(Overlap, float);
146  vtkGetMacro(Overlap, float);
148 
150 
154  vtkSetMacro(PMin, int);
155  vtkGetMacro(PMin, int);
157 
159 
163  vtkSetMacro(BB, float);
164  vtkGetMacro(BB, float);
166 
168 
172  vtkSetMacro(ComputeSOD, int);
173  vtkGetMacro(ComputeSOD, int);
175 
177 
181  vtkSetMacro(CenterFindingMethod, int);
182  vtkGetMacro(CenterFindingMethod, int);
184 
186 
190  vtkSetMacro(RhoC, float);
191  vtkGetMacro(RhoC, float);
193 
195 
199  vtkSetMacro(SODMass, float);
200  vtkGetMacro(SODMass, float);
202 
204 
208  vtkSetMacro(MinRadiusFactor, float);
209  vtkGetMacro(MinRadiusFactor, float);
211 
213 
217  vtkSetMacro(MaxRadiusFactor, float);
218  vtkGetMacro(MaxRadiusFactor, float);
220 
222 
226  vtkSetMacro(SODBins, int);
227  vtkGetMacro(SODBins, int);
229 
231 
235  vtkSetMacro(MinFOFSize, int);
236  vtkGetMacro(MinFOFSize, int);
238 
240 
244  vtkSetMacro(MinFOFMass, float);
245  vtkGetMacro(MinFOFMass, float);
247 
248 protected:
251 
252  virtual int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*);
253 
258  bool CheckOutputIntegrity(vtkUnstructuredGrid* outputParticles);
259 
264  void ComputeFOFHalos(vtkUnstructuredGrid* particles, vtkUnstructuredGrid* haloCenters);
265 
269  void ComputeSODHalos(vtkUnstructuredGrid* particles, vtkUnstructuredGrid* haloCenters);
270 
275  void VectorizeData(vtkUnstructuredGrid* particles);
276 
280  void ComputeFOFHaloProperties();
281 
287  void InitializeHaloCenters(vtkUnstructuredGrid* haloCenters, unsigned int N);
288 
293  void MarkHaloParticlesAndGetCenter(const unsigned int halo, const int internalHaloIdx,
294  double center[3], vtkUnstructuredGrid* particles);
295 
299  void ResetHaloFinderInternals();
300 
304  void InitializeSODHaloArrays(vtkUnstructuredGrid* haloCenters);
305 
307 
308  int NP; // num particles in the original simulation
309  float RL; // The physical box dimensions (rL)
310  float Overlap; // The ghost cell boundary space
311  int PMin; // The minimum particles for a halo
312  float BB; // The linking length
313 
314  int CenterFindingMethod; // Halo center detection method
315  int ComputeSOD; // Turn on Spherical OverDensity (SOD) halos
316 
317  float RhoC; // SOD rho_C (2.77536627e11)
318  float SODMass; // Initial SOD mass (1.0e14)
319  float MinRadiusFactor; // Minimum factor of SOD radius (0.5)
320  float MaxRadiusFactor; // Maximum factor of SOD radius (2.0)
321  int SODBins; // Number of log scale bins for SOD (20)
322  int MinFOFSize; // Minimum FOF size for SOD (1000)
323  float MinFOFMass; // Minimum FOF mass for SOD (5.0e12)
324 
325  HaloFinderInternals::ParticleData* Particles;
326  HaloFinderInternals::HaloData* Halos;
327  cosmotk::CosmoHaloFinderP* HaloFinder;
328 
329 private:
330  vtkPLANLHaloFinder(const vtkPLANLHaloFinder&) = delete;
331  void operator=(const vtkPLANLHaloFinder&) = delete;
332 };
333 
334 #endif // vtkPLANLHaloFinder_h
cosmotk::CosmoHaloFinderP * HaloFinder
HaloFinderInternals::HaloData * Halos
find halos within a cosmology data file
vtkMultiProcessController * Controller
HaloFinderInternals::ParticleData * Particles