Commit 50976055 authored by hrchilds's avatar hrchilds

Update from June 3, 2003

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@5 18c085ea-50e0-402c-830e-de6fd14e8384
parent 351b5813
......@@ -14,6 +14,7 @@
#include <avtFacelist.h>
#include <BadDomainException.h>
#include <BadIndexException.h>
#include <DebugStream.h>
#include <ImproperUseException.h>
......@@ -205,6 +206,9 @@ avtFacelist::Destruct(void *p)
// Hank Chlids, Sun Aug 4 18:03:00 PDT 2002
// Copy over all of the cell variables.
//
// Hank Childs, Tue Jun 3 15:07:11 PDT 2003
// Check to make sure that the zones are valid before copying over the data.
//
// ****************************************************************************
void
......@@ -234,8 +238,13 @@ avtFacelist::CalcFacelist(vtkUnstructuredGrid *ugrid, vtkPolyData *pdata)
if (zones != NULL && shouldCopyCellData)
{
outCD->CopyAllocate(inCD);
int nInZones = ugrid->GetNumberOfCells();
for (int i = 0 ; i < nfaces ; i++)
{
if (zones[i] >= nInZones)
{
EXCEPTION2(BadIndexException, zones[i], nInZones);
}
outCD->CopyData(inCD, zones[i], i);
}
outCD->Squeeze();
......
......@@ -23,6 +23,7 @@
#include <avtMetaData.h>
#include <avtTerminatingSource.h>
#include <BadIndexException.h>
#include <DebugStream.h>
......@@ -290,6 +291,9 @@ avtFacelistFilter::ExecuteData(vtkDataSet *in_ds, int domain, std::string)
// Hank Childs, Mon Nov 4 12:52:24 PST 200
// Removed need for a two-pass mode unstructured grid facelist filter.
//
// Hank Childs, Tue Jun 3 15:07:11 PDT 2003
// Account for avtFacelists that are "bad".
//
// ****************************************************************************
vtkDataSet *
......@@ -348,11 +352,23 @@ avtFacelistFilter::Take3DFaces(vtkDataSet *in_ds, int domain)
{
debug5 << "Ugrid using facelist from files for domain "
<< domain << endl;
fl->CalcFacelist((vtkUnstructuredGrid *) in_ds, pd);
out_ds = pd;
mustDeReference = true;
TRY
{
fl->CalcFacelist((vtkUnstructuredGrid *) in_ds, pd);
out_ds = pd;
mustDeReference = true;
}
CATCH (BadIndexException)
{
debug1 << "The facelist was invalid. This often happens "
<< "with history variables." << endl;
debug1 << "The facelist will be calculated by hand."<<endl;
fl = NULL;
}
ENDTRY
}
else
if (fl == NULL) // Value could have changed since last test.
{
debug5 << "Ugrid forced to calculate facelist for domain "
<< domain << endl;
......
......@@ -132,6 +132,10 @@ avtLocateCellQuery::PostExecute(void)
// Kathleen Bonnell, Wed May 7 13:06:55 PDT 2003
// For efficiency, do not use the cell locator for rectilinear grids.
//
// Kathleen Bonnell, Tue Jun 3 15:20:35 PDT 2003
// Removed calculation of tolerance, and passing of that value to FindCell
// methods. No longer use tolerance when calculating fudgedIsect.
//
// ****************************************************************************
void
......@@ -142,27 +146,18 @@ avtLocateCellQuery::Execute(vtkDataSet *ds, const int dom)
return;
}
int dim = GetInput()->GetInfo().GetAttributes().GetSpatialDimension();
float tol, dist, diagLen, isect[3] = { 0., 0., 0.};
float dist, isect[3] = { 0., 0., 0.};
int foundCell;
// Use PickedPoint to determine if it lies in this domain
int nCells = ds->GetNumberOfCells();
diagLen = ds->GetLength();
if (nCells != 0)
tol = diagLen / (float) nCells;
else
tol = 1e-6;
//
// Find the cell, intersection point, and distance along the ray.
//
if (ds->GetDataObjectType() != VTK_RECTILINEAR_GRID)
{
foundCell = LocatorFindCell(ds, tol, dist, isect);
foundCell = LocatorFindCell(ds, dist, isect);
}
else
{
foundCell = RGridFindCell(ds, tol, dist, isect);
foundCell = RGridFindCell(ds, dist, isect);
}
if ((foundCell != -1) && (dist < minDist))
......@@ -202,17 +197,9 @@ avtLocateCellQuery::Execute(vtkDataSet *ds, const int dom)
{
vtkCell *cell = ds->GetCell(foundCell);
float parametricCenter[3];
float xyzCenter[3];
float *weights = new float[cell->GetNumberOfPoints()];
int subId = cell->GetParametricCenter(parametricCenter);
cell->EvaluateLocation(subId, parametricCenter, xyzCenter, weights);
float proj[3];
proj[0] = xyzCenter[0] - isect[0];
proj[1] = xyzCenter[1] - isect[1];
proj[2] = xyzCenter[2] - isect[2];
isect[0] += tol *proj[0];
isect[1] += tol *proj[1];
isect[2] += tol *proj[2];
cell->EvaluateLocation(subId, parametricCenter, isect, weights);
delete [] weights;
}
queryAtts.SetCellPoint(isect);
......@@ -230,7 +217,6 @@ avtLocateCellQuery::Execute(vtkDataSet *ds, const int dom)
//
// Arguments:
// ds The dataset to query.
// tol The tolerance to use.
// dist A place to store the distance along the ray of the
// intersection point.
// isect A place to store the intersection point of the ray with the
......@@ -242,11 +228,16 @@ avtLocateCellQuery::Execute(vtkDataSet *ds, const int dom)
// Programmer: Kathleen Bonnell
// Creation: May 7, 2003
//
// Modifications:
// Kathleen Bonnell, Tue Jun 3 15:20:35 PDT 2003
// Removed tolerance parameter (based on the diagonal length of the dataset)
// in favor of a tolerance calculated from the MinimumCellLength as
// determined by the locator.
//
// ****************************************************************************
int
avtLocateCellQuery::LocatorFindCell(vtkDataSet *ds, const float tol,
float &dist, float *isect)
avtLocateCellQuery::LocatorFindCell(vtkDataSet *ds, float &dist, float *isect)
{
float *rayPt1 = queryAtts.GetRayPoint1();
float *rayPt2 = queryAtts.GetRayPoint2();
......@@ -255,6 +246,25 @@ avtLocateCellQuery::LocatorFindCell(vtkDataSet *ds, const float tol,
cellLocator->SetIgnoreGhosts(true);
cellLocator->SetDataSet(ds);
cellLocator->BuildLocator();
float tol = cellLocator->GetMinCellLength();
if (tol != VTK_LARGE_FLOAT)
{
tol *= 0.001;
}
else // for some reason, the min-cell length did not get calculated.
{
int nCells = ds->GetNumberOfCells();
tol = ds->GetLength();
if (nCells != 0)
{
tol /= (float) nCells;
}
else // we have no cells with which to search.
{
cellLocator->Delete();
return -1;
}
}
float pcoords[3];
int subId;
......@@ -262,7 +272,6 @@ avtLocateCellQuery::LocatorFindCell(vtkDataSet *ds, const float tol,
vtkIdType foundCell;
int success = cellLocator->IntersectWithLine(rayPt1, rayPt2, tol, dist,
isect, pcoords, subId, foundCell);
cellLocator->Delete();
if (success)
return foundCell;
......@@ -280,7 +289,6 @@ avtLocateCellQuery::LocatorFindCell(vtkDataSet *ds, const float tol,
//
// Arguments:
// ds The dataset to query.
// tol <UNUSED>
// dist A place to store the distance along the ray of the
// intersection point.
// isect A place to store the intersetion point of the ray with the
......@@ -292,11 +300,14 @@ avtLocateCellQuery::LocatorFindCell(vtkDataSet *ds, const float tol,
// Programmer: Kathleen Bonnell
// Creation: May 7, 2003
//
// Modifications:
// Kathleen Bonnell, Tue Jun 3 15:20:35 PDT 2003
// Removed unused tolerance parameter.
//
// ****************************************************************************
int
avtLocateCellQuery::RGridFindCell(vtkDataSet *ds, const float,
float &dist, float *isect)
avtLocateCellQuery::RGridFindCell(vtkDataSet *ds, float &dist, float *isect)
{
vtkRectilinearGrid *rgrid = (vtkRectilinearGrid*)ds;
......@@ -332,3 +343,4 @@ avtLocateCellQuery::RGridFindCell(vtkDataSet *ds, const float,
}
return cellId;
}
......@@ -34,6 +34,9 @@ class vtkDataSet;
// Kathleen Bonnell, Wed May 7 13:24:37 PDT 2003
// Add methods 'RGridFindCell' and 'LocatorFindCell'.
//
// Kathleen Bonnell, Tue Jun 3 15:20:35 PDT 2003
// Removed 'tolerance' parameter from FindCell methods.
//
// ****************************************************************************
class QUERY_API avtLocateCellQuery : public avtDatasetQuery
......@@ -55,9 +58,9 @@ class QUERY_API avtLocateCellQuery : public avtDatasetQuery
virtual void Execute(vtkDataSet *, const int);
virtual void PreExecute(void);
virtual void PostExecute(void);
int LocatorFindCell(vtkDataSet *, const float,
int LocatorFindCell(vtkDataSet *,
float &, float*);
int RGridFindCell(vtkDataSet *, const float,
int RGridFindCell(vtkDataSet *,
float &, float*);
};
......
#!/bin/ksh
# $1 = year, $2 = month, $3 = day
function set_time
{
cd /data_vobs/VisIt
echo "element * CHECKEDOUT" > time_file
echo "element * ../svn_Feb_25_2007/LATEST -time $3-$2-$1.23:59" >> time_file
echo "element * /main/LATEST -time $3-$2-$1.23:59" >> time_file
export WINEDITOR="cat"
echo "yes" | ct edcs time_file
cd $OLDPWD
}
# $1: directory to update
function svn_update_dir
{
VOB_dir=$1
# Check to see if any files were removed from the VOB
for i in * ; do
if [[ ! -a $i ]] ; then
if [[ "$i" != "*" ]] ; then # We get "*" with empty directories
echo "Removing file $i"
svn delete --force $i
fi
fi
done
typeset list # typeset makes "list" be a local variable
list=${VOB_dir}/*
typeset i
for i in $list ; do
name=${i##*/} # -> /data_vobs/VisIt/mdserver/rpc --> rpc
if [[ -d $i ]] ; then
if [[ ! -d $name ]] ; then
svn mkdir $name
echo "Added directory $name"
fi
cd $name
svn_update_dir $i
cd ..
fi
if [[ -f $i ]] ; then
if [[ ! -f $name ]] ; then
cp $i .
svn add $name
echo "Added file $name"
else
diff $i $name > /dev/null
if [[ $? != 0 ]] ; then
cp $i .
echo "Updating file $name"
fi
fi
fi
done
}
function svn_update
{
print "Doing mdserver only!"
cd mdserver
svn_update_dir /data_vobs/VisIt/mdserver > log.${1}.${2}.${3}
svn commit -m "Update from $2 ${3}, $1"
}
function iterate_over_time
{
#set -A months January February March April May June July August September October November December
set -A months January June July
#set -A days 31 28 31 30 31 30 31 31 30 31 30 31
set -A days 1 1 1
set -A years 2003 2004 2005 2006 2007
Y=0
while (( Y < ${#years[*]} )) ; do
M=0
while (( M < ${#months[*]} )) ; do
if [[ "${years[$Y]}" == 2003 ]] ; then
if (( M < 5 )) ; then # June 2003 is first accepted date
(( M += 1 ))
continue
fi
fi
if [[ "${years[$Y]}" == 2007 ]] ; then
if (( M > 1 )) ; then # Month 1 is Feb (Jan is 0)
(( M += 1 ))
continue
fi
fi
D=0
while (( D < ${days[$M]} )) ; do
if [[ "${years[$Y]}" == 2007 ]] ; then
if (( D > 25 )) ; then
(( D += 1 ))
continue
fi
fi
echo "Doing ${years[$Y]}, ${months[$M]}, $D"
(( D += 1 )) # Increment day first, so it is not 0-based
set_time ${years[$Y]} ${months[$M]} $D
svn_update ${years[$Y]} ${months[$M]} $D
done
(( M += 1 ))
done
(( Y += 1 ))
done
}
cd /data_vobs/VisIt
if [[ ! -d components ]] ; then
echo "You must have already set up your ClearCase view. Bailing out"
exit 1
fi
WC=/scratch/childs/wc
REPO=file:///scratch/childs/svn/visit
cd $WC
svn checkout $REPO
cd visit
if [[ ! -d trunk ]] ; then
svn mkdir trunk -m "add trunk"
fi
cd trunk
iterate_over_time
# View configured for individual work.
# Development branch: svn_Feb_25_2007
element * CHECKEDOUT
element * .../svn_Feb_25_2007/LATEST -time 1-Jul-2003.23:59
element * /main/LATEST -mkbranch svn_Feb_25_2007 -time 1-Jul-2003.23:59
element * CHECKEDOUT
element * ../svn_Feb_25_2007/LATEST -time 2-June-2003.23:59
element * /main/LATEST -mkbranch svn_Feb_25_2007 -time 2-June-2003.23:59
element * ../svn_Feb_25_2007/LATEST -time 3-June-2003.23:59
element * /main/LATEST -mkbranch svn_Feb_25_2007 -time 3-June-2003.23:59
......@@ -62,6 +62,11 @@ inline int vtkNeighborCells::InsertNextPoint(int *x)
// Construct with automatic computation of divisions, averaging
// 25 cells per bucket.
//
// Modificatons:
// Kathleen Bonnell, Tue Jun 3 15:26:52 PDT 2003
// Initialinze MinCellLength.
//
vtkVisItCellLocator::vtkVisItCellLocator()
{
this->NumberOfCellsPerBucket = 25;
......@@ -82,6 +87,8 @@ vtkVisItCellLocator::vtkVisItCellLocator()
this->OctantBounds[3] = 0.;
this->OctantBounds[4] = 0.;
this->OctantBounds[5] = 0.;
this->MinCellLength = VTK_LARGE_FLOAT;
}
vtkVisItCellLocator::~vtkVisItCellLocator()
......@@ -1252,6 +1259,9 @@ vtkIdList* vtkVisItCellLocator::GetCells(int octantId)
// Incorporate changes made to vtkCellLocator by Will Schroeder.
// The changes fix a bug when dataset thickness is very near zero.
//
// Kathleen Bonnell, Tue Jun 3 15:26:52 PDT 2003
// Calculate MinCellLength.
//
void vtkVisItCellLocator::BuildLocator()
{
float *bounds, length, cellBounds[6], *boundsPtr;
......@@ -1271,7 +1281,7 @@ void vtkVisItCellLocator::BuildLocator()
{
return;
}
vtkDebugMacro( << "Subdividing octree..." );
if ( !this->DataSet || (numCells = this->DataSet->GetNumberOfCells()) < 1 )
......@@ -1280,6 +1290,8 @@ void vtkVisItCellLocator::BuildLocator()
return;
}
this->MinCellLength = VTK_LARGE_FLOAT;
// Make sure the appropriate data is available
//
if ( this->Tree )
......@@ -1357,6 +1369,7 @@ void vtkVisItCellLocator::BuildLocator()
parentOffset = numOctants - (ndivs * ndivs * ndivs);
product = ndivs * ndivs;
boundsPtr = cellBounds;
float len2;
for (cellId=0; cellId<numCells; cellId++)
{
if (this->CacheCellBounds)
......@@ -1368,7 +1381,16 @@ void vtkVisItCellLocator::BuildLocator()
{
this->DataSet->GetCellBounds(cellId, cellBounds);
}
// Keep track of the minimum cell diagonal length
//
len2 = (cellBounds[1] - cellBounds[0]) * (cellBounds[1] - cellBounds[0]);
len2 += (cellBounds[3] - cellBounds[2]) * (cellBounds[3] - cellBounds[2]);
len2 += (cellBounds[5] - cellBounds[4]) * (cellBounds[5] - cellBounds[4]);
if (len2 < this->MinCellLength)
this->MinCellLength = len2;
// find min/max locations of bounding box
for (i=0; i<3; i++)
{
......@@ -1834,3 +1856,4 @@ void vtkVisItCellLocator::ComputeOctantBounds(int i, int j, int k)
this->OctantBounds[4] = this->Bounds[4] + k*H[2];
this->OctantBounds[5] = this->OctantBounds[4] + H[2];
}
......@@ -37,6 +37,9 @@
// .SECTION Additions
// KSB, LLNL, Added flag that allows ghost cells to be ignored.
// KBB, LLNL, Tue Jun 3 15:26:52 PDT 2003, Added MinCellLength member
// and correspondign GetMacro. MinCellLength may be useful
// for determining a tolerance to use with certain methods.
#ifndef __vtkVisItCellLocator_h
......@@ -190,6 +193,12 @@ public:
void FreeSearchStructure();
void BuildLocator();
void GenerateRepresentation(int level, vtkPolyData *pd);
//
// Retrieve MinCellLength. Value not valid until the locator has
// been built.
//
vtkGetMacro(MinCellLength,float);
protected:
vtkVisItCellLocator();
......@@ -251,6 +260,7 @@ protected:
private:
vtkVisItCellLocator(const vtkVisItCellLocator&); // Not implemented.
void operator=(const vtkVisItCellLocator&); // Not implemented.
float MinCellLength;
};
#endif
......
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