Commit 87d0835d authored by hrchilds's avatar hrchilds

Update from January 12, 2006

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@597 18c085ea-50e0-402c-830e-de6fd14e8384
parent 70f31913
......@@ -118,6 +118,9 @@ $0 = shift @ARGV;
# be specified without nodes being specified (ie -nn without -ln) with
# psub, which is tricky because syntax changes in this case.
#
# Brad Whitlock, Wed Jan 11 17:46:19 PST 2006
# Added help for -nowindowmetrics.
#
###############################################################################
......@@ -191,6 +194,10 @@ $usage = "
This is typically used with the -cli option.
-stereo Enable active stereo, also known as the
page-flipping, or 'CrystalEyes' mode.
-nowindowmetrics Prevents X11 from grabbing and moving a test
widget used in calculating window borders. This
option can be useful if VisIt hangs when
displaying to an Apple X-server.
Version options
---------------------------------------------------------------------------
......
......@@ -369,7 +369,7 @@ gunzip -c $dist.tar.gz | tar xvf - > buildlog 2>&1
cd $dist
ver=\`cat VERSION\`
ver2=\`echo \$ver | tr "." "_"\`
env CXXFLAGS=-O2 ./configure >> ../buildlog 2>&1
env CXXFLAGS=-O2 ./configure --enable-parallel >> ../buildlog 2>&1
gmake -j 4 >> ../buildlog 2>&1
clearcase_bin/visit-bin-dist >> ../buildlog 2>&1
mv visit\$ver2.irix6.tar.gz ..
......
......@@ -50,9 +50,12 @@
// Brad Whitlock, Thu Apr 26 15:58:35 PST 2001
// Added initialization of the version.
//
// Brad Whitlock, Wed Jan 11 17:01:24 PST 2006
// Added localUserName.
//
// ****************************************************************************
ParentProcess::ParentProcess() : version(VERSION)
ParentProcess::ParentProcess() : version(VERSION), localUserName()
{
// Set some default values.
hostName = std::string("localhost");
......@@ -604,3 +607,41 @@ ParentProcess::GetHostInfo()
{
hostInfo = (void *)gethostbyname(hostName.c_str());
}
// ****************************************************************************
// Method: ParentProcess::GetLocalUserName
//
// Purpose:
// Gets the local user's name.
//
// Returns: A reference to the local user name.
//
// Programmer: Brad Whitlock
// Creation: Wed Jan 11 17:02:38 PST 2006
//
// Modifications:
//
// ****************************************************************************
const std::string &
ParentProcess::GetLocalUserName()
{
//
// Get the local user name.
//
if(localUserName.size() == 0)
{
#if defined(_WIN32)
char username[100];
DWORD maxLen = 100;
GetUserName((LPTSTR)username, (LPDWORD)&maxLen);
localUserName = std::string(username);
#else
struct passwd *users_passwd_entry = NULL;
if((users_passwd_entry = getpwuid(getuid())) != NULL)
localUserName = std::string(users_passwd_entry->pw_name);
#endif
}
return localUserName;
}
......@@ -43,6 +43,9 @@ class Connection;
// connections to create without having to pass the numbers on the command
// line.
//
// Brad Whitlock, Wed Jan 11 17:00:35 PST 2006
// Added localUserName.
//
// ****************************************************************************
class COMM_API ParentProcess
......@@ -57,6 +60,7 @@ public:
Connection *GetReadConnection(int i=0) const;
Connection *GetWriteConnection(int i=0) const;
void SetVersion(const std::string &ver);
const std::string &GetLocalUserName();
private:
void ExchangeTypeRepresentations(int failCode=0);
int GetClientSocketDescriptor(int port);
......@@ -68,6 +72,7 @@ private:
int nReadConnections, nWriteConnections;
std::string version;
std::string securityKey;
std::string localUserName;
};
#endif
......@@ -734,6 +734,10 @@ avtMeshMetaData::SetExtents(const float *extents)
//
// Mark C. Miller, Wed Nov 16 10:46:36 PST 2005
// Added loadBalanceScheme
//
// Hank Childs, Wed Jan 11 09:36:13 PST 2006
// Added new mesh types.
//
// ****************************************************************************
void
......@@ -785,10 +789,6 @@ avtMeshMetaData::Print(ostream &out, int indent) const
out << "Mesh type is ";
switch (meshType)
{
case AVT_UNSTRUCTURED_MESH:
out << "Unstructured Mesh";
break;
case AVT_RECTILINEAR_MESH:
out << "Rectilinear Mesh";
break;
......@@ -797,10 +797,26 @@ avtMeshMetaData::Print(ostream &out, int indent) const
out << "Curvilinear Mesh";
break;
case AVT_UNSTRUCTURED_MESH:
out << "Unstructured Mesh";
break;
case AVT_POINT_MESH:
out << "Point Mesh";
break;
case AVT_SURFACE_MESH:
out << "Surface Mesh";
break;
case AVT_CSG_MESH:
out << "CSG Mesh";
break;
case AVT_AMR_MESH:
out << "AMR Mesh";
break;
case AVT_UNKNOWN_MESH:
default:
out << "Unknown";
......
......@@ -61,7 +61,8 @@ enum avtMeshType
AVT_POINT_MESH, /* 3 */
AVT_SURFACE_MESH, /* 4 */
AVT_CSG_MESH, /* 5 */
AVT_UNKNOWN_MESH /* 6 */
AVT_AMR_MESH, /* 6 */
AVT_UNKNOWN_MESH /* 7 */
};
......
......@@ -739,6 +739,7 @@ avtDatabase::GetNewMetaData(int timeState, bool forceReadAllCyclesTimes)
!SILIsInvariant());
AddMeshQualityExpressions(md);
AddTimeDerivativeExpressions(md);
if (! OnlyServeUpMetaData())
{
......@@ -864,6 +865,154 @@ avtDatabase::AddMeshQualityExpressions(avtDatabaseMetaData *md)
}
// ****************************************************************************
// Method: avtDatabase::AddTimeDerivativeExpressions
//
// Purpose:
// Adds the time derivative expressions for time-varying databases.
//
// Programmer: Hank Childs
// Creation: January 11, 2006
//
// ****************************************************************************
void
avtDatabase::AddTimeDerivativeExpressions(avtDatabaseMetaData *md)
{
int i, j;
if (md->GetNumStates() <= 1)
return;
int numMeshes = md->GetNumMeshes();
std::string base1 = "time_derivative";
for (i = 0 ; i < numMeshes ; i++)
{
const avtMeshMetaData *mmd = md->GetMesh(i);
std::string base2;
if (numMeshes == 1)
base2 = base1;
else
base2 = base1 + std::string("/") + std::string(mmd->name);
avtMeshType mt = mmd->meshType;
bool doConn = false;
bool doPos = false;
switch (mt)
{
case AVT_RECTILINEAR_MESH:
doConn = true;
break;
case AVT_CURVILINEAR_MESH:
doConn = true;
doPos = true;
break;
case AVT_UNSTRUCTURED_MESH:
doConn = true;
doPos = true;
break;
case AVT_POINT_MESH:
doConn = true;
break;
case AVT_AMR_MESH:
doPos = true;
break;
}
if (!doConn && !doPos)
continue;
bool needPrefix = (doPos && doConn);
std::string conn_base = base2;
if (needPrefix)
conn_base = base2 + std::string("/") + std::string("conn_based");
std::string pos_base = base2;
if (needPrefix)
pos_base = base2 + std::string("/") + std::string("pos_based");
int numScalars = md->GetNumScalars();
for (j = 0 ; j < numScalars ; j++)
{
const avtScalarMetaData *smd = md->GetScalar(j);
if (smd->meshName == mmd->name)
{
if (doConn)
{
Expression new_expr;
std::string expr_name = conn_base + std::string("/")
+ smd->name;
new_expr.SetName(expr_name);
char buff[1024];
SNPRINTF(buff, 1024, "%s - conn_cmfe(<[-1]id:%s>, %s)",
smd->name.c_str(), smd->name.c_str(),
smd->meshName.c_str());
new_expr.SetDefinition(buff);
new_expr.SetType(Expression::ScalarMeshVar);
new_expr.SetAutoExpression(true);
md->AddExpression(&new_expr);
}
if (doPos)
{
Expression new_expr;
std::string expr_name = pos_base + std::string("/")
+ smd->name;
new_expr.SetName(expr_name);
char buff[1024];
SNPRINTF(buff, 1024, "%s - pos_cmfe(<[-1]id:%s>, %s, 0.)",
smd->name.c_str(), smd->name.c_str(),
smd->meshName.c_str());
new_expr.SetDefinition(buff);
new_expr.SetType(Expression::ScalarMeshVar);
new_expr.SetAutoExpression(true);
md->AddExpression(&new_expr);
}
}
}
int numVectors = md->GetNumVectors();
for (j = 0 ; j < numVectors ; j++)
{
const avtVectorMetaData *smd = md->GetVector(j);
if (smd->meshName == mmd->name)
{
if (doConn)
{
Expression new_expr;
std::string expr_name = conn_base + std::string("/")
+ smd->name;
new_expr.SetName(expr_name);
char buff[1024];
SNPRINTF(buff, 1024, "%s - conn_cmfe(<[-1]id:%s>, %s)",
smd->name.c_str(), smd->name.c_str(),
smd->meshName.c_str());
new_expr.SetDefinition(buff);
new_expr.SetType(Expression::VectorMeshVar);
new_expr.SetAutoExpression(true);
md->AddExpression(&new_expr);
}
if (doPos)
{
Expression new_expr;
std::string expr_name = pos_base + std::string("/")
+ smd->name;
new_expr.SetName(expr_name);
char buff[1024];
SNPRINTF(buff, 1024, "%s - pos_cmfe(<[-1]id:%s>, %s, 0.)",
smd->name.c_str(), smd->name.c_str(),
smd->meshName.c_str());
new_expr.SetDefinition(buff);
new_expr.SetType(Expression::VectorMeshVar);
new_expr.SetAutoExpression(true);
md->AddExpression(&new_expr);
}
}
}
}
}
// ****************************************************************************
// Method: avtDatabase::GetMetaData
//
......
......@@ -224,6 +224,9 @@ typedef struct {
// Hank Childs, Fri Oct 7 08:21:03 PDT 2005
// Added fullDBName.
//
// Hank Childs, Wed Jan 11 09:15:23 PST 2006
// Add AddTimeDerivativeExpressions.
//
// ****************************************************************************
class DATABASE_API avtDatabase
......@@ -310,6 +313,7 @@ class DATABASE_API avtDatabase
bool forceReadAllCyclesTimes = false);
void GetNewSIL(int stateIndex);
void AddMeshQualityExpressions(avtDatabaseMetaData *);
void AddTimeDerivativeExpressions(avtDatabaseMetaData *);
virtual bool HasInvariantMetaData(void) const = 0;
virtual bool HasInvariantSIL(void) const = 0;
......
......@@ -91,6 +91,9 @@ avtBinaryMathFilter::~avtBinaryMathFilter()
// Hank Childs, Thu Jan 20 17:32:13 PST 2005
// Make cur_mesh accessible to derived types.
//
// Hank Childs, Thu Jan 12 10:01:41 PST 2006
// Make sure that all arrays are valid.
//
// ****************************************************************************
vtkDataArray *
......@@ -113,6 +116,12 @@ avtBinaryMathFilter::DeriveVariable(vtkDataSet *in_ds)
centering = AVT_NODECENT;
}
if (data1 == NULL)
{
EXCEPTION1(ExpressionException, "An internal error occurred when "
"calculating an expression. Please contact a VisIt developer.");
}
// Get the second variable.
bool ownData1 = false;
bool ownData2 = false;
......
......@@ -158,13 +158,7 @@ avtCMFEExpression::ProcessArguments(ArgsExpr *args,
}
// Check if there's a second argument.
if (nargs < targetArgs)
{
EXCEPTION1(ExpressionException, mismatchMsg);
}
// See if there are other arguments.
if (nargs > targetArgs)
if (nargs != targetArgs)
{
EXCEPTION1(ExpressionException, mismatchMsg);
}
......@@ -442,6 +436,12 @@ avtCMFEExpression::Execute()
// Programmer: Hank Childs
// Creation: September 1, 2005
//
// Modifications:
//
// Hank Childs, Thu Jan 12 11:34:43 PST 2006
// Post a special error message for time derivatives, since they will
// cause the error message from this routine to execute most frequently.
//
// ****************************************************************************
int
......@@ -522,7 +522,15 @@ avtCMFEExpression::GetTimestate(ref_ptr<avtDatabase> dbp)
if (actualTimestep < 0)
{
actualTimestep = 0;
avtCallback::IssueWarning("You have instructed VisIt to use a "
if (isDelta && firstDBTime == 0 && timeIndex == -1)
avtCallback::IssueWarning("VisIt uses the current time state and "
"the previus time state when doing a time derivative. Because "
"you are at the first time state, there is no previous time "
"state to difference with. So the resulting plot will have no "
"differences. This feature will work correctly, however, for "
"the rest of the time states.");
else
avtCallback::IssueWarning("You have instructed VisIt to use a "
"non-existent time state when comparing databases. VisIt "
"is using the first time state in its place.");
}
......
......@@ -35,6 +35,10 @@ class avtDatabase;
// support for a "default" variable for when we are sampling onto
// non-overlapping meshes.
//
// Hank Childs, Thu Jan 12 10:13:17 PST 2006
// Change the number of variable arguments when we have a default
// argument.
//
// ****************************************************************************
class EXPRESSION_API avtCMFEExpression : public avtExpressionFilter
......@@ -47,7 +51,8 @@ class EXPRESSION_API avtCMFEExpression : public avtExpressionFilter
virtual const char *GetDescription(void)
{return "Evaluating field";};
virtual void ProcessArguments(ArgsExpr*, ExprPipelineState *);
virtual int NumVariableArguments() { return 1; };
virtual int NumVariableArguments()
{ return (HasDefaultVariable() ? 2 : 1); };
virtual int GetVariableDimension() { return varDim; };
virtual bool IsPointVariable(void) { return isNodal; };
virtual void AddInputVariableName(const char *);
......
......@@ -86,6 +86,11 @@ avtPosCMFEExpression::~avtPosCMFEExpression()
// Programmer: Hank Childs
// Creation: October 11, 2005
//
// Modifications:
//
// Hank Childs, Thu Jan 12 11:24:23 PST 2006
// Modify index of default variable.
//
// ****************************************************************************
avtDataTree_p
......@@ -229,7 +234,7 @@ avtPosCMFEExpression::PerformCMFE(avtDataTree_p output_mesh,
vtkDataSet *in_ds1 = output_list.datasets[i];
vtkDataArray *defaultVar = NULL;
bool deleteDefault = false;
const char *defaultName = varnames[0].c_str();
const char *defaultName = varnames[1].c_str();
defaultVar = (isNodal
? in_ds1->GetPointData()->GetArray(defaultName)
: in_ds1->GetCellData()->GetArray(defaultName));
......
// ************************************************************************* //
// Pick3D.C //
// Pick.C //
// ************************************************************************* //
#include <Pick3D.h>
#include <Pick.h>
#include <VisWindowInteractorProxy.h>
#include <vtkRenderWindowInteractor.h>
using std::queue;
// ****************************************************************************
// Method: Pick3D constructor
// Method: Pick constructor
//
// Programmer: Hank Childs
// Creation: May 29, 2000
//
// Modifications:
// Kathleen Bonnell, Thu Jan 12 14:03:39 PST 2006
// Initialize picking and handlingCache.
//
// ****************************************************************************
Pick3D::Pick3D(VisWindowInteractorProxy &v) : VisitInteractor(v)
Pick::Pick(VisWindowInteractorProxy &v) : VisitInteractor(v)
{
;
picking = false;
handlingCache = false;
}
// ****************************************************************************
// Method: Pick3D::StartLeftButtonAction
// Method: Pick::StartLeftButtonAction
//
// Purpose:
// Handles the left button being pushed down. For Pick3D, this means
// Handles the left button being pushed down. For Pick, this means
// performing a pick.
//
// Programmer: Hank Childs
......@@ -50,17 +56,86 @@ Pick3D::Pick3D(VisWindowInteractorProxy &v) : VisitInteractor(v)
// Removed arguments to match vtk's new interactor api, retrieve them
// directly from the RenderWindowInteractor.
//
// Kathleen Bonnell, Thu Jan 12 14:03:39 PST 2006
// Added logic to prevent a call to proxy->Pick when the current Pick has
// not yet completed (can cause hang). Added logic to cache picks and
// handle them.
//
// ****************************************************************************
void
Pick3D::StartLeftButtonAction()
Pick::StartLeftButtonAction()
{
int x, y;
Interactor->GetEventPosition(x, y);
if (!picking && !handlingCache)
{
DoPick(x, y);
HandlePickCache();
}
else
{
pickCache.push(x);
pickCache.push(y);
}
}
// ****************************************************************************
// Method: Pick::DoPick
//
// Purpose:
// Call's the VisWindow's routine to handle pick.
//
// Arguments:
// x The x screen position that was picked.
// y The y screen position that was picked.
//
// Programmer: Kathleen Bonnell
// Creation: January 12, 2006
//
// Modifications:
//
// ****************************************************************************
void
Pick::DoPick(int x, int y)
{
picking = true;
//
// Just call the VisWindow's routine to do this.
//
proxy.Pick(x, y);
picking = false;
}
// ****************************************************************************
// Method: Pick::HandlePickCache
//
// Purpose:
// Performs pick for all the x,y values stored in the pick cache.
//
// Programmer: Kathleen Bonnell
// Creation: January 12, 2006
//
// Modifications:
//
// ****************************************************************************
void
Pick::HandlePickCache()
{
handlingCache = true;
while (!pickCache.empty())
{
int x, y;
x = pickCache.front();
pickCache.pop();
y = pickCache.front();
pickCache.pop();
DoPick(x, y);
}
handlingCache = false;
}
// ************************************************************************* //
// Pick2D.h //
// Pick.h //
// ************************************************************************* //
#ifndef PICK_2D_H
#define PICK_2D_H
#ifndef PICK__H
#define PICK__H
#include <viswindow_exports.h>
#include <queue>
class VisWindowInteractorProxy;
......@@ -13,10 +14,10 @@ class VisWindowInteractorProxy;
// ****************************************************************************
// Class: Pick2D
// Class: Pick
//
// Purpose:
// Defines what Visit's 2D Pick interactions should look like.
// Defines what Visit's Pick interactions should look like.
//
// Programmer: Hank Childs
// Creation: May 29, 2000
......@@ -30,14 +31,25 @@ class VisWindowInteractorProxy;
// Removed arguments from StartLeftButtonAction, in order to match
// vtk's new interactor api.
//
// Kathleen Bonnell, Thu Jan 12 14:03:39 PST 2006
// Renamed from Pick3D. Added private members picking, handlingCache,
// pickCache and methods HandlePickCache and DoPick.
//
// ****************************************************************************
class VISWINDOW_API Pick2D : public VisitInteractor
class VISWINDOW_API Pick : public VisitInteractor
{
public:
Pick2D(VisWindowInteractorProxy &);
Pick(VisWindowInteractorProxy &);
virtual void StartLeftButtonAction();
private:
bool picking;
bool handlingCache;
std::queue<int> pickCache;
void HandlePickCache();
void DoPick(int x, int y);
};
......
// ************************************************************************* //
// Pick2D.C //
// ************************************************************************* //
#include <Pick2D.h>
#include <VisWindowInteractorProxy.h>
#include <vtkRenderWindowInteractor.h>
// ****************************************************************************
// Method: Pick2D constructor
//
// Programmer: Hank Childs
// Creation: May 29, 2000
//
// ****************************************************************************
Pick2D::Pick2D(VisWindowInteractorProxy &v) : VisitInteractor(v)
{
;
}
// ****************************************************************************
// Method: Pick2D::StartLeftButtonAction
//
// Purpose:
// Handles the left button being pushed down. For Pick2D, this means
// performing a pick.
//
// Programmer: Hank Childs
// Creation: May 29, 2000
//
// Modifications:
//
// Hank Childs, Thu Jun 29 16:08:05 PDT 200
// Added downcast to picker type from abstract picker from the render window
// to account for VTK changes.
//
// Hank Childs, Wed Jul 5 16:15:09 PDT 2000
// Removed picker argument to VisWindow's pick.
//
// Kathleen Bonnell, Wed Nov 12 10:54:55 PST 2001
// Uncomment proxy.Pick.
//
// Hank Childs, Mon Mar 18 13:48:55 PST 2002
// Renamed from OnLeftButtonDown.
//
// Kathleen Bonnell, Fri Dec 13 14:07:15 PST 2002
// Removed arguments to match vtk's new interactor api, retrieve them
// directly from the RenderWindowInteractor.
//
// ****************************************************************************
void
Pick2D::StartLeftButtonAction()
{