{"id":21525587,"url":"https://github.com/sciinstitute/sci-solver_level-set","last_synced_at":"2025-04-09T23:23:02.400Z","repository":{"id":24345132,"uuid":"27743022","full_name":"SCIInstitute/SCI-Solver_Level-Set","owner":"SCIInstitute","description":"SCI-Solver_Level-Set is a C++/CUDA library written to solve a system of level set equations on unstructured meshes. It is designed to solve the equations quickly by using GPU hardware.","archived":false,"fork":false,"pushed_at":"2019-08-19T18:57:50.000Z","size":34504,"stargazers_count":19,"open_issues_count":1,"forks_count":12,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-24T01:12:27.015Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Cuda","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SCIInstitute.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-09T01:05:31.000Z","updated_at":"2024-04-28T02:10:25.000Z","dependencies_parsed_at":"2022-08-22T16:31:07.873Z","dependency_job_id":null,"html_url":"https://github.com/SCIInstitute/SCI-Solver_Level-Set","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SCIInstitute%2FSCI-Solver_Level-Set","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SCIInstitute%2FSCI-Solver_Level-Set/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SCIInstitute%2FSCI-Solver_Level-Set/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SCIInstitute%2FSCI-Solver_Level-Set/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SCIInstitute","download_url":"https://codeload.github.com/SCIInstitute/SCI-Solver_Level-Set/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248126733,"owners_count":21052017,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-24T01:37:10.909Z","updated_at":"2025-04-09T23:23:02.374Z","avatar_url":"https://github.com/SCIInstitute.png","language":"Cuda","funding_links":[],"categories":[],"sub_categories":[],"readme":"GPUTUM: Level-Set\n====================\n\nGPUTUM Level-Set is a C++/CUDA library written to solve a system of level set equations on unstructured meshes. It is designed to solve the equations quickly by using GPU hardware.\n\nThe code was written by Zhisong Fu at the Scientific Computing and Imaging Institute, \nUniversity of Utah, Salt Lake City, USA. The theory behind this code is published in the papers linked below. \nTable of Contents\n========\n\u003cimg src=\"https://raw.githubusercontent.com/SCIInstitute/SCI-Solver_Level-Set/master/src/Resources/levelset.gif\"  align=\"right\" hspace=\"20\" width=450\u003e\n- [LevelSet Aknowledgements](#levelset-aknowledgements)\n- [Requirements](#requirements)\n- [Building](#building)\u003cbr/\u003e\n\t\t- [Linux / OSX](#linux-and-osx)\u003cbr/\u003e\n\t\t- [Windows](#windows)\u003cbr/\u003e\n- [Running Examples](#running-examples)\n- [Using the Library](#using-the-library)\n- [Testing](#testing)\u003cbr/\u003e\n\n\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\n\n\u003ch4\u003eLevelSet Aknowledgements\u003c/h4\u003e\n**\u003ca href =\"http://onlinelibrary.wiley.com/doi/10.1002/cpe.3320/full\"\u003eFast Parallel Solver for the \nLevelset Equations on Unstructured Meshes\u003c/a\u003e**\u003cbr/\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/SCIInstitute/SCI-Solver_Level-Set/master/src/Resources/sphere.gif\"  align=\"right\" hspace=\"20\" width=460\u003e\n\n**AUTHORS:**\n\u003cbr/\u003eZhisong Fu(*a*) \u003cbr/\u003e\nSergey Yakovlev(*b*) \u003cbr/\u003e\nRobert M. Kirby(*a*) \u003cbr/\u003e\nRoss T. Whitaker(*a*) \u003cbr/\u003e\n\nThis library solves for the LevelSet values on vertices located on a tetrahedral mesh. Several mesh formats\nare supported, and are read by the \u003ca href=\"http://wias-berlin.de/software/tetgen/\"\u003eTetGen Library\u003c/a\u003e. \nThe \u003ca href=\"http://glaros.dtc.umn.edu/gkhome/metis/metis/download\"\u003eMETIS library\u003c/a\u003e is used to partition unstructured \nmeshes. \u003ca href=\"https://code.google.com/p/googletest/\"\u003e\nGoogle Test\u003c/a\u003e is used for testing.\n\u003cbr/\u003e\u003cbr/\u003e\nRequirements\n==============\n\n * Git, CMake (2.8+ recommended), and the standard system build environment tools.\n * You will need a CUDA Compatible Graphics card. See \u003ca href=\"https://developer.nvidia.com/cuda-gpus\"\u003ehere\u003c/a\u003e You will also need to be sure your card has CUDA compute capability of at least 2.0.\n * SCI-Solver_Level-Set is compatible with the latest CUDA toolkit (7.5). Download \u003ca href=\"https://developer.nvidia.com/cuda-downloads\"\u003ehere\u003c/a\u003e.\n * This project has been tested on OpenSuse 13.1 (Bottle) on NVidia GeForce GTX 680 HD, Windows 10 on NVidia GeForce GTX 775M, and OSX 10.10 on NVidia GeForce GTX 775M. \n * If you have a CUDA graphics card equal to or greater than our test machines and are experiencing issues, please contact the repository owners.\n * Windows: You will need Microsoft Visual Studio 2010+ build tools. This document describes the \"NMake\" process.\n * OSX: Please be sure to follow setup for CUDA \u003ca href=\"http://docs.nvidia.com/cuda/cuda-getting-started-guide-for-mac-os-x/#axzz3W4nXNNin\"\u003ehere\u003c/a\u003e. There are several compatability requirements for different MAC machines, including using a different version of CUDA (ie. 5.5).\n\nBuilding\n==============\n\n\u003ch3\u003eLinux and OSX\u003c/h3\u003e\nIn a terminal:\n\n```console\nmkdir SCI-Solver_Level-Set/build\ncd SCI-Solver_Level-Set/build\ncmake ../src\nmake\n```\n\n\u003ch3\u003eWindows\u003c/h3\u003e\nOpen a Visual Studio (32 or 64 bit) Native Tools Command Prompt. \nFollow these commands:\n\n```console\nmkdir C:\\Path\\To\\SCI-Solver_Level-Set\\build\ncd C:\\Path\\To\\SCI-Solver_Level-Set\\build\ncmake -G \"NMake Makefiles\" ..\\src\nnmake\n```\n\n**Note:** For all platforms, you may need to specify your CUDA toolkit location (especially if you have multiple CUDA versions installed):\n\n```console\ncmake -DCUDA_TOOLKIT_ROOT_DIR=\"~/NVIDIA/CUDA-7.5\" ../src\n```\n(Assuming this is the location).\n\n**Note:** If you have compile errors such as \u003ccode\u003eundefined reference: atomicAdd\u003c/code\u003e, it is likely you need to set your compute capability manually. CMake outputs whether compute capability was determined automatically, or if you need to set it manually. The default minimum compute capability is 2.0.\n\n```console\ncmake -DCUDA_COMPUTE_CAPABILITY=20 ../src\nmake\n```\n\nRunning Examples\n==============\n\nYou will need to enable examples in your build to compile and run them.\n\n```console\ncmake -DBUILD_EXAMPLES=ON ../src\nmake\n```\n\nYou will find the example binaries built in the \u003ccode\u003ebuild/examples\u003c/code\u003e directory.\n\nRun the example in the build directory:\n\n```console\nexamples/Example1 \n```\nEach example has a \u003ccode\u003e-h\u003c/code\u003e flag that prints options for that example. \u003cbr/\u003e\n\nFollow the example source code in \u003ccode\u003esrc/examples\u003c/code\u003e to learn how to use the library.\n\u003cbr/\u003e\nTo run examples similar to the paper, the following example calls would do so:\u003cbr/\u003e\n\u003cb\u003e2D LevelSet, Sphere \u003c/b\u003e\u003cbr/\u003e\n\u003ccode\u003eexamples/Example2 -v -i ../src/test/test_data/sphere_1154verts.ply\u003c/code\u003e\u003cbr/\u003e\n\u003cb\u003e2D LevelSet Curvature, Square \u003c/b\u003e\u003cbr/\u003e\n\u003ccode\u003e$ examples/Example2.exe -v -i ../src/test/test_data/SquareMesh_size16.ply -y curvature -o 0.5 -n 1\u003c/code\u003e\u003cbr/\u003e\n\u003cb\u003e3D LevelSet, Torus \u003c/b\u003e \u003cbr/\u003e\n\u003ccode\u003eexamples/Example1 -v -i ../src/test/test_data/torus -y revolve -n 100\u003c/code\u003e\u003cbr/\u003e\n\u003cb\u003e3D LevelSet Curvature, Cube \u003c/b\u003e\u003cbr/\u003e\n\u003ccode\u003e$ examples/Example1.exe -v -i ../src/test/test_data/CubeMesh_size256step8_correct -y curvature -o 0.5 -n 1 -w 128\u003c/code\u003e\u003cbr/\u003e\n\n**NOTE** All examples output a set of \u003ccode\u003eresult.vtk\u003c/code\u003e VTK files in the current directory \nnumbered with the time step iterations. These files are easily viewed via VTK readers like Paraview.\nYou can clip and add iso-values to more distinctly visualize the result. Opening the set of files\nat one time allows you to run a time sequence to view the iteration steps.\n\nUsing the Library\n==============\n\nA basic usage of the library links to the \u003ccode\u003eLEVELSET_CORE\u003c/code\u003e\nlibrary during build and includes the headers needed, which are usually no more than:\n\n```c++\n#include \u003cLevelSet.h\u003e\n```\n\nThen a program would setup the LevelSet parameters using the \n\u003ccode\u003e\"LevelSet object\"\u003c/code\u003e object and call \n\u003ccode\u003eobject.solveLevelSet()\u003c/code\u003e to generate\nthe array of vertex values per iteration.\n\nHere is a minimal usage example (using a tet mesh).\u003cbr/\u003e\n```c++\n#include \u003cLevelSet.h\u003e\n#include \u003ciostream\u003e\nint main(int argc, char *argv[])\n{\n  LevelSet data(false); // tet mesh, not a tri mesh\n  //the below means ~/my_tet_mesh.node \u0026 ~/my_tet_mesh.ele\n  data.filename_ = \"~/my_tet_mesh\"; \n  //Run the solver\n  data.solveLevelSet(data);\n  //now use the result\n  data.writeVTK();\n  return 0;\n}\n```\n\nThe following accessor functions are available before running the solver:\n```c++\nvoid LevelSet::initializeVertices(std::vector\u003cfloat\u003e values);\nvoid LevelSet::initializeAdvection(std::vector\u003cpoint\u003e values);\nvoid LevelSet::initializeMesh();\n```\nThe following accessor functions are available after running the solver:\n```c++\nstd::vector \u003c float \u003e LevelSet::getResultAtIteration(size_t i);\nsize_t LevelSet::numIterations(); \n```\nYou can also access the results and the mesh directly after running the solver:\n```c++\nTetMesh * LevelSet::tetMesh_;\nTriMesh * LevelSet::triMesh_;\n// AND\nstd::vector \u003c std::vector \u003c LevelsetValueType \u003e \u003e LevelSet::time_values_;\n```\n\n\u003ch3\u003eLevelSet Options\u003c/h3\u003e\n\n```C++\n  class LevelSet {\n      bool verbose_;                    //option to set for runtime verbosity [Default false]\n      std::string filename_;            //the input tet mesh filename         [Default ../src/test/test_data/sphere334\n      int partitionType_;               //0 for unstructured, 1 for square    [Default 0]\n      int numSteps_;                    //The number of timed steps to take   [Default 10]\n      double timeStep_;                 //The length of time for a time step  [Default 1.0]\n      int insideIterations_;            //The number of inner iterations      [Default 1]\n      int blockSize_  ;                 //If structured, the block size       [Default 16]\n      int sideLengths_;                 //If structured, the cube size        [Default 16]\n      LevelsetValueType bandwidth_;     //The algorithm bandwidth             [Default 16.]\n      int metisSize_;                   //If unstructured, # of METIS patches [Default 16]\n      int isTriMesh_;                   //If this is a triangle mesh          [Default true]\n      ...\n  };\n```\n\u003cbr/\u003e\nYou will need to make sure your CMake/Makfile/Build setup knows where \nto point for the library and header files. See the examples and their CMakeLists.txt.\u003cbr/\u003e\u003cbr/\u003e\n\nTesting\n==============\nThe repo comes with a set of regression tests to see if recent changes break \nexpected results. To build the tests, you will need to set \n\u003ccode\u003eBUILD_TESTING\u003c/code\u003e to \"ON\" in either \u003ccode\u003eccmake\u003c/code\u003e or when calling CMake:\n\n```c++\ncmake -DBUILD_TESTING=ON ../src\n```\nAfter building, run \u003ccode\u003emake test\u003c/code\u003e or \u003ccode\u003ectest\u003c/code\u003e in the build directory to run tests.\u003cbr/\u003e\n**NOTE** No regression tests have been implemented for this library yet.\n\u003ch4\u003eWindows\u003c/h4\u003e\nThe gtest library included in the repo needs to be built with \nforced shared libraries on Windows, so use the following:\n\n```c++\ncmake -DBUILD_TESTING=ON -Dgtest_forced_shared_crt=ON ../src\n```\nBe sure to include all other necessary CMake definitions as annotated above.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsciinstitute%2Fsci-solver_level-set","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsciinstitute%2Fsci-solver_level-set","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsciinstitute%2Fsci-solver_level-set/lists"}