Commit d6185bb5 authored by hrchilds's avatar hrchilds
Browse files

Update from August 23, 2004

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@306 18c085ea-50e0-402c-830e-de6fd14e8384
parent 5b756fb6
......@@ -19,6 +19,7 @@
struct avtDatasetCollection;
struct avtMatSpeciesMetaData;
class avtDomainBoundaries;
class avtFileFormatInterface;
class avtMixedVariable;
class avtSILRestrictionTraverser;
......@@ -190,6 +191,9 @@ class PickVarInfo;
// Mark C. Miller, Mon Aug 9 19:12:24 PDT 2004
// Added methods to get global node and zone ids
//
// Hank Childs, Fri Aug 13 15:57:29 PDT 2004
// Beef up ghost data communication routines.
//
// ****************************************************************************
class DATABASE_API avtGenericDatabase : public avtDatasetDatabase
......@@ -290,9 +294,37 @@ class DATABASE_API avtGenericDatabase : public avtDatasetDatabase
void ReadDataset(avtDatasetCollection &,
std::vector<int> &, avtDataSpecification_p &,
avtSourceFromDatabase *);
bool CommunicateGhosts(avtDatasetCollection &,
std::vector<int> &, avtDataSpecification_p &,
avtSourceFromDatabase *);
avtDomainBoundaries *GetDomainBoundaryInformation(
avtDatasetCollection &,
std::vector<int> &,
avtDataSpecification_p);
bool CommunicateGhosts(avtGhostDataType,
avtDatasetCollection &, std::vector<int> &,
avtDataSpecification_p &,
avtSourceFromDatabase *);
bool CommunicateGhostZonesFromDomainBoundaries(
avtDomainBoundaries *,
avtDatasetCollection &, std::vector<int> &,
avtDataSpecification_p &,
avtSourceFromDatabase *);
bool CommunicateGhostZonesFromDomainBoundariesFromFile(
avtDatasetCollection &, std::vector<int> &,
avtDataSpecification_p &,
avtSourceFromDatabase *);
bool CommunicateGhostNodesFromDomainBoundariesFromFile(
avtDatasetCollection &, std::vector<int> &,
avtDataSpecification_p &,
avtSourceFromDatabase *);
bool CommunicateGhostZonesFromGlobalNodeIds(
avtDatasetCollection &, std::vector<int> &,
avtDataSpecification_p &,
avtSourceFromDatabase *);
bool CommunicateGhostNodesFromGlobalNodeIds(
avtDatasetCollection &, std::vector<int> &,
avtDataSpecification_p &,
avtSourceFromDatabase *);
bool ApplyGhostForDomainNesting(avtDatasetCollection &,
std::vector<int> &, std::vector<int> &,
avtDataSpecification_p &);
......
......@@ -24,6 +24,11 @@ const int avtMTSDFileFormat::MAX_FILES = 1000;
// Programmer: Hank Childs
// Creation: October 8, 2001
//
// Modifications:
//
// Hank Childs, Mon Aug 16 16:22:56 PDT 2004
// Initialize myDomain.
//
// ****************************************************************************
avtMTSDFileFormat::avtMTSDFileFormat(const char * const *names, int nNames)
......@@ -40,6 +45,7 @@ avtMTSDFileFormat::avtMTSDFileFormat(const char * const *names, int nNames)
{
filenames[i] = NULL;
}
myDomain = -1;
}
......
......@@ -52,6 +52,9 @@ class avtIOInformation;
// Mark C. Miller, Tue Mar 16 14:28:42 PST 2004
// Added method, PopulateIOInformation
//
// Hank Childs, Mon Aug 16 16:22:56 PDT 2004
// Allow for the domain to be set.
//
// ****************************************************************************
class DATABASE_API avtMTSDFileFormat : public avtFileFormat
......@@ -64,6 +67,8 @@ class DATABASE_API avtMTSDFileFormat : public avtFileFormat
const char *type, void *args,
DestructorFunction &);
void SetDomain(int d) { myDomain = d; };
virtual void GetCycles(std::vector<int> &);
virtual void GetTimes(std::vector<double> &);
virtual int GetNTimesteps(void);
......@@ -81,6 +86,7 @@ class DATABASE_API avtMTSDFileFormat : public avtFileFormat
protected:
char **filenames;
int nFiles;
int myDomain;
int AddFile(const char *);
static const int MAX_FILES;
......
......@@ -30,6 +30,11 @@ using std::vector;
// Programmer: Hank Childs
// Creation: October 8, 2001
//
// Modifications:
//
// Hank Childs, Mon Aug 16 16:22:56 PDT 2004
// Tell each file format what its domain is.
//
// ****************************************************************************
avtMTSDFileFormatInterface::avtMTSDFileFormatInterface(avtMTSDFileFormat **lst,
......@@ -37,6 +42,14 @@ avtMTSDFileFormatInterface::avtMTSDFileFormatInterface(avtMTSDFileFormat **lst,
{
domains = lst;
nDomains = nLst;
for (int i = 0 ; i < nDomains ; i++)
{
if (lst[i] != NULL)
{
lst[i]->SetDomain(i);
}
}
}
......
......@@ -31,6 +31,9 @@ class avtMaterial;
// Made ExhangeVector into two methods to handle different underlying
// data types (int, float).
//
// Hank Childs, Sat Aug 14 06:41:00 PDT 2004
// Added ghost nodes.
//
// ****************************************************************************
class DATABASE_API avtDomainBoundaries
{
......@@ -59,6 +62,8 @@ class DATABASE_API avtDomainBoundaries
virtual vector<avtMixedVariable*> ExchangeMixVar(vector<int> domainNum,
const vector<avtMaterial*> mats,
vector<avtMixedVariable*> mixvars) =0;
virtual void CreateGhostNodes(vector<int> domainNum,
vector<vtkDataSet*> meshes) =0;
virtual bool ConfirmMesh(vector<int> domainNum,
vector<vtkDataSet*> meshes) =0;
};
......
......@@ -7,9 +7,11 @@
#include <vtkCellData.h>
#include <vtkFloatArray.h>
#include <vtkIntArray.h>
#include <vtkPointData.h>
#include <vtkRectilinearGrid.h>
#include <vtkStructuredGrid.h>
#include <avtGhostData.h>
#include <avtMaterial.h>
#include <avtMixedVariable.h>
......@@ -2378,6 +2380,105 @@ avtRectilinearDomainBoundaries::ExchangeMesh(vector<int> domainNum,
return out;
}
// ****************************************************************************
// Method: avtStructuredDomainBoundaries::CreateGhostNodes
//
// Purpose:
// Creates ghost nodes.
//
// Programmer: Hank Childs
// Creation: August 14, 2004
//
// ****************************************************************************
void
avtStructuredDomainBoundaries::CreateGhostNodes(vector<int> domainNum,
vector<vtkDataSet*> meshes)
{
vector<int> domain2proc = CreateDomainToProcessorMap(domainNum);
CreateCurrentDomainBoundaryInformation(domain2proc);
for (int i = 0 ; i < domainNum.size() ; i++)
{
int dom = domainNum[i];
Boundary *bi = &boundary[dom];
vtkDataSet *ds = meshes[i];
int npts = ds->GetNumberOfPoints();
vtkUnsignedCharArray *gn = vtkUnsignedCharArray::New();
gn->SetNumberOfTuples(npts);
gn->SetName("vtkGhostNodes");
unsigned char *gnp = gn->GetPointer(0);
for (int j = 0 ; j < npts ; j++)
gnp[j] = 0;
int dims[3];
dims[0] = bi->oldnextents[1] - bi->oldnextents[0] + 1;
dims[1] = bi->oldnextents[3] - bi->oldnextents[2] + 1;
dims[2] = bi->oldnextents[5] - bi->oldnextents[4] + 1;
if (bi->newnextents[0] < bi->oldnextents[0])
{
for (int k = 0 ; k < dims[2] ; k++)
for (int j = 0 ; j < dims[1] ; j++)
{
int idx = 0 + j*dims[0] + k*dims[0]*dims[1];
avtGhostData::AddGhostNodeType(gnp[idx], DUPLICATED_NODE);
}
}
if (bi->newnextents[1] > bi->oldnextents[1])
{
for (int k = 0 ; k < dims[2] ; k++)
for (int j = 0 ; j < dims[1] ; j++)
{
int idx = dims[0]-1 + j*dims[0] + k*dims[0]*dims[1];
avtGhostData::AddGhostNodeType(gnp[idx], DUPLICATED_NODE);
}
}
if (bi->newnextents[2] < bi->oldnextents[2])
{
for (int k = 0 ; k < dims[2] ; k++)
for (int i = 0 ; i < dims[0] ; i++)
{
int idx = i + 0*dims[0] + k*dims[0]*dims[1];
avtGhostData::AddGhostNodeType(gnp[idx], DUPLICATED_NODE);
}
}
if (bi->newnextents[3] > bi->oldnextents[3])
{
for (int k = 0 ; k < dims[2] ; k++)
for (int i = 0 ; i < dims[0] ; i++)
{
int idx = i + (dims[1]-1)*dims[0] + k*dims[0]*dims[1];
avtGhostData::AddGhostNodeType(gnp[idx], DUPLICATED_NODE);
}
}
if (bi->newnextents[4] < bi->oldnextents[4])
{
for (int j = 0 ; j < dims[1] ; j++)
for (int i = 0 ; i < dims[0] ; i++)
{
int idx = i + j*dims[0] + 0*dims[0]*dims[1];
avtGhostData::AddGhostNodeType(gnp[idx], DUPLICATED_NODE);
}
}
if (bi->newnextents[5] > bi->oldnextents[5])
{
for (int j = 0 ; j < dims[1] ; j++)
for (int i = 0 ; i < dims[0] ; i++)
{
int idx = i + j*dims[0] + (dims[2]-1)*dims[0]*dims[1];
avtGhostData::AddGhostNodeType(gnp[idx], DUPLICATED_NODE);
}
}
ds->GetPointData()->AddArray(gn);
gn->Delete();
}
}
// ****************************************************************************
// Method: avtStructuredDomainBoundaries::SetIndicesForRectGrid
//
......
......@@ -161,6 +161,9 @@ class BoundaryHelperFunctions
// indicate this condition rather than sub-classing because the class
// hierarchy is more involved than was worth it.
//
// Hank Childs, Sat Aug 14 06:41:00 PDT 2004
// Added CreateGhostNodes.
//
// ****************************************************************************
class DATABASE_API avtStructuredDomainBoundaries : public avtDomainBoundaries
......@@ -200,6 +203,9 @@ class DATABASE_API avtStructuredDomainBoundaries : public avtDomainBoundaries
const vector<avtMaterial*> mats,
vector<avtMixedVariable*> mixvars);
virtual void CreateGhostNodes(vector<int> domainNum,
vector<vtkDataSet*> meshes);
virtual bool ConfirmMesh(vector<int> domainNum,
vector<vtkDataSet*> meshes);
......
// ************************************************************************* //
// avtUnstructuredDomainBoundaries.C //
// ************************************************************************* //
#include <avtUnstructuredDomainBoundaries.h>
#include <vtkCellData.h>
#include <vtkFloatArray.h>
#include <vtkIdList.h>
#include <vtkIntArray.h>
#include <vtkPointData.h>
#include <vtkUnsignedCharArray.h>
#include <vtkUnstructuredGrid.h>
#include <avtGhostData.h>
#include <avtMaterial.h>
#include <avtMixedVariable.h>
......@@ -1468,3 +1473,53 @@ avtUnstructuredDomainBoundaries::CommunicateDataInformation(
MPI_Barrier(MPI_COMM_WORLD);
#endif
}
// ****************************************************************************
// Method: avtUnstructuredDomainBoundaries::CreateGhostNodes
//
// Purpose:
// Creates ghost nodes.
//
// Programmer: Hank Childs
// Creation: August 16, 2004
//
// ****************************************************************************
void
avtUnstructuredDomainBoundaries::CreateGhostNodes(vector<int> domainNum,
vector<vtkDataSet*> meshes)
{
int i, j;
for (i = 0 ; i < domainNum.size() ; i++)
{
vtkDataSet *ds = meshes[i];
int npts = ds->GetNumberOfPoints();
vtkUnsignedCharArray *gn = vtkUnsignedCharArray::New();
gn->SetNumberOfTuples(npts);
gn->SetName("vtkGhostNodes");
unsigned char *gnp = gn->GetPointer(0);
for (j = 0 ; j < npts ; j++)
gnp[j] = 0;
for (j = 0 ; j < giveIndex.size() ; j++)
{
if (giveIndex[j].first != domainNum[i])
continue;
std::map<int,int> &thisMap = sharedPointsMap[giveIndex[j].first];
std::map<int,int>::iterator p = thisMap.begin();
for (p = thisMap.begin() ; p != thisMap.end() ; p++)
{
int node = (*p).first;
avtGhostData::AddGhostNodeType(gnp[node], DUPLICATED_NODE);
}
}
ds->GetPointData()->AddArray(gn);
gn->Delete();
}
}
......@@ -35,6 +35,11 @@ class avtMaterial;
// Programmer: Akira Haddox
// Creation: August 11, 2003
//
// Modifications:
//
// Hank Childs, Mon Aug 16 08:47:27 PDT 2004
// Added CreateGhostNodes.
//
// ****************************************************************************
class DATABASE_API avtUnstructuredDomainBoundaries : public avtDomainBoundaries
......@@ -77,6 +82,9 @@ class DATABASE_API avtUnstructuredDomainBoundaries : public avtDomainBoundaries
const vector<avtMaterial*> mats,
vector<avtMixedVariable*> mixvars);
virtual void CreateGhostNodes(vector<int> domainNum,
vector<vtkDataSet*> meshes);
virtual bool ConfirmMesh(vector<int> domainNum,
vector<vtkDataSet*> meshes);
......
......@@ -44,7 +44,7 @@ CXXFLAGS="-Wno-deprecated $CXXFLAGS"
## Add parallel arguments.
##
CXXFLAGS="-I/usr/lib/mpi/mpi_gnu/include $CXXFLAGS"
MPI_LIBS="-L/usr/lib/mpi/mpi_gn/lib -Wl,-rpath=/usr/lib/mpi/mpi_gnu/lib -lmpi -lelan -lelan3 -lrmscall"
MPI_LIBS="-L/usr/lib/mpi/mpi_gnu/lib -Wl,-rpath=/usr/lib/mpi/mpi_gnu/lib -lmpi -lelan -lelan3 -lrmscall"
##
## Database reader plugin support libraries
......
<?xml version="1.0"?>
<Plugin name="Dune" type="database" label="Dune" version="1.0" enabled="true" dbtype="MTSD" haswriter="false">
<Extensions>
Dat
</Extensions>
<Attribute name="" purpose="" persistent="false" exportAPI="" exportInclude="">
</Attribute>
</Plugin>
#include <DunePluginInfo.h>
#include <avtDuneFileFormat.h>
#include <avtMTSDFileFormatInterface.h>
#include <avtGenericDatabase.h>
// ****************************************************************************
// Method: DuneCommonPluginInfo::GetDatabaseType
//
// Purpose:
// Returns the type of a Dune database.
//
// Programmer: meredith -- generated by xml2info
// Creation: Mon Aug 23 14:39:28 PST 2004
//
// ****************************************************************************
DatabaseType
DuneCommonPluginInfo::GetDatabaseType()
{
return DB_TYPE_MTSD;
}
// ****************************************************************************
// Method: DuneCommonPluginInfo::GetDefaultExtensions
//
// Purpose:
// Returns the default extensions for a Dune database.
//
// Programmer: meredith -- generated by xml2info
// Creation: Mon Aug 23 14:39:28 PST 2004
//
// ****************************************************************************
std::vector<std::string>
DuneCommonPluginInfo::GetDefaultExtensions()
{
std::vector<std::string> defaultExtensions;
defaultExtensions.push_back("Dat");
return defaultExtensions;
}
// ****************************************************************************
// Method: DuneCommonPluginInfo::GetWriter
//
// Purpose:
// Sets up a Dune writer.
//
// Returns: A Dune writer.
//
// Programmer: meredith -- generated by xml2info
// Creation: Mon Aug 23 14:39:28 PST 2004
//
// ****************************************************************************
avtDatabaseWriter *
DuneCommonPluginInfo::GetWriter(void)
{
return NULL;
}
// ****************************************************************************
// Method: DuneCommonPluginInfo::SetUpDuneDatabase
//
// Purpose:
// Sets up a Dune database.
//
// Arguments:
// list A list of file names.
// nList The number of timesteps in list.
// nBlocks The number of blocks in the list.
//
// Returns: A Dune database from list.
//
// Programmer: meredith -- generated by xml2info
// Creation: Mon Aug 23 14:39:28 PST 2004
//
// ****************************************************************************
avtDatabase *
DuneCommonPluginInfo::SetupDatabase(const char *const *list,
int nList, int nBlock)
{
avtMTSDFileFormat **ffl = new avtMTSDFileFormat*[nList];
for (int i = 0 ; i < nList ; i++)
{
ffl[i] = new avtDuneFileFormat(list[i]);
}
avtMTSDFileFormatInterface *inter
= new avtMTSDFileFormatInterface(ffl, nList);
return new avtGenericDatabase(inter);
}
#include <DunePluginInfo.h>
#if defined(__APPLE__)
#define GetEngineInfo Dune_GetEngineInfo
#endif
// ****************************************************************************
// Function: GetEngineInfo
//
// Purpose:
// Return a new EnginePluginInfo for the Dune database.
//
// Programmer: meredith -- generated by xml2info
// Creation: Mon Aug 23 14:39:28 PST 2004
//
// ****************************************************************************
extern "C" EngineDatabasePluginInfo* GetEngineInfo()
{
return new DuneEnginePluginInfo;
}
// this makes compilers happy... remove if we ever have functions here
void DuneEnginePluginInfo::dummy()
{
}
#include <DunePluginInfo.h>
#if defined(__APPLE__)
#define GetMDServerInfo Dune_GetMDServerInfo
#endif
// ****************************************************************************
// Function: GetMDServerInfo
//
// Purpose:
// Return a new MDServerPluginInfo for the Dune database.
//
// Programmer: meredith -- generated by xml2info
// Creation: Mon Aug 23 14:39:28 PST 2004
//
// ****************************************************************************
extern "C" MDServerDatabasePluginInfo* GetMDServerInfo()
{
return new DuneMDServerPluginInfo;
}
// this makes compilers happy... remove if we ever have functions here
void DuneMDServerPluginInfo::dummy()
{
}
// ************************************************************************* //
// File: DunePluginInfo.C
// ************************************************************************* //
#include <DunePluginInfo.h>
#if defined(__APPLE__)
#define GetGeneralInfo Dune_GetGeneralInfo
#endif
// ****************************************************************************
// Function: GetGeneralInfo
//
// Purpose:
// Return a new GeneralPluginInfo for the Dune database.
//
// Programmer: meredith -- generated by xml2info
// Creation: Mon Aug 23 14:39:28 PST 2004
//
// ****************************************************************************
extern "C" GeneralDatabasePluginInfo* GetGeneralInfo()
{
return new DuneGeneralPluginInfo;
}
// ****************************************************************************
// Method: DuneGeneralPluginInfo::GetName
//
// Purpose:
// Return the name of the database plugin.
//
// Returns: A pointer to the name of the database plugin.
//
// Programmer: meredith -- generated by xml2info
// Creation: Mon Aug 23 14:39:28 PST 2004
//
// ****************************************************************************
char *
DuneGeneralPluginInfo::GetName() const
{
return "Dune";
}
// ****************************************************************************
// Method: DuneGeneralPluginInfo::GetVersion
//
// Purpose: