Commit db1981a3 authored by Ken Martin's avatar Ken Martin
Browse files

big change to the testing for MPI systems, some other minor fixes as well

parent 784f584a
......@@ -21,7 +21,7 @@
#include "vtkPointData.h"
#include "vtkUnstructuredGrid.h"
vtkCxxRevisionMacro(vtkReflectionFilter, "1.13");
vtkCxxRevisionMacro(vtkReflectionFilter, "1.13.6.1");
vtkStandardNewMacro(vtkReflectionFilter);
//---------------------------------------------------------------------------
......@@ -29,6 +29,7 @@ vtkReflectionFilter::vtkReflectionFilter()
{
this->Plane = USE_X_MIN;
this->Center = 0.0;
this->CopyInput = 1;
}
//---------------------------------------------------------------------------
......@@ -70,8 +71,16 @@ void vtkReflectionFilter::Execute()
input->GetBounds(bounds);
outPoints = vtkPoints::New();
if (this->CopyInput)
{
outPoints->Allocate(2* numPts);
output->Allocate(numCells * 2);
}
else
{
outPoints->Allocate(numPts);
output->Allocate(numCells);
}
outPD->CopyAllocate(inPD);
outCD->CopyAllocate(inCD);
......@@ -89,12 +98,15 @@ void vtkReflectionFilter::Execute()
outCellNormals = outCD->GetNormals();
// Copy first points.
if (this->CopyInput)
{
for (i = 0; i < numPts; i++)
{
input->GetPoint(i, point);
ptId = outPoints->InsertNextPoint(point);
outPD->CopyData(inPD, i, ptId);
}
}
// Copy reflected points.
switch (this->Plane)
......@@ -165,12 +177,15 @@ void vtkReflectionFilter::Execute()
vtkIdList *cellPts;
// Copy original cells.
if (this->CopyInput)
{
for (i = 0; i < numCells; i++)
{
input->GetCellPoints(i, ptIds);
output->InsertNextCell(input->GetCellType(i), ptIds);
outCD->CopyData(inCD, i, i);
}
}
// Generate reflected cells.
for (i = 0; i < numCells; i++)
......@@ -192,7 +207,11 @@ void vtkReflectionFilter::Execute()
newCellPts[3] = cellPts->GetId(2) + numPts;
for (j = 4; j < numCellPts; j++)
{
newCellPts[j] = cellPts->GetId(j-1) + numPts;
newCellPts[j] = cellPts->GetId(j-1);
if (this->CopyInput)
{
newCellPts[j] += numPts;
}
}
}
else
......@@ -200,7 +219,11 @@ void vtkReflectionFilter::Execute()
newCellPts = new vtkIdType[numCellPts];
for (j = numCellPts-1; j >= 0; j--)
{
newCellPts[numCellPts-1-j] = cellPts->GetId(j) + numPts;
newCellPts[numCellPts-1-j] = cellPts->GetId(j);
if (this->CopyInput)
{
newCellPts[numCellPts-1-j] += numPts;
}
}
}
cellId = output->InsertNextCell(cellType, numCellPts, newCellPts);
......@@ -234,4 +257,5 @@ void vtkReflectionFilter::PrintSelf(ostream &os, vtkIndent indent)
os << indent << "Plane: " << this->Plane << endl;
os << indent << "Center: " << this->Center << endl;
os << indent << "CopyInput: " << this->CopyInput << endl;
}
......@@ -67,6 +67,13 @@ public:
vtkSetMacro(Center, double);
vtkGetMacro(Center, double);
// Description:
// If on (the default), copy the input geometry to the output. If off,
// the output will only contain the reflection.
vtkSetMacro(CopyInput, int);
vtkGetMacro(CopyInput, int);
vtkBooleanMacro(CopyInput, int);
protected:
vtkReflectionFilter();
~vtkReflectionFilter();
......@@ -75,6 +82,7 @@ protected:
int Plane;
double Center;
int CopyInput;
void FlipVector(double tuple[3], int mirrorDir[3]);
......
......@@ -44,19 +44,22 @@ IF (VTK_DATA_ROOT)
IF (VTK_USE_MPI)
IF (UNIX)
IF (VTK_MPIRUN_EXE)
ADD_TEST(ParallelIsoMPI-image ${VTK_MPIRUN_EXE} ${VTK_MPI_PREFLAGS}
ADD_TEST(ParallelIsoMPI-image
${VTK_MPIRUN_EXE} ${VTK_MPI_NUMPROC_FLAG} 2 ${VTK_MPI_PREFLAGS}
${CXX_TEST_PATH}/ParallelIsoTest
-D ${VTK_DATA_ROOT}
-T ${VTK_BINARY_DIR}/Testing/Temporary
-V Baseline/Parallel/ParallelIso.cxx.png
${VTK_MPI_POSTFLAGS})
ADD_TEST(TestCommunicatorMPI-image ${VTK_MPIRUN_EXE} ${VTK_MPI_PREFLAGS}
ADD_TEST(TestCommunicatorMPI-image
${VTK_MPIRUN_EXE} ${VTK_MPI_NUMPROC_FLAG} 2 ${VTK_MPI_PREFLAGS}
${CXX_TEST_PATH}/GenericCommunicator
-D ${VTK_DATA_ROOT}
-T ${VTK_BINARY_DIR}/Testing/Temporary
-V Baseline/Parallel/GenericCommunicator.cxx.png
${VTK_MPI_POSTFLAGS})
ADD_TEST(TestPStreamMPI-image ${VTK_MPIRUN_EXE} ${VTK_MPI_PREFLAGS}
ADD_TEST(TestPStreamMPI-image
${VTK_MPIRUN_EXE} ${VTK_MPI_NUMPROC_FLAG} 2 ${VTK_MPI_PREFLAGS}
${CXX_TEST_PATH}/TestPStream
-D ${VTK_DATA_ROOT}
-T ${VTK_BINARY_DIR}/Testing/Temporary
......@@ -64,7 +67,8 @@ IF (VTK_DATA_ROOT)
${VTK_MPI_POSTFLAGS})
IF (VTK_MPI_MAX_NUMPROCS)
IF (VTK_MPI_MAX_NUMPROCS MATCHES "[1-9]*(0|[4-9])$")
ADD_TEST(MPIGroups-image ${VTK_MPIRUN_EXE} -np ${VTK_MPI_MAX_NUMPROCS}
ADD_TEST(MPIGroups-image
${VTK_MPIRUN_EXE} ${VTK_MPI_NUMPROC_FLAG} ${VTK_MPI_MAX_NUMPROCS} ${VTK_MPI_PREFLAGS}
${CXX_TEST_PATH}/MPIGroups
-D ${VTK_DATA_ROOT}
-T ${VTK_BINARY_DIR}/Testing/Temporary
......@@ -98,7 +102,8 @@ ELSE (VTK_DATA_ROOT)
IF (VTK_USE_MPI)
IF(UNIX)
IF (VTK_MPIRUN_EXE AND VTK_USE_DISPLAY)
ADD_TEST(TestCommunicatorMPI ${VTK_MPIRUN_EXE} ${VTK_MPI_PREFLAGS}
ADD_TEST(TestCommunicatorMPI
${VTK_MPIRUN_EXE} ${VTK_MPI_NUMPROC_FLAG} 2 ${VTK_MPI_PREFLAGS}
${CXX_TEST_PATH}/GenericCommunicator ${VTK_MPI_POSTFLAGS})
ENDIF(VTK_MPIRUN_EXE AND VTK_USE_DISPLAY)
ENDIF(UNIX)
......
......@@ -69,8 +69,9 @@ IF (VTK_DATA_ROOT)
-T ${VTK_BINARY_DIR}/Testing/Temporary
-V Baseline/Parallel/TestPDataSetReaderGrid.tcl.png
-A ${VTK_SOURCE_DIR}/Wrapping/Tcl)
IF(PVTK_EXECUTABLE AND UNIX)
ADD_TEST(TestPProbe-image ${VTK_MPIRUN_EXE} ${VTK_MPI_PREFLAGS} ${PVTK_EXECUTABLE}
IF(PVTK_EXECUTABLE AND VTK_MPIRUN_EXE)
ADD_TEST(TestPProbe-image
${VTK_MPIRUN_EXE} ${VTK_MPI_NUMPROC_FLAG} 2 ${VTK_MPI_PREFLAGS} ${PVTK_EXECUTABLE}
${VTK_SOURCE_DIR}/Common/Testing/Tcl/prtImageTest.tcl
${VTK_SOURCE_DIR}/Parallel/Testing/Tcl/TestPProbe.tcl
-D ${VTK_DATA_ROOT}
......@@ -78,7 +79,7 @@ IF (VTK_DATA_ROOT)
-V Baseline/Parallel/TestPProbe.png
-A ${VTK_SOURCE_DIR}/Wrapping/Tcl
${VTK_MPI_POSTFLAGS})
ELSE(PVTK_EXECUTABLE AND UNIX)
ELSE(PVTK_EXECUTABLE AND VTK_MPIRUN_EXE)
ADD_TEST(TestPProbe-image ${VTK_EXECUTABLE}
${VTK_SOURCE_DIR}/Common/Testing/Tcl/prtImageTest.tcl
${VTK_SOURCE_DIR}/Parallel/Testing/Tcl/TestPProbe.tcl
......@@ -86,7 +87,7 @@ IF (VTK_DATA_ROOT)
-T ${VTK_BINARY_DIR}/Testing/Temporary
-V Baseline/Parallel/TestPProbe.png
-A ${VTK_SOURCE_DIR}/Wrapping/Tcl)
ENDIF(PVTK_EXECUTABLE AND UNIX)
ENDIF(PVTK_EXECUTABLE AND VTK_MPIRUN_EXE)
ELSE (VTK_DATA_ROOT)
ADD_TEST(PolyDataPieces ${VTK_EXECUTABLE}
${VTK_SOURCE_DIR}/Common/Testing/Tcl/rtImageTest.tcl
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment