Updates will be applied on October 27th between 12pm - 12:45pm EDT (UTC-0400). Gitlab may be slow during the maintenance window.

Commit ad8183ee authored by Dan Lipsa's avatar Dan Lipsa
Browse files

Add Boxlib2D and Boxlib3D readers to VisItBridge.

parent 93a5c45a
Pipeline #39528 passed with stage
# Try to find BoxLib library and headers.
# This file sets the following variables:
#
# BoxLib_INCLUDE_DIR, where to find BoxLib.H, etc.
# BoxLib_LIBRARIES, the libraries to link against
# BoxLib_FOUND, If false, do not try to use BoxLib.
#
# Also defined, but not for general use are:
# BoxLib_LIBRARY, the full path to the BoxLib library.
# BoxLib_INCLUDE_PATH, for CMake backward compatibility
FIND_PATH( BoxLib_INCLUDE_DIR BoxLib.H
/usr/local/include
/usr/include
)
FIND_LIBRARY( BoxLib_LIBRARY NAMES cboxlib
/usr/lib
/usr/local/lib
)
SET( BoxLib_FOUND "NO" )
IF(BoxLib_INCLUDE_DIR)
IF(BoxLib_LIBRARY)
SET( BoxLib_LIBRARIES ${BoxLib_LIBRARY})
SET( BoxLib_FOUND "YES" )
#The following deprecated settings are for backwards compatibility with CMake1.4
SET (BoxLib_INCLUDE_PATH ${BoxLib_INCLUDE_DIR})
ELSE()
IF(BoxLib_FIND_REQUIRED)
message(SEND_ERROR "Unable to find the requested BoxLib libraries.")
ENDIF()
ENDIF()
ENDIF()
# handle the QUIETLY and REQUIRED arguments and set BoxLib_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(BoxLib DEFAULT_MSG BoxLib_LIBRARY BoxLib_INCLUDE_DIR)
MARK_AS_ADVANCED(
BoxLib_INCLUDE_DIR
BoxLib_LIBRARY
BoxLib_DIR
)
# Try to find GFortran libraries.
# This file sets the following variables:
#
# GFORTRAN_LIBRARIES, the libraries to link against
# GFORTRAN_FOUND, If false, do not try to use GFORTRAN
find_library(gfortran_LIBRARY NAMES gfortran
PATHS
/usr/lib
/usr/local/lib
PATH_SUFFIXES
gcc/x86_64-linux-gnu/5/
)
if (gfortran_LIBRARY)
set(GFortran_LIBRARIES ${gfortran_LIBRARY})
endif()
find_library(quadmath_LIBRARY NAMES quadmath
PATHS
/usr/lib
/usr/local/lib
PATH_SUFFIXES
gcc/x86_64-linux-gnu/5/
)
if (quadmath_LIBRARY)
list(APPEND GFortran_LIBRARIES ${quadmath_LIBRARY})
endif()
# handle the QUIETLY and REQUIRED arguments and set GFortran_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GFortran DEFAULT_MSG gfortran_LIBRARY quadmath_LIBRARY)
MARK_AS_ADVANCED(
gfortran_LIBRARY
quadmath_LIBRARY
)
......@@ -297,16 +297,27 @@ int vtkAvtSTMDFileFormatAlgorithm::FillAMR(
//determine the number of grids on each level of the AMR
//and initialize the amr
intVector gids = meshMetaData->groupIds;
int *numDataSets = new int[ numGroups ];
for ( int i=0; i < numGroups; ++i)
{
numDataSets[i] = 0; //clear the array
}
//count the grids at each level
for ( int i=0; i < gids.size(); ++i )
intVector groupIdsBasedOnRange = meshMetaData->groupIdsBasedOnRange;
if (groupIdsBasedOnRange.size() > 0)
{
++numDataSets[gids.at(i)];
for (int i = 0; i < groupIdsBasedOnRange.size() - 1; ++i)
{
numDataSets[i] = groupIdsBasedOnRange[i+1] - groupIdsBasedOnRange[i];
}
}
else
{
//count the grids at each level
intVector gids = meshMetaData->groupIds;
for ( int i=0; i < gids.size(); ++i )
{
++numDataSets[gids.at(i)];
}
}
ghostedAMR->Initialize(numGroups, numDataSets);
......
#include "../Boxlib3D/BoxLibHelper.C"
#include "../BoxLib3D/BoxLibHelper.h"
<?xml version="1.0"?>
<Plugin name="Boxlib2D" type="database" label="Boxlib2D" version="1.0" enabled="true" mdspecificcode="false" engspecificcode="false" onlyengine="false" noengine="false" dbtype="STMD" haswriter="false" hasoptions="false" filePatternsStrict="true">
<CXXFLAGS>
-DBL_SPACEDIM=2
${BOXLIB_INCLUDE_DIR}
</CXXFLAGS>
<LDFLAGS>
${BOXLIB_LIBRARY_DIR}
</LDFLAGS>
<LIBS>
${BOXLIB_2D_LIB}
</LIBS>
<FilePatterns>
*.boxlib2d
Header
</FilePatterns>
<Files components="M">
avtBoxlibFileFormat.C
BoxLibHelper.C
</Files>
<Files components="E">
avtBoxlibFileFormat.C
BoxLibHelper.C
</Files>
<Attribute name="" purpose="" persistent="false" keyframe="true" exportAPI="" exportInclude="">
</Attribute>
</Plugin>
/*****************************************************************************
*
* Copyright (c) 2000 - 2013, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-442911
* 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 <Boxlib2DPluginInfo.h>
#include <avtBoxlib2DFileFormat.h>
#include <avtSTMDFileFormatInterface.h>
#include <avtGenericDatabase.h>
// ****************************************************************************
// Method: Boxlib2DCommonPluginInfo::GetDatabaseType
//
// Purpose:
// Returns the type of a Boxlib2D database.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
DatabaseType
Boxlib2DCommonPluginInfo::GetDatabaseType()
{
return DB_TYPE_STMD;
}
// ****************************************************************************
// Method: Boxlib2DCommonPluginInfo::SetupDatabase
//
// Purpose:
// Sets up a Boxlib2D 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 Boxlib2D database from list.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
avtDatabase *
Boxlib2DCommonPluginInfo::SetupDatabase(const char *const *list,
int nList, int nBlock)
{
avtSTMDFileFormat **ffl = new avtSTMDFileFormat*[nList];
for (int i = 0 ; i < nList ; i++)
{
ffl[i] = new avtBoxlib2DFileFormat(list[i]);
}
avtSTMDFileFormatInterface *inter
= new avtSTMDFileFormatInterface(ffl, nList);
return new avtGenericDatabase(inter);
}
/*****************************************************************************
*
* Copyright (c) 2000 - 2013, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-442911
* 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 <Boxlib2DPluginInfo.h>
// ****************************************************************************
// Function: GetEngineInfo
//
// Purpose:
// Return a new EnginePluginInfo for the Boxlib2D database.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
extern "C" DBP_EXPORT EngineDatabasePluginInfo* Boxlib2D_GetEngineInfo()
{
return new Boxlib2DEnginePluginInfo;
}
// ****************************************************************************
// Method: Boxlib2DEnginePluginInfo::GetWriter
//
// Purpose:
// Sets up a Boxlib2D writer.
//
// Returns: A Boxlib2D writer.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
avtDatabaseWriter *
Boxlib2DEnginePluginInfo::GetWriter(void)
{
return NULL;
}
/*****************************************************************************
*
* Copyright (c) 2000 - 2013, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-442911
* 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 <Boxlib2DPluginInfo.h>
// ****************************************************************************
// Function: GetMDServerInfo
//
// Purpose:
// Return a new MDServerPluginInfo for the Boxlib2D database.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
extern "C" DBP_EXPORT MDServerDatabasePluginInfo* Boxlib2D_GetMDServerInfo()
{
return new Boxlib2DMDServerPluginInfo;
}
// this makes compilers happy... remove if we ever have functions here
void Boxlib2DMDServerPluginInfo::dummy()
{
}
/*****************************************************************************
*
* Copyright (c) 2000 - 2013, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-442911
* 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: Boxlib2DPluginInfo.C
// ************************************************************************* //
#include <Boxlib2DPluginInfo.h>
#include <visit-config.h>
VISIT_PLUGIN_VERSION(Boxlib2D,DBP_EXPORT)
// ****************************************************************************
// Function: GetGeneralInfo
//
// Purpose:
// Return a new GeneralPluginInfo for the Boxlib2D database.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
extern "C" DBP_EXPORT GeneralDatabasePluginInfo* Boxlib2D_GetGeneralInfo()
{
return new Boxlib2DGeneralPluginInfo;
}
// ****************************************************************************
// Method: Boxlib2DGeneralPluginInfo::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 *
Boxlib2DGeneralPluginInfo::GetName() const
{
return "Boxlib2D";
}
// ****************************************************************************
// Method: Boxlib2DGeneralPluginInfo::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 *
Boxlib2DGeneralPluginInfo::GetVersion() const
{
return "1.0";
}
// ****************************************************************************
// Method: Boxlib2DGeneralPluginInfo::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 *
Boxlib2DGeneralPluginInfo::GetID() const
{
return "Boxlib2D_1.0";
}
// ****************************************************************************
// Method: Boxlib2DGeneralPluginInfo::EnabledByDefault
//
// Purpose:
// Return true if this plugin should be enabled by default; false otherwise.
//
// Returns: true/false
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
bool
Boxlib2DGeneralPluginInfo::EnabledByDefault() const
{
return true;
}
// ****************************************************************************
// Method: Boxlib2DGeneralPluginInfo::HasWriter
//
// Purpose:
// Return true if this plugin has a database writer.
//
// Returns: true/false
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
bool
Boxlib2DGeneralPluginInfo::HasWriter() const
{
return false;
}
// ****************************************************************************
// Method: Boxlib2DGeneralPluginInfo::GetDefaultFilePatterns
//
// Purpose:
// Returns the default patterns for a Boxlib2D database.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
std::vector<std::string>
Boxlib2DGeneralPluginInfo::GetDefaultFilePatterns() const
{
std::vector<std::string> defaultPatterns;
defaultPatterns.push_back("*.boxlib2d");
defaultPatterns.push_back("Header");
return defaultPatterns;
}
// ****************************************************************************
// Method: Boxlib2DGeneralPluginInfo::AreDefaultFilePatternsStrict
//
// Purpose:
// Returns if the file patterns for a Boxlib2D database are
// intended to be interpreted strictly by default.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
bool
Boxlib2DGeneralPluginInfo::AreDefaultFilePatternsStrict() const
{
return true;
}
// ****************************************************************************
// Method: Boxlib2DGeneralPluginInfo::OpensWholeDirectory
//
// Purpose:
// Returns if the Boxlib2D plugin opens a whole directory name
// instead of a single file.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
bool
Boxlib2DGeneralPluginInfo::OpensWholeDirectory() const
{
return false;
}
/*****************************************************************************
*
* Copyright (c) 2000 - 2013, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-442911
* 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.