From 9c01e9a7731946223e48c67b761a3514908f9c3f Mon Sep 17 00:00:00 2001 From: Lars Bilke Date: Wed, 10 Apr 2024 11:50:59 +0200 Subject: [PATCH 01/11] Removed ThirdParty/Readme (obsolete). --- ThirdParty/ReadMe.md | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 ThirdParty/ReadMe.md diff --git a/ThirdParty/ReadMe.md b/ThirdParty/ReadMe.md deleted file mode 100644 index 02fd52e623b..00000000000 --- a/ThirdParty/ReadMe.md +++ /dev/null @@ -1,34 +0,0 @@ -# Third-party libraries # - -## RapidXML ## - -Is used for XML-IO. Is integrated directly. - -## tclap ## - -Command line option parser. Is integrated directly. - -## zlib ## - -Compression algorithms. Is integrated directly. - -## gtest ## - -Google testing framework for unit tests. Is integrated directly. - -## autocheck ## - -Is integrated as a submodule. - -## nlohmann/json ## - -Header only c++ json parser. Directly integrated because the benchmarks and -tests are too large. - -## exprtk ## - -Header only c++ mathematical expression parsing and evaluation library - -## spdlog ## - -Very fast, header-only/compiled, C++ logging library. From 7e27f8c683ae8b859e4dc9c6121b7d2915f1f284 Mon Sep 17 00:00:00 2001 From: Lars Bilke Date: Wed, 10 Apr 2024 12:53:49 +0200 Subject: [PATCH 02/11] Removed ThirdParty/paraview. vtkCleanUnstructuredGrid class is part of VTK since 9.3. --- Applications/Utils/MeshEdit/CMakeLists.txt | 16 +- ThirdParty/paraview/License_v1.2.txt | 388 ------------------ .../paraview/vtkCleanUnstructuredGrid.cpp | 232 ----------- .../paraview/vtkCleanUnstructuredGrid.h | 108 ----- 4 files changed, 8 insertions(+), 736 deletions(-) delete mode 100644 ThirdParty/paraview/License_v1.2.txt delete mode 100644 ThirdParty/paraview/vtkCleanUnstructuredGrid.cpp delete mode 100644 ThirdParty/paraview/vtkCleanUnstructuredGrid.h diff --git a/Applications/Utils/MeshEdit/CMakeLists.txt b/Applications/Utils/MeshEdit/CMakeLists.txt index 33eba894943..4ce722aac79 100644 --- a/Applications/Utils/MeshEdit/CMakeLists.txt +++ b/Applications/Utils/MeshEdit/CMakeLists.txt @@ -30,15 +30,15 @@ set(TOOLS add_subdirectory(PVTU2VTU) -ogs_add_executable( - RemoveGhostData RemoveGhostData.cpp - ${PROJECT_SOURCE_DIR}/ThirdParty/paraview/vtkCleanUnstructuredGrid.cpp -) -target_include_directories( - RemoveGhostData PRIVATE ${PROJECT_SOURCE_DIR}/ThirdParty/paraview -) +ogs_add_executable(RemoveGhostData RemoveGhostData.cpp) target_link_libraries( - RemoveGhostData GitInfoLib MeshLib MeshToolsLib tclap VTK::FiltersParallel + RemoveGhostData + GitInfoLib + MeshLib + MeshToolsLib + tclap + VTK::FiltersParallel + VTK::FiltersGeneral ) install(TARGETS RemoveGhostData RUNTIME DESTINATION bin) diff --git a/ThirdParty/paraview/License_v1.2.txt b/ThirdParty/paraview/License_v1.2.txt deleted file mode 100644 index 5b5dccef8c2..00000000000 --- a/ThirdParty/paraview/License_v1.2.txt +++ /dev/null @@ -1,388 +0,0 @@ -Parts of ParaView are under the following licenses: - -ParaView License Version 1.2 -======================================================================== - -Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc. - -Sandia National Laboratories, New Mexico -PO Box 5800 -Albuquerque, NM 87185 - -Kitware Inc. -28 Corporate Drive -Clifton Park, NY 12065 -USA - -Under the terms of Contract DE-AC04-94AL85000, there is a -non-exclusive license for use of this work by or on behalf of the -U.S. Government. - -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 following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the - distribution. - - * Neither the name of Kitware nor the names of any 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 THE AUTHORS 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. -======================================================================== - -Other licenses: - -======================================================================== - -Copyright (c) 2000-2005 Kitware Inc. 28 Corporate Drive, Suite 204, -Clifton Park, NY, 12065, USA. -All rights reserved. - -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 following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the - distribution. - - * Neither the name of Kitware nor the names of any 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 THE AUTHORS 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. - -======================================================================== - -Copyright (c) 2002-2005 Los Alamos National Laboratory - -This software and ancillary information known as vtk_ext (and herein -called "SOFTWARE") is made available under the terms described below. -The SOFTWARE has been approved for release with associated LA_CC -Number 99-44, granted by Los Alamos National Laboratory in July 1999. - -Unless otherwise indicated, this SOFTWARE has been authored by an -employee or employees of the University of California, operator of the -Los Alamos National Laboratory under Contract No. W-7405-ENG-36 with -the United States Department of Energy. - -The United States Government has rights to use, reproduce, and -distribute this SOFTWARE. The public may copy, distribute, prepare -derivative works and publicly display this SOFTWARE without charge, -provided that this Notice and any statement of authorship are -reproduced on all copies. - -Neither the U. S. Government, the University of California, nor the -Advanced Computing Laboratory makes any warranty, either express or -implied, nor assumes any liability or responsibility for the use of -this SOFTWARE. - -If SOFTWARE is modified to produce derivative works, such modified -SOFTWARE should be clearly marked, so as not to confuse it with the -version available from Los Alamos National Laboratory. - -======================================================================== - -VTK License - -======================================================================== - -Copyright (c) 2000-2006 Kitware Inc. 28 Corporate Drive, Suite 204, -Clifton Park, NY, 12065, USA. -All rights reserved. - -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 following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the - distribution. - - * Neither the name of Kitware nor the names of any 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 THE AUTHORS 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. - -======================================================================== - -HDF5 License - -======================================================================== - -NCSA HDF5 (Hierarchical Data Format 5) Software Library and Utilities -Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 by the Board of -Trustees of the University of Illinois All rights reserved. - -Contributors: National Center for Supercomputing Applications (NCSA) at the -University of Illinois at Urbana-Champaign (UIUC), Lawrence Livermore National -Laboratory (LLNL), Sandia National Laboratories (SNL), Los Alamos National -Laboratory (LANL), Jean-loup Gailly and Mark Adler (gzip library). - -Redistribution and use in source and binary forms, with or without -modification, are permitted for any purpose (including commercial purposes) -provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions, and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions, and the following disclaimer in the - documentation and/or materials provided with the distribution. - 3. In addition, redistributions of modified forms of the source or binary - code must carry prominent notices stating that the original code was - changed and the date of the change. - 4. All publications or advertising materials mentioning features or use of - this software are asked, but not required, to acknowledge that it was - developed by the National Center for Supercomputing Applications at the - University of Illinois at Urbana-Champaign and to credit the - contributors. - 5. Neither the name of the University nor the names of the Contributors may - be used to endorse or promote products derived from this software without - specific prior written permission from the University or the - Contributors, as appropriate for the name(s) to be used. - 6. THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY AND THE CONTRIBUTORS "AS IS" - WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. In no event - shall the University or the Contributors be liable for any damages - suffered by the users arising out of the use of this software, even if - advised of the possibility of such damage. - -Portions of HDF5 were developed with support from the University of California, -Lawrence Livermore National Laboratory (UC LLNL). The following statement -applies to those portions of the product and must be retained in any -redistribution of source code, binaries, documentation, and/or accompanying -materials: -This work was partially produced at the University of California, Lawrence -Livermore National Laboratory (UC LLNL) under contract no. W-7405-ENG-48 -(Contract 48) between the U.S. Department of Energy (DOE) and The Regents of -the University of California (University) for the operation of UC LLNL. - -DISCLAIMER: This work was prepared as an account of work sponsored by an agency -of the United States Government. Neither the United States Government nor the -University of California nor any of their employees, makes any warranty, -express or implied, or assumes any liability or responsibility for the -accuracy, completeness, or usefulness of any information, apparatus, product, -or process disclosed, or represents that its use would not infringe privately- -owned rights. Reference herein to any specific commercial products, process, or -service by trade name, trademark, manufacturer, or otherwise, does not -necessarily constitute or imply its endorsement, recommendation, or favoring by -the United States Government or the University of California. The views and -opinions of authors expressed herein do not necessarily state or reflect those -of the United States Government or the University of California, and shall not -be used for advertising or product endorsement purposes. - -======================================================================== - -Xdmf License - -======================================================================== - -Copyright (c) 2002 U.S. Army Research Laboratory -All rights reserved. - -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 following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * Neither the name of the U.S. Army Research Laboratory nor the names - of any contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - - * Modified source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - -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 THE AUTHORS 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. - -======================================================================== - -Protocol Buffer License - -======================================================================== - -Copyright 2008, Google Inc. -All rights reserved. - -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 following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. 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 THE COPYRIGHT -OWNER 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. - -Code generated by the Protocol Buffer compiler is owned by the owner -of the input file used when generating it. This code is not -standalone and requires a support library to be linked with it. This -support library is itself covered by the above license. - - -======================================================================== - -NVD3 License - -======================================================================== - -Copyright (c) 2011, 2012 [Novus Partners, Inc.][novus] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - - https://www.novus.com/ - - -======================================================================== - -D3 License - -======================================================================== - -Copyright (c) 2012, Michael Bostock -All rights reserved. - -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 following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* The name Michael Bostock may not 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 MICHAEL BOSTOCK 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. - - -======================================================================== - -jQuery License - -======================================================================== - -Copyright 2013 jQuery Foundation and other contributors -http://jquery.com/ - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -======================================================================== - -jQuery UI License - -======================================================================== - -Copyright (c) 2013 jQuery Foundation and other contributors Licensed MIT diff --git a/ThirdParty/paraview/vtkCleanUnstructuredGrid.cpp b/ThirdParty/paraview/vtkCleanUnstructuredGrid.cpp deleted file mode 100644 index 37d6febe325..00000000000 --- a/ThirdParty/paraview/vtkCleanUnstructuredGrid.cpp +++ /dev/null @@ -1,232 +0,0 @@ -/*========================================================================= - -Program: ParaView -Module: vtkCleanUnstructuredGrid.cxx - -Copyright (c) Kitware, Inc. -All rights reserved. -See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details. - -This software is distributed WITHOUT ANY WARRANTY; without even -the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the above copyright notice for more information. - -=========================================================================*/ -#include "vtkCleanUnstructuredGrid.h" - -#include "vtkCell.h" -#include "vtkCellData.h" -#include "vtkCollection.h" -#include "vtkDataSet.h" -#include "vtkIncrementalPointLocator.h" -#include "vtkInformation.h" -#include "vtkInformationVector.h" -#include "vtkIntArray.h" -#include "vtkMergePoints.h" -#include "vtkObjectFactory.h" -#include "vtkPointData.h" -#include "vtkPointSet.h" -#include "vtkPoints.h" -#include "vtkRectilinearGrid.h" -#include "vtkUnstructuredGrid.h" - -vtkStandardNewMacro(vtkCleanUnstructuredGrid); -vtkCxxSetObjectMacro(vtkCleanUnstructuredGrid, Locator, vtkIncrementalPointLocator); - -//---------------------------------------------------------------------------- -vtkCleanUnstructuredGrid::~vtkCleanUnstructuredGrid() -{ - this->SetLocator(nullptr); -} - -//---------------------------------------------------------------------------- -void vtkCleanUnstructuredGrid::PrintSelf(ostream& os, vtkIndent indent) -{ - this->Superclass::PrintSelf(os, indent); -} - -//---------------------------------------------------------------------------- -int vtkCleanUnstructuredGrid::RequestData(vtkInformation* vtkNotUsed(request), - vtkInformationVector** inputVector, vtkInformationVector* outputVector) -{ - vtkInformation* inInfo = inputVector[0]->GetInformationObject(0); - vtkInformation* outInfo = outputVector->GetInformationObject(0); - - vtkDataSet* input = vtkDataSet::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT())); - vtkUnstructuredGrid* output = - vtkUnstructuredGrid::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT())); - - if (input->GetNumberOfCells() == 0) - { - // set up a ugrid with same data arrays as input, but - // no points, cells or data. - output->Allocate(1); - output->GetPointData()->CopyAllocate(input->GetPointData(), VTK_CELL_SIZE); - output->GetCellData()->CopyAllocate(input->GetCellData(), 1); - vtkPoints* pts = vtkPoints::New(); - output->SetPoints(pts); - pts->Delete(); - return 1; - } - - output->GetPointData()->CopyAllocate(input->GetPointData()); - output->GetCellData()->PassData(input->GetCellData()); - - // First, create a new points array that eliminate duplicate points. - // Also create a mapping from the old point id to the new. - vtkPoints* newPts = vtkPoints::New(); - - // Set the desired precision for the points in the output. - if (this->OutputPointsPrecision == vtkAlgorithm::DEFAULT_PRECISION) - { - // The logical behaviour would be to use the data type from the input. - // However, input is a vtkDataSet, which has no point data type; only the - // derived class vtkPointSet has a vtkPoints attribute, so only for that - // the logical practice can be applied, while for others (currently - // vtkImageData and vtkRectilinearGrid) the data type is the default - // for vtkPoints - which is VTK_FLOAT. - vtkPointSet* ps = vtkPointSet::SafeDownCast(input); - if (ps) - { - newPts->SetDataType(ps->GetPoints()->GetDataType()); - } - } - else if (this->OutputPointsPrecision == vtkAlgorithm::SINGLE_PRECISION) - { - newPts->SetDataType(VTK_FLOAT); - } - else if (this->OutputPointsPrecision == vtkAlgorithm::DOUBLE_PRECISION) - { - newPts->SetDataType(VTK_DOUBLE); - } - - vtkIdType num = input->GetNumberOfPoints(); - vtkIdType id; - vtkIdType newId; - vtkIdType* ptMap = new vtkIdType[num]; - double pt[3]; - - this->CreateDefaultLocator(input); - if (this->ToleranceIsAbsolute) - { - this->Locator->SetTolerance(this->AbsoluteTolerance); - } - else - { - this->Locator->SetTolerance(this->Tolerance * input->GetLength()); - } - double bounds[6]; - input->GetBounds(bounds); - this->Locator->InitPointInsertion(newPts, bounds); - - vtkIdType progressStep = num / 100; - if (progressStep == 0) - { - progressStep = 1; - } - for (id = 0; id < num; ++id) - { - if (id % progressStep == 0) - { - this->UpdateProgress(0.8 * ((float)id / num)); - } - input->GetPoint(id, pt); - if (this->Locator->InsertUniquePoint(pt, newId)) - { - output->GetPointData()->CopyData(input->GetPointData(), id, newId); - } - ptMap[id] = newId; - } - output->SetPoints(newPts); - newPts->Delete(); - - // Now copy the cells. - vtkIdList* cellPoints = vtkIdList::New(); - num = input->GetNumberOfCells(); - output->Allocate(num); - for (id = 0; id < num; ++id) - { - if (id % progressStep == 0) - { - this->UpdateProgress(0.8 + 0.2 * ((float)id / num)); - } - // special handling for polyhedron cells - if (vtkUnstructuredGrid::SafeDownCast(input) && input->GetCellType(id) == VTK_POLYHEDRON) - { - vtkUnstructuredGrid::SafeDownCast(input)->GetFaceStream(id, cellPoints); - vtkUnstructuredGrid::ConvertFaceStreamPointIds(cellPoints, ptMap); - } - else - { - input->GetCellPoints(id, cellPoints); - for (int i = 0; i < cellPoints->GetNumberOfIds(); i++) - { - int cellPtId = cellPoints->GetId(i); - newId = ptMap[cellPtId]; - cellPoints->SetId(i, newId); - } - } - output->InsertNextCell(input->GetCellType(id), cellPoints); - } - - delete[] ptMap; - cellPoints->Delete(); - output->Squeeze(); - - return 1; -} - -//---------------------------------------------------------------------------- -int vtkCleanUnstructuredGrid::FillInputPortInformation(int vtkNotUsed(port), vtkInformation* info) -{ - info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkDataSet"); - return 1; -} - -//---------------------------------------------------------------------------- -void vtkCleanUnstructuredGrid::CreateDefaultLocator(vtkDataSet* input) -{ - double tol; - if (this->ToleranceIsAbsolute) - { - tol = this->AbsoluteTolerance; - } - else - { - if (input) - { - tol = this->Tolerance * input->GetLength(); - } - else - { - tol = this->Tolerance; - } - } - - if (this->Locator == nullptr) - { - if (tol == 0.0) - { - this->Locator = vtkMergePoints::New(); - this->Locator->Register(this); - this->Locator->Delete(); - } - else - { - this->Locator = vtkPointLocator::New(); - this->Locator->Register(this); - this->Locator->Delete(); - } - } - else - { - // check that the tolerance wasn't changed from zero to non-zero - if ((tol > 0.0) && (this->GetLocator()->GetTolerance() == 0.0)) - { - this->SetLocator(nullptr); - this->Locator = vtkPointLocator::New(); - this->Locator->Register(this); - this->Locator->Delete(); - } - } -} diff --git a/ThirdParty/paraview/vtkCleanUnstructuredGrid.h b/ThirdParty/paraview/vtkCleanUnstructuredGrid.h deleted file mode 100644 index e13ad9522fb..00000000000 --- a/ThirdParty/paraview/vtkCleanUnstructuredGrid.h +++ /dev/null @@ -1,108 +0,0 @@ -/*========================================================================= - - Program: ParaView - Module: vtkCleanUnstructuredGrid.h - - Copyright (c) Kitware, Inc. - All rights reserved. - See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notice for more information. - -=========================================================================*/ - -/** - * @class vtkCleanUnstructuredGrid - * @brief merge duplicate points - * - * - * vtkCleanUnstructuredGrid is a filter that takes unstructured grid data as - * input and generates unstructured grid data as output. vtkCleanUnstructuredGrid can - * merge duplicate points (with coincident coordinates) using the vtkMergePoints object - * to merge points. - * - * @sa - * vtkCleanPolyData -*/ - -#ifndef vtkCleanUnstructuredGrid_h -#define vtkCleanUnstructuredGrid_h - -//#include "vtkPVVTKExtensionsFiltersGeneralModule.h" //needed for exports -#include "vtkUnstructuredGridAlgorithm.h" - -class vtkIncrementalPointLocator; -class vtkDataSet; - -class /*VTKPVVTKEXTENSIONSFILTERSGENERAL_EXPORT*/ vtkCleanUnstructuredGrid - : public vtkUnstructuredGridAlgorithm -{ -public: - static vtkCleanUnstructuredGrid* New(); - - vtkTypeMacro(vtkCleanUnstructuredGrid, vtkUnstructuredGridAlgorithm); - - // By default ToleranceIsAbsolute is false and Tolerance is - // a fraction of Bounding box diagonal, if true, AbsoluteTolerance is - // used when adding points to locator (merging) - vtkSetMacro(ToleranceIsAbsolute, bool); - vtkBooleanMacro(ToleranceIsAbsolute, bool); - vtkGetMacro(ToleranceIsAbsolute, bool); - - // Specify tolerance in terms of fraction of bounding box length. - // Default is 0.0. - vtkSetClampMacro(Tolerance, double, 0.0, 1.0); - vtkGetMacro(Tolerance, double); - - // Specify tolerance in absolute terms. Default is 1.0. - vtkSetClampMacro(AbsoluteTolerance, double, 0.0, VTK_DOUBLE_MAX); - vtkGetMacro(AbsoluteTolerance, double); - - //@{ - /** - * Set/Get a spatial locator for speeding the search process. By - * default an instance of vtkMergePoints is used. - */ - virtual void SetLocator(vtkIncrementalPointLocator* locator); - vtkGetObjectMacro(Locator, vtkIncrementalPointLocator); - //@} - - // Create default locator. Used to create one when none is specified. - void CreateDefaultLocator(vtkDataSet* input = nullptr); - - // Release locator - void ReleaseLocator() { this->SetLocator(nullptr); } - - //@{ - /** - * Set/get the desired precision for the output types. See the documentation - * for the vtkAlgorithm::DesiredOutputPrecision enum for an explanation of - * the available precision settings. - */ - vtkSetMacro(OutputPointsPrecision, int); - vtkGetMacro(OutputPointsPrecision, int); - //@} - - void PrintSelf(ostream& os, vtkIndent indent) override; - -protected: - vtkCleanUnstructuredGrid() = default; - ~vtkCleanUnstructuredGrid() override; - - // options for managing point merging tolerance - bool ToleranceIsAbsolute = false; - double Tolerance = 0.0; - double AbsoluteTolerance = 1.0; - vtkIncrementalPointLocator* Locator = nullptr; - int OutputPointsPrecision = vtkAlgorithm::DEFAULT_PRECISION; - - int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override; - int FillInputPortInformation(int port, vtkInformation* info) override; - -private: - vtkCleanUnstructuredGrid(const vtkCleanUnstructuredGrid&) = delete; - void operator=(const vtkCleanUnstructuredGrid&) = delete; -}; -#endif From 8776250edb999acefa009741d015c2b059d3f1e9 Mon Sep 17 00:00:00 2001 From: Lars Bilke Date: Wed, 10 Apr 2024 12:54:24 +0200 Subject: [PATCH 03/11] Bump minimum VTK to 9.3 --- .gitignore | 1 + .../cmake/DependenciesExternalProject.cmake | 38 +++++++++++++++---- scripts/cmake/loguru.patch | 10 ----- web/data/versions.json | 3 +- 4 files changed, 34 insertions(+), 18 deletions(-) delete mode 100644 scripts/cmake/loguru.patch diff --git a/.gitignore b/.gitignore index bc89e16a442..d174388ea61 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ Tests/Data/_out web/.netlify CMakeUserPresets.json +scripts/cmake/vtk-*.patch .snakemake diff --git a/scripts/cmake/DependenciesExternalProject.cmake b/scripts/cmake/DependenciesExternalProject.cmake index d1a23f7c094..cf36b592710 100644 --- a/scripts/cmake/DependenciesExternalProject.cmake +++ b/scripts/cmake/DependenciesExternalProject.cmake @@ -404,16 +404,40 @@ elseif(NOT OGS_BUILD_VTK AND (NOT OGS_USE_MKL OR GUIX_BUILD)) find_package(VTK ${ogs.minimum_version.vtk} COMPONENTS ${VTK_COMPONENTS}) endif() if(NOT VTK_FOUND) - if(APPLE AND "${OGS_EXTERNAL_DEPENDENCIES_CACHE}" STREQUAL "") - # Fixes https://stackoverflow.com/questions/9894961 on vismac05: - set(_loguru_patch PATCH_COMMAND git apply - "${PROJECT_SOURCE_DIR}/scripts/cmake/loguru.patch" - ) - message(DEBUG "Applying VTK loguru patch") + file( + DOWNLOAD + https://gitlab.kitware.com/bilke/vtk/-/commit/b70e3e103cf711e080f23171201c7d030187146b.patch + ${PROJECT_SOURCE_DIR}/scripts/cmake/vtk-win.patch + ) + file( + DOWNLOAD + https://gitlab.kitware.com/bilke/vtk/-/commit/70b16fda87f82520fa29b48c6a62bafa405d8ee2.patch + ${PROJECT_SOURCE_DIR}/scripts/cmake/vtk-mac.patch + ) + if("${OGS_EXTERNAL_DEPENDENCIES_CACHE}" STREQUAL "") + set(_vtk_patch PATCH_COMMAND git apply) + if(WIN32) + # Fixes https://gitlab.kitware.com/vtk/vtk/-/issues/19178 + list(APPEND _vtk_patch + "${PROJECT_SOURCE_DIR}/scripts/cmake/vtk-win.patch" + ) + message(STATUS "Applying VTK Win patch") + endif() + if(APPLE) + # Fixes https://stackoverflow.com/questions/9894961 + list(APPEND _vtk_patch + "${PROJECT_SOURCE_DIR}/scripts/cmake/vtk-mac.patch" + ) + message(STATUS "Applying VTK Mac patch") + elseif(UNIX) + # No pacthes on Linux + unset(_vtk_patch) + endif() endif() + BuildExternalProject( VTK ${_vtk_source} CMAKE_ARGS ${VTK_OPTIONS} ${_defaultCMakeArgs} - ${_loguru_patch} ${_cmake_generator} + ${_vtk_patch} ${_cmake_generator} ) message( STATUS diff --git a/scripts/cmake/loguru.patch b/scripts/cmake/loguru.patch deleted file mode 100644 index ec30dd7cb31..00000000000 --- a/scripts/cmake/loguru.patch +++ /dev/null @@ -1,10 +0,0 @@ -diff --git a/ThirdParty/loguru/vtkloguru/CMakeLists.txt b/ThirdParty/loguru/vtkloguru/CMakeLists.txt -index 8a789a0407..440ac619bf 100644 ---- a/ThirdParty/loguru/vtkloguru/CMakeLists.txt -+++ b/ThirdParty/loguru/vtkloguru/CMakeLists.txt -@@ -17,3 +17,5 @@ generate_export_header(loguru - - vtk_module_find_package(PACKAGE Threads) - vtk_module_link(VTK::loguru PRIVATE Threads::Threads ${CMAKE_DL_LIBS}) -+ -+set_target_properties(loguru PROPERTIES CXX_VISIBILITY_PRESET default) diff --git a/web/data/versions.json b/web/data/versions.json index 4105ef768fa..5a3e59ec98f 100644 --- a/web/data/versions.json +++ b/web/data/versions.json @@ -15,7 +15,7 @@ "boost": "1.73.0", "eigen": "3.4.0", "eigen-unsupported": "9441d94dccccd5db8d64179516fdc5b53994a047", - "vtk": "9.1.0", + "vtk": "9.3.0", "petsc": "3.18.6", "qt": "5.14.2", "python": "3.6", @@ -103,6 +103,7 @@ "ogscm": "True" }, "cmake": [ + "VTK_MODULE_ENABLE_VTK_FiltersGeneral=YES", "VTK_MODULE_ENABLE_VTK_FiltersParallel=YES" ] }, From 6e24f0506b4d5ec1eefbf524c7fb5e55028a8dea Mon Sep 17 00:00:00 2001 From: Lars Bilke Date: Wed, 10 Apr 2024 12:55:11 +0200 Subject: [PATCH 04/11] cmake-format --- scripts/cmake/DependenciesExternalProject.cmake | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/scripts/cmake/DependenciesExternalProject.cmake b/scripts/cmake/DependenciesExternalProject.cmake index cf36b592710..12c466155d5 100644 --- a/scripts/cmake/DependenciesExternalProject.cmake +++ b/scripts/cmake/DependenciesExternalProject.cmake @@ -133,7 +133,7 @@ if(OGS_USE_PETSC) set(PETSC_EXECUTABLE_RUNS YES) endif() - # apple clang 15 requires newer petsc, see + # apple clang 15 requires newer petsc, see # https://www.mail-archive.com/petsc-users@mcs.anl.gov/msg46980.html if(APPLE AND ${CMAKE_CXX_COMPILER_VERSION} GREATER_EQUAL 15) set(ogs.minimum_version.petsc 3.20.5) @@ -256,8 +256,10 @@ if(NOT ZLIB_FOUND) if(CMAKE_BUILD_TYPE STREQUAL "Debug") set(_zlib_debug_postfix "d") endif() - # Remove zlib dll and corresponding lib, ZLIB_USE_STATIC_LIBS sometimes does not work - file(REMOVE + # Remove zlib dll and corresponding lib, ZLIB_USE_STATIC_LIBS sometimes + # does not work + file( + REMOVE ${build_dir_ZLIB}/${CMAKE_INSTALL_LIBDIR}/zlib${_zlib_debug_postfix}${CMAKE_STATIC_LIBRARY_SUFFIX} ${build_dir_ZLIB}/${CMAKE_INSTALL_BINDIR}/zlib${_zlib_debug_postfix}${CMAKE_SHARED_LIBRARY_SUFFIX} ) @@ -265,7 +267,9 @@ if(NOT ZLIB_FOUND) set(ZLIB_USE_STATIC_LIBS "ON") set(ZLIB_ROOT ${build_dir_ZLIB}) # Force local zlib build, found netcdf-installed zlib sometimes - set(ZLIB_LIBRARIES ${build_dir_ZLIB}/${CMAKE_INSTALL_LIBDIR}/zlibstatic${_zlib_debug_postfix}${CMAKE_STATIC_LIBRARY_SUFFIX}) + set(ZLIB_LIBRARIES + ${build_dir_ZLIB}/${CMAKE_INSTALL_LIBDIR}/zlibstatic${_zlib_debug_postfix}${CMAKE_STATIC_LIBRARY_SUFFIX} + ) endif() set(_EXT_LIBS ${_EXT_LIBS} ZLIB CACHE INTERNAL "") BuildExternalProject_find_package(ZLIB) @@ -302,8 +306,8 @@ if(WIN32 OR HDF5_USE_STATIC_LIBRARIES) list(APPEND _hdf5_options "-DBUILD_SHARED_LIBS=OFF") endif() -# With apple clang 15 there are errors when the cpm compiled hdf5 -# has a different version than the one bundled with vtk, see +# With apple clang 15 there are errors when the cpm compiled hdf5 has a +# different version than the one bundled with vtk, see # https://gitlab.kitware.com/vtk/vtk/-/issues/19232. if(APPLE AND ${CMAKE_CXX_COMPILER_VERSION} GREATER_EQUAL 15) set(ogs.tested_version.hdf5 1.10.7) From 9e7f8b26774c5fc390aab49dbdf42755d992965f Mon Sep 17 00:00:00 2001 From: Lars Bilke Date: Wed, 10 Apr 2024 12:56:56 +0200 Subject: [PATCH 05/11] Removed ThirdParty/ogs6py. ogs6py is a dependency of OGSTools which depends on OGS. --- .gitmodules | 3 - ProcessLib/HT/Tests.cmake | 11 +- .../generateInvalidMediaForHT.py | 262 ++++++++++++++++++ ThirdParty/ogs6py | 1 - 4 files changed, 266 insertions(+), 11 deletions(-) create mode 100644 Tests/Data/Parabolic/HT/InvalidProjectFiles/generateInvalidMediaForHT.py delete mode 160000 ThirdParty/ogs6py diff --git a/.gitmodules b/.gitmodules index 854c0f5d668..e69de29bb2d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "ThirdParty/ogs6py"] - path = ThirdParty/ogs6py - url = https://github.com/joergbuchwald/ogs6py.git diff --git a/ProcessLib/HT/Tests.cmake b/ProcessLib/HT/Tests.cmake index 96b6b1eeb02..e93012552e9 100644 --- a/ProcessLib/HT/Tests.cmake +++ b/ProcessLib/HT/Tests.cmake @@ -357,12 +357,10 @@ AddTest( ThermalConvection_ts_1_t_0.000000_expected.vtu ThermalConvection_ts_1_t_0.000000.vtu darcy_velocity darcy_velocity 1e-8 1e-13 ) -if(NOT OGS_USE_MPI AND OGS_BUILD_TESTING AND Python_FOUND) - add_custom_target(generate_invalid_project_files_ht - ${Python_EXECUTABLE} - ${PROJECT_SOURCE_DIR}/ThirdParty/ogs6py/generateInvalidMediaForHT.py - generateInvalidMediaForHT.py - WORKING_DIRECTORY ${Data_SOURCE_DIR}/Parabolic/HT/InvalidProjectFiles/) +if(NOT OGS_USE_MPI AND OGS_BUILD_TESTING AND OGS_USE_PIP) + execute_process(COMMAND ${Python_EXECUTABLE} + ${Data_SOURCE_DIR}/Parabolic/HT/InvalidProjectFiles/generateInvalidMediaForHT.py + WORKING_DIRECTORY ${Data_SOURCE_DIR}/Parabolic/HT/InvalidProjectFiles) file(GLOB HT_INVALID_PRJ_FILES ${Data_SOURCE_DIR}/Parabolic/HT/InvalidProjectFiles/*.prj) foreach(ht_invalid_prj_file ${HT_INVALID_PRJ_FILES}) string(REPLACE ${Data_SOURCE_DIR}/Parabolic/HT/InvalidProjectFiles/HT "invalid" ht_invalid_prj_file_short ${ht_invalid_prj_file}) @@ -372,7 +370,6 @@ if(NOT OGS_USE_MPI AND OGS_BUILD_TESTING AND Python_FOUND) EXECUTABLE ogs EXECUTABLE_ARGS ${ht_invalid_prj_file} RUNTIME 1 - DEPENDS generate_invalid_project_files_ht ) set_tests_properties(ogs-HT_${ht_invalid_prj_file_short} PROPERTIES WILL_FAIL TRUE) endforeach() diff --git a/Tests/Data/Parabolic/HT/InvalidProjectFiles/generateInvalidMediaForHT.py b/Tests/Data/Parabolic/HT/InvalidProjectFiles/generateInvalidMediaForHT.py new file mode 100644 index 00000000000..5a9f85a8b5e --- /dev/null +++ b/Tests/Data/Parabolic/HT/InvalidProjectFiles/generateInvalidMediaForHT.py @@ -0,0 +1,262 @@ +from ogs6py import ogs + + +def addSolidPropertiesForHT(omit=""): + if omit != "storage": + model.media.add_property( + medium_id="0", + phase_type="Solid", + name="storage", + type="Constant", + value="0.0", + ) + if omit != "density": + model.media.add_property( + medium_id="0", + phase_type="Solid", + name="density", + type="Constant", + value="0.0", + ) + if omit != "thermal_conductivity": + model.media.add_property( + medium_id="0", + phase_type="Solid", + name="thermal_conductivity", + type="Constant", + value="3.0", + ) + if omit != "specific_heat_capacity": + model.media.add_property( + medium_id="0", + phase_type="Solid", + name="specific_heat_capacity", + type="Constant", + value="0.0", + ) + + +def addAqueousLiquidPropertiesForHT(omit=""): + if omit != "specific_heat_capacity": + model.media.add_property( + medium_id="0", + phase_type="AqueousLiquid", + name="specific_heat_capacity", + type="Constant", + value="0.0", + ) + if omit != "thermal_conductivity": + model.media.add_property( + medium_id="0", + phase_type="AqueousLiquid", + name="thermal_conductivity", + type="Constant", + value="0.65", + ) + if omit != "density": + model.media.add_property( + medium_id="0", + phase_type="AqueousLiquid", + name="density", + type="Constant", + value="1e-3", + ) + if omit != "viscosity": + model.media.add_property( + medium_id="0", + phase_type="AqueousLiquid", + name="viscosity", + type="Constant", + value="1e-3", + ) + + +def addMediumPropertiesForHT(omit=""): + if omit != "thermal_longitudinal_dispersivity": + model.media.add_property( + medium_id="0", + name="thermal_longitudinal_dispersivity", + type="Constant", + value="0.0", + ) + if omit != "thermal_transversal_dispersivity": + model.media.add_property( + medium_id="0", + name="thermal_transversal_dispersivity", + type="Constant", + value="0.0", + ) + if omit != "permeability": + model.media.add_property( + medium_id="0", name="permeability", type="Constant", value="1e-14 0 0 1e-14" + ) + if omit != "porosity": + model.media.add_property( + medium_id="0", name="porosity", type="Constant", value="1e-3" + ) + + +solid_properties = [ + "", + "storage", + "density", + "thermal_conductivity", + "specific_heat_capacity", +] +aqueousfluid_properties = [ + "", + "specific_heat_capacity", + "thermal_conductivity", + "density", + "viscosity", +] +medium_properties = [ + "", + "thermal_longitudinal_dispersivity", + "thermal_transversal_dispersivity", + "permeability", + "porosity", +] + +for solid_property in solid_properties: + for aqueousfluid_property in aqueousfluid_properties: + for medium_property in medium_properties: + if ( + solid_property == "" + and aqueousfluid_property == "" + and medium_property == "" + ): + continue + model = ogs.OGS( + PROJECT_FILE="HT_" + + solid_property + + "_" + + aqueousfluid_property + + "_" + + medium_property + + ".prj" + ) + model.mesh.add_mesh(filename="square_1x1_quad_1e3.vtu") + model.geo.add_geom(filename="square_1x1.gml") + model.processes.set_process( + name="HT", type="HT", integration_order="2", specific_body_force="0 0" + ) + model.processes.add_process_variable( + process_variable="temperature", process_variable_name="temperature" + ) + model.processes.add_process_variable( + process_variable="pressure", process_variable_name="pressure" + ) + model.processes.add_process_variable( + secondary_variable="darcy_velocity", output_name="darcy_velocity" + ) + + addAqueousLiquidPropertiesForHT(aqueousfluid_property) + addSolidPropertiesForHT(solid_property) + addMediumPropertiesForHT(medium_property) + + model.timeloop.add_process( + process="HT", + nonlinear_solver_name="basic_picard", + convergence_type="DeltaX", + norm_type="NORM2", + abstol="1e-15", + time_discretization="BackwardEuler", + ) + model.timeloop.set_stepping( + process="HT", + type="FixedTimeStepping", + t_initial="0", + t_end="1", + repeat="4", + delta_t="0.25", + ) + model.timeloop.add_output( + type="VTK", + prefix="HT_test_", + repeat="1", + each_steps="10", + variables=["temperature", "pressure"], + ) + model.parameters.add_parameter(name="T0", type="Constant", value="0") + model.parameters.add_parameter(name="P0", type="Constant", value="0") + model.parameters.add_parameter( + name="p_Dirichlet_left", type="Constant", value="1" + ) + # model.parameters.add_parameter(name="p_Dirichlet_right", type="Constant", value="-1") + model.parameters.add_parameter( + name="t_Dirichlet_bottom", type="Constant", value="2" + ) + # model.parameters.add_parameter(name="t_Dirichlet_top", type="Constant", value="1") + model.processvars.set_ic( + process_variable_name="temperature", + components="1", + order="1", + initial_condition="T0", + ) + model.processvars.add_bc( + process_variable_name="temperature", + geometrical_set="square_1x1_geometry", + geometry="bottom", + type="Dirichlet", + component="0", + parameter="t_Dirichlet_bottom", + ) + # model.processvars.add_bc(process_variable_name="temperature", + # geometrical_set="square_1x1_geometry", + # geometry="top", + # type="Dirichlet", + # component="1", + # parameter="t_Dirichlet_top") + model.processvars.set_ic( + process_variable_name="pressure", + components="1", + order="1", + initial_condition="P0", + ) + model.processvars.add_bc( + process_variable_name="pressure", + geometrical_set="square_1x1_geometry", + geometry="left", + type="Dirichlet", + component="1", + parameter="p_Dirichlet_left", + ) + # model.processvars.addadd_bcBC(process_variable_name="pressure", + # geometrical_set="square_1x1_geometry", + # geometry="right", + # type="Dirichlet", + # component="1", + # parameter="p_Dirichlet_right") + model.nonlinsolvers.add_non_lin_solver( + name="basic_picard", + type="Picard", + max_iter="4", + linear_solver="general_linear_solver", + ) + model.linsolvers.add_lin_solver( + name="general_linear_solver", + kind="lis", + solver_type="cg", + precon_type="jacobi", + max_iteration_step="10000", + error_tolerance="1e-16", + ) + model.linsolvers.add_lin_solver( + name="general_linear_solver", + kind="eigen", + solver_type="CG", + precon_type="DIAGONAL", + max_iteration_step="10000", + error_tolerance="1e-16", + ) + model.linsolvers.add_lin_solver( + name="general_linear_solver", + kind="petsc", + solver_type="cg", + precon_type="bjacobi", + max_iteration_step="10000", + error_tolerance="1e-16", + prefix="foo", + ) + model.write_input() diff --git a/ThirdParty/ogs6py b/ThirdParty/ogs6py deleted file mode 160000 index a909ed65ad9..00000000000 --- a/ThirdParty/ogs6py +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a909ed65ad9ec99fbe752dd7000f07005ee912ff From 4b65645c373cd9763015dfc53004c6c88c1d7fa4 Mon Sep 17 00:00:00 2001 From: Lars Bilke Date: Wed, 10 Apr 2024 13:00:08 +0200 Subject: [PATCH 06/11] Removed ThirdParty/ --- .codeclimate.yml | 1 - .codespellrc | 2 +- .pre-commit-config.yaml | 8 ++++---- ThirdParty/.clang-tidy | 6 ------ codecov.yml | 1 - pyproject.toml | 2 +- scripts/ci/jobs/build-docs.yml | 2 +- scripts/cmake/DocumentationSetup.cmake | 10 +++------- scripts/test/cppcheck.in.sh | 1 - 9 files changed, 10 insertions(+), 23 deletions(-) delete mode 100644 ThirdParty/.clang-tidy diff --git a/.codeclimate.yml b/.codeclimate.yml index 761a90adf2d..44a58c54ccd 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -1,6 +1,5 @@ version: "2" exclude_patterns: - - "ThirdParty/" - "Tests/" plugins: duplication: diff --git a/.codespellrc b/.codespellrc index 9d57e040fb0..e1e36dbbf41 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,5 +1,5 @@ [codespell] -skip = *.bib,*.css,*.pdf,*.yaml,*.yml,*/.vale,./.git,./GeoLib/IO/XmlIO/OpenGeoSysSTN.xsd,./Tests/Data,./ThirdParty,./web/content/imprint.md,./web/node_modules,./web/public/imprint/index.html,./web/resources,CITATION.cff, +skip = *.bib,*.css,*.pdf,*.yaml,*.yml,*/.vale,./.git,./GeoLib/IO/XmlIO/OpenGeoSysSTN.xsd,./Tests/Data,./web/content/imprint.md,./web/node_modules,./web/public/imprint/index.html,./web/resources,CITATION.cff, ignore-words-list = ba,bu,ket,nd,pris,strat,sur,theis, exclude-file = .codespellexclude uri-ignore-words-list = * diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 19c07b0ec06..e822be2e6b7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ repos: hooks: - id: trailing-whitespace args: [--markdown-linebreak-ext=md, --markdown-linebreak-ext=pandoc] - exclude: "^ThirdParty/.*|^Tests/Data/.*|^web/static|^Documentation/.vale/.*|.*\\.patch" + exclude: "^Tests/Data/.*|^web/static|^Documentation/.vale/.*|.*\\.patch" - id: check-added-large-files args: [--maxkb 1024] - id: check-merge-conflict @@ -24,7 +24,7 @@ repos: rev: 23.1.0 hooks: - id: black - exclude: "ThirdParty|LinearMFront/generate_ref.py" + exclude: "LinearMFront/generate_ref.py" # Run black on markdown notebooks - repo: https://github.com/nbQA-dev/nbQA rev: 1.7.0 @@ -35,7 +35,7 @@ repos: rev: v2.2.2 hooks: - id: codespell - exclude: 'ThirdParty/.*|Tests/Data/.*|.*\.ya?ml|.*\.bib|^web/content/imprint.md|^GeoLib/IO/XmlIO/OpenGeoSysSTN.xsd|^Applications/FileIO/Legacy/OGSIOVer4.cpp|^scripts/cmake/CPM.cmake|Documentation/.vale/.*|.*\.ipynb|.*\.svg' + exclude: 'Tests/Data/.*|.*\.ya?ml|.*\.bib|^web/content/imprint.md|^GeoLib/IO/XmlIO/OpenGeoSysSTN.xsd|^Applications/FileIO/Legacy/OGSIOVer4.cpp|^scripts/cmake/CPM.cmake|Documentation/.vale/.*|.*\.ipynb|.*\.svg' - repo: https://github.com/cheshirekow/cmake-format-precommit rev: v0.6.13 hooks: @@ -56,7 +56,7 @@ repos: name: Run git diff --check entry: git diff --check --cached -- ':!*.md' ':!*.pandoc' ':!*.asc' ':!*.dat' ':!*.ts' language: system - exclude: "ThirdParty/.*|Tests/Data/.*|web/static/images/xsd" + exclude: "Tests/Data/.*|web/static/images/xsd" stages: [commit, manual] - id: file-extensions name: Check file extensions diff --git a/ThirdParty/.clang-tidy b/ThirdParty/.clang-tidy deleted file mode 100644 index 8cd40d73ca6..00000000000 --- a/ThirdParty/.clang-tidy +++ /dev/null @@ -1,6 +0,0 @@ ---- -# Disable all checks, one check has to be enabled. -# Hack: if there is no enabled check clang-tidy (at least in the way it is -# invoked by CMake) prints out its own usage instructions. I have chosen an -# arbitrary check here. -Checks: '-*,boost-use-to-string' diff --git a/codecov.yml b/codecov.yml index 2d0d5456143..3438ad88433 100644 --- a/codecov.yml +++ b/codecov.yml @@ -4,5 +4,4 @@ codecov: ignore: - "Applications/CLI" - "ProcessLib" - - "ThirdParty" - "*Tests/**/*" diff --git a/pyproject.toml b/pyproject.toml index b5a44ff8c31..ab5aa9e0521 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -130,7 +130,7 @@ unfixable = [ "F841", # Removes unused variables ] include = ["*.py", "*.pyi", "**/pyproject.toml", "*.ipynb"] -exclude = ["ThirdParty/", "scripts/doc", "*ci-skip*"] +exclude = ["scripts/doc", "*ci-skip*"] flake8-unused-arguments.ignore-variadic-names = true line-length = 80 diff --git a/scripts/ci/jobs/build-docs.yml b/scripts/ci/jobs/build-docs.yml index 9621169120e..eb47489eb9b 100644 --- a/scripts/ci/jobs/build-docs.yml +++ b/scripts/ci/jobs/build-docs.yml @@ -17,7 +17,7 @@ build docs: - NUM_LIZARD_ISSUES=`cat lizard.txt | wc -l` - echo "lizard_issues $NUM_LIZARD_ISSUES" >> metrics.txt - lizard -l cpp -t 8 --html -o Lizard.html - - lizard -EWordCount -x "./ThirdParty/*" -x "./Tests/*" || true # word-cloud + - lizard -EWordCount -x "./Tests/*" || true # word-cloud # build - cd build - cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DOGS_BUILD_PROCESSES=SteadyStateDiffusion diff --git a/scripts/cmake/DocumentationSetup.cmake b/scripts/cmake/DocumentationSetup.cmake index 88ba06f289e..f663f185fba 100644 --- a/scripts/cmake/DocumentationSetup.cmake +++ b/scripts/cmake/DocumentationSetup.cmake @@ -3,13 +3,9 @@ if(NOT DOXYGEN_FOUND) endif() set(DOXYGEN_EXCLUDE - ${PROJECT_SOURCE_DIR}/ThirdParty - ${PROJECT_SOURCE_DIR}/scripts - ${PROJECT_SOURCE_DIR}/Tests - ${PROJECT_SOURCE_DIR}/Documentation/ProjectFile - ${PROJECT_SOURCE_DIR}/web - ${PROJECT_BINARY_DIR}/_deps - ${PROJECT_BINARY_DIR}/_ext + ${PROJECT_SOURCE_DIR}/scripts ${PROJECT_SOURCE_DIR}/Tests + ${PROJECT_SOURCE_DIR}/Documentation/ProjectFile ${PROJECT_SOURCE_DIR}/web + ${PROJECT_BINARY_DIR}/_deps ${PROJECT_BINARY_DIR}/_ext ) set(DOXYGEN_FILE_PATTERNS *.h *.cpp *.tpp *.dox) set(DOXYGEN_PROJECT_NAME "OGS") diff --git a/scripts/test/cppcheck.in.sh b/scripts/test/cppcheck.in.sh index 2a69b1bde7d..646297ac9c5 100644 --- a/scripts/test/cppcheck.in.sh +++ b/scripts/test/cppcheck.in.sh @@ -12,7 +12,6 @@ ${CPPCHECK_TOOL_PATH} \ --inline-suppr \ -i ${_cpm_dir} --suppress=*:${_cpm_dir}/* \ -i ${PROJECT_BINARY_DIR}/_deps --suppress=*:${PROJECT_BINARY_DIR}/_deps/* \ - -i ${PROJECT_SOURCE_DIR}/ThirdParty --suppress=*:${PROJECT_SOURCE_DIR}/ThirdParty* \ -i ${PROJECT_SOURCE_DIR}/Tests --suppress=*:*Tests/* \ --suppress=missingIncludeSystem \ --template='{\n "description": "{message}",\n "severity": "info",\n "location": {\n "path": "{file}",\n "lines": {\n "begin": {line}\n }\n }\n},' \ From f4cbc0440c32b785be36d81ec6c96a2df7adbee7 Mon Sep 17 00:00:00 2001 From: project_120_bot2 Date: Thu, 11 Apr 2024 08:32:00 +0200 Subject: [PATCH 07/11] [versions] Updated cpm cache info. --- web/data/versions.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/data/versions.json b/web/data/versions.json index 5a3e59ec98f..453a98337bc 100644 --- a/web/data/versions.json +++ b/web/data/versions.json @@ -71,8 +71,8 @@ } }, "cpm": { - "package_file_id": 1515, - "package_file_sha256": "ba39e2ad8e4928db1e74fca54236f97f1bd18f650073c053dd98a1a4a3aa80ce" + "package_file_id": 1517, + "package_file_sha256": "70dd7dc421092ca021bb2c992d919d1a1c91963bbf63cf3cc1fb7d7365f071ab" }, "ext": { "cache_hash": "5063f1593404ca5e61365e327a09cb3a1edcea1c" From 049b2d47d86e6f82ce34c7a32ba47ac475df62d8 Mon Sep 17 00:00:00 2001 From: Lars Bilke Date: Thu, 11 Apr 2024 09:53:56 +0200 Subject: [PATCH 08/11] [cmake] BuildExternalProject checks for already built packages. - CMake configuration is faster when external projects are already build - Fixes multiple application of PATCH_COMMAND (which fails the build --- scripts/cmake/BuildExternalProject.cmake | 54 +++++++++++++++---- scripts/cmake/Dependencies.cmake | 1 + .../cmake/DependenciesExternalProject.cmake | 7 +-- 3 files changed, 50 insertions(+), 12 deletions(-) diff --git a/scripts/cmake/BuildExternalProject.cmake b/scripts/cmake/BuildExternalProject.cmake index 4652b8af01a..22f9d772384 100644 --- a/scripts/cmake/BuildExternalProject.cmake +++ b/scripts/cmake/BuildExternalProject.cmake @@ -1,7 +1,6 @@ # Modified from # https://github.com/Sbte/BuildExternalProject/commit/ce1a70996aa538aac17a6faf07db487c3a238838 -macro(BuildExternalProject_find_package target) - +macro(BuildExternalProject_find_package target required) # Set CMake prefix path so we can look there for the module set(_CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH}) mark_as_advanced(_CMAKE_PREFIX_PATH) @@ -11,7 +10,7 @@ macro(BuildExternalProject_find_package target) if(NOT ${target}_FOUND) # Look for config version if there was no module find_package( - ${target} CONFIG REQUIRED HINTS ${build_dir_${target}} + ${target} CONFIG ${required} HINTS ${build_dir_${target}} NO_DEFAULT_PATH ) endif() @@ -21,28 +20,62 @@ macro(BuildExternalProject_find_package target) unset(_CMAKE_PREFIX_PATH) endmacro() +macro(BuildExternalProject_set_build_dir target argn_string) + + set(build_dir ${PROJECT_BINARY_DIR}/_ext/${target}) + + if(CPM_SOURCE_CACHE) + cmake_path( + IS_PREFIX PROJECT_BINARY_DIR "${CPM_SOURCE_CACHE}" _is_inside_build + ) + if(NOT _is_inside_build) + string(SHA256 _hash "${CMAKE_GENERATOR};${argn_string}") + set(build_dir "${CPM_SOURCE_CACHE}/_ext/${target}/${_hash}") + endif() + endif() + + set(build_dir_${target} "${build_dir}" CACHE INTERNAL "") + + message(STATUS "Building ${target} in ${build_dir_${target}}") + +endmacro() + function(BuildExternalProject target) message(STATUS "┌─ BuildExternalProject ${target}") list(APPEND CMAKE_MESSAGE_INDENT "│ ") - set(build_dir ${PROJECT_BINARY_DIR}/_ext/${target}) + list(FIND ARGN SKIP_FIND _skip_find_index) + if(NOT ${_skip_find_index} EQUAL -1) + set(SKIP_FIND TRUE) + list(REMOVE_AT ARGN ${_skip_find_index}) + endif() string(REPLACE ";" " " ARGN_STRING "${ARGN}") + BuildExternalProject_set_build_dir(${target} ${ARGN_STRING}) + + if(NOT SKIP_FIND) + BuildExternalProject_find_package(${target} "") + endif() + + if(${${target}_FOUND}) + message(STATUS "${target} already built.") + list(POP_BACK CMAKE_MESSAGE_INDENT) + message(STATUS "└─ End BuildExternalProject ${_target}") + return() + endif() + + set(build_dir ${build_dir_${target}}) + if(CPM_SOURCE_CACHE) cmake_path( IS_PREFIX PROJECT_BINARY_DIR "${CPM_SOURCE_CACHE}" _is_inside_build ) if(NOT _is_inside_build) - string(SHA256 _hash "${CMAKE_GENERATOR};${ARGN_STRING}") - set(build_dir "${CPM_SOURCE_CACHE}/_ext/${target}/${_hash}") file(LOCK ${build_dir}/cmake.lock) endif() endif() - message(STATUS "Building ${target} in ${build_dir}") - set(build_dir_${target} "${build_dir}" CACHE INTERNAL "") - file(MAKE_DIRECTORY ${build_dir}) set(CMAKE_LIST_CONTENT @@ -91,6 +124,9 @@ function(BuildExternalProject target) if(EXISTS ${build_dir}/cmake.lock) file(LOCK ${build_dir}/cmake.lock RELEASE) endif() + if(NOT SKIP_FIND) + BuildExternalProject_find_package(${target} REQUIRED) + endif() list(POP_BACK CMAKE_MESSAGE_INDENT) message(STATUS "└─ End BuildExternalProject ${_target}") endfunction() diff --git a/scripts/cmake/Dependencies.cmake b/scripts/cmake/Dependencies.cmake index 87eb28910ae..23af87884e8 100644 --- a/scripts/cmake/Dependencies.cmake +++ b/scripts/cmake/Dependencies.cmake @@ -344,6 +344,7 @@ if(OGS_USE_PETSC) set(CMAKE_REQUIRED_LIBRARIES "${HDF5_LIBRARIES}") check_cxx_symbol_exists(H5Pset_fapl_mpio hdf5.h HAVE_H5Pset_fapl_mpio) unset(CMAKE_REQUIRED_INCLUDES) + unset(CMAKE_REQUIRED_LIBRARIES) if(NOT HAVE_H5Pset_fapl_mpio) message(FATAL_ERROR "HDF5 was not build with MPI support! " "(Enable with HDF5_ENABLE_PARALLEL)" diff --git a/scripts/cmake/DependenciesExternalProject.cmake b/scripts/cmake/DependenciesExternalProject.cmake index 12c466155d5..987bcace57b 100644 --- a/scripts/cmake/DependenciesExternalProject.cmake +++ b/scripts/cmake/DependenciesExternalProject.cmake @@ -100,6 +100,7 @@ if(OGS_USE_MFRONT) "-Denable-testing=OFF" ${_defaultCMakeArgs} "${_tfel_cmake_args}" + SKIP_FIND ) message( STATUS @@ -178,6 +179,7 @@ if(OGS_USE_PETSC) BUILD_IN_SOURCE ON BUILD_COMMAND make -j$ENV{CMAKE_BUILD_PARALLEL_LEVEL} all INSTALL_COMMAND make -j$ENV{CMAKE_BUILD_PARALLEL_LEVEL} install + SKIP_FIND ) message( STATUS @@ -272,7 +274,6 @@ if(NOT ZLIB_FOUND) ) endif() set(_EXT_LIBS ${_EXT_LIBS} ZLIB CACHE INTERNAL "") - BuildExternalProject_find_package(ZLIB) endif() # HDF5 @@ -340,7 +341,8 @@ if(NOT _HDF5_FOUND AND NOT HDF5_FOUND) set(_HDF5_FOUND ON CACHE INTERNAL "") endif() if(_HDF5_FOUND) - BuildExternalProject_find_package(HDF5) + # Somehow needs an extra run of ..._find_package() + BuildExternalProject_find_package(HDF5 REQUIRED) endif() # VTK @@ -448,7 +450,6 @@ if(NOT VTK_FOUND) "ExternalProject_Add(): added package VTK@${ogs.minimum_version.vtk}" ) set(_EXT_LIBS ${_EXT_LIBS} VTK CACHE INTERNAL "") - BuildExternalProject_find_package(VTK) endif() # cmake-lint: disable=C0103 From cc492eec86fb35e5436222637432da1f8efd6e13 Mon Sep 17 00:00:00 2001 From: Lars Bilke Date: Thu, 11 Apr 2024 21:09:59 +0200 Subject: [PATCH 09/11] Prevent duplicated link libraries: -ldl -lm -lm -ldl --- scripts/cmake/Find.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/cmake/Find.cmake b/scripts/cmake/Find.cmake index ba434da7d4e..f61f6be02fc 100644 --- a/scripts/cmake/Find.cmake +++ b/scripts/cmake/Find.cmake @@ -103,7 +103,9 @@ if(OGS_USE_MKL) endif() endif() find_package(BLAS) -find_package(LAPACK) +if(OGS_USE_MKL) + find_package(LAPACK) +endif() if(OGS_USE_MKL) if(GUIX_BUILD) From 1d31ff9b74c97d3fb2fb1f9e0af2ef87725079f2 Mon Sep 17 00:00:00 2001 From: Lars Bilke Date: Fri, 12 Apr 2024 08:30:05 +0200 Subject: [PATCH 10/11] [cmake] Silence linter. --- scripts/cmake/DependenciesExternalProject.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/cmake/DependenciesExternalProject.cmake b/scripts/cmake/DependenciesExternalProject.cmake index 987bcace57b..688dd22d3b7 100644 --- a/scripts/cmake/DependenciesExternalProject.cmake +++ b/scripts/cmake/DependenciesExternalProject.cmake @@ -1,3 +1,7 @@ +# because of ogs.minimum_version variables: +# +# cmake-lint: disable=C0103 + if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.24) cmake_policy(SET CMP0135 NEW) endif() From e180f23937edafd899fb453fe0dd7cdc44341b5b Mon Sep 17 00:00:00 2001 From: Lars Bilke Date: Fri, 12 Apr 2024 09:53:42 +0200 Subject: [PATCH 11/11] [guix] Update ogs channel to get VTK 9.3 --- scripts/ci/jobs/build-guix.yml | 2 ++ scripts/guix/channels.scm | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/ci/jobs/build-guix.yml b/scripts/ci/jobs/build-guix.yml index c62b6f2d36a..a3adf903beb 100644 --- a/scripts/ci/jobs/build-guix.yml +++ b/scripts/ci/jobs/build-guix.yml @@ -13,6 +13,8 @@ build guix: - if: '$CI_COMMIT_BRANCH == "master"' allow_failure: true - if: $CI_MERGE_REQUEST_LABELS =~ /.*ci::guix only.*/ + - changes: + - scripts/guix/channels.scm - when: manual allow_failure: true script: diff --git a/scripts/guix/channels.scm b/scripts/guix/channels.scm index a6731246dd9..33298192c2b 100644 --- a/scripts/guix/channels.scm +++ b/scripts/guix/channels.scm @@ -2,13 +2,13 @@ (name 'guix-ogs) (url "https://gitlab.opengeosys.org/ogs/inf/guix-ogs.git") (branch "master") - (commit "6e99eb6d84706b500e89044cd25393b4e6f3a9d6")) + (commit "151fe23f8610b85a84dbaf6888a5afc1256cbb10")) (channel (name 'guix) (url "https://git.savannah.gnu.org/git/guix.git") (branch "master") (commit - "0c1aa354048f82023e6d2043bfecc4fd58bc9b58") + "6cb181c07f83dfdeae1882208941086f3717a165") (introduction (make-channel-introduction "cdf1d7dded027019f0ebbd5d6f0147b13dfdd28d"