Commit b1cea34a authored by Robert Maynard's avatar Robert Maynard
Browse files

Add in support for the Mili reader.

parent 94666e2b
#
# Find the native MILI includes and library
#
# MILI_INCLUDE_DIR - where to find MILI.h, etc.
# MILI_LIBRARIES - List of fully qualified libraries to link against when using MILI.
# MILI_FOUND - Do not attempt to use MILI if "no" or undefined.
FIND_PATH(MILI_INCLUDE_DIR MILIlib.h
/usr/local/include
/usr/include
)
FIND_LIBRARY(MILI_LIBRARY MILI
/usr/local/lib
/usr/lib
)
IF(MILI_INCLUDE_DIR)
IF(MILI_LIBRARY)
SET( MILI_LIBRARIES ${MILI_LIBRARY} )
SET( MILI_FOUND "YES" )
ENDIF(MILI_LIBRARY)
ENDIF(MILI_INCLUDE_DIR)
IF(MILI_FIND_REQUIRED AND NOT MILI_FOUND)
message(SEND_ERROR "Unable to find the requested MILI libraries.")
ENDIF(MILI_FIND_REQUIRED AND NOT MILI_FOUND)
MARK_AS_ADVANCED(
MILI_INCLUDE_DIR
MILI_LIBRARY
)
\ No newline at end of file
......@@ -193,6 +193,13 @@ if(CGNS_FOUND)
set(VISITBRIDGE_USE_CGNS ${CGNS_FOUND} PARENT_SCOPE)
endif(CGNS_FOUND)
# Setup Mili
find_package(MILI)
if(MILI_FOUND)
set(HAVE_LIBMILI ${MILI_FOUND})
set(VISITBRIDGE_USE_MILI ${MILI_FOUND} PARENT_SCOPE)
endif(MILI_FOUND)
#setup zlib
include_directories(${VTK_ZLIB_INCLUDE_DIRS})
......
SET(HAVE_LIBSILO "@HAVE_LIBSILO@")
SET(HAVE_LIBCGNS "@HAVE_LIBCGNS@")
SET(HAVE_LIBMILI "@HAVE_LIBMILI@")
#Setup the use file for VisIt
SET(VISITBRIDGE_INCLUDE_DIRS "@VISITBRIDGE_INCLUDE_DIRS@")
......
......@@ -105,6 +105,18 @@ if(VISIT_BUILD_READER_CGNS)
endif(NOT CGNS_FOUND)
endif(VISIT_BUILD_READER_CGNS)
VISIT_INCLUDE_READER_SOURCE(Mili OFF)
if(VISIT_BUILD_READER_Mili)
if(NOT HAVE_LIBMILI)
#if we currently don't have silo setup make it required
find_package(MILI REQUIRED)
endif(NOT HAVE_LIBMILI)
if(NOT MILI_FOUND)
message(FATAL_ERROR "Unable to locate Mili library.")
endif(NOT MILI_FOUND)
endif(VISIT_BUILD_READER_Mili)
#currently needs more work
#if ( HAVE_LIBNETCDF )
#VISIT_INCLUDE_READER_SOURCE(NETCDF)
......@@ -169,6 +181,10 @@ if(HAVE_LIBCGNS AND VISIT_BUILD_READER_CGNS)
target_link_libraries(vtk${KIT} ${CGNS_LIBRARY})
endif(HAVE_LIBCGNS AND VISIT_BUILD_READER_CGNS)
if(HAVE_LIBMILI AND VISIT_BUILD_READER_Mili)
target_link_libraries(vtk${KIT} ${MILI_LIBRARY})
endif(HAVE_LIBMILI AND VISIT_BUILD_READER_Mili)
#Install
#-------------------------------------------------------------------------------------------------
VISIT_INSTALL_TARGETS(vtk${KIT})
set(SOURCES
avtMiliFileFormat.C
)
ADD_VISIT_READER(VisItMiliReader "1.0"
VISIT_READER_TYPE "MTMD"
VISIT_READER_NAME "avtMiliFileFormat"
SERVER_SOURCES ${SOURCES}
)
<?xml version="1.0"?>
<Plugin name="Mili" type="database" label="Mili" version="1.0" dbtype="MTMD">
<CXXFLAGS>
${MILI_INCLUDE_DIR}
</CXXFLAGS>
<LDFLAGS>
${MILI_LIBRARY_DIR}
</LDFLAGS>
<LIBS>
${MILI_LIB}
</LIBS>
<FilePatterns>
*.mili
*.m
</FilePatterns>
<Attribute name="" purpose="" persistent="false" exportAPI="" exportInclude="">
</Attribute>
</Plugin>
/*****************************************************************************
*
* Copyright (c) 2000 - 2010, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-400124
* 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 <MiliPluginInfo.h>
#include <avtMiliFileFormat.h>
#include <avtMTMDFileFormatInterface.h>
#include <avtGenericDatabase.h>
// ****************************************************************************
// Method: MiliCommonPluginInfo::GetDatabaseType
//
// Purpose:
// Returns the type of a Mili database.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
DatabaseType
MiliCommonPluginInfo::GetDatabaseType()
{
return DB_TYPE_MTMD;
}
// ****************************************************************************
// Method: MiliCommonPluginInfo::SetupDatabase
//
// Purpose:
// Sets up a Mili 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 Mili database from list.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
avtDatabase *
MiliCommonPluginInfo::SetupDatabase(const char *const *list,
int nList, int nBlock)
{
// ignore any nBlocks past 1
int nTimestepGroups = nList / nBlock;
avtMTMDFileFormat **ffl = new avtMTMDFileFormat*[nTimestepGroups];
for (int i = 0 ; i < nTimestepGroups ; i++)
{
ffl[i] = new avtMiliFileFormat(list[i*nBlock]);
}
avtMTMDFileFormatInterface *inter
= new avtMTMDFileFormatInterface(ffl, nTimestepGroups);
return new avtGenericDatabase(inter);
}
/*****************************************************************************
*
* Copyright (c) 2000 - 2010, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-400124
* 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 <MiliPluginInfo.h>
// ****************************************************************************
// Function: GetEngineInfo
//
// Purpose:
// Return a new EnginePluginInfo for the Mili database.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
extern "C" DBP_EXPORT EngineDatabasePluginInfo* Mili_GetEngineInfo()
{
return new MiliEnginePluginInfo;
}
// ****************************************************************************
// Method: MiliEnginePluginInfo::GetWriter
//
// Purpose:
// Sets up a Mili writer.
//
// Returns: A Mili writer.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
avtDatabaseWriter *
MiliEnginePluginInfo::GetWriter(void)
{
return NULL;
}
/*****************************************************************************
*
* Copyright (c) 2000 - 2010, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-400124
* 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 <MiliPluginInfo.h>
// ****************************************************************************
// Function: GetMDServerInfo
//
// Purpose:
// Return a new MDServerPluginInfo for the Mili database.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
extern "C" DBP_EXPORT MDServerDatabasePluginInfo* Mili_GetMDServerInfo()
{
return new MiliMDServerPluginInfo;
}
// this makes compilers happy... remove if we ever have functions here
void MiliMDServerPluginInfo::dummy()
{
}
/*****************************************************************************
*
* Copyright (c) 2000 - 2010, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-400124
* 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: MiliPluginInfo.C
// ************************************************************************* //
#include <MiliPluginInfo.h>
#include <visit-config.h>
extern "C" DBP_EXPORT const char *MiliVisItPluginVersion = VISIT_VERSION;
// ****************************************************************************
// Function: GetGeneralInfo
//
// Purpose:
// Return a new GeneralPluginInfo for the Mili database.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
extern "C" DBP_EXPORT GeneralDatabasePluginInfo* Mili_GetGeneralInfo()
{
return new MiliGeneralPluginInfo;
}
// ****************************************************************************
// Method: MiliGeneralPluginInfo::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 *
MiliGeneralPluginInfo::GetName() const
{
return "Mili";
}
// ****************************************************************************
// Method: MiliGeneralPluginInfo::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 *
MiliGeneralPluginInfo::GetVersion() const
{
return "1.0";
}
// ****************************************************************************
// Method: MiliGeneralPluginInfo::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 *
MiliGeneralPluginInfo::GetID() const
{
return "Mili_1.0";
}
// ****************************************************************************
// Method: MiliGeneralPluginInfo::EnabledByDefault
//
// Purpose:
// Return true if this plugin should be enabled by default; false otherwise.
//
// Returns: true/false
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
bool
MiliGeneralPluginInfo::EnabledByDefault() const
{
return true;
}
// ****************************************************************************
// Method: MiliGeneralPluginInfo::HasWriter
//
// Purpose:
// Return true if this plugin has a database writer.
//
// Returns: true/false
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
bool
MiliGeneralPluginInfo::HasWriter() const
{
return false;
}
// ****************************************************************************
// Method: MiliGeneralPluginInfo::GetDefaultFilePatterns
//
// Purpose:
// Returns the default patterns for a Mili database.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
std::vector<std::string>
MiliGeneralPluginInfo::GetDefaultFilePatterns() const
{
std::vector<std::string> defaultPatterns;
defaultPatterns.push_back("*.mili");
defaultPatterns.push_back("*.m");
return defaultPatterns;
}
// ****************************************************************************
// Method: MiliGeneralPluginInfo::AreDefaultFilePatternsStrict
//
// Purpose:
// Returns if the file patterns for a Mili database are
// intended to be interpreted strictly by default.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
bool
MiliGeneralPluginInfo::AreDefaultFilePatternsStrict() const
{
return false;
}
// ****************************************************************************
// Method: MiliGeneralPluginInfo::OpensWholeDirectory
//
// Purpose:
// Returns if the Mili plugin opens a whole directory name
// instead of a single file.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
bool
MiliGeneralPluginInfo::OpensWholeDirectory() const
{
return false;
}
/*****************************************************************************
*
* Copyright (c) 2000 - 2010, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-400124
* 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.
*
*****************************************************************************/
// ****************************************************************************
// MiliPluginInfo.h
// ****************************************************************************
#ifndef MILI_PLUGIN_INFO_H
#define MILI_PLUGIN_INFO_H
#include <DatabasePluginInfo.h>
#include <database_plugin_exports.h>
class avtDatabase;
class avtDatabaseWriter;
// ****************************************************************************
// Class: MiliDatabasePluginInfo
//
// Purpose:
// Classes that provide all the information about the Mili plugin.
// Portions are separated into pieces relevant to the appropriate
// components of VisIt.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// Modifications:
//
// ****************************************************************************
class MiliGeneralPluginInfo : 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> GetDefaultFilePatterns() const;
virtual bool AreDefaultFilePatternsStrict() const;
virtual bool OpensWholeDirectory() const;
};
class MiliCommonPluginInfo : public virtual CommonDatabasePluginInfo, public virtual MiliGeneralPluginInfo
{
public: