Commit 9d321885 authored by hrchilds's avatar hrchilds

Update from August 17, 2005

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@523 18c085ea-50e0-402c-830e-de6fd14e8384
parent f086563e
......@@ -10,19 +10,21 @@
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:15 PDT 2003
// Creation: Tue Aug 16 15:34:05 PST 2005
//
// Modifications:
//
// ****************************************************************************
MaterialAttributes::MaterialAttributes() : AttributeSubject("bbbbb")
MaterialAttributes::MaterialAttributes() : AttributeSubject("bbbbbbi")
{
smoothing = false;
forceMIR = false;
cleanZonesOnly = false;
needValidConnectivity = false;
useNewMIRAlgorithm = true;
simplifyHeavilyMixedZones = false;
maxMaterialsPerZone = 3;
}
// ****************************************************************************
......@@ -34,19 +36,21 @@ MaterialAttributes::MaterialAttributes() : AttributeSubject("bbbbb")
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:15 PDT 2003
// Creation: Tue Aug 16 15:34:05 PST 2005
//
// Modifications:
//
// ****************************************************************************
MaterialAttributes::MaterialAttributes(const MaterialAttributes &obj) : AttributeSubject("bbbbb")
MaterialAttributes::MaterialAttributes(const MaterialAttributes &obj) : AttributeSubject("bbbbbbi")
{
smoothing = obj.smoothing;
forceMIR = obj.forceMIR;
cleanZonesOnly = obj.cleanZonesOnly;
needValidConnectivity = obj.needValidConnectivity;
useNewMIRAlgorithm = obj.useNewMIRAlgorithm;
simplifyHeavilyMixedZones = obj.simplifyHeavilyMixedZones;
maxMaterialsPerZone = obj.maxMaterialsPerZone;
SelectAll();
}
......@@ -60,7 +64,7 @@ MaterialAttributes::MaterialAttributes(const MaterialAttributes &obj) : Attribut
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:15 PDT 2003
// Creation: Tue Aug 16 15:34:05 PST 2005
//
// Modifications:
//
......@@ -80,22 +84,26 @@ MaterialAttributes::~MaterialAttributes()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:15 PDT 2003
// Creation: Tue Aug 16 15:34:05 PST 2005
//
// Modifications:
//
// ****************************************************************************
void
MaterialAttributes&
MaterialAttributes::operator = (const MaterialAttributes &obj)
{
if (this == &obj) return *this;
smoothing = obj.smoothing;
forceMIR = obj.forceMIR;
cleanZonesOnly = obj.cleanZonesOnly;
needValidConnectivity = obj.needValidConnectivity;
useNewMIRAlgorithm = obj.useNewMIRAlgorithm;
simplifyHeavilyMixedZones = obj.simplifyHeavilyMixedZones;
maxMaterialsPerZone = obj.maxMaterialsPerZone;
SelectAll();
return *this;
}
// ****************************************************************************
......@@ -107,7 +115,7 @@ MaterialAttributes::operator = (const MaterialAttributes &obj)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:15 PDT 2003
// Creation: Tue Aug 16 15:34:05 PST 2005
//
// Modifications:
//
......@@ -121,7 +129,9 @@ MaterialAttributes::operator == (const MaterialAttributes &obj) const
(forceMIR == obj.forceMIR) &&
(cleanZonesOnly == obj.cleanZonesOnly) &&
(needValidConnectivity == obj.needValidConnectivity) &&
(useNewMIRAlgorithm == obj.useNewMIRAlgorithm));
(useNewMIRAlgorithm == obj.useNewMIRAlgorithm) &&
(simplifyHeavilyMixedZones == obj.simplifyHeavilyMixedZones) &&
(maxMaterialsPerZone == obj.maxMaterialsPerZone));
}
// ****************************************************************************
......@@ -133,7 +143,7 @@ MaterialAttributes::operator == (const MaterialAttributes &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:15 PDT 2003
// Creation: Tue Aug 16 15:34:05 PST 2005
//
// Modifications:
//
......@@ -154,7 +164,7 @@ MaterialAttributes::operator != (const MaterialAttributes &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:15 PDT 2003
// Creation: Tue Aug 16 15:34:05 PST 2005
//
// Modifications:
//
......@@ -175,7 +185,7 @@ MaterialAttributes::TypeName() const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:15 PDT 2003
// Creation: Tue Aug 16 15:34:05 PST 2005
//
// Modifications:
//
......@@ -203,7 +213,7 @@ MaterialAttributes::CopyAttributes(const AttributeGroup *atts)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:15 PDT 2003
// Creation: Tue Aug 16 15:34:05 PST 2005
//
// Modifications:
//
......@@ -229,7 +239,7 @@ MaterialAttributes::CreateCompatible(const std::string &tname) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:15 PDT 2003
// Creation: Tue Aug 16 15:34:05 PST 2005
//
// Modifications:
//
......@@ -256,7 +266,7 @@ MaterialAttributes::NewInstance(bool copy) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:15 PDT 2003
// Creation: Tue Aug 16 15:34:05 PST 2005
//
// Modifications:
//
......@@ -270,6 +280,8 @@ MaterialAttributes::SelectAll()
Select(2, (void *)&cleanZonesOnly);
Select(3, (void *)&needValidConnectivity);
Select(4, (void *)&useNewMIRAlgorithm);
Select(5, (void *)&simplifyHeavilyMixedZones);
Select(6, (void *)&maxMaterialsPerZone);
}
///////////////////////////////////////////////////////////////////////////////
......@@ -285,7 +297,7 @@ MaterialAttributes::SelectAll()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:15 PDT 2003
// Creation: Tue Aug 16 15:34:05 PST 2005
//
// Modifications:
//
......@@ -332,6 +344,18 @@ MaterialAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool for
node->AddNode(new DataNode("useNewMIRAlgorithm", useNewMIRAlgorithm));
}
if(completeSave || !FieldsEqual(5, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("simplifyHeavilyMixedZones", simplifyHeavilyMixedZones));
}
if(completeSave || !FieldsEqual(6, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("maxMaterialsPerZone", maxMaterialsPerZone));
}
// Add the node to the parent node.
if(addToParent || forceAdd)
......@@ -351,7 +375,7 @@ MaterialAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool for
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:15 PDT 2003
// Creation: Tue Aug 16 15:34:05 PST 2005
//
// Modifications:
//
......@@ -379,6 +403,10 @@ MaterialAttributes::SetFromNode(DataNode *parentNode)
SetNeedValidConnectivity(node->AsBool());
if((node = searchNode->GetNode("useNewMIRAlgorithm")) != 0)
SetUseNewMIRAlgorithm(node->AsBool());
if((node = searchNode->GetNode("simplifyHeavilyMixedZones")) != 0)
SetSimplifyHeavilyMixedZones(node->AsBool());
if((node = searchNode->GetNode("maxMaterialsPerZone")) != 0)
SetMaxMaterialsPerZone(node->AsInt());
}
///////////////////////////////////////////////////////////////////////////////
......@@ -420,6 +448,20 @@ MaterialAttributes::SetUseNewMIRAlgorithm(bool useNewMIRAlgorithm_)
Select(4, (void *)&useNewMIRAlgorithm);
}
void
MaterialAttributes::SetSimplifyHeavilyMixedZones(bool simplifyHeavilyMixedZones_)
{
simplifyHeavilyMixedZones = simplifyHeavilyMixedZones_;
Select(5, (void *)&simplifyHeavilyMixedZones);
}
void
MaterialAttributes::SetMaxMaterialsPerZone(int maxMaterialsPerZone_)
{
maxMaterialsPerZone = maxMaterialsPerZone_;
Select(6, (void *)&maxMaterialsPerZone);
}
///////////////////////////////////////////////////////////////////////////////
// Get property methods
///////////////////////////////////////////////////////////////////////////////
......@@ -454,6 +496,18 @@ MaterialAttributes::GetUseNewMIRAlgorithm() const
return useNewMIRAlgorithm;
}
bool
MaterialAttributes::GetSimplifyHeavilyMixedZones() const
{
return simplifyHeavilyMixedZones;
}
int
MaterialAttributes::GetMaxMaterialsPerZone() const
{
return maxMaterialsPerZone;
}
///////////////////////////////////////////////////////////////////////////////
// Keyframing methods
///////////////////////////////////////////////////////////////////////////////
......@@ -467,7 +521,7 @@ MaterialAttributes::GetUseNewMIRAlgorithm() const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:15 PDT 2003
// Creation: Tue Aug 16 15:34:05 PST 2005
//
// Modifications:
//
......@@ -483,6 +537,8 @@ MaterialAttributes::GetFieldName(int index) const
case 2: return "Clean zones only";
case 3: return "Force perfect connectivity";
case 4: return "Use new MIR algorithm";
case 5: return "Simplify Heavily Mixed Zones";
case 6: return "Maximum Materials Per Zone";
default: return "invalid index";
}
}
......@@ -496,7 +552,7 @@ MaterialAttributes::GetFieldName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:15 PDT 2003
// Creation: Tue Aug 16 15:34:05 PST 2005
//
// Modifications:
//
......@@ -512,6 +568,8 @@ MaterialAttributes::GetFieldType(int index) const
case 2: return FieldType_bool;
case 3: return FieldType_bool;
case 4: return FieldType_bool;
case 5: return FieldType_bool;
case 6: return FieldType_int;
default: return FieldType_unknown;
}
}
......@@ -525,7 +583,7 @@ MaterialAttributes::GetFieldType(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:15 PDT 2003
// Creation: Tue Aug 16 15:34:05 PST 2005
//
// Modifications:
//
......@@ -541,6 +599,8 @@ MaterialAttributes::GetFieldTypeName(int index) const
case 2: return "bool";
case 3: return "bool";
case 4: return "bool";
case 5: return "bool";
case 6: return "int";
default: return "invalid index";
}
}
......@@ -554,7 +614,7 @@ MaterialAttributes::GetFieldTypeName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:15 PDT 2003
// Creation: Tue Aug 16 15:34:05 PST 2005
//
// Modifications:
//
......@@ -592,6 +652,16 @@ MaterialAttributes::FieldsEqual(int index_, const AttributeGroup *rhs) const
retval = (useNewMIRAlgorithm == obj.useNewMIRAlgorithm);
}
break;
case 5:
{ // new scope
retval = (simplifyHeavilyMixedZones == obj.simplifyHeavilyMixedZones);
}
break;
case 6:
{ // new scope
retval = (maxMaterialsPerZone == obj.maxMaterialsPerZone);
}
break;
default: retval = false;
}
......
......@@ -12,7 +12,7 @@
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:15 PDT 2003
// Creation: Tue Aug 16 15:34:05 PST 2005
//
// Modifications:
//
......@@ -25,7 +25,7 @@ public:
MaterialAttributes(const MaterialAttributes &obj);
virtual ~MaterialAttributes();
virtual void operator = (const MaterialAttributes &obj);
virtual MaterialAttributes& operator = (const MaterialAttributes &obj);
virtual bool operator == (const MaterialAttributes &obj) const;
virtual bool operator != (const MaterialAttributes &obj) const;
......@@ -43,6 +43,8 @@ public:
void SetCleanZonesOnly(bool cleanZonesOnly_);
void SetNeedValidConnectivity(bool needValidConnectivity_);
void SetUseNewMIRAlgorithm(bool useNewMIRAlgorithm_);
void SetSimplifyHeavilyMixedZones(bool simplifyHeavilyMixedZones_);
void SetMaxMaterialsPerZone(int maxMaterialsPerZone_);
// Property getting methods
bool GetSmoothing() const;
......@@ -50,6 +52,8 @@ public:
bool GetCleanZonesOnly() const;
bool GetNeedValidConnectivity() const;
bool GetUseNewMIRAlgorithm() const;
bool GetSimplifyHeavilyMixedZones() const;
int GetMaxMaterialsPerZone() const;
// Persistence methods
virtual bool CreateNode(DataNode *node, bool completeSave, bool forceAdd);
......@@ -68,6 +72,8 @@ private:
bool cleanZonesOnly;
bool needValidConnectivity;
bool useNewMIRAlgorithm;
bool simplifyHeavilyMixedZones;
int maxMaterialsPerZone;
};
#endif
......@@ -15,4 +15,10 @@
<Field name="useNewMIRAlgorithm" label="Use new MIR algorithm" type="bool">
true
</Field>
<Field name="simplifyHeavilyMixedZones" label="Simplify Heavily Mixed Zones" type="bool">
false
</Field>
<Field name="maxMaterialsPerZone" label="Maximum Materials Per Zone" type="int" enabler="simplifyHeavilyMixedZones:true">
3
</Field>
</Attribute>
......@@ -79,6 +79,50 @@ avtExtentType_FromString(const std::string &s, avtExtentType &m)
return false;
}
// ****************************************************************************
// Function: avtVarTypeToString
//
// Purpose:
// Creates a string from an avtVarType.
//
// Programmer: Hank Childs
// Creation: August 16, 2005
//
// ****************************************************************************
std::string
avtVarTypeToString(avtVarType v)
{
switch (v)
{
case AVT_MESH:
return "mesh";
case AVT_SCALAR_VAR:
return "scalar";
case AVT_VECTOR_VAR:
return "vector";
case AVT_TENSOR_VAR:
return "tensor";
case AVT_SYMMETRIC_TENSOR_VAR:
return "symmetric tensor";
case AVT_ARRAY_VAR:
return "array";
case AVT_LABEL_VAR:
return "label";
case AVT_MATERIAL:
return "material";
case AVT_MATSPECIES:
return "species";
case AVT_CURVE:
return "curve";
default:
break;
}
return "unknown";
}
// ****************************************************************************
// Function: GuessVarTypeFromNumDimsAndComps
//
......
......@@ -98,6 +98,8 @@ DBATTS_API std::string avtExtentType_ToString(avtExtentType);
DBATTS_API std::string avtExtentType_ToString(int);
DBATTS_API bool avtExtentType_FromString(const std::string &, avtExtentType &);
DBATTS_API std::string avtVarTypeToString(avtVarType);
DBATTS_API avtVarType GuessVarTypeFromNumDimsAndComps(int numSpatialDims,
int componentCount);
#endif
......
......@@ -4017,6 +4017,8 @@ avtGenericDatabase::MaterialSelect(vtkDataSet *ds, avtMaterial *mat,
bool needSmoothMaterialInterfaces,
bool needCleanZonesOnly,
bool reconstructionForced,
bool simplifyHeavilyMixedZones,
int maxMatsPerZone,
int mirAlgorithm,
bool didGhosts,
bool &subdivisionOccurred,
......@@ -4058,7 +4060,8 @@ avtGenericDatabase::MaterialSelect(vtkDataSet *ds, avtMaterial *mat,
void_ref_ptr vr_mir = GetMIR(dom, var, ts, ds, mat, topoDim,
needValidConnectivity,
needSmoothMaterialInterfaces,
needCleanZonesOnly, mirAlgorithm,
needCleanZonesOnly, simplifyHeavilyMixedZones,
maxMatsPerZone, mirAlgorithm,
didGhosts,
subdivisionOccurred,
notAllCellsSubdivided, reUseMIR);
......@@ -4705,6 +4708,9 @@ avtGenericDatabase::SpeciesSelect(avtDatasetCollection &dsc,
// Jeremy Meredith, Thu Sep 18 11:31:23 PDT 2003
// Made the new MIR algorithm work in 2D as well.
//
// Hank Childs, Wed Aug 17 09:10:35 PDT 2005
// Add support for simplifying heavily mixed zones.
//
// ****************************************************************************
void_ref_ptr
avtGenericDatabase::GetMIR(int domain, const char *varname, int timestep,
......@@ -4712,17 +4718,20 @@ avtGenericDatabase::GetMIR(int domain, const char *varname, int timestep,
bool needValidConnectivity,
bool needSmoothMaterialInterfaces,
bool needCleanZonesOnly,
bool simplifyHeavilyMixedZones, int maxMatsPerZone,
int mirAlgorithm,
bool didGhosts,
bool &subdivisionOccurred,
bool &notAllCellsSubdivided, bool reUseMIR)
{
char cacheLbl[1000];
sprintf(cacheLbl, "MIR_%s_%s_%s_%s_%s",
sprintf(cacheLbl, "MIR_%s_%s_%s_%s_%s_%d_%s",
needValidConnectivity ? "FullSubdiv" : "MinimalSubdiv",
needSmoothMaterialInterfaces ? "Smooth" : "NotSmooth",
needCleanZonesOnly ? "CleanOnly" : "SplitMixed",
didGhosts ? "DidGhosts" : "NoDidGhosts",
simplifyHeavilyMixedZones ? "Simplify" : "NoSimplify",
maxMatsPerZone,
mirAlgorithm==0 ? "TetMIR" : "ZooMIR");
//
......@@ -4747,6 +4756,12 @@ avtGenericDatabase::GetMIR(int domain, const char *varname, int timestep,
EXCEPTION0(NoInputException);
}
avtMaterial *mat_to_use = mat;
if (simplifyHeavilyMixedZones)
{
mat_to_use = mat->SimplifyHeavilyMixedZones(maxMatsPerZone);
}
MIR *mir = NULL;
//
......@@ -4763,11 +4778,11 @@ avtGenericDatabase::GetMIR(int domain, const char *varname, int timestep,
mir->SetCleanZonesOnly(needCleanZonesOnly);
if (topoDim == 3)
{
mir->Reconstruct3DMesh(ds, mat);
mir->Reconstruct3DMesh(ds, mat_to_use);
}
else
{
mir->Reconstruct2DMesh(ds, mat);
mir->Reconstruct2DMesh(ds, mat_to_use);
}
//
......@@ -4780,6 +4795,11 @@ avtGenericDatabase::GetMIR(int domain, const char *varname, int timestep,
{
cache.CacheVoidRef(matname.c_str(), cacheLbl, timestep, domain,vr);
}
// By deleting this new material, we are assuming that the MIR is
// not caching a copy of the material.
if (mat != mat_to_use)
delete mat_to_use;
}
MIR *rv = (MIR *) *vr;
......@@ -7198,6 +7218,9 @@ avtGenericDatabase::ApplyGhostForDomainNesting(avtDatasetCollection &ds,
// Kathleen Bonnell, Thu Feb 3 09:27:22 PST 2005
// Set MIROccurred flag in avtDataAttributes.
//
// Hank Childs, Wed Aug 17 09:23:38 PDT 2005
// Use new material options for simplifying heavily mixed zones.
//
// ****************************************************************************
void
......@@ -7269,6 +7292,8 @@ avtGenericDatabase::MaterialSelect(avtDatasetCollection &ds,
spec->NeedSmoothMaterialInterfaces(),
spec->NeedCleanZonesOnly(),
spec->MustDoMaterialInterfaceReconstruction(),
spec->SimplifyHeavilyMixedZones(),
spec->MaxMaterialsPerZone(),
spec->UseNewMIRAlgorithm() ? 1 : 0,
didGhosts, so, nacs, reUseMIR);
......
......@@ -246,6 +246,9 @@ class PickVarInfo;
// Hank Childs, Tue Jul 19 14:52:08 PDT 2005
// Added support for array variables.
//
// Hank Childs, Wed Aug 17 09:10:35 PDT 2005
// Add support for simplifying heavily mixed zones.
//
// ****************************************************************************
class DATABASE_API avtGenericDatabase : public avtDatasetDatabase
......@@ -365,11 +368,11 @@ class DATABASE_API avtGenericDatabase : public avtDatasetDatabase
stringVector &,
stringVector &,
bool, bool, bool, bool, bool,
bool, int, bool, bool&, bool&,
bool);
bool, bool, int, int, bool,
bool&, bool&, bool);
void_ref_ptr GetMIR(int, const char *, int, vtkDataSet*,
avtMaterial *, int, bool, bool, bool,
int, bool, bool&, bool&, bool);
bool, int, int, bool, bool&, bool&,bool);
avtMaterial *GetMaterial(int, const char *, int);
avtSpecies *GetSpecies(int, const char *, int);
void GetMaterialIndices(avtMaterial *,
......
......@@ -101,6 +101,9 @@ avtExpressionEvaluatorFilter::~avtExpressionEvaluatorFilter()
// Hank Childs, Fri Dec 31 11:47:01 PST 2004
// Use a cached terminating source rather than one on the stack.
//
// Hank Childs, Tue Aug 16 16:53:20 PDT 2005
// Added called to VerifyVariableTypes ['6485]
//
// ****************************************************************************
void
......@@ -145,12 +148,77 @@ avtExpressionEvaluatorFilter::Execute(void)
GetOutput()->Copy(*dObj);
}
//VerifyVariableTypes();
// Stop the timer
visitTimer->StopTimer(timingIndex, "Expression Evaluator Filter");
visitTimer->DumpTimings();
}
// ****************************************************************************
// Method: avtExpressionEvaluatorFilter::VerifyVariableTypes
//
// Purpose:
// Verify that the variables created are of the same type they were
// declared to be.
//
// Programmer: Hank Childs
// Creation: August 16, 2005
//
// ****************************************************************************
void
avtExpressionEvaluatorFilter::VerifyVariableTypes(void)
{
avtDataAttributes &atts = GetOutput()->GetInfo().GetAttributes();
int nvars = atts.GetNumberOfVariables();
for (int i = 0 ; i < nvars ; i++)
{
const std::string &varname = atts.GetVariableName();
avtVarType vt = atts.GetVariableType(varname.c_str());
Expression *exp = ParsingExprList::GetExpression(varname.c_str());
if (exp == NULL)
continue;
Expression::ExprType et = exp->GetType();
if (et == Expression::Mesh || et == Expression::Material
|| et == Expression::Species)
continue;