Commit bf793917 authored by brugger's avatar brugger

1) I deleted the Nek3D database reader since it has been superceded by the

   Nek5000 reader.

2) I applied a fix from Hank Childs for a bug in the contour filter, where
   it didn't specify a variable when it was getting an interval tree.  This
   resulted in it sometimes getting the wrong interval tree and producing
   incorrect results.  A specific example is when you create a pseudocolor
   plot of one variable and then apply an iso surface operator of another
   variable.



git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@7925 18c085ea-50e0-402c-830e-de6fd14e8384
parent 0a31030e
......@@ -240,6 +240,11 @@ avtContourFilter::~avtContourFilter()
// Hank Childs, Mon Jan 5 15:18:09 CST 2009
// Add a data selection.
//
// Eric Brugger, Fri Jul 24 10:59:44 PDT 2009
// Added the variable name to the call to GetMetaData()->GetDataExtents()
// so that it would get the correct interval tree. This fix was provided
// Hank Childs.
//
// ****************************************************************************
avtContract_p
......@@ -275,7 +280,7 @@ avtContourFilter::ModifyContract(avtContract_p in_contract)
//
// Get the interval tree of data extents.
//
avtIntervalTree *it = GetMetaData()->GetDataExtents();
avtIntervalTree *it = GetMetaData()->GetDataExtents(varname);
if (it != NULL && it->GetDimension() != 1)
{
debug1 << "The interval tree returned for the contour variable "
......
<?xml version="1.0"?>
<Plugin name="Nek3D" type="database" label="Nek3D" version="1.0" enabled="true" mdspecificcode="false" engspecificcode="false" onlyengine="false" noengine="false" dbtype="MTMD" haswriter="false" hasoptions="false">
<Extensions>
nek3d
nek2d
nek
</Extensions>
<Attribute name="" purpose="" persistent="true" keyframe="true" exportAPI="" exportInclude="">
</Attribute>
</Plugin>
/*****************************************************************************
*
* Copyright (c) 2000 - 2008, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-400142
* All rights reserved.
*
* This file is part of VisIt. For details, see https://visit.llnl.gov/. 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 other materials provided with the distribution.
* - Neither the name of the LLNS/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 LAWRENCE LIVERMORE NATIONAL SECURITY,
* LLC, 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.
*
*****************************************************************************/
#include <Nek3DPluginInfo.h>
#include <avtNek3DFileFormat.h>
#include <avtMTMDFileFormatInterface.h>
#include <avtGenericDatabase.h>
// ****************************************************************************
// Method: Nek3DCommonPluginInfo::GetDatabaseType
//
// Purpose:
// Returns the type of a Nek3D database.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
DatabaseType
Nek3DCommonPluginInfo::GetDatabaseType()
{
return DB_TYPE_MTMD;
}
// ****************************************************************************
// Method: Nek3DCommonPluginInfo::SetupDatabase
//
// Purpose:
// Sets up a Nek3D 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 Nek3D database from list.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
avtDatabase *
Nek3DCommonPluginInfo::SetupDatabase(const char *const *list,
int nList, int nBlock)
{
return new avtGenericDatabase(
new avtMTMDFileFormatInterface(
new avtNek3DFileFormat(list[0])));
}
/*****************************************************************************
*
* Copyright (c) 2000 - 2008, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-400142
* All rights reserved.
*
* This file is part of VisIt. For details, see https://visit.llnl.gov/. 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 other materials provided with the distribution.
* - Neither the name of the LLNS/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 LAWRENCE LIVERMORE NATIONAL SECURITY,
* LLC, 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.
*
*****************************************************************************/
#include <Nek3DPluginInfo.h>
#if defined(__APPLE__)
#define GetEngineInfo Nek3D_GetEngineInfo
#endif
// ****************************************************************************
// Function: GetEngineInfo
//
// Purpose:
// Return a new EnginePluginInfo for the Nek3D database.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
extern "C" DBP_EXPORT EngineDatabasePluginInfo* GetEngineInfo()
{
return new Nek3DEnginePluginInfo;
}
// ****************************************************************************
// Method: Nek3DEnginePluginInfo::GetWriter
//
// Purpose:
// Sets up a Nek3D writer.
//
// Returns: A Nek3D writer.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
avtDatabaseWriter *
Nek3DEnginePluginInfo::GetWriter(void)
{
return NULL;
}
/*****************************************************************************
*
* Copyright (c) 2000 - 2008, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-400142
* All rights reserved.
*
* This file is part of VisIt. For details, see https://visit.llnl.gov/. 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 other materials provided with the distribution.
* - Neither the name of the LLNS/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 LAWRENCE LIVERMORE NATIONAL SECURITY,
* LLC, 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.
*
*****************************************************************************/
#include <Nek3DPluginInfo.h>
#if defined(__APPLE__)
#define GetMDServerInfo Nek3D_GetMDServerInfo
#endif
// ****************************************************************************
// Function: GetMDServerInfo
//
// Purpose:
// Return a new MDServerPluginInfo for the Nek3D database.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
extern "C" DBP_EXPORT MDServerDatabasePluginInfo* GetMDServerInfo()
{
return new Nek3DMDServerPluginInfo;
}
// this makes compilers happy... remove if we ever have functions here
void Nek3DMDServerPluginInfo::dummy()
{
}
/*****************************************************************************
*
* Copyright (c) 2000 - 2008, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-400142
* All rights reserved.
*
* This file is part of VisIt. For details, see https://visit.llnl.gov/. 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 other materials provided with the distribution.
* - Neither the name of the LLNS/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 LAWRENCE LIVERMORE NATIONAL SECURITY,
* LLC, 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.
*
*****************************************************************************/
// ************************************************************************* //
// File: Nek3DPluginInfo.C
// ************************************************************************* //
#include <Nek3DPluginInfo.h>
#include <visit-config.h>
#if defined(__APPLE__)
extern "C" DBP_EXPORT const char *Nek3DVisItPluginVersion = VISIT_VERSION;
#else
extern "C" DBP_EXPORT const char *VisItPluginVersion = VISIT_VERSION;
#endif
#if defined(__APPLE__)
#define GetGeneralInfo Nek3D_GetGeneralInfo
#endif
// ****************************************************************************
// Function: GetGeneralInfo
//
// Purpose:
// Return a new GeneralPluginInfo for the Nek3D database.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
extern "C" DBP_EXPORT GeneralDatabasePluginInfo* GetGeneralInfo()
{
return new Nek3DGeneralPluginInfo;
}
// ****************************************************************************
// Method: Nek3DGeneralPluginInfo::GetName
//
// Purpose:
// Return the name of the database plugin.
//
// Returns: A pointer to the name of the database plugin.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
const char *
Nek3DGeneralPluginInfo::GetName() const
{
return "Nek3D";
}
// ****************************************************************************
// Method: Nek3DGeneralPluginInfo::GetVersion
//
// Purpose:
// Return the version of the database plugin.
//
// Returns: A pointer to the version of the database plugin.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
const char *
Nek3DGeneralPluginInfo::GetVersion() const
{
return "1.0";
}
// ****************************************************************************
// Method: Nek3DGeneralPluginInfo::GetID
//
// Purpose:
// Return the id of the database plugin.
//
// Returns: A pointer to the id of the database plugin.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
const char *
Nek3DGeneralPluginInfo::GetID() const
{
return "Nek3D_1.0";
}
// ****************************************************************************
// Method: Nek3DGeneralPluginInfo::EnabledByDefault
//
// Purpose:
// Return true if this plugin should be enabled by default; false otherwise.
//
// Returns: true/false
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
bool
Nek3DGeneralPluginInfo::EnabledByDefault() const
{
return true;
}
// ****************************************************************************
// Method: Nek3DGeneralPluginInfo::HasWriter
//
// Purpose:
// Return true if this plugin has a database writer.
//
// Returns: true/false
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
bool
Nek3DGeneralPluginInfo::HasWriter() const
{
return false;
}
// ****************************************************************************
// Method: Nek3DGeneralPluginInfo::GetDfltExtsFromGen
//
// Purpose:
// Returns the default extensions for a Nek3D database.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
std::vector<std::string>
Nek3DGeneralPluginInfo::GetDfltExtsFromGen() const
{
std::vector<std::string> defaultExtensions;
defaultExtensions.push_back("nek3d");
defaultExtensions.push_back("nek2d");
defaultExtensions.push_back("nek");
return defaultExtensions;
}
/*****************************************************************************
*
* Copyright (c) 2000 - 2008, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-400142
* All rights reserved.
*
* This file is part of VisIt. For details, see https://visit.llnl.gov/. 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 other materials provided with the distribution.
* - Neither the name of the LLNS/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 LAWRENCE LIVERMORE NATIONAL SECURITY,
* LLC, 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.
*
*****************************************************************************/
// ****************************************************************************
// Nek3DPluginInfo.h
// ****************************************************************************
#ifndef NEK3D_PLUGIN_INFO_H
#define NEK3D_PLUGIN_INFO_H
#include <DatabasePluginInfo.h>
#include <database_plugin_exports.h>
class avtDatabase;
class avtDatabaseWriter;
// ****************************************************************************
// Class: Nek3DDatabasePluginInfo
//
// Purpose:
// Classes that provide all the information about the Nek3D plugin.
// Portions are separated into pieces relevant to the appropriate
// components of VisIt.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// Modifications:
//
// ****************************************************************************
class Nek3DGeneralPluginInfo : public virtual GeneralDatabasePluginInfo
{
public:
virtual const char *GetName() const;
virtual const char *GetVersion() const;
virtual const char *GetID() const;
virtual bool EnabledByDefault() const;
virtual bool HasWriter() const;
virtual std::vector<std::string> GetDfltExtsFromGen() const;
};
class Nek3DCommonPluginInfo : public virtual CommonDatabasePluginInfo, public virtual Nek3DGeneralPluginInfo
{
public:
virtual DatabaseType GetDatabaseType();
virtual avtDatabase *SetupDatabase(const char * const *list,
int nList, int nBlock);
};
class Nek3DMDServerPluginInfo : public virtual MDServerDatabasePluginInfo, public virtual Nek3DCommonPluginInfo
{
public:
// this makes compilers happy... remove if we ever have functions here
virtual void dummy();
};
class Nek3DEnginePluginInfo : public virtual EngineDatabasePluginInfo, public virtual Nek3DCommonPluginInfo
{
public:
virtual avtDatabaseWriter *GetWriter(void);
};
#endif
This diff is collapsed.
/*****************************************************************************
*
* Copyright (c) 2000 - 2008, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-400142
* All rights reserved.
*
* This file is part of VisIt. For details, see https://visit.llnl.gov/. 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 other materials provided with the distribution.
* - Neither the name of the LLNS/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 LAWRENCE LIVERMORE NATIONAL SECURITY,
* LLC, 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.
*
*****************************************************************************/
// ************************************************************************* //
// avtNek3DFileFormat.h //
// ************************************************************************* //
#ifndef AVT_Nek3D_FILE_FORMAT_H
#define AVT_Nek3D_FILE_FORMAT_H
#include <avtMTMDFileFormat.h>
#include <map>
#include <vector>
// ****************************************************************************
// Class: avtNek3DFileFormat
//
// Purpose:
// Reads in Nek3D files as a plugin to VisIt.
//
// Programmer: dbremer -- generated by xml2avt
// Creation: Fri May 18 16:07:09 PST 2007
//
// Modifications:
// Dave Bremer, Wed Nov 7 12:27:33 PST 2007
// This reader previously supported 3D binary Nek files. Now it also
// handles 2D and ascii versions of Nek files.
//
// Dave Bremer, Wed Nov 14 15:00:13 PST 2007
// Added support for the parallel version of the file.
//
// Dave Bremer, Thu Nov 15 16:44:42 PST 2007
// Small fix for ascii format in case windows-style CRLF is used.
//
// Dave Bremer, Wed Feb 6 19:12:55 PST 2008
// Refactored the constructor, moving some functionality into
// other methods, and deferring some significant computation.
//
// Dave Bremer, Wed Apr 23 18:12:50 PDT 2008
// Implemented GetAuxiliaryData so I can read spatial extents.
//
// Dave Bremer, Tue May 13 19:51:04 CDT 2008
// Added PopulateIOInformation to give hints to improve IO patterns,
// but the info is currently not used.
//
// Dave Bremer, Fri Jun 6 15:38:45 PDT 2008
// Added the bParFormat flag allowing the parallel format to be used
// by a serial code, in which there is only one output dir.
//
// Dave Bremer, Thu Jun 12 12:59:23 PDT 2008
// Support varying numbers of blocks per file in the parallel format.
// The distribution of blocks is assumed to be constant over time.
//
// Dave Bremer, Mon Aug 11 13:53:18 PDT 2008
// Added a method to parse field tags in nek binary header files.
//
// Hank Childs, Sat Nov 8 14:33:30 PST 2008
// Cache the mesh from time slice to time slice.
//
// ****************************************************************************
class avtNek3DFileFormat : public avtMTMDFileFormat
{
public:
avtNek3DFileFormat(const char *);
virtual ~avtNek3DFileFormat();
//
// This is used to return unconventional data -- ranging from material
// information to information about block connectivity.
//
virtual void *GetAuxiliaryData(const char *var, int timestep,
int domain, const char *type, void *args,
DestructorFunction &);
virtual void PopulateIOInformation(int /*ts*/, avtIOInformation &ioInfo);
//
// If you know the times and cycle numbers, overload this function.
// Otherwise, VisIt will make up some reasonable ones for you.
//
virtual void GetCycles(std::vector<int> &);
virtual void GetTimes(std::vector<double> &);
virtual int GetNTimesteps(void);
virtual const char *GetType(void) { return "Nek3D"; }
virtual void FreeUpResources(void);
virtual vtkDataSet *GetMesh(int, int, const char *);
virtual vtkDataSet *ReadMesh(int);
virtual vtkDataArray *GetVar(int, int, const char *);
virtual vtkDataArray *GetVectorVar(int, int, const char *);
protected:
// This info is embedded in the .nek3d text file
// originally specified by Dave Bremer
std::map<int,vtkDataSet *> meshCache;
std::string version;
std::string fileTemplate;
int iFirstTimestep;
int iNumTimesteps;
bool bBinary; //binary or ascii
int iNumOutputDirs; //used in parallel format
bool bParFormat;
// This info is embedded in, or derived from, the file header
bool bSwapEndian;
int iNumBlocks;
int iBlockSize[3];
bool bHasVelocity;
bool bHasPressure;
bool bHasTemperature;
int iNumSFields;
int iHeaderSize;
int iDim;
int iPrecision; //4 or 8 for float or double
//only used in parallel binary
int * aBlocksPerFile;
// This info is distributed through all the dumps, and only
// computed on demand
std::vector<int> aCycles;
std::vector<double> aTimes;
std::vector<int> iTimestepsWithMesh;
// Cached data
FILE *fdMesh, *fdVar;
int iCurrTimestep; //which timestep is associated with fdVar
int iCurrMeshProc; //For parallel format, proc associated with fdMesh
int iCurrVarProc; //For parallel format, proc associated with fdVar
int iAsciiMeshFileStart; //For ascii data, file pos where data begins, in mesh file
int iAsciiCurrFileStart; //For ascii data, file pos where data begins, in current timestep
int iAsciiMeshFileLineLen; //For ascii data, length of each line, in mesh file
int iAsciiCurrFileLineLen; //For ascii data, length of each line, in current timestep
int *aBlockLocs; //For parallel format, make a table for looking up blocks.
//This has 2 ints per block, with proc # and local block #.
virtual void ParseMetaDataFile(const char *filename);
virtual void ParseNekFileHeader();
virtual void ParseFieldTags(ifstream &f);
virtual void ReadBlockLocations();
virtual void PopulateDatabaseMetaData(avtDatabaseMetaData *, int);
virtual void UpdateCyclesAndTimes();
virtual void GetDomainSizeAndVarOffset(int timestate, const char *var,
int &outDomSizeInFloats,
int &outVarOffsetInFloats,
int &outVarOffsetInBytes,
int &outTimestepHasMesh );
void ByteSwap32(void *aVals, int nVals);
void ByteSwap64(void *aVals, int nVals);
void FindAsciiDataStart(FILE *fd, int &outDataStart, int &outLineLen);
void GetFileName(int timestep, int pardir, char *outFileName, int bufSize);
};
#endif
Markdown is supported
0% or
You are about to add