Commit 5c8ea1db authored by hrchilds's avatar hrchilds

Update from August 19, 2005

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@525 18c085ea-50e0-402c-830e-de6fd14e8384
parent aece2771
......@@ -136,6 +136,9 @@
#
# Mark C. Miller, Tue May 31 20:12:42 PDT 2005
# Updated skipList
#
# Mark C. Miller, Fri Aug 19 10:16:30 PDT 2005
# Added label.py to skipList for optimized mode
# ----------------------------------------------------------------------------
# list of users who want email every night with the log file
......@@ -283,7 +286,8 @@ skipList="scalable,parallel:tests/databases/boxlib.py \
dlb:tests/queries/pick.py \
optimized:tests/plots/tensor.py \
optimized:tests/hybrid/lineout.py \
optimized:tests/queries/database.py"
optimized:tests/queries/database.py \
optimized:tests/plots/label.py"
# run the test(s)
error=0
......
#include <MaterialAttributes.h>
#include <DataNode.h>
//
// Enum conversion methods for MaterialAttributes::Algorithm
//
static const char *Algorithm_strings[] = {
"Tetrahedral", "ZooClipping", "Isovolume"
};
std::string
MaterialAttributes::Algorithm_ToString(MaterialAttributes::Algorithm t)
{
int index = int(t);
if(index < 0 || index >= 3) index = 0;
return Algorithm_strings[index];
}
std::string
MaterialAttributes::Algorithm_ToString(int t)
{
int index = (t < 0 || t >= 3) ? 0 : t;
return Algorithm_strings[index];
}
bool
MaterialAttributes::Algorithm_FromString(const std::string &s, MaterialAttributes::Algorithm &val)
{
val = MaterialAttributes::Tetrahedral;
for(int i = 0; i < 3; ++i)
{
if(s == Algorithm_strings[i])
{
val = (Algorithm)i;
return true;
}
}
return false;
}
// ****************************************************************************
// Method: MaterialAttributes::MaterialAttributes
//
......@@ -10,21 +48,22 @@
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Aug 16 15:34:05 PST 2005
// Creation: Thu Aug 18 17:37:44 PST 2005
//
// Modifications:
//
// ****************************************************************************
MaterialAttributes::MaterialAttributes() : AttributeSubject("bbbbbbi")
MaterialAttributes::MaterialAttributes() : AttributeSubject("bbbbibif")
{
smoothing = false;
forceMIR = false;
cleanZonesOnly = false;
needValidConnectivity = false;
useNewMIRAlgorithm = true;
algorithm = ZooClipping;
simplifyHeavilyMixedZones = false;
maxMaterialsPerZone = 3;
isoVolumeFraction = 0.5;
}
// ****************************************************************************
......@@ -36,21 +75,22 @@ MaterialAttributes::MaterialAttributes() : AttributeSubject("bbbbbbi")
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Aug 16 15:34:05 PST 2005
// Creation: Thu Aug 18 17:37:44 PST 2005
//
// Modifications:
//
// ****************************************************************************
MaterialAttributes::MaterialAttributes(const MaterialAttributes &obj) : AttributeSubject("bbbbbbi")
MaterialAttributes::MaterialAttributes(const MaterialAttributes &obj) : AttributeSubject("bbbbibif")
{
smoothing = obj.smoothing;
forceMIR = obj.forceMIR;
cleanZonesOnly = obj.cleanZonesOnly;
needValidConnectivity = obj.needValidConnectivity;
useNewMIRAlgorithm = obj.useNewMIRAlgorithm;
algorithm = obj.algorithm;
simplifyHeavilyMixedZones = obj.simplifyHeavilyMixedZones;
maxMaterialsPerZone = obj.maxMaterialsPerZone;
isoVolumeFraction = obj.isoVolumeFraction;
SelectAll();
}
......@@ -64,7 +104,7 @@ MaterialAttributes::MaterialAttributes(const MaterialAttributes &obj) : Attribut
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Aug 16 15:34:05 PST 2005
// Creation: Thu Aug 18 17:37:44 PST 2005
//
// Modifications:
//
......@@ -84,7 +124,7 @@ MaterialAttributes::~MaterialAttributes()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Aug 16 15:34:05 PST 2005
// Creation: Thu Aug 18 17:37:44 PST 2005
//
// Modifications:
//
......@@ -98,9 +138,10 @@ MaterialAttributes::operator = (const MaterialAttributes &obj)
forceMIR = obj.forceMIR;
cleanZonesOnly = obj.cleanZonesOnly;
needValidConnectivity = obj.needValidConnectivity;
useNewMIRAlgorithm = obj.useNewMIRAlgorithm;
algorithm = obj.algorithm;
simplifyHeavilyMixedZones = obj.simplifyHeavilyMixedZones;
maxMaterialsPerZone = obj.maxMaterialsPerZone;
isoVolumeFraction = obj.isoVolumeFraction;
SelectAll();
return *this;
......@@ -115,7 +156,7 @@ MaterialAttributes::operator = (const MaterialAttributes &obj)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Aug 16 15:34:05 PST 2005
// Creation: Thu Aug 18 17:37:44 PST 2005
//
// Modifications:
//
......@@ -129,9 +170,10 @@ MaterialAttributes::operator == (const MaterialAttributes &obj) const
(forceMIR == obj.forceMIR) &&
(cleanZonesOnly == obj.cleanZonesOnly) &&
(needValidConnectivity == obj.needValidConnectivity) &&
(useNewMIRAlgorithm == obj.useNewMIRAlgorithm) &&
(algorithm == obj.algorithm) &&
(simplifyHeavilyMixedZones == obj.simplifyHeavilyMixedZones) &&
(maxMaterialsPerZone == obj.maxMaterialsPerZone));
(maxMaterialsPerZone == obj.maxMaterialsPerZone) &&
(isoVolumeFraction == obj.isoVolumeFraction));
}
// ****************************************************************************
......@@ -143,7 +185,7 @@ MaterialAttributes::operator == (const MaterialAttributes &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Aug 16 15:34:05 PST 2005
// Creation: Thu Aug 18 17:37:44 PST 2005
//
// Modifications:
//
......@@ -164,7 +206,7 @@ MaterialAttributes::operator != (const MaterialAttributes &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Aug 16 15:34:05 PST 2005
// Creation: Thu Aug 18 17:37:44 PST 2005
//
// Modifications:
//
......@@ -185,7 +227,7 @@ MaterialAttributes::TypeName() const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Aug 16 15:34:05 PST 2005
// Creation: Thu Aug 18 17:37:44 PST 2005
//
// Modifications:
//
......@@ -213,7 +255,7 @@ MaterialAttributes::CopyAttributes(const AttributeGroup *atts)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Aug 16 15:34:05 PST 2005
// Creation: Thu Aug 18 17:37:44 PST 2005
//
// Modifications:
//
......@@ -239,7 +281,7 @@ MaterialAttributes::CreateCompatible(const std::string &tname) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Aug 16 15:34:05 PST 2005
// Creation: Thu Aug 18 17:37:44 PST 2005
//
// Modifications:
//
......@@ -266,7 +308,7 @@ MaterialAttributes::NewInstance(bool copy) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Aug 16 15:34:05 PST 2005
// Creation: Thu Aug 18 17:37:44 PST 2005
//
// Modifications:
//
......@@ -279,9 +321,10 @@ MaterialAttributes::SelectAll()
Select(1, (void *)&forceMIR);
Select(2, (void *)&cleanZonesOnly);
Select(3, (void *)&needValidConnectivity);
Select(4, (void *)&useNewMIRAlgorithm);
Select(4, (void *)&algorithm);
Select(5, (void *)&simplifyHeavilyMixedZones);
Select(6, (void *)&maxMaterialsPerZone);
Select(7, (void *)&isoVolumeFraction);
}
///////////////////////////////////////////////////////////////////////////////
......@@ -297,7 +340,7 @@ MaterialAttributes::SelectAll()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Aug 16 15:34:05 PST 2005
// Creation: Thu Aug 18 17:37:44 PST 2005
//
// Modifications:
//
......@@ -341,7 +384,7 @@ MaterialAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool for
if(completeSave || !FieldsEqual(4, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("useNewMIRAlgorithm", useNewMIRAlgorithm));
node->AddNode(new DataNode("algorithm", Algorithm_ToString(algorithm)));
}
if(completeSave || !FieldsEqual(5, &defaultObject))
......@@ -356,6 +399,12 @@ MaterialAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool for
node->AddNode(new DataNode("maxMaterialsPerZone", maxMaterialsPerZone));
}
if(completeSave || !FieldsEqual(7, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("isoVolumeFraction", isoVolumeFraction));
}
// Add the node to the parent node.
if(addToParent || forceAdd)
......@@ -375,7 +424,7 @@ MaterialAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool for
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Aug 16 15:34:05 PST 2005
// Creation: Thu Aug 18 17:37:44 PST 2005
//
// Modifications:
//
......@@ -401,12 +450,28 @@ MaterialAttributes::SetFromNode(DataNode *parentNode)
SetCleanZonesOnly(node->AsBool());
if((node = searchNode->GetNode("needValidConnectivity")) != 0)
SetNeedValidConnectivity(node->AsBool());
if((node = searchNode->GetNode("useNewMIRAlgorithm")) != 0)
SetUseNewMIRAlgorithm(node->AsBool());
if((node = searchNode->GetNode("algorithm")) != 0)
{
// Allow enums to be int or string in the config file
if(node->GetNodeType() == INT_NODE)
{
int ival = node->AsInt();
if(ival >= 0 && ival < 3)
SetAlgorithm(Algorithm(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
Algorithm value;
if(Algorithm_FromString(node->AsString(), value))
SetAlgorithm(value);
}
}
if((node = searchNode->GetNode("simplifyHeavilyMixedZones")) != 0)
SetSimplifyHeavilyMixedZones(node->AsBool());
if((node = searchNode->GetNode("maxMaterialsPerZone")) != 0)
SetMaxMaterialsPerZone(node->AsInt());
if((node = searchNode->GetNode("isoVolumeFraction")) != 0)
SetIsoVolumeFraction(node->AsFloat());
}
///////////////////////////////////////////////////////////////////////////////
......@@ -442,10 +507,10 @@ MaterialAttributes::SetNeedValidConnectivity(bool needValidConnectivity_)
}
void
MaterialAttributes::SetUseNewMIRAlgorithm(bool useNewMIRAlgorithm_)
MaterialAttributes::SetAlgorithm(MaterialAttributes::Algorithm algorithm_)
{
useNewMIRAlgorithm = useNewMIRAlgorithm_;
Select(4, (void *)&useNewMIRAlgorithm);
algorithm = algorithm_;
Select(4, (void *)&algorithm);
}
void
......@@ -462,6 +527,13 @@ MaterialAttributes::SetMaxMaterialsPerZone(int maxMaterialsPerZone_)
Select(6, (void *)&maxMaterialsPerZone);
}
void
MaterialAttributes::SetIsoVolumeFraction(float isoVolumeFraction_)
{
isoVolumeFraction = isoVolumeFraction_;
Select(7, (void *)&isoVolumeFraction);
}
///////////////////////////////////////////////////////////////////////////////
// Get property methods
///////////////////////////////////////////////////////////////////////////////
......@@ -490,10 +562,10 @@ MaterialAttributes::GetNeedValidConnectivity() const
return needValidConnectivity;
}
bool
MaterialAttributes::GetUseNewMIRAlgorithm() const
MaterialAttributes::Algorithm
MaterialAttributes::GetAlgorithm() const
{
return useNewMIRAlgorithm;
return Algorithm(algorithm);
}
bool
......@@ -508,6 +580,12 @@ MaterialAttributes::GetMaxMaterialsPerZone() const
return maxMaterialsPerZone;
}
float
MaterialAttributes::GetIsoVolumeFraction() const
{
return isoVolumeFraction;
}
///////////////////////////////////////////////////////////////////////////////
// Keyframing methods
///////////////////////////////////////////////////////////////////////////////
......@@ -521,7 +599,7 @@ MaterialAttributes::GetMaxMaterialsPerZone() const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Aug 16 15:34:05 PST 2005
// Creation: Thu Aug 18 17:37:44 PST 2005
//
// Modifications:
//
......@@ -536,9 +614,10 @@ MaterialAttributes::GetFieldName(int index) const
case 1: return "Force interface reconstruction";
case 2: return "Clean zones only";
case 3: return "Force perfect connectivity";
case 4: return "Use new MIR algorithm";
case 4: return "Algorithm";
case 5: return "Simplify Heavily Mixed Zones";
case 6: return "Maximum Materials Per Zone";
case 7: return "VF for Isovolume";
default: return "invalid index";
}
}
......@@ -552,7 +631,7 @@ MaterialAttributes::GetFieldName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Aug 16 15:34:05 PST 2005
// Creation: Thu Aug 18 17:37:44 PST 2005
//
// Modifications:
//
......@@ -567,9 +646,10 @@ MaterialAttributes::GetFieldType(int index) const
case 1: return FieldType_bool;
case 2: return FieldType_bool;
case 3: return FieldType_bool;
case 4: return FieldType_bool;
case 4: return FieldType_enum;
case 5: return FieldType_bool;
case 6: return FieldType_int;
case 7: return FieldType_float;
default: return FieldType_unknown;
}
}
......@@ -583,7 +663,7 @@ MaterialAttributes::GetFieldType(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Aug 16 15:34:05 PST 2005
// Creation: Thu Aug 18 17:37:44 PST 2005
//
// Modifications:
//
......@@ -598,9 +678,10 @@ MaterialAttributes::GetFieldTypeName(int index) const
case 1: return "bool";
case 2: return "bool";
case 3: return "bool";
case 4: return "bool";
case 4: return "enum";
case 5: return "bool";
case 6: return "int";
case 7: return "float";
default: return "invalid index";
}
}
......@@ -614,7 +695,7 @@ MaterialAttributes::GetFieldTypeName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Aug 16 15:34:05 PST 2005
// Creation: Thu Aug 18 17:37:44 PST 2005
//
// Modifications:
//
......@@ -649,7 +730,7 @@ MaterialAttributes::FieldsEqual(int index_, const AttributeGroup *rhs) const
break;
case 4:
{ // new scope
retval = (useNewMIRAlgorithm == obj.useNewMIRAlgorithm);
retval = (algorithm == obj.algorithm);
}
break;
case 5:
......@@ -662,6 +743,11 @@ MaterialAttributes::FieldsEqual(int index_, const AttributeGroup *rhs) const
retval = (maxMaterialsPerZone == obj.maxMaterialsPerZone);
}
break;
case 7:
{ // new scope
retval = (isoVolumeFraction == obj.isoVolumeFraction);
}
break;
default: retval = false;
}
......
#ifndef MATERIALATTRIBUTES_H
#define MATERIALATTRIBUTES_H
#include <state_exports.h>
#include <string>
#include <AttributeSubject.h>
// ****************************************************************************
......@@ -12,7 +13,7 @@
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Aug 16 15:34:05 PST 2005
// Creation: Thu Aug 18 17:37:44 PST 2005
//
// Modifications:
//
......@@ -21,6 +22,13 @@
class STATE_API MaterialAttributes : public AttributeSubject
{
public:
enum Algorithm
{
Tetrahedral,
ZooClipping,
Isovolume
};
MaterialAttributes();
MaterialAttributes(const MaterialAttributes &obj);
virtual ~MaterialAttributes();
......@@ -42,23 +50,31 @@ public:
void SetForceMIR(bool forceMIR_);
void SetCleanZonesOnly(bool cleanZonesOnly_);
void SetNeedValidConnectivity(bool needValidConnectivity_);
void SetUseNewMIRAlgorithm(bool useNewMIRAlgorithm_);
void SetAlgorithm(Algorithm algorithm_);
void SetSimplifyHeavilyMixedZones(bool simplifyHeavilyMixedZones_);
void SetMaxMaterialsPerZone(int maxMaterialsPerZone_);
void SetIsoVolumeFraction(float isoVolumeFraction_);
// Property getting methods
bool GetSmoothing() const;
bool GetForceMIR() const;
bool GetCleanZonesOnly() const;
bool GetNeedValidConnectivity() const;
bool GetUseNewMIRAlgorithm() const;
bool GetSimplifyHeavilyMixedZones() const;
int GetMaxMaterialsPerZone() const;
bool GetSmoothing() const;
bool GetForceMIR() const;
bool GetCleanZonesOnly() const;
bool GetNeedValidConnectivity() const;
Algorithm GetAlgorithm() const;
bool GetSimplifyHeavilyMixedZones() const;
int GetMaxMaterialsPerZone() const;
float GetIsoVolumeFraction() const;
// Persistence methods
virtual bool CreateNode(DataNode *node, bool completeSave, bool forceAdd);
virtual void SetFromNode(DataNode *node);
// Enum conversion functions
static std::string Algorithm_ToString(Algorithm);
static bool Algorithm_FromString(const std::string &, Algorithm &);
protected:
static std::string Algorithm_ToString(int);
public:
// Keyframing methods
virtual std::string GetFieldName(int index) const;
......@@ -67,13 +83,14 @@ public:
virtual bool FieldsEqual(int index, const AttributeGroup *rhs) const;
private:
bool smoothing;
bool forceMIR;
bool cleanZonesOnly;
bool needValidConnectivity;
bool useNewMIRAlgorithm;
bool simplifyHeavilyMixedZones;
int maxMaterialsPerZone;
bool smoothing;
bool forceMIR;
bool cleanZonesOnly;
bool needValidConnectivity;
int algorithm;
bool simplifyHeavilyMixedZones;
int maxMaterialsPerZone;
float isoVolumeFraction;
};
#endif
<?xml version="1.0"?>
<Attribute name="MaterialAttributes" purpose="Attributes to control material interface reconstruction" persistent="true" exportAPI="STATE_API" exportInclude="state_exports.h">
<Enum name="Algorithm">
Tetrahedral
ZooClipping
Isovolume
</Enum>
<Field name="smoothing" label="Enable interface smoothing" type="bool">
false
</Field>
......@@ -12,8 +17,8 @@
<Field name="needValidConnectivity" label="Force perfect connectivity" type="bool">
false
</Field>
<Field name="useNewMIRAlgorithm" label="Use new MIR algorithm" type="bool">
true
<Field name="algorithm" label="Algorithm" type="enum" subtype="Algorithm">
ZooClipping
</Field>
<Field name="simplifyHeavilyMixedZones" label="Simplify Heavily Mixed Zones" type="bool">
false
......@@ -21,4 +26,7 @@
<Field name="maxMaterialsPerZone" label="Maximum Materials Per Zone" type="int" enabler="simplifyHeavilyMixedZones:true">
3
</Field>
<Field name="isoVolumeFraction" label="VF for Isovolume" type="float" enabler="algorithm:Isovolume">
0.500000
</Field>
</Attribute>
......@@ -4005,6 +4005,9 @@ avtGenericDatabase::AddOriginalNodesArray(vtkDataSet *ds, const int domain)
// Mark C. Miller, Thu Apr 21 09:37:41 PDT 2005
// Made error message a little clearer
//
// Jeremy Meredith, Thu Aug 18 17:54:51 PDT 2005
// Added a new isovolume algorithm, with adjustable VF cutoff.
//
// ****************************************************************************
avtDataTree_p
......@@ -4020,6 +4023,7 @@ avtGenericDatabase::MaterialSelect(vtkDataSet *ds, avtMaterial *mat,
bool simplifyHeavilyMixedZones,
int maxMatsPerZone,
int mirAlgorithm,
float isovolumeMIRVF,
bool didGhosts,
bool &subdivisionOccurred,
bool &notAllCellsSubdivided,
......@@ -4061,7 +4065,7 @@ avtGenericDatabase::MaterialSelect(vtkDataSet *ds, avtMaterial *mat,
needValidConnectivity,
needSmoothMaterialInterfaces,
needCleanZonesOnly, simplifyHeavilyMixedZones,
maxMatsPerZone, mirAlgorithm,
maxMatsPerZone, mirAlgorithm, isovolumeMIRVF,
didGhosts,
subdivisionOccurred,
notAllCellsSubdivided, reUseMIR);
......@@ -4711,6 +4715,9 @@ avtGenericDatabase::SpeciesSelect(avtDatasetCollection &dsc,
// Hank Childs, Wed Aug 17 09:10:35 PDT 2005
// Add support for simplifying heavily mixed zones.
//
// Jeremy Meredith, Thu Aug 18 17:54:51 PDT 2005
// Added a new isovolume algorithm, with adjustable VF cutoff.
//
// ****************************************************************************
void_ref_ptr
avtGenericDatabase::GetMIR(int domain, const char *varname, int timestep,
......@@ -4720,19 +4727,21 @@ avtGenericDatabase::GetMIR(int domain, const char *varname, int timestep,
bool needCleanZonesOnly,
bool simplifyHeavilyMixedZones, int maxMatsPerZone,
int mirAlgorithm,
float isovolumeMIRVF,
bool didGhosts,
bool &subdivisionOccurred,
bool &notAllCellsSubdivided, bool reUseMIR)
{
char cacheLbl[1000];
sprintf(cacheLbl, "MIR_%s_%s_%s_%s_%s_%d_%s",
sprintf(cacheLbl, "MIR_%s_%s_%s_%s_%s_%d_%f_%s",
needValidConnectivity ? "FullSubdiv" : "MinimalSubdiv",
needSmoothMaterialInterfaces ? "Smooth" : "NotSmooth",
needCleanZonesOnly ? "CleanOnly" : "SplitMixed",
didGhosts ? "DidGhosts" : "NoDidGhosts",
simplifyHeavilyMixedZones ? "Simplify" : "NoSimplify",
maxMatsPerZone,
mirAlgorithm==0 ? "TetMIR" : "ZooMIR");
isovolumeMIRVF,
mirAlgorithm==0 ? "TetMIR" : (mirAlgorithm==1 ? "ZooMIR" : "IsovolumeMIR"));
//
// See if we already have the data lying around.
......@@ -4764,18 +4773,25 @@ avtGenericDatabase::GetMIR(int domain, const char *varname, int timestep,