MCPcopy Create free account
hub / github.com/Kitware/ParaView / CoProcess

Method CoProcess

Examples/Catalyst/CxxHyperTreeGridExample/FEAdaptor.cxx:53–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53void FEAdaptor::CoProcess(double time, unsigned int timeStep, bool lastTimeStep)
54{
55 vtkNew<vtkCPDataDescription> dataDescription;
56 dataDescription->AddInput("input");
57 dataDescription->SetTimeData(time, timeStep);
58 if (lastTimeStep == true)
59 {
60 // assume that we want to all the pipelines to execute if it
61 // is the last time step.
62 dataDescription->ForceOutputOn();
63 }
64 if (this->Processor->RequestDataDescription(dataDescription) != 0)
65 {
66 vtkMultiProcessController* controller = vtkMultiProcessController::GetGlobalController();
67 int numberOfProcesses = controller->GetNumberOfProcesses();
68 int processId = controller->GetLocalProcessId();
69 vtkNew<vtkHyperTreeGrid> hyperTreeGrid;
70 hyperTreeGrid->Initialize();
71 int extent[6] = { processId, processId + 1, 0, 1, 0, 1 };
72 hyperTreeGrid->SetGridExtent(extent);
73 hyperTreeGrid->SetDimension(3);
74 // hyperTreeGrid->SetOrientation(0);
75 hyperTreeGrid->SetBranchFactor(2);
76 // hyperTreeGrid->SetMaterialMaskIndex(nullptr);
77
78 vtkNew<vtkDoubleArray> xCoords;
79 xCoords->SetNumberOfValues(2);
80 xCoords->SetValue(0, processId);
81 xCoords->SetValue(1, processId + 1.);
82 vtkNew<vtkDoubleArray> yCoords;
83 yCoords->SetNumberOfValues(2);
84 yCoords->SetValue(0, 0);
85 yCoords->SetValue(1, 1);
86 vtkNew<vtkDoubleArray> zCoords;
87 zCoords->SetNumberOfValues(2);
88 zCoords->SetValue(0, 0);
89 zCoords->SetValue(1, 1);
90
91 hyperTreeGrid->SetXCoordinates(xCoords);
92 hyperTreeGrid->SetYCoordinates(yCoords);
93 hyperTreeGrid->SetZCoordinates(zCoords);
94
95 hyperTreeGrid->GenerateTrees();
96
97 this->FillHTG(hyperTreeGrid);
98
99 vtkCPInputDataDescription* inputDataDescription =
100 dataDescription->GetInputDescriptionByName("input");
101 inputDataDescription->SetGrid(hyperTreeGrid);
102
103 // Set whole extent
104 int wholeExtent[6] = { 0, numberOfProcesses, 0, 1, 0, 1 };
105 inputDataDescription->SetWholeExtent(wholeExtent);
106
107 this->Processor->CoProcess(dataDescription);
108 }
109}
110

Callers 12

CoProcessFunction · 0.45
CatalystCoProcessFunction · 0.45
CoProcessFunction · 0.45
mainFunction · 0.45
CoProcessFunction · 0.45
CoProcessFunction · 0.45
CoProcessFunction · 0.45
CoProcessFunction · 0.45
filedriver.pyFile · 0.45
mainFunction · 0.45
coprocessFunction · 0.45
CatalystCoProcessFunction · 0.45

Calls 10

FillHTGMethod · 0.95
SetTimeDataMethod · 0.80
GenerateTreesMethod · 0.80
AddInputMethod · 0.45
GetNumberOfProcessesMethod · 0.45
InitializeMethod · 0.45
SetValueMethod · 0.45
SetWholeExtentMethod · 0.45

Tested by

no test coverage detected