diff --git a/CMakeLists.txt b/CMakeLists.txt index ec7420e0..2f055989 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,11 +28,13 @@ ENDIF() SET( CMAKE_CXX_EXTENSIONS OFF ) IF ( NOT CMAKE_CXX_STANDARD ) IF ( CXX_STD ) - MESSAGE( WARNING "CXX_STD is obsolete, please set CMAKE_CXX_STANDARD" ) - SET( CMAKE_CXX_STANDARD ${CXX_STD} ) + MESSAGE( FATAL_ERROR "CXX_STD is obsolete, please set CMAKE_CXX_STANDARD" ) ENDIF() SET( CMAKE_CXX_STANDARD 14 ) ENDIF() +IF ( ( "${CMAKE_CXX_STANDARD}" GREATER "90" ) OR ( "${CMAKE_CXX_STANDARD}" LESS "14" ) ) + MESSAGE( FATAL_ERROR "C++14 or newer required" ) +ENDIF() # Set source/install paths @@ -110,7 +112,7 @@ ENDIF() ADD_CUSTOM_TARGET( build-test ) ADD_CUSTOM_TARGET( build-examples ) ADD_CUSTOM_TARGET( check COMMAND make test ) -ADD_DISTCLEAN( analysis null_timer tests liblbpm-wia.* cpu gpu example common visit IO threadpool ) +ADD_DISTCLEAN( analysis null_timer tests liblbpm-wia.* cpu gpu example common IO threadpool ) # Check for CUDA @@ -168,11 +170,3 @@ IF ( NOT ONLY_BUILD_DOCS ) INSTALL_PROJ_LIB() ENDIF() - -# Create the visit plugin -IF ( USE_VISIT ) - INCLUDE( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindVisIt.cmake ) - VISIT_PLUGIN( visit LBM ) -ENDIF() - - diff --git a/README.md b/README.md index 3add4e4d..a11f14ec 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ Lattice Boltzmann Methods for Porous Media Notes on installation * example configure scripts for cmake are in the sample_scripts directory -* required dependencies - MPI, HDF5, SILO, C++11 -* optional dependencies - NetCDF, CUDA, TimerUtility, VisIT +* required dependencies - MPI, HDF5, SILO, C++14 +* optional dependencies - NetCDF, CUDA, TimerUtility Build dependencies (zlib, hdf5, silo) OR point to an existing installation diff --git a/README.visit b/README.visit deleted file mode 100644 index 890ad605..00000000 --- a/README.visit +++ /dev/null @@ -1,64 +0,0 @@ -To compile the visit plug-in and run in parallel on computational back-end: - -Checkout code and create a cmake script to compile plug-in. -Example commands for Rhea: - -Load the proper modules - module unload intel gcc - module load gcc/4.8.2 - module load cmake - - -Configure cmake to build the plug-in - cmake \ - -D CMAKE_BUILD_TYPE:STRING=Release \ - -D CMAKE_C_COMPILER:PATH=gcc \ - -D CMAKE_CXX_COMPILER:PATH=g++ \ - -D USE_MPI=false \ - -D USE_CUDA=false \ - -D USE_VISIT=true \ - -D VISIT_ROOT_DIR=/sw/redhat6/visit \ - -D USE_TIMER=false \ - ../../LBPM-WIA - - -Build the visit plug-in - make install -j 8 - make visit - -Check that the visit plug-in installed in ~/.visit/2.9.0/linux-x86_64/plugins/databases -where 2.9.0 is the current version of visit on rhea -It should have created several shared libraries: - libELBMDatabase_par.so libELBMDatabase_ser.so libILBMDatabase.so libMLBMDatabase.so - -Install visit on local machine (2.9.0) - -Start visit on local machine - -First time: - Go to: Options - Host profiles - Click Remote Profiles - Update - After list populates, drag host_ornl_rhea.xml to Hosts - Select ORNL_Rhea from Hosts, click on Machines - Set account username - Click on Launch Profiles tab - Change profile name and timeout if desired - Click on Parallel tab - Add Default Bank / Account with project number, set default nodes/processors if desired - Click Apply, then close window - Go to: Options - Save Settings - -Open remote file / launch parallel job - Click Open file - Change Host to ORNL_Rhea, enter passcode when prompted - Open visualization file - /lustre/atlas/proj-shared/geo106/vis_test/dumps.LBM - New window will open prompting for # of nodes, processors, Bank (project number) and time limit - Rhea as 16 physical-cores/node and 64 GB/node - for example file above I used 1 node, 16 cores - Visit will call qsub and submit a parallel job that will start when ready - -Visualize desired quantities - - - diff --git a/analysis/TwoPhase.cpp b/analysis/TwoPhase.cpp index 049ddcb9..ecd328e3 100644 --- a/analysis/TwoPhase.cpp +++ b/analysis/TwoPhase.cpp @@ -127,10 +127,6 @@ TwoPhase::TwoPhase(std::shared_ptr dm): Vel_x.resize(Nx,Ny,Nz); Vel_x.fill(0); // Gradient of the phase indicator field Vel_y.resize(Nx,Ny,Nz); Vel_y.fill(0); Vel_z.resize(Nx,Ny,Nz); Vel_z.fill(0); - - wet_morph = Minkowski(Dm); - nonwet_morph = Minkowski(Dm); - //......................................... // Allocate cube storage space CubeValues.resize(2,2,2); @@ -184,8 +180,7 @@ TwoPhase::TwoPhase(std::shared_ptr dm): fprintf(TIMELOG,"Gnsxx Gnsyy Gnszz Gnsxy Gnsxz Gnsyz "); fprintf(TIMELOG,"trawn trJwn trRwn "); //trimmed curvature, fprintf(TIMELOG,"wwndnw wwnsdnwn Jwnwwndnw "); //kinematic quantities, - fprintf(TIMELOG,"Vw Jw Aw Xw "); //miknowski measures, - fprintf(TIMELOG,"Vn Jn An Xn\n"); //miknowski measures, + fprintf(TIMELOG,"Euler Kn Jn An\n"); //miknowski measures, } NWPLOG = fopen("components.NWP.tcat","a+"); @@ -214,9 +209,8 @@ TwoPhase::TwoPhase(std::shared_ptr dm): fprintf(TIMELOG,"Gnsxx Gnsyy Gnszz Gnsxy Gnsxz Gnsyz "); fprintf(TIMELOG,"trawn trJwn trRwn "); //trimmed curvature, fprintf(TIMELOG,"wwndnw wwnsdnwn Jwnwwndnw "); //kinematic quantities, - fprintf(TIMELOG,"Vw Jw Aw Xw "); //miknowski measures, - fprintf(TIMELOG,"Vn Jn An Xn\n"); //miknowski measures, - } + fprintf(TIMELOG,"Euler Kn Jn An\n"); //miknowski measures, + } } @@ -578,6 +572,7 @@ void TwoPhase::ComputeLocal() } } } +/* Array phase_label(Nx,Ny,Nz); Array phase_distance(Nx,Ny,Nz); // Analyze the wetting fluid @@ -603,7 +598,7 @@ void TwoPhase::ComputeLocal() } CalcDist(phase_distance,phase_label,*Dm); wet_morph.ComputeScalar(phase_distance,0.f); - + printf("generating distance at rank=%i \n",Dm->rank()); // Analyze the wetting fluid for (k=0; krank()); CalcDist(phase_distance,phase_label,*Dm); + printf("morphological analysis at rank=%i \n",Dm->rank()); nonwet_morph.ComputeScalar(phase_distance,0.f); + printf("rank=%i completed \n",Dm->rank()); +*/ } @@ -1328,10 +1327,7 @@ void TwoPhase::PrintAll(int timestep) Gws_global(0),Gws_global(1),Gws_global(2),Gws_global(3),Gws_global(4),Gws_global(5)); // orientation of ws interface fprintf(TIMELOG,"%.5g %.5g %.5g ",trawn_global, trJwn_global, trRwn_global); // Trimmed curvature fprintf(TIMELOG,"%.5g %.5g %.5g ",wwndnw_global, wwnsdnwn_global, Jwnwwndnw_global); // kinematic quantities - fprintf(TIMELOG,"%.5g %.5g %.5g %.5g ", wet_morph.Vi_global, wet_morph.Ji_global, wet_morph.Ai_global, wet_morph.Xi_global); // minkowski measures - fprintf(TIMELOG,"%.5g %.5g %.5g %.5g\n", nonwet_morph.Vi_global, nonwet_morph.Ji_global, nonwet_morph.Ai_global, nonwet_morph.Xi_global); // minkowski measures - - + fprintf(TIMELOG,"%.5g %.5g %.5g %.5g\n",euler_global, Kn_global, Jn_global, An_global); // minkowski measures fflush(TIMELOG); } else{ @@ -1356,9 +1352,7 @@ void TwoPhase::PrintAll(int timestep) Gws(0),Gws(1),Gws(2),Gws(3),Gws(4),Gws(5)); // orientation of ws interface fprintf(TIMELOG,"%.5g %.5g %.5g ",trawn, trJwn, trRwn); // Trimmed curvature fprintf(TIMELOG,"%.5g %.5g %.5g ",wwndnw, wwnsdnwn, Jwnwwndnw); // kinematic quantities - fprintf(TIMELOG,"%.5g %.5g %.5g %.5g ", wet_morph.Vi, wet_morph.Ji, wet_morph.Ai, wet_morph.Xi); // minkowski measures - fprintf(TIMELOG,"%.5g %.5g %.5g %.5g\n", nonwet_morph.Vi, nonwet_morph.Ji, nonwet_morph.Ai, nonwet_morph.Xi); // minkowski measures - + fprintf(TIMELOG,"%.5g %.5g %.5g %.5g\n",euler, Kn, Jn, An); // minkowski measures fflush(TIMELOG); } diff --git a/cmake/FindVisIt.cmake b/cmake/FindVisIt.cmake deleted file mode 100644 index 13bf51b9..00000000 --- a/cmake/FindVisIt.cmake +++ /dev/null @@ -1,61 +0,0 @@ -# Tool for building visit plugins -# -# The script will prompt the user to specify VISIT_ROOT_DIR if the prefix -# cannot be determined by the location of xml2cmake in the system path. -# Users can set the environment variable VISIT_BIN_PATH before running cmake -# (e.g. VISIT_BIN_PATH=/usr/local/bin instead of VISIT_ROOT_DIR) - - - -# Find the xml2cmake executable and set VISIT_XML_CMAKE -SET( VISIT_XML_CMAKE ) -FIND_PROGRAM( VISIT_XML_CMAKE - NAMES xml2cmake - PATHS - "${VISIT_ROOT_DIR}" - "${VISIT_BIN_PATH}" - "$ENV{VISIT_ROOT_DIR}" - "$ENV{VISIT_BIN_PATH}" - PATH_SUFFIXES bin bin64 - NO_DEFAULT_PATH -) -IF( NOT VISIT_XML_CMAKE ) - MESSAGE( FATAL_ERROR "xml2cmake not found in:\n" - "${VISIT_ROOT_DIR}/bin\n" - "${VISIT_BIN_PATH}\n" - "$ENV{VISIT_ROOT_DIR}/bin\n" - "$ENV{VISIT_BIN_PATH}\n" - ) -ELSE() - MESSAGE( "VISIT_XML_CMAKE=${VISIT_XML_CMAKE}" ) -ENDIF() - - -# Install plugin -MACRO( VISIT_PLUGIN SRC_DIR TARGET ) - CONFIGURE_FILE( "${CMAKE_CURRENT_SOURCE_DIR}/${SRC_DIR}/${TARGET}.xml" "${CMAKE_CURRENT_BINARY_DIR}/${SRC_DIR}/${TARGET}.xml" ) - FILE( GLOB ConfigFiles RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/${SRC_DIR}" - "${CMAKE_CURRENT_SOURCE_DIR}/${SRC_DIR}/*.C" "${CMAKE_CURRENT_SOURCE_DIR}/${SRC_DIR}/*.h" ) - ADD_CUSTOM_TARGET(copy-${SRC_DIR}) - FOREACH( ConfigFile ${ConfigFiles} ) - ADD_CUSTOM_COMMAND(TARGET copy-${SRC_DIR} PRE_BUILD - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/${SRC_DIR}/${ConfigFile}" - "${CMAKE_CURRENT_BINARY_DIR}/${SRC_DIR}/${ConfigFile}" - ) - ENDFOREACH() - ADD_CUSTOM_TARGET( - ${SRC_DIR} - COMMAND ${VISIT_XML_CMAKE} -clobber ${TARGET}.xml - COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} - -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} - -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} - -DVISIT_NOLINK_MPI_WITH_LIBRARIES=TRUE - . - COMMAND make - WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${SRC_DIR}" - SOURCES ${SRC_DIR} - DEPENDS lbpm-wia copy-${SRC_DIR} - ) -ENDMACRO() - - diff --git a/cmake/ctest_script.cmake b/cmake/ctest_script.cmake index 83fb4851..88bf92fe 100644 --- a/cmake/ctest_script.cmake +++ b/cmake/ctest_script.cmake @@ -48,8 +48,6 @@ SET( USE_MPI TRUE ) IF ( DEFINED ENV{USE_MPI} ) SET( USE_MPI $ENV{USE_MPI} ) ENDIF() -SET( USE_VISIT $ENV{USE_VISIT} ) -SET( VISIT_ROOT_DIR $ENV{VISIT_ROOT_DIR} ) # Get the source directory based on the current directory @@ -106,9 +104,6 @@ ELSEIF( ${CTEST_SCRIPT_ARG} STREQUAL "valgrind-cuda" ) ELSE() MESSAGE(FATAL_ERROR "Invalid build (${CTEST_SCRIPT_ARG}): ctest -S /path/to/script,build (debug/opt/valgrind") ENDIF() -IF ( USE_VISIT ) - STRING( REGEX REPLACE "LBPM-WIA-" "LBPM-WIA-visit-" CTEST_BUILD_NAME "${CTEST_BUILD_NAME}" ) -ENDIF() IF ( BUILDNAME_POSTFIX ) SET( CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${BUILDNAME_POSTFIX}" ) ENDIF() @@ -161,9 +156,6 @@ IF ( BUILD_SERIAL ) ELSE() SET( CTEST_BUILD_COMMAND "${CMAKE_MAKE_PROGRAM} -i -j ${N_PROCS} install" ) ENDIF() -IF ( USE_VISIT ) - SET( CTEST_BUILD_COMMAND "${CTEST_BUILD_COMMAND} visit" ) -ENDIF() SET( CTEST_CUSTOM_WARNING_EXCEPTION "has no symbols" ) @@ -218,9 +210,6 @@ IF ( USE_TIMER ) ELSE() SET( CTEST_OPTIONS "${CTEST_OPTIONS};-DUSE_TIMER:BOOL=false" ) ENDIF() -IF ( USE_VISIT ) - SET( CTEST_OPTIONS "${CTEST_OPTIONS};-DUSE_VISIT:BOOL=true;-DVISIT_ROOT_DIR='${VISIT_ROOT_DIR}'" ) -ENDIF() IF ( USE_CUDA ) SET( CTEST_OPTIONS "${CTEST_OPTIONS};-DUSE_CUDA:BOOL=true;-DCMAKE_CUDA_FLAGS='${CUDA_FLAGS}';-DCMAKE_CUDA_HOST_COMPILER=${CUDA_HOST_COMPILER};-DLIB_TYPE=${LIB_TYPE}" ) ELSE() diff --git a/cmake/libraries.cmake b/cmake/libraries.cmake index b51545f9..54d70b5d 100644 --- a/cmake/libraries.cmake +++ b/cmake/libraries.cmake @@ -225,12 +225,6 @@ MACRO( CONFIGURE_SYSTEM ) IF( NOT CMAKE_BUILD_TYPE ) MESSAGE(FATAL_ERROR "CMAKE_BUILD_TYPE is not set") ENDIF() - # Disable gxx debug flags if we are building the visit plugin - # This is necessary to prvent segfaults caused by inconsistent object sizes - # caused by std::vector in the avtMeshMetaData class - IF ( USE_VISIT ) - SET( DISABLE_GXX_DEBUG 1 ) - ENDIF() # Remove extra library links # Get the compiler SET_COMPILER_FLAGS() diff --git a/sample_scripts/configure_desktop b/sample_scripts/configure_desktop index 3a853517..ccf6f713 100755 --- a/sample_scripts/configure_desktop +++ b/sample_scripts/configure_desktop @@ -24,8 +24,5 @@ cmake \ -D USE_TIMER=0 \ ${HOME}/Programs/LBPM-WIA -# -D SILO_LIB="/usr/local/visit/2.9.2/linux-x86_64/lib/libsiloh5.a" \ -# -D SILO_DIRECTORY="/usr/local/visit/2.9.2/linux-x86_64/include/silo" \ - diff --git a/sample_scripts/daedalus_config b/sample_scripts/daedalus_config index ca0d2196..f14f3627 100755 --- a/sample_scripts/daedalus_config +++ b/sample_scripts/daedalus_config @@ -25,9 +25,7 @@ i -D CMAKE_CXX_COMPILER:PATH=/home/christopher/openmpi/install_dir/bin/mpicxx -D CUDA_HOST_COMPILER="/usr/bin/gcc-4.9" \ -D USE_CUDA=1 \ -D USE_TIMER=0 \ - -D USE_VISIT=true \ - -D VISIT_ROOT_DIR=/home/christopher/visit2_12_2.linux-x86_64/bin \ /home/christopher/repos/LBPM-WIA make -j8 install -#make visit + diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 9c8d4dfe..b1329173 100755 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -48,9 +48,9 @@ ADD_LBPM_TEST( TestMap ) ADD_LBPM_TEST( TestColorGradDFH ) ADD_LBPM_TEST( TestBubbleDFH ../example/Bubble/input.db) #ADD_LBPM_TEST( TestColorMassBounceback ../example/Bubble/input.db) -ADD_LBPM_TEST( TestPressVel ../example/Piston/input.db) +ADD_LBPM_TEST( TestPressVel ../example/Bubble/input.db) ADD_LBPM_TEST( TestPoiseuille ../example/Piston/poiseuille.db) -ADD_LBPM_TEST( TestForceMoments ../example/Piston/input.db) +ADD_LBPM_TEST( TestForceMoments ../example/Bubble/input.db) ADD_LBPM_TEST( TestForceD3Q19 ) ADD_LBPM_TEST( TestMomentsD3Q19 ) ADD_LBPM_TEST( TestInterfaceSpeed ../example/Bubble/input.db) diff --git a/tests/TestSegDist.cpp b/tests/TestSegDist.cpp index f431042a..ece3222d 100644 --- a/tests/TestSegDist.cpp +++ b/tests/TestSegDist.cpp @@ -121,7 +121,7 @@ int main(int argc, char **argv) if (rank==0) printf("Mean error %0.4f \n", err); - // Write the results to visit + // Write the results Array ID0(id.size()); ID0.copy( id ); Array ID(Nx,Ny,Nz); diff --git a/tests/lbpm_uCT_maskfilter.cpp b/tests/lbpm_uCT_maskfilter.cpp index cd7763b4..cff41ad7 100644 --- a/tests/lbpm_uCT_maskfilter.cpp +++ b/tests/lbpm_uCT_maskfilter.cpp @@ -319,15 +319,15 @@ int main(int argc, char **argv) } - // Write the results to visit + // Write the results if (rank==0) printf("Writing output \n"); std::vector meshData(N_levels); for (size_t i=0; i( new IO::DomainMesh(Dm[i]->rank_info,Nx[i],Ny[i],Nz[i],Lx,Ly,Lz) ); + meshData[i].mesh = std::make_shared( Dm[i]->rank_info,Nx[i],Ny[i],Nz[i],Lx,Ly,Lz ); // Source data - std::shared_ptr OrigData( new IO::Variable() ); + auto OrigData = std::make_shared(); OrigData->name = "Source Data"; OrigData->type = IO::VariableType::VolumeVariable; OrigData->dim = 1; @@ -335,7 +335,7 @@ int main(int argc, char **argv) meshData[i].vars.push_back(OrigData); fillDouble[i]->copy( LOCVOL[i], OrigData->data ); // Non-Local Mean - std::shared_ptr NonLocMean( new IO::Variable() ); + auto NonLocMean = std::make_shared(); NonLocMean->name = "Non-Local Mean"; NonLocMean->type = IO::VariableType::VolumeVariable; NonLocMean->dim = 1; @@ -343,7 +343,7 @@ int main(int argc, char **argv) meshData[i].vars.push_back(NonLocMean); fillDouble[i]->copy( NonLocalMean[i], NonLocMean->data ); // Segmented Data - std::shared_ptr SegData( new IO::Variable() ); + auto SegData = std::make_shared(); SegData->name = "Segmented Data"; SegData->type = IO::VariableType::VolumeVariable; SegData->dim = 1; @@ -351,7 +351,7 @@ int main(int argc, char **argv) meshData[i].vars.push_back(SegData); fillDouble[i]->copy( ID[i], SegData->data ); // Signed Distance - std::shared_ptr DistData( new IO::Variable() ); + auto DistData = std::make_shared(); DistData->name = "Signed Distance"; DistData->type = IO::VariableType::VolumeVariable; DistData->dim = 1; @@ -359,7 +359,7 @@ int main(int argc, char **argv) meshData[i].vars.push_back(DistData); fillDouble[i]->copy( Dist[i], DistData->data ); // Smoothed Data - std::shared_ptr SmoothData( new IO::Variable() ); + auto SmoothData = std::make_shared(); SmoothData->name = "Smoothed Data"; SmoothData->type = IO::VariableType::VolumeVariable; SmoothData->dim = 1; diff --git a/tests/lbpm_uCT_pp.cpp b/tests/lbpm_uCT_pp.cpp index 391d0f95..ccb0f5af 100644 --- a/tests/lbpm_uCT_pp.cpp +++ b/tests/lbpm_uCT_pp.cpp @@ -22,6 +22,7 @@ #include "analysis/analysis.h" #include "analysis/filters.h" #include "analysis/uCT.h" +#include "analysis/distance.h" #include "analysis/Minkowski.h" #include "ProfilerApp.h" @@ -346,7 +347,7 @@ int main(int argc, char **argv) */ { - // Write the results to visit + // Write the results if (rank==0) printf("Setting up visualization structure \n"); // std::vector meshData(N_levels); std::vector meshData(1); @@ -450,29 +451,36 @@ int main(int argc, char **argv) IO::writeData( 0, meshData, comm ); if (rank==0) printf("Finished. \n"); } + // Compute the Minkowski functionals MPI_Barrier(comm); std::shared_ptr Averages(new Minkowski(Dm[0])); - if (rank==0) printf("Initializing the system: Nx=%i, Ny=%i, Nz=%i \n",Averages->Nx,Averages->Ny,Averages->Nz); - for ( int k=1;kNx-1;k++){ - for ( int j=1;jNy-1;j++){ - for ( int i=1;iNx-1;i++){ - int n = k*(Averages->Nx)*(Averages->Ny)+j*(Averages->Nx)+i; - double distance=Dist[0](i,j,k); - Averages->SDn(i,j,k) = distance; - if (distance > 0) - Averages->Dm->id[n] = 0; - else - Averages->Dm->id[n] = 1; + + Array phase_label(Nx[0],Ny[0],Nz[0]); + Array phase_distance(Nx[0],Ny[0],Nz[0]); + // Analyze the wetting fluid + for (int k=1;kid[n] > 0)){ + // Solid phase + phase_label(i,j,k) = 0; + } + else if (Dist[0](i,j,k) < 0.0){ + // wetting phase + phase_label(i,j,k) = 1; + } + else { + // non-wetting phase + phase_label(i,j,k) = 0; + } + phase_distance(i,j,k) =2.0*double(phase_label(i,j,k))-1.0; } } - } - - if (rank==0) printf("Computing Minkowski functionals \n"); - Averages->Initialize(); - Averages->UpdateMeshValues(); - Averages->ComputeLocal(); - Averages->Reduce(); + } + CalcDist(phase_distance,phase_label,*Dm[0]); + Averages->ComputeScalar(phase_distance,0.f); Averages->PrintAll(); } PROFILE_STOP("Main"); diff --git a/visit/LBM.xml b/visit/LBM.xml deleted file mode 100644 index a498af0c..00000000 --- a/visit/LBM.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - *.LBM - - - -I${LBPM_INSTALL_DIR}/include - -I${TIMER_INCLUDE} - ${MPI_CXXFLAGS} - ${TIMER_CXXFLAGS} - - - -L${LBPM_INSTALL_DIR}/lib - -L${CMAKE_CURRENT_BINARY_DIR}/.. - ${TIMER_LDFLAGS} - ${MPI_LINK_FLAGS} - - - -llbpm-wia - ${TIMER_LDLIBS} - ${MPI_LIBRARIES} - - - diff --git a/visit/LBMCommonPluginInfo.C b/visit/LBMCommonPluginInfo.C deleted file mode 100644 index 42c916c9..00000000 --- a/visit/LBMCommonPluginInfo.C +++ /dev/null @@ -1,92 +0,0 @@ -/***************************************************************************** -* -* 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 -#include -#include -#include - -// **************************************************************************** -// Method: LBMCommonPluginInfo::GetDatabaseType -// -// Purpose: -// Returns the type of a LBM database. -// -// Programmer: generated by xml2info -// Creation: omitted -// -// **************************************************************************** -DatabaseType -LBMCommonPluginInfo::GetDatabaseType() -{ - return DB_TYPE_MTMD; -} - -// **************************************************************************** -// Method: LBMCommonPluginInfo::SetupDatabase -// -// Purpose: -// Sets up a LBM 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 LBM database from list. -// -// Programmer: generated by xml2info -// Creation: omitted -// -// **************************************************************************** -avtDatabase * -LBMCommonPluginInfo::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 avtLBMFileFormat(list[i*nBlock]); - } - avtMTMDFileFormatInterface *inter - = new avtMTMDFileFormatInterface(ffl, nTimestepGroups); - return new avtGenericDatabase(inter); -} - diff --git a/visit/LBMEnginePluginInfo.C b/visit/LBMEnginePluginInfo.C deleted file mode 100644 index a58f04dc..00000000 --- a/visit/LBMEnginePluginInfo.C +++ /dev/null @@ -1,73 +0,0 @@ -/***************************************************************************** -* -* 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 - -// **************************************************************************** -// Function: GetEngineInfo -// -// Purpose: -// Return a new EnginePluginInfo for the LBM database. -// -// Programmer: generated by xml2info -// Creation: omitted -// -// **************************************************************************** -extern "C" DBP_EXPORT EngineDatabasePluginInfo* LBM_GetEngineInfo() -{ - return new LBMEnginePluginInfo; -} - -// **************************************************************************** -// Method: LBMEnginePluginInfo::GetWriter -// -// Purpose: -// Sets up a LBM writer. -// -// Returns: A LBM writer. -// -// Programmer: generated by xml2info -// Creation: omitted -// -// **************************************************************************** -avtDatabaseWriter * -LBMEnginePluginInfo::GetWriter(void) -{ - return NULL; -} - diff --git a/visit/LBMMDServerPluginInfo.C b/visit/LBMMDServerPluginInfo.C deleted file mode 100644 index 8d8212d1..00000000 --- a/visit/LBMMDServerPluginInfo.C +++ /dev/null @@ -1,60 +0,0 @@ -/***************************************************************************** -* -* 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 - -// **************************************************************************** -// Function: GetMDServerInfo -// -// Purpose: -// Return a new MDServerPluginInfo for the LBM database. -// -// Programmer: generated by xml2info -// Creation: omitted -// -// **************************************************************************** -extern "C" DBP_EXPORT MDServerDatabasePluginInfo* LBM_GetMDServerInfo() -{ - return new LBMMDServerPluginInfo; -} - -// this makes compilers happy... remove if we ever have functions here -void LBMMDServerPluginInfo::dummy() -{ -} - diff --git a/visit/LBMPluginInfo.C b/visit/LBMPluginInfo.C deleted file mode 100644 index 5d0284fe..00000000 --- a/visit/LBMPluginInfo.C +++ /dev/null @@ -1,206 +0,0 @@ -/***************************************************************************** -* -* 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: LBMPluginInfo.C -// ************************************************************************* // - -#include - -#include -VISIT_PLUGIN_VERSION(LBM,DBP_EXPORT) - -// **************************************************************************** -// Function: GetGeneralInfo -// -// Purpose: -// Return a new GeneralPluginInfo for the LBM database. -// -// Programmer: generated by xml2info -// Creation: omitted -// -// **************************************************************************** -extern "C" DBP_EXPORT GeneralDatabasePluginInfo* LBM_GetGeneralInfo() -{ - return new LBMGeneralPluginInfo; -} - -// **************************************************************************** -// Method: LBMGeneralPluginInfo::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 * -LBMGeneralPluginInfo::GetName() const -{ - return "LBM"; -} - -// **************************************************************************** -// Method: LBMGeneralPluginInfo::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 * -LBMGeneralPluginInfo::GetVersion() const -{ - return "1.0"; -} - -// **************************************************************************** -// Method: LBMGeneralPluginInfo::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 * -LBMGeneralPluginInfo::GetID() const -{ - return "LBM_1.0"; -} -// **************************************************************************** -// Method: LBMGeneralPluginInfo::EnabledByDefault -// -// Purpose: -// Return true if this plugin should be enabled by default; false otherwise. -// -// Returns: true/false -// -// Programmer: generated by xml2info -// Creation: omitted -// -// **************************************************************************** - -bool -LBMGeneralPluginInfo::EnabledByDefault() const -{ - return true; -} -// **************************************************************************** -// Method: LBMGeneralPluginInfo::HasWriter -// -// Purpose: -// Return true if this plugin has a database writer. -// -// Returns: true/false -// -// Programmer: generated by xml2info -// Creation: omitted -// -// **************************************************************************** - -bool -LBMGeneralPluginInfo::HasWriter() const -{ - return false; -} -// **************************************************************************** -// Method: LBMGeneralPluginInfo::GetDefaultFilePatterns -// -// Purpose: -// Returns the default patterns for a LBM database. -// -// Programmer: generated by xml2info -// Creation: omitted -// -// **************************************************************************** -std::vector -LBMGeneralPluginInfo::GetDefaultFilePatterns() const -{ - std::vector defaultPatterns; - defaultPatterns.push_back("*.LBM"); - - return defaultPatterns; -} - -// **************************************************************************** -// Method: LBMGeneralPluginInfo::AreDefaultFilePatternsStrict -// -// Purpose: -// Returns if the file patterns for a LBM database are -// intended to be interpreted strictly by default. -// -// Programmer: generated by xml2info -// Creation: omitted -// -// **************************************************************************** -bool -LBMGeneralPluginInfo::AreDefaultFilePatternsStrict() const -{ - return false; -} - -// **************************************************************************** -// Method: LBMGeneralPluginInfo::OpensWholeDirectory -// -// Purpose: -// Returns if the LBM plugin opens a whole directory name -// instead of a single file. -// -// Programmer: generated by xml2info -// Creation: omitted -// -// **************************************************************************** -bool -LBMGeneralPluginInfo::OpensWholeDirectory() const -{ - return false; -} diff --git a/visit/LBMPluginInfo.h b/visit/LBMPluginInfo.h deleted file mode 100644 index c3edf001..00000000 --- a/visit/LBMPluginInfo.h +++ /dev/null @@ -1,100 +0,0 @@ -/***************************************************************************** -* -* 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. -* -*****************************************************************************/ - -// **************************************************************************** -// LBMPluginInfo.h -// **************************************************************************** - -#ifndef LBM_PLUGIN_INFO_H -#define LBM_PLUGIN_INFO_H -#include -#include - -class avtDatabase; -class avtDatabaseWriter; - -// **************************************************************************** -// Class: LBMDatabasePluginInfo -// -// Purpose: -// Classes that provide all the information about the LBM plugin. -// Portions are separated into pieces relevant to the appropriate -// components of VisIt. -// -// Programmer: generated by xml2info -// Creation: omitted -// -// Modifications: -// -// **************************************************************************** - -class LBMGeneralPluginInfo : 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 GetDefaultFilePatterns() const; - virtual bool AreDefaultFilePatternsStrict() const; - virtual bool OpensWholeDirectory() const; -}; - -class LBMCommonPluginInfo : public virtual CommonDatabasePluginInfo, public virtual LBMGeneralPluginInfo -{ - public: - virtual DatabaseType GetDatabaseType(); - virtual avtDatabase *SetupDatabase(const char * const *list, - int nList, int nBlock); -}; - -class LBMMDServerPluginInfo : public virtual MDServerDatabasePluginInfo, public virtual LBMCommonPluginInfo -{ - public: - // this makes compilers happy... remove if we ever have functions here - virtual void dummy(); -}; - -class LBMEnginePluginInfo : public virtual EngineDatabasePluginInfo, public virtual LBMCommonPluginInfo -{ - public: - virtual avtDatabaseWriter *GetWriter(void); -}; - -#endif diff --git a/visit/avtLBMFileFormat.C b/visit/avtLBMFileFormat.C deleted file mode 100644 index ec30fb0f..00000000 --- a/visit/avtLBMFileFormat.C +++ /dev/null @@ -1,498 +0,0 @@ -/***************************************************************************** -* -* 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. -* -*****************************************************************************/ - -// ************************************************************************* // -// avtLBMFileFormat.C // -// ************************************************************************* // - -#include -#include - -#include - -// LBPM headers -#include "IO/Reader.h" -#include "IO/IOHelpers.h" -#include "IO/PIO.h" -#include "common/Utilities.h" - -// vtk headers -#include -#include -#include -#include -#include -#include -#include -#include - - -#include -#include - -#include -#include - -#include - - -#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) - #define USE_WINDOWS -#elif defined(__APPLE__) - #define USE_MAC -#else - #define USE_LINUX -#endif -#ifdef USE_WINDOWS - #include - #include - #define TIME_TYPE LARGE_INTEGER - #define get_time(x) QueryPerformanceCounter(x) - #define get_frequency(f) QueryPerformanceFrequency(f) - #define get_diff(start,end,f) \ - static_cast(end.QuadPart-start.QuadPart)/static_cast(f.QuadPart) -#elif defined(USE_LINUX) || defined(USE_MAX) - #include - #define TIME_TYPE timeval - #define get_time(x) gettimeofday(x,NULL); - #define get_frequency(f) (*f=timeval()) - #define get_diff(start,end,f) 1e-6*static_cast( \ - 0xF4240*(static_cast(end.tv_sec)-static_cast(start.tv_sec)) + \ - (static_cast(end.tv_usec)-static_cast(start.tv_usec)) ) -#else - #error Unknown OS -#endif - - -// Null stream buffer -class NullBufferClass : public std::streambuf { -public: - virtual std::streamsize xsputn(const char *s, std::streamsize n) { return n; } - virtual int overflow(int c) { return 1; } - virtual void setOutputStream( std::ostream* ) {} -}; - - -// Output streams -#if 0 - static IO::ParallelStreamBuffer DebugStreamBuffer1; - static IO::ParallelStreamBuffer DebugStreamBuffer2; -#else - static NullBufferClass DebugStreamBuffer1; - static NullBufferClass DebugStreamBuffer2; -#endif -std::ostream DebugStream1(&DebugStreamBuffer1); -std::ostream DebugStream2(&DebugStreamBuffer2); - - -// **************************************************************************** -// Method: avtLBMFileFormat constructor -// -// Programmer: mbt -- generated by xml2avt -// Creation: Wed Jul 9 10:59:08 PDT 2014 -// -// **************************************************************************** - -avtLBMFileFormat::avtLBMFileFormat(const char *filename) - : avtMTMDFileFormat(filename) -{ - // Set abort behavior - Utilities::setAbortBehavior(true,true,true); - Utilities::setErrorHandlers(); - // Set debug streams - DebugStreamBuffer1.setOutputStream( &DebugStream::Stream1() ); - DebugStreamBuffer2.setOutputStream( &DebugStream::Stream2() ); - DebugStreamBuffer1.setOutputStream( &std::cout ); - // Get the path to the input file - std::string file(filename); - size_t k1 = file.rfind(47); - size_t k2 = file.rfind(92); - if ( k1==std::string::npos ) { k1=0; } - if ( k2==std::string::npos ) { k2=0; } - d_path = file.substr(0,std::max(k1,k2)); - // Load the summary file - DebugStream1 << "Loading " << filename << std::endl; - d_timesteps = IO::readTimesteps(filename); - // Read the mesh dabases - d_database.clear(); - d_database.resize(d_timesteps.size()); - for (size_t i=0; i(d_timesteps.size()); -} - - -// **************************************************************************** -// Method: avtLBMFileFormat::FreeUpResources -// -// Purpose: -// When VisIt is done focusing on a particular timestep, it asks that -// timestep to free up any resources (memory, file descriptors) that -// it has associated with it. This method is the mechanism for doing -// that. -// -// Programmer: mbt -- generated by xml2avt -// Creation: Wed Jul 9 10:59:08 PDT 2014 -// -// **************************************************************************** - -void -avtLBMFileFormat::FreeUpResources(void) -{ - DebugStream1 << "avtLBMFileFormat::FreeUpResources" << std::endl; - std::map::iterator it; - for ( it=d_meshcache.begin(); it!=d_meshcache.end(); ++it ) { - DebugStream2 << " deleting: " << it->first << std::endl; - vtkObjectBase* obj = it->second; - it->second = NULL; - if ( obj!=NULL ) - obj->Delete(); - } - DebugStream2 << " finished" << std::endl; -} - - -// **************************************************************************** -// Method: avtLBMFileFormat::PopulateDatabaseMetaData -// -// Purpose: -// This database meta-data object is like a table of contents for the -// file. By populating it, you are telling the rest of VisIt what -// information it can request from you. -// -// Programmer: mbt -- generated by xml2avt -// Creation: Wed Jul 9 10:59:08 PDT 2014 -// -// **************************************************************************** - -void -avtLBMFileFormat::PopulateDatabaseMetaData(avtDatabaseMetaData *md, int timestate) -{ - DebugStream1 << "avtLBMFileFormat::PopulateDatabaseMetaData: " << timestate << std::endl; - // Add the mesh domains to the meta data - const std::vector database = d_database[timestate]; - for (size_t i=0; iname = database[i].name; - mmd->meshType = vtkMeshType(database[i].type); - mmd->spatialDimension = 3; - mmd->topologicalDimension = vtkTopDim(database[i].type); - if ( mmd->meshType==AVT_SURFACE_MESH ) - mmd->topologicalDimension = 2; - mmd->numBlocks = database[i].domains.size(); - mmd->blockNames.resize( mmd->numBlocks ); - for (int j=0; jnumBlocks; j++) - mmd->blockNames[j] = database[i].domains[j].name; - md->Add(mmd); - // Add expressions for the coordinates - const char *xyz[3] = {"x","y","z"}; - for(int j=0; j<3; j++) { - Expression expr; - char expdef[100], expname[100]; - sprintf(expdef,"coord(<%s>)[%i]",mmd->name.c_str(),j); - sprintf(expname,"%s/%s",xyz[j],mmd->name.c_str()); - expr.SetName(expname); - expr.SetDefinition(expdef); - md->AddExpression(&expr); - } - // Add the variables - for (size_t j=0; jname; - avtCentering center = AVT_UNKNOWN_CENT; - if ( variable.type==IO::VariableType::NodeVariable ) { - center = AVT_NODECENT; - } else if ( variable.type==IO::VariableType::SurfaceVariable ) { - center = AVT_ZONECENT; - } else if ( variable.type==IO::VariableType::VolumeVariable ) { - center = AVT_ZONECENT; - } - if ( variable.dim==1 ) { - AddScalarVarToMetaData( md, varname, mmd->name, center ); - } else if ( variable.dim==3 ) { - AddVectorVarToMetaData( md, varname, mmd->name, center, variable.dim ); - } else if ( variable.dim==9 ) { - AddTensorVarToMetaData( md, varname, mmd->name, center, variable.dim ); - } - } - } - DebugStream2 << " Finished" << std::endl; - - // - // CODE TO ADD A MATERIAL - // - // string mesh_for_mat = meshname; // ??? -- could be multiple meshes - // string matname = ... - // int nmats = ...; - // vector mnames; - // for (int i = 0 ; i < nmats ; i++) - // { - // char str[32]; - // sprintf(str, "mat%d", i); - // -- or -- - // strcpy(str, "Aluminum"); - // mnames.push_back(str); - // } - // - // Here's the call that tells the meta-data object that we have a mat: - // - // AddMaterialToMetaData(md, matname, mesh_for_mat, nmats, mnames); - // - // - // Here's the way to add expressions: - //Expression momentum_expr; - //momentum_expr.SetName("momentum"); - //momentum_expr.SetDefinition("{u, v}"); - //momentum_expr.SetType(Expression::VectorMeshVar); - //md->AddExpression(&momentum_expr); - //Expression KineticEnergy_expr; - //KineticEnergy_expr.SetName("KineticEnergy"); - //KineticEnergy_expr.SetDefinition("0.5*(momentum*momentum)/(rho*rho)"); - //KineticEnergy_expr.SetType(Expression::ScalarMeshVar); - //md->AddExpression(&KineticEnergy_expr); - // -} - - -// **************************************************************************** -// Method: avtLBMFileFormat::GetMesh -// -// Purpose: -// Gets the mesh associated with this file. The mesh is returned as a -// derived type of vtkDataSet (ie vtkRectilinearGrid, vtkStructuredGrid, -// vtkUnstructuredGrid, etc). -// -// Arguments: -// timestate The index of the timestate. If GetNTimesteps returned -// 'N' time steps, this is guaranteed to be between 0 and N-1. -// domain The index of the domain. If there are NDomains, this -// value is guaranteed to be between 0 and NDomains-1, -// regardless of block origin. -// meshname The name of the mesh of interest. This can be ignored if -// there is only one mesh. -// -// Programmer: mbt -- generated by xml2avt -// Creation: Wed Jul 9 10:59:08 PDT 2014 -// -// **************************************************************************** - -vtkDataSet * -avtLBMFileFormat::GetMesh(int timestate, int domain, const char *meshname) -{ - DebugStream1 << "avtLBMFileFormat::GetMesh - " << meshname - << "," << timestate << "," << domain << std::endl; - TIME_TYPE start, stop, freq; - get_frequency(&freq); - get_time(&start); - // Check if we have a cached copy of the mesh - char cache_name[1000]; - sprintf(cache_name,"%i-%i-%s",timestate,domain,meshname); - if ( d_meshcache.find(cache_name)!=d_meshcache.end() ) - return dynamic_cast(d_meshcache.find(cache_name)->second); - // Read the mesh - std::shared_ptr mesh; - const std::vector database = d_database[timestate]; - const std::string timestep = d_timesteps[timestate]; - for (size_t i=0; iGetNumberOfCells() << std::endl; - vtkMesh->PrintSelf(DebugStream2,vtkIndent(6)); - // Cache the mesh and return - // meshcache[cache_name] = mesh; - get_time(&stop); - DebugStream2 << " Time required: " << get_diff(start,stop,freq) << std::endl; - return vtkMesh; -} - - -// **************************************************************************** -// Method: avtLBMFileFormat::GetVar -// -// Purpose: -// Gets a scalar variable associated with this file. Although VTK has -// support for many different types, the best bet is vtkFloatArray, since -// that is supported everywhere through VisIt. -// -// Arguments: -// timestate The index of the timestate. If GetNTimesteps returned -// 'N' time steps, this is guaranteed to be between 0 and N-1. -// domain The index of the domain. If there are NDomains, this -// value is guaranteed to be between 0 and NDomains-1, -// regardless of block origin. -// varname The name of the variable requested. -// -// Programmer: mbt -- generated by xml2avt -// Creation: Wed Jul 9 10:59:08 PDT 2014 -// -// **************************************************************************** - -vtkDataArray * -avtLBMFileFormat::GetVar(int timestate, int domain, const char *meshvarname) -{ - DebugStream1 << "avtLBMFileFormat::GetVar: " << meshvarname - << "," << timestate << "," << domain << std::endl; - std::vector tmp = IO::splitList(meshvarname,'/'); - ASSERT(tmp.size()==2); - std::string varname = tmp[0]; - std::string meshname = tmp[1]; - const std::vector database = d_database[timestate]; - const std::string timestep = d_timesteps[timestate]; - std::shared_ptr variable; - for (size_t i=0; iSetNumberOfComponents(ucomps); - // rv->SetNumberOfTuples(ntuples); - // float *one_entry = new float[ucomps]; - // for (int i = 0 ; i < ntuples ; i++) - // { - // int j; - // for (j = 0 ; j < ncomps ; j++) - // one_entry[j] = ... - // for (j = ncomps ; j < ucomps ; j++) - // one_entry[j] = 0.; - // rv->SetTuple(i, one_entry); - // } - // - // delete [] one_entry; - // return rv; - // -} - diff --git a/visit/avtLBMFileFormat.h b/visit/avtLBMFileFormat.h deleted file mode 100644 index b879291a..00000000 --- a/visit/avtLBMFileFormat.h +++ /dev/null @@ -1,115 +0,0 @@ -/***************************************************************************** -* -* 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. -* -*****************************************************************************/ - -// ************************************************************************* // -// avtLBMFileFormat.h // -// ************************************************************************* // - -#ifndef AVT_LBM_FILE_FORMAT_H -#define AVT_LBM_FILE_FORMAT_H - -#include - -#include - -#include -#include -#include "IO/MeshDatabase.h" - - - -// **************************************************************************** -// Class: avtLBMFileFormat -// -// Purpose: -// Reads in LBM files as a plugin to VisIt. -// -// Programmer: mbt -- generated by xml2avt -// Creation: Wed Jul 9 10:59:08 PDT 2014 -// -// **************************************************************************** - -class avtLBMFileFormat : public avtMTMDFileFormat -{ - public: - avtLBMFileFormat(const char *); - virtual ~avtLBMFileFormat() {;}; - - // - // This is used to return unconvention 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 &); - // - - // - // 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 &); - // virtual void GetTimes(std::vector &); - // - - virtual int GetNTimesteps(void); - - virtual const char *GetType(void) { return "LBM"; }; - virtual void FreeUpResources(void); - - virtual vtkDataSet *GetMesh(int, int, const char *); - virtual vtkDataArray *GetVar(int, int, const char *); - virtual vtkDataArray *GetVectorVar(int, int, const char *); - - protected: - - // Populate the databes - virtual void PopulateDatabaseMetaData(avtDatabaseMetaData*, int); - - // Helper typedefs - typedef std::pair mesh_key; - - // DATA MEMBERS - std::string d_path; - std::vector d_timesteps; - std::vector > d_database; - std::map d_meshcache; -}; - - -#endif diff --git a/visit/testVisit.py b/visit/testVisit.py deleted file mode 100644 index d9be3bfb..00000000 --- a/visit/testVisit.py +++ /dev/null @@ -1,10 +0,0 @@ -# visit -debug 1 -valgrind engine_ser -cli -s /projects/JamesClure/LBPM-WIA/visit/testVisit.py - - -OpenDatabase("localhost:/projects/JamesClure/build/debug/tests/summary.LBM", 0) -#AddPlot("Mesh", "pointmesh", 1, 1) -AddPlot("Mesh", "trilist", 1, 1) -DrawPlots() -#quit() - - diff --git a/visit/vtkHelpers.h b/visit/vtkHelpers.h deleted file mode 100644 index ba1e8b85..00000000 --- a/visit/vtkHelpers.h +++ /dev/null @@ -1,223 +0,0 @@ -// vtk headers -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -// LBPM headers -#include "IO/Mesh.h" -#include "IO/MeshDatabase.h" - - -extern std::ostream DebugStream1; -extern std::ostream DebugStream2; - - -// Convert a point array to vtkFloatArray -inline vtkFloatArray* pointToVTK( const std::vector& points ) -{ - vtkFloatArray *coords = vtkFloatArray::New(); - coords->SetNumberOfComponents(3); - coords->SetNumberOfTuples(points.size()); - for (size_t i=0; iSetTuple3(i,points[i].x,points[i].y,points[i].z); - return coords; -} - - -// Return the mesh type -inline avtMeshType vtkMeshType( IO::MeshType meshType ) -{ - avtMeshType vtkType = AVT_UNKNOWN_MESH; - if ( meshType==IO::PointMesh ) - vtkType = AVT_POINT_MESH; - else if ( meshType==IO::SurfaceMesh ) - vtkType = AVT_SURFACE_MESH; - else if ( meshType==IO::VolumeMesh ) - vtkType = AVT_RECTILINEAR_MESH; - return vtkType; -} - - -// Return the topological dimension -inline int vtkTopDim( IO::MeshType meshType ) -{ - int dim = -1; - if ( meshType==IO::PointMesh ) - dim = 1; - else if ( meshType==IO::SurfaceMesh ) - dim = 2; - else if ( meshType==IO::VolumeMesh ) - dim = 3; - return dim; -} - - -// Convert a PointList to vtkDataSet -inline vtkDataSet* PointListToVTK( std::shared_ptr mesh ) -{ - vtkFloatArray *coords = pointToVTK(mesh->points); - vtkPoints *points = vtkPoints::New(VTK_FLOAT); - points->SetData(coords); - points->ComputeBounds(); - size_t N = mesh->points.size(); - vtkPolyData *vtkMesh = vtkPolyData::New(); - vtkMesh->SetPoints(points); - vtkMesh->Allocate(N); - for (int i=0; i<(int)N; i++) { - vtkIdType ids[1] = {i}; - vtkMesh->InsertNextCell(VTK_VERTEX,1,ids); - } - // vtkMesh->BuildCells(); - vtkMesh->ComputeBounds(); - points->Delete(); - coords->Delete(); - return vtkMesh; -} - - -// Convert a TriMesh to vtkDataSet -inline vtkDataSet* TriMeshToVTK( std::shared_ptr mesh ) -{ - vtkFloatArray *coords = pointToVTK(mesh->vertices->points); - ASSERT(coords!=NULL); - vtkPoints *points = vtkPoints::New(VTK_FLOAT); - points->SetData(coords); - points->ComputeBounds(); - const std::vector& A = mesh->A; - const std::vector& B = mesh->B; - const std::vector& C = mesh->C; - size_t N_tri = A.size(); - vtkPolyData *vtkMesh = vtkPolyData::New(); - vtkMesh->SetPoints(points); - vtkMesh->Allocate(N_tri); - for (size_t i=0; iInsertNextCell(VTK_TRIANGLE,3,ids); - } - vtkMesh->BuildCells(); - vtkMesh->ComputeBounds(); - points->Delete(); - coords->Delete(); - return vtkMesh; -} - - -// Convert a TriList to vtkDataSet -inline vtkDataSet* TriListToVTK( std::shared_ptr mesh ) -{ - std::vector point_set(3*mesh->A.size()); - for (size_t i=0; iA.size(); i++) { - point_set[3*i+0] = mesh->A[i]; - point_set[3*i+1] = mesh->B[i]; - point_set[3*i+2] = mesh->C[i]; - } - vtkFloatArray *coords = pointToVTK(point_set); - ASSERT(coords!=NULL); - vtkPoints *points = vtkPoints::New(VTK_FLOAT); - points->SetData(coords); - points->ComputeBounds(); - size_t N_tri = mesh->A.size(); - vtkPolyData *vtkMesh = vtkPolyData::New(); - vtkMesh->SetPoints(points); - vtkMesh->Allocate(N_tri); - for (int i=0; i<(int)N_tri; i++) { - vtkIdType ids[3] = {3*i+0,3*i+1,3*i+2}; - vtkMesh->InsertNextCell(VTK_TRIANGLE,3,ids); - } - vtkMesh->BuildCells(); - vtkMesh->ComputeBounds(); - points->Delete(); - coords->Delete(); - return vtkMesh; -} - - -// Convert a DomainMesh to vtkDataSet -inline vtkDataSet* DomainToVTK( std::shared_ptr mesh ) -{ - int nx = mesh->nx; - int ny = mesh->ny; - int nz = mesh->nz; - if ( nx==0 || ny==0 || nz==0 ) { - DebugStream::Stream1() << " Domain mesh is empty" << std::endl; - return NULL; - } - RankInfoStruct rank_data(mesh->rank,mesh->nprocx,mesh->nprocy,mesh->nprocz); - vtkFloatArray *x = vtkFloatArray::New(); - vtkFloatArray *y = vtkFloatArray::New(); - vtkFloatArray *z = vtkFloatArray::New(); - for(int i=0; i<=nx; i++) - x->InsertNextValue(static_cast(nx*rank_data.ix+i)/static_cast(nx*mesh->nprocx)); - for(int j=0; j<=ny; j++) - y->InsertNextValue(static_cast(ny*rank_data.jy+j)/static_cast(ny*mesh->nprocy)); - for(int k=0; k<=nz; k++) - z->InsertNextValue(static_cast(nz*rank_data.kz+k)/static_cast(nz*mesh->nprocz)); - vtkRectilinearGrid *vtkMesh = vtkRectilinearGrid::New(); - vtkMesh->SetDimensions(nx+1,ny+1,nz+1); - vtkMesh->SetXCoordinates(x); - vtkMesh->SetYCoordinates(y); - vtkMesh->SetZCoordinates(z); - vtkMesh->ComputeBounds(); - x->Delete(); - y->Delete(); - z->Delete(); - return vtkMesh; -} - - -// Convert a mesh to vtkDataSet -inline vtkDataSet* meshToVTK( std::shared_ptr mesh ) -{ - if ( mesh.get() == NULL ){ - DebugStream::Stream1() << " Mesh is NULL" << std::endl; - return NULL; - } - vtkDataSet* mesh2 = NULL; - const std::string className = mesh->className(); - if ( className == "PointList" ) { - // We are dealing with a point mesh - mesh2 = PointListToVTK( std::dynamic_pointer_cast(mesh) ); - DebugStream1 << " Point mesh created" << std::endl; - } else if ( className == "TriMesh" ) { - mesh2 = TriMeshToVTK( std::dynamic_pointer_cast(mesh) ); - DebugStream1 << " Surface mesh created" << std::endl; - } else if ( className == "TriList" ) { - mesh2 = TriListToVTK( std::dynamic_pointer_cast(mesh) ); - DebugStream1 << " Surface mesh created" << std::endl; - } else if ( className == "DomainMesh" ) { - mesh2 = DomainToVTK( std::dynamic_pointer_cast(mesh) ); - DebugStream1 << " Volume mesh created" << std::endl; - } else { - //DebugStream1 << " Error, unknown mesh type" << std::endl; - return NULL; - } - return mesh2; -} - - -// Convert a variable to vtkDataSet -inline vtkDataArray* varToVTK( std::shared_ptr var ) -{ - vtkFloatArray* var2 = NULL; - if ( var->dim==1 ) { - // Scalar variable - var2 = vtkFloatArray::New(); - var2->SetNumberOfTuples(var->data.length()); - for (size_t i=0; idata.length(); i++) - var2->SetTuple1(i,var->data(i)); - } else { - DebugStream::Stream1() << " Error, variable not yet supported" << std::endl; - return NULL; - } - return var2; -} - -