├── .clang-format ├── .github └── workflows │ ├── doxygen.yml │ ├── indentation.yml │ └── tests.yml ├── .gitignore ├── CMakeLists.txt ├── LICENSE ├── NACA_CAD_FILES ├── Color_1.iges ├── Color_2.iges ├── Color_3.iges ├── Color_4.iges ├── Curve_1.iges └── Curve_2.iges ├── NACA_FILES ├── Color_1.iges ├── Color_2.iges ├── Color_3.iges ├── Color_4.iges ├── Curve_1.iges ├── Curve_2.iges ├── naca0012.inp └── parameter_bem.prm ├── README.md ├── VERSION ├── docker └── Dockerfile ├── docs ├── Doxyfile └── logo │ ├── logo.png │ └── logo_small.png ├── grids ├── circle.inp ├── coarse_cube.inp ├── coarse_cube_double_nodes.inp ├── coarse_sphere.inp ├── coarse_sphere_double_nodes.inp ├── coarse_straight_cube.inp ├── cosine.inp ├── naca0012.inp └── sphere.inp ├── include ├── ass_leg_function.h ├── bem_fma.h ├── bem_problem.h ├── bem_problem_access.h ├── boundary_conditions.h ├── cached_nurbs_patch_manifold.h ├── computational_domain.h ├── constrained_matrix.h ├── driver.h ├── laplace_kernel.h ├── local_expansion.h ├── local_expansion_coeff.h ├── multipole_expansion.h ├── octree_block.h ├── singular_kernel_integral.h ├── time_integrator.h └── true_constrained_matrix.h ├── scripts ├── check_indentation.sh ├── check_test ├── docker.sh ├── dr.sh ├── indent ├── run_docker.sh ├── script_convergence_global.sh ├── script_convergence_local.sh └── script_threads.sh ├── source ├── ass_leg_function.cc ├── bem_fma.cc ├── bem_problem.cc ├── boundary_conditions.cc ├── cached_nurbs_patch_manifold.cc ├── computational_domain.cc ├── driver.cc ├── exp_example.cc.tmp ├── local_expansion.cc ├── local_expansion_coeff.cc ├── main.cc ├── multipole_expansion.cc ├── octree_block.cc └── singular_kernel_integral.cc └── tests ├── CMakeLists.txt ├── cad_import_and_curvature_refinement.cc ├── cad_import_and_curvature_refinement.nooutput ├── hypersingular_integral.cc ├── hypersingular_integral.output ├── hypersingular_integral_curved_cell.cc ├── hypersingular_integral_curved_cell.output ├── local_expansion_copy.cc ├── local_expansion_copy.output ├── local_expansion_creation_and_evaluation.cc ├── local_expansion_creation_and_evaluation.output ├── local_expansion_translation.cc ├── local_expansion_translation.output ├── multipole_expansion_copy.cc ├── multipole_expansion_copy.output ├── multipole_expansion_creation_and_evaluation.cc ├── multipole_expansion_creation_and_evaluation.output ├── multipole_expansion_creation_and_evaluation_neumann_kernel.cc ├── multipole_expansion_creation_and_evaluation_neumann_kernel.output ├── multipole_expansion_translation.cc ├── multipole_expansion_translation.output ├── parameter_cad_import_and_curvature_refinement.prm ├── parameters_conv_sphere.prm ├── strongly_singular_integral.cc ├── strongly_singular_integral.output ├── template.cc ├── testData └── Revolution_1.iges ├── tests.h ├── vectorial_dof_handler_64_bits.cc └── vectorial_dof_handler_64_bits.with_64bit_indices=true.output /.clang-format: -------------------------------------------------------------------------------- 1 | # 2 | # The clang-format (Clang 16) style file used by deal.II. 3 | # 4 | 5 | AccessModifierOffset: -2 6 | 7 | AlignAfterOpenBracket: Align 8 | AlignConsecutiveAssignments: true 9 | AlignConsecutiveDeclarations: true 10 | AlignEscapedNewlines: Left 11 | AlignOperands: true 12 | AlignTrailingComments: true 13 | 14 | AllowAllParametersOfDeclarationOnNextLine: false 15 | AllowShortBlocksOnASingleLine: false 16 | AllowShortCaseLabelsOnASingleLine: false 17 | AllowShortFunctionsOnASingleLine: None 18 | AllowShortIfStatementsOnASingleLine: false 19 | AllowShortLoopsOnASingleLine: false 20 | 21 | AlwaysBreakAfterReturnType: All 22 | AlwaysBreakBeforeMultilineStrings: false 23 | AlwaysBreakTemplateDeclarations: true 24 | 25 | BinPackArguments: false 26 | BinPackParameters: false 27 | 28 | BraceWrapping: 29 | AfterCaseLabel: true 30 | AfterClass: true 31 | AfterControlStatement: Always 32 | AfterEnum: true 33 | AfterExternBlock: true 34 | AfterFunction: true 35 | AfterNamespace: true 36 | AfterStruct: true 37 | AfterUnion: true 38 | BeforeCatch: true 39 | BeforeElse: true 40 | BeforeLambdaBody: false 41 | BeforeWhile: true 42 | IndentBraces: true 43 | SplitEmptyFunction: false 44 | SplitEmptyRecord: false 45 | SplitEmptyNamespace: false 46 | 47 | BreakBeforeBinaryOperators: None 48 | BreakBeforeBraces: Custom 49 | BreakBeforeInheritanceComma: false 50 | BreakBeforeTernaryOperators: false 51 | BreakConstructorInitializers: BeforeComma 52 | BreakStringLiterals: false 53 | 54 | ColumnLimit: 80 55 | 56 | CompactNamespaces: false 57 | 58 | ConstructorInitializerIndentWidth: 2 59 | 60 | ContinuationIndentWidth: 2 61 | 62 | Cpp11BracedListStyle: true 63 | 64 | DerivePointerAlignment: false 65 | 66 | FixNamespaceComments: true 67 | 68 | IncludeBlocks: Regroup 69 | IncludeCategories: 70 | # config.h must always be first: 71 | - Regex: "deal.II/base/config.h" 72 | Priority: -1 73 | # deal.II folders in sorted order: 74 | - Regex: "deal.II/algorithms/.*\\.h" 75 | Priority: 100 76 | - Regex: "deal.II/arborx/.*\\.h" 77 | Priority: 110 78 | - Regex: "deal.II/base/.*\\.h" 79 | Priority: 120 80 | - Regex: "deal.II/boost_adaptors/.*\\.h" 81 | Priority: 125 82 | - Regex: "deal.II/differentiation/.*\\.h" 83 | Priority: 130 84 | - Regex: "deal.II/distributed/.*\\.h" 85 | Priority: 140 86 | - Regex: "deal.II/dofs/.*\\.h" 87 | Priority: 150 88 | - Regex: "deal.II/fe/.*\\.h" 89 | Priority: 160 90 | - Regex: "deal.II/gmsh/.*\\.h" 91 | Priority: 170 92 | - Regex: "deal.II/grid/.*\\.h" 93 | Priority: 180 94 | - Regex: "deal.II/hp/.*\\.h" 95 | Priority: 190 96 | - Regex: "deal.II/integrators/.*\\.h" 97 | Priority: 200 98 | - Regex: "deal.II/lac/.*\\.h" 99 | Priority: 210 100 | - Regex: "deal.II/matrix_free/.*\\.h" 101 | Priority: 220 102 | - Regex: "deal.II/meshworker/.*\\.h" 103 | Priority: 230 104 | - Regex: "deal.II/multigrid/.*\\.h" 105 | Priority: 240 106 | - Regex: "deal.II/non_matching/.*\\.h" 107 | Priority: 250 108 | - Regex: "deal.II/numerics/.*\\.h" 109 | Priority: 260 110 | - Regex: "deal.II/opencascade/.*\\.h" 111 | Priority: 270 112 | - Regex: "deal.II/optimization/.*\\.h" 113 | Priority: 280 114 | - Regex: "deal.II/particles/.*\\.h" 115 | Priority: 290 116 | - Regex: "deal.II/physics/.*\\.h" 117 | Priority: 300 118 | - Regex: "deal.II/sundials/.*\\.h" 119 | Priority: 310 120 | - Regex: "deal.II/trilinos/.*\\.h" 121 | Priority: 320 122 | # put boost right after deal: 123 | - Regex: "" 124 | Priority: 500 125 | # try to group PETSc headers: 126 | - Regex: "" 127 | Priority: 1000 128 | # try to catch all third party headers and put them after deal.II but before 129 | # standard headers: 130 | - Regex: "<.*\\.(h|hpp|hxx)>" 131 | Priority: 2000 132 | # match all standard headers. Things like '#include ' should be 133 | # surrounded by #ifdef checks (which will not be merged by clang-format) so they 134 | # should not be caught here 135 | - Regex: "<[a-z_]+>" 136 | Priority: 100000 137 | # make sure that "../tests.h" appears before all other local include files 138 | # such that replacing Assert in tests also applies to the testing header files. 139 | - Regex: "\\.\\./tests\\.h" 140 | Priority: 200000 141 | 142 | IndentCaseLabels: true 143 | IndentPPDirectives: AfterHash 144 | IndentWidth: 2 145 | 146 | IndentWrappedFunctionNames: false 147 | 148 | KeepEmptyLinesAtTheStartOfBlocks: false 149 | 150 | Language: Cpp 151 | 152 | MaxEmptyLinesToKeep: 3 153 | 154 | NamespaceIndentation: All 155 | 156 | PenaltyBreakBeforeFirstCallParameter: 90 157 | 158 | PointerAlignment: Right 159 | 160 | ReflowComments: true 161 | CommentPragmas: '( \| |\*--|
  • |@ref | @p |@param |@name |@returns |@warning |@ingroup |@author |@date |@related |@relates |@relatesalso |@deprecated |@image |@return |@brief |@attention |@copydoc |@addtogroup |@todo |@tparam |@see |@note |@skip |@skipline |@until |@line |@dontinclude |@include)' 162 | 163 | QualifierAlignment: Left 164 | 165 | SortIncludes: true 166 | SortUsingDeclarations: true 167 | 168 | SpaceAfterCStyleCast: false 169 | SpaceAfterTemplateKeyword: true 170 | SpaceBeforeAssignmentOperators: true 171 | SpaceBeforeParens: ControlStatements 172 | SpaceInEmptyParentheses: false 173 | SpacesBeforeTrailingComments: 1 174 | SpacesInAngles: false 175 | SpacesInCStyleCastParentheses: false 176 | SpacesInContainerLiterals: false 177 | SpacesInParentheses: false 178 | SpacesInSquareBrackets: false 179 | 180 | Standard: c++20 181 | 182 | TabWidth: 2 183 | 184 | UseTab: Never 185 | -------------------------------------------------------------------------------- /.github/workflows/doxygen.yml: -------------------------------------------------------------------------------- 1 | name: Doxygen 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | 7 | jobs: 8 | build: 9 | runs-on: ubuntu-latest 10 | 11 | steps: 12 | - uses: actions/checkout@v2 13 | - name: Get deal.tag 14 | run: | 15 | wget https://www.dealii.org/developer/doxygen/deal.tag 16 | 17 | - name: Build Doxygen documentation 18 | uses: mattnotmitt/doxygen-action@v1.1.0 19 | with: 20 | doxyfile-path: "./docs/Doxyfile" 21 | working-directory: "." 22 | 23 | - name: Publish Doxygen documentation 24 | uses: peaceiris/actions-gh-pages@v3 25 | with: 26 | github_token: ${{ secrets.GITHUB_TOKEN }} 27 | publish_dir: ./doc/html/ 28 | -------------------------------------------------------------------------------- /.github/workflows/indentation.yml: -------------------------------------------------------------------------------- 1 | name: Indent 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | build: 11 | 12 | runs-on: ubuntu-latest 13 | container: 14 | image: dealii/dealii:v9.6.0-jammy 15 | options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 16 | 17 | steps: 18 | - uses: actions/checkout@v2 19 | - name: Check indentation 20 | run: | 21 | git config --global --add safe.directory /__w/pi-BEM/pi-BEM 22 | ./scripts/check_indentation.sh -------------------------------------------------------------------------------- /.github/workflows/tests.yml: -------------------------------------------------------------------------------- 1 | name: GitHub CI 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | debug: 11 | 12 | runs-on: ubuntu-latest 13 | 14 | container: 15 | image: dealii/dealii:v9.6.0-jammy 16 | options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 17 | 18 | steps: 19 | - uses: actions/checkout@v2 20 | - name: Test debug 21 | run: | 22 | rm -rf build_linux_debug 23 | mkdir build_linux_debug 24 | cd build_linux_debug 25 | cmake .. -GNinja -DCMAKE_BUILD_TYPE=Debug 26 | ninja 27 | ctest -N 28 | ctest --output-on-failure 29 | 30 | release: 31 | 32 | runs-on: ubuntu-latest 33 | 34 | container: 35 | image: dealii/dealii:v9.6.0-jammy 36 | options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 37 | 38 | steps: 39 | - uses: actions/checkout@v2 40 | - name: Test release 41 | run: | 42 | rm -rf build_linux_release 43 | mkdir build_linux_release 44 | cd build_linux_release 45 | cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release 46 | ninja 47 | ctest -N 48 | ctest --output-on-failure -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | build/ 3 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## 2 | # CMake script for large project, with one executable 3 | # and a library of objects 4 | # 5 | # The structure of the directory is assumed to be: 6 | # ./source: containing implementations and one file with "int main()" 7 | # ./include: containing all class declarations 8 | # ./tests: containing pairs of files: test.cc/test.output to test 9 | # 10 | # If you set the environemnt variable D2K_DIR, 11 | # everything will work out of the box 12 | ## 13 | 14 | # Set the name of the project and target 15 | # If your application follows the structure above, you don't need to 16 | # specify anything else. 17 | SET(TARGET bem_fma) 18 | SET(_main source/main.cc) 19 | 20 | # Set the _main variable to empty if you don't want an executable 21 | # but only a library 22 | #SET(_main "") 23 | 24 | ############################################################ 25 | # Normally you shouldn't need to change anything below. 26 | ############################################################ 27 | # Declare all source files the target consists of: 28 | file(GLOB _files source/*cc) 29 | 30 | # Don't compile the main file into the library 31 | IF(NOT "${_main}" STREQUAL "") 32 | LIST(REMOVE_ITEM _files 33 | ${CMAKE_CURRENT_SOURCE_DIR}/${_main} 34 | ) 35 | ENDIF() 36 | 37 | 38 | CMAKE_MINIMUM_REQUIRED(VERSION 3.13.4) 39 | 40 | FIND_PACKAGE(deal.II 9.5.0 REQUIRED 41 | HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} 42 | ) 43 | 44 | IF(DEFINED CMAKE_BUILD_TYPE) 45 | SET(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING 46 | "Choose the type of build, options are: Debug, Release or DebugRelease" 47 | ) 48 | ELSE() 49 | SET(CMAKE_BUILD_TYPE ${DEAL_II_BUILD_TYPE} CACHE STRING 50 | "Choose the type of build, options are: Debug, Release or DebugRelease" 51 | ) 52 | ENDIF() 53 | 54 | DEAL_II_INITIALIZE_CACHED_VARIABLES() 55 | 56 | 57 | PROJECT(${TARGET}) 58 | 59 | if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") 60 | set(CMAKE_MACOSX_RPATH 1) 61 | endif() 62 | 63 | OPTION(BEM_ENABLE_TESTING 64 | "Enable deal.II style tests in this application." ON) 65 | 66 | 67 | # We one library and one target for each type of deal.II library 68 | # we found. If you compiled deal.II with both Release and Debug 69 | # mode, this will generate both Release and Debug programs for you 70 | # The debug library and program are postfixed with ".g" 71 | SET(_d2_build_types "Release;Debug") 72 | SET(Release_postfix "") 73 | SET(Debug_postfix ".g") 74 | 75 | FOREACH(_build_type ${_d2_build_types}) 76 | # Postfix to use everywhere 77 | SET(_p "${${_build_type}_postfix}") 78 | # Only build this type, if deal.II was compiled with it. 79 | IF(CMAKE_BUILD_TYPE MATCHES "${_build_type}" AND 80 | DEAL_II_BUILD_TYPE MATCHES "${_build_type}") 81 | MESSAGE("-- Found ${_build_type} version of deal.II.") 82 | 83 | SET(_lib "${TARGET}-lib${_p}") 84 | MESSAGE("-- Configuring library ${_lib}") 85 | 86 | STRING(TOUPPER "${_build_type}" _BUILD_TYPE) 87 | 88 | # Add all files, except the main file, to the library 89 | ADD_LIBRARY(${_lib} SHARED ${_files}) 90 | FOREACH(_dim 2 3) 91 | SET(_exe "${TARGET}_${_dim}d${${_build_type}_postfix}") 92 | MESSAGE("-- Configuring executable ${_exe}") 93 | ADD_EXECUTABLE(${_exe} ${_main}) 94 | target_compile_definitions(${_exe} PUBLIC DEAL_II_DIMENSION=${_dim}) 95 | TARGET_LINK_LIBRARIES(${_exe} ${_lib}) 96 | DEAL_II_SETUP_TARGET(${_exe} ${_BUILD_TYPE}) 97 | ENDFOREACH() 98 | 99 | 100 | 101 | DEAL_II_SETUP_TARGET(${_lib} ${_BUILD_TYPE}) 102 | SET(TEST_LIBRARIES_${_BUILD_TYPE} ${_lib}) 103 | ENDIF() 104 | ENDFOREACH() 105 | 106 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include) 107 | 108 | if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/tests AND BEM_ENABLE_TESTING) 109 | ADD_SUBDIRECTORY(tests) 110 | ENABLE_TESTING() 111 | endif() 112 | 113 | 114 | # Doxygen 115 | if(EXISTS ${CMAKE_SOURCE_DIR}/docs/Doxyfile) 116 | find_package(Doxygen) 117 | if(DOXYGEN_FOUND) 118 | add_custom_target(doc 119 | ${DOXYGEN_EXECUTABLE} ${CMAKE_SOURCE_DIR}/docs/Doxyfile 120 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} 121 | COMMENT "Generating API documentation with Doxygen" VERBATIM 122 | ) 123 | endif(DOXYGEN_FOUND) 124 | endif() 125 | 126 | 127 | message(STATUS "DEAL_II_INCLUDE_DIRECTORIES=${deal.II_INCLUDE_DIRECTORIES}") 128 | 129 | ADD_CUSTOM_TARGET(indent 130 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} 131 | COMMAND ./scripts/indent 132 | ) 133 | -------------------------------------------------------------------------------- /NACA_CAD_FILES/Curve_2.iges: -------------------------------------------------------------------------------- 1 | S0000001 2 | ,,31HOpen CASCADE IGES processor 6.5,13HFilename.iges, G0000001 3 | 16HOpen CASCADE 6.5,31HOpen CASCADE IGES processor 6.5,32,308,15,308,15,G0000002 4 | ,1.,6,1HM,1,0.01,15H20161205.163638,1E-07,2.500027,5Hamola,,11,0, G0000003 5 | 15H20161205.163638,; G0000004 6 | 102 1 0 0 0 0 0 000000000D0000001 7 | 102 0 0 1 0 0D0000002 8 | 126 2 0 0 0 0 0 000010000D0000003 9 | 126 0 0 56 0 0D0000004 10 | 126 58 0 0 0 0 0 000010000D0000005 11 | 126 0 0 61 0 0D0000006 12 | 102,2,3,5; 0000001P0000001 13 | 126,68,3,1,0,1,0,0.,0.,0.,0.,4.299843718E-03,8.821244054E-03, 0000003P0000002 14 | 1.38279149E-02,1.951206163E-02,2.599879247E-02,3.336711555E-02, 0000003P0000003 15 | 4.166185081E-02,5.090790348E-02,6.111402071E-02,7.228008202E-02, 0000003P0000004 16 | 8.439776121E-02,9.745288036E-02,0.111426179,0.126293482, 0000003P0000005 17 | 0.142029186,0.158603159,0.17598219,0.194132445,0.213015741, 0000003P0000006 18 | 0.232592439,0.252820384,0.273656127,0.295054734,0.316968995, 0000003P0000007 19 | 0.339349285,0.362145645,0.385305779,0.408779071,0.432510563, 0000003P0000008 20 | 0.456445078,0.480528177,0.50470317,0.528915244,0.553106307, 0000003P0000009 21 | 0.577221181,0.601203641,0.624995215,0.648542475,0.671789018, 0000003P0000010 22 | 0.694680101,0.717161282,0.73918187,0.760688338,0.781629802, 0000003P0000011 23 | 0.801957849,0.821624613,0.840583516,0.858789608,0.876200357, 0000003P0000012 24 | 0.892772862,0.908470273,0.923254847,0.937089691,0.949943842, 0000003P0000013 25 | 0.961785707,0.972587263,0.982322707,0.990969196,0.998505136, 0000003P0000014 26 | 1.004912747,1.010176225,1.014283411,1.017224707,1.018991773, 0000003P0000015 27 | 1.019581502,1.029660569,1.029660569,1.029660569,1.029660569,1., 0000003P0000016 28 | 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1., 0000003P0000017 29 | 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1., 0000003P0000018 30 | 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1., 0000003P0000019 31 | 1.,1.,1.,1.,1.,0.,2.5,0.,-1.232957866E-05,2.5,1.453715274E-03, 0000003P0000020 32 | 4.143242186E-04,2.5,4.378902723E-03,2.235125045E-03,2.5, 0000003P0000021 33 | 8.66459269E-03,5.228437791E-03,2.5,1.277529677E-02, 0000003P0000022 34 | 9.340486677E-03,2.5,1.674874281E-02,1.456557979E-02,2.5, 0000003P0000023 35 | 2.059064811E-02,2.089225679E-02,2.5,2.430912029E-02, 0000003P0000024 36 | 2.831359267E-02,2.5,2.789727674E-02,3.681530669E-02,2.5, 0000003P0000025 37 | 3.134783322E-02,4.638061443E-02,2.5,3.465077648E-02, 0000003P0000026 38 | 5.698910322E-02,2.5,3.779471735E-02,6.861738574E-02,2.5, 0000003P0000027 39 | 4.076920911E-02,8.123976577E-02,2.5,4.356092828E-02, 0000003P0000028 40 | 9.482674417E-02,2.5,4.616041067E-02,0.109347051,2.5, 0000003P0000029 41 | 4.855788201E-02,0.124767407,2.5,5.074136007E-02,0.141051488,2.5, 0000003P0000030 42 | 5.270677469E-02,0.15816175,2.5,5.444613698E-02,0.176058439,2.5, 0000003P0000031 43 | 5.595284873E-02,0.194699946,2.5,5.722417149E-02,0.214042373,2.5, 0000003P0000032 44 | 5.825984015E-02,0.234040689,2.5,5.90569519E-02,0.254648232,2.5, 0000003P0000033 45 | 5.962123417E-02,0.275817329,2.5,5.99501899E-02,0.297498377,2.5, 0000003P0000034 46 | 6.005376045E-02,0.319640631,2.5,5.993660239E-02,0.342191945,2.5, 0000003P0000035 47 | 5.960567747E-02,0.365100197,2.5,5.907028682E-02,0.388311907,2.5, 0000003P0000036 48 | 5.833986887E-02,0.411773032,2.5,5.74274162E-02,0.435428427,2.5, 0000003P0000037 49 | 5.634305875E-02,0.459222651,2.5,5.509887611E-02,0.483100675,2.5, 0000003P0000038 50 | 5.370845121E-02,0.507006287,2.5,5.218277959E-02,0.530884155,2.5, 0000003P0000039 51 | 5.053659569E-02,0.554678537,2.5,4.878304895E-02,0.578333517,2.5, 0000003P0000040 52 | 4.693313743E-02,0.601794149,2.5,4.500171132E-02,0.625005343,2.5, 0000003P0000041 53 | 4.300110502E-02,0.647913008,2.5,4.094026701E-02,0.670463502,2.5, 0000003P0000042 54 | 3.883623394E-02,0.69260422,2.5,3.669588469E-02,0.714283747,2.5, 0000003P0000043 55 | 3.453408494E-02,0.735451108,2.5,3.235762435E-02,0.756057127,2.5, 0000003P0000044 56 | 3.018328583E-02,0.77605323,2.5,2.801509871E-02,0.7953935,2.5, 0000003P0000045 57 | 2.586855724E-02,0.814032153,2.5,2.374942658E-02,0.831926243,2.5, 0000003P0000046 58 | 2.167290838E-02,0.84903296,2.5,1.964430573E-02,0.865312977,2.5, 0000003P0000047 59 | 1.767577089E-02,0.880728383,2.5,1.577758992E-02,0.89524306,2.5, 0000003P0000048 60 | 1.395823595E-02,0.908822977,2.5,1.22271187E-02,0.921436519,2.5, 0000003P0000049 61 | 1.059634975E-02,0.933054022,2.5,9.070053083E-03,0.943648594,2.5, 0000003P0000050 62 | 7.660480161E-03,0.95319555,2.5,6.374252092E-03,0.961672699,2.5, 0000003P0000051 63 | 5.220603486E-03,0.969059966,2.5,4.204466917E-03,0.975339844,2.5, 0000003P0000052 64 | 3.332425827E-03,0.980498373,2.5,2.613906371E-03,0.984522915,2.5, 0000003P0000053 65 | 2.048029985E-03,0.987404321,2.5,1.641219034E-03,0.989136015,2.5, 0000003P0000054 66 | 1.396636059E-03,0.993200341,2.5,8.198672984E-04,0.996688072,2.5, 0000003P0000055 67 | 3.323139682E-04,1.,2.5,0.,0.,1.029660569,-1.331312692E-18,1., 0000003P0000056 68 | 5.453056785E-15; 0000003P0000057 69 | 126,68,3,1,0,1,0,0.,0.,0.,0.,1.007906742E-02,1.066879617E-02, 0000005P0000058 70 | 1.243586295E-02,1.537715824E-02,1.948434462E-02,2.474782218E-02, 0000005P0000059 71 | 3.115543391E-02,3.8691373E-02,4.733786281E-02,5.707330676E-02, 0000005P0000060 72 | 6.78748623E-02,7.971672778E-02,9.257087843E-02,0.106405722, 0000005P0000061 73 | 0.121190296,0.136887707,0.153460212,0.170870961,0.189077054, 0000005P0000062 74 | 0.208035957,0.22770272,0.248030768,0.268972232,0.290478699, 0000005P0000063 75 | 0.312499287,0.334980469,0.357871551,0.381118094,0.404665354, 0000005P0000064 76 | 0.428456928,0.452439389,0.476554262,0.500745325,0.524957399, 0000005P0000065 77 | 0.549132393,0.573215492,0.597150006,0.620881498,0.64435479, 0000005P0000066 78 | 0.667514924,0.690311284,0.712691574,0.734605836,0.756004442, 0000005P0000067 79 | 0.776840186,0.797068131,0.816644828,0.835528125,0.85367838, 0000005P0000068 80 | 0.87105741,0.887631384,0.903367087,0.918234391,0.932207689, 0000005P0000069 81 | 0.945262808,0.957380487,0.968546549,0.978752666,0.987998719, 0000005P0000070 82 | 0.996293454,1.003661777,1.010148508,1.015832655,1.020839325, 0000005P0000071 83 | 1.025360726,1.029660569,1.029660569,1.029660569,1.029660569,1., 0000005P0000072 84 | 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1., 0000005P0000073 85 | 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1., 0000005P0000074 86 | 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1., 0000005P0000075 87 | 1.,1.,1.,1.,1.,1.,2.5,0.,0.996688072,2.5,-3.323139682E-04, 0000005P0000076 88 | 0.993200341,2.5,-8.198672984E-04,0.989136015,2.5, 0000005P0000077 89 | -1.396636059E-03,0.987404321,2.5,-1.641219034E-03,0.984522915, 0000005P0000078 90 | 2.5,-2.048029985E-03,0.980498373,2.5,-2.613906371E-03, 0000005P0000079 91 | 0.975339844,2.5,-3.332425827E-03,0.969059966,2.5, 0000005P0000080 92 | -4.204466917E-03,0.961672699,2.5,-5.220603486E-03,0.95319555, 0000005P0000081 93 | 2.5,-6.374252092E-03,0.943648594,2.5,-7.660480161E-03, 0000005P0000082 94 | 0.933054022,2.5,-9.070053083E-03,0.921436519,2.5, 0000005P0000083 95 | -1.059634975E-02,0.908822977,2.5,-1.22271187E-02,0.89524306,2.5, 0000005P0000084 96 | -1.395823595E-02,0.880728383,2.5,-1.577758992E-02,0.865312977, 0000005P0000085 97 | 2.5,-1.767577089E-02,0.84903296,2.5,-1.964430573E-02, 0000005P0000086 98 | 0.831926243,2.5,-2.167290838E-02,0.814032153,2.5, 0000005P0000087 99 | -2.374942658E-02,0.7953935,2.5,-2.586855724E-02,0.77605323,2.5, 0000005P0000088 100 | -2.801509871E-02,0.756057127,2.5,-3.018328583E-02,0.735451108, 0000005P0000089 101 | 2.5,-3.235762435E-02,0.714283747,2.5,-3.453408494E-02, 0000005P0000090 102 | 0.69260422,2.5,-3.669588469E-02,0.670463502,2.5, 0000005P0000091 103 | -3.883623394E-02,0.647913008,2.5,-4.094026701E-02,0.625005343, 0000005P0000092 104 | 2.5,-4.300110502E-02,0.601794149,2.5,-4.500171132E-02, 0000005P0000093 105 | 0.578333517,2.5,-4.693313743E-02,0.554678537,2.5, 0000005P0000094 106 | -4.878304895E-02,0.530884155,2.5,-5.053659569E-02,0.507006287, 0000005P0000095 107 | 2.5,-5.218277959E-02,0.483100675,2.5,-5.370845121E-02, 0000005P0000096 108 | 0.459222651,2.5,-5.509887611E-02,0.435428427,2.5, 0000005P0000097 109 | -5.634305875E-02,0.411773032,2.5,-5.74274162E-02,0.388311907, 0000005P0000098 110 | 2.5,-5.833986887E-02,0.365100197,2.5,-5.907028682E-02, 0000005P0000099 111 | 0.342191945,2.5,-5.960567747E-02,0.319640631,2.5, 0000005P0000100 112 | -5.993660239E-02,0.297498377,2.5,-6.005376045E-02,0.275817329, 0000005P0000101 113 | 2.5,-5.99501899E-02,0.254648232,2.5,-5.962123417E-02, 0000005P0000102 114 | 0.234040689,2.5,-5.90569519E-02,0.214042373,2.5, 0000005P0000103 115 | -5.825984015E-02,0.194699946,2.5,-5.722417149E-02,0.176058439, 0000005P0000104 116 | 2.5,-5.595284873E-02,0.15816175,2.5,-5.444613698E-02, 0000005P0000105 117 | 0.141051488,2.5,-5.270677469E-02,0.124767407,2.5, 0000005P0000106 118 | -5.074136007E-02,0.109347051,2.5,-4.855788201E-02, 0000005P0000107 119 | 9.482674417E-02,2.5,-4.616041067E-02,8.123976577E-02,2.5, 0000005P0000108 120 | -4.356092828E-02,6.861738574E-02,2.5,-4.076920911E-02, 0000005P0000109 121 | 5.698910322E-02,2.5,-3.779471735E-02,4.638061443E-02,2.5, 0000005P0000110 122 | -3.465077648E-02,3.681530669E-02,2.5,-3.134783322E-02, 0000005P0000111 123 | 2.831359267E-02,2.5,-2.789727674E-02,2.089225679E-02,2.5, 0000005P0000112 124 | -2.430912029E-02,1.456557979E-02,2.5,-2.059064811E-02, 0000005P0000113 125 | 9.340486677E-03,2.5,-1.674874281E-02,5.228437791E-03,2.5, 0000005P0000114 126 | -1.277529677E-02,2.235125045E-03,2.5,-8.66459269E-03, 0000005P0000115 127 | 4.143242186E-04,2.5,-4.378902723E-03,-1.232957866E-05,2.5, 0000005P0000116 128 | -1.453715274E-03,0.,2.5,0.,0.,1.029660569,-0.,-1., 0000005P0000117 129 | 4.992422594E-19; 0000005P0000118 130 | S 1G 4D 6P 118 T0000001 131 | -------------------------------------------------------------------------------- /NACA_FILES/Curve_2.iges: -------------------------------------------------------------------------------- 1 | S0000001 2 | ,,31HOpen CASCADE IGES processor 6.5,13HFilename.iges, G0000001 3 | 16HOpen CASCADE 6.5,31HOpen CASCADE IGES processor 6.5,32,308,15,308,15,G0000002 4 | ,1.,6,1HM,1,0.01,15H20161205.163638,1E-07,2.500027,5Hamola,,11,0, G0000003 5 | 15H20161205.163638,; G0000004 6 | 102 1 0 0 0 0 0 000000000D0000001 7 | 102 0 0 1 0 0D0000002 8 | 126 2 0 0 0 0 0 000010000D0000003 9 | 126 0 0 56 0 0D0000004 10 | 126 58 0 0 0 0 0 000010000D0000005 11 | 126 0 0 61 0 0D0000006 12 | 102,2,3,5; 0000001P0000001 13 | 126,68,3,1,0,1,0,0.,0.,0.,0.,4.299843718E-03,8.821244054E-03, 0000003P0000002 14 | 1.38279149E-02,1.951206163E-02,2.599879247E-02,3.336711555E-02, 0000003P0000003 15 | 4.166185081E-02,5.090790348E-02,6.111402071E-02,7.228008202E-02, 0000003P0000004 16 | 8.439776121E-02,9.745288036E-02,0.111426179,0.126293482, 0000003P0000005 17 | 0.142029186,0.158603159,0.17598219,0.194132445,0.213015741, 0000003P0000006 18 | 0.232592439,0.252820384,0.273656127,0.295054734,0.316968995, 0000003P0000007 19 | 0.339349285,0.362145645,0.385305779,0.408779071,0.432510563, 0000003P0000008 20 | 0.456445078,0.480528177,0.50470317,0.528915244,0.553106307, 0000003P0000009 21 | 0.577221181,0.601203641,0.624995215,0.648542475,0.671789018, 0000003P0000010 22 | 0.694680101,0.717161282,0.73918187,0.760688338,0.781629802, 0000003P0000011 23 | 0.801957849,0.821624613,0.840583516,0.858789608,0.876200357, 0000003P0000012 24 | 0.892772862,0.908470273,0.923254847,0.937089691,0.949943842, 0000003P0000013 25 | 0.961785707,0.972587263,0.982322707,0.990969196,0.998505136, 0000003P0000014 26 | 1.004912747,1.010176225,1.014283411,1.017224707,1.018991773, 0000003P0000015 27 | 1.019581502,1.029660569,1.029660569,1.029660569,1.029660569,1., 0000003P0000016 28 | 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1., 0000003P0000017 29 | 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1., 0000003P0000018 30 | 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1., 0000003P0000019 31 | 1.,1.,1.,1.,1.,0.,2.5,0.,-1.232957866E-05,2.5,1.453715274E-03, 0000003P0000020 32 | 4.143242186E-04,2.5,4.378902723E-03,2.235125045E-03,2.5, 0000003P0000021 33 | 8.66459269E-03,5.228437791E-03,2.5,1.277529677E-02, 0000003P0000022 34 | 9.340486677E-03,2.5,1.674874281E-02,1.456557979E-02,2.5, 0000003P0000023 35 | 2.059064811E-02,2.089225679E-02,2.5,2.430912029E-02, 0000003P0000024 36 | 2.831359267E-02,2.5,2.789727674E-02,3.681530669E-02,2.5, 0000003P0000025 37 | 3.134783322E-02,4.638061443E-02,2.5,3.465077648E-02, 0000003P0000026 38 | 5.698910322E-02,2.5,3.779471735E-02,6.861738574E-02,2.5, 0000003P0000027 39 | 4.076920911E-02,8.123976577E-02,2.5,4.356092828E-02, 0000003P0000028 40 | 9.482674417E-02,2.5,4.616041067E-02,0.109347051,2.5, 0000003P0000029 41 | 4.855788201E-02,0.124767407,2.5,5.074136007E-02,0.141051488,2.5, 0000003P0000030 42 | 5.270677469E-02,0.15816175,2.5,5.444613698E-02,0.176058439,2.5, 0000003P0000031 43 | 5.595284873E-02,0.194699946,2.5,5.722417149E-02,0.214042373,2.5, 0000003P0000032 44 | 5.825984015E-02,0.234040689,2.5,5.90569519E-02,0.254648232,2.5, 0000003P0000033 45 | 5.962123417E-02,0.275817329,2.5,5.99501899E-02,0.297498377,2.5, 0000003P0000034 46 | 6.005376045E-02,0.319640631,2.5,5.993660239E-02,0.342191945,2.5, 0000003P0000035 47 | 5.960567747E-02,0.365100197,2.5,5.907028682E-02,0.388311907,2.5, 0000003P0000036 48 | 5.833986887E-02,0.411773032,2.5,5.74274162E-02,0.435428427,2.5, 0000003P0000037 49 | 5.634305875E-02,0.459222651,2.5,5.509887611E-02,0.483100675,2.5, 0000003P0000038 50 | 5.370845121E-02,0.507006287,2.5,5.218277959E-02,0.530884155,2.5, 0000003P0000039 51 | 5.053659569E-02,0.554678537,2.5,4.878304895E-02,0.578333517,2.5, 0000003P0000040 52 | 4.693313743E-02,0.601794149,2.5,4.500171132E-02,0.625005343,2.5, 0000003P0000041 53 | 4.300110502E-02,0.647913008,2.5,4.094026701E-02,0.670463502,2.5, 0000003P0000042 54 | 3.883623394E-02,0.69260422,2.5,3.669588469E-02,0.714283747,2.5, 0000003P0000043 55 | 3.453408494E-02,0.735451108,2.5,3.235762435E-02,0.756057127,2.5, 0000003P0000044 56 | 3.018328583E-02,0.77605323,2.5,2.801509871E-02,0.7953935,2.5, 0000003P0000045 57 | 2.586855724E-02,0.814032153,2.5,2.374942658E-02,0.831926243,2.5, 0000003P0000046 58 | 2.167290838E-02,0.84903296,2.5,1.964430573E-02,0.865312977,2.5, 0000003P0000047 59 | 1.767577089E-02,0.880728383,2.5,1.577758992E-02,0.89524306,2.5, 0000003P0000048 60 | 1.395823595E-02,0.908822977,2.5,1.22271187E-02,0.921436519,2.5, 0000003P0000049 61 | 1.059634975E-02,0.933054022,2.5,9.070053083E-03,0.943648594,2.5, 0000003P0000050 62 | 7.660480161E-03,0.95319555,2.5,6.374252092E-03,0.961672699,2.5, 0000003P0000051 63 | 5.220603486E-03,0.969059966,2.5,4.204466917E-03,0.975339844,2.5, 0000003P0000052 64 | 3.332425827E-03,0.980498373,2.5,2.613906371E-03,0.984522915,2.5, 0000003P0000053 65 | 2.048029985E-03,0.987404321,2.5,1.641219034E-03,0.989136015,2.5, 0000003P0000054 66 | 1.396636059E-03,0.993200341,2.5,8.198672984E-04,0.996688072,2.5, 0000003P0000055 67 | 3.323139682E-04,1.,2.5,0.,0.,1.029660569,-1.331312692E-18,1., 0000003P0000056 68 | 5.453056785E-15; 0000003P0000057 69 | 126,68,3,1,0,1,0,0.,0.,0.,0.,1.007906742E-02,1.066879617E-02, 0000005P0000058 70 | 1.243586295E-02,1.537715824E-02,1.948434462E-02,2.474782218E-02, 0000005P0000059 71 | 3.115543391E-02,3.8691373E-02,4.733786281E-02,5.707330676E-02, 0000005P0000060 72 | 6.78748623E-02,7.971672778E-02,9.257087843E-02,0.106405722, 0000005P0000061 73 | 0.121190296,0.136887707,0.153460212,0.170870961,0.189077054, 0000005P0000062 74 | 0.208035957,0.22770272,0.248030768,0.268972232,0.290478699, 0000005P0000063 75 | 0.312499287,0.334980469,0.357871551,0.381118094,0.404665354, 0000005P0000064 76 | 0.428456928,0.452439389,0.476554262,0.500745325,0.524957399, 0000005P0000065 77 | 0.549132393,0.573215492,0.597150006,0.620881498,0.64435479, 0000005P0000066 78 | 0.667514924,0.690311284,0.712691574,0.734605836,0.756004442, 0000005P0000067 79 | 0.776840186,0.797068131,0.816644828,0.835528125,0.85367838, 0000005P0000068 80 | 0.87105741,0.887631384,0.903367087,0.918234391,0.932207689, 0000005P0000069 81 | 0.945262808,0.957380487,0.968546549,0.978752666,0.987998719, 0000005P0000070 82 | 0.996293454,1.003661777,1.010148508,1.015832655,1.020839325, 0000005P0000071 83 | 1.025360726,1.029660569,1.029660569,1.029660569,1.029660569,1., 0000005P0000072 84 | 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1., 0000005P0000073 85 | 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1., 0000005P0000074 86 | 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1., 0000005P0000075 87 | 1.,1.,1.,1.,1.,1.,2.5,0.,0.996688072,2.5,-3.323139682E-04, 0000005P0000076 88 | 0.993200341,2.5,-8.198672984E-04,0.989136015,2.5, 0000005P0000077 89 | -1.396636059E-03,0.987404321,2.5,-1.641219034E-03,0.984522915, 0000005P0000078 90 | 2.5,-2.048029985E-03,0.980498373,2.5,-2.613906371E-03, 0000005P0000079 91 | 0.975339844,2.5,-3.332425827E-03,0.969059966,2.5, 0000005P0000080 92 | -4.204466917E-03,0.961672699,2.5,-5.220603486E-03,0.95319555, 0000005P0000081 93 | 2.5,-6.374252092E-03,0.943648594,2.5,-7.660480161E-03, 0000005P0000082 94 | 0.933054022,2.5,-9.070053083E-03,0.921436519,2.5, 0000005P0000083 95 | -1.059634975E-02,0.908822977,2.5,-1.22271187E-02,0.89524306,2.5, 0000005P0000084 96 | -1.395823595E-02,0.880728383,2.5,-1.577758992E-02,0.865312977, 0000005P0000085 97 | 2.5,-1.767577089E-02,0.84903296,2.5,-1.964430573E-02, 0000005P0000086 98 | 0.831926243,2.5,-2.167290838E-02,0.814032153,2.5, 0000005P0000087 99 | -2.374942658E-02,0.7953935,2.5,-2.586855724E-02,0.77605323,2.5, 0000005P0000088 100 | -2.801509871E-02,0.756057127,2.5,-3.018328583E-02,0.735451108, 0000005P0000089 101 | 2.5,-3.235762435E-02,0.714283747,2.5,-3.453408494E-02, 0000005P0000090 102 | 0.69260422,2.5,-3.669588469E-02,0.670463502,2.5, 0000005P0000091 103 | -3.883623394E-02,0.647913008,2.5,-4.094026701E-02,0.625005343, 0000005P0000092 104 | 2.5,-4.300110502E-02,0.601794149,2.5,-4.500171132E-02, 0000005P0000093 105 | 0.578333517,2.5,-4.693313743E-02,0.554678537,2.5, 0000005P0000094 106 | -4.878304895E-02,0.530884155,2.5,-5.053659569E-02,0.507006287, 0000005P0000095 107 | 2.5,-5.218277959E-02,0.483100675,2.5,-5.370845121E-02, 0000005P0000096 108 | 0.459222651,2.5,-5.509887611E-02,0.435428427,2.5, 0000005P0000097 109 | -5.634305875E-02,0.411773032,2.5,-5.74274162E-02,0.388311907, 0000005P0000098 110 | 2.5,-5.833986887E-02,0.365100197,2.5,-5.907028682E-02, 0000005P0000099 111 | 0.342191945,2.5,-5.960567747E-02,0.319640631,2.5, 0000005P0000100 112 | -5.993660239E-02,0.297498377,2.5,-6.005376045E-02,0.275817329, 0000005P0000101 113 | 2.5,-5.99501899E-02,0.254648232,2.5,-5.962123417E-02, 0000005P0000102 114 | 0.234040689,2.5,-5.90569519E-02,0.214042373,2.5, 0000005P0000103 115 | -5.825984015E-02,0.194699946,2.5,-5.722417149E-02,0.176058439, 0000005P0000104 116 | 2.5,-5.595284873E-02,0.15816175,2.5,-5.444613698E-02, 0000005P0000105 117 | 0.141051488,2.5,-5.270677469E-02,0.124767407,2.5, 0000005P0000106 118 | -5.074136007E-02,0.109347051,2.5,-4.855788201E-02, 0000005P0000107 119 | 9.482674417E-02,2.5,-4.616041067E-02,8.123976577E-02,2.5, 0000005P0000108 120 | -4.356092828E-02,6.861738574E-02,2.5,-4.076920911E-02, 0000005P0000109 121 | 5.698910322E-02,2.5,-3.779471735E-02,4.638061443E-02,2.5, 0000005P0000110 122 | -3.465077648E-02,3.681530669E-02,2.5,-3.134783322E-02, 0000005P0000111 123 | 2.831359267E-02,2.5,-2.789727674E-02,2.089225679E-02,2.5, 0000005P0000112 124 | -2.430912029E-02,1.456557979E-02,2.5,-2.059064811E-02, 0000005P0000113 125 | 9.340486677E-03,2.5,-1.674874281E-02,5.228437791E-03,2.5, 0000005P0000114 126 | -1.277529677E-02,2.235125045E-03,2.5,-8.66459269E-03, 0000005P0000115 127 | 4.143242186E-04,2.5,-4.378902723E-03,-1.232957866E-05,2.5, 0000005P0000116 128 | -1.453715274E-03,0.,2.5,0.,0.,1.029660569,-0.,-1., 0000005P0000117 129 | 4.992422594E-19; 0000005P0000118 130 | S 1G 4D 6P 118 T0000001 131 | -------------------------------------------------------------------------------- /NACA_FILES/naca0012.inp: -------------------------------------------------------------------------------- 1 | 30 38 0 0 0 2 | 1 0.0 -2.5 0.0 3 | 2 0.08630942482892 -2.5 0.04451188166534 4 | 3 0.08630942482892 -2.5 -0.04451188166534 5 | 4 0.15 -2.5 0.0 6 | 5 0.89893259058517 -2.5 0.01348586340133 7 | 6 0.89893259058517 -2.5 -0.01348586340133 8 | 7 0.89 -2.5 0.0 9 | 8 1.0 -2.5 0.0 10 | 9 0.0 2.5 0.0 11 | 10 0.08630942482892 2.5 0.04451188166534 12 | 11 0.08630942482892 2.5 -0.04451188166534 13 | 12 0.15 2.5 0.0 14 | 13 0.89893259058517 2.5 0.01348586340133 15 | 14 0.89893259058517 2.5 -0.01348586340133 16 | 15 0.89 2.5 0.0 17 | 16 1.0 2.5 0.0 18 | 17 0.0 -2.5 0.0 19 | 18 0.08630942482892 -2.5 0.04451188166534 20 | 19 0.89893259058517 -2.5 0.0134858634013 21 | 20 1.0 -2.5 0.0 22 | 21 0.0 2.5 0.0 23 | 22 0.08630942482892 2.5 0.04451188166534 24 | 23 0.89893259058517 2.5 0.01348586340133 25 | 24 1.0 2.5 0.0 26 | 25 0.08630942482892 -2.5 -0.04451188166534 27 | 26 0.89893259058517 -2.5 -0.0134858634013 28 | 27 1.0 -2.5 0.0 29 | 28 0.08630942482892 2.5 -0.04451188166534 30 | 29 0.89893259058517 2.5 -0.01348586340133 31 | 30 1.0 2.5 0.0 32 | 1 1 quad 1 3 4 2 33 | 2 1 quad 2 4 7 5 34 | 3 1 quad 3 6 7 4 35 | 4 1 quad 7 6 8 5 36 | 5 2 quad 12 11 9 10 37 | 6 2 quad 13 15 12 10 38 | 7 2 quad 15 14 11 12 39 | 8 2 quad 16 14 15 13 40 | 9 3 quad 17 18 22 21 41 | 10 3 quad 18 19 23 22 42 | 11 3 quad 19 20 24 23 43 | 12 4 quad 21 28 25 17 44 | 13 4 quad 28 29 26 25 45 | 14 4 quad 29 30 27 26 46 | 15 11 line 1 2 47 | 16 11 line 2 5 48 | 17 11 line 5 8 49 | 18 11 line 1 3 50 | 19 11 line 3 6 51 | 20 11 line 6 8 52 | 21 11 line 17 18 53 | 22 11 line 18 19 54 | 23 11 line 19 20 55 | 24 11 line 17 25 56 | 25 11 line 25 26 57 | 26 11 line 26 27 58 | 27 12 line 9 10 59 | 28 12 line 10 13 60 | 29 12 line 13 16 61 | 30 12 line 9 11 62 | 31 12 line 11 14 63 | 32 12 line 14 16 64 | 33 12 line 21 22 65 | 34 12 line 22 23 66 | 35 12 line 23 24 67 | 36 12 line 21 28 68 | 37 12 line 28 29 69 | 38 12 line 29 30 70 | -------------------------------------------------------------------------------- /NACA_FILES/parameter_bem.prm: -------------------------------------------------------------------------------- 1 | # Parameter file generated with 2 | # D2K_GIT_BRANCH= master 3 | # D2K_GIT_SHORTREV= 9762009 4 | # DEAL_II_GIT_BRANCH= master 5 | # DEAL_II_GIT_SHORTREV= d984c95 6 | subsection BEMFMA<3> 7 | subsection FMA Params 8 | set FMA Truncation Order = 6 9 | end 10 | subsection Octree Params 11 | set Maximum Number of Collocation Points per Childless Block = 20 12 | set Number of Octree Levels = 10 13 | end 14 | end 15 | subsection BEMProblem<3> 16 | set Continuos gradient across edges = true 17 | set Mapping Q Degree = 1 18 | set Mapping Type = FE 19 | set Preconditioner = ILU 20 | set Solution method = Direct 21 | subsection Quadrature rules 22 | set Quadrature order = 4 23 | set Quadrature type = gauss 24 | set Singular quadrature order = 5 25 | end 26 | subsection Solver 27 | set Log frequency = 1 28 | set Log history = true 29 | set Log result = true 30 | set Max steps = 3000 31 | set Tolerance = 1.e-7 32 | end 33 | end 34 | subsection BoundaryConditions<3> 35 | set Output file name = result 36 | subsection Potential 2d 37 | set Function constants = 38 | set Function expression = x+y 39 | set Variable names = x,y,t 40 | end 41 | subsection Potential 3d 42 | set Function constants = 43 | set Function expression = x 44 | set Variable names = x,y,z,t 45 | end 46 | subsection Wind function 2d 47 | set Function constants = 48 | set Function expression = 1; 1 49 | set Variable names = x,y,t 50 | end 51 | subsection Wind function 3d 52 | set Function constants = 53 | set Function expression = 1; 0; 0 54 | set Variable names = x,y,z,t 55 | end 56 | end 57 | subsection ComputationalDomain<3> 58 | set Input grid format = inp 59 | set Input grid name = ./naca0012 60 | set Number of cycles = 1 61 | subsection Boundary Conditions ID Numbers 62 | set Dirichlet boundary ids = 1,0,110,110 63 | set Neumann boundary ids = 2,3,4 64 | end 65 | end 66 | subsection Driver<3> 67 | set Set Global Refinement = true 68 | end 69 | subsection Scalar FE 70 | set Blocking of the finite element = u 71 | set Finite element space = FE_Q(1) 72 | end 73 | subsection Scalar data out 74 | set Files to save in run directory = 75 | set Incremental run prefix = 76 | set Output format = vtu 77 | set Output partitioning = false 78 | set Problem base name = solution 79 | set Solution names = u 80 | set Subdivisions = 1 81 | end 82 | subsection Vector FE 83 | set Blocking of the finite element = u,u,u 84 | set Finite element space = FESystem[FE_Q(1)^3] 85 | end 86 | subsection Vector data out 87 | set Files to save in run directory = 88 | set Incremental run prefix = 89 | set Output format = vtu 90 | set Output partitioning = false 91 | set Problem base name = solution 92 | set Solution names = u 93 | set Subdivisions = 1 94 | end 95 | subsection deal2lkit::ParsedGridRefinement 96 | set Bottom fraction = 0.100000 97 | set Maximum number of cells (if available) = 0 98 | set Order (optimize) = 2 99 | set Refinement strategy = fraction 100 | set Top fraction = 0.300000 101 | end 102 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

    2 | 3 | pi-BEM 4 | 5 |

    6 | 7 | # pi-BEM: Parallel BEM Solver 8 | 9 | [![Build Status](https://travis-ci.org/mathLab/pi-BEM.svg?branch=master)](https://travis-ci.org/mathLab/pi-BEM) 10 | 11 | Copyright (C) 2015 -- 2019 by Nicola Giuliani (1), Andrea Mola (2) and Luca Heltai (2) 12 | 13 | (1) Scuola Internazionale Superiore di Studi Avanzati E-mail: 14 | 15 | (2) Scuola Internazionale Superiore di Studi Avanzati E-mail: 16 | 17 | (3) Scuola Internazionale Superiore di Studi Avanzati E-mail: 18 | 19 | The library represents a parallel solver for the Laplace equation through Boundary Element Methods. We have developed the software in C++ on top of many high performance libraries, the [deal.II](https://github.com/dealii/dealii) library for Finite Element Handling, the [METIS](http://glaros.dtc.umn.edu/gkhome/metis/metis/download) project and [Trilinos](https://trilinos.org/) library for automatic Workload balance, and [OpenCASCADE](https://www.opencascade.com/) for CAD integration. 20 | 21 | ## Provided features 22 | 23 | We provide the following capabilities 24 | 25 | - Read of the grid through an external file in one of the following formats (.prm, .msh, .vtk), the files specifies the kind of boundary condition to be applied on the nodes. 26 | - Possibility of solving mixed Dirichlet Neumann boundary value problem. 27 | - Automatic treatment of sharp edges via the double nodes technique. 28 | - Integration of complex geometry descriptors (CAD files through OpenCASCADE). 29 | - Usage of Lagrangian Finite Elements of arbitrary order. We also provide interfaces with discontinuous elements. 30 | - Distributed memory (MPI) parallelisation of the standard collocation BEM for the Laplace equation. 31 | - Coupling with a Fast Multiple Method (FMM) to get a performance improvement. 32 | - Hybrid Distributed (MPI) - Shared (Intel Threaded Building Block) memory parallelisation for the BEM-FMM code 33 | - Recovery of both primal (potential) and dual (potential normal derivative) unknowns. 34 | - L2 projection of the full 3D potential gradient for post processing. 35 | - Extensive tuning via parameter file using. 36 | 37 | ## Code Structure 38 | 39 | We have subdivided the code in main classes to handle the many different aspects of a complete BEM simulation. 40 | 41 | - Driver. This class is in charge of organising the overall BEM simulation. It has interfaces with all the other classes in order to perform a complete simulation. 42 | - ComputationalDomain. This class handles, and provides to the other classes, ONLY the geometry of the problem. In particular 43 | - it handles the domain decomposition using a graph partitioning tool (METIS); 44 | - it reads the domain from an external file. 45 | - BoundaryCondition. The class handles the boundary conditions. In particular 46 | - it reads the boundary conditions for the potential and its normal derivative; 47 | - given the peculiarities of the BEM, the boundary conditions represent the actual unknowns, thus it creates the vectors containing the two variables and fills them with the proper data; 48 | - it performs the error analysis on both unknowns. 49 | 50 | - BEMProblem. This class is the core of the BEM simulation 51 | - it receives the variables vector filled in with the proper boundary condition; 52 | - it creates the codimension 1 functional space setting up the BEM; 53 | - it solves the system using a preconditioned parallel GMRES solver; 54 | - it eventually interacts with the FMM accelerator. 55 | - BEMFMA. This class handles the accelerator, in particular 56 | - it sets up an hierarchical 3D space subdivision (octree); 57 | - it receives two distributed vectors representing the unknowns and performs a full FMM matrix vector product. 58 | 59 | ## Install Procedure using CANDI 60 | 61 | To install from scratch all the needed library you can look to the automatic installation procedure provided by [CANDI](https://github.com/koecher/candi) developed Uwe Köcher. 62 | 63 | ## Install Procedure using spack 64 | 65 | Just follow the [instructions](https://github.com/dealii/dealii/wiki/deal.II-in-Spack) to install dealii@develop using spack. 66 | 67 | ## Install Procedure using Docker 68 | 69 | We provide the possibility of using Docker as a tool to provide a fully operational environment for our library. To use such tool you need to install Docker following the [instructions](https://docs.docker.com/engine/installation/) provided by its authors. Then you can execute the following command line instruction 70 | 71 | docker run -v `pwd`:/pwd_to_your_own_directory/ -i -t dealii/dealii:v9.6.0-jammy bash 72 | 73 | to retrieve the environment. In such a shell you can easily compile the pi-BEM library following its own instructions. 74 | 75 | ## Install Procedure from scratch 76 | 77 | In order to successfully compile the code you need 78 | 79 | - to install the Trilinos and Metis wrappers of the library, see the official [instructions](https://www.dealii.org/developer/readme.html) 80 | - to install the [deal.II](https://github.com/dealii/dealii) library allowing both for multiprocessors and multithreaded environment. 81 | 82 | ### deal.II Installation procedure 83 | 84 | Follow the detailed [instruction](https://www.dealii.org/developer/readme.html) to install deal with METIS and Trilinos wrappers. We highlight that in order to fully exploit pi-BEM you need to properly install the following additional packages: MPI, TBB, METIS, TRILINOS ans OPENCASCADE. For more detailed instruction you can look to the the deal.ii install procedures. In the following we provide an example of the installation of all the proper packages. 85 | 86 | ### OpenCASCADE Installation procedure 87 | 88 | - Download the latest version at [OpenCASCADE](https://github.com/tpaviot/oce) 89 | - Follow the instructions 90 | 91 | ### METIS-PARMETIS Installation procedure 92 | 93 | - Download the latest version at [METIS](http://glaros.dtc.umn.edu/gkhome/metis/metis/download) 94 | - Follow the [instructions](http://glaros.dtc.umn.edu/gkhome/metis/metis/download) for the correct installation of the package 95 | 96 | ### Trilinos Installation procedure 97 | 98 | - Download the latest version at [Trilinos](https://trilinos.org/download/) 99 | - This is a possible configuration file 100 | 101 | cmake -D Trilinos_ENABLE_OPTIONAL_PACKAGES:BOOL=ON \ 102 | -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=ON \ 103 | -D CMAKE_CXX_FLAGS:STRING="-O3" \ 104 | -D CMAKE_C_FLAGS:STRING="-O3" \ 105 | -D CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE \ 106 | -D Trilinos_VERBOSE_CONFIGURE:BOOL=FALSE \ 107 | -D TPL_ENABLE_MPI:BOOL=ON \ 108 | -D CMAKE_BUILD_TYPE:STRING=RELEASE \ 109 | -D Trilinos_ENABLE_Fortran:BOOL=ON \ 110 | -D BLAS_LIBRARY_NAMES:STRING="blas" \ 111 | -D BLAS_LIBRARY_DIRS:PATH=/usr/lib/libblas/ \ 112 | -D TPL_BLAS_LIBRARIES:PATH=/usr/lib/libblas/ \ 113 | -D Trilinos_WARNINGS_AS_ERRORS_FLAGS:STRING="" \ 114 | -D CMAKE_INSTALL_PREFIX:PATH=/usr/local/ \ 115 | -D BUILD_SHARED_LIBS:BOOL=ON ../ 116 | 117 | make install 118 | 119 | - if some packages create conflicts they can be disabled as seen on the Trilinos webpage 120 | 121 | ### pi-BEM Installation procedure 122 | 123 | Then you can clone the repository and compile it 124 | 125 | git clone 126 | cd pi-BEM 127 | mkdir build 128 | cd build 129 | cmake ../ 130 | make -j4 131 | 132 | After you have compiled your application, you can run 133 | 134 | make test 135 | 136 | or 137 | 138 | ctest 139 | 140 | to start the testsuite. 141 | 142 | Take a look at 143 | for more 144 | information on how to create tests and add categories of tests. 145 | 146 | If you want you can run a preliminary execution in the build library typing 147 | 148 | mpirun -np 1 bem_fma_2d 149 | 150 | this will automatically generate the parameter file for the bi-dimensional run while 151 | 152 | mpirun -np 1 bem_fma_3d 153 | 154 | will create a proper parameter file for a 3 dimensional simulation. 155 | 156 | # Notice to developers 157 | 158 | Before making a pull request, please make sure you run the script 159 | 160 | ./scripts/indent 161 | 162 | from the base directory of this project, to ensure that no random 163 | white space changes are inserted in the repository. 164 | 165 | The script requires `clang-format` version 16.0.6 to work properly. 166 | 167 | # Cite this work 168 | 169 | If you use this software, please consider citing the following work: 170 | 171 | @article{GiulianiMolaHeltai2018, 172 | doi = {10.1016/j.advengsoft.2018.03.008}, 173 | url = {, 174 | year = {2018}, 175 | month = {jul}, 176 | publisher = {Elsevier {BV}}, 177 | volume = {121}, 178 | pages = {39--58}, 179 | author = {Nicola Giuliani and Andrea Mola and Luca Heltai}, 180 | title = {$\uppi$ - {BEM} : A flexible parallel implementation for adaptive, geometry aware, and high order boundary element methods}, 181 | journal = {Advances in Engineering Software} 182 | } 183 | 184 | # Licence 185 | 186 | Please see the file [LICENSE](https://github.com/mathLab/pi-BEM/blob/master/LICENSE) for details 187 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 9.6.0 -------------------------------------------------------------------------------- /docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM dealii/dealii:v9.6.0-jammy 2 | 3 | # pi-BEM master image 4 | RUN git clone https://github.com/mathLab/pi-BEM/ &&\ 5 | mkdir pi-BEM/build && cd pi-BEM/build &&\ 6 | cmake -DCMAKE_BUILD_TYPE=DebugRelease \ 7 | -GNinja \ 8 | ../ && \ 9 | ninja 10 | -------------------------------------------------------------------------------- /docs/logo/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/pi-BEM/f4332c01adb356ee59554456c117cdc766314749/docs/logo/logo.png -------------------------------------------------------------------------------- /docs/logo/logo_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/pi-BEM/f4332c01adb356ee59554456c117cdc766314749/docs/logo/logo_small.png -------------------------------------------------------------------------------- /grids/circle.inp: -------------------------------------------------------------------------------- 1 | 10 10 0 0 0 2 | 1 0 1.0 0 3 | 2 0.587785252292 0.809016994375 0 4 | 3 0.951056516295 0.309016994375 0 5 | 4 0.951056516295 -0.309016994375 0 6 | 5 0.587785252292 -0.809016994375 0 7 | 6 0 -1.0 0 8 | 7 -0.587785252292 -0.809016994375 0 9 | 8 -0.951056516295 -0.309016994375 0 10 | 9 -0.951056516295 0.309016994375 0 11 | 10 -0.587785252292 0.809016994375 0 12 | 1 1 line 1 2 13 | 2 1 line 2 3 14 | 3 1 line 3 4 15 | 4 1 line 4 5 16 | 5 1 line 5 6 17 | 6 1 line 6 7 18 | 7 1 line 7 8 19 | 8 1 line 8 9 20 | 9 1 line 9 10 21 | 10 1 line 10 1 22 | -------------------------------------------------------------------------------- /grids/coarse_cube.inp: -------------------------------------------------------------------------------- 1 | 24 6 0 0 0 2 | 1 0 0 0 3 | 2 0 1 0 4 | 3 1 1 0 5 | 4 1 0 0 6 | 5 0 0 1 7 | 6 0 0.5 1 8 | 7 0.5 0.5 1 9 | 8 0.5 0 1 10 | 9 0 0 0 11 | 10 1 0 0 12 | 11 0.5 0 1 13 | 12 0 0 1 14 | 13 0 1 0 15 | 14 1 1 0 16 | 15 0.5 0.5 1 17 | 16 0 0.5 1 18 | 17 0 0 0 19 | 18 0 0 1 20 | 19 0 0.5 1 21 | 20 0 1 0 22 | 21 1 0 0 23 | 22 0.5 0 1 24 | 23 0.5 0.5 1 25 | 24 1 1 0 26 | 27 | 1 1 quad 1 2 3 4 28 | 2 0 quad 5 8 7 6 29 | 3 1 quad 1 4 8 5 30 | 4 0 quad 2 6 7 3 31 | 5 1 quad 1 5 6 2 32 | 6 0 quad 4 3 7 8 33 | -------------------------------------------------------------------------------- /grids/coarse_cube_double_nodes.inp: -------------------------------------------------------------------------------- 1 | 24 6 0 0 0 2 | 1 0 0 0 3 | 2 0 1 0 4 | 3 1 1 0 5 | 4 1 0 0 6 | 5 0 0 1 7 | 6 0 0.5 1 8 | 7 0.5 0.5 1 9 | 8 0.5 0 1 10 | 9 0 0 0 11 | 10 1 0 0 12 | 11 0.5 0 1 13 | 12 0 0 1 14 | 13 0 1 0 15 | 14 1 1 0 16 | 15 0.5 0.5 1 17 | 16 0 0.5 1 18 | 17 0 0 0 19 | 18 0 0 1 20 | 19 0 0.5 1 21 | 20 0 1 0 22 | 21 1 0 0 23 | 22 0.5 0 1 24 | 23 0.5 0.5 1 25 | 24 1 1 0 26 | 27 | 1 1 quad 1 2 3 4 28 | 2 0 quad 5 8 7 6 29 | 3 1 quad 9 10 11 12 30 | 4 1 quad 13 16 15 14 31 | 5 1 quad 17 18 19 20 32 | 6 1 quad 21 24 23 22 33 | -------------------------------------------------------------------------------- /grids/coarse_sphere.inp: -------------------------------------------------------------------------------- 1 | 8 6 0 0 0 2 | 1 -0.577350269 -0.577350269 -0.577350269 3 | 2 0.577350269 -0.577350269 -0.577350269 4 | 3 -0.577350269 0.577350269 -0.577350269 5 | 4 0.577350269 0.577350269 -0.577350269 6 | 5 -0.577350269 -0.577350269 0.577350269 7 | 6 0.577350269 -0.577350269 0.577350269 8 | 7 -0.577350269 0.577350269 0.577350269 9 | 8 0.577350269 0.577350269 0.577350269 10 | 1 1 quad 3 4 2 1 11 | 2 1 quad 5 6 8 7 12 | 3 1 quad 1 2 6 5 13 | 4 1 quad 3 7 8 4 14 | 5 1 quad 5 7 3 1 15 | 6 1 quad 2 4 8 6 16 | -------------------------------------------------------------------------------- /grids/coarse_sphere_double_nodes.inp: -------------------------------------------------------------------------------- 1 | 14 6 0 0 0 2 | 1 -0.577350269 -0.577350269 -0.577350269 3 | 2 0.577350269 -0.577350269 -0.577350269 4 | 3 -0.577350269 0.577350269 -0.577350269 5 | 4 0.577350269 0.577350269 -0.577350269 6 | 5 -0.577350269 -0.577350269 0.577350269 7 | 6 0.577350269 -0.577350269 0.577350269 8 | 7 -0.577350269 0.577350269 0.577350269 9 | 8 0.577350269 -0.577350269 -0.577350269 10 | 9 -0.577350269 0.577350269 -0.577350269 11 | 10 0.577350269 0.577350269 -0.577350269 12 | 11 -0.577350269 -0.577350269 0.577350269 13 | 12 0.577350269 -0.577350269 0.577350269 14 | 13 -0.577350269 0.577350269 0.577350269 15 | 14 0.577350269 0.577350269 0.577350269 16 | 1 1 quad 3 4 2 1 17 | 2 0 quad 11 12 14 13 18 | 3 1 quad 1 2 6 5 19 | 4 0 quad 9 13 14 10 20 | 5 1 quad 5 7 3 1 21 | 6 0 quad 8 10 14 12 22 | -------------------------------------------------------------------------------- /grids/coarse_straight_cube.inp: -------------------------------------------------------------------------------- 1 | 24 6 0 0 0 2 | 1 0 0 0 3 | 2 0 1 0 4 | 3 1 1 0 5 | 4 1 0 0 6 | 5 0 0 1 7 | 6 0 1 1 8 | 7 1 1 1 9 | 8 1 0 1 10 | 9 0 0 0 11 | 10 1 0 0 12 | 11 1 0 1 13 | 12 0 0 1 14 | 13 0 1 0 15 | 14 1 1 0 16 | 15 1 1 1 17 | 16 0 1 1 18 | 17 0 0 0 19 | 18 0 0 1 20 | 19 0 1 1 21 | 20 0 1 0 22 | 21 1 0 0 23 | 22 1 0 1 24 | 23 1 1 1 25 | 24 1 1 0 26 | 27 | 1 1 quad 1 2 3 4 28 | 2 0 quad 5 8 7 6 29 | 3 1 quad 9 10 11 12 30 | 4 1 quad 13 16 15 14 31 | 5 1 quad 17 18 19 20 32 | 6 1 quad 21 24 23 22 33 | -------------------------------------------------------------------------------- /grids/cosine.inp: -------------------------------------------------------------------------------- 1 | 11 7 0 0 0 2 | 1 -15 -20 0 3 | 2 -15 -20 0 4 | 3 15 -20 0 5 | 4 15 -20 0 6 | 5 15 0 0 7 | 6 15 0 0 8 | 7 7.5 0 0 9 | 8 0 0 0 10 | 9 -7.5 0 0 11 | 10 -15 0 0 12 | 11 -15 0 0 13 | 1 2 line 2 3 14 | 2 2 line 4 5 15 | 3 1 line 6 7 16 | 4 1 line 7 8 17 | 5 1 line 8 9 18 | 6 1 line 9 10 19 | 7 2 line 11 1 20 | -------------------------------------------------------------------------------- /grids/naca0012.inp: -------------------------------------------------------------------------------- 1 | 30 38 0 0 0 2 | 1 0.0 -2.5 0.0 3 | 2 0.08630942482892 -2.5 0.04451188166534 4 | 3 0.08630942482892 -2.5 -0.04451188166534 5 | 4 0.15 -2.5 0.0 6 | 5 0.89893259058517 -2.5 0.01348586340133 7 | 6 0.89893259058517 -2.5 -0.01348586340133 8 | 7 0.89 -2.5 0.0 9 | 8 1.0 -2.5 0.0 10 | 9 0.0 2.5 0.0 11 | 10 0.08630942482892 2.5 0.04451188166534 12 | 11 0.08630942482892 2.5 -0.04451188166534 13 | 12 0.15 2.5 0.0 14 | 13 0.89893259058517 2.5 0.01348586340133 15 | 14 0.89893259058517 2.5 -0.01348586340133 16 | 15 0.89 2.5 0.0 17 | 16 1.0 2.5 0.0 18 | 17 0.0 -2.5 0.0 19 | 18 0.08630942482892 -2.5 0.04451188166534 20 | 19 0.89893259058517 -2.5 0.0134858634013 21 | 20 1.0 -2.5 0.0 22 | 21 0.0 2.5 0.0 23 | 22 0.08630942482892 2.5 0.04451188166534 24 | 23 0.89893259058517 2.5 0.01348586340133 25 | 24 1.0 2.5 0.0 26 | 25 0.08630942482892 -2.5 -0.04451188166534 27 | 26 0.89893259058517 -2.5 -0.0134858634013 28 | 27 1.0 -2.5 0.0 29 | 28 0.08630942482892 2.5 -0.04451188166534 30 | 29 0.89893259058517 2.5 -0.01348586340133 31 | 30 1.0 2.5 0.0 32 | 1 1 quad 1 3 4 2 33 | 2 1 quad 2 4 7 5 34 | 3 1 quad 3 6 7 4 35 | 4 1 quad 7 6 8 5 36 | 5 2 quad 12 11 9 10 37 | 6 2 quad 13 15 12 10 38 | 7 2 quad 15 14 11 12 39 | 8 2 quad 16 14 15 13 40 | 9 3 quad 17 18 22 21 41 | 10 3 quad 18 19 23 22 42 | 11 3 quad 19 20 24 23 43 | 12 4 quad 21 28 25 17 44 | 13 4 quad 28 29 26 25 45 | 14 4 quad 29 30 27 26 46 | 15 11 line 1 2 47 | 16 11 line 2 5 48 | 17 11 line 5 8 49 | 18 11 line 1 3 50 | 19 11 line 3 6 51 | 20 11 line 6 8 52 | 21 11 line 17 18 53 | 22 11 line 18 19 54 | 23 11 line 19 20 55 | 24 11 line 17 25 56 | 25 11 line 25 26 57 | 26 11 line 26 27 58 | 27 12 line 9 10 59 | 28 12 line 10 13 60 | 29 12 line 13 16 61 | 30 12 line 9 11 62 | 31 12 line 11 14 63 | 32 12 line 14 16 64 | 33 12 line 21 22 65 | 34 12 line 22 23 66 | 35 12 line 23 24 67 | 36 12 line 21 28 68 | 37 12 line 28 29 69 | 38 12 line 29 30 70 | -------------------------------------------------------------------------------- /grids/sphere.inp: -------------------------------------------------------------------------------- 1 | 117 115 0 0 0 2 | 1 0.00770619074016 -0.00138354404738 0.999969349745 3 | 2 0.00835238822402 0.000577374514318 -0.999964951511 4 | 3 0.344345880731 0.0255043224935 0.938496373971 5 | 4 0.349460919086 -0.0342793147496 -0.936323659112 6 | 5 0.291387968796 0.358862870325 0.886741502323 7 | 6 0.360028015418 0.324053805297 -0.874853678844 8 | 7 -0.00307019218226 0.308818912823 0.951115898828 9 | 8 0.0172181381469 0.340908707132 -0.939938715619 10 | 9 -0.290972921308 0.31712074855 0.902645661323 11 | 10 -0.30739368725 0.32669476846 -0.893744733858 12 | 11 -0.309602355222 0.00467950302638 0.950854607126 13 | 12 -0.31204463207 0.0104549771322 -0.95000991629 14 | 13 -0.31960338239 -0.328608711139 0.888746304031 15 | 14 -0.314955125287 -0.293538133601 -0.902573339501 16 | 15 0.0258425731752 -0.352906947725 0.93530147421 17 | 16 -0.0185919105391 -0.314531555853 -0.949064929936 18 | 17 0.367492472884 -0.32129033296 0.872766752529 19 | 18 0.28297926096 -0.391262450344 -0.875691973708 20 | 19 -0.574914073658 0.300205890077 -0.761150597104 21 | 20 -0.570240700145 0.0227981334673 -0.821161244219 22 | 21 -0.588119684792 -0.250643307337 -0.768955895255 23 | 22 -0.570620414531 -0.518680748544 -0.636680943339 24 | 23 -0.290566176353 -0.561069414682 -0.775095096791 25 | 24 -0.0590299267926 -0.533799097379 -0.843548452301 26 | 25 0.123283948007 -0.671890735433 -0.730317675948 27 | 26 0.60335594429 -0.443167840357 -0.662996131031 28 | 27 0.658968788279 -0.0659531536318 -0.749273192901 29 | 28 0.65159679144 0.270954753663 -0.708523212642 30 | 29 0.64845410876 0.548800158813 -0.527565782173 31 | 30 0.3442490351 0.635200706801 -0.691384599129 32 | 31 0.00655851207333 0.636653343027 -0.771122238515 33 | 32 -0.288071933621 0.595992070432 -0.749538533394 34 | 33 -0.539795785037 0.56469678429 -0.624290038579 35 | 34 -0.762714935696 0.48122778305 -0.43207146132 36 | 35 -0.774243265911 0.226011815169 -0.591156514466 37 | 36 -0.729174840627 0.0324751443398 -0.683556447411 38 | 37 -0.600348167624 -0.258362611278 0.756855890328 39 | 38 -0.568716615388 0.0234696454429 0.82219862997 40 | 39 -0.558822531237 0.305147738696 0.771104555914 41 | 40 -0.499782931513 0.589244963108 0.634828634216 42 | 41 -0.229147341749 0.575972939118 0.784695271538 43 | 42 -0.019244953372 0.518016524409 0.855154086822 44 | 43 0.176818754176 0.61790317754 0.76611408508 45 | 44 0.432300052558 0.696512668152 0.572701290083 46 | 45 0.584138574185 0.398864519515 0.706886993246 47 | 46 0.640168165986 0.0603165463544 0.765863325597 48 | 47 0.64835697372 -0.251416229086 0.718625851456 49 | 48 0.678548634145 -0.502525889836 0.535760656585 50 | 49 0.39549950931 -0.625901351603 0.672181252489 51 | 50 0.0458263817392 -0.673461318393 0.737800647442 52 | 51 -0.305207869723 -0.635627290272 0.709102322744 53 | 52 -0.601435465751 -0.538616861017 0.590056995183 54 | 53 -0.820219431805 -0.394990529249 0.41379048502 55 | 54 -0.798385911979 -0.146567833929 0.584035791378 56 | 55 -0.729889167224 0.0400687794547 0.6823901351 57 | 56 -0.792160616556 -0.15365054741 -0.590654778071 58 | 57 -0.802465331581 -0.39958542142 -0.443148826693 59 | 58 -0.731762819535 -0.636006255672 -0.244988201126 60 | 59 -0.485242310056 -0.759161182834 -0.433836604045 61 | 60 -0.177136070524 -0.784572211871 -0.594196311735 62 | 61 0.852689726734 -0.364382938084 -0.374359859434 63 | 62 0.870635910559 -0.0373718307386 -0.490506327698 64 | 63 0.82087289387 0.209995577341 -0.531102202601 65 | 64 0.581436610252 0.77745467726 -0.239782595417 66 | 65 0.260631360485 0.867616931657 -0.423452658314 67 | 66 -0.0494638463741 0.839596764412 -0.540953418596 68 | 67 -0.652575012077 0.720637264049 -0.234153341376 69 | 68 -0.829577988256 0.55835845106 0.00601677079547 70 | 69 -0.926821218599 0.306772019834 -0.21654873955 71 | 70 -0.765484512348 0.236219585886 0.598526330749 72 | 71 -0.744553960536 0.497096620803 0.445571935198 73 | 72 -0.624607993822 0.745488622678 0.232618931973 74 | 73 -0.346126497742 0.825729715196 0.445383974794 75 | 74 -0.0576675337567 0.77363596363 0.631000674586 76 | 75 0.184029767985 0.900533507006 0.393919341052 77 | 76 0.41579051744 0.905342368586 0.0864490673741 78 | 77 0.671158153539 0.687295435525 0.277797979196 79 | 78 0.818111108665 0.380544708444 0.431137957914 80 | 79 0.848532373104 0.0565254454446 0.526115658207 81 | 80 0.811529422964 -0.181666424562 0.555353316233 82 | 81 0.86594855553 -0.334046678628 0.372217564971 83 | 82 0.666958382864 -0.693504788594 0.272429116881 84 | 83 0.400225825796 -0.837650720209 0.371699555152 85 | 84 0.0624589070404 -0.899857992531 0.431687940773 86 | 85 -0.904042581293 0.0477080637879 -0.424771646722 87 | 86 -0.953371600356 -0.191501611353 -0.233258921551 88 | 87 -0.900455952377 -0.43433964477 -0.0229815319211 89 | 88 -0.755579282132 -0.627182346027 0.189056217153 90 | 89 -0.614061824733 -0.788985378309 -0.0207400149776 91 | 90 -0.905541444465 0.0575491602777 0.420336515791 92 | 91 -0.922273602505 0.312453289729 0.227561736372 93 | 92 -0.435243409593 0.899916620656 -0.0267067458459 94 | 93 -0.024616337875 -0.95479802371 -0.296234315752 95 | 94 0.406724825159 -0.815634300302 -0.411479774436 96 | 95 0.738574232715 -0.650071236119 -0.178649071479 97 | 96 0.857666919006 -0.503034241893 0.106602099068 98 | 97 0.972897827212 0.101393143955 -0.207820230402 99 | 98 0.860154616124 0.379802850005 -0.340417143354 100 | 99 0.822918484994 0.565853753548 -0.0511341045719 101 | 100 -0.131525708689 0.97267992446 0.19129754966 102 | 101 0.0878306921203 0.989177032129 -0.117535393092 103 | 102 -0.959172039684 -0.188151722459 0.211158536709 104 | 103 0.958152892365 0.264158603603 0.11028720232 105 | 104 0.966464182396 -0.0636034330835 0.248800296315 106 | 105 0.972536226269 -0.224248867499 -0.0623356560842 107 | 106 0.618690962595 -0.784661079678 0.0390958161561 108 | 107 0.0371742058869 -0.996087465653 0.0801738061087 109 | 108 0.381037539346 -0.924196372331 0.0259125255189 110 | 109 -0.26563367186 0.760154198548 -0.592962348555 111 | 110 -0.439695288737 0.779725734744 -0.445753106149 112 | 111 -0.217833793078 0.930957484064 -0.29303003508 113 | 112 -0.282850281275 -0.855879078681 0.432974272975 114 | 113 -0.550695493801 -0.752542999226 0.361128103896 115 | 114 -0.283138395571 -0.949758903261 0.13338168776 116 | 115 -0.495826432226 -0.853131943174 0.162240675056 117 | 116 -0.374395246018 -0.91289737912 -0.162624029453 118 | 117 -0.997998857183 0.0631725964958 -0.00273936352311 119 | 1 1 quad 5 7 1 3 120 | 2 1 quad 9 11 1 7 121 | 3 1 quad 13 15 1 11 122 | 4 1 quad 17 3 1 15 123 | 5 1 quad 18 16 2 4 124 | 6 1 quad 14 12 2 16 125 | 7 1 quad 10 8 2 12 126 | 8 1 quad 6 4 2 8 127 | 9 1 quad 12 20 19 10 128 | 10 1 quad 14 21 20 12 129 | 11 1 quad 23 22 21 14 130 | 12 1 quad 16 24 23 14 131 | 13 1 quad 18 25 24 16 132 | 14 1 quad 4 27 26 18 133 | 15 1 quad 6 28 27 4 134 | 16 1 quad 30 29 28 6 135 | 17 1 quad 8 31 30 6 136 | 18 1 quad 10 32 31 8 137 | 19 1 quad 19 33 32 10 138 | 20 1 quad 35 34 33 19 139 | 21 1 quad 20 36 35 19 140 | 22 1 quad 11 38 37 13 141 | 23 1 quad 9 39 38 11 142 | 24 1 quad 41 40 39 9 143 | 25 1 quad 7 42 41 9 144 | 26 1 quad 5 43 42 7 145 | 27 1 quad 45 44 43 5 146 | 28 1 quad 3 46 45 5 147 | 29 1 quad 17 47 46 3 148 | 30 1 quad 49 48 47 17 149 | 31 1 quad 15 50 49 17 150 | 32 1 quad 13 51 50 15 151 | 33 1 quad 37 52 51 13 152 | 34 1 quad 54 53 52 37 153 | 35 1 quad 38 55 54 37 154 | 36 1 quad 21 56 36 20 155 | 37 1 quad 22 57 56 21 156 | 38 1 quad 59 58 57 22 157 | 39 1 quad 23 60 59 22 158 | 40 1 quad 25 60 23 24 159 | 41 1 quad 27 62 61 26 160 | 42 1 quad 28 63 62 27 161 | 43 1 quad 30 65 64 29 162 | 44 1 quad 31 66 65 30 163 | 45 1 quad 34 67 110 33 164 | 46 1 quad 69 68 67 34 165 | 47 1 quad 35 85 69 34 166 | 48 1 quad 39 70 55 38 167 | 49 1 quad 40 71 70 39 168 | 50 1 quad 73 72 71 40 169 | 51 1 quad 41 74 73 40 170 | 52 1 quad 43 74 41 42 171 | 53 1 quad 44 75 74 43 172 | 54 1 quad 77 76 75 44 173 | 55 1 quad 45 78 77 44 174 | 56 1 quad 46 79 78 45 175 | 57 1 quad 47 80 79 46 176 | 58 1 quad 48 81 80 47 177 | 59 1 quad 82 96 81 48 178 | 60 1 quad 49 83 82 48 179 | 61 1 quad 50 84 83 49 180 | 62 1 quad 53 88 113 52 181 | 63 1 quad 102 87 88 53 182 | 64 1 quad 54 90 102 53 183 | 65 1 quad 57 86 85 56 184 | 66 1 quad 58 87 86 57 185 | 67 1 quad 89 88 87 58 186 | 68 1 quad 71 91 90 70 187 | 69 1 quad 72 68 91 71 188 | 70 1 quad 92 67 68 72 189 | 71 1 quad 59 116 89 58 190 | 72 1 quad 61 95 94 26 191 | 73 1 quad 105 96 95 61 192 | 74 1 quad 62 97 105 61 193 | 75 1 quad 63 98 97 62 194 | 76 1 quad 64 99 98 29 195 | 77 1 quad 66 111 101 65 196 | 78 1 quad 67 92 111 110 197 | 79 1 quad 100 101 111 92 198 | 80 1 quad 78 103 99 77 199 | 81 1 quad 79 104 103 78 200 | 82 1 quad 96 105 104 81 201 | 83 1 quad 76 77 99 64 202 | 84 1 quad 103 97 98 99 203 | 85 1 quad 104 105 97 103 204 | 86 1 quad 82 106 95 96 205 | 87 1 quad 83 108 106 82 206 | 88 1 quad 84 107 108 83 207 | 89 1 quad 88 89 115 113 208 | 90 1 quad 94 108 107 93 209 | 91 1 quad 106 108 94 95 210 | 92 1 quad 98 63 28 29 211 | 93 1 quad 101 76 64 65 212 | 94 1 quad 100 75 76 101 213 | 95 1 quad 32 109 66 31 214 | 96 1 quad 33 110 109 32 215 | 97 1 quad 100 73 74 75 216 | 98 1 quad 51 112 84 50 217 | 99 1 quad 52 113 112 51 218 | 100 1 quad 113 115 114 112 219 | 101 1 quad 112 114 107 84 220 | 102 1 quad 114 116 93 107 221 | 103 1 quad 100 92 72 73 222 | 104 1 quad 66 109 110 111 223 | 105 1 quad 81 104 79 80 224 | 106 1 quad 35 36 56 85 225 | 107 1 quad 59 60 93 116 226 | 108 1 quad 114 115 89 116 227 | 109 1 quad 91 117 102 90 228 | 110 1 quad 68 69 117 91 229 | 111 1 quad 69 85 86 117 230 | 112 1 quad 54 55 70 90 231 | 113 1 quad 117 86 87 102 232 | 114 1 quad 93 60 25 94 233 | 115 1 quad 25 18 26 94 234 | -------------------------------------------------------------------------------- /include/bem_problem_access.h: -------------------------------------------------------------------------------- 1 | #ifndef bem_problem_access_h 2 | #define bem_problem_access_h 3 | 4 | #include 5 | 6 | using namespace dealii; 7 | // using namespace deal2lkit; 8 | 9 | template 10 | class BEMProblem; 11 | 12 | template 13 | class BEMProblemAccess 14 | { 15 | public: 16 | BEMProblemAccess(){}; 17 | 18 | void 19 | initialize(BEMProblem *in) 20 | { 21 | bem_problem = in; 22 | }; 23 | const DoFHandler & 24 | get_bem_dh() const 25 | { 26 | return (bem_problem->dh); 27 | }; 28 | 29 | const FiniteElement & 30 | get_bem_fe() const 31 | { 32 | return *bem_problem->fe; 33 | } 34 | // const Triangulation & get_tria(); 35 | const Mapping & 36 | get_bem_mapping() const 37 | { 38 | return *bem_problem->mapping; 39 | }; 40 | const Quadrature & 41 | get_bem_quadrature() const 42 | { 43 | return (*bem_problem->quadrature); 44 | }; 45 | unsigned int 46 | get_bem_singular_quadrature_order() 47 | { 48 | return bem_problem->singular_quadrature_order; 49 | }; 50 | const AffineConstraints & 51 | get_bem_constraint_matrix() const 52 | { 53 | return bem_problem->constraints; 54 | } 55 | const std::vector> & 56 | get_bem_double_nodes_set() 57 | { 58 | return bem_problem->double_nodes_set; 59 | } 60 | const TrilinosWrappers::MPI::Vector & 61 | get_bem_dirichlet_nodes() const 62 | { 63 | return bem_problem->dirichlet_nodes; 64 | } 65 | 66 | // get_pinco(); 67 | // get_palla(); 68 | 69 | private: 70 | BEMProblem *bem_problem; 71 | }; 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /include/boundary_conditions.h: -------------------------------------------------------------------------------- 1 | // --------------------------------------------------------------------- 2 | // 3 | // Copyright (C) 2014 - 2020 by the pi-BEM authors. 4 | // 5 | // This file is part of the pi-BEM library. 6 | // 7 | // The pi-BEM is free software; you can use it, redistribute 8 | // it, and/or modify it under the terms of the GNU Lesser General 9 | // Public License version 2.1 as published by the Free Software Foundation. 10 | // The full text of the license can be found in the file LICENSE at 11 | // the top level of the pi-BEM distribution. 12 | // 13 | // Authors: Nicola Giuliani, Andrea Mola, Luca Heltai 14 | 15 | #ifndef boundary_conditions_h 16 | #define boundary_conditions_h 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | // #include 39 | 40 | #include 41 | 42 | #include 43 | #include 44 | #include 45 | #include 46 | 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include 52 | 53 | #include 54 | #include 55 | #include 56 | 57 | #include 58 | #include 59 | #include 60 | #include 61 | #include 62 | 63 | #include "../include/bem_problem.h" 64 | #include "../include/computational_domain.h" 65 | using namespace dealii; 66 | /** 67 | * - BoundaryCondition. The class handles the boundary conditions. In particular 68 | * - it reads the boundary conditions for the potential and its normal 69 | * derivative; 70 | * - given the peculiarities of the BEM, the boundary conditions represent the 71 | * actual unknowns, thus it creates the vectors containing the variables and 72 | * fills them with the proper data; 73 | * - it performs the error analysis on both unknowns. 74 | */ 75 | template 76 | class BoundaryConditions : public ParameterAcceptor 77 | { 78 | public: 79 | BoundaryConditions(ComputationalDomain &comp_dom, 80 | BEMProblem &bem, 81 | const MPI_Comm comm = MPI_COMM_WORLD) 82 | : wind(dim) 83 | , comp_dom(comp_dom) 84 | , bem(bem) 85 | , mpi_communicator(comm) 86 | , n_mpi_processes(Utilities::MPI::n_mpi_processes(mpi_communicator)) 87 | , this_mpi_process(Utilities::MPI::this_mpi_process(mpi_communicator)) 88 | , pcout(std::cout, (this_mpi_process == 0)) 89 | { 90 | dofs_number = 0, output_frequency = 1; 91 | } 92 | 93 | 94 | typedef typename DoFHandler::active_cell_iterator cell_it; 95 | 96 | virtual void 97 | declare_parameters(ParameterHandler &prm) override; 98 | 99 | virtual void 100 | parse_parameters(ParameterHandler &prm) override; 101 | 102 | void 103 | prepare_bem_vectors(); 104 | 105 | void 106 | solve_problem(); 107 | 108 | void 109 | output_results(const std::string); 110 | 111 | void 112 | compute_errors(); 113 | 114 | const TrilinosWrappers::MPI::Vector & 115 | get_phi(); 116 | 117 | const TrilinosWrappers::MPI::Vector & 118 | get_dphi_dn(); 119 | 120 | 121 | std::string output_file_name; 122 | 123 | protected: 124 | Functions::ParsedFunction wind; 125 | 126 | Functions::ParsedFunction potential; 127 | 128 | std::string node_displacement_type; 129 | 130 | SolverControl solver_control; 131 | 132 | ComputationalDomain &comp_dom; 133 | 134 | BEMProblem &bem; 135 | 136 | types::global_dof_index dofs_number; 137 | 138 | unsigned int output_frequency; 139 | 140 | TrilinosWrappers::MPI::Vector tmp_rhs; 141 | TrilinosWrappers::MPI::Vector phi; 142 | TrilinosWrappers::MPI::Vector dphi_dn; 143 | 144 | MPI_Comm mpi_communicator; 145 | 146 | unsigned int n_mpi_processes; 147 | 148 | unsigned int this_mpi_process; 149 | 150 | bool have_dirichlet_bc; 151 | 152 | IndexSet this_cpu_set; 153 | 154 | ConditionalOStream pcout; 155 | }; 156 | 157 | #endif 158 | -------------------------------------------------------------------------------- /include/cached_nurbs_patch_manifold.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | DEAL_II_NAMESPACE_OPEN 6 | 7 | 8 | template 9 | class CachedNURBSPatchManifold 10 | : public OpenCASCADE::NURBSPatchManifold 11 | { 12 | public: 13 | CachedNURBSPatchManifold(const TopoDS_Face &face, 14 | const double tolerance = 1e-7) //, 15 | // const types::global_dof_index cache_size=100000) 16 | : OpenCASCADE::NURBSPatchManifold<2, 3>(face, tolerance) 17 | , tolerance(tolerance) 18 | , face(face){ 19 | // projections_cache.reserve(cache_size); 20 | }; 21 | 22 | virtual Point 23 | pull_back(const Point &space_point) const override; 24 | 25 | // virtual Point<3> get_new_point(const ArrayView> 26 | // &surrounding_points, 27 | // const ArrayView &weights) const; 28 | 29 | // virtual void get_new_points(const ArrayView> 30 | // &surrounding_points, 31 | // const Table<2,double> &weights, 32 | // ArrayView> new_points) const; 33 | // virtual Tensor<1,3> get_tangent_vector (const Point<3> &x1, 34 | // const Point<3> &x2) const; 35 | 36 | inline std::unordered_map> & 37 | get_projections_cache() 38 | { 39 | return projections_cache; 40 | }; 41 | 42 | mutable types::global_dof_index new_pull_backs, cache_hits; 43 | 44 | private: 45 | mutable std::unordered_map> projections_cache; 46 | double tolerance; 47 | TopoDS_Face face; 48 | const FlatManifold sub_manifold; 49 | }; 50 | 51 | 52 | 53 | DEAL_II_NAMESPACE_CLOSE -------------------------------------------------------------------------------- /include/constrained_matrix.h: -------------------------------------------------------------------------------- 1 | // --------------------------------------------------------------------- 2 | // 3 | // Copyright (C) 2014 - 2020 by the pi-BEM authors. 4 | // 5 | // This file is part of the pi-BEM library. 6 | // 7 | // The pi-BEM is free software; you can use it, redistribute 8 | // it, and/or modify it under the terms of the GNU Lesser General 9 | // Public License version 2.1 as published by the Free Software Foundation. 10 | // The full text of the license can be found in the file LICENSE at 11 | // the top level of the pi-BEM distribution. 12 | // 13 | // Authors: Nicola Giuliani, Andrea Mola, Luca Heltai 14 | 15 | #ifndef __deal2__constrained_matrix_h 16 | # define __deal2__constrained_matrix_h 17 | 18 | 19 | 20 | # include 21 | 22 | # include 23 | # include 24 | # include 25 | # include 26 | 27 | # include 28 | # include 29 | 30 | # include 31 | # include 32 | 33 | DEAL_II_NAMESPACE_OPEN 34 | 35 | template 36 | class Vector; 37 | template 38 | class ConstrainedMatrixBlock; 39 | 40 | 41 | /*! @addtogroup Matrix2 42 | *@{ 43 | */ 44 | 45 | 46 | /** 47 | * 48 | * @author Luca Heltai 2011 49 | */ 50 | 51 | template 52 | class ConstrainedOperator 53 | { 54 | public: 55 | ConstrainedOperator(const MATRIX &m, 56 | const AffineConstraints &c, 57 | const IndexSet &c_cpu_set, 58 | MPI_Comm comm = MPI_COMM_WORLD) 59 | : constraints(c) 60 | , matrix(m) 61 | , constr_cpu_set(c_cpu_set) 62 | , mpi_communicator(comm) 63 | , n_mpi_processes(Utilities::MPI::n_mpi_processes(mpi_communicator)) 64 | , this_mpi_process(Utilities::MPI::this_mpi_process(mpi_communicator)) 65 | {} 66 | 67 | 68 | 69 | void 70 | vmult(VEC &dst, const VEC &src) const; 71 | 72 | void 73 | distribute_rhs(VEC &rhs) const; 74 | 75 | private: 76 | const AffineConstraints &constraints; 77 | const MATRIX &matrix; 78 | const IndexSet constr_cpu_set; 79 | MPI_Comm mpi_communicator; 80 | unsigned int n_mpi_processes; 81 | unsigned int this_mpi_process; 82 | }; 83 | 84 | /*@}*/ 85 | /*---------------------- Inline functions -----------------------------------*/ 86 | 87 | 88 | //--------------------------------Iterators--------------------------------------// 89 | 90 | 91 | template 92 | void 93 | ConstrainedOperator::vmult(VEC &dst, const VEC &src) const 94 | { 95 | // Vector loc_src(src); 96 | VEC loc_src(constr_cpu_set); 97 | loc_src.reinit(src, false, true); 98 | // loc_src = src; 99 | 100 | // std::cout<<"in vector "<> *entries = 116 | constraints.get_constraint_entries(i); 117 | for (unsigned int j = 0; j < entries->size(); ++j) 118 | dst(i) -= (*entries)[j].second * loc_src((*entries)[j].first); 119 | } 120 | else 121 | dst(i) += 0.; 122 | 123 | dst.compress(VectorOperation::add); 124 | // constraints.condense(dst); 125 | // std::cout<<"out vector "< 138 | void 139 | ConstrainedOperator::distribute_rhs(VEC &rhs) const 140 | { 141 | for (auto i : rhs.locally_owned_elements()) 142 | if ((constraints.is_constrained(i)) && 143 | (rhs.locally_owned_elements().is_element(i))) 144 | rhs(i) = constraints.get_inhomogeneity(i); 145 | else 146 | rhs(i) = rhs(i); 147 | } 148 | 149 | 150 | DEAL_II_NAMESPACE_CLOSE 151 | 152 | #endif 153 | /*---------------------------- filtered_matrix.h ---------------------------*/ 154 | -------------------------------------------------------------------------------- /include/driver.h: -------------------------------------------------------------------------------- 1 | // --------------------------------------------------------------------- 2 | // 3 | // Copyright (C) 2014 - 2020 by the pi-BEM authors. 4 | // 5 | // This file is part of the pi-BEM library. 6 | // 7 | // The pi-BEM is free software; you can use it, redistribute 8 | // it, and/or modify it under the terms of the GNU Lesser General 9 | // Public License version 2.1 as published by the Free Software Foundation. 10 | // The full text of the license can be found in the file LICENSE at 11 | // the top level of the pi-BEM distribution. 12 | // 13 | // Authors: Nicola Giuliani, Andrea Mola, Luca Heltai 14 | 15 | #ifndef driver_h 16 | #define driver_h 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | // 34 | // #include 35 | // #include 36 | // #include 37 | // #include 38 | // #include 39 | // 40 | // #include 41 | // #include 42 | // #include 43 | // #include 44 | // #include 45 | 46 | #include 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include 52 | // #include 53 | 54 | #include 55 | #include 56 | #include 57 | #include 58 | 59 | #include 60 | #include 61 | #include 62 | #include 63 | #include 64 | 65 | #include 66 | #include 67 | #include 68 | 69 | // And here are a few C++ standard header 70 | // files that we will need: 71 | 72 | #include 73 | #include 74 | #include 75 | #include 76 | #include 77 | 78 | #include "bem_fma.h" 79 | #include "bem_problem.h" 80 | #include "boundary_conditions.h" 81 | #include "computational_domain.h" 82 | using namespace dealii; 83 | 84 | // using namespace TrilinosWrappers::MPI::Vector; 85 | // using namespace TrilinosWrappers::MPI::SparseMatrix; 86 | 87 | /** 88 | * This class is in charge of organising the overall BEM simulation. It has 89 | * interfaces with all the other classes in order to have a complete simulation. 90 | */ 91 | template 92 | class Driver : public ParameterAcceptor 93 | { 94 | public: 95 | Driver(); 96 | 97 | ~Driver(); 98 | 99 | /// method to declare the parameters 100 | /// to be read from the parameters file 101 | 102 | virtual void 103 | declare_parameters(ParameterHandler &prm) override; 104 | 105 | /// method to parse the needed parameters 106 | /// from the parameters file 107 | 108 | virtual void 109 | parse_parameters(ParameterHandler &prm) override; 110 | 111 | 112 | void 113 | run(); 114 | 115 | protected: 116 | ConditionalOStream pcout; 117 | 118 | MPI_Comm mpi_communicator; 119 | 120 | ComputationalDomain computational_domain; 121 | 122 | BEMProblem bem_problem; 123 | 124 | BoundaryConditions boundary_conditions; 125 | 126 | ParameterHandler prm; 127 | 128 | bool global_refinement; 129 | 130 | const unsigned int n_mpi_processes; 131 | const unsigned int this_mpi_process; 132 | }; 133 | 134 | #endif 135 | -------------------------------------------------------------------------------- /include/laplace_kernel.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | 6 | // And here are a few C++ standard header 7 | // files that we will need: 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | 15 | namespace LaplaceKernel 16 | { 17 | template 18 | double 19 | single_layer(const Point &R) 20 | { 21 | switch (dim) 22 | { 23 | case 2: 24 | return (-std::log(R.norm()) / (2 * numbers::PI)); 25 | 26 | case 3: 27 | return (1. / (R.norm() * 4 * numbers::PI)); 28 | 29 | default: 30 | Assert(false, ExcInternalError()); 31 | return 0.; 32 | } 33 | } 34 | 35 | 36 | 37 | template 38 | Point 39 | double_layer(const Point &R) 40 | { 41 | switch (dim) 42 | { 43 | case 2: 44 | return R / (-2 * numbers::PI * R.square()); 45 | case 3: 46 | return R / (-4 * numbers::PI * R.square() * R.norm()); 47 | 48 | default: 49 | Assert(false, ExcInternalError()); 50 | return Point(); 51 | } 52 | } 53 | 54 | template // mio// 55 | Tensor<2, dim> 56 | hypersingular(const Point &R) 57 | { 58 | Tensor<2, dim> Hyper; 59 | switch (dim) 60 | { 61 | case 2: 62 | Hyper[0][0] = -R[0] * R[0] + R[1] * R[1]; 63 | Hyper[1][1] = R[0] * R[0] - R[1] * R[1]; 64 | Hyper[0][1] = -2 * R[0] * R[1]; 65 | Hyper[1][0] = -2 * R[0] * R[1]; 66 | Hyper = Hyper / (-2 * numbers::PI * R.square() * R.square()); 67 | return Hyper; 68 | case 3: 69 | { 70 | for (unsigned int i = 0; i < dim; ++i) 71 | for (unsigned int j = 0; j < dim; ++j) 72 | if (i == j) 73 | { 74 | Hyper[j][j] = 2 * (R[j] * R[j]); 75 | for (unsigned int k = 0; k < dim && k != i; ++k) 76 | Hyper[j][j] -= (R[k] * R[k]); 77 | } 78 | else 79 | Hyper[i][j] = 3 * R[i] * R[j]; 80 | return Hyper / 81 | (-4 * numbers::PI * R.square() * R.square() * R.norm()); 82 | } 83 | 84 | 85 | default: 86 | Assert(false, ExcInternalError()); 87 | return Point(); 88 | } 89 | } 90 | 91 | template 92 | void 93 | kernels(const Tensor<1, dim> &R, Tensor<1, dim> &D, double &d) 94 | { 95 | double r = R.norm(); 96 | double r2 = r * r; 97 | switch (dim) 98 | { 99 | case 2: 100 | d = -std::log(r) / (2 * numbers::PI); 101 | D = R / (-2 * numbers::PI * r2); 102 | break; 103 | case 3: 104 | d = (1. / (r * 4 * numbers::PI)); 105 | D = R / (-4 * numbers::PI * r2 * r); 106 | break; 107 | default: 108 | Assert(false, ExcInternalError()); 109 | } 110 | } 111 | 112 | template // mio// 113 | void 114 | kernels(const Tensor<1, dim> &R, 115 | Tensor<2, dim> &H, 116 | Tensor<1, dim> &D, 117 | double &d) 118 | { 119 | double r = R.norm(); 120 | double r2 = r * r; 121 | switch (dim) 122 | { 123 | case 2: 124 | d = -std::log(r) / (2 * numbers::PI); 125 | D = R / (-2 * numbers::PI * r2); 126 | H = 0; 127 | H[0][0] = -R[0] * R[0] + R[1] * R[1]; 128 | H[1][1] = R[0] * R[0] - R[1] * R[1]; 129 | H[0][1] = -2 * R[0] * R[1]; 130 | H[1][0] = -2 * R[0] * R[1]; 131 | H = H / (-2 * numbers::PI * r2 * r2); 132 | break; 133 | case 3: 134 | d = (1. / (r * 4 * numbers::PI)); 135 | D = R / (4 * numbers::PI * r2 * r); 136 | H = 0; 137 | /* for(unsigned int i=0;i 5 | 6 | #include 7 | 8 | #include 9 | #include 10 | 11 | #include "ass_leg_function.h" 12 | #include "local_expansion_coeff.h" 13 | #include "multipole_expansion.h" 14 | 15 | 16 | class LocalExpansion 17 | { 18 | public: 19 | static FullMatrix A_n_m; 20 | 21 | // static std::vector > > > 22 | // mExp_to_lExp_Coeff; 23 | 24 | static std::vector>>> 25 | lExp_to_lExp_Coeff; 26 | 27 | static LocalExpansionCoeff mExp_to_lExp_Coeff; 28 | 29 | mutable bool is_zero; 30 | 31 | 32 | private: 33 | mutable unsigned int p; 34 | 35 | mutable dealii::Point<3> center; 36 | 37 | mutable const AssLegFunction *assLegFunction; 38 | 39 | mutable std::complex *_L_n_m; 40 | 41 | 42 | public: 43 | LocalExpansion(); 44 | 45 | LocalExpansion(const unsigned int order, 46 | const dealii::Point<3> ¢er, 47 | const AssLegFunction *assLegFunction); 48 | 49 | LocalExpansion(const LocalExpansion &other); 50 | 51 | ~LocalExpansion(); 52 | 53 | void 54 | Add(const std::vector &real, const std::vector &imag); 55 | 56 | 57 | void 58 | Add(const LocalExpansion &parent); 59 | 60 | void 61 | Add(const MultipoleExpansion &multipole); 62 | 63 | double 64 | Evaluate(const dealii::Point<3> &evalPoint); 65 | 66 | inline dealii::Point<3> & 67 | GetCenter() const 68 | { 69 | return this->center; 70 | } 71 | 72 | inline void 73 | SetCenter(const dealii::Point<3> &new_center) 74 | { 75 | this->center = new_center; 76 | } 77 | 78 | inline FullMatrix 79 | GetA_n_m() const 80 | { 81 | return this->A_n_m; 82 | } 83 | 84 | inline unsigned int 85 | GetOrder() const 86 | { 87 | return this->p; 88 | } 89 | 90 | inline std::complex * 91 | GetCoeffs() const 92 | { 93 | return this->_L_n_m; 94 | } 95 | 96 | inline std::complex & 97 | GetCoeff(unsigned int n, unsigned int m) const 98 | { 99 | return this->_L_n_m[(n) * (n + 1) / 2 + m]; 100 | } 101 | 102 | void 103 | SetCoeff(unsigned int n, unsigned int m, std::complex &value) const 104 | { 105 | this->_L_n_m[(n) * (n + 1) / 2 + m] = value; 106 | } 107 | 108 | void 109 | AddToCoeff(unsigned int n, unsigned int m, std::complex &value) const 110 | { 111 | this->_L_n_m[(n) * (n + 1) / 2 + m] += value; 112 | } 113 | 114 | LocalExpansion & 115 | operator=(const LocalExpansion &other); 116 | 117 | 118 | static FullMatrix 119 | A_n_m_Matrix(unsigned int dimension) 120 | { 121 | FullMatrix A_n_m(dimension + 1, dimension + 1); 122 | for (unsigned int n = 0; n < dimension + 1; n++) 123 | 124 | { 125 | for (unsigned int m = 0; m < n + 1; m++) 126 | 127 | { 128 | double f1 = 1.; 129 | double f2 = 1.; 130 | 131 | for (int ii = n - m; ii > 0; ii--) 132 | f1 *= ii; 133 | 134 | for (int ii = n + m; ii > 0; ii--) 135 | f2 *= (ii); 136 | 137 | A_n_m(n, m) = pow(-1., double(n)) / sqrt(f1 * f2); 138 | } 139 | } 140 | 141 | return A_n_m; 142 | } 143 | 144 | // static std::vector > > > 145 | static LocalExpansionCoeff 146 | mExp_to_lExp_Coeff_Build(FullMatrix A_n_m, unsigned int p) 147 | { 148 | LocalExpansionCoeff loc_exp_coeff(p); 149 | std::complex imUnit = std::complex(0., 1.); 150 | std::vector>>> realCoeff; 151 | realCoeff.resize(p + 1); 152 | for (int n = 0; n < int(p) + 1; n++) 153 | { 154 | realCoeff[n].resize(n + 1); 155 | for (int m = 0; m < n + 1; m++) 156 | { 157 | realCoeff[n][m].resize(p + 1); 158 | for (int nn = 0; nn < int(p) + 1; nn++) 159 | { 160 | for (int mm = -1 * nn; mm < nn + 1; mm++) 161 | { 162 | // double realFact = (*gsl_matrix_ptr(A_n_m,nn,abs(mm))) / 163 | // (*gsl_matrix_ptr(A_n_m,n+nn,abs(m-mm))) * 164 | // (*gsl_matrix_ptr(A_n_m,n,abs(m))); 165 | double realFact = A_n_m(nn, abs(mm)) / 166 | A_n_m(n + nn, abs(m - mm)) * 167 | A_n_m(n, abs(m)); 168 | realFact *= 169 | (pow(imUnit, double(abs(m - mm) - abs(m) - abs(mm)))) 170 | .real() / 171 | pow(-1., nn); 172 | realCoeff[n][m][nn][mm] = realFact; 173 | loc_exp_coeff.set(n, m, nn, mm, realFact); 174 | } 175 | } 176 | } 177 | } 178 | return loc_exp_coeff; 179 | // return realCoeff; 180 | } 181 | 182 | static std::vector>>> 183 | lExp_to_lExp_Coeff_Build(FullMatrix A_n_m, unsigned int p) 184 | { 185 | std::complex imUnit = std::complex(0., 1.); 186 | std::vector>>> realCoeff; 187 | realCoeff.resize(p + 1); 188 | for (int n = 0; n < int(p) + 1; n++) 189 | { 190 | realCoeff[n].resize(n + 1); 191 | for (int m = 0; m < n + 1; m++) 192 | { 193 | for (int nn = n; nn < int(p) + 1; nn++) 194 | { 195 | for (int mm = -1 * nn; mm < nn + 1; mm++) 196 | { 197 | // double realFact = (*gsl_matrix_ptr(A_n_m,nn-n,abs(mm-m))) 198 | // / (*gsl_matrix_ptr(A_n_m,nn,abs(mm))) * 199 | // (*gsl_matrix_ptr(A_n_m,n,abs(m))); 200 | double realFact = A_n_m(nn - n, abs(mm - m)) / 201 | A_n_m(nn, abs(mm)) * A_n_m(n, abs(m)); 202 | realFact *= 203 | (pow(imUnit, double(abs(mm) - abs(mm - m) - abs(m)))) 204 | .real() * 205 | pow(-1., nn + n); 206 | realCoeff[n][m][nn][mm] = realFact; 207 | } 208 | } 209 | } 210 | } 211 | 212 | 213 | 214 | return realCoeff; 215 | } 216 | }; 217 | 218 | 219 | 220 | #endif /*LOCALEXPANSION_H_*/ 221 | -------------------------------------------------------------------------------- /include/local_expansion_coeff.h: -------------------------------------------------------------------------------- 1 | // --------------------------------------------------------------------- 2 | // 3 | // Copyright (C) 2014 - 2020 by the pi-BEM authors. 4 | // 5 | // This file is part of the pi-BEM library. 6 | // 7 | // The pi-BEM is free software; you can use it, redistribute 8 | // it, and/or modify it under the terms of the GNU Lesser General 9 | // Public License version 2.1 as published by the Free Software Foundation. 10 | // The full text of the license can be found in the file LICENSE at 11 | // the top level of the pi-BEM distribution. 12 | // 13 | // Authors: Nicola Giuliani, Andrea Mola, Luca Heltai 14 | 15 | #ifndef LOCALEXPANSIONCOEFF_H 16 | #define LOCALEXPANSIONCOEFF_H 17 | 18 | class LocalExpansionCoeff 19 | { 20 | public: 21 | LocalExpansionCoeff(); 22 | LocalExpansionCoeff(const unsigned int &p); 23 | LocalExpansionCoeff(const LocalExpansionCoeff &orig); 24 | double 25 | get(const unsigned int &n, 26 | const unsigned int &m, 27 | const unsigned int &nn, 28 | const unsigned int &mm); 29 | void 30 | set(const unsigned int &n, 31 | const unsigned int &m, 32 | const unsigned int &nn, 33 | const unsigned int &mm, 34 | const double &value); 35 | unsigned int 36 | getNumberOfElements(); 37 | unsigned int 38 | getNNOffset(const unsigned int &nn); 39 | unsigned int 40 | getMOffset(const unsigned int &m); 41 | unsigned int 42 | getNOffset(const unsigned int &n); 43 | virtual ~LocalExpansionCoeff(); 44 | 45 | // Debugging and test of indexes 46 | // static unsigned int const loopDebugger(const unsigned int & p); 47 | // void fillCoeffWithIndex(); 48 | // void printCoeff(); 49 | 50 | private: 51 | unsigned int _p; 52 | double *_coeff; 53 | }; 54 | 55 | #endif /* LOCALEXPANSIONCOEFF_HPP */ 56 | -------------------------------------------------------------------------------- /include/multipole_expansion.h: -------------------------------------------------------------------------------- 1 | // --------------------------------------------------------------------- 2 | // 3 | // Copyright (C) 2014 - 2020 by the pi-BEM authors. 4 | // 5 | // This file is part of the pi-BEM library. 6 | // 7 | // The pi-BEM is free software; you can use it, redistribute 8 | // it, and/or modify it under the terms of the GNU Lesser General 9 | // Public License version 2.1 as published by the Free Software Foundation. 10 | // The full text of the license can be found in the file LICENSE at 11 | // the top level of the pi-BEM distribution. 12 | // 13 | // Authors: Nicola Giuliani, Andrea Mola, Luca Heltai 14 | 15 | #ifndef MULTIPOLE_EXPANSION_H_ 16 | #define MULTIPOLE_EXPANSION_H_ 17 | 18 | #include 19 | 20 | #include 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | #include "ass_leg_function.h" 27 | 28 | using namespace dealii; 29 | 30 | 31 | class MultipoleExpansion 32 | { 33 | public: 34 | static FullMatrix A_n_m; 35 | 36 | mutable bool is_zero; 37 | 38 | private: 39 | mutable unsigned int p; 40 | 41 | mutable dealii::Point<3> center; 42 | 43 | mutable const AssLegFunction *assLegFunction; 44 | 45 | mutable std::complex *_M_n_m; 46 | 47 | 48 | 49 | public: 50 | MultipoleExpansion(); 51 | 52 | MultipoleExpansion(const unsigned int order, 53 | const dealii::Point<3> ¢er, 54 | const AssLegFunction *assLegFunction); 55 | 56 | MultipoleExpansion(const MultipoleExpansion &other); 57 | 58 | ~MultipoleExpansion(); 59 | 60 | void 61 | Add(const MultipoleExpansion &multipole, const double sol); 62 | 63 | void 64 | Add(const double strength, const dealii::Point<3> &point); 65 | 66 | void 67 | Add(const MultipoleExpansion &child); 68 | 69 | void 70 | AddNormDer(const double strength, 71 | const dealii::Point<3> &point, 72 | const dealii::Tensor<1, 3> &normal); 73 | 74 | double 75 | Evaluate(const dealii::Point<3> &evalPoint); 76 | 77 | inline dealii::Point<3> 78 | GetCenter() const 79 | { 80 | return this->center; 81 | } 82 | 83 | inline void 84 | SetCenter(const dealii::Point<3> &new_center) 85 | { 86 | this->center = new_center; 87 | } 88 | 89 | inline FullMatrix & 90 | GetA_n_m() const 91 | { 92 | return this->A_n_m; 93 | } 94 | 95 | inline std::complex * 96 | GetCoeffs() const 97 | { 98 | return this->_M_n_m; 99 | } 100 | 101 | inline std::complex & 102 | GetCoeff(unsigned int n, unsigned int m) const 103 | { 104 | return this->_M_n_m[(n) * (n + 1) / 2 + m]; 105 | } 106 | 107 | inline void 108 | SetCoeff(unsigned int n, unsigned int m, std::complex &value) const 109 | { 110 | this->_M_n_m[(n) * (n + 1) / 2 + m] = value; 111 | } 112 | 113 | inline void 114 | AddToCoeff(unsigned int n, unsigned int m, std::complex &value) const 115 | { 116 | this->_M_n_m[(n) * (n + 1) / 2 + m] += value; 117 | } 118 | 119 | MultipoleExpansion & 120 | operator=(const MultipoleExpansion &other); 121 | 122 | 123 | static FullMatrix 124 | A_n_m_Matrix(unsigned int dim) 125 | { 126 | FullMatrix A_n_m(dim + 1, dim + 1); 127 | for (unsigned int n = 0; n < dim + 1; n++) 128 | 129 | { 130 | for (unsigned int m = 0; m < n + 1; m++) 131 | 132 | { 133 | double f1 = 1.; 134 | double f2 = 1.; 135 | 136 | for (int ii = n - m; ii > 0; ii--) 137 | f1 *= ii; 138 | 139 | for (int ii = n + m; ii > 0; ii--) 140 | f2 *= (ii); 141 | 142 | A_n_m(n, m) = pow(-1., double(n)) / sqrt(f1 * f2); 143 | } 144 | } 145 | 146 | return A_n_m; 147 | } 148 | }; 149 | 150 | 151 | 152 | #endif /*MULTIPOLE_EXPANSION_H_*/ 153 | -------------------------------------------------------------------------------- /include/octree_block.h: -------------------------------------------------------------------------------- 1 | 2 | // --------------------------------------------------------------------- 3 | // 4 | // Copyright (C) 2014 - 2020 by the pi-BEM authors. 5 | // 6 | // This file is part of the pi-BEM library. 7 | // 8 | // The pi-BEM is free software; you can use it, redistribute 9 | // it, and/or modify it under the terms of the GNU Lesser General 10 | // Public License version 2.1 as published by the Free Software Foundation. 11 | // The full text of the license can be found in the file LICENSE at 12 | // the top level of the pi-BEM distribution. 13 | // 14 | // Authors: Nicola Giuliani, Andrea Mola, Luca Heltai 15 | 16 | #ifndef octree_block_h 17 | #define octree_block_h 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | // #include 41 | 42 | #include 43 | #include 44 | #include 45 | #include 46 | 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include 52 | 53 | #include 54 | #include 55 | #include 56 | 57 | // And here are a few C++ standard header 58 | // files that we will need: 59 | #include 60 | #include 61 | #include 62 | #include 63 | #include 64 | #include 65 | 66 | 67 | using namespace dealii; 68 | 69 | template 70 | class OctreeBlock 71 | { 72 | public: 73 | typedef typename DoFHandler::active_cell_iterator cell_it; 74 | 75 | 76 | private: 77 | unsigned int level; 78 | 79 | types::global_dof_index parentId; 80 | 81 | unsigned int numChildren; 82 | 83 | types::global_dof_index childrenId[8]; 84 | 85 | std::vector> nearNeigh; 86 | 87 | std::vector> intList; 88 | 89 | std::vector> nonIntList; 90 | 91 | Point pMin; 92 | 93 | double delta; 94 | 95 | std::vector nodesId; 96 | 97 | std::map> quadPointsId; 98 | 99 | 100 | public: 101 | OctreeBlock(); 102 | 103 | OctreeBlock(unsigned int level, 104 | types::global_dof_index parent, 105 | Point pMin, 106 | double delta); 107 | 108 | OctreeBlock(const OctreeBlock &other); 109 | 110 | ~OctreeBlock(); 111 | 112 | void 113 | CopyContent(const OctreeBlock *other); 114 | 115 | void 116 | AddNode(types::global_dof_index nodeId); 117 | 118 | void 119 | AddQuadPoint(cell_it elemPointer, types::global_dof_index quadPointId); 120 | 121 | std::vector 122 | GetBlockNodeList() const; 123 | 124 | void 125 | DelNodeList(); 126 | 127 | std::map> 128 | GetBlockQuadPointsList() const; 129 | 130 | void 131 | DelQuadPointsList(); 132 | 133 | types::global_dof_index 134 | GetBlockNodesNum() const; 135 | 136 | unsigned int 137 | GetBlockChildrenNum() const; 138 | 139 | types::global_dof_index 140 | GetParentId() const; 141 | 142 | void 143 | AddChild(types::global_dof_index childId); 144 | 145 | types::global_dof_index 146 | GetChildId(unsigned int idInList) const; 147 | 148 | Point 149 | GetPMin() const; 150 | 151 | double 152 | GetDelta() const; 153 | 154 | void 155 | AddNearNeigh(unsigned int sublevel, const types::global_dof_index nnBlockId); 156 | 157 | unsigned int 158 | NumNearNeigh(unsigned int sublevel) const; 159 | 160 | unsigned int 161 | NumNearNeighLevels() const; 162 | 163 | std::set 164 | GetNearNeighs(unsigned int sublevel) const; 165 | 166 | void 167 | AddBlockToIntList(unsigned int sublevel, 168 | const types::global_dof_index intListBlockId); 169 | 170 | types::global_dof_index 171 | NumIntList(unsigned int sublevel) const; 172 | 173 | unsigned int 174 | NumIntListLevels() const; 175 | 176 | std::set 177 | GetIntList(unsigned int sublevel) const; 178 | 179 | std::vector> 180 | GetIntList() const; 181 | 182 | void 183 | AddBlockToNonIntList(unsigned int sublevel, 184 | const types::global_dof_index intListBlockId); 185 | 186 | types::global_dof_index 187 | NumNonIntList(unsigned int sublevel) const; 188 | 189 | unsigned int 190 | NumNonIntListLevels() const; 191 | 192 | std::set 193 | GetNonIntList(unsigned int sublevel) const; 194 | 195 | void 196 | SetNearNeighSize(unsigned int sublevels); 197 | 198 | void 199 | SetIntListSize(unsigned int sublevels); 200 | 201 | void 202 | SetNonIntListSize(unsigned int sublevels); 203 | 204 | unsigned int 205 | GetNearNeighSize() const; 206 | 207 | types::global_dof_index 208 | GetIntListSize() const; 209 | 210 | types::global_dof_index 211 | GetNonIntListSize() const; 212 | }; 213 | 214 | 215 | #endif 216 | -------------------------------------------------------------------------------- /include/singular_kernel_integral.h: -------------------------------------------------------------------------------- 1 | #ifndef singular_kernel_integral_h 2 | #define singular_kernel_integral_h 3 | 4 | // The most fundamental class in the library is the Triangulation class, which 5 | // is declared here: 6 | #include 7 | 8 | #include 9 | // And this is the file in which the functions are declared that create grids: 10 | #include 11 | 12 | // This file contains the description of the Lagrange interpolation finite 13 | // element: 14 | #include 15 | #include 16 | 17 | 18 | // And this file is needed for the creation of sparsity patterns of sparse 19 | // matrices, as shown in previous examples: 20 | #include 21 | 22 | // The next two files are needed for assembling the matrix using quadrature on 23 | // each cell. The classes declared in them will be explained below: 24 | #include 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | // We need the following two includes for loops over cells and/or faces: 32 | #include 33 | #include 34 | // Here are some functions to generate standard grids: 35 | #include 36 | #include 37 | 38 | // Output of grids in various graphics formats: 39 | #include 40 | 41 | // This is needed for C++ output: 42 | #include 43 | #include 44 | // And this for the declarations of the `std::sqrt` and `std::fabs` functions: 45 | #include 46 | 47 | // The final step in importing deal.II is this: All deal.II functions and 48 | // classes are in a namespace dealii, to make sure they don't 49 | // clash with symbols from other libraries you may want to use in conjunction 50 | // with deal.II. One could use these functions and classes by prefixing every 51 | // use of these names by dealii::, but that would quickly become 52 | // cumbersome and annoying. Rather, we simply import the entire deal.II 53 | // namespace for general use: 54 | using namespace dealii; 55 | 56 | template 57 | class SingularKernelIntegral 58 | { 59 | public: 60 | SingularKernelIntegral( 61 | const typename DoFHandler::active_cell_iterator &in_cell, 62 | const FiniteElement &in_fe, 63 | const Mapping &in_mapping, 64 | const Point &in_eta); 65 | 66 | 67 | 68 | Tensor<1, dim> 69 | evaluate_free_term_b(); 70 | 71 | 72 | std::vector> 73 | evaluate_VkNj_integrals(); 74 | 75 | 76 | std::vector> 77 | evaluate_WkNj_integrals(); 78 | 79 | 80 | private: 81 | const typename DoFHandler::active_cell_iterator &cell; 82 | const FiniteElement &fe; 83 | const Mapping &mapping; 84 | const Point η 85 | // to be read from input file 86 | unsigned int rho_quadrature_order = 4; 87 | unsigned int theta_quadrature_order = 20; 88 | }; 89 | 90 | #endif 91 | -------------------------------------------------------------------------------- /include/time_integrator.h: -------------------------------------------------------------------------------- 1 | #ifndef __thiwi__time_integrator_h 2 | #define __thiwi__time_integrator_h 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "ode_argument.h" 9 | 10 | using namespace std; 11 | using namespace dealii; 12 | 13 | class TimeIntegrator 14 | { 15 | public: 16 | /** Constructor for the TimeIntegrator class. The Solver class is 17 | * required to have a Solver.solve(Vector &dst, const 18 | * Vector &src) method that will be called by the time 19 | * integrator to find out about the solution to a given src. */ 20 | TimeIntegrator(OdeArgument &solver); 21 | 22 | /** Declare parameters for this class to function properly. */ 23 | static void 24 | declare_parameters(ParameterHandler &prm); 25 | 26 | /** Parse a parameter handler. */ 27 | void 28 | parse_parameters(ParameterHandler &prm); 29 | 30 | /** Returns a list of implemented stepping schemes, suitable for 31 | * use with parameter handler class. */ 32 | static string 33 | get_stepping_names(); 34 | 35 | /** Reinit the solver with different types or values (for example, 36 | * after reading a paramter file). */ 37 | void 38 | initialize(); 39 | 40 | /** Evolve. */ 41 | void 42 | start_ode(const double initial_data[]); 43 | 44 | /** To get the output frequency from other classes using the time integrator. 45 | */ 46 | // inline unsigned int Output_frequency() 47 | // {return output_frequency;} 48 | 49 | unsigned int output_frequency; 50 | 51 | private: 52 | /** The bubble membrane poperties. */ 53 | OdeArgument &solver; 54 | 55 | /** Type of time integration. RK, EI, EE. */ 56 | const gsl_odeiv_step_type *type; 57 | 58 | /** Time integrator step control*/ 59 | gsl_odeiv_step *step; 60 | 61 | /** Time integrator control. */ 62 | gsl_odeiv_control *control; 63 | 64 | /** Evolution object.*/ 65 | gsl_odeiv_evolve *evolution; 66 | 67 | /** Ode system. */ 68 | gsl_odeiv_system system; 69 | 70 | /** Size of the ode system. */ 71 | unsigned int n_dofs; 72 | 73 | /** Initial step size. */ 74 | double initial_step_size; 75 | 76 | /** Absolute error tolerance for adaptive time stepping. */ 77 | double abs_tol; 78 | 79 | /** Relative error tolerance for adaptive time stepping. */ 80 | double rel_tol; 81 | 82 | /** Initial time. */ 83 | double initial_time; 84 | 85 | /** Final time. */ 86 | double final_time; 87 | 88 | /** Maximum number of time steps. */ 89 | unsigned int max_n_steps; 90 | 91 | // /** Number of output times per second written. */ 92 | // unsigned int output_frequency; 93 | 94 | /** Initialization flag.*/ 95 | bool is_initialized; 96 | }; 97 | 98 | 99 | #endif 100 | -------------------------------------------------------------------------------- /include/true_constrained_matrix.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | // $Id: filtered_matrix.h 23248 2011-01-23 06:03:57Z bangerth $ 3 | // Version: $Name$ 4 | // 5 | // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 6 | // 2011 by the deal.II authors 7 | // 8 | // This file is subject to QPL and may not be distributed 9 | // without copyright and license information. Please refer 10 | // to the file deal.II/doc/license.html for the text and 11 | // further information on this license. 12 | // 13 | //--------------------------------------------------------------------------- 14 | #ifndef __deal2__constrained_matrix_h 15 | # define __deal2__constrained_matrix_h 16 | 17 | 18 | 19 | # include 20 | 21 | # include 22 | # include 23 | # include 24 | 25 | # include 26 | # include 27 | 28 | # include 29 | # include 30 | 31 | DEAL_II_NAMESPACE_OPEN 32 | 33 | template 34 | class Vector; 35 | template 36 | class ConstrainedMatrixBlock; 37 | 38 | 39 | /*! @addtogroup Matrix2 40 | *@{ 41 | */ 42 | 43 | 44 | /** 45 | * 46 | * @author Luca Heltai 2011 47 | */ 48 | 49 | template 50 | class ConstrainedOperator 51 | { 52 | public: 53 | ConstrainedOperator(const MATRIX &m, 54 | const AffineConstraints &c, 55 | const IndexSet &c_cpu_set, 56 | MPI_Comm comm = MPI_COMM_WORLD) 57 | : cm(c) 58 | , matrix(m) 59 | , constr_cpu_set(c_cpu_set) 60 | , mpi_communicator(comm) 61 | , n_mpi_processes(Utilities::MPI::n_mpi_processes(mpi_communicator)) 62 | , this_mpi_process(Utilities::MPI::this_mpi_process(mpi_communicator)) 63 | {} 64 | 65 | 66 | // void compute_constraint_transpose(const unsigned int problem_size); 67 | 68 | void 69 | constraint_vmult(VEC &dst, const VEC &src) const; 70 | 71 | void 72 | constraint_tvmult(VEC &dst, const VEC &src) const; 73 | 74 | void 75 | vmult(VEC &dst, const VEC &src) const; 76 | 77 | void 78 | distribute_rhs(VEC &rhs) const; 79 | 80 | void 81 | finalise(VEC &u) const; 82 | 83 | private: 84 | const AffineConstraints &cm; 85 | const MATRIX &matrix; 86 | const IndexSet constr_cpu_set; 87 | AffineConstraints cmt; 88 | MPI_Comm mpi_communicator; 89 | unsigned int n_mpi_processes; 90 | unsigned int this_mpi_process; 91 | }; 92 | 93 | /*@}*/ 94 | /*---------------------- Inline functions -----------------------------------*/ 95 | 96 | 97 | //--------------------------------Iterators--------------------------------------// 98 | 99 | 100 | 101 | // template 102 | // void ConstrainedOperator::compute_constraint_transpose(const 103 | // unsigned int problem_size) 104 | // { 105 | // for(unsigned int i=0; i 114 | void 115 | ConstrainedOperator::constraint_vmult(VEC &dst, 116 | const VEC &src) const 117 | { 118 | VEC loc_src(src.locally_owned_elements(), constr_cpu_set, mpi_communicator); 119 | loc_src.reinit(src, false, true); 120 | 121 | for (unsigned int i = 0; i < dst.size(); ++i) 122 | { 123 | if (dst.locally_owned_elements().is_element(i)) 124 | { 125 | if (cm.is_constrained(i)) 126 | { 127 | dst(i) = 0; 128 | const std::vector> *entries = 129 | cm.get_constraint_entries(i); 130 | for (unsigned int j = 0; j < entries->size(); ++j) 131 | { 132 | unsigned int pos = (*entries)[j].first; 133 | dst(i) += loc_src(pos) * (*entries)[j].second; 134 | } 135 | } 136 | else 137 | dst(i) = loc_src(i); 138 | } 139 | } 140 | } 141 | 142 | template 143 | void 144 | ConstrainedOperator::constraint_tvmult(VEC &dst, 145 | const VEC &src) const 146 | { 147 | VEC loc_dst(constr_cpu_set); 148 | for (unsigned int i = 0; i < src.size(); ++i) 149 | { 150 | if (src.locally_owned_elements().is_element(i)) 151 | { 152 | if (cm.is_constrained(i)) 153 | { 154 | loc_dst(i) = 0; 155 | const std::vector> *entries = 156 | cm.get_constraint_entries(i); 157 | for (unsigned int j = 0; j < entries->size(); ++j) 158 | { 159 | unsigned int pos = (*entries)[j].first; 160 | loc_dst(pos) += src(i) * (*entries)[j].second; 161 | } 162 | } 163 | else 164 | loc_dst(i) = src(i); 165 | } 166 | } 167 | 168 | std::cout << "Tvmult comm" << std::endl; 169 | dst.add(loc_dst, true); 170 | } 171 | 172 | template 173 | void 174 | ConstrainedOperator::distribute_rhs(VEC &rhs) const 175 | { 176 | VEC constraint_term(rhs.locally_owned_elements(), mpi_communicator); 177 | VEC rhs_tmp(rhs.locally_owned_elements(), mpi_communicator); 178 | 179 | for (unsigned int i = 0; i < rhs.size(); ++i) 180 | constraint_term(i) = -cm.get_inhomogeneity(i); 181 | 182 | matrix.vmult(rhs_tmp, constraint_term); 183 | constraint_term = rhs; 184 | constraint_term.add(rhs_tmp); 185 | rhs = 0.; 186 | constraint_tvmult(rhs, constraint_term); 187 | } 188 | 189 | template 190 | void 191 | ConstrainedOperator::vmult(VEC &dst, const VEC &src) const 192 | { 193 | auto dst_tmp = dst; 194 | auto src_tmp = src; 195 | 196 | constraint_vmult(src_tmp, src); 197 | matrix.vmult(dst_tmp, src_tmp); 198 | constraint_tvmult(dst, dst_tmp); 199 | } 200 | 201 | template 202 | void 203 | ConstrainedOperator::finalise(VEC &u) const 204 | { 205 | cm.distribute(u); 206 | } 207 | // template 208 | // void ConstrainedOperator::distribute_rhs(VEC &rhs) const 209 | // { 210 | // for (unsigned int i=0; i 0 && REPLY <= ${#options[@]} )) ; then 41 | echo "Comparing with $opt:" 42 | CMP=$opt 43 | break 44 | else 45 | echo "Invalid option. Try another one." 46 | fi 47 | done 48 | fi 49 | 50 | cwdiff $CMP ${FILE}/output 51 | 52 | PS3="Accept new version ($FILE)?" 53 | select opt in "Yes" "No"; do 54 | if ((REPLY == 1)) ; then 55 | echo "You said yes. Very well." 56 | cp ${FILE}/output $CMP 57 | exit 58 | else 59 | echo "You said no. :( " 60 | exit 61 | fi 62 | done 63 | -------------------------------------------------------------------------------- /scripts/docker.sh: -------------------------------------------------------------------------------- 1 | docker run -P -t -i -v `pwd`:/home/dealii/app:rw mathlab/deal2lkit:v8.5.0-debugrelease 2 | -------------------------------------------------------------------------------- /scripts/dr.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker run --user $(id -u):$(id -g) -i -t --rm -P -v `pwd`:/app:rw dealii/dealii:v9.6.0-jammy /bin/sh -c "cd /app; $@" 3 | -------------------------------------------------------------------------------- /scripts/indent: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ## --------------------------------------------------------------------- 3 | ## 4 | ## Copyright (C) 2012 - 2013, 2015 by the deal.II authors 5 | ## 6 | ## This file is part of the deal.II library. 7 | ## 8 | ## The deal.II library is free software; you can use it, redistribute 9 | ## it, and/or modify it under the terms of the GNU Lesser General 10 | ## Public License as published by the Free Software Foundation; either 11 | ## version 2.1 of the License, or (at your option) any later version. 12 | ## The full text of the license can be found in the file LICENSE at 13 | ## the top level of the deal.II distribution. 14 | ## 15 | ## --------------------------------------------------------------------- 16 | 17 | if test ! -d source ; then 18 | echo "*** This script must be run from the top-level directory of your project." 19 | exit 20 | fi 21 | 22 | if test ! -f .clang-format ; then 23 | echo "*** No style file .clang-format found." 24 | exit 25 | fi 26 | 27 | 28 | # loop over all directories in which we may have source files; 29 | # collect a list of files and then spawn a parallel process to 30 | # indent all of them 31 | echo "--- Indenting all header and source files" 32 | SRC_FILES=`find . -name "*.cc"` 33 | H_FILES=`find . -name "*.h"` 34 | clang-format -i $SRC_FILES 35 | clang-format -i $H_FILES 36 | -------------------------------------------------------------------------------- /scripts/run_docker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | CMD=`grep -e '- ' .travis.yml | sed 's/- //'` 3 | docker run --user $(id -u):$(id -g) -i -t --rm -P -v `pwd`:/app:rw mathlab/deal2lkit:v9.1.1-debugrelease /bin/sh -c "cd /app; $CMD" 4 | -------------------------------------------------------------------------------- /scripts/script_convergence_global.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #PBS -N bem_thread_scaling 3 | #PBS -l walltime=12:00:00 4 | #PBS -l nodes=2:ppn=20 5 | #PBS -q regular 6 | 7 | 8 | 9 | 10 | module purge 11 | 12 | WORK_DIR=/home/ngiuliani/parallel-bem/build_global_Q3 13 | . /home/mathlab/candi-testing.conf 14 | 15 | cd $WORK_DIR 16 | rm -rf *Mak* *mak* *bem_fma* *txt *bin *vtu 17 | cmake ../ 18 | make -j20 19 | #for i in 1 2 4 8 16 20 20 | #do 21 | # mpirun -np 1 --bind-to none bem_fma $i >> output_bem_fma_threads_$((${i})).txt 22 | #done 23 | cycle_old=2 24 | old_str="set Number of cycles = 2" 25 | 26 | for cycle in 1 2 3 4 5 6 27 | do 28 | # cycle_str=$( printf '%04d' $cycle ) 29 | # cycle_old_str=$(printf '%04d' $cycle_old ) 30 | #new_str=sed "s/$cycle_old_str/$cycle_str/g" "$old_str" 31 | new_str=${old_str/$cycle_old/$cycle} 32 | echo $cycle_str 33 | echo $new_str 34 | f="parameter_bem.prm" 35 | sed "s/$old_str/$new_str/g" "$f" > pippo.txt 36 | cp pippo.txt parameter_bem.prm 37 | cycle_old=$cycle 38 | old_str=$new_str 39 | mpirun -np 2 --map-by ppr:1:node --bind-to none bem_fma >> output_bem_fma_$((${cycle}))_global_refs_FMM.txt 40 | done 41 | 42 | -------------------------------------------------------------------------------- /scripts/script_convergence_local.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #PBS -N bem_local_convergence 3 | #PBS -l walltime=12:00:00 4 | #PBS -l nodes=2:ppn=20 5 | #PBS -q regular 6 | 7 | 8 | 9 | 10 | module purge 11 | 12 | WORK_DIR=/home/ngiuliani/parallel-bem/build_local_Q3 13 | . /home/mathlab/candi-testing.conf 14 | 15 | cd $WORK_DIR 16 | rm -rf *Mak* *mak* *bem_fma* *txt *bin *vtu 17 | cmake ../ 18 | make -j20 19 | 20 | #for i in 1 2 4 8 16 20 21 | #do 22 | # mpirun -np 1 --bind-to none bem_fma $i >> output_bem_fma_threads_$((${i})).txt 23 | #done 24 | cycle_old=2 25 | old_str="set Number of cycles = 2" 26 | 27 | for i in 0 1 2 3 4 5 6 7 8 9 28 | do 29 | cycle=$i 30 | # cycle_str=$( printf '%04d' $cycle ) 31 | # cycle_old_str=$(printf '%04d' $cycle_old ) 32 | #new_str=sed "s/$cycle_old_str/$cycle_str/g" "$old_str" 33 | new_str=${old_str/$cycle_old/$cycle} 34 | echo $cycle_str 35 | echo $new_str 36 | f="parameter_bem.prm" 37 | sed "s/$old_str/$new_str/g" "$f" > pippo.txt 38 | cp pippo.txt parameter_bem.prm 39 | cycle_old=$cycle 40 | old_str=$new_str 41 | mpirun -np 2 --map-by ppr:1:node --bind-to none bem_fma >> output_bem_fma_$((${i}))_local_refs_FMM.txt 42 | done 43 | 44 | -------------------------------------------------------------------------------- /scripts/script_threads.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #PBS -N bem_thread_scaling 3 | #PBS -l walltime=12:00:00 4 | #PBS -l nodes=2:ppn=20 5 | #PBS -q regular 6 | 7 | 8 | 9 | 10 | module purge 11 | 12 | WORK_DIR=/home/ngiuliani/parallel-bem/build_clash_thread 13 | . /home/mathlab/gnu.conf /home/mathlab/gnu/ 14 | 15 | cd $WORK_DIR 16 | 17 | #for i in 1 2 4 8 16 20 18 | #do 19 | # mpirun -np 1 --bind-to none bem_fma $i >> output_bem_fma_threads_$((${i})).txt 20 | #done 21 | mpirun -np 6 -pernode --bind-to none bem_fma 6 >> output_bem_fma_threads_36_6_6.txt 22 | mpirun -np 8 -pernode --bind-to none bem_fma 5 >> output_bem_fma_threads_40_8_5.txt 23 | mpirun -np 4 -pernode --bind-to none bem_fma 10 >> output_bem_fma_threads_40_4_10.txt 24 | mpirun -np 2 -pernode --bind-to none bem_fma 20 >> output_bem_fma_threads_40_2_20.txt 25 | -------------------------------------------------------------------------------- /source/cached_nurbs_patch_manifold.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | DEAL_II_NAMESPACE_OPEN 15 | 16 | template 17 | std::string 18 | point_to_string(const Point &point) 19 | { 20 | std::string result = std::to_string(point[0]) + std::to_string(point[1]) + 21 | std::to_string(point[2]); 22 | return result; 23 | } 24 | 25 | using namespace OpenCASCADE; 26 | // Point<3> 27 | // CachedNURBSPatchManifold::get_new_point(const ArrayView> 28 | // &surrounding_points, 29 | // const ArrayView &weights) const 30 | // { 31 | // // std::cout<<"USING"<, 200> chart_points(n_points); 34 | // for (unsigned int i=0; isecond; 40 | // } 41 | // else 42 | // { 43 | // chart_points[i] = pull_back(surrounding_points[i]); 44 | // projections_cache.insert({point_to_string(surrounding_points[i]), 45 | // chart_points[i]}); 46 | // } 47 | // } 48 | // const Point<2> p_chart = sub_manifold.get_new_point 49 | // (make_array_view(chart_points.begin(), 50 | // chart_points.end()), 51 | // weights); 52 | 53 | // return push_forward(p_chart); 54 | 55 | 56 | // } 57 | 58 | 59 | // void 60 | // CachedNURBSPatchManifold::get_new_points(const ArrayView> 61 | // &surrounding_points, 62 | // const Table<2,double> &weights, 63 | // ArrayView> new_points) const 64 | // { 65 | // // std::cout<<"USING"<, 200> chart_points(n_points); 68 | // for (unsigned int i=0; isecond; 74 | // } 75 | // else 76 | // { 77 | // chart_points[i] = pull_back(surrounding_points[i]); 78 | // projections_cache.insert({point_to_string(surrounding_points[i]), 79 | // chart_points[i]}); 80 | // } 81 | // } 82 | 83 | // boost::container::small_vector, 200> 84 | // new_points_on_chart(weights.size(0)); sub_manifold.get_new_points 85 | // (make_array_view(chart_points.begin(), 86 | // chart_points.end()), 87 | // weights, 88 | // make_array_view(new_points_on_chart.begin(), 89 | // new_points_on_chart.end())); 90 | 91 | // for (std::size_t row=0; row 99 | // CachedNURBSPatchManifold::get_tangent_vector (const Point<3> &x1, 100 | // const Point<3> &x2) const 101 | // { 102 | // Point<2> p_x1, p_x2; 103 | 104 | // // auto it_1= projections_cache.find(point_to_string(x1)); 105 | // // auto it_2= projections_cache.find(point_to_string(x2)); 106 | 107 | // // if(it_1 != projections_cache.end()) 108 | // // p_x1 = it_1->second; 109 | // // else 110 | // p_x1 = pull_back(x1); 111 | 112 | // // if(it_2 != projections_cache.end()) 113 | // // p_x2 = it_2->second; 114 | // // else 115 | // p_x2 = pull_back(x2); 116 | 117 | 118 | // const DerivativeForm<1,2,3> F_prime = push_forward_gradient((p_x1)); 119 | // Assert (std::pow(std::abs(F_prime.determinant()), 1./2) >= 1e-12 * 120 | // F_prime.norm(), 121 | // ExcMessage("The derivative of a chart function must not be 122 | // singular.")); 123 | 124 | 125 | 126 | // const Tensor<1,2> delta = sub_manifold.get_tangent_vector((p_x1), 127 | // (p_x2)); 128 | // Tensor<1,3> result; 129 | // for (unsigned int i=0; i<3; ++i) 130 | // result[i] += F_prime[i] * delta; 131 | 132 | // return result; 133 | // } 134 | template 135 | Point 136 | CachedNURBSPatchManifold::pull_back( 137 | const Point &space_point) const 138 | { 139 | auto it_1 = projections_cache.find( 140 | std::hash()(point_to_string(space_point))); 141 | Point result; 142 | if (it_1 != projections_cache.end()) 143 | { 144 | result = it_1->second; 145 | cache_hits += 1; 146 | } 147 | else 148 | { 149 | Handle(Geom_Surface) SurfToProj = BRep_Tool::Surface(face); 150 | 151 | ShapeAnalysis_Surface projector(SurfToProj); 152 | gp_Pnt2d proj_params = projector.ValueOfUV(point(space_point), tolerance); 153 | 154 | result[0] = proj_params.X(); 155 | result[1] = proj_params.Y(); 156 | projections_cache.insert( 157 | {std::hash()(point_to_string(space_point)), result}); 158 | new_pull_backs += 1; 159 | } 160 | 161 | return result; 162 | } 163 | 164 | 165 | template class CachedNURBSPatchManifold<2, 3>; 166 | 167 | DEAL_II_NAMESPACE_CLOSE 168 | -------------------------------------------------------------------------------- /source/driver.cc: -------------------------------------------------------------------------------- 1 | #include "../include/driver.h" 2 | 3 | #include 4 | 5 | #include "Teuchos_TimeMonitor.hpp" 6 | 7 | using Teuchos::RCP; 8 | using Teuchos::Time; 9 | using Teuchos::TimeMonitor; 10 | 11 | RCP