Commit 1860671f authored by Philippe Pébay's avatar Philippe Pébay
Browse files

Allow for binary or ternary subdivisions

Change-Id: I98632a4524dce3f09becfee942fa0a8fcf7e9e43
parent 3f926f87
......@@ -31,6 +31,7 @@ int TestHyperTreeGrid( int argc, char* argv[] )
{
// Default parameters and options
int dim = 3;
int branch = 3;
int max = 3;
int nX = 3;
int nY = 4;
......@@ -51,6 +52,10 @@ int TestHyperTreeGrid( int argc, char* argv[] )
vtksys::CommandLineArguments::SPACE_ARGUMENT,
&dim, "Dimension of hyper tree grid" );
clArgs.AddArgument( "--branch-factor",
vtksys::CommandLineArguments::SPACE_ARGUMENT,
&branch, "Branching factor of hyper tree grid" );
clArgs.AddArgument( "--max-level",
vtksys::CommandLineArguments::SPACE_ARGUMENT,
&max, "Maximum depth of hyper tree grid" );
......@@ -95,12 +100,6 @@ int TestHyperTreeGrid( int argc, char* argv[] )
<< "\n";
}
// Ensure that parsed maximum level makes sense
if ( max < 1 )
{
max = 1;
}
// Ensure that parsed dimensionality makes sense
if ( dim > 3 )
{
......@@ -111,6 +110,22 @@ int TestHyperTreeGrid( int argc, char* argv[] )
dim = 1;
}
// Ensure that parsed branch factor makes sense
if ( branch > 3 )
{
branch = 3;
}
else if ( branch < 2 )
{
branch = 2;
}
// Ensure that parsed maximum level makes sense
if ( max < 1 )
{
max = 1;
}
// Ensure that parsed grid sizes make sense
if ( nX < 1 )
{
......@@ -140,7 +155,7 @@ int TestHyperTreeGrid( int argc, char* argv[] )
// Create hyper tree grid source
vtkNew<vtkHyperTreeGridSource> fractal;
fractal->SetMaximumLevel( 3 );
fractal->SetMaximumLevel( max );
fractal->DualOn();
if ( dim == 3 )
{
......@@ -148,7 +163,7 @@ int TestHyperTreeGrid( int argc, char* argv[] )
}
fractal->SetGridSize( nX, nY, nZ );
fractal->SetDimension( dim );
fractal->SetAxisBranchFactor( 3 );
fractal->SetAxisBranchFactor( branch );
fractal->Update();
vtkHyperTreeGrid* htGrid = fractal->GetOutput();
......
Supports Markdown
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