Updates will be applied April 15th at 12pm EDT (UTC-0400). GitLab could be a little slow between 12 - 12:45pm EDT.

Commit e23bb5f7 authored by hrchilds's avatar hrchilds

Update from September 16, 2003

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@79 18c085ea-50e0-402c-830e-de6fd14e8384
parent 5db80e44
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -10,18 +10,19 @@
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jul 29 12:56:51 PDT 2003
// Creation: Mon Sep 15 16:51:24 PST 2003
//
// Modifications:
//
// ****************************************************************************
MaterialAttributes::MaterialAttributes() : AttributeSubject("bbbb")
MaterialAttributes::MaterialAttributes() : AttributeSubject("bbbbb")
{
smoothing = false;
forceMIR = false;
cleanZonesOnly = false;
needValidConnectivity = false;
useNewMIRAlgorithm = true;
}
// ****************************************************************************
......@@ -33,18 +34,19 @@ MaterialAttributes::MaterialAttributes() : AttributeSubject("bbbb")
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jul 29 12:56:51 PDT 2003
// Creation: Mon Sep 15 16:51:24 PST 2003
//
// Modifications:
//
// ****************************************************************************
MaterialAttributes::MaterialAttributes(const MaterialAttributes &obj) : AttributeSubject("bbbb")
MaterialAttributes::MaterialAttributes(const MaterialAttributes &obj) : AttributeSubject("bbbbb")
{
smoothing = obj.smoothing;
forceMIR = obj.forceMIR;
cleanZonesOnly = obj.cleanZonesOnly;
needValidConnectivity = obj.needValidConnectivity;
useNewMIRAlgorithm = obj.useNewMIRAlgorithm;
SelectAll();
}
......@@ -58,7 +60,7 @@ MaterialAttributes::MaterialAttributes(const MaterialAttributes &obj) : Attribut
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jul 29 12:56:51 PDT 2003
// Creation: Mon Sep 15 16:51:24 PST 2003
//
// Modifications:
//
......@@ -78,7 +80,7 @@ MaterialAttributes::~MaterialAttributes()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jul 29 12:56:51 PDT 2003
// Creation: Mon Sep 15 16:51:24 PST 2003
//
// Modifications:
//
......@@ -91,6 +93,7 @@ MaterialAttributes::operator = (const MaterialAttributes &obj)
forceMIR = obj.forceMIR;
cleanZonesOnly = obj.cleanZonesOnly;
needValidConnectivity = obj.needValidConnectivity;
useNewMIRAlgorithm = obj.useNewMIRAlgorithm;
SelectAll();
}
......@@ -104,7 +107,7 @@ MaterialAttributes::operator = (const MaterialAttributes &obj)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jul 29 12:56:51 PDT 2003
// Creation: Mon Sep 15 16:51:24 PST 2003
//
// Modifications:
//
......@@ -117,7 +120,8 @@ MaterialAttributes::operator == (const MaterialAttributes &obj) const
return ((smoothing == obj.smoothing) &&
(forceMIR == obj.forceMIR) &&
(cleanZonesOnly == obj.cleanZonesOnly) &&
(needValidConnectivity == obj.needValidConnectivity));
(needValidConnectivity == obj.needValidConnectivity) &&
(useNewMIRAlgorithm == obj.useNewMIRAlgorithm));
}
// ****************************************************************************
......@@ -129,7 +133,7 @@ MaterialAttributes::operator == (const MaterialAttributes &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jul 29 12:56:51 PDT 2003
// Creation: Mon Sep 15 16:51:24 PST 2003
//
// Modifications:
//
......@@ -150,7 +154,7 @@ MaterialAttributes::operator != (const MaterialAttributes &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jul 29 12:56:51 PDT 2003
// Creation: Mon Sep 15 16:51:24 PST 2003
//
// Modifications:
//
......@@ -171,7 +175,7 @@ MaterialAttributes::TypeName() const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jul 29 12:56:51 PDT 2003
// Creation: Mon Sep 15 16:51:24 PST 2003
//
// Modifications:
//
......@@ -199,7 +203,7 @@ MaterialAttributes::CopyAttributes(const AttributeGroup *atts)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jul 29 12:56:51 PDT 2003
// Creation: Mon Sep 15 16:51:24 PST 2003
//
// Modifications:
//
......@@ -225,7 +229,7 @@ MaterialAttributes::CreateCompatible(const std::string &tname) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jul 29 12:56:51 PDT 2003
// Creation: Mon Sep 15 16:51:24 PST 2003
//
// Modifications:
//
......@@ -252,7 +256,7 @@ MaterialAttributes::NewInstance(bool copy) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jul 29 12:56:51 PDT 2003
// Creation: Mon Sep 15 16:51:24 PST 2003
//
// Modifications:
//
......@@ -265,6 +269,7 @@ MaterialAttributes::SelectAll()
Select(1, (void *)&forceMIR);
Select(2, (void *)&cleanZonesOnly);
Select(3, (void *)&needValidConnectivity);
Select(4, (void *)&useNewMIRAlgorithm);
}
///////////////////////////////////////////////////////////////////////////////
......@@ -280,7 +285,7 @@ MaterialAttributes::SelectAll()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jul 29 12:56:51 PDT 2003
// Creation: Mon Sep 15 16:51:24 PST 2003
//
// Modifications:
//
......@@ -321,6 +326,12 @@ MaterialAttributes::CreateNode(DataNode *parentNode, bool forceAdd)
node->AddNode(new DataNode("needValidConnectivity", needValidConnectivity));
}
if(!FieldsEqual(4, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("useNewMIRAlgorithm", useNewMIRAlgorithm));
}
// Add the node to the parent node.
if(addToParent || forceAdd)
......@@ -340,7 +351,7 @@ MaterialAttributes::CreateNode(DataNode *parentNode, bool forceAdd)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jul 29 12:56:51 PDT 2003
// Creation: Mon Sep 15 16:51:24 PST 2003
//
// Modifications:
//
......@@ -365,6 +376,8 @@ 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());
}
///////////////////////////////////////////////////////////////////////////////
......@@ -399,6 +412,13 @@ MaterialAttributes::SetNeedValidConnectivity(bool needValidConnectivity_)
Select(3, (void *)&needValidConnectivity);
}
void
MaterialAttributes::SetUseNewMIRAlgorithm(bool useNewMIRAlgorithm_)
{
useNewMIRAlgorithm = useNewMIRAlgorithm_;
Select(4, (void *)&useNewMIRAlgorithm);
}
///////////////////////////////////////////////////////////////////////////////
// Get property methods
///////////////////////////////////////////////////////////////////////////////
......@@ -427,6 +447,12 @@ MaterialAttributes::GetNeedValidConnectivity() const
return needValidConnectivity;
}
bool
MaterialAttributes::GetUseNewMIRAlgorithm() const
{
return useNewMIRAlgorithm;
}
///////////////////////////////////////////////////////////////////////////////
// Keyframing methods
///////////////////////////////////////////////////////////////////////////////
......@@ -440,7 +466,7 @@ MaterialAttributes::GetNeedValidConnectivity() const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jul 29 12:56:51 PDT 2003
// Creation: Mon Sep 15 16:51:24 PST 2003
//
// Modifications:
//
......@@ -455,6 +481,7 @@ 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";
default: return "invalid index";
}
}
......@@ -468,7 +495,7 @@ MaterialAttributes::GetFieldName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jul 29 12:56:51 PDT 2003
// Creation: Mon Sep 15 16:51:24 PST 2003
//
// Modifications:
//
......@@ -483,6 +510,7 @@ 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;
default: return FieldType_unknown;
}
}
......@@ -496,7 +524,7 @@ MaterialAttributes::GetFieldType(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jul 29 12:56:51 PDT 2003
// Creation: Mon Sep 15 16:51:24 PST 2003
//
// Modifications:
//
......@@ -511,6 +539,7 @@ MaterialAttributes::GetFieldTypeName(int index) const
case 1: return "bool";
case 2: return "bool";
case 3: return "bool";
case 4: return "bool";
default: return "invalid index";
}
}
......@@ -524,7 +553,7 @@ MaterialAttributes::GetFieldTypeName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jul 29 12:56:51 PDT 2003
// Creation: Mon Sep 15 16:51:24 PST 2003
//
// Modifications:
//
......@@ -557,6 +586,11 @@ MaterialAttributes::FieldsEqual(int index_, const AttributeGroup *rhs) const
retval = (needValidConnectivity == obj.needValidConnectivity);
}
break;
case 4:
{ // new scope
retval = (useNewMIRAlgorithm == obj.useNewMIRAlgorithm);
}
break;
default: retval = false;
}
......
......@@ -12,7 +12,7 @@
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jul 29 12:56:51 PDT 2003
// Creation: Mon Sep 15 16:51:24 PST 2003
//
// Modifications:
//
......@@ -42,12 +42,14 @@ public:
void SetForceMIR(bool forceMIR_);
void SetCleanZonesOnly(bool cleanZonesOnly_);
void SetNeedValidConnectivity(bool needValidConnectivity_);
void SetUseNewMIRAlgorithm(bool useNewMIRAlgorithm_);
// Property getting methods
bool GetSmoothing() const;
bool GetForceMIR() const;
bool GetCleanZonesOnly() const;
bool GetNeedValidConnectivity() const;
bool GetUseNewMIRAlgorithm() const;
// Persistence methods
virtual bool CreateNode(DataNode *node, bool forceAdd);
......@@ -65,6 +67,7 @@ private:
bool forceMIR;
bool cleanZonesOnly;
bool needValidConnectivity;
bool useNewMIRAlgorithm;
};
#endif
......@@ -12,4 +12,7 @@
<Field name="needValidConnectivity" label="Force perfect connectivity" type="bool">
false
</Field>
<Field name="useNewMIRAlgorithm" label="Use new MIR algorithm" type="bool">
true
</Field>
</Attribute>
......@@ -40,6 +40,7 @@
#include <PickAttributes.h>
#include <PickVarInfo.h>
#include <TetMIR.h>
#include <ZooMIR.h>
#include <DebugStream.h>
#include <ImproperUseException.h>
......@@ -1687,6 +1688,9 @@ avtGenericDatabase::AddOriginalNodesArray(vtkDataSet *ds, const int domain)
// Hank Childs, Fri Sep 12 16:27:38 PDT 2003
// Added a flag for whether or not reconstruction was forced.
//
// Jeremy Meredith, Fri Sep 5 15:31:53 PDT 2003
// Added a flag for the MIR algorithm.
//
// ****************************************************************************
avtDataTree_p
......@@ -1697,9 +1701,13 @@ avtGenericDatabase::MaterialSelect(vtkDataSet *ds, avtMaterial *mat,
bool needBoundarySurfaces,
bool needValidConnectivity,
bool needSmoothMaterialInterfaces,
bool needCleanZonesOnly, bool reconstructionForced,
bool didGhosts, bool &subdivisionOccurred,
bool &notAllCellsSubdivided, bool reUseMIR)
bool needCleanZonesOnly,
bool reconstructionForced,
int mirAlgorithm,
bool didGhosts,
bool &subdivisionOccurred,
bool &notAllCellsSubdivided,
bool reUseMIR)
{
//
// We need to have the material indices as well.
......@@ -1722,7 +1730,8 @@ avtGenericDatabase::MaterialSelect(vtkDataSet *ds, avtMaterial *mat,
void_ref_ptr vr_mir = GetMIR(dom, var, ts, ds, mat, topoDim,
needValidConnectivity,
needSmoothMaterialInterfaces,
needCleanZonesOnly, didGhosts,
needCleanZonesOnly, mirAlgorithm,
didGhosts,
subdivisionOccurred,
notAllCellsSubdivided, reUseMIR);
MIR *mir = (MIR *) (*vr_mir);
......@@ -2172,23 +2181,28 @@ avtGenericDatabase::SpeciesSelect(avtDatasetCollection &dsc,
// Hank Childs, Tue Jul 22 21:48:09 PDT 2003
// Added a flag for whether or not we communicated ghosts.
//
// Jeremy Meredith, Fri Sep 5 15:31:33 PDT 2003
// Added the new MIR algorithm.
//
// ****************************************************************************
void_ref_ptr
avtGenericDatabase::GetMIR(int domain, const char *varname, int timestep,
vtkDataSet *ds, avtMaterial *mat, int topoDim,
bool needValidConnectivity,
bool needSmoothMaterialInterfaces,
bool needCleanZonesOnly, bool didGhosts,
bool needCleanZonesOnly,
int mirAlgorithm,
bool didGhosts,
bool &subdivisionOccurred,
bool &notAllCellsSubdivided, bool reUseMIR)
{
char cacheLbl[1000];
sprintf(cacheLbl, "MIR_%s_%s_%s_%s",
sprintf(cacheLbl, "MIR_%s_%s_%s_%s_%s",
needValidConnectivity ? "FullSubdiv" : "MinimalSubdiv",
needSmoothMaterialInterfaces ? "Smooth" : "NotSmooth",
needCleanZonesOnly ? "CleanOnly" : "SplitMixed",
didGhosts ? "DidGhosts" : "NoDidGhosts");
didGhosts ? "DidGhosts" : "NoDidGhosts",
mirAlgorithm==0 ? "TetMIR" : "ZooMIR");
//
// See if we already have the data lying around.
......@@ -2212,7 +2226,17 @@ avtGenericDatabase::GetMIR(int domain, const char *varname, int timestep,
EXCEPTION0(NoInputException);
}
MIR *mir = new TetMIR;
MIR *mir = NULL;
//
// Right new the new algorithm (index==1) is only
// available in 3D.
//
if (topoDim == 3 && mirAlgorithm == 1)
mir = new ZooMIR;
else
mir = new TetMIR;
mir->SetLeaveCleanZonesWhole(!needValidConnectivity);
mir->SetSmoothing(needSmoothMaterialInterfaces);
mir->SetCleanZonesOnly(needCleanZonesOnly);
......@@ -3205,6 +3229,9 @@ avtGenericDatabase::CommunicateGhosts(avtDatasetCollection &ds,
// Hank Childs, Fri Sep 12 16:27:38 PDT 2003
// Send down info about whether the MIR was forced.
//
// Jeremy Meredith, Fri Sep 5 15:32:30 PDT 2003
// Added a flag for the MIR algorithm.
//
// ****************************************************************************
void
......@@ -3276,6 +3303,7 @@ avtGenericDatabase::MaterialSelect(avtDatasetCollection &ds,
spec->NeedSmoothMaterialInterfaces(),
spec->NeedCleanZonesOnly(),
spec->MustDoMaterialInterfaceReconstruction(),
spec->UseNewMIRAlgorithm() ? 1 : 0,
didGhosts, so, nacs, reUseMIR);
notAllCellsSubdivided = notAllCellsSubdivided || nacs ||
......
......@@ -147,6 +147,9 @@ class PickVarInfo;
// Kathleen Bonnell, Tue Sep 9 16:51:10 PDT 2003
// Changed PickVarInfo argument in QueryMesh to std::string.
//
// Jeremy Meredith, Mon Sep 15 09:43:26 PDT 2003
// Added a MIR algorithm flag to MaterialSelect and GetMIR.
//
// ****************************************************************************
class DATABASE_API avtGenericDatabase : public avtDatasetDatabase
......@@ -213,10 +216,11 @@ class DATABASE_API avtGenericDatabase : public avtDatasetDatabase
std::vector<std::string> &,
std::vector<std::string> &,
bool, bool, bool, bool, bool,
bool, bool, bool&, bool&, bool);
bool, int, bool, bool&, bool&,
bool);
void_ref_ptr GetMIR(int, const char *, int, vtkDataSet*,
avtMaterial *, int, bool, bool, bool,
bool, bool&, bool&, bool);
int, bool, bool&, bool&, bool);
avtMaterial *GetMaterial(int, const char *, int);
avtSpecies *GetSpecies(int, const char *, int);
void GetMaterialIndices(const char *,
......
......@@ -16,6 +16,10 @@
// Programmer: Jeremy Meredith
// Creation: September 17, 2001
//
// Modifications:
// Jeremy Meredith, Mon Sep 15 09:47:58 PDT 2003
// Updated to allow reserving memory.
//
// ****************************************************************************
template<class T>
class MIR_API Array
......@@ -32,6 +36,12 @@ class MIR_API Array
cp = 10;
sz = 0;
}
Array(int initSize)
{
d = new T[initSize];
cp = initSize;
sz = 0;
}
~Array()
{
delete[] d;
......@@ -43,15 +53,28 @@ class MIR_API Array
const T &operator[](const int &i) const { return d[i]; }
T &operator[](const int &i) { return d[i]; }
void push_back(const T& t)
void resize(int n)
{
if (sz+1 > cp)
{
T *d2 = new T[cp*2];
memcpy(d2, d, sizeof(T)*cp);
reserve(n);
sz = n;
}
void reserve(int n)
{
if (n > cp)
{
T *d2 = new T[n];
memcpy(d2, d, sizeof(T)*sz);
delete[] d;
d = d2;
cp *= 2;
cp = n;
}
}
void push_back(const T& t)
{
if (sz+1 > cp)
{
reserve(int(float(cp)*2));
}
d[sz++] = t;
}
......
......@@ -31,6 +31,8 @@ class avtSpecies;
// Note: refactored base out of what has now become TetMIR.h
//
// Modifications:
// Jeremy Meredith, Mon Sep 15 09:48:43 PDT 2003
// Changed the way some functions were refactored from TetMIR.
//
// ****************************************************************************
class MIR_API MIR
......@@ -64,12 +66,10 @@ class MIR_API MIR
vtkDataArray*&, avtMixedVariable*&);
// get some result flags
bool SubdivisionOccurred() { return !allClean; }
bool NotAllCellsSubdivided() { return someClean; }
virtual bool SubdivisionOccurred() = 0;
virtual bool NotAllCellsSubdivided() = 0;
protected:
bool allClean;
bool someClean;
MIROptions options;
};
......
#include "MIRConnectivity.h"
#include <DebugStream.h>
#include <ImproperUseException.h>
#include <TimingsManager.h>
#include <vtkDataSet.h>
#include <vtkRectilinearGrid.h>
#include <vtkStructuredGrid.h>
#include <vtkUnstructuredGrid.h>
// ****************************************************************************
// Method: MIRConnectivity constructor
//
// Programmer: Hank Childs
// Creation: October 7, 2002
//
// ****************************************************************************
MIRConnectivity::MIRConnectivity()
{
cellindex = NULL;
connectivity = NULL;
celltype = NULL;
ncells = 0;
}
// ****************************************************************************
// Method: MIRConnectivity destructor
//
// Programmer: Hank Childs
// Creation: October 7, 2002
//
// ****************************************************************************
MIRConnectivity::~MIRConnectivity()
{
if (cellindex != NULL)
{
delete [] cellindex;
}
if (connectivity != NULL)
{
delete [] connectivity;
}
if (celltype != NULL)
{
delete [] celltype;
}
}
// ****************************************************************************
// Method: MIRConnectivity::SetUpConnectivity
//
// Purpose:
// Sets up the connectivity from a VTK dataset.
//
// Programmer: Hank Childs
// Creation: October 7, 2002
//
// ****************************************************************************