Commit 1522267e authored by allens's avatar allens

added number of blocks options to the reader

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@26755 18c085ea-50e0-402c-830e-de6fd14e8384
parent 21579fef
......@@ -202,15 +202,15 @@ avtPICS_TesterFileFormat::ReadHeader(const char *filename)
}
else if( flowType == DOUBLE_GYRE )
{
int nTimes, nx, ny, nz;
int nTimes, nb, nx, ny, nz;
double startTime, endTime, simulationTime, dt, bx, by, bz;
bool validScan = (sscanf(line,
"%d %lf %lf %d %d %d %lf %lf %lf %lf %lf %lf",
&nTimes, &startTime, &simulationTime,
&nx, &ny, &nz,
&bx, &by, &bz,
&dg_A, &dg_epsilon, &dg_period) == 12);
bool validScan =
(sscanf(line, "%d %lf %lf %d %d %d %d %lf %lf %lf %lf %lf %lf",
&nTimes, &startTime, &simulationTime,
&nb, &nx, &ny, &nz,
&bx, &by, &bz,
&dg_A, &dg_epsilon, &dg_period) == 13);
if( validScan )
{
......@@ -249,10 +249,14 @@ avtPICS_TesterFileFormat::ReadHeader(const char *filename)
times.push_back( startTime + (double) i * dt );
cycles.push_back(i);
numBlocks[0].push_back(1);
numBlocks[1].push_back(1);
numBlocks[2].push_back(1);
numBlocks[0].push_back(nb);
numBlocks[1].push_back(nb);
if (rank == 2)
numBlocks[2].push_back(1);
else
numBlocks[2].push_back(nb);
numCells[0].push_back(nx);
numCells[1].push_back(ny);
numCells[2].push_back(nz);
......@@ -263,9 +267,10 @@ avtPICS_TesterFileFormat::ReadHeader(const char *filename)
}
else if( flowType == ABC_FLOW_STEADY_STATE )
{
int nx, ny, nz;
int nb, nx, ny, nz;
bool validScan = (sscanf(line, "%d %d %d", &nx, &ny, &nz ) == 3);
bool validScan = (sscanf(line, "%d %d %d %d",
&nb, &nx, &ny, &nz ) == 4);
if( validScan )
{
......@@ -287,10 +292,14 @@ avtPICS_TesterFileFormat::ReadHeader(const char *filename)
times.push_back(0);
cycles.push_back(0);
numBlocks[0].push_back(1);
numBlocks[1].push_back(1);
numBlocks[2].push_back(1);
numBlocks[0].push_back(nb);
numBlocks[1].push_back(nb);
if (rank == 2)
numBlocks[2].push_back(1);
else
numBlocks[2].push_back(nb);
numCells[0].push_back(nx);
numCells[1].push_back(ny);
numCells[2].push_back(nz);
......@@ -300,15 +309,15 @@ avtPICS_TesterFileFormat::ReadHeader(const char *filename)
}
else if( flowType == ABC_FLOW_APERIODIC )
{
int nTimes, nx, ny, nz;
int nTimes, nb, nx, ny, nz;
double startTime, endTime, simulationTime, dt;
bool validScan = (sscanf(line,
"%d %lf %lf %d %d %d %lf %lf %lf %d %d %d",
&nTimes, &startTime, &simulationTime,
&nx, &ny, &nz,
&abc_c0, &abc_c1, &abc_c2,
&abc_signalA, &abc_signalB, &abc_signalC) == 12);
bool validScan =
(sscanf(line, "%d %lf %lf %d %d %d %d %lf %lf %lf %d %d %d",
&nTimes, &startTime, &simulationTime,
&nb, &nx, &ny, &nz,
&abc_c0, &abc_c1, &abc_c2,
&abc_signalA, &abc_signalB, &abc_signalC) == 13);
if( validScan )
{
......@@ -823,6 +832,28 @@ avtPICS_TesterFileFormat::GetVectorVar(int timestate, int domain, const char *va
return rv;
}
// ****************************************************************************
// Method: avtPICS_TesterFileFormat::GetAuxiliaryData
//
// Purpose:
// Gets the auxiliary data from a Silo file.
//
// Arguments:
// var The variable of interest.
// domain The domain of interest.
// type The type of auxiliary data.
// <unnamed> The arguments for that -- not used for any PICS types.
// df The interval tree destructor function.
//
// Returns: The auxiliary data. Throws an exception if this is not a
// supported data type.
//
// Programmer: hchilds -- generated by xml2avt
// Creation: Tue Mar 6 07:45:19 PDT 2012
//
// ****************************************************************************
void *
avtPICS_TesterFileFormat::GetAuxiliaryData(const char *var, int ts, int dom,
const char * type, void *,
......@@ -848,21 +879,21 @@ avtPICS_TesterFileFormat::GetAuxiliaryData(const char *var, int ts, int dom,
int yOff = (domain/numBlocks[0][ts]) % numBlocks[1][ts];
int zOff = domain/(numBlocks[0][ts]*numBlocks[1][ts]);
double bounds[6];
bounds[0] = xOff*xSizePerBlock;
bounds[1] = (xOff+1)*xSizePerBlock;
bounds[2] = yOff*ySizePerBlock;
bounds[3] = (yOff+1)*ySizePerBlock;
double extents[6];
extents[0] = xOff*xSizePerBlock;
extents[1] = (xOff+1)*xSizePerBlock;
extents[2] = yOff*ySizePerBlock;
extents[3] = (yOff+1)*ySizePerBlock;
if (rank == 3)
{
bounds[4] = zOff*zSizePerBlock;
bounds[5] = (zOff+1)*zSizePerBlock;
extents[4] = zOff*zSizePerBlock;
extents[5] = (zOff+1)*zSizePerBlock;
}
else
{
bounds[4] = 0.0;
bounds[5] = 0.0;
extents[4] = 0.0;
extents[5] = 0.0;
}
if (! isRectilinear)
{
......@@ -875,9 +906,9 @@ avtPICS_TesterFileFormat::GetAuxiliaryData(const char *var, int ts, int dom,
for (i = 0 ; i < 8 ; i++)
{
double pt[3];
pt[0] = (i%2 ? bounds[0] : bounds[1]);
pt[1] = (((i/2)%2) ? bounds[2] : bounds[3]);
pt[2] = (i/2 ? bounds[4] : bounds[5]);
pt[0] = (i%2 ? extents[0] : extents[1]);
pt[1] = (((i/2)%2) ? extents[2] : extents[3]);
pt[2] = (i/2 ? extents[4] : extents[5]);
double pt2[3];
RotatePoint(pt, pt2);
b[0] = (b[0] < pt2[0] ? b[0] : pt2[0]);
......@@ -888,9 +919,9 @@ avtPICS_TesterFileFormat::GetAuxiliaryData(const char *var, int ts, int dom,
b[5] = (b[5] > pt2[2] ? b[5] : pt2[2]);
}
for (i = 0 ; i < 6 ; i++)
bounds[i] = b[i];
extents[i] = b[i];
}
itree->AddElement(domain, bounds);
itree->AddElement(domain, extents);
}
itree->Calculate(true);
......
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