Commit c33d71cf authored by hrchilds's avatar hrchilds

Update from September 8, 2006

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@728 18c085ea-50e0-402c-830e-de6fd14e8384
parent acd88a8e
......@@ -63,6 +63,9 @@
// Hank Childs, Fri Jul 28 09:44:24 PDT 2006
// Added CylindricalExecute.
//
// Dave Bremer, Thu Sep 7 16:38:28 PDT 2006
// Added accessor for line parameters.
//
// ****************************************************************************
class AVTFILTERS_API avtLineScanFilter : public avtStreamer
......@@ -80,6 +83,8 @@ class AVTFILTERS_API avtLineScanFilter : public avtStreamer
virtual void RefashionDataObjectInfo(void);
virtual void SetRandomSeed(int s) { seed = s; };
virtual const double *GetLines() const { return lines; }
protected:
int nLines;
int seed;
......
......@@ -168,6 +168,9 @@
# Hank Childs, Mon Aug 28 16:55:05 PDT 2006
# Added avtPartialWeightedLineSegmentDistributionQuery.
#
# Dave Bremer, Thu Sep 7 16:15:12 PDT 2006
# Added line scan transform query.
#
##############################################################################
@SET_MAKE@
......@@ -224,6 +227,7 @@ Queries_src= \
Queries/avtIntegrateQuery.C \
Queries/avtKurtosisQuery.C \
Queries/avtLineScanQuery.C \
Queries/avtLineScanTransformQuery.C \
Queries/avtL2NormQuery.C \
Queries/avtL2NormBetweenCurvesQuery.C \
Queries/avtLocalizedCompactnessFactorQuery.C \
......
......@@ -60,6 +60,7 @@
#include <avtIntegrateQuery.h>
#include <avtL2NormQuery.h>
#include <avtL2NormBetweenCurvesQuery.h>
#include <avtLineScanTransformQuery.h>
#include <avtLocalizedCompactnessFactorQuery.h>
#include <avtKurtosisQuery.h>
#include <avtMassDistributionQuery.h>
......@@ -228,6 +229,9 @@ avtQueryFactory::Instance()
// Added aggregate and individual variants of chord and ray length
// distributions.
//
// Dave Bremer, Thu Sep 7 16:16:41 PDT 2006
// Added line scan transform query.
//
// ****************************************************************************
......@@ -285,6 +289,15 @@ avtQueryFactory::CreateQuery(const QueryAttributes *qa)
{
query = new avtL2NormQuery();
}
else if (qname == "Line Scan Transform")
{
avtLineScanTransformQuery *lst =
new avtLineScanTransformQuery();
lst->SetNumberOfLines(qa->GetElement()); // Element == intarg1
lst->SetNumberOfBins(qa->GetDomain()); // Domain == intarg2
lst->SetRange(qa->GetDarg1(), qa->GetDarg2());
query = lst;
}
else if (qname == "Chord Length Distribution (aggregate)")
{
avtAggregateChordLengthDistributionQuery *cldq =
......
......@@ -361,7 +361,10 @@ avtLineScanQuery::Execute(vtkDataSet *ds, const int chunk)
//
// Hank Childs, Tue Sep 5 11:40:33 PDT 2006
// Reset the time out so that queries can take longer than ten minutes.
//
//
// Dave Bremer, Thu Sep 7 16:43:27 PDT 2006
// Set the lines member.
//
// ****************************************************************************
void
......@@ -400,10 +403,12 @@ avtLineScanQuery::Execute(avtDataTree_p tree)
// Cause our artificial pipeline to execute.
//
filt.GetOutput()->Update(pspec);
lines = filt.GetLines();
avtDataset_p ds2 = filt.GetTypedOutput();
avtDataTree_p tree = ds2->GetDataTree();
ExecuteTree(tree);
lines = NULL;
//
// Reset the timeout for the next iteration.
......
......@@ -61,6 +61,11 @@ class vtkIntArray;
// Programmer: Hank Childs
// Creation: August 2, 2006
//
// Modifications:
// Dave Bremer, Thu Sep 7 17:44:25 PDT 2006
// Added lines member as a way to give base classes access to the
// line parameters during the Execute call.
//
// ****************************************************************************
class QUERY_API avtLineScanQuery : public avtDatasetQuery
......@@ -88,6 +93,8 @@ class QUERY_API avtLineScanQuery : public avtDatasetQuery
int numLinesPerIteration;
std::string varname;
const double *lines; //Set only during Execute. Stores data for use by base classes.
virtual void PreExecute(void);
virtual void Execute(vtkDataSet *, int);
......
This diff is collapsed.
/*****************************************************************************
*
* Copyright (c) 2000 - 2006, The Regents of the University of California
* Produced at the Lawrence Livermore National Laboratory
* All rights reserved.
*
* This file is part of VisIt. For details, see http://www.llnl.gov/visit/. The
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the disclaimer (as noted below) in the
* documentation and/or materials provided with the distribution.
* - Neither the name of the UC/LLNL nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OF THE UNIVERSITY OF
* CALIFORNIA, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*****************************************************************************/
// ************************************************************************* //
// avtLineScanTransformQuery.h //
// ************************************************************************* //
#ifndef AVT_LINE_SCAN_TRANSFORM_QUERY_H
#define AVT_LINE_SCAN_TRANSFORM_QUERY_H
#include <query_exports.h>
#include <avtLineScanQuery.h>
// ****************************************************************************
// Class: avtDistanceFromBoundaryQuery
//
// Purpose:
// A query that calculates a probability density function of where the
// mass lies.
//
// Programmer: David Bremer
// Creation: August 8, 2006
//
// ****************************************************************************
class QUERY_API avtLineScanTransformQuery : public avtLineScanQuery
{
public:
avtLineScanTransformQuery();
virtual ~avtLineScanTransformQuery();
virtual const char *GetType(void)
{ return "avtLineScanTransformQuery"; };
virtual const char *GetDescription(void)
{ return "Calculating the line scan transform."; };
protected:
double *lengths;
int numLineIntersections;
virtual void PreExecute(void);
virtual void PostExecute(void);
virtual void ExecuteLineScan(vtkPolyData *);
// void WalkLine(int startPtId, int endPtId, vtkPolyData *output,
// vtkIntArray *lineids, int lineid, vtkDataArray *arr);
};
#endif
<?xml version="1.0"?>
<Plugin name="Fluent" type="database" label="Fluent" version="1.0" enabled="true" mdspecificcode="false" onlyengine="false" noengine="false" dbtype="STMD" haswriter="false" hasoptions="false">
<Extensions>
cas
</Extensions>
<Attribute name="" purpose="" persistent="true" exportAPI="" exportInclude="">
</Attribute>
</Plugin>
#include <FluentPluginInfo.h>
#include <avtFluentFileFormat.h>
#include <avtSTMDFileFormatInterface.h>
#include <avtGenericDatabase.h>
// ****************************************************************************
// Method: FluentCommonPluginInfo::GetDatabaseType
//
// Purpose:
// Returns the type of a Fluent database.
//
// Programmer: bdotson -- generated by xml2info
// Creation: Thu Jul 20 14:14:06 PST 2006
//
// ****************************************************************************
DatabaseType
FluentCommonPluginInfo::GetDatabaseType()
{
return DB_TYPE_STMD;
}
// ****************************************************************************
// Method: FluentCommonPluginInfo::GetDefaultExtensions
//
// Purpose:
// Returns the default extensions for a Fluent database.
//
// Programmer: bdotson -- generated by xml2info
// Creation: Thu Jul 20 14:14:06 PST 2006
//
// ****************************************************************************
std::vector<std::string>
FluentCommonPluginInfo::GetDefaultExtensions()
{
std::vector<std::string> defaultExtensions;
defaultExtensions.push_back("cas");
return defaultExtensions;
}
// ****************************************************************************
// Method: FluentCommonPluginInfo::SetupFluentDatabase
//
// Purpose:
// Sets up a Fluent 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 Fluent database from list.
//
// Programmer: bdotson -- generated by xml2info
// Creation: Thu Jul 20 14:14:06 PST 2006
//
// ****************************************************************************
avtDatabase *
FluentCommonPluginInfo::SetupDatabase(const char *const *list,
int nList, int nBlock)
{
avtSTMDFileFormat **ffl = new avtSTMDFileFormat*[nList];
for (int i = 0 ; i < nList ; i++)
{
ffl[i] = new avtFluentFileFormat(list[i]);
}
avtSTMDFileFormatInterface *inter
= new avtSTMDFileFormatInterface(ffl, nList);
return new avtGenericDatabase(inter);
}
#include <FluentPluginInfo.h>
#if defined(__APPLE__)
#define GetEngineInfo Fluent_GetEngineInfo
#endif
// ****************************************************************************
// Function: GetEngineInfo
//
// Purpose:
// Return a new EnginePluginInfo for the Fluent database.
//
// Programmer: bdotson -- generated by xml2info
// Creation: Thu Jul 20 14:14:06 PST 2006
//
// ****************************************************************************
extern "C" EngineDatabasePluginInfo* GetEngineInfo()
{
return new FluentEnginePluginInfo;
}
// ****************************************************************************
// Method: FluentCommonPluginInfo::GetWriter
//
// Purpose:
// Sets up a Fluent writer.
//
// Returns: A Fluent writer.
//
// Programmer: bdotson -- generated by xml2info
// Creation: Thu Jul 20 14:14:06 PST 2006
//
// ****************************************************************************
avtDatabaseWriter *
FluentEnginePluginInfo::GetWriter(void)
{
return NULL;
}
#include <FluentPluginInfo.h>
#if defined(__APPLE__)
#define GetMDServerInfo Fluent_GetMDServerInfo
#endif
// ****************************************************************************
// Function: GetMDServerInfo
//
// Purpose:
// Return a new MDServerPluginInfo for the Fluent database.
//
// Programmer: bdotson -- generated by xml2info
// Creation: Thu Jul 20 14:14:06 PST 2006
//
// ****************************************************************************
extern "C" MDServerDatabasePluginInfo* GetMDServerInfo()
{
return new FluentMDServerPluginInfo;
}
// this makes compilers happy... remove if we ever have functions here
void FluentMDServerPluginInfo::dummy()
{
}
// ************************************************************************* //
// File: FluentPluginInfo.C
// ************************************************************************* //
#include <FluentPluginInfo.h>
#include <visit-config.h>
#if defined(__APPLE__)
extern "C" const char *FluentVisItPluginVersion = VERSION;
#else
extern "C" const char *VisItPluginVersion = VERSION;
#endif
#if defined(__APPLE__)
#define GetGeneralInfo Fluent_GetGeneralInfo
#endif
// ****************************************************************************
// Function: GetGeneralInfo
//
// Purpose:
// Return a new GeneralPluginInfo for the Fluent database.
//
// Programmer: bdotson -- generated by xml2info
// Creation: Thu Jul 20 14:14:06 PST 2006
//
// ****************************************************************************
extern "C" GeneralDatabasePluginInfo* GetGeneralInfo()
{
return new FluentGeneralPluginInfo;
}
// ****************************************************************************
// Method: FluentGeneralPluginInfo::GetName
//
// Purpose:
// Return the name of the database plugin.
//
// Returns: A pointer to the name of the database plugin.
//
// Programmer: bdotson -- generated by xml2info
// Creation: Thu Jul 20 14:14:06 PST 2006
//
// ****************************************************************************
char *
FluentGeneralPluginInfo::GetName() const
{
return "Fluent";
}
// ****************************************************************************
// Method: FluentGeneralPluginInfo::GetVersion
//
// Purpose:
// Return the version of the database plugin.
//
// Returns: A pointer to the version of the database plugin.
//
// Programmer: bdotson -- generated by xml2info
// Creation: Thu Jul 20 14:14:06 PST 2006
//
// ****************************************************************************
char *
FluentGeneralPluginInfo::GetVersion() const
{
return "1.0";
}
// ****************************************************************************
// Method: FluentGeneralPluginInfo::GetID
//
// Purpose:
// Return the id of the database plugin.
//
// Returns: A pointer to the id of the database plugin.
//
// Programmer: bdotson -- generated by xml2info
// Creation: Thu Jul 20 14:14:06 PST 2006
//
// ****************************************************************************
char *
FluentGeneralPluginInfo::GetID() const
{
return "Fluent_1.0";
}
// ****************************************************************************
// Method: FluentGeneralPluginInfo::EnabledByDefault
//
// Purpose:
// Return true if this plugin should be enabled by default; false otherwise.
//
// Returns: true/false
//
// Programmer: bdotson -- generated by xml2info
// Creation: Thu Jul 20 14:14:06 PST 2006
//
// ****************************************************************************
bool
FluentGeneralPluginInfo::EnabledByDefault() const
{
return true;
}
// ****************************************************************************
// Method: FluentGeneralPluginInfo::HasWriter
//
// Purpose:
// Return true if this plugin has a database writer.
//
// Returns: true/false
//
// Programmer: bdotson -- generated by xml2info
// Creation: Thu Jul 20 14:14:06 PST 2006
//
// ****************************************************************************
bool
FluentGeneralPluginInfo::HasWriter() const
{
return false;
}
// ****************************************************************************
// FluentPluginInfo.h
// ****************************************************************************
#ifndef FLUENT_PLUGIN_INFO_H
#define FLUENT_PLUGIN_INFO_H
#include <DatabasePluginInfo.h>
#include <database_plugin_exports.h>
class avtDatabase;
class avtDatabaseWriter;
// ****************************************************************************
// Class: FluentDatabasePluginInfo
//
// Purpose:
// Classes that provide all the information about the Fluent plugin.
// Portions are separated into pieces relevant to the appropriate
// components of VisIt.
//
// Programmer: bdotson -- generated by xml2info
// Creation: Thu Jul 20 14:14:06 PST 2006
//
// Modifications:
//
// ****************************************************************************
class FluentGeneralPluginInfo : public virtual GeneralDatabasePluginInfo
{
public:
virtual char *GetName() const;
virtual char *GetVersion() const;
virtual char *GetID() const;
virtual bool EnabledByDefault() const;
virtual bool HasWriter() const;
};
class FluentCommonPluginInfo : public virtual CommonDatabasePluginInfo, public virtual FluentGeneralPluginInfo
{
public:
virtual DatabaseType GetDatabaseType();
virtual std::vector<std::string> GetDefaultExtensions();
virtual avtDatabase *SetupDatabase(const char * const *list,
int nList, int nBlock);
};
class FluentMDServerPluginInfo : public virtual MDServerDatabasePluginInfo, public virtual FluentCommonPluginInfo
{
public:
// this makes compilers happy... remove if we ever have functions here
virtual void dummy();
};
class FluentEnginePluginInfo : public virtual EngineDatabasePluginInfo, public virtual FluentCommonPluginInfo
{
public:
virtual avtDatabaseWriter *GetWriter(void);
};
#endif
This source diff could not be displayed because it is too large. You can view the blob instead.
// ************************************************************************* //
// avtFluentFileFormat.h //
// ************************************************************************* //
#ifndef AVT_Fluent_FILE_FORMAT_H
#define AVT_Fluent_FILE_FORMAT_H
#include <avtSTMDFileFormat.h>
#include <vector>
#include <string>
#include <map>
// Fluent plugin
#include <visitstream.h>
#include <iomanip.h>
#include <stdlib.h>
#include <sstream>
#include "vtkPoints.h"
#include "vtkTriangle.h"
#include "vtkTetra.h"
#include "vtkQuad.h"
#include "vtkHexahedron.h"
#include "vtkPyramid.h"
#include "vtkWedge.h"
#include "vtkConvexPointSet.h"
#include "vtkUnstructuredGrid.h"
#include "vtkDoubleArray.h"
using namespace std;
// ****************************************************************************
// Class: avtFluentFileFormat
//
// Purpose:
// Reads in Fluent files as a plugin to VisIt.
//
// Programmer: bdotson -- generated by xml2avt
// Creation: Fri Jun 30 15:02:33 PST 2006
//
// Modifications:
//
// Hank Childs, Fri Sep 8 14:30:04 PDT 2006
// Added methods HasInvariantMetaData and HasInvariantSIL on the advice
// of Terry Jordan.
//
// ****************************************************************************
class avtFluentFileFormat : public avtSTMDFileFormat
{
public:
avtFluentFileFormat(const char *);
virtual ~avtFluentFileFormat() {;};
virtual const char *GetType(void) { return "Fluent"; };
virtual void FreeUpResources(void);
virtual vtkDataSet *GetMesh(int, const char *);
virtual vtkDataArray *GetVar(int, const char *);
virtual vtkDataArray *GetVectorVar(int, const char *);
//Number of variables is dynamic
virtual bool HasInvariantMetaData(void) const
{ return false; };
//Number of Domains is dynamic
virtual bool HasInvariantSIL(void) const
{ return false; };
protected:
virtual void PopulateDatabaseMetaData(avtDatabaseMetaData *);
int OpenCaseFile(const char *filename);
int OpenDataFile(const char *filename);
int GetCaseChunk ();
void GetNumberOfCellZones();
int GetCaseIndex();
void LoadVariableNames();
int GetDataIndex();
int GetDataChunk();
void ParseCaseFile();
int GetDimension();
void GetLittleEndianFlag();
void GetNodesAscii();
void GetNodesSinglePrecision();
void GetNodesDoublePrecision();
void GetCellsAscii();
void GetCellsBinary();
void GetFacesAscii();
void GetFacesBinary();
void GetPeriodicShadowFacesAscii();
void GetPeriodicShadowFacesBinary();
void GetCellTreeAscii();
void GetCellTreeBinary();
void GetFaceTreeAscii();
void GetFaceTreeBinary();
void GetInterfaceFaceParentsAscii();
void GetInterfaceFaceParentsBinary();
void GetNonconformalGridInterfaceFaceInformationAscii();
void GetNonconformalGridInterfaceFaceInformationBinary();
void CleanCells();
void PopulateCellNodes();
int GetCaseBufferInt(int ptr);
float GetCaseBufferFloat(int ptr);
double GetCaseBufferDouble(int ptr);
void PopulateTriangleCell(int i);
void PopulateTetraCell(int i);
void PopulateQuadCell(int i);
void PopulateHexahedronCell(int i);
void PopulatePyramidCell(int i);
void PopulateWedgeCell(int i);
void PopulatePolyhedronCell(int i);
void ParseDataFile();
int GetDataBufferInt(int ptr);
float GetDataBufferFloat(int ptr);
double GetDataBufferDouble(int ptr);
void GetData(int dataType);
//
// Variables
//
ifstream FluentCaseFile;
ifstream FluentDataFile;
string CaseBuffer;
string DataBuffer;
vtkPoints *Points;
vtkTriangle *Triangle;
vtkTetra *Tetra;
vtkQuad *Quad;
vtkHexahedron *Hexahedron;
vtkPyramid *Pyramid;
vtkWedge *Wedge;
vtkConvexPointSet *ConvexPointSet;
struct Cell {
int type;
int zone;
vector<int> faces;
int parent;
int child;
vector<int> nodes;
};
struct Face {
int type;
int zone;
vector<int> nodes;
int c0;
int c1;
int periodicShadow;
int parent;
int child;
int interfaceFaceParent;
int interfaceFaceChild;
int ncgParent;
int ncgChild;
};
struct ScalarDataChunk {
int subsectionId;
int zoneId;
vector<double> scalarData;
};
struct VectorDataChunk {
int subsectionId;
int zoneId;
vector<double> iComponentData;
vector<double> jComponentData;
vector<double> kComponentData;
};
vector< Cell > Cells;