Commit c662645f authored by hrchilds's avatar hrchilds

Update from August 20, 2003

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@62 18c085ea-50e0-402c-830e-de6fd14e8384
parent ee2d0be8
......@@ -20,10 +20,13 @@
// Moved this routine from the header, to prevent problems with inline
// functions and statics.
//
// Kathleen Bonnell, Wed Aug 20 11:36:06 PDT 2003
// Removed initialization of s from parameter list.
//
// ****************************************************************************
void
ExprGrammarNode::Print(ostream &o, std::string s="")
ExprGrammarNode::Print(ostream &o, std::string s)
{
static int indent = 0;
for (int i=0; i<indent; i++)
......
......@@ -11,7 +11,7 @@
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:30:25 PDT 2003
// Creation: Wed Aug 20 11:02:34 PDT 2003
//
// Modifications:
//
......@@ -31,7 +31,7 @@ HostProfileList::HostProfileList() : AttributeSubject("a*i")
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:30:25 PDT 2003
// Creation: Wed Aug 20 11:02:34 PDT 2003
//
// Modifications:
//
......@@ -70,7 +70,7 @@ HostProfileList::HostProfileList(const HostProfileList &obj) : AttributeSubject(
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:30:25 PDT 2003
// Creation: Wed Aug 20 11:02:34 PDT 2003
//
// Modifications:
//
......@@ -94,7 +94,7 @@ HostProfileList::~HostProfileList()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:30:25 PDT 2003
// Creation: Wed Aug 20 11:02:34 PDT 2003
//
// Modifications:
//
......@@ -134,7 +134,7 @@ HostProfileList::operator = (const HostProfileList &obj)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:30:25 PDT 2003
// Creation: Wed Aug 20 11:02:34 PDT 2003
//
// Modifications:
//
......@@ -168,7 +168,7 @@ HostProfileList::operator == (const HostProfileList &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:30:25 PDT 2003
// Creation: Wed Aug 20 11:02:34 PDT 2003
//
// Modifications:
//
......@@ -189,7 +189,7 @@ HostProfileList::operator != (const HostProfileList &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:30:25 PDT 2003
// Creation: Wed Aug 20 11:02:34 PDT 2003
//
// Modifications:
//
......@@ -210,7 +210,7 @@ HostProfileList::TypeName() const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:30:25 PDT 2003
// Creation: Wed Aug 20 11:02:34 PDT 2003
//
// Modifications:
//
......@@ -238,7 +238,7 @@ HostProfileList::CopyAttributes(const AttributeGroup *atts)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:30:25 PDT 2003
// Creation: Wed Aug 20 11:02:34 PDT 2003
//
// Modifications:
//
......@@ -264,7 +264,7 @@ HostProfileList::CreateCompatible(const std::string &tname) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:30:25 PDT 2003
// Creation: Wed Aug 20 11:02:34 PDT 2003
//
// Modifications:
//
......@@ -291,7 +291,7 @@ HostProfileList::NewInstance(bool copy) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:30:25 PDT 2003
// Creation: Wed Aug 20 11:02:34 PDT 2003
//
// Modifications:
//
......@@ -313,7 +313,7 @@ HostProfileList::SelectAll()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:30:25 PDT 2003
// Creation: Wed Aug 20 11:02:34 PDT 2003
//
// Modifications:
//
......@@ -338,7 +338,7 @@ HostProfileList::CreateSubAttributeGroup(int)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:30:25 PDT 2003
// Creation: Wed Aug 20 11:02:34 PDT 2003
//
// Modifications:
//
......@@ -403,6 +403,9 @@ HostProfileList::CreateNode(DataNode *parentNode, bool forceAdd)
// I added code to prevent the host profile from being inserted into the
// list if the host contains wildcard characters.
//
// Kathleen Bonnell, Wed Aug 20 10:51:24 PDT 2003
// Ensure that activeProfile is in the correct range.
//
// ****************************************************************************
void
......@@ -461,7 +464,19 @@ HostProfileList::SetFromNode(DataNode *parentNode)
}
if((node = searchNode->GetNode("activeProfile")) != 0)
SetActiveProfile(node->AsInt());
{
if (profiles.size() > 0)
{
if (node->AsInt() < profiles.size())
SetActiveProfile(node->AsInt());
else
SetActiveProfile(0);
}
else
{
SetActiveProfile(-1);
}
}
}
///////////////////////////////////////////////////////////////////////////////
// Set property methods
......@@ -519,7 +534,7 @@ HostProfileList::SelectProfiles()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:30:25 PDT 2003
// Creation: Wed Aug 20 11:02:34 PDT 2003
//
// Modifications:
//
......@@ -544,7 +559,7 @@ HostProfileList::AddHostProfile(const HostProfile &obj)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:30:25 PDT 2003
// Creation: Wed Aug 20 11:02:34 PDT 2003
//
// Modifications:
//
......@@ -572,7 +587,7 @@ HostProfileList::ClearHostProfiles()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:30:25 PDT 2003
// Creation: Wed Aug 20 11:02:34 PDT 2003
//
// Modifications:
//
......@@ -607,7 +622,7 @@ HostProfileList::RemoveHostProfile(int index)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:30:25 PDT 2003
// Creation: Wed Aug 20 11:02:34 PDT 2003
//
// Modifications:
//
......@@ -628,7 +643,7 @@ HostProfileList::GetNumHostProfiles() const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:30:25 PDT 2003
// Creation: Wed Aug 20 11:02:34 PDT 2003
//
// Modifications:
//
......@@ -649,7 +664,7 @@ HostProfileList::GetHostProfile(int i)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:30:25 PDT 2003
// Creation: Wed Aug 20 11:02:34 PDT 2003
//
// Modifications:
//
......@@ -670,7 +685,7 @@ HostProfileList::GetHostProfile(int i) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:30:25 PDT 2003
// Creation: Wed Aug 20 11:02:34 PDT 2003
//
// Modifications:
//
......@@ -691,7 +706,7 @@ HostProfileList::operator [] (int i)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:30:25 PDT 2003
// Creation: Wed Aug 20 11:02:34 PDT 2003
//
// Modifications:
//
......@@ -716,7 +731,7 @@ HostProfileList::operator [] (int i) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:30:25 PDT 2003
// Creation: Wed Aug 20 11:02:34 PDT 2003
//
// Modifications:
//
......@@ -742,7 +757,7 @@ HostProfileList::GetFieldName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:30:25 PDT 2003
// Creation: Wed Aug 20 11:02:34 PDT 2003
//
// Modifications:
//
......@@ -768,7 +783,7 @@ HostProfileList::GetFieldType(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:30:25 PDT 2003
// Creation: Wed Aug 20 11:02:34 PDT 2003
//
// Modifications:
//
......@@ -794,7 +809,7 @@ HostProfileList::GetFieldTypeName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:30:25 PDT 2003
// Creation: Wed Aug 20 11:02:34 PDT 2003
//
// Modifications:
//
......@@ -1051,12 +1066,15 @@ HostProfileList::GetNumProfilesForHost(const std::string &hostName) const
// Jeremy Meredith, Tue Jul 17 18:00:10 PDT 2001
// Reworded "default profile" to be "active profile".
//
// Kathleen Bonnell, Wed Aug 20 10:57:00 PDT 2003
// Ensure index is within correct range.
//
// ****************************************************************************
void
HostProfileList::SetAsActiveProfile(int index)
{
if(index < 0 || index > profiles.size())
if(index < 0 || index >= profiles.size())
return;
// Set the specified profile as the active for its host.
......
......@@ -233,12 +233,15 @@ Definition:
// Jeremy Meredith, Tue Jul 17 18:00:10 PDT 2001
// Reworded "default profile" to be "active profile".
//
// Kathleen Bonnell, Wed Aug 20 10:57:00 PDT 2003
// Ensure index is within correct range.
//
// ****************************************************************************
void
HostProfileList::SetAsActiveProfile(int index)
{
if(index < 0 || index > profiles.size())
if(index < 0 || index >= profiles.size())
return;
// Set the specified profile as the active for its host.
......@@ -443,6 +446,9 @@ Definition:
// I added code to prevent the host profile from being inserted into the
// list if the host contains wildcard characters.
//
// Kathleen Bonnell, Wed Aug 20 10:51:24 PDT 2003
// Ensure that activeProfile is in the correct range.
//
// ****************************************************************************
void
......@@ -501,5 +507,17 @@ HostProfileList::SetFromNode(DataNode *parentNode)
}
if((node = searchNode->GetNode("activeProfile")) != 0)
SetActiveProfile(node->AsInt());
{
if (profiles.size() > 0)
{
if (node->AsInt() < profiles.size())
SetActiveProfile(node->AsInt());
else
SetActiveProfile(0);
}
else
{
SetActiveProfile(-1);
}
}
}
......@@ -13,7 +13,7 @@ class HostProfile;
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:30:25 PDT 2003
// Creation: Wed Aug 20 11:02:33 PDT 2003
//
// Modifications:
//
......
......@@ -39,7 +39,7 @@
#include <avtTypes.h>
#include <PickAttributes.h>
#include <PickVarInfo.h>
#include <MIR.h>
#include <TetMIR.h>
#include <DebugStream.h>
#include <ImproperUseException.h>
......@@ -2206,7 +2206,7 @@ avtGenericDatabase::GetMIR(int domain, const char *varname, int timestep,
EXCEPTION0(NoInputException);
}
MIR *mir = new MIR;
MIR *mir = new TetMIR;
mir->SetLeaveCleanZonesWhole(!needValidConnectivity);
mir->SetSmoothing(needSmoothMaterialInterfaces);
mir->SetCleanZonesOnly(needCleanZonesOnly);
......@@ -3447,6 +3447,10 @@ avtGenericDatabase::CreateStructuredIndices(avtDatasetCollection &dsc,
// We should do MIR if we are told to by the data spec, not if the type of
// variable is material.
//
// Jeremy Meredith, Wed Aug 20 09:56:19 PDT 2003
// Refactored MIR into a base and subclass. This will allow us to swap
// in other MIR algorithms more easily.
//
// ****************************************************************************
int
......@@ -3464,7 +3468,6 @@ avtGenericDatabase::NumStagesForFetch(avtDataSpecification_p spec)
//
bool needMatSel = false;
const char *var = spec->GetVariable();
needMatSel |= spec->MustDoMaterialInterfaceReconstruction();
if (!needMatSel)
{
......
This diff is collapsed.
// ****************************************************************************
// avtUnstructuredDomainBoundaries.h
// ****************************************************************************
#ifndef AVT_UNSTRUCTURED_DOMAIN_BOUNDARIES_H
#define AVT_UNSTRUCTURED_DOMAIN_BOUNDARIES_H
#include <database_exports.h>
#include <avtDomainBoundaries.h>
#include <map>
#include <vector>
#include <utility>
using std::vector;
using std::pair;
using std::map;
class vtkDataSet;
class vtkDataArray;
class avtMixedVariable;
class avtMaterial;
// ****************************************************************************
// Class: avtUnstructuredDomainBoundaries
//
// Purpose:
// Encapsulate domain boundary information for unstructured datasets.
//
// Notes:
// For each domain that an instance on a processor is responsible for,
// it needs to know all of the shared points for those domains, and
// what points and cells are being given by those domains.
//
// Programmer: Akira Haddox
// Creation: August 11, 2003
//
// ****************************************************************************
class DATABASE_API avtUnstructuredDomainBoundaries : public avtDomainBoundaries
{
public:
avtUnstructuredDomainBoundaries();
virtual ~avtUnstructuredDomainBoundaries();
static void Destruct(void *);
void SetTotalNumberOfDomains(int nd) { nTotalDomains = nd; }
void SetSharedPoints(int d1, int d2, const vector<int> &d1pts,
const vector<int> &d2pts);
void SetGivenCellsAndPoints(int fromDom, int toDom,
const vector<int> &cells,
const vector<int> &points,
bool filterShared = false);
virtual vector<vtkDataSet*> ExchangeMesh(vector<int> domainNum,
vector<vtkDataSet*> meshes);
virtual vector<vtkDataArray*> ExchangeScalar(vector<int> domainNum,
bool isPointData,
vector<vtkDataArray*> scalars);
virtual vector<vtkDataArray*> ExchangeFloatVector(vector<int> domainNum,
bool isPointData,
vector<vtkDataArray*> vectors);
virtual vector<vtkDataArray*> ExchangeIntVector(vector<int> domainNum,
bool isPointData,
vector<vtkDataArray*> vectors);
virtual vector<avtMaterial*> ExchangeMaterial(vector<int> domainNum,
vector<avtMaterial*> mats);
virtual vector<avtMixedVariable*> ExchangeMixVar(vector<int> domainNum,
const vector<avtMaterial*> mats,
vector<avtMixedVariable*> mixvars);
virtual bool ConfirmMesh(vector<int> domainNum,
vector<vtkDataSet*> meshes);
protected:
template <class T>
void CopyPointer(T *src, T *dest,
int components, int count);
int GetGivenIndex(int from, int to);
int nTotalDomains;
vector<std::pair<int, int> > giveIndex;
vector<vector<int> > givenCells;
vector<vector<int> > givenPoints;
vector<map<int, int> > sharedPointsMap;
// [<send, recv>] = startingCell for recvDom
map<std::pair<int, int>, int> startingCell;
map<std::pair<int, int>, int> startingPoint;
template <class T>
vector<vtkDataArray*> ExchangeData(vector<int> &domainNum,
bool isPointData,
vector<vtkDataArray*> &data);
// Communication methods
vector<int> CreateDomainToProcessorMap(const vector<int> &domainNum);
void CommunicateMeshInformation(const vector<int> &domain2proc,
const vector<int> &domainNum,
const vector<vtkDataSet *> &,
float ***&gainedPoints,
int ***&cellTypes,
int ****&cellPoints,
int ***&origPointIds,
int **&nGainedPoints,
int **&nGainedCells,
int ***&nPointsPerCell);
template <class T>
void CommunicateDataInformation(const vector<int> &domain2proc,
const vector<int> &domainNum,
const vector<vtkDataArray *>&,
bool isPointData,
T ***&gainedData,
int **&nGainedTuples);
};
#endif
#include <avtUnstructuredPointBoundaries.h>
#include <vtkUnstructuredGrid.h>
#include <map>
#include <set>
using namespace std;
// ****************************************************************************
// Constructor: avtUnstructuredPointBoundaries::
// avtUnstructuredPointBoundaries
//
// Programmer: Akira Haddox
// Creation: August 11, 2003
//
// ****************************************************************************
avtUnstructuredPointBoundaries::avtUnstructuredPointBoundaries()
{
}
// ****************************************************************************
// Destructor: avtUnstructuredPointBoundaries::
// ~avtUnstructuredPointBoundaries
//
// Programmer: Akira Haddox
// Creation: August 11, 2003
//
// ****************************************************************************
avtUnstructuredPointBoundaries::~avtUnstructuredPointBoundaries()
{
}
// ****************************************************************************
// Destructor: avtUnstructuredPointBoundaries::Destruct
//
// Programmer: Akira Haddox
// Creation: August 11, 2003
//
// ****************************************************************************
void
avtUnstructuredPointBoundaries::Destruct(void *p)
{
avtUnstructuredPointBoundaries *u = (avtUnstructuredPointBoundaries *)p;
delete u;
}
// ****************************************************************************
// Method: avtUnstructuredPointBoundaries::ExchangeMesh
//
// Purpose:
// Generates information for parent class before calling its
// ExchangeMesh method.
//
// Arguments:
// domainNum an array of domain numbers for each mesh
// mesh an array of meshes
//
// Programmer: Akira Haddox
// Creation: August 11, 2003
//
// ****************************************************************************
vector<vtkDataSet*>
avtUnstructuredPointBoundaries::ExchangeMesh(vector<int> domainNum,
vector<vtkDataSet*> meshes)
{
Generate(domainNum, meshes);
return avtUnstructuredDomainBoundaries::ExchangeMesh(domainNum, meshes);
}
// ****************************************************************************
// Method: avtUnstructuredPointBoundaries::ConfirmMesh
//
// Purpose:
// Generates information for parent class before calling its
// ConfirmMesh method.
//
// Arguments:
// domainNum an array of domain numbers for each mesh
// mesh an array of meshes
//
// Programmer: Akira Haddox
// Creation: August 11, 2003
//
// ****************************************************************************
bool
avtUnstructuredPointBoundaries::ConfirmMesh(vector<int> domainNum,
vector<vtkDataSet*> meshes)
{
Generate(domainNum, meshes);
return avtUnstructuredDomainBoundaries::ConfirmMesh(domainNum, meshes);
}
// ****************************************************************************
// Method: avtUnstructuredPointBoundaries::CheckGenerated
//
// Purpose:
// Check if the information for two domains has been generated or not.
// Also ensures that the generated vector is resized to modify those
// settings.
//
// Arguments:
// d1 The domain sending.
// d2 The domain receiving.
//
// Programmer: Akira Haddox
// Creation: August 11, 2003
//
// ****************************************************************************
bool
avtUnstructuredPointBoundaries::CheckGenerated(int d1, int d2)
{
if (d1 >= generated.size())
generated.resize(d1 + 1);
if (d2 >= generated[d1].size())
generated[d1].resize(d2 + 1, false);
return generated[d1][d2];
}
// ****************************************************************************
// Method: avtUnstructuredPointBoundaries::Generate
//
// Purpose:
// Generate given cell and point information based on the shared point
// list and datasets. Does not generate information for pairs that have
// been generated before.
//
// Arguments:
// domainNum The domain numbers associated.
// meshes The datasets for the domains.
//
// Programmer: Akira Haddox
// Creation: August 11, 2003
//
// ****************************************************************************
void
avtUnstructuredPointBoundaries::Generate(vector<int> domainNum,
vector<vtkDataSet *> meshes)
{
int i, k, m;
map<int, int>::iterator miter;
vtkIdList *cl = vtkIdList::New();
vtkIdList *pl = vtkIdList::New();
for (i = 0; i < domainNum.size(); ++i)
{
int sendDom = domainNum[i];
int recvDom;
for (recvDom = 0; recvDom < nTotalDomains; ++recvDom)
{
if (sendDom == recvDom || CheckGenerated(sendDom, recvDom))
continue;
generated[sendDom][recvDom] = true;
int index = GetGivenIndex(sendDom, recvDom);
// If there's no shared data, there's no given data.
if (index < 0)
continue;
map<int, int> &smap = sharedPointsMap[index];
miter = smap.begin();
vtkDataSet *ds = meshes[i];
set<int> cells;
set<int> points;
// For each shared point, find the cells to give.
// From those cells, find what points to give.
for (; miter != smap.end(); ++miter)
{
ds->GetPointCells(miter->first, cl);
for (k = 0; k < cl->GetNumberOfIds(); ++k)
{
int cellId = cl->GetId(k);
//
// We shouldn't ghost 2D cells.
//
int type = ds->GetCellType(cellId);
if (type == VTK_LINE || type == VTK_TRIANGLE
|| type == VTK_VERTEX || type == VTK_QUAD)
continue;