Commit 1db0431a authored by ghweber's avatar ghweber

Add metadata required for AMRStitchCellOperator in FLASH database plugin

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@23905 18c085ea-50e0-402c-830e-de6fd14e8384
parent b3c2b16e
......@@ -776,6 +776,9 @@ QsortCurveSorter(const void *arg1, const void *arg2)
// Hank Childs, Fri Mar 19 11:06:49 PDT 2010
// Do not flatten curves ... leave them as AMR.
//
// Gunther H. Weber, Mon Jul 28 18:15:48 PDT 2014
// Add meta data requried by AMRStitchCell operator.
//
// ****************************************************************************
vtkDataSet *
......@@ -819,6 +822,15 @@ avtFLASHFileFormat::GetMesh(int domain, const char *meshname)
rGrid->SetZCoordinates(coords[2]);
coords[2]->Delete();
vtkIntArray *arr = vtkIntArray::New();
arr->SetNumberOfTuples(3);
arr->SetValue(0, blocks[theRealDomain].minGlobalLogicalExtents[0]);
arr->SetValue(1, blocks[theRealDomain].minGlobalLogicalExtents[1]);
arr->SetValue(2, blocks[theRealDomain].minGlobalLogicalExtents[2]);
arr->SetName("base_index");
rGrid->GetFieldData()->AddArray(arr);
arr->Delete();
return rGrid;
}
else if (string(meshname) == "mesh_blockandproc")
......@@ -2758,6 +2770,9 @@ void avtFLASHFileFormat::DetermineGlobalLogicalExtentsForAllBlocks()
// Hank Childs, Sat Mar 20 20:25:14 PDT 2010
// Only do domain abutment based on database option.
//
// Gunther H. Weber, Mon Jul 28 18:14:55 PDT 2014
// Add metdata required for AMRStitchCell operator
//
// ****************************************************************************
void
......@@ -2779,34 +2794,10 @@ avtFLASHFileFormat::BuildDomainNesting()
{
int i;
if (addStructuredDomainBoundaries)
{
int t1 = visitTimer->StartTimer();
avtRectilinearDomainBoundaries *rdb = new avtRectilinearDomainBoundaries(true);
rdb->SetNumDomains(numBlocks);
for (i = 0; i < numBlocks; i++)
{
int logExts[6];
logExts[0] = blocks[i].minGlobalLogicalExtents[0];
logExts[1] = blocks[i].maxGlobalLogicalExtents[0];
logExts[2] = blocks[i].minGlobalLogicalExtents[1];
logExts[3] = blocks[i].maxGlobalLogicalExtents[1];
logExts[4] = blocks[i].minGlobalLogicalExtents[2];
logExts[5] = blocks[i].maxGlobalLogicalExtents[2];
rdb->SetIndicesForAMRPatch(FLASHIdToVisitId[i], blocks[i].level - 1, logExts);
}
rdb->CalculateBoundaries();
void_ref_ptr vrdb = void_ref_ptr(rdb,
avtStructuredDomainBoundaries::Destruct);
cache->CacheVoidRef("any_mesh", AUXILIARY_DATA_DOMAIN_BOUNDARY_INFORMATION,
timestep, -1, vrdb);
visitTimer->StopTimer(t1, "FLASH setting up domain boundaries");
}
//
// build the avtDomainNesting object
//
vector< vector<int> > refinement_ratios;
if (numLevels > 0)
{
......@@ -2833,6 +2824,7 @@ avtFLASHFileFormat::BuildDomainNesting()
ratios[1] = 2;
ratios[2] = 2;
dn->SetLevelRefinementRatios(i, ratios);
refinement_ratios.push_back(ratios);
}
//
......@@ -2867,6 +2859,21 @@ avtFLASHFileFormat::BuildDomainNesting()
dn->SetNestingForDomain(FLASHIdToVisitId[i], blocks[i].level-1,
childBlocks, logExts);
// Instead of finding a representative block for each level, we set the
// level cell size for each block. Less bookkeeping and the calculation
// is not that expensive
vector<double> cs(3);
cs[0] = 0.0;
cs[1] = 0.0;
cs[2] = 0.0;
for (int d=0 ; d<dimension; ++d)
{
double minExt = blocks[i].minSpatialExtents[d];
double maxExt = blocks[i].maxSpatialExtents[d];
cs[d] = (maxExt-minExt) / double(block_ndims[d]-1);
}
dn->SetLevelCellSizes(blocks[i].level-1, cs);
}
void_ref_ptr vr = void_ref_ptr(dn,
......@@ -2877,6 +2884,32 @@ avtFLASHFileFormat::BuildDomainNesting()
timestep, -1, vr);
visitTimer->StopTimer(t2, "FLASH setting up patch nesting");
}
if (addStructuredDomainBoundaries)
{
int t1 = visitTimer->StartTimer();
avtRectilinearDomainBoundaries *rdb = new avtRectilinearDomainBoundaries(true);
rdb->SetNumDomains(numBlocks);
rdb->SetRefinementRatios(refinement_ratios);
for (i = 0; i < numBlocks; i++)
{
int logExts[6];
logExts[0] = blocks[i].minGlobalLogicalExtents[0];
logExts[1] = blocks[i].maxGlobalLogicalExtents[0];
logExts[2] = blocks[i].minGlobalLogicalExtents[1];
logExts[3] = blocks[i].maxGlobalLogicalExtents[1];
logExts[4] = blocks[i].minGlobalLogicalExtents[2];
logExts[5] = blocks[i].maxGlobalLogicalExtents[2];
rdb->SetIndicesForAMRPatch(FLASHIdToVisitId[i], blocks[i].level - 1, logExts);
}
rdb->CalculateBoundaries();
void_ref_ptr vrdb = void_ref_ptr(rdb,
avtStructuredDomainBoundaries::Destruct);
cache->CacheVoidRef("any_mesh", AUXILIARY_DATA_DOMAIN_BOUNDARY_INFORMATION,
timestep, -1, vrdb);
visitTimer->StopTimer(t1, "FLASH setting up domain boundaries");
}
}
// ***********************************************************************
......
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