vtkCTHSource.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkCTHSource.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html 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 #ifndef vtkCTHSource_h
17 #define vtkCTHSource_h
18 
19 #include "vtkBoundingBox.h" // For bounding box
20 #include "vtkPVAdaptorsCTHModule.h"
21 #include "vtkSmartPointer.h" // for AMRSets
22 
23 #include <vector> // For field names
24 
25 class vtkCTHDataArray;
26 class vtkIntArray;
28 class vtkAMRBox;
29 class vtkUniformGrid;
31 
33 {
34 public:
35  vtkCTHSource();
36  virtual ~vtkCTHSource();
37 
38  // Description:
39  // Initializes the model parameters
40  void Initialize(int igm, int n_blocks, int nmat, int max_mat, int NCFields, int NMFields,
41  double* x0, double* x1, int max_level);
42  // Description:
43  // Initialize block parameters for block_id
44  void InitializeBlock(int block_id, int Nx, int Ny, int Nz, double* x, double* y, double* z,
45  int active, int active1, int level);
46  // Description:
47  // Initialize field parameters for field_id
48  void SetCellFieldName(int field_id, char* field_name, char* comment, int matid);
49  void SetMaterialFieldName(int field_id, char* field_name, char* command);
50  // Description:
51  // Set data pointer for horizontal field data strip
52  void SetCellFieldPointer(int block_id, int field_id, int k, int j, double* istrip);
53  void SetMaterialFieldPointer(int block_id, int field_id, int mat, int k, int j, double* istrip);
54  // Description:
55  // Update block parameters for block_id (due to refinement/coarsening)
56  void UpdateBlock(int block_id, int active, int active1, int level, int max_level, int bxbot,
57  int bxtop, int bybot, int bytop, int bzbot, int bztop, int* neighb_proc, int* neighb_block);
58 
59  virtual int FillInputData(vtkCPInputDataDescription* input);
60 
61 protected:
62  void UpdateRepresentation();
63 
64  int MaxLevel;
65  int MinLevel;
66  double MinLevelSpacing[3];
67  int GlobalBlockSize[3];
68 
70 
71  std::vector<std::string> CFieldNames;
72  std::vector<std::vector<std::string> > MFieldNames;
73 
75 
77 
78  struct Block
79  {
80  int id;
81  int allocated;
82  int active;
83  int level;
84  int Nx, Ny, Nz;
85  double *x, *y, *z;
86  int bot[3];
87  int top[3];
88  int neighbor_proc[24];
89  int neighbor_block[24];
90  std::vector<vtkSmartPointer<vtkCTHDataArray> > CFieldData;
92  std::vector<std::vector<vtkSmartPointer<vtkCTHDataArray> > > MFieldData;
95  };
96  std::vector<Block> Blocks;
98 
99  void AllocateBlock(Block& b);
100  bool GetBounds(Block& b, int loCorner[3], int hiCorner[3]);
101  void AddGhostArray(Block& b, int dx, int dy, int dz);
102  void AddBlockIdArray(Block& b, int dx, int dy, int dz);
103  void AddNeighborArray(Block& b);
104  void AddAMRLevelArray(Block& b, int dx, int dy, int dz);
105  void AddFieldArrays(Block& b);
106  void AddFieldArrays(Block& b, int loCorner[3], int hiCorner[3]);
107  void AddActivationArray(Block& b);
108  void AddAttributesToAMR(vtkNonOverlappingAMR* amr);
109 
110 private:
111  vtkCTHSource(const vtkCTHSource&) = delete;
112  void operator=(const vtkCTHSource&) = delete;
113 };
114 
115 #endif /* vtkCTHSource_h */
vtkIntArray * NeighborArray
Definition: vtkCTHSource.h:74
#define VTKPVADAPTORSCTH_EXPORT
vtkUniformGrid * ug
Definition: vtkCTHSource.h:93
std::vector< std::vector< std::string > > MFieldNames
Definition: vtkCTHSource.h:72
This class provides the data description for each input for the coprocessor pipelines.
level
vtkSmartPointer< vtkNonOverlappingAMR > AMRSet
Definition: vtkCTHSource.h:97
vtkBoundingBox Bounds
Definition: vtkCTHSource.h:69
std::vector< std::vector< vtkSmartPointer< vtkCTHDataArray > > > MFieldData
Definition: vtkCTHSource.h:92
bool AllocationsChanged
Definition: vtkCTHSource.h:76
std::vector< std::string > CFieldNames
Definition: vtkCTHSource.h:71
std::vector< vtkSmartPointer< vtkCTHDataArray > > CFieldData
Definition: vtkCTHSource.h:90
top
std::vector< Block > Blocks
Definition: vtkCTHSource.h:96