diff --git a/CMakeLists.txt b/CMakeLists.txt index 558755bd4a11aed5ee8acad9d64702a7f1876f9c..7962eebae1a58d431986a68808a16aa377c9c700 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -102,7 +102,7 @@ INCLUDE(scripts/cmake/Pack.cmake) # External projects OPTION(Boost_USE_STATIC_LIBS "This option has to be set from the command line (before boost gets found)!" OFF) INCLUDE(scripts/cmake/ExternalProjectBoost.cmake) -OPTION(OGS_SYSTEM_VTK_ONLY "If On VTK will be searched if installed and will not be build locally." OFF) +OPTION(OGS_SYSTEM_VTK_ONLY "If On VTK / ParaView will be searched if installed and will not be build locally." OFF) INCLUDE(scripts/cmake/ExternalProjectCatalyst.cmake) INCLUDE_DIRECTORIES( SYSTEM ${Boost_INCLUDE_DIRS} ) diff --git a/FileIO/VtkIO/VtuInterface.cpp b/FileIO/VtkIO/VtuInterface.cpp index 1a64695b7bea4e174bf064272c6772308f549b0e..7d5b0c51558bd49e1802daa7cfb65201b9822630 100644 --- a/FileIO/VtkIO/VtuInterface.cpp +++ b/FileIO/VtkIO/VtuInterface.cpp @@ -13,14 +13,14 @@ #include "VtuInterface.h" -#include "Mesh.h" -#include "MeshGenerators/VtkMeshConverter.h" - #include "logog/include/logog.hpp" #include <vtkXMLUnstructuredGridReader.h> #include <vtkSmartPointer.h> +#include "Mesh.h" +#include "MeshGenerators/VtkMeshConverter.h" + namespace FileIO { diff --git a/FileIO/VtkIO/VtuInterface.h b/FileIO/VtkIO/VtuInterface.h index a867aa90832419128a376b28529d4a8a79aeea0f..d5daebeef75a727af5debc7b34245e5bfdda9092 100644 --- a/FileIO/VtkIO/VtuInterface.h +++ b/FileIO/VtkIO/VtuInterface.h @@ -12,13 +12,13 @@ * */ -#ifndef BOOSTVTUINTERFACE_H_ -#define BOOSTVTUINTERFACE_H_ - -#include "Writer.h" +#ifndef VTUINTERFACE_H_ +#define VTUINTERFACE_H_ #include <string> +#include "Writer.h" + namespace MeshLib { class Mesh; } @@ -39,7 +39,7 @@ public: static MeshLib::Mesh* readVTUFile(const std::string &file_name); /// Decide if the mesh data should be written compressed (default is false). - void setCompressData(bool flag=true) { _use_compressor = flag; }; + void setCompressData(bool flag=true) { _use_compressor = flag; } /// Sets the mesh to write. void setMesh(const MeshLib::Mesh* mesh); @@ -53,4 +53,4 @@ private: } -#endif /* BOOSTVTUINTERFACE_H_ */ +#endif /* VTUINTERFACE_H_ */ diff --git a/InSituLib/VtkMappedMesh.cpp b/InSituLib/VtkMappedMesh.cpp index 042f577031ea77bad1db559e47c5528eb56f34bf..b7a1cd4678ef1be92faa62e7c2a87a56dd98f8fe 100644 --- a/InSituLib/VtkMappedMesh.cpp +++ b/InSituLib/VtkMappedMesh.cpp @@ -14,9 +14,7 @@ #include "VtkMappedMesh.h" -#include "Element.h" -#include "MeshLib/Node.h" -#include "MeshEnums.h" +#include <algorithm> #include "logog/include/logog.hpp" @@ -27,7 +25,9 @@ #include <vtkObjectFactory.h> #include <vtkPoints.h> -#include <algorithm> +#include "Element.h" +#include "MeshLib/Node.h" +#include "MeshEnums.h" namespace InSituLib { @@ -92,7 +92,7 @@ int VtkMappedMeshImpl::GetCellType(vtkIdType cellId) void VtkMappedMeshImpl::GetCellPoints(vtkIdType cellId, vtkIdList *ptIds) { - const MeshLib::Element* elem = (*_elements)[cellId]; + const MeshLib::Element* const elem = (*_elements)[cellId]; const unsigned numNodes(elem->getNNodes()); const MeshLib::Node* const* nodes = (*_elements)[cellId]->getNodes(); ptIds->SetNumberOfIds(numNodes); diff --git a/InSituLib/VtkMappedMesh.h b/InSituLib/VtkMappedMesh.h index 066b9c4ff6737166ac9c4e4a73cc08671f7ba172..7535891b8f07ab848cfda096a6dc21b33cb5a8ba 100644 --- a/InSituLib/VtkMappedMesh.h +++ b/InSituLib/VtkMappedMesh.h @@ -17,11 +17,11 @@ #ifndef VTKMAPPEDMESH_H_ #define VTKMAPPEDMESH_H_ -#include "MeshEnums.h" - #include <vtkObject.h> #include <vtkMappedUnstructuredGrid.h> +#include "MeshEnums.h" + class vtkGenericCell; namespace MeshLib { class Element; @@ -76,9 +76,6 @@ private: MeshElemType ogs; switch (type) { - case 0: - ogs = MeshElemType::INVALID; - break; case VTK_LINE: ogs = MeshElemType::LINE; break; @@ -100,6 +97,9 @@ private: case VTK_PYRAMID: ogs = MeshElemType::PYRAMID; break; + default: + ogs = MeshElemType::INVALID; + break; } return ogs; } diff --git a/InSituLib/VtkMappedMeshSource.cpp b/InSituLib/VtkMappedMeshSource.cpp index ba23c01440eb70083a0ac62b0c128904b46dc796..70f97d5945377946b2c265c2f0bed8dee4e7839c 100644 --- a/InSituLib/VtkMappedMeshSource.cpp +++ b/InSituLib/VtkMappedMeshSource.cpp @@ -14,23 +14,22 @@ #include "VtkMappedMeshSource.h" -#include "VtkMappedMesh.h" -#include "VtkMeshNodalCoordinatesTemplate.h" -//#include "vtkCPExodusIIResultsArrayTemplate.h" - #include "logog/include/logog.hpp" -#include "vtkCellData.h" -#include "vtkDemandDrivenPipeline.h" -#include "vtkStreamingDemandDrivenPipeline.h" -#include "vtkDoubleArray.h" -#include "vtkInformation.h" -#include "vtkInformationVector.h" -#include "vtkObjectFactory.h" -#include "vtkPointData.h" -#include "vtkPoints.h" -#include "vtkUnstructuredGrid.h" -#include "vtkIdTypeArray.h" +#include <vtkCellData.h> +#include <vtkDemandDrivenPipeline.h> +#include <vtkStreamingDemandDrivenPipeline.h> +#include <vtkDoubleArray.h> +#include <vtkInformation.h> +#include <vtkInformationVector.h> +#include <vtkObjectFactory.h> +#include <vtkPointData.h> +#include <vtkPoints.h> +#include <vtkUnstructuredGrid.h> +#include <vtkIdTypeArray.h> + +#include "VtkMappedMesh.h" +#include "VtkMeshNodalCoordinatesTemplate.h" namespace InSituLib { diff --git a/InSituLib/VtkMappedMeshSource.h b/InSituLib/VtkMappedMeshSource.h index 6cfcb3212d4eb634821d81d0da8a378fe2bc7585..f0b52eca23b871443dcc36cf5e8d34b0b3789f40 100644 --- a/InSituLib/VtkMappedMeshSource.h +++ b/InSituLib/VtkMappedMeshSource.h @@ -23,11 +23,12 @@ #ifndef _VTKMAPPEDMESHSOURCE #define _VTKMAPPEDMESHSOURCE -#include "vtkUnstructuredGridAlgorithm.h" -#include "vtkNew.h" #include <string> #include <vector> +#include "vtkUnstructuredGridAlgorithm.h" +#include "vtkNew.h" + class vtkDataArrayCollection; class vtkPointData; class vtkPoints; diff --git a/InSituLib/VtkMeshNodalCoordinatesTemplate-impl.h b/InSituLib/VtkMeshNodalCoordinatesTemplate-impl.h index dc17dd675936573a841fa49dac72cfbbba9b86ee..9f6851a7f964d2771f95ad52896f0cdf4c76c4b1 100644 --- a/InSituLib/VtkMeshNodalCoordinatesTemplate-impl.h +++ b/InSituLib/VtkMeshNodalCoordinatesTemplate-impl.h @@ -14,13 +14,13 @@ #include "VtkMeshNodalCoordinatesTemplate.h" -#include "MeshLib/Node.h" - #include <vtkIdList.h> #include <vtkObjectFactory.h> #include <vtkVariant.h> #include <vtkVariantCast.h> +#include "MeshLib/Node.h" + namespace InSituLib { // Can't use vtkStandardNewMacro with a template. @@ -74,7 +74,7 @@ template <class Scalar> void VtkMeshNodalCoordinatesTemplate<Scalar> return; } - vtkIdType numTuples = ptIds->GetNumberOfIds(); + const vtkIdType numTuples = ptIds->GetNumberOfIds(); outArray->SetNumberOfComponents(this->NumberOfComponents); outArray->SetNumberOfTuples(numTuples); @@ -163,9 +163,9 @@ template <class Scalar> double* VtkMeshNodalCoordinatesTemplate<Scalar> template <class Scalar> void VtkMeshNodalCoordinatesTemplate<Scalar> ::GetTuple(vtkIdType i, double *tuple) { - tuple[0] = static_cast<double>((*(*this->_nodes)[i])[0]); - tuple[1] = static_cast<double>((*(*this->_nodes)[i])[1]); - tuple[2] = static_cast<double>((*(*this->_nodes)[i])[2]); + tuple[0] = (*(*this->_nodes)[i])[0]; + tuple[1] = (*(*this->_nodes)[i])[1]; + tuple[2] = (*(*this->_nodes)[i])[2]; } template <class Scalar> vtkIdType VtkMeshNodalCoordinatesTemplate<Scalar> diff --git a/scripts/cmake/ExternalProjectCatalyst.cmake b/scripts/cmake/ExternalProjectCatalyst.cmake index 045c4048487517ff671f7dd42f9e9fdc9715e485..7f37f27cc9cad7ce2f508901e348c20846077296 100644 --- a/scripts/cmake/ExternalProjectCatalyst.cmake +++ b/scripts/cmake/ExternalProjectCatalyst.cmake @@ -50,7 +50,7 @@ IF(ParaView_FOUND AND VTKIO_LIB_FOUND) INCLUDE_DIRECTORIES(SYSTEM ${DIR}/../cxx ${DIR}/include) ENDIF() ENDFOREACH() - MESSAGE("Using ParaView in ${ParaView_DIR}") + MESSAGE(STATUS "Using ParaView in ${ParaView_DIR}") RETURN() ELSEIF(NOT ParaView_DIR) # If ParaView was not found check for VTK @@ -65,7 +65,7 @@ ELSEIF(NOT ParaView_DIR) ENDIF() ENDFOREACH() INCLUDE_DIRECTORIES(SYSTEM ${VTK_DIR}/../ThirdParty/netcdf/vtknetcdf/cxx) - MESSAGE("Using VTK in ${VTK_DIR}") + MESSAGE(STATUS "Using VTK in ${VTK_DIR}") RETURN() ELSE() # If nothing was found build ParaView as an external project @@ -95,7 +95,7 @@ ELSE() SET(CATALYST_CONFIGURE_COMMAND cmake.sh) ENDIF() -MESSAGE("Building ParaView as an external project in the build directory") +MESSAGE(STATUS "Building ParaView as an external project in the build directory") ExternalProject_Add(Catalyst PREFIX ${CMAKE_BINARY_DIR}/External/catalyst GIT_REPOSITORY ${CATALYST_GIT_URL} diff --git a/scripts/cmake/ExternalProjectVtk.cmake b/scripts/cmake/ExternalProjectVtk.cmake index 933cb53beba15f08dba00507da06a719eb03874c..22716c157c180537ff5dd1ec28ded5c1fd350dcf 100644 --- a/scripts/cmake/ExternalProjectVtk.cmake +++ b/scripts/cmake/ExternalProjectVtk.cmake @@ -54,8 +54,8 @@ IF(NOT VTK_DIR) ENDIF() ENDIF() -IF(OGS_SYSTEM_VTK_ONLY AND NOT VTK_FOUND) - MESSAGE(FATAL_ERROR "Vtk was not found but is required! Try to set VTK_DIR to its install or build directory.") +IF(OGS_SYSTEM_VTK_ONLY AND NOT VTK_FOUND AND NOT ParaView_FOUND) + MESSAGE(FATAL_ERROR "Vtk / ParaView was not found but is required! Try to set VTK_DIR or ParaView_DIR to its install or build directory.") ENDIF() IF(VTK_FOUND)