diff --git a/.gitignore b/.gitignore index 5975d974..65db6101 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,8 @@ *~ build/ +.vscode +*.vtu +*/.ipynb_checkpoints/ +tests_regression/robin_bconditions/parameters_bem_3.prm +tests_regression/robin_bconditions/used_parameters_bem_3.prm + diff --git a/CMakeLists.txt b/CMakeLists.txt index 70a61500..2feb4829 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,8 +35,10 @@ IF(NOT "${_main}" STREQUAL "") ENDIF() + CMAKE_MINIMUM_REQUIRED(VERSION 3.13.4) + FIND_PACKAGE(deal.II 9.5.0 REQUIRED HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) @@ -53,7 +55,6 @@ ENDIF() DEAL_II_INITIALIZE_CACHED_VARIABLES() - PROJECT(${TARGET}) if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") @@ -64,6 +65,18 @@ OPTION(BEM_ENABLE_TESTING "Enable deal.II style tests in this application." ON) +IF($ENV{PBEM_OPENMP}) + message("compiling with OpenMP threading") + FIND_PACKAGE(OpenMP REQUIRED) + add_definitions("-DPBEM_OPENMP") +ELSE() + message("compiling with TBB threading") +ENDIF() +#-fopenmp was not used in compiling .o files, it was substituted with -fopenmp-simd +IF (OPENMP_FOUND) + add_definitions("-fopenmp") +ENDIF() + # We one library and one target for each type of deal.II library # we found. If you compiled deal.II with both Release and Debug # mode, this will generate both Release and Debug programs for you @@ -91,10 +104,16 @@ FOREACH(_build_type ${_d2_build_types}) SET(_exe "${TARGET}_${_dim}d${${_build_type}_postfix}") MESSAGE("-- Configuring executable ${_exe}") ADD_EXECUTABLE(${_exe} ${_main}) - target_compile_definitions(${_exe} PUBLIC DEAL_II_DIMENSION=${_dim}) - TARGET_LINK_LIBRARIES(${_exe} ${_lib}) + + + IF (OPENMP_FOUND) + TARGET_LINK_LIBRARIES(${_exe} ${_lib} OpenMP::OpenMP_CXX) + ELSE() + TARGET_LINK_LIBRARIES(${_exe} ${_lib}) + ENDIF() + target_compile_definitions(${_exe} PUBLIC DEAL_II_DIMENSION=${_dim} ) DEAL_II_SETUP_TARGET(${_exe} ${_BUILD_TYPE}) - ENDFOREACH() + ENDFOREACH() @@ -105,7 +124,7 @@ ENDFOREACH() INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include) -if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/tests AND BEM_ENABLE_TESTING) +if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/tests AND "${BEM_ENABLE_TESTING}") ADD_SUBDIRECTORY(tests) ENABLE_TESTING() endif() diff --git a/grids/coarse_sphere_curves.inp b/grids/coarse_sphere_curves.inp new file mode 100644 index 00000000..c68a1452 --- /dev/null +++ b/grids/coarse_sphere_curves.inp @@ -0,0 +1,27 @@ +8 18 0 0 0 +1 -0.577350269 -0.577350269 -0.577350269 +2 0.577350269 -0.577350269 -0.577350269 +3 -0.577350269 0.577350269 -0.577350269 +4 0.577350269 0.577350269 -0.577350269 +5 -0.577350269 -0.577350269 0.577350269 +6 0.577350269 -0.577350269 0.577350269 +7 -0.577350269 0.577350269 0.577350269 +8 0.577350269 0.577350269 0.577350269 +1 1 quad 3 4 2 1 +2 2 quad 5 6 8 7 +3 1 quad 1 2 6 5 +4 2 quad 3 7 8 4 +5 1 quad 5 7 3 1 +6 2 quad 2 4 8 6 +7 11 line 1 5 +8 12 line 3 7 +9 13 line 2 6 +10 14 line 4 8 +11 15 line 1 3 +12 16 line 5 7 +13 17 line 2 4 +14 18 line 6 8 +15 19 line 1 2 +16 20 line 5 6 +17 21 line 3 4 +18 22 line 7 8 diff --git a/grids/coarse_sphere_curves_iges/Color_1.iges b/grids/coarse_sphere_curves_iges/Color_1.iges new file mode 100644 index 00000000..1b82316a --- /dev/null +++ b/grids/coarse_sphere_curves_iges/Color_1.iges @@ -0,0 +1,55 @@ + S0000001 +,,31HOpen CASCADE IGES processor 7.4,13HFilename.iges, G0000001 +16HOpen CASCADE 7.4,31HOpen CASCADE IGES processor 7.4,32,308,15,308,15,G0000002 +,1.,6,1HM,1,0.00001,15H20210726.085854,1E-07,1.00544,6Hyaevon,,11,0, G0000003 +15H20210726.085854,; G0000004 + 144 1 0 0 0 0 0 000000000D0000001 + 144 0 0 1 0 0D0000002 + 120 2 0 0 0 0 5 000010000D0000003 + 120 0 0 1 0 0D0000004 + 124 3 0 0 0 0 0 000000000D0000005 + 124 0 0 2 0 0D0000006 + 110 5 0 0 0 0 0 000010000D0000007 + 110 0 0 1 0 0D0000008 + 100 6 0 0 0 0 11 000010000D0000009 + 100 0 0 1 0 0D0000010 + 124 7 0 0 0 0 0 000000000D0000011 + 124 0 0 1 0 0D0000012 + 142 8 0 0 0 0 0 000010500D0000013 + 142 0 0 1 0 0D0000014 + 102 9 0 0 0 0 0 000010000D0000015 + 102 0 0 1 0 0D0000016 + 110 10 0 0 0 0 0 000010000D0000017 + 110 0 0 1 0 0D0000018 + 110 11 0 0 0 0 0 000010000D0000019 + 110 0 0 2 0 0D0000020 + 102 13 0 0 0 0 0 000010000D0000021 + 102 0 0 1 0 0D0000022 + 100 14 0 0 0 0 25 000010000D0000023 + 100 0 0 1 0 0D0000024 + 124 15 0 0 0 0 0 000000000D0000025 + 124 0 0 2 0 0D0000026 + 100 17 0 0 0 0 29 000010000D0000027 + 100 0 0 1 0 0D0000028 + 124 18 0 0 0 0 0 000000000D0000029 + 124 0 0 2 0 0D0000030 +144,3,1,0,13; 0000001P0000001 +120,7,9,0.,6.283185307; 0000003P0000002 +124,0.707106781,0.5,0.5,0.,0.,0.707106781,-0.707106781,0., 0000005P0000003 +-0.707106781,0.5,0.5,0.; 0000005P0000004 +110,0.,0.,1.,0.,0.,0.; 0000007P0000005 +100,0.,0.,0.,6.123233996E-17,-1.,6.123233996E-17,1.; 0000009P0000006 +124,1.,0.,0.,0.,0.,0.,-1.,0.,0.,1.,-0.,0.; 0000011P0000007 +142,0,3,15,21,3; 0000013P0000008 +102,2,17,19; 0000015P0000009 +110,1.570796327,6.283185307,0.,-1.570796327,6.283185307,0.; 0000017P0000010 +110,-1.570796327,1.046360549E-15,0.,1.570796327,1.743934249E-15, 0000019P0000011 +0.; 0000019P0000012 +102,2,23,27; 0000021P0000013 +100,0.,0.,0.,5.551115123E-17,-1.,0.,1.; 0000023P0000014 +124,0.707106781,-0.5,0.5,0.,-2.220446049E-16,0.707106781, 0000025P0000015 +0.707106781,0.,-0.707106781,-0.5,0.5,0.; 0000025P0000016 +100,0.,0.,0.,-1.110223025E-16,-1.,2.775557562E-16,1.; 0000027P0000017 +124,0.707106781,0.5,-0.5,0.,-1.731912112E-16,-0.707106781, 0000029P0000018 +-0.707106781,0.,-0.707106781,0.5,-0.5,0.; 0000029P0000019 +S 1G 4D 30P 19 T0000001 diff --git a/grids/coarse_sphere_curves_iges/Color_2.iges b/grids/coarse_sphere_curves_iges/Color_2.iges new file mode 100644 index 00000000..0cb54277 --- /dev/null +++ b/grids/coarse_sphere_curves_iges/Color_2.iges @@ -0,0 +1,55 @@ + S0000001 +,,31HOpen CASCADE IGES processor 7.4,13HFilename.iges, G0000001 +16HOpen CASCADE 7.4,31HOpen CASCADE IGES processor 7.4,32,308,15,308,15,G0000002 +,1.,6,1HM,1,0.01,15H20210726.085854,1E-07,1.00544,6Hyaevon,,11,0, G0000003 +15H20210726.085854,; G0000004 + 144 1 0 0 0 0 0 000000000D0000001 + 144 0 0 1 0 0D0000002 + 120 2 0 0 0 0 5 000010000D0000003 + 120 0 0 1 0 0D0000004 + 124 3 0 0 0 0 0 000000000D0000005 + 124 0 0 2 0 0D0000006 + 110 5 0 0 0 0 0 000010000D0000007 + 110 0 0 1 0 0D0000008 + 100 6 0 0 0 0 11 000010000D0000009 + 100 0 0 1 0 0D0000010 + 124 7 0 0 0 0 0 000000000D0000011 + 124 0 0 1 0 0D0000012 + 142 8 0 0 0 0 0 000010500D0000013 + 142 0 0 1 0 0D0000014 + 102 9 0 0 0 0 0 000010000D0000015 + 102 0 0 1 0 0D0000016 + 110 10 0 0 0 0 0 000010000D0000017 + 110 0 0 1 0 0D0000018 + 110 11 0 0 0 0 0 000010000D0000019 + 110 0 0 2 0 0D0000020 + 102 13 0 0 0 0 0 000010000D0000021 + 102 0 0 1 0 0D0000022 + 100 14 0 0 0 0 25 000010000D0000023 + 100 0 0 1 0 0D0000024 + 124 15 0 0 0 0 0 000000000D0000025 + 124 0 0 2 0 0D0000026 + 100 17 0 0 0 0 29 000010000D0000027 + 100 0 0 1 0 0D0000028 + 124 18 0 0 0 0 0 000000000D0000029 + 124 0 0 2 0 0D0000030 +144,3,1,0,13; 0000001P0000001 +120,7,9,0.,6.283185307; 0000003P0000002 +124,0.707106781,0.5,0.5,0.,0.,0.707106781,-0.707106781,0., 0000005P0000003 +-0.707106781,0.5,0.5,0.; 0000005P0000004 +110,0.,0.,1.,0.,0.,0.; 0000007P0000005 +100,0.,0.,0.,6.123233996E-17,-1.,6.123233996E-17,1.; 0000009P0000006 +124,1.,0.,0.,0.,0.,0.,-1.,0.,0.,1.,-0.,0.; 0000011P0000007 +142,0,3,15,21,3; 0000013P0000008 +102,2,17,19; 0000015P0000009 +110,1.570796327,6.283185307,0.,-1.570796327,6.283185307,0.; 0000017P0000010 +110,-1.570796327,1.046360549E-15,0.,1.570796327,1.743934249E-15, 0000019P0000011 +0.; 0000019P0000012 +102,2,23,27; 0000021P0000013 +100,0.,0.,0.,5.551115123E-17,-1.,0.,1.; 0000023P0000014 +124,0.707106781,-0.5,0.5,0.,-2.220446049E-16,0.707106781, 0000025P0000015 +0.707106781,0.,-0.707106781,-0.5,0.5,0.; 0000025P0000016 +100,0.,0.,0.,-1.110223025E-16,-1.,2.775557562E-16,1.; 0000027P0000017 +124,0.707106781,0.5,-0.5,0.,-1.731912112E-16,-0.707106781, 0000029P0000018 +-0.707106781,0.,-0.707106781,0.5,-0.5,0.; 0000029P0000019 +S 1G 4D 30P 19 T0000001 diff --git a/grids/coarse_sphere_curves_iges/Curve_1.iges b/grids/coarse_sphere_curves_iges/Curve_1.iges new file mode 100644 index 00000000..3eac9b15 --- /dev/null +++ b/grids/coarse_sphere_curves_iges/Curve_1.iges @@ -0,0 +1,13 @@ + S0000001 +,,31HOpen CASCADE IGES processor 7.4,13HFilename.iges, G0000001 +16HOpen CASCADE 7.4,31HOpen CASCADE IGES processor 7.4,32,308,15,308,15,G0000002 +,1.,6,1HM,1,0.01,15H20210725.221311,1E-07,0.711725,6Hyaevon,,11,0, G0000003 +15H20210725.221311,; G0000004 + 100 1 0 0 0 0 3 000000000D0000001 + 100 0 0 1 0 0D0000002 + 124 2 0 0 0 0 0 000000000D0000003 + 124 0 0 2 0 0D0000004 +100,0.,0.,0.,-0.8164962,0.57735,-0.8164962,-0.57735; 0000001P0000001 +124,0.707106781,0.,-0.707106781,0.,0.707106781,0.,0.707106781, 0000003P0000002 +0.,0.,-1.,0.,0.; 0000003P0000003 +S 1G 4D 4P 3 T0000001 diff --git a/grids/coarse_sphere_curves_iges/Curve_10.iges b/grids/coarse_sphere_curves_iges/Curve_10.iges new file mode 100644 index 00000000..f62174de --- /dev/null +++ b/grids/coarse_sphere_curves_iges/Curve_10.iges @@ -0,0 +1,13 @@ + S0000001 +,,31HOpen CASCADE IGES processor 7.4,13HFilename.iges, G0000001 +16HOpen CASCADE 7.4,31HOpen CASCADE IGES processor 7.4,32,308,15,308,15,G0000002 +,1.,6,1HM,1,0.01,15H20210725.221311,1E-07,0.711725,6Hyaevon,,11,0, G0000003 +15H20210725.221311,; G0000004 + 100 1 0 0 0 0 3 000000000D0000001 + 100 0 0 1 0 0D0000002 + 124 2 0 0 0 0 0 000000000D0000003 + 124 0 0 2 0 0D0000004 +100,0.,0.,0.,-0.8164962,0.57735,-0.8164962,-0.57735; 0000001P0000001 +124,0.,-1.,0.,0.,0.707106781,0.,0.707106781,0.,-0.707106781,0., 0000003P0000002 +0.707106781,0.; 0000003P0000003 +S 1G 4D 4P 3 T0000001 diff --git a/grids/coarse_sphere_curves_iges/Curve_11.iges b/grids/coarse_sphere_curves_iges/Curve_11.iges new file mode 100644 index 00000000..d8d1464a --- /dev/null +++ b/grids/coarse_sphere_curves_iges/Curve_11.iges @@ -0,0 +1,13 @@ + S0000001 +,,31HOpen CASCADE IGES processor 7.4,13HFilename.iges, G0000001 +16HOpen CASCADE 7.4,31HOpen CASCADE IGES processor 7.4,32,308,15,308,15,G0000002 +,1.,6,1HM,1,0.01,15H20210725.221311,1E-07,0.711725,6Hyaevon,,11,0, G0000003 +15H20210725.221311,; G0000004 + 100 1 0 0 0 0 3 000000000D0000001 + 100 0 0 1 0 0D0000002 + 124 2 0 0 0 0 0 000000000D0000003 + 124 0 0 2 0 0D0000004 +100,0.,0.,0.,-0.8164962,0.57735,-0.8164962,-0.57735; 0000001P0000001 +124,0.,-1.,0.,0.,-0.707106781,0.,-0.707106781,0.,0.707106781,0., 0000003P0000002 +-0.707106781,0.; 0000003P0000003 +S 1G 4D 4P 3 T0000001 diff --git a/grids/coarse_sphere_curves_iges/Curve_12.iges b/grids/coarse_sphere_curves_iges/Curve_12.iges new file mode 100644 index 00000000..3fc590f1 --- /dev/null +++ b/grids/coarse_sphere_curves_iges/Curve_12.iges @@ -0,0 +1,13 @@ + S0000001 +,,31HOpen CASCADE IGES processor 7.4,13HFilename.iges, G0000001 +16HOpen CASCADE 7.4,31HOpen CASCADE IGES processor 7.4,32,308,15,308,15,G0000002 +,1.,6,1HM,1,0.01,15H20210725.221311,1E-07,0.711725,6Hyaevon,,11,0, G0000003 +15H20210725.221311,; G0000004 + 100 1 0 0 0 0 3 000000000D0000001 + 100 0 0 1 0 0D0000002 + 124 2 0 0 0 0 0 000000000D0000003 + 124 0 0 2 0 0D0000004 +100,0.,0.,0.,-0.8164962,0.57735,-0.8164962,-0.57735; 0000001P0000001 +124,0.,-1.,0.,0.,-0.707106781,0.,0.707106781,0.,-0.707106781,0., 0000003P0000002 +-0.707106781,0.; 0000003P0000003 +S 1G 4D 4P 3 T0000001 diff --git a/grids/coarse_sphere_curves_iges/Curve_2.iges b/grids/coarse_sphere_curves_iges/Curve_2.iges new file mode 100644 index 00000000..21cc3938 --- /dev/null +++ b/grids/coarse_sphere_curves_iges/Curve_2.iges @@ -0,0 +1,13 @@ + S0000001 +,,31HOpen CASCADE IGES processor 7.4,13HFilename.iges, G0000001 +16HOpen CASCADE 7.4,31HOpen CASCADE IGES processor 7.4,32,308,15,308,15,G0000002 +,1.,6,1HM,1,0.01,15H20210725.221311,1E-07,0.711725,6Hyaevon,,11,0, G0000003 +15H20210725.221311,; G0000004 + 100 1 0 0 0 0 3 000000000D0000001 + 100 0 0 1 0 0D0000002 + 124 2 0 0 0 0 0 000000000D0000003 + 124 0 0 2 0 0D0000004 +100,0.,0.,0.,-0.8164962,0.57735,-0.8164962,-0.57735; 0000001P0000001 +124,0.707106781,0.,0.707106781,0.,-0.707106781,0.,0.707106781, 0000003P0000002 +0.,0.,-1.,0.,0.; 0000003P0000003 +S 1G 4D 4P 3 T0000001 diff --git a/grids/coarse_sphere_curves_iges/Curve_3.iges b/grids/coarse_sphere_curves_iges/Curve_3.iges new file mode 100644 index 00000000..f00e03b0 --- /dev/null +++ b/grids/coarse_sphere_curves_iges/Curve_3.iges @@ -0,0 +1,13 @@ + S0000001 +,,31HOpen CASCADE IGES processor 7.4,13HFilename.iges, G0000001 +16HOpen CASCADE 7.4,31HOpen CASCADE IGES processor 7.4,32,308,15,308,15,G0000002 +,1.,6,1HM,1,0.01,15H20210725.221311,1E-07,0.711725,6Hyaevon,,11,0, G0000003 +15H20210725.221311,; G0000004 + 100 1 0 0 0 0 3 000000000D0000001 + 100 0 0 1 0 0D0000002 + 124 2 0 0 0 0 0 000000000D0000003 + 124 0 0 2 0 0D0000004 +100,0.,0.,0.,-0.8164962,0.57735,-0.8164962,-0.57735; 0000001P0000001 +124,-0.707106781,0.,-0.707106781,0.,0.707106781,0.,-0.707106781, 0000003P0000002 +0.,0.,-1.,0.,0.; 0000003P0000003 +S 1G 4D 4P 3 T0000001 diff --git a/grids/coarse_sphere_curves_iges/Curve_4.iges b/grids/coarse_sphere_curves_iges/Curve_4.iges new file mode 100644 index 00000000..a7c56494 --- /dev/null +++ b/grids/coarse_sphere_curves_iges/Curve_4.iges @@ -0,0 +1,13 @@ + S0000001 +,,31HOpen CASCADE IGES processor 7.4,13HFilename.iges, G0000001 +16HOpen CASCADE 7.4,31HOpen CASCADE IGES processor 7.4,32,308,15,308,15,G0000002 +,1.,6,1HM,1,0.01,15H20210725.221311,1E-07,0.711725,6Hyaevon,,11,0, G0000003 +15H20210725.221311,; G0000004 + 100 1 0 0 0 0 3 000000000D0000001 + 100 0 0 1 0 0D0000002 + 124 2 0 0 0 0 0 000000000D0000003 + 124 0 0 2 0 0D0000004 +100,0.,0.,0.,-0.8164962,0.57735,-0.8164962,-0.57735; 0000001P0000001 +124,-0.707106781,0.,0.707106781,0.,-0.707106781,-0., 0000003P0000002 +-0.707106781,0.,0.,-1.,0.,0.; 0000003P0000003 +S 1G 4D 4P 3 T0000001 diff --git a/grids/coarse_sphere_curves_iges/Curve_5.iges b/grids/coarse_sphere_curves_iges/Curve_5.iges new file mode 100644 index 00000000..e8a0f035 --- /dev/null +++ b/grids/coarse_sphere_curves_iges/Curve_5.iges @@ -0,0 +1,13 @@ + S0000001 +,,31HOpen CASCADE IGES processor 7.4,13HFilename.iges, G0000001 +16HOpen CASCADE 7.4,31HOpen CASCADE IGES processor 7.4,32,308,15,308,15,G0000002 +,1.,6,1HM,1,0.01,15H20210725.221311,1E-07,0.711725,6Hyaevon,,11,0, G0000003 +15H20210725.221311,; G0000004 + 100 1 0 0 0 0 3 000000000D0000001 + 100 0 0 1 0 0D0000002 + 124 2 0 0 0 0 0 000000000D0000003 + 124 0 0 2 0 0D0000004 +100,0.,0.,0.,0.8164962,-0.57735,0.8164962,0.57735; 0000001P0000001 +124,-0.707106781,0.,0.707106781,0.,0.,1.,0.,0.,-0.707106781,0., 0000003P0000002 +-0.707106781,0.; 0000003P0000003 +S 1G 4D 4P 3 T0000001 diff --git a/grids/coarse_sphere_curves_iges/Curve_6.iges b/grids/coarse_sphere_curves_iges/Curve_6.iges new file mode 100644 index 00000000..a52bfc8b --- /dev/null +++ b/grids/coarse_sphere_curves_iges/Curve_6.iges @@ -0,0 +1,13 @@ + S0000001 +,,31HOpen CASCADE IGES processor 7.4,13HFilename.iges, G0000001 +16HOpen CASCADE 7.4,31HOpen CASCADE IGES processor 7.4,32,308,15,308,15,G0000002 +,1.,6,1HM,1,0.01,15H20210725.221311,1E-07,0.711725,6Hyaevon,,11,0, G0000003 +15H20210725.221311,; G0000004 + 100 1 0 0 0 0 3 000000000D0000001 + 100 0 0 1 0 0D0000002 + 124 2 0 0 0 0 0 000000000D0000003 + 124 0 0 2 0 0D0000004 +100,0.,0.,0.,0.8164962,-0.57735,0.8164962,0.57735; 0000001P0000001 +124,-0.707106781,0.,-0.707106781,0.,0.,1.,0.,0.,0.707106781,0., 0000003P0000002 +-0.707106781,0.; 0000003P0000003 +S 1G 4D 4P 3 T0000001 diff --git a/grids/coarse_sphere_curves_iges/Curve_7.iges b/grids/coarse_sphere_curves_iges/Curve_7.iges new file mode 100644 index 00000000..b490d706 --- /dev/null +++ b/grids/coarse_sphere_curves_iges/Curve_7.iges @@ -0,0 +1,13 @@ + S0000001 +,,31HOpen CASCADE IGES processor 7.4,13HFilename.iges, G0000001 +16HOpen CASCADE 7.4,31HOpen CASCADE IGES processor 7.4,32,308,15,308,15,G0000002 +,1.,6,1HM,1,0.01,15H20210725.221311,1E-07,0.711725,6Hyaevon,,11,0, G0000003 +15H20210725.221311,; G0000004 + 100 1 0 0 0 0 3 000000000D0000001 + 100 0 0 1 0 0D0000002 + 124 2 0 0 0 0 0 000000000D0000003 + 124 0 0 2 0 0D0000004 +100,0.,0.,0.,-0.8164962,0.57735,-0.8164962,-0.57735; 0000001P0000001 +124,-0.707106781,0.,-0.707106781,0.,0.,1.,0.,0.,0.707106781,0., 0000003P0000002 +-0.707106781,0.; 0000003P0000003 +S 1G 4D 4P 3 T0000001 diff --git a/grids/coarse_sphere_curves_iges/Curve_8.iges b/grids/coarse_sphere_curves_iges/Curve_8.iges new file mode 100644 index 00000000..72429012 --- /dev/null +++ b/grids/coarse_sphere_curves_iges/Curve_8.iges @@ -0,0 +1,13 @@ + S0000001 +,,31HOpen CASCADE IGES processor 7.4,13HFilename.iges, G0000001 +16HOpen CASCADE 7.4,31HOpen CASCADE IGES processor 7.4,32,308,15,308,15,G0000002 +,1.,6,1HM,1,0.01,15H20210725.221311,1E-07,0.711725,6Hyaevon,,11,0, G0000003 +15H20210725.221311,; G0000004 + 100 1 0 0 0 0 3 000000000D0000001 + 100 0 0 1 0 0D0000002 + 124 2 0 0 0 0 0 000000000D0000003 + 124 0 0 2 0 0D0000004 +100,0.,0.,0.,0.8164962,-0.57735,0.8164962,0.57735; 0000001P0000001 +124,0.707106781,0.,-0.707106781,0.,0.,1.,0.,0.,0.707106781,0., 0000003P0000002 +0.707106781,0.; 0000003P0000003 +S 1G 4D 4P 3 T0000001 diff --git a/grids/coarse_sphere_curves_iges/Curve_9.iges b/grids/coarse_sphere_curves_iges/Curve_9.iges new file mode 100644 index 00000000..7f5c2bcf --- /dev/null +++ b/grids/coarse_sphere_curves_iges/Curve_9.iges @@ -0,0 +1,13 @@ + S0000001 +,,31HOpen CASCADE IGES processor 7.4,13HFilename.iges, G0000001 +16HOpen CASCADE 7.4,31HOpen CASCADE IGES processor 7.4,32,308,15,308,15,G0000002 +,1.,6,1HM,1,0.01,15H20210725.221311,1E-07,0.711725,6Hyaevon,,11,0, G0000003 +15H20210725.221311,; G0000004 + 100 1 0 0 0 0 3 000000000D0000001 + 100 0 0 1 0 0D0000002 + 124 2 0 0 0 0 0 000000000D0000003 + 124 0 0 2 0 0D0000004 +100,0.,0.,0.,-0.8164962,0.57735,-0.8164962,-0.57735; 0000001P0000001 +124,0.,-1.,0.,0.,0.707106781,0.,-0.707106781,0.,0.707106781,0., 0000003P0000002 +0.707106781,0.; 0000003P0000003 +S 1G 4D 4P 3 T0000001 diff --git a/include/ass_leg_function.h b/include/ass_leg_function.h index df0c1e3a..c318c981 100644 --- a/include/ass_leg_function.h +++ b/include/ass_leg_function.h @@ -9,6 +9,17 @@ #include #include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + #include #include #include @@ -21,18 +32,6 @@ #include #include #include -// #include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include #include #include @@ -42,8 +41,6 @@ using namespace dealii; - - class AssLegFunction { public: @@ -51,7 +48,6 @@ class AssLegFunction ~AssLegFunction(); - void AssLegFunSph(const unsigned int p, const unsigned int m, diff --git a/include/bem_fma.h b/include/bem_fma.h index db6bca51..4214baf4 100644 --- a/include/bem_fma.h +++ b/include/bem_fma.h @@ -1,4 +1,3 @@ - // --------------------------------------------------------------------- // // Copyright (C) 2014 - 2020 by the pi-BEM authors. @@ -19,8 +18,6 @@ /// applied to the Boundary Element /// Method - - #ifndef bem_fma_h #define bem_fma_h @@ -82,7 +79,6 @@ class BEMFMA : public ParameterAcceptor test(BEMFMA &); /// Just renaming the cell iterator type - typedef typename DoFHandler::active_cell_iterator cell_it; /// Contructor: needs only a MPI communicator @@ -128,6 +124,14 @@ class BEMFMA : public ParameterAcceptor void direct_integrals(); + void + direct_integrals_tbb(); + +#ifdef PBEM_OPENMP + void + direct_integrals_omp(); +#endif + /// Method computing the multipole /// expansion containing the integrals /// values for each bottom level block. @@ -176,8 +180,21 @@ class BEMFMA : public ParameterAcceptor TrilinosWrappers::MPI::Vector &matrVectProdN, TrilinosWrappers::MPI::Vector &matrVectProdD) const; + void + multipole_matr_vect_products_tbb( + const TrilinosWrappers::MPI::Vector &phi_values, + const TrilinosWrappers::MPI::Vector &dphi_dn_values, + TrilinosWrappers::MPI::Vector &matrVectProdN, + TrilinosWrappers::MPI::Vector &matrVectProdD) const; - // void compute_m2l_flags(); +#ifdef PBEM_OPENMP + void + multipole_matr_vect_products_omp( + const TrilinosWrappers::MPI::Vector &phi_values, + const TrilinosWrappers::MPI::Vector &dphi_dn_values, + TrilinosWrappers::MPI::Vector &matrVectProdN, + TrilinosWrappers::MPI::Vector &matrVectProdD) const; +#endif /// this methods creates the adaptive /// octree partitioning of the domain, @@ -187,7 +204,6 @@ class BEMFMA : public ParameterAcceptor void generate_octree_blocking(); - // In this function we have grouped some geometrical computation that // are useful for setting up the octree blocking. For example the maps // containing the surrounding elements for each element, or the component @@ -211,48 +227,63 @@ class BEMFMA : public ParameterAcceptor FMA_preconditioner(const TrilinosWrappers::MPI::Vector &alpha, AffineConstraints &c); + TrilinosWrappers::PreconditionILU & + FMA_preconditioner_tbb(const TrilinosWrappers::MPI::Vector &alpha, + AffineConstraints &c); + +#ifdef PBEM_OPENMP + TrilinosWrappers::PreconditionILU & + FMA_preconditioner_omp(const TrilinosWrappers::MPI::Vector &alpha, + AffineConstraints &c); +#endif + + TrilinosWrappers::PreconditionILU & + FMA_preconditioner_complex(const TrilinosWrappers::MPI::Vector &alpha, + AffineConstraints &c); + + TrilinosWrappers::PreconditionILU & + FMA_preconditioner_complex_tbb(const TrilinosWrappers::MPI::Vector &alpha, + AffineConstraints &c); + +#ifdef PBEM_OPENMP + TrilinosWrappers::PreconditionILU & + FMA_preconditioner_complex_omp(const TrilinosWrappers::MPI::Vector &alpha, + AffineConstraints &c); +#endif + protected: /// Three pointers to the problem parameters to be set equal to /// the ones in the calling problem through the init function SmartPointer> fma_dh; SmartPointer> fma_mapping; - /// Truncation order for the multipole /// and local expansion series: it is /// read from the parameters input file. - unsigned int trunc_order; /// Sparsity pattern for the /// initial preconditioning matrix /// (no constraints applied) - TrilinosWrappers::SparsityPattern init_prec_sparsity_pattern; /// Sparsity pattern for the /// final preconditioning matrix /// (constraints applied) - TrilinosWrappers::SparsityPattern final_prec_sparsity_pattern; /// Sparse Neumann matrix containing /// only direct integrals contributions TrilinosWrappers::SparseMatrix prec_neumann_matrix; - // SparseMatrix prec_neumann_matrix; /// Sparse Dirichlet matrix containing /// only direct integrals contributions - TrilinosWrappers::SparseMatrix prec_dirichlet_matrix; - // SparseMatrix prec_dirichlet_matrix; /// Initial sparse preconditioning matrix (without constraints) - TrilinosWrappers::SparseMatrix init_preconditioner; /// Final sparse preconditioning matrix (with constraints) - TrilinosWrappers::SparseMatrix final_preconditioner; /// Structures where the Dirichlet @@ -262,7 +293,6 @@ class BEMFMA : public ParameterAcceptor /// expansions as the lowest level /// blocks in which element's quad /// points lie. - mutable std::map>> elemMultipoleExpansionsKer1; @@ -274,8 +304,6 @@ class BEMFMA : public ParameterAcceptor /// expansions as the lowest level /// blocks in which element's quad /// points lie. - - mutable std::map>> elemMultipoleExpansionsKer2; @@ -283,29 +311,24 @@ class BEMFMA : public ParameterAcceptor /// Vector storing the Dirichlet /// integrals multipole expansions /// for each block - mutable std::vector blockMultipoleExpansionsKer1; /// Vector storing the Neumann /// integrals multipole expansions /// for each block - mutable std::vector blockMultipoleExpansionsKer2; /// Vector storing the Dirichlet /// integrals local expansions /// for each block - mutable std::vector blockLocalExpansionsKer1; /// Vector storing the Neumann /// integrals local expansions /// for each block - mutable std::vector blockLocalExpansionsKer2; /// Associated Legendre functions class - AssLegFunction assLegFunction; /// the preconditioner to be passed to bem_problem @@ -314,27 +337,21 @@ class BEMFMA : public ParameterAcceptor TrilinosWrappers::PreconditionILU preconditioner; unsigned int quadrature_order; - unsigned int singular_quadrature_order; /// mpi related variables - - MPI_Comm mpi_communicator; - + MPI_Comm mpi_communicator; unsigned int n_mpi_processes; - unsigned int this_mpi_process; /// maximum number of collocation points /// that can be contained by a childless block: /// if a block contains less nodes than this number /// it is not further refined - unsigned int max_num_nodes_per_block; /// number of levels of the octree /// partitioning - unsigned int num_octree_levels; /// Granularity for TBB cycles. Simple parallel_for at the moment. @@ -346,30 +363,19 @@ class BEMFMA : public ParameterAcceptor /// will be used in the FMA /// a map associating each DoF with the cells /// it belongs to - std::map> dof_to_elems; /// a map associating each gradient DoF /// with the cells it belongs to - std::map> gradient_dof_to_elems; /// a vector associating each gradient DoF /// with the component it represents - std::vector gradient_dof_components; - /// a map associating each DoF to the - /// block it belongs to - /// for each level - - std::map> - dof_to_block; - /// a map associating each quad point to the /// block it belongs to for /// each level - std::map>> quad_point_to_block; @@ -377,26 +383,20 @@ class BEMFMA : public ParameterAcceptor /// containing the surrounding /// cells - std::map> elem_to_surr_elems; - /// a vector to store all OctreeBlocks /// in which the geometry is divided - mutable std::vector *> blocks; /// the total blocks number - types::global_dof_index num_blocks; /// the indices in the blocks vector, at which /// each of the levels start or end - std::vector endLevel; std::vector startLevel; /// a list of the indices of all the childless /// blocks - std::vector childlessList; /// a list of the number of parent blocks @@ -405,55 +405,44 @@ class BEMFMA : public ParameterAcceptor /// a std::vector containing the list of /// parent blocks for each level - std::vector> parentList; /// a std::map of std::vectors containing the /// list of quadrature points - std::map>> quadPoints; /// a std::map of std::vectors containing the /// list of normals at quadrature points - - // std::map > > quadNormals; std::map>> quadNormals; /// a std::map of std::vectors containing the /// list of shape function values at /// quadrature points - std::map>> quadShapeFunValues; /// a std::map of std::vectors containing the /// list of JxW values at /// quadrature points - std::map> quadJxW; /// a std::vector containing std::vectors with /// the IDs of blocks with at least one dof, /// for each level - std::vector> dofs_filled_blocks; /// a std::vector containing std::vectors with /// the IDs of blocks with at least one /// quad point, for each level - std::vector> quad_points_filled_blocks; - ConditionalOStream pcout; - /// TODO parsed quadrature? std::shared_ptr> quadrature; SmartPointer> dirichlet_nodes; /// This should be erased by the usage of the constraint matrix. const std::vector> *double_nodes_set; - std::vector> m2l_flags; - IndexSet this_cpu_set; + IndexSet this_cpu_set; }; #endif diff --git a/include/bem_problem.h b/include/bem_problem.h index d925ea77..d0a23f68 100644 --- a/include/bem_problem.h +++ b/include/bem_problem.h @@ -20,7 +20,6 @@ // of include files that we will use in the // various parts of the program. - #include #include #include @@ -31,8 +30,27 @@ #include #include +#include +#include +#include +#include + #include +#include +#include #include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include #include #include @@ -49,6 +67,7 @@ #include #include + // #include // #include // #include @@ -81,11 +100,10 @@ #include #include - - // And here are a few C++ standard header // files that we will need: + #include #include @@ -105,9 +123,6 @@ using namespace dealii; -// using namespace TrilinosWrappers; -// using namespace TrilinosWrappers::MPI; - /** * - BEMProblem. This class is the core of the BEM simulation * - it receives the variables vector filled in with the proper boundary @@ -123,12 +138,24 @@ class BEMProblem : public ParameterAcceptor typedef typename DoFHandler::active_cell_iterator cell_it; BEMProblem(ComputationalDomain &comp_dom, - const MPI_Comm comm = MPI_COMM_WORLD); + const MPI_Comm comm = MPI_COMM_WORLD, + unsigned int n_components = 1); void + solve(TrilinosWrappers::MPI::Vector &phi, TrilinosWrappers::MPI::Vector &dphi_dn, - const TrilinosWrappers::MPI::Vector &tmp_rhs); + const TrilinosWrappers::MPI::Vector &tmp_rhs, + bool reset_matrix = true); + + void + solve(TrilinosWrappers::MPI::Vector &phi, + TrilinosWrappers::MPI::Vector &phi_imag, + TrilinosWrappers::MPI::Vector &dphi_dn, + TrilinosWrappers::MPI::Vector &dphi_dn_imag, + const TrilinosWrappers::MPI::Vector &tmp_rhs, + const TrilinosWrappers::MPI::Vector &tmp_rhs_imag, + bool reset_matrix = true); /// This function takes care of the proper initialization of all the elements /// needed by the bem problem class. Since we need to sum elements associated @@ -188,6 +215,11 @@ class BEMProblem : public ParameterAcceptor void assemble_system(); + void + assemble_system_tbb(); + + void + assemble_system_singlethread(); /// The next three methods are /// needed by the GMRES solver: @@ -201,14 +233,25 @@ class BEMProblem : public ParameterAcceptor vmult(TrilinosWrappers::MPI::Vector &dst, const TrilinosWrappers::MPI::Vector &src) const; + void + vmult(TrilinosWrappers::MPI::Vector &dst, + TrilinosWrappers::MPI::Vector &dst_imag, + const TrilinosWrappers::MPI::Vector &src, + const TrilinosWrappers::MPI::Vector &src_imag) const; + /// The second method computes the /// right hand side vector of the /// system. - void compute_rhs(TrilinosWrappers::MPI::Vector &dst, const TrilinosWrappers::MPI::Vector &src) const; + void + compute_rhs(TrilinosWrappers::MPI::Vector &dst, + TrilinosWrappers::MPI::Vector &dst_imag, + const TrilinosWrappers::MPI::Vector &src, + const TrilinosWrappers::MPI::Vector &src_imag) const; + /// The third method computes the /// product between the solution vector /// and the (fully populated) sytstem @@ -219,6 +262,24 @@ class BEMProblem : public ParameterAcceptor void assemble_preconditioner(); + void + assemble_preconditioner_complex(); + + TrilinosWrappers::PreconditionBase & + get_preconditioner(bool complex) + { + if (preconditioner_type == "ILU") + { + return complex ? preconditioner_complex : preconditioner; + } + else if (preconditioner_type == "AMG") + { + return complex ? preconditioner_complex_amg : preconditioner_amg; + } + + AssertThrow(false, ExcMessage("Invalid preconditioner type")); + } + /// This is the function that guides the execution of the BEM problem. /// Depending on the resolution stategy we go whether for the direct or fma /// strategy. @@ -226,6 +287,13 @@ class BEMProblem : public ParameterAcceptor solve_system(TrilinosWrappers::MPI::Vector &phi, TrilinosWrappers::MPI::Vector &dphi_dn, const TrilinosWrappers::MPI::Vector &tmp_rhs); + void + solve_system(TrilinosWrappers::MPI::Vector &phi, + TrilinosWrappers::MPI::Vector &phi_imag, + TrilinosWrappers::MPI::Vector &dphi_dn, + TrilinosWrappers::MPI::Vector &dphi_dn_imag, + const TrilinosWrappers::MPI::Vector &tmp_rhs, + const TrilinosWrappers::MPI::Vector &tmp_rhs_imag); void @@ -270,11 +338,9 @@ class BEMProblem : public ParameterAcceptor /// this method is needed to /// separate Dirichlet dofs from /// Neumann nodes. - void compute_dirichlet_and_neumann_dofs_vectors(); - /// in the imported mesh, the nodes on the /// domain edges are doubled: this routine /// creates a std::vector of std::set which @@ -282,7 +348,6 @@ class BEMProblem : public ParameterAcceptor /// double(s). Since the geometry is shared among /// all processors we can let every processors to compute_normals /// the overall double nodes set. - void compute_double_nodes_set(); @@ -292,33 +357,246 @@ class BEMProblem : public ParameterAcceptor void adaptive_refinement(const TrilinosWrappers::MPI::Vector &error_vector); + // the components are activated one at a time + unsigned int + n_phi_components() const + { + return n_components; + } + void + set_n_phi_components(unsigned int n_components) + { + assert(this->n_components <= n_components); + if (this->n_components != n_components) + { + vector_gradients_solutions.resize(n_components); + vector_surface_gradients_solutions.resize(n_components); + + this->n_components = n_components; + } + } + + unsigned int + get_current_phi_component() const + { + return current_component; + } + void + set_current_phi_component(unsigned int component) + { + assert(component < n_components); + current_component = component; + } + + // accessors to wrap the solution Vectors; non-const&, open borders + TrilinosWrappers::MPI::Vector & + get_vector_gradients_solution() + { + return vector_gradients_solutions[current_component]; + } + + TrilinosWrappers::MPI::Vector & + get_vector_surface_gradients_solution() + { + return vector_surface_gradients_solutions[current_component]; + } + + // component selection + TrilinosWrappers::MPI::Vector & + get_vector_gradients_solution(unsigned int component) + { + assert(component < n_components); + return vector_gradients_solutions[component]; + } + + TrilinosWrappers::MPI::Vector & + get_vector_surface_gradients_solution(unsigned int component) + { + assert(component < n_components); + return vector_surface_gradients_solutions[component]; + } + + FullMatrix + get_system_matrix() const + { + Vector localized_dirichlet_nodes(dirichlet_nodes); + Vector localized_neumann_nodes(neumann_nodes); + Vector localized_robin_nodes(robin_nodes); + Vector localized_alpha(alpha); + Vector localized_robin_matrix_diagonal(robin_matrix_diagonal); + + SparsityPattern spattern(dh.n_dofs(), dh.n_dofs(), dh.n_dofs()); + for (unsigned int i = 0; i < dh.n_dofs(); ++i) + { + for (unsigned int j = 0; j < dh.n_dofs(); ++j) + { + spattern.add(i, j); + } + } + spattern.compress(); + + SparseMatrix localized_dirichlet_matrix(spattern); + localized_dirichlet_matrix.copy_from(dirichlet_matrix); + SparseMatrix localized_neumann_matrix(spattern); + localized_neumann_matrix.copy_from(neumann_matrix); + + FullMatrix ret(dh.n_dofs(), dh.n_dofs()); + + for (unsigned int i = 0; i < dh.n_dofs(); ++i) + { + for (unsigned int j = 0; j < dh.n_dofs(); ++j) + { + if (localized_dirichlet_nodes(j)) + { + ret.set(i, j, localized_neumann_matrix(i, j)); + if (i == j) + { + ret.add(i, j, localized_alpha(i)); + } + } + else if (localized_neumann_nodes(j)) + { + ret.set(i, j, -localized_dirichlet_matrix(i, j)); + } + else + { + ret.set(i, j, localized_neumann_matrix(i, j)); + ret.add(i, + j, + localized_dirichlet_matrix(i, j) * + localized_robin_matrix_diagonal(j)); + if (i == j) + { + ret.add(i, j, localized_alpha(i)); + } + } + } + } + + return ret; + } + + FullMatrix + get_system_matrix_complex() const + { + Vector localized_dirichlet_nodes(dirichlet_nodes); + Vector localized_neumann_nodes(neumann_nodes); + Vector localized_robin_nodes(robin_nodes); + Vector localized_alpha(alpha); + Vector localized_robin_matrix_diagonal(robin_matrix_diagonal); + Vector localized_robin_matrix_diagonal_imag( + robin_matrix_diagonal_imag); + + SparsityPattern spattern(dh.n_dofs(), dh.n_dofs(), dh.n_dofs()); + for (unsigned int i = 0; i < dh.n_dofs(); ++i) + { + for (unsigned int j = 0; j < dh.n_dofs(); ++j) + { + spattern.add(i, j); + } + } + spattern.compress(); + + SparseMatrix localized_dirichlet_matrix(spattern); + localized_dirichlet_matrix.copy_from(dirichlet_matrix); + SparseMatrix localized_neumann_matrix(spattern); + localized_neumann_matrix.copy_from(neumann_matrix); + + FullMatrix ret(2 * dh.n_dofs(), 2 * dh.n_dofs()); + + for (unsigned int i = 0; i < dh.n_dofs(); ++i) + { + for (unsigned int j = 0; j < dh.n_dofs(); ++j) + { + if (localized_dirichlet_nodes(j)) + { + ret.set(i, j, localized_neumann_matrix(i, j)); + ret.set(i + dh.n_dofs(), + j + dh.n_dofs(), + localized_neumann_matrix(i, j)); + if (i == j) + { + ret.add(i, j, localized_alpha(i)); + ret.add(i + dh.n_dofs(), + j + dh.n_dofs(), + localized_alpha(i)); + } + } + else if (localized_neumann_nodes(j)) + { + ret.set(i, j, -localized_dirichlet_matrix(i, j)); + ret.set(i + dh.n_dofs(), + j + dh.n_dofs(), + -localized_dirichlet_matrix(i, j)); + } + else + { + ret.set(i, j, localized_neumann_matrix(i, j)); + ret.set(i + dh.n_dofs(), + j + dh.n_dofs(), + localized_neumann_matrix(i, j)); + + // in the diagonal blocks, it's just the real part of the robin + // datastructs + ret.add(i, + j, + localized_dirichlet_matrix(i, j) * + localized_robin_matrix_diagonal(j)); + ret.add(i + dh.n_dofs(), + j + dh.n_dofs(), + localized_dirichlet_matrix(i, j) * + localized_robin_matrix_diagonal(j)); + // but the in the other quadrants, it's the imaginary part with + // flipping of the sign + ret.add(i, + j + dh.n_dofs(), + -localized_dirichlet_matrix(i, j) * + localized_robin_matrix_diagonal_imag(j)); + ret.add(i + dh.n_dofs(), + j, + localized_dirichlet_matrix(i, j) * + localized_robin_matrix_diagonal_imag(j)); + + if (i == j) + { + ret.add(i, j, localized_alpha(i)); + ret.add(i + dh.n_dofs(), + j + dh.n_dofs(), + localized_alpha(i)); + } + } + } + } + + return ret; + } + + unsigned int n_components; + unsigned int current_component; ConditionalOStream pcout; ComputationalDomain &comp_dom; - std::string scalar_fe_type, vector_fe_type; - unsigned int scalar_fe_order, vector_fe_order; + std::string scalar_fe_type, vector_fe_type; + unsigned int scalar_fe_order, vector_fe_order; + std::unique_ptr> fe; std::unique_ptr> gradient_fe; DoFHandler dh; DoFHandler gradient_dh; - // FE_Q fe; - // FESystem gradient_fe; double refinement_threshold, coarsening_threshold; /// An Eulerian Mapping is created to deal /// with the free surface and boat mesh /// deformation - Vector map_vector; std::shared_ptr> mapping; unsigned int mapping_degree; Vector map_points; - /// these are the std::vectors of std::sets /// containing informations on multiple /// nodes on the edges: one vector is @@ -327,12 +605,9 @@ class BEMProblem : public ParameterAcceptor /// function, and one is created for the /// points associated with the degrees of /// freedom of its gradient (a vector field) - std::vector> double_nodes_set; std::vector> gradient_double_nodes_set; - - std::shared_ptr> quadrature; unsigned int quadrature_order; @@ -341,15 +616,19 @@ class BEMProblem : public ParameterAcceptor /// used unsigned int singular_quadrature_order; - TrilinosWrappers::SparsityPattern full_sparsity_pattern; TrilinosWrappers::SparseMatrix neumann_matrix; TrilinosWrappers::SparseMatrix dirichlet_matrix; + // handles robin conditions such as + // coeffs[i, 0] * phi + coeffs[i, 1] * dphi_dn = coeffs[i, 2] + TrilinosWrappers::MPI::Vector robin_matrix_diagonal, + robin_matrix_diagonal_imag; + TrilinosWrappers::MPI::Vector robin_rhs, robin_rhs_imag; - TrilinosWrappers::MPI::Vector system_rhs; + TrilinosWrappers::MPI::Vector system_rhs; //, system_rhs_imag; - /// solution and alpha vectors - TrilinosWrappers::MPI::Vector sol; + + TrilinosWrappers::MPI::Vector sol, sol_imag; TrilinosWrappers::MPI::Vector alpha; /// an alternatively computed alpha vector (obtained with geometric /// computations) @@ -361,37 +640,33 @@ class BEMProblem : public ParameterAcceptor /// b_i vector appearing in the hypersingular BIE std::vector b_i; - mutable TrilinosWrappers::MPI::Vector serv_phi; - mutable TrilinosWrappers::MPI::Vector serv_dphi_dn; - TrilinosWrappers::MPI::Vector serv_tmp_rhs; - - AffineConstraints constraints; - - std::string preconditioner_type; + TrilinosWrappers::MPI::BlockVector sol_blocked, system_rhs_blocked; - std::string mapping_type; + mutable TrilinosWrappers::MPI::Vector serv_phi, serv_phi_imag; + mutable TrilinosWrappers::MPI::Vector serv_dphi_dn, serv_dphi_dn_imag; + mutable TrilinosWrappers::MPI::Vector serv_phi_robin, serv_phi_robin_imag; - std::string solution_method; + AffineConstraints constraints, constraints_imag; + std::string preconditioner_type; + std::string mapping_type; + std::string solution_method; SolverControl solver_control; - // TODO AMG preconditioner - TrilinosWrappers::PreconditionILU preconditioner; - - TrilinosWrappers::SparsityPattern preconditioner_sparsity_pattern; - - TrilinosWrappers::SparseMatrix band_system; + TrilinosWrappers::PreconditionILU preconditioner, preconditioner_complex; + TrilinosWrappers::PreconditionAMG preconditioner_amg, + preconditioner_complex_amg; + TrilinosWrappers::SparsityPattern preconditioner_sparsity_pattern, + preconditioner_complex_sparsity_pattern; - types::global_dof_index preconditioner_band; - - bool is_preconditioner_initialized; + types::global_dof_index preconditioner_band; + TrilinosWrappers::SparseMatrix band_system, band_system_complex; + bool is_preconditioner_initialized, is_preconditioner_complex_initialized; bool continuos_gradient; - MPI_Comm mpi_communicator; - + MPI_Comm mpi_communicator; unsigned int n_mpi_processes; - unsigned int this_mpi_process; /// the following vector is needed to @@ -405,12 +680,14 @@ class BEMProblem : public ParameterAcceptor /// entries for Dirichlet nodes, and ones /// for Neumann nodes TrilinosWrappers::MPI::Vector neumann_nodes; - - + TrilinosWrappers::MPI::Vector robin_nodes; + TrilinosWrappers::MPI::Vector dirichlet_flags; + TrilinosWrappers::MPI::Vector neumann_flags; + TrilinosWrappers::MPI::Vector robin_flags; /// The IndexSet for the problem without considering any ghost element for the /// scalar FE - IndexSet this_cpu_set; + IndexSet this_cpu_set; //, this_cpu_set_complex; /// The IndexSet for the problem considering every ghost element for the /// scalar FE IndexSet ghosted_set; @@ -422,31 +699,23 @@ class BEMProblem : public ParameterAcceptor IndexSet edge_set; - TrilinosWrappers::MPI::Vector vector_gradients_solution; - - TrilinosWrappers::MPI::Vector vector_surface_gradients_solution; - - TrilinosWrappers::MPI::Vector vector_normals_solution; + // vectorize to support multiple phi components + std::vector vector_gradients_solutions; + std::vector vector_surface_gradients_solutions; + TrilinosWrappers::MPI::Vector vector_normals_solution; std::vector start_per_process; - std::vector vector_start_per_process; - - TrilinosWrappers::SparsityPattern vector_sparsity_pattern; - - AffineConstraints vector_constraints; + TrilinosWrappers::SparsityPattern vector_sparsity_pattern; + AffineConstraints vector_constraints; std::vector original_to_sub_wise; - std::vector sub_wise_to_original; - std::vector vec_original_to_sub_wise; - std::vector vec_sub_wise_to_original; - bool have_dirichlet_bc; + bool can_determine_phi; BEMFMA fma; }; - #endif diff --git a/include/bem_problem_access.h b/include/bem_problem_access.h deleted file mode 100644 index 8db93789..00000000 --- a/include/bem_problem_access.h +++ /dev/null @@ -1,73 +0,0 @@ -#ifndef bem_problem_access_h -#define bem_problem_access_h - -#include - -using namespace dealii; -// using namespace deal2lkit; - -template -class BEMProblem; - -template -class BEMProblemAccess -{ -public: - BEMProblemAccess(){}; - - void - initialize(BEMProblem *in) - { - bem_problem = in; - }; - const DoFHandler & - get_bem_dh() const - { - return (bem_problem->dh); - }; - - const FiniteElement & - get_bem_fe() const - { - return *bem_problem->fe; - } - // const Triangulation & get_tria(); - const Mapping & - get_bem_mapping() const - { - return *bem_problem->mapping; - }; - const Quadrature & - get_bem_quadrature() const - { - return (*bem_problem->quadrature); - }; - unsigned int - get_bem_singular_quadrature_order() - { - return bem_problem->singular_quadrature_order; - }; - const AffineConstraints & - get_bem_constraint_matrix() const - { - return bem_problem->constraints; - } - const std::vector> & - get_bem_double_nodes_set() - { - return bem_problem->double_nodes_set; - } - const TrilinosWrappers::MPI::Vector & - get_bem_dirichlet_nodes() const - { - return bem_problem->dirichlet_nodes; - } - - // get_pinco(); - // get_palla(); - -private: - BEMProblem *bem_problem; -}; - -#endif diff --git a/include/boundary_conditions.h b/include/boundary_conditions.h index 87702c10..109a9957 100644 --- a/include/boundary_conditions.h +++ b/include/boundary_conditions.h @@ -20,8 +20,20 @@ #include #include #include +#include #include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + #include #include #include @@ -35,20 +47,6 @@ #include #include #include -// #include - -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include #include #include @@ -62,7 +60,17 @@ #include "../include/bem_problem.h" #include "../include/computational_domain.h" + using namespace dealii; + +enum BoundaryConditionType +{ + dirichlet, + neumann, + robin, + invalid +}; + /** * - BoundaryCondition. The class handles the boundary conditions. In particular * - it reads the boundary conditions for the potential and its normal @@ -76,12 +84,22 @@ template class BoundaryConditions : public ParameterAcceptor { public: + static constexpr unsigned int MAX_COMPONENTS = 14; + static constexpr unsigned int MAX_CONDITION_SLOTS = 2; + BoundaryConditions(ComputationalDomain &comp_dom, BEMProblem &bem, - const MPI_Comm comm = MPI_COMM_WORLD) - : wind(dim) + const MPI_Comm comm = MPI_COMM_WORLD, + unsigned int n_components = 1) + : n_components(n_components) + , current_component(0) + , winds(n_components * MAX_CONDITION_SLOTS) + , potentials(n_components * MAX_CONDITION_SLOTS) + , robin_coeffs(n_components * MAX_CONDITION_SLOTS) , comp_dom(comp_dom) , bem(bem) + , phis(n_components) + , dphi_dns(n_components) , mpi_communicator(comm) , n_mpi_processes(Utilities::MPI::n_mpi_processes(mpi_communicator)) , this_mpi_process(Utilities::MPI::this_mpi_process(mpi_communicator)) @@ -90,7 +108,6 @@ class BoundaryConditions : public ParameterAcceptor dofs_number = 0, output_frequency = 1; } - typedef typename DoFHandler::active_cell_iterator cell_it; virtual void @@ -100,30 +117,201 @@ class BoundaryConditions : public ParameterAcceptor parse_parameters(ParameterHandler &prm) override; void - prepare_bem_vectors(); + prepare_bem_vectors(TrilinosWrappers::MPI::Vector &rhs); void - solve_problem(); + prepare_robin_datastructs( + TrilinosWrappers::MPI::Vector &robin_matrix_diagonal, + TrilinosWrappers::MPI::Vector &robin_rhs); + + void + prepare_robin_datastructs( + TrilinosWrappers::MPI::Vector &robin_matrix_diagonal, + TrilinosWrappers::MPI::Vector &robin_matrix_diagonal_imag, + TrilinosWrappers::MPI::Vector &robin_rhs, + TrilinosWrappers::MPI::Vector &robin_rhs_imag); + + void + solve_problem(bool reset_matrix = true); + + // solves the complex problem where the real parts of b.conditions and Robin + // coefficients are given by the current component data structs, the imaginary + // parts from the next component + void + solve_complex_problem(bool reset_matrix = true); void output_results(const std::string); void - compute_errors(); + compute_errors(bool complex, bool current_is_real); - const TrilinosWrappers::MPI::Vector & - get_phi(); + // the components are activated one at a time + unsigned int + n_phi_components() const + { + return n_components; + } - const TrilinosWrappers::MPI::Vector & - get_dphi_dn(); + void + set_n_phi_components(unsigned int n_components) + { + AssertIndexRange(this->n_components, n_components + 1); + if (this->n_components != n_components) + { + winds.resize(n_components * MAX_CONDITION_SLOTS); + potentials.resize(n_components * MAX_CONDITION_SLOTS); + robin_coeffs.resize(n_components * MAX_CONDITION_SLOTS); + phis.resize(n_components); + dphi_dns.resize(n_components); + + this->n_components = n_components; + } + } + unsigned int + get_current_phi_component() const + { + return current_component; + } + + void + set_current_phi_component(unsigned int component) + { + AssertIndexRange(component, n_components); + current_component = component; + bem.set_current_phi_component(component); + } + + // wrap extraction of current component; public interface retrieves const& + // objects + const Functions::ParsedFunction & + get_wind(unsigned int component, unsigned int slot) const + { + AssertIndexRange(component * MAX_CONDITION_SLOTS + slot, + n_components * MAX_CONDITION_SLOTS); + return *winds[component * MAX_CONDITION_SLOTS + slot]; + } + + const Functions::ParsedFunction & + get_potential(unsigned int component, unsigned int slot) const + { + AssertIndexRange(component * MAX_CONDITION_SLOTS + slot, + n_components * MAX_CONDITION_SLOTS); + return *potentials[component * MAX_CONDITION_SLOTS + slot]; + } + + const Functions::ParsedFunction & + get_robin_coeffs(unsigned int component, unsigned int slot) const + { + AssertIndexRange(component * MAX_CONDITION_SLOTS + slot, + n_components * MAX_CONDITION_SLOTS); + return *robin_coeffs[component * MAX_CONDITION_SLOTS + slot]; + } + + // same as above, for the Vectors; however, retrieve non-const& + TrilinosWrappers::MPI::Vector & + get_phi() + { + return phis[current_component]; + } + + TrilinosWrappers::MPI::Vector & + get_dphi_dn() + { + return dphi_dns[current_component]; + } + + TrilinosWrappers::MPI::Vector & + get_phi(unsigned int component) + { + AssertIndexRange(component, n_components); + return phis[component]; + } + + TrilinosWrappers::MPI::Vector & + get_dphi_dn(unsigned int component) + { + AssertIndexRange(component, n_components); + return dphi_dns[component]; + } + + /// get all components as blocks + TrilinosWrappers::MPI::BlockVector + get_phi_components(const std::vector &component_idxs) + { + TrilinosWrappers::MPI::BlockVector ret; + std::vector indexSets(n_components); + for (auto comp : component_idxs) + { + for (auto i : this_cpu_set) + { + indexSets[comp].add_index(comp * this_cpu_set.size() + i); + } + indexSets[comp].compress(); + } + + ret.reinit(indexSets, mpi_communicator); + + for (auto comp : component_idxs) + { + for (auto i : this_cpu_set) + { + ret[comp * this_cpu_set.size() + i] = get_phi(comp)[i]; + } + } + + ret.compress(VectorOperation::add); + + return ret; + } + + TrilinosWrappers::MPI::BlockVector + get_phi_components() + { + std::vector component_idxs(n_components); + for (unsigned int i = 0; i < n_components; ++i) + { + component_idxs[i] = i; + } + + return get_phi_components(component_idxs); + } std::string output_file_name; protected: - Functions::ParsedFunction wind; + // non const extractors: needed for set_time + Functions::ParsedFunction & + get_wind(unsigned int component, unsigned int slot) + { + AssertIndexRange(component * MAX_CONDITION_SLOTS + slot, + n_components * MAX_CONDITION_SLOTS); + return *winds[component * MAX_CONDITION_SLOTS + slot]; + } + + Functions::ParsedFunction & + get_potential(unsigned int component, unsigned int slot) + { + AssertIndexRange(component * MAX_CONDITION_SLOTS + slot, + n_components * MAX_CONDITION_SLOTS); + return *potentials[component * MAX_CONDITION_SLOTS + slot]; + } + + Functions::ParsedFunction & + get_robin_coeffs(unsigned int component, unsigned int slot) + { + AssertIndexRange(component * MAX_CONDITION_SLOTS + slot, + n_components * MAX_CONDITION_SLOTS); + return *robin_coeffs[component * MAX_CONDITION_SLOTS + slot]; + } - Functions::ParsedFunction potential; + unsigned int n_components; + unsigned int current_component; + // each vector holds MAX_COMPONENTS * MAX_CONDITION_SLOTS functions + std::vector>> winds; + std::vector>> potentials; + std::vector>> robin_coeffs; std::string node_displacement_type; @@ -137,9 +325,9 @@ class BoundaryConditions : public ParameterAcceptor unsigned int output_frequency; - TrilinosWrappers::MPI::Vector tmp_rhs; - TrilinosWrappers::MPI::Vector phi; - TrilinosWrappers::MPI::Vector dphi_dn; + TrilinosWrappers::MPI::Vector tmp_rhs; + std::vector phis; + std::vector dphi_dns; MPI_Comm mpi_communicator; @@ -147,7 +335,7 @@ class BoundaryConditions : public ParameterAcceptor unsigned int this_mpi_process; - bool have_dirichlet_bc; + bool can_determine_phi; IndexSet this_cpu_set; diff --git a/include/cached_nurbs_patch_manifold.h b/include/cached_nurbs_patch_manifold.h index ff9607c5..5d9b63ed 100644 --- a/include/cached_nurbs_patch_manifold.h +++ b/include/cached_nurbs_patch_manifold.h @@ -15,9 +15,9 @@ class CachedNURBSPatchManifold // const types::global_dof_index cache_size=100000) : OpenCASCADE::NURBSPatchManifold<2, 3>(face, tolerance) , tolerance(tolerance) - , face(face){ - // projections_cache.reserve(cache_size); - }; + , face(face) { + // projections_cache.reserve(cache_size); + }; virtual Point pull_back(const Point &space_point) const override; diff --git a/include/computational_domain.h b/include/computational_domain.h index d6f66e9a..fb2c730a 100644 --- a/include/computational_domain.h +++ b/include/computational_domain.h @@ -133,10 +133,21 @@ class ComputationalDomain : public ParameterAcceptor void read_domain(); + double + load_cad_objects(); + + void + refine_and_resize_by_aspect_ratio(); + + void + refine_and_resize_by_cad_projections(double max_tol); + + void + refine_and_resize_wrapup(); + /// method to refine the imported mesh /// according to the level requested in /// the parameters file - void refine_and_resize(const unsigned int refinement_level); @@ -191,48 +202,50 @@ class ComputationalDomain : public ParameterAcceptor void compute_double_vertex_cache(); - // const unsigned int fe_degree; - // const unsigned int mapping_degree; Triangulation tria; - /// here we are just renaming the cell - /// iterator - - - // values to be imported from the // parameters file: /// number of refining cycles - unsigned int n_cycles; /// number of global refinement to executed before a local refinement cycle; - unsigned int pre_global_refinements; /// maximum cell aspect ratio - double max_element_aspect_ratio; + + // we make frequent use of AVS UCD grids, which only admit a single flag per + // each cell so, we can either set a manifold_id or a material_id with it. we + // make use of both. the former to refine the grid and the second to apply + // boundary conditions. however, it often happens that we have more boundary + // conditions than manifolds associated to cad surfaces. In such a case a + // deal.II exception is triggered, as manifold_ids are defined but no + // manifolds are attached to them. this option can be used to avoid a similar + // exception. If the option is set to true, all manifold_ids are scanned, and + // those with no manifold attached are attached to a flat manifold. This + // preserves the possibility of importing AVS UCD grids or similar (which, + // however, have not been deprecated by deal.II) + + bool attach_flat_manifold_to_manifold_ids_with_unset_manifold; + // flag to assess if the software will look for cad surfaces (form files // Color_*.iges) and curves (from files Curve_*.iges), and use such geometries // to refine the grid. the program will import as many curves and surfaces as // there are available in the present folder, and progressively associate them // to the manifold IDS available in the mesh file. - // bool use_cad_surface_and_curves; // flag to require surface refinement based on CAD surface curvature. Can only // be activated if previous flag is true - // bool surface_curvature_refinement; // used if curvature adaptive refinement is true. the cells are refined until // their size is 1/cells_per_circle of the circumference the radius of which // is the local max curvature radius - // double cells_per_circle; // maximum number of curvature based refinement cycles @@ -253,12 +266,14 @@ class ComputationalDomain : public ParameterAcceptor /// the material ID numbers in the mesh /// input file, for the neumann_nodes std::vector neumann_boundary_ids; + std::vector robin_boundary_ids; + std::map manifold2bcondition_map; + std::map manifold2bcondition_slot_map; MPI_Comm mpi_communicator; unsigned int n_mpi_processes; - unsigned int this_mpi_process; // to deal with conformity on edges with double nodes @@ -277,7 +292,6 @@ class ComputationalDomain : public ParameterAcceptor ConditionalOStream pcout; - /// vectors containing the CAD surfaces and curves to be /// (optionally) used for refinement of the triangulation std::vector cad_surfaces; diff --git a/include/constrained_matrix.h b/include/constrained_matrix.h index 6bf2c062..34ccb07c 100644 --- a/include/constrained_matrix.h +++ b/include/constrained_matrix.h @@ -13,22 +13,20 @@ // Authors: Nicola Giuliani, Andrea Mola, Luca Heltai #ifndef __deal2__constrained_matrix_h -# define __deal2__constrained_matrix_h +#define __deal2__constrained_matrix_h +#include +#include +#include +#include +#include -# include +#include +#include -# include -# include -# include -# include - -# include -# include - -# include -# include +#include +#include DEAL_II_NAMESPACE_OPEN @@ -42,7 +40,6 @@ class ConstrainedMatrixBlock; *@{ */ - /** * * @author Luca Heltai 2011 @@ -64,8 +61,6 @@ class ConstrainedOperator , this_mpi_process(Utilities::MPI::this_mpi_process(mpi_communicator)) {} - - void vmult(VEC &dst, const VEC &src) const; @@ -84,33 +79,21 @@ class ConstrainedOperator /*@}*/ /*---------------------- Inline functions -----------------------------------*/ - //--------------------------------Iterators--------------------------------------// - template void ConstrainedOperator::vmult(VEC &dst, const VEC &src) const { - // Vector loc_src(src); VEC loc_src(constr_cpu_set); loc_src.reinit(src, false, true); - // loc_src = src; - - // std::cout<<"in vector "<> *entries = constraints.get_constraint_entries(i); @@ -121,17 +104,6 @@ ConstrainedOperator::vmult(VEC &dst, const VEC &src) const dst(i) += 0.; dst.compress(VectorOperation::add); - // constraints.condense(dst); - // std::cout<<"out vector "< @@ -146,8 +118,6 @@ ConstrainedOperator::distribute_rhs(VEC &rhs) const rhs(i) = rhs(i); } - DEAL_II_NAMESPACE_CLOSE #endif -/*---------------------------- filtered_matrix.h ---------------------------*/ diff --git a/include/constrained_matrix_complex.h b/include/constrained_matrix_complex.h new file mode 100644 index 00000000..abbebd78 --- /dev/null +++ b/include/constrained_matrix_complex.h @@ -0,0 +1,288 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2014 - 2020 by the pi-BEM authors. +// +// This file is part of the pi-BEM library. +// +// The pi-BEM is free software; you can use it, redistribute +// it, and/or modify it under the terms of the GNU Lesser General +// Public License version 2.1 as published by the Free Software Foundation. +// The full text of the license can be found in the file LICENSE at +// the top level of the pi-BEM distribution. +// +// Authors: Nicola Giuliani, Andrea Mola, Luca Heltai + +#ifndef __deal2__constrained_matrix_complex_h +#define __deal2__constrained_matrix_complex_h + +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include + +DEAL_II_NAMESPACE_OPEN + +template +class ConstrainedComplexOperator +{ +public: + ConstrainedComplexOperator(const MATRIX &m, + const AffineConstraints &c, + const AffineConstraints &c_imag, + const IndexSet &c_cpu_set, + MPI_Comm comm = MPI_COMM_WORLD) + : constraints(c) + , constraints_imag(c_imag) + , matrix(m) + , constr_cpu_set(c_cpu_set) + , mpi_communicator(comm) + , n_mpi_processes(Utilities::MPI::n_mpi_processes(mpi_communicator)) + , this_mpi_process(Utilities::MPI::this_mpi_process(mpi_communicator)) + { + constr_cpu_set_complex = IndexSet(2 * constr_cpu_set.size()); + constr_cpu_set_complex.add_indices(constr_cpu_set); + constr_cpu_set_complex.add_indices(constr_cpu_set, constr_cpu_set.size()); + constr_cpu_set_complex.compress(); + + c_dst.reinit(matrix.this_cpu_set); + c_dst_imag.reinit(matrix.this_cpu_set); + c_src.reinit(matrix.this_cpu_set); + c_src_imag.reinit(matrix.this_cpu_set); + } + + void + vmult(VEC &dst, const VEC &src) const; + + void + distribute_rhs(VEC &rhs) const; + +private: + const AffineConstraints &constraints, constraints_imag; + const MATRIX &matrix; + IndexSet constr_cpu_set, constr_cpu_set_complex; + // this class is meant to be const when used by GMRES, but these caches are + // kept allocated + mutable VEC c_dst, c_dst_imag, c_src, c_src_imag; + MPI_Comm mpi_communicator; + unsigned int n_mpi_processes; + unsigned int this_mpi_process; +}; + +template +void +ConstrainedComplexOperator::vmult(VEC &dst, const VEC &src) const +{ + auto offset = matrix.this_cpu_set.size(); + // store localized constrained values + VEC loc_src(constr_cpu_set_complex); + loc_src.reinit(src, false, true); + + // split into real, imag + c_src = 0; + c_src_imag = 0; + c_dst = 0; + c_dst_imag = 0; + for (auto i : matrix.this_cpu_set) + { + c_src(i) = src(i); + c_src_imag(i) = src(i + offset); + } + c_src.compress(VectorOperation::add); + c_src_imag.compress(VectorOperation::add); + + matrix.vmult(c_dst, c_dst_imag, c_src, c_src_imag); + c_dst.compress(VectorOperation::add); + c_dst_imag.compress(VectorOperation::add); + + for (auto i : matrix.this_cpu_set) + { + dst(i) = c_dst(i); + dst(i + offset) = c_dst_imag(i); + } + + for (auto i : matrix.this_cpu_set) + { + if (constraints.is_constrained(i)) + { + dst(i) += src(i) - dst(i); + dst(i + offset) += src(i + offset) - dst(i + offset); + + for (const auto &entry : *constraints.get_constraint_entries(i)) + { + dst(i) -= entry.second * loc_src(entry.first); + } + + for (const auto &entry : *constraints_imag.get_constraint_entries(i)) + { + dst(i + offset) -= entry.second * loc_src(entry.first + offset); + } + } + else + { + dst(i) += 0.; + dst(i + offset) += 0.; + } + } + + dst.compress(VectorOperation::add); +} + +template +void +ConstrainedComplexOperator::distribute_rhs(VEC &rhs) const +{ + for (auto i : matrix.this_cpu_set) + { + if (constraints.is_constrained(i)) + { + rhs(i) = constraints.get_inhomogeneity(i); + rhs(i + matrix.this_cpu_set.size()) = + constraints_imag.get_inhomogeneity(i); + } + else + { + rhs(i) = rhs(i); + rhs(i + matrix.this_cpu_set.size()) = + rhs(i + matrix.this_cpu_set.size()); + } + } +} + +// using BlockVector +template +class BlockPreconditioner +{ +public: + BlockPreconditioner(PreconditionerType &preconditioner) + : preconditioner(preconditioner) + {} + + virtual void + vmult(TrilinosWrappers::MPI::BlockVector &dst, + const TrilinosWrappers::MPI::BlockVector &src) const + { + for (unsigned int i = 0; i < src.n_blocks(); ++i) + { + preconditioner.vmult(dst.block(i), src.block(i)); + } + } + + virtual void + Tvmult(TrilinosWrappers::MPI::BlockVector &dst, + const TrilinosWrappers::MPI::BlockVector &src) const + { + for (unsigned int i = 0; i < src.n_blocks(); ++i) + { + preconditioner.Tvmult(dst.block(i), src.block(i)); + } + } + +protected: + PreconditionerType &preconditioner; +}; + +template +class BlockConstrainedComplexOperator +{ +public: + BlockConstrainedComplexOperator(const MATRIX &m, + const AffineConstraints &c, + const AffineConstraints &c_imag, + const IndexSet &c_cpu_set, + MPI_Comm comm = MPI_COMM_WORLD) + : constraints(c) + , constraints_imag(c_imag) + , matrix(m) + , constr_cpu_set(c_cpu_set) + , mpi_communicator(comm) + , n_mpi_processes(Utilities::MPI::n_mpi_processes(mpi_communicator)) + , this_mpi_process(Utilities::MPI::this_mpi_process(mpi_communicator)) + { + constr_cpu_set_complex = IndexSet(2 * constr_cpu_set.size()); + constr_cpu_set_complex.add_indices(constr_cpu_set); + constr_cpu_set_complex.add_indices(constr_cpu_set, constr_cpu_set.size()); + constr_cpu_set_complex.compress(); + } + + void + vmult(VEC &dst, const VEC &src) const; + + void + distribute_rhs(VEC &rhs) const; + +private: + const AffineConstraints &constraints, constraints_imag; + const MATRIX &matrix; + IndexSet constr_cpu_set, constr_cpu_set_complex; + MPI_Comm mpi_communicator; + unsigned int n_mpi_processes; + unsigned int this_mpi_process; +}; + +template +void +BlockConstrainedComplexOperator::vmult(VEC &dst, + const VEC &src) const +{ + // store localized constrained values + std::vector parallel_partitioning{constr_cpu_set, constr_cpu_set}; + VEC localized_src; + localized_src.reinit(parallel_partitioning, mpi_communicator); + for (unsigned int i = 0; i < src.n_blocks(); ++i) + { + localized_src.block(i).reinit(src.block(i), false, true); + } + + matrix.vmult(dst.block(0), dst.block(1), src.block(0), src.block(1)); + dst.compress(VectorOperation::add); + + for (auto i : matrix.this_cpu_set) + { + if (constraints.is_constrained(i)) + { + dst.block(0)(i) += src.block(0)(i) - dst.block(0)(i); + for (const auto &entry : *constraints.get_constraint_entries(i)) + { + dst.block(0)(i) -= + entry.second * localized_src.block(0)(entry.first); + } + + dst.block(1)(i) += src.block(1)(i) - dst.block(1)(i); + for (const auto &entry : *constraints_imag.get_constraint_entries(i)) + { + dst.block(1)(i) -= + entry.second * localized_src.block(1)(entry.first); + } + } + } + + dst.compress(VectorOperation::add); +} + +template +void +BlockConstrainedComplexOperator::distribute_rhs(VEC &rhs) const +{ + for (auto i : matrix.this_cpu_set) + { + if (constraints.is_constrained(i)) + { + rhs.block(0)(i) = constraints.get_inhomogeneity(i); + rhs.block(1)(i) = constraints_imag.get_inhomogeneity(i); + } + } + + rhs.compress(VectorOperation::insert); +} + +DEAL_II_NAMESPACE_CLOSE + +#endif diff --git a/include/driver.h b/include/driver.h index 298f500c..f14cc92b 100644 --- a/include/driver.h +++ b/include/driver.h @@ -62,13 +62,24 @@ #include #include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + #include #include #include -// And here are a few C++ standard header -// files that we will need: - #include #include #include @@ -81,9 +92,6 @@ #include "computational_domain.h" using namespace dealii; -// using namespace TrilinosWrappers::MPI::Vector; -// using namespace TrilinosWrappers::MPI::SparseMatrix; - /** * This class is in charge of organising the overall BEM simulation. It has * interfaces with all the other classes in order to have a complete simulation. @@ -92,7 +100,7 @@ template class Driver : public ParameterAcceptor { public: - Driver(); + Driver(unsigned int n_components = 1); ~Driver(); @@ -108,7 +116,6 @@ class Driver : public ParameterAcceptor virtual void parse_parameters(ParameterHandler &prm) override; - void run(); @@ -125,10 +132,12 @@ class Driver : public ParameterAcceptor ParameterHandler prm; - bool global_refinement; + bool global_refinement; + std::set complex_problems; const unsigned int n_mpi_processes; const unsigned int this_mpi_process; + unsigned int n_components; }; #endif diff --git a/include/laplace_kernel.h b/include/laplace_kernel.h index ac8e6c49..3c2b6132 100644 --- a/include/laplace_kernel.h +++ b/include/laplace_kernel.h @@ -1,17 +1,16 @@ +#ifndef laplace_kernel_h +#define laplace_kernel_h #include #include #include -// And here are a few C++ standard header -// files that we will need: #include #include #include #include #include - namespace LaplaceKernel { template @@ -32,8 +31,6 @@ namespace LaplaceKernel } } - - template Point double_layer(const Point &R) @@ -160,3 +157,4 @@ namespace LaplaceKernel } } // namespace LaplaceKernel +#endif diff --git a/include/local_expansion.h b/include/local_expansion.h index c27c927b..b772a806 100644 --- a/include/local_expansion.h +++ b/include/local_expansion.h @@ -12,22 +12,43 @@ #include "local_expansion_coeff.h" #include "multipole_expansion.h" - class LocalExpansion { public: static FullMatrix A_n_m; - // static std::vector > > > - // mExp_to_lExp_Coeff; - static std::vector>>> lExp_to_lExp_Coeff; static LocalExpansionCoeff mExp_to_lExp_Coeff; - mutable bool is_zero; + static bool + equal(const LocalExpansion &lhs, + const LocalExpansion &rhs, + double tolerance = 1e-10) + { + if (lhs.p != rhs.p) + { + return false; + } + + if (lhs.center.distance_square(rhs.center) > (tolerance * tolerance)) + { + return false; + } + + for (unsigned int i = 0; i < (lhs.p + 1) * (lhs.p + 2) / 2; ++i) + { + if (std::abs(lhs._L_n_m[i] - rhs._L_n_m[i]) > tolerance) + { + return false; + } + } + + return true; + } + mutable bool is_zero; private: mutable unsigned int p; @@ -36,8 +57,7 @@ class LocalExpansion mutable const AssLegFunction *assLegFunction; - mutable std::complex *_L_n_m; - + mutable std::vector> _L_n_m; public: LocalExpansion(); @@ -46,23 +66,29 @@ class LocalExpansion const dealii::Point<3> ¢er, const AssLegFunction *assLegFunction); - LocalExpansion(const LocalExpansion &other); - - ~LocalExpansion(); - void Add(const std::vector &real, const std::vector &imag); - void Add(const LocalExpansion &parent); + void + Add(const LocalExpansion &parent, std::vector> &cache); + void Add(const MultipoleExpansion &multipole); + void + Add(const MultipoleExpansion &multipole, + std::vector> &cache); + double Evaluate(const dealii::Point<3> &evalPoint); + double + Evaluate(const dealii::Point<3> &evalPoint, + std::vector> &cache); + inline dealii::Point<3> & GetCenter() const { @@ -87,7 +113,7 @@ class LocalExpansion return this->p; } - inline std::complex * + inline const std::vector> & GetCoeffs() const { return this->_L_n_m; @@ -111,78 +137,68 @@ class LocalExpansion this->_L_n_m[(n) * (n + 1) / 2 + m] += value; } - LocalExpansion & - operator=(const LocalExpansion &other); - - static FullMatrix A_n_m_Matrix(unsigned int dimension) { FullMatrix A_n_m(dimension + 1, dimension + 1); for (unsigned int n = 0; n < dimension + 1; n++) - { for (unsigned int m = 0; m < n + 1; m++) - { double f1 = 1.; double f2 = 1.; for (int ii = n - m; ii > 0; ii--) - f1 *= ii; + { + f1 *= ii; + } for (int ii = n + m; ii > 0; ii--) - f2 *= (ii); + { + f2 *= (ii); + } - A_n_m(n, m) = pow(-1., double(n)) / sqrt(f1 * f2); + A_n_m(n, m) = std::pow(-1., double(n)) / std::sqrt(f1 * f2); } } return A_n_m; } - // static std::vector > > > static LocalExpansionCoeff mExp_to_lExp_Coeff_Build(FullMatrix A_n_m, unsigned int p) { - LocalExpansionCoeff loc_exp_coeff(p); - std::complex imUnit = std::complex(0., 1.); - std::vector>>> realCoeff; - realCoeff.resize(p + 1); + LocalExpansionCoeff loc_exp_coeff(p); for (int n = 0; n < int(p) + 1; n++) { - realCoeff[n].resize(n + 1); for (int m = 0; m < n + 1; m++) { - realCoeff[n][m].resize(p + 1); for (int nn = 0; nn < int(p) + 1; nn++) { for (int mm = -1 * nn; mm < nn + 1; mm++) { - // double realFact = (*gsl_matrix_ptr(A_n_m,nn,abs(mm))) / - // (*gsl_matrix_ptr(A_n_m,n+nn,abs(m-mm))) * - // (*gsl_matrix_ptr(A_n_m,n,abs(m))); - double realFact = A_n_m(nn, abs(mm)) / - A_n_m(n + nn, abs(m - mm)) * - A_n_m(n, abs(m)); - realFact *= - (pow(imUnit, double(abs(m - mm) - abs(m) - abs(mm)))) - .real() / - pow(-1., nn); - realCoeff[n][m][nn][mm] = realFact; + double realFact = A_n_m(nn, std::abs(mm)) / + A_n_m(n + nn, std::abs(m - mm)) * + A_n_m(n, std::abs(m)); + + // reference implementation + std::complex imUnit(0, 1); + int steps = std::abs(m - mm) - std::abs(m) - std::abs(mm); + realFact *= std::pow(imUnit, double(steps)).real() / + std::pow(-1., nn); + loc_exp_coeff.set(n, m, nn, mm, realFact); } } } } + return loc_exp_coeff; - // return realCoeff; } static std::vector>>> lExp_to_lExp_Coeff_Build(FullMatrix A_n_m, unsigned int p) { - std::complex imUnit = std::complex(0., 1.); std::vector>>> realCoeff; realCoeff.resize(p + 1); for (int n = 0; n < int(p) + 1; n++) @@ -194,27 +210,23 @@ class LocalExpansion { for (int mm = -1 * nn; mm < nn + 1; mm++) { - // double realFact = (*gsl_matrix_ptr(A_n_m,nn-n,abs(mm-m))) - // / (*gsl_matrix_ptr(A_n_m,nn,abs(mm))) * - // (*gsl_matrix_ptr(A_n_m,n,abs(m))); - double realFact = A_n_m(nn - n, abs(mm - m)) / - A_n_m(nn, abs(mm)) * A_n_m(n, abs(m)); - realFact *= - (pow(imUnit, double(abs(mm) - abs(mm - m) - abs(m)))) - .real() * - pow(-1., nn + n); + double realFact = A_n_m(nn - n, std::abs(mm - m)) / + A_n_m(nn, std::abs(mm)) * + A_n_m(n, std::abs(m)); + + // reference implementation + std::complex imUnit(0, 1); + int steps = std::abs(mm) - std::abs(mm - m) - std::abs(m); + realFact *= std::pow(imUnit, double(steps)).real() * + std::pow(-1., nn + n); + realCoeff[n][m][nn][mm] = realFact; } } } } - - return realCoeff; } }; - - - -#endif /*LOCALEXPANSION_H_*/ +#endif diff --git a/include/local_expansion_coeff.h b/include/local_expansion_coeff.h index 4d5499cd..c08edb5a 100644 --- a/include/local_expansion_coeff.h +++ b/include/local_expansion_coeff.h @@ -21,6 +21,7 @@ class LocalExpansionCoeff LocalExpansionCoeff(); LocalExpansionCoeff(const unsigned int &p); LocalExpansionCoeff(const LocalExpansionCoeff &orig); + double get(const unsigned int &n, const unsigned int &m, @@ -31,25 +32,25 @@ class LocalExpansionCoeff const unsigned int &m, const unsigned int &nn, const unsigned int &mm, - const double &value); + + const double &value); unsigned int getNumberOfElements(); + unsigned int getNNOffset(const unsigned int &nn); + unsigned int getMOffset(const unsigned int &m); + unsigned int getNOffset(const unsigned int &n); - virtual ~LocalExpansionCoeff(); - // Debugging and test of indexes - // static unsigned int const loopDebugger(const unsigned int & p); - // void fillCoeffWithIndex(); - // void printCoeff(); + virtual ~LocalExpansionCoeff(); private: unsigned int _p; double *_coeff; }; -#endif /* LOCALEXPANSIONCOEFF_HPP */ +#endif diff --git a/include/multipole_expansion.h b/include/multipole_expansion.h index 43f49adf..44f17630 100644 --- a/include/multipole_expansion.h +++ b/include/multipole_expansion.h @@ -27,7 +27,6 @@ using namespace dealii; - class MultipoleExpansion { public: @@ -42,9 +41,7 @@ class MultipoleExpansion mutable const AssLegFunction *assLegFunction; - mutable std::complex *_M_n_m; - - + mutable std::vector> _M_n_m; public: MultipoleExpansion(); @@ -53,27 +50,42 @@ class MultipoleExpansion const dealii::Point<3> ¢er, const AssLegFunction *assLegFunction); - MultipoleExpansion(const MultipoleExpansion &other); - - ~MultipoleExpansion(); - void Add(const MultipoleExpansion &multipole, const double sol); void Add(const double strength, const dealii::Point<3> &point); + void + Add(const double strength, + const dealii::Point<3> &point, + std::vector> &cache); + void Add(const MultipoleExpansion &child); + void + Add(const MultipoleExpansion &child, + std::vector> &cache); + void AddNormDer(const double strength, const dealii::Point<3> &point, const dealii::Tensor<1, 3> &normal); + void + AddNormDer(const double strength, + const dealii::Point<3> &point, + const dealii::Tensor<1, 3> &normal, + std::vector> &cache); + double Evaluate(const dealii::Point<3> &evalPoint); + double + Evaluate(const dealii::Point<3> &evalPoint, + std::vector> &cache); + inline dealii::Point<3> GetCenter() const { @@ -86,58 +98,74 @@ class MultipoleExpansion this->center = new_center; } - inline FullMatrix & + inline const FullMatrix & GetA_n_m() const { return this->A_n_m; } - inline std::complex * + inline const std::vector> & GetCoeffs() const { return this->_M_n_m; } - inline std::complex & + inline const std::complex & GetCoeff(unsigned int n, unsigned int m) const { return this->_M_n_m[(n) * (n + 1) / 2 + m]; } inline void - SetCoeff(unsigned int n, unsigned int m, std::complex &value) const + SetCoeff(unsigned int n, + unsigned int m, + const std::complex &value) const { this->_M_n_m[(n) * (n + 1) / 2 + m] = value; } inline void - AddToCoeff(unsigned int n, unsigned int m, std::complex &value) const + AddToCoeff(unsigned int n, + unsigned int m, + const std::complex &value) const { this->_M_n_m[(n) * (n + 1) / 2 + m] += value; } - MultipoleExpansion & - operator=(const MultipoleExpansion &other); - + static void + spherical_coords(const dealii::Point<3> ¢er, + const dealii::Point<3> &other, + dealii::Point<3> &blockRelPos, + double &rho, + double &cos_alpha, + double &beta) + { + blockRelPos = other - center; + rho = blockRelPos.norm(); + cos_alpha = blockRelPos(2) / rho; + beta = atan2(blockRelPos(1), blockRelPos(0)); + } static FullMatrix A_n_m_Matrix(unsigned int dim) { FullMatrix A_n_m(dim + 1, dim + 1); for (unsigned int n = 0; n < dim + 1; n++) - { for (unsigned int m = 0; m < n + 1; m++) - { double f1 = 1.; double f2 = 1.; for (int ii = n - m; ii > 0; ii--) - f1 *= ii; + { + f1 *= ii; + } for (int ii = n + m; ii > 0; ii--) - f2 *= (ii); + { + f2 *= (ii); + } A_n_m(n, m) = pow(-1., double(n)) / sqrt(f1 * f2); } @@ -146,7 +174,4 @@ class MultipoleExpansion return A_n_m; } }; - - - -#endif /*MULTIPOLE_EXPANSION_H_*/ +#endif diff --git a/include/octree_block.h b/include/octree_block.h index 220e4f4b..13f7affc 100644 --- a/include/octree_block.h +++ b/include/octree_block.h @@ -1,4 +1,3 @@ - // --------------------------------------------------------------------- // // Copyright (C) 2014 - 2020 by the pi-BEM authors. @@ -24,6 +23,17 @@ #include #include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + #include #include #include @@ -37,25 +47,13 @@ #include #include #include -// #include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include #include #include #include -// And here are a few C++ standard header -// files that we will need: +#include + #include #include #include @@ -63,7 +61,6 @@ #include #include - using namespace dealii; template @@ -71,22 +68,18 @@ class OctreeBlock { public: typedef typename DoFHandler::active_cell_iterator cell_it; - + using small_set = boost::container::flat_set; private: - unsigned int level; - + unsigned int level; types::global_dof_index parentId; - - unsigned int numChildren; - + unsigned int numChildren; types::global_dof_index childrenId[8]; - std::vector> nearNeigh; - - std::vector> intList; - - std::vector> nonIntList; + /// relevant entities at each level + std::vector nearNeigh; + std::vector intList; + std::vector nonIntList; Point pMin; @@ -96,7 +89,6 @@ class OctreeBlock std::map> quadPointsId; - public: OctreeBlock(); @@ -105,26 +97,19 @@ class OctreeBlock Point pMin, double delta); - OctreeBlock(const OctreeBlock &other); - - ~OctreeBlock(); - - void - CopyContent(const OctreeBlock *other); - void AddNode(types::global_dof_index nodeId); void AddQuadPoint(cell_it elemPointer, types::global_dof_index quadPointId); - std::vector + const std::vector & GetBlockNodeList() const; void DelNodeList(); - std::map> + const std::map> & GetBlockQuadPointsList() const; void @@ -151,6 +136,18 @@ class OctreeBlock double GetDelta() const; + Point + GetCenter() const + { + auto ret = this->GetPMin(); + for (unsigned int i = 0; i < dim; ++i) + { + ret(i) += this->GetDelta() / 2.; + } + + return ret; + } + void AddNearNeigh(unsigned int sublevel, const types::global_dof_index nnBlockId); @@ -160,7 +157,7 @@ class OctreeBlock unsigned int NumNearNeighLevels() const; - std::set + const small_set & GetNearNeighs(unsigned int sublevel) const; void @@ -170,13 +167,10 @@ class OctreeBlock types::global_dof_index NumIntList(unsigned int sublevel) const; - unsigned int - NumIntListLevels() const; - - std::set + const small_set & GetIntList(unsigned int sublevel) const; - std::vector> + const std::vector & GetIntList() const; void @@ -186,10 +180,7 @@ class OctreeBlock types::global_dof_index NumNonIntList(unsigned int sublevel) const; - unsigned int - NumNonIntListLevels() const; - - std::set + const small_set & GetNonIntList(unsigned int sublevel) const; void @@ -211,5 +202,4 @@ class OctreeBlock GetNonIntListSize() const; }; - #endif diff --git a/include/quasi_singular_kernel_integral.h b/include/quasi_singular_kernel_integral.h new file mode 100644 index 00000000..96bab99e --- /dev/null +++ b/include/quasi_singular_kernel_integral.h @@ -0,0 +1,95 @@ +#ifndef quasi_singular_kernel_integral_h +#define quasi_singular_kernel_integral_h + +// The most fundamental class in the library is the Triangulation class, which +// is declared here: +#include + +#include +// And this is the file in which the functions are declared that create grids: +#include + +// This file contains the description of the Lagrange interpolation finite +// element: +#include +#include + + +// And this file is needed for the creation of sparsity patterns of sparse +// matrices, as shown in previous examples: +#include + +// The next two files are needed for assembling the matrix using quadrature on +// each cell. The classes declared in them will be explained below: +#include + +#include +#include +#include +#include + +// We need the following two includes for loops over cells and/or faces: +#include +#include +// Here are some functions to generate standard grids: +#include +#include + +// Output of grids in various graphics formats: +#include + +// This is needed for C++ output: +#include +#include +// And this for the declarations of the `std::sqrt` and `std::fabs` functions: +#include + +// The final step in importing deal.II is this: All deal.II functions and +// classes are in a namespace dealii, to make sure they don't +// clash with symbols from other libraries you may want to use in conjunction +// with deal.II. One could use these functions and classes by prefixing every +// use of these names by dealii::, but that would quickly become +// cumbersome and annoying. Rather, we simply import the entire deal.II +// namespace for general use: +using namespace dealii; + +template +class QuasiSingularKernelIntegral +{ +public: + QuasiSingularKernelIntegral( + const typename DoFHandler::active_cell_iterator &in_cell, + const FiniteElement &in_fe, + const Mapping &in_mapping, + const Point &in_external_point); + + + + // Tensor<1, dim> + // evaluate_free_term_b(); + + + // std::vector> + // evaluate_VkNj_integrals(); + + + // std::vector> + // evaluate_WkNj_integrals(); + + Point + find_closest_reference_cell_point(const Point &external_point); + + Point eta; + double min_distance; + + +private: + const typename DoFHandler::active_cell_iterator &cell; + const FiniteElement &fe; + const Mapping &mapping; + // to be read from input file + unsigned int rho_quadrature_order = 4; + unsigned int theta_quadrature_order = 20; +}; + +#endif diff --git a/include/time_integrator.h b/include/time_integrator.h deleted file mode 100644 index 9e195e67..00000000 --- a/include/time_integrator.h +++ /dev/null @@ -1,99 +0,0 @@ -#ifndef __thiwi__time_integrator_h -#define __thiwi__time_integrator_h - -#include -#include -#include - -#include "ode_argument.h" - -using namespace std; -using namespace dealii; - -class TimeIntegrator -{ -public: - /** Constructor for the TimeIntegrator class. The Solver class is - * required to have a Solver.solve(Vector &dst, const - * Vector &src) method that will be called by the time - * integrator to find out about the solution to a given src. */ - TimeIntegrator(OdeArgument &solver); - - /** Declare parameters for this class to function properly. */ - static void - declare_parameters(ParameterHandler &prm); - - /** Parse a parameter handler. */ - void - parse_parameters(ParameterHandler &prm); - - /** Returns a list of implemented stepping schemes, suitable for - * use with parameter handler class. */ - static string - get_stepping_names(); - - /** Reinit the solver with different types or values (for example, - * after reading a paramter file). */ - void - initialize(); - - /** Evolve. */ - void - start_ode(const double initial_data[]); - - /** To get the output frequency from other classes using the time integrator. - */ - // inline unsigned int Output_frequency() - // {return output_frequency;} - - unsigned int output_frequency; - -private: - /** The bubble membrane poperties. */ - OdeArgument &solver; - - /** Type of time integration. RK, EI, EE. */ - const gsl_odeiv_step_type *type; - - /** Time integrator step control*/ - gsl_odeiv_step *step; - - /** Time integrator control. */ - gsl_odeiv_control *control; - - /** Evolution object.*/ - gsl_odeiv_evolve *evolution; - - /** Ode system. */ - gsl_odeiv_system system; - - /** Size of the ode system. */ - unsigned int n_dofs; - - /** Initial step size. */ - double initial_step_size; - - /** Absolute error tolerance for adaptive time stepping. */ - double abs_tol; - - /** Relative error tolerance for adaptive time stepping. */ - double rel_tol; - - /** Initial time. */ - double initial_time; - - /** Final time. */ - double final_time; - - /** Maximum number of time steps. */ - unsigned int max_n_steps; - - // /** Number of output times per second written. */ - // unsigned int output_frequency; - - /** Initialization flag.*/ - bool is_initialized; -}; - - -#endif diff --git a/include/true_constrained_matrix.h b/include/true_constrained_matrix.h index cf268476..16c4cb89 100644 --- a/include/true_constrained_matrix.h +++ b/include/true_constrained_matrix.h @@ -204,15 +204,6 @@ ConstrainedOperator::finalise(VEC &u) const { cm.distribute(u); } -// template -// void ConstrainedOperator::distribute_rhs(VEC &rhs) const -// { -// for (unsigned int i=0; i +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +// And here are a few C++ standard header +// files that we will need: + +using namespace dealii; + +// adapted from +// https://github.com/dealii/dealii/blob/master/include/deal.II/numerics/vector_tools_integrate_difference.templates.h +template +void +do_integrate_difference_based_on_material_id( + const hp::MappingCollection &mapping, + const DoFHandler &dof, + const InVector &fe_function, + // const Function &exact_solution, + const std::map *> + &exact_solutions, + OutVector &difference, + const dealii::hp::QCollection &q, + const VectorTools::NormType &norm, + const Function *weight, + const double exponent_1) +{ + using Number = typename InVector::value_type; + // we mark the "exponent" parameter to this function "const" since it is + // strictly incoming, but we need to set it to something different later + // on, if necessary, so have a read-write version of it: + double exponent = exponent_1; + + const unsigned int n_components = dof.get_fe(0).n_components(); + +#ifdef DEBUG + for (const auto &pair : exact_solutions) + { + Assert(pair.second->n_components == n_components, + ExcDimensionMismatch(pair.second->n_components, n_components)); + } +#endif + + if (weight != nullptr) + { + Assert((weight->n_components == 1) || + (weight->n_components == n_components), + ExcDimensionMismatch(weight->n_components, n_components)); + } + + difference.reinit(dof.get_triangulation().n_active_cells()); + + switch (norm) + { + case VectorTools::L2_norm: + case VectorTools::H1_seminorm: + case VectorTools::H1_norm: + case VectorTools::Hdiv_seminorm: + exponent = 2.; + break; + + case VectorTools::L1_norm: + exponent = 1.; + break; + + default: + break; + } + + UpdateFlags update_flags = + UpdateFlags(update_quadrature_points | update_JxW_values); + switch (norm) + { + case VectorTools::H1_seminorm: + case VectorTools::Hdiv_seminorm: + case VectorTools::W1p_seminorm: + case VectorTools::W1infty_seminorm: + update_flags |= UpdateFlags(update_gradients); + if (spacedim == dim + 1) + update_flags |= UpdateFlags(update_normal_vectors); + + break; + + case VectorTools::H1_norm: + case VectorTools::W1p_norm: + case VectorTools::W1infty_norm: + update_flags |= UpdateFlags(update_gradients); + if (spacedim == dim + 1) + update_flags |= UpdateFlags(update_normal_vectors); + DEAL_II_FALLTHROUGH; + + default: + update_flags |= UpdateFlags(update_values); + break; + } + + const dealii::hp::FECollection &fe_collection = + dof.get_fe_collection(); + VectorTools::internal::IDScratchData data( + mapping, fe_collection, q, update_flags); + + // loop over all cells + for (const auto &cell : dof.active_cell_iterators()) + if (cell->is_locally_owned()) + { + // initialize for this cell + data.x_fe_values.reinit(cell); + + const dealii::FEValues &fe_values = + data.x_fe_values.get_present_fe_values(); + const unsigned int n_q_points = fe_values.n_quadrature_points; + data.resize_vectors(n_q_points, n_components); + + if (update_flags & update_values) + fe_values.get_function_values(fe_function, data.function_values); + if (update_flags & update_gradients) + fe_values.get_function_gradients(fe_function, data.function_grads); + + const auto found = exact_solutions.find(cell->material_id()); + if (found != exact_solutions.end()) + { + difference(cell->active_cell_index()) = VectorTools::internal:: + integrate_difference_inner(*found->second, + norm, + weight, + update_flags, + exponent, + n_components, + data); + // std::cout << "using boundary-selected integration" << std::endl; + } + else + { + difference(cell->active_cell_index()) = 0; + // std::cout + // << "skipping cell difference due to missing function + // assignment" + // << std::endl; + } + } + else + // the cell is a ghost cell or is artificial. write a zero into the + // corresponding value of the returned vector + difference(cell->active_cell_index()) = 0; +} + +template +void +integrate_difference_based_on_material_id( + const Mapping &mapping, + const DoFHandler &dof, + const InVector &fe_function, + // const Function &exact_solution, + const std::map *> + &exact_solutions, + OutVector &difference, + const Quadrature &q, + const VectorTools::NormType &norm, + const Function *weight = nullptr, + const double exponent = 2.0) +{ + do_integrate_difference_based_on_material_id( + hp::MappingCollection(mapping), + dof, + fe_function, + exact_solutions, + difference, + hp::QCollection(q), + norm, + weight, + exponent); +} + +#endif diff --git a/samples/grids/cube2sphere.inp b/samples/grids/cube2sphere.inp new file mode 100644 index 00000000..de7cd20e --- /dev/null +++ b/samples/grids/cube2sphere.inp @@ -0,0 +1,15 @@ +8 6 0 0 0 +1 -0.577350269 -0.577350269 -0.577350269 +2 0.577350269 -0.577350269 -0.577350269 +3 -0.577350269 0.577350269 -0.577350269 +4 0.577350269 0.577350269 -0.577350269 +5 -0.577350269 -0.577350269 0.577350269 +6 0.577350269 -0.577350269 0.577350269 +7 -0.577350269 0.577350269 0.577350269 +8 0.577350269 0.577350269 0.577350269 +1 1 quad 3 4 2 1 +2 2 quad 5 6 8 7 +3 1 quad 1 2 6 5 +4 2 quad 3 7 8 4 +5 1 quad 5 7 3 1 +6 2 quad 2 4 8 6 diff --git a/samples/grids/cube2sphere_curves.inp b/samples/grids/cube2sphere_curves.inp new file mode 100644 index 00000000..c68a1452 --- /dev/null +++ b/samples/grids/cube2sphere_curves.inp @@ -0,0 +1,27 @@ +8 18 0 0 0 +1 -0.577350269 -0.577350269 -0.577350269 +2 0.577350269 -0.577350269 -0.577350269 +3 -0.577350269 0.577350269 -0.577350269 +4 0.577350269 0.577350269 -0.577350269 +5 -0.577350269 -0.577350269 0.577350269 +6 0.577350269 -0.577350269 0.577350269 +7 -0.577350269 0.577350269 0.577350269 +8 0.577350269 0.577350269 0.577350269 +1 1 quad 3 4 2 1 +2 2 quad 5 6 8 7 +3 1 quad 1 2 6 5 +4 2 quad 3 7 8 4 +5 1 quad 5 7 3 1 +6 2 quad 2 4 8 6 +7 11 line 1 5 +8 12 line 3 7 +9 13 line 2 6 +10 14 line 4 8 +11 15 line 1 3 +12 16 line 5 7 +13 17 line 2 4 +14 18 line 6 8 +15 19 line 1 2 +16 20 line 5 6 +17 21 line 3 4 +18 22 line 7 8 diff --git a/samples/grids/cube2sphere_double_nodes.inp b/samples/grids/cube2sphere_double_nodes.inp new file mode 100644 index 00000000..1d4c1964 --- /dev/null +++ b/samples/grids/cube2sphere_double_nodes.inp @@ -0,0 +1,21 @@ +14 6 0 0 0 +1 -0.577350269 -0.577350269 -0.577350269 +2 0.577350269 -0.577350269 -0.577350269 +3 -0.577350269 0.577350269 -0.577350269 +4 0.577350269 0.577350269 -0.577350269 +5 -0.577350269 -0.577350269 0.577350269 +6 0.577350269 -0.577350269 0.577350269 +7 -0.577350269 0.577350269 0.577350269 +8 0.577350269 -0.577350269 -0.577350269 +9 -0.577350269 0.577350269 -0.577350269 +10 0.577350269 0.577350269 -0.577350269 +11 -0.577350269 -0.577350269 0.577350269 +12 0.577350269 -0.577350269 0.577350269 +13 -0.577350269 0.577350269 0.577350269 +14 0.577350269 0.577350269 0.577350269 +1 1 quad 3 4 2 1 +2 2 quad 11 12 14 13 +3 1 quad 1 2 6 5 +4 2 quad 9 13 14 10 +5 1 quad 5 7 3 1 +6 2 quad 8 10 14 12 diff --git a/samples/grids/cube2sphere_double_nodes_curves.inp b/samples/grids/cube2sphere_double_nodes_curves.inp new file mode 100644 index 00000000..8bb7d4db --- /dev/null +++ b/samples/grids/cube2sphere_double_nodes_curves.inp @@ -0,0 +1,33 @@ +14 18 0 0 0 +1 -0.577350269 -0.577350269 -0.577350269 +2 0.577350269 -0.577350269 -0.577350269 +3 -0.577350269 0.577350269 -0.577350269 +4 0.577350269 0.577350269 -0.577350269 +5 -0.577350269 -0.577350269 0.577350269 +6 0.577350269 -0.577350269 0.577350269 +7 -0.577350269 0.577350269 0.577350269 +8 0.577350269 -0.577350269 -0.577350269 +9 -0.577350269 0.577350269 -0.577350269 +10 0.577350269 0.577350269 -0.577350269 +11 -0.577350269 -0.577350269 0.577350269 +12 0.577350269 -0.577350269 0.577350269 +13 -0.577350269 0.577350269 0.577350269 +14 0.577350269 0.577350269 0.577350269 +1 1 quad 3 4 2 1 +2 2 quad 11 12 14 13 +3 1 quad 1 2 6 5 +4 2 quad 9 13 14 10 +5 1 quad 5 7 3 1 +6 2 quad 8 10 14 12 +7 11 line 1 5 +8 12 line 3 7 +9 13 line 2 6 +10 14 line 10 14 +11 15 line 1 3 +12 16 line 5 7 +13 17 line 4 2 +14 18 line 12 14 +15 19 line 1 2 +16 20 line 11 12 +17 21 line 9 10 +18 22 line 13 14 diff --git a/samples/grids/cube2sphere_iges/Color_1.iges b/samples/grids/cube2sphere_iges/Color_1.iges new file mode 100644 index 00000000..1b82316a --- /dev/null +++ b/samples/grids/cube2sphere_iges/Color_1.iges @@ -0,0 +1,55 @@ + S0000001 +,,31HOpen CASCADE IGES processor 7.4,13HFilename.iges, G0000001 +16HOpen CASCADE 7.4,31HOpen CASCADE IGES processor 7.4,32,308,15,308,15,G0000002 +,1.,6,1HM,1,0.00001,15H20210726.085854,1E-07,1.00544,6Hyaevon,,11,0, G0000003 +15H20210726.085854,; G0000004 + 144 1 0 0 0 0 0 000000000D0000001 + 144 0 0 1 0 0D0000002 + 120 2 0 0 0 0 5 000010000D0000003 + 120 0 0 1 0 0D0000004 + 124 3 0 0 0 0 0 000000000D0000005 + 124 0 0 2 0 0D0000006 + 110 5 0 0 0 0 0 000010000D0000007 + 110 0 0 1 0 0D0000008 + 100 6 0 0 0 0 11 000010000D0000009 + 100 0 0 1 0 0D0000010 + 124 7 0 0 0 0 0 000000000D0000011 + 124 0 0 1 0 0D0000012 + 142 8 0 0 0 0 0 000010500D0000013 + 142 0 0 1 0 0D0000014 + 102 9 0 0 0 0 0 000010000D0000015 + 102 0 0 1 0 0D0000016 + 110 10 0 0 0 0 0 000010000D0000017 + 110 0 0 1 0 0D0000018 + 110 11 0 0 0 0 0 000010000D0000019 + 110 0 0 2 0 0D0000020 + 102 13 0 0 0 0 0 000010000D0000021 + 102 0 0 1 0 0D0000022 + 100 14 0 0 0 0 25 000010000D0000023 + 100 0 0 1 0 0D0000024 + 124 15 0 0 0 0 0 000000000D0000025 + 124 0 0 2 0 0D0000026 + 100 17 0 0 0 0 29 000010000D0000027 + 100 0 0 1 0 0D0000028 + 124 18 0 0 0 0 0 000000000D0000029 + 124 0 0 2 0 0D0000030 +144,3,1,0,13; 0000001P0000001 +120,7,9,0.,6.283185307; 0000003P0000002 +124,0.707106781,0.5,0.5,0.,0.,0.707106781,-0.707106781,0., 0000005P0000003 +-0.707106781,0.5,0.5,0.; 0000005P0000004 +110,0.,0.,1.,0.,0.,0.; 0000007P0000005 +100,0.,0.,0.,6.123233996E-17,-1.,6.123233996E-17,1.; 0000009P0000006 +124,1.,0.,0.,0.,0.,0.,-1.,0.,0.,1.,-0.,0.; 0000011P0000007 +142,0,3,15,21,3; 0000013P0000008 +102,2,17,19; 0000015P0000009 +110,1.570796327,6.283185307,0.,-1.570796327,6.283185307,0.; 0000017P0000010 +110,-1.570796327,1.046360549E-15,0.,1.570796327,1.743934249E-15, 0000019P0000011 +0.; 0000019P0000012 +102,2,23,27; 0000021P0000013 +100,0.,0.,0.,5.551115123E-17,-1.,0.,1.; 0000023P0000014 +124,0.707106781,-0.5,0.5,0.,-2.220446049E-16,0.707106781, 0000025P0000015 +0.707106781,0.,-0.707106781,-0.5,0.5,0.; 0000025P0000016 +100,0.,0.,0.,-1.110223025E-16,-1.,2.775557562E-16,1.; 0000027P0000017 +124,0.707106781,0.5,-0.5,0.,-1.731912112E-16,-0.707106781, 0000029P0000018 +-0.707106781,0.,-0.707106781,0.5,-0.5,0.; 0000029P0000019 +S 1G 4D 30P 19 T0000001 diff --git a/samples/grids/cube2sphere_iges/Color_2.iges b/samples/grids/cube2sphere_iges/Color_2.iges new file mode 100644 index 00000000..0cb54277 --- /dev/null +++ b/samples/grids/cube2sphere_iges/Color_2.iges @@ -0,0 +1,55 @@ + S0000001 +,,31HOpen CASCADE IGES processor 7.4,13HFilename.iges, G0000001 +16HOpen CASCADE 7.4,31HOpen CASCADE IGES processor 7.4,32,308,15,308,15,G0000002 +,1.,6,1HM,1,0.01,15H20210726.085854,1E-07,1.00544,6Hyaevon,,11,0, G0000003 +15H20210726.085854,; G0000004 + 144 1 0 0 0 0 0 000000000D0000001 + 144 0 0 1 0 0D0000002 + 120 2 0 0 0 0 5 000010000D0000003 + 120 0 0 1 0 0D0000004 + 124 3 0 0 0 0 0 000000000D0000005 + 124 0 0 2 0 0D0000006 + 110 5 0 0 0 0 0 000010000D0000007 + 110 0 0 1 0 0D0000008 + 100 6 0 0 0 0 11 000010000D0000009 + 100 0 0 1 0 0D0000010 + 124 7 0 0 0 0 0 000000000D0000011 + 124 0 0 1 0 0D0000012 + 142 8 0 0 0 0 0 000010500D0000013 + 142 0 0 1 0 0D0000014 + 102 9 0 0 0 0 0 000010000D0000015 + 102 0 0 1 0 0D0000016 + 110 10 0 0 0 0 0 000010000D0000017 + 110 0 0 1 0 0D0000018 + 110 11 0 0 0 0 0 000010000D0000019 + 110 0 0 2 0 0D0000020 + 102 13 0 0 0 0 0 000010000D0000021 + 102 0 0 1 0 0D0000022 + 100 14 0 0 0 0 25 000010000D0000023 + 100 0 0 1 0 0D0000024 + 124 15 0 0 0 0 0 000000000D0000025 + 124 0 0 2 0 0D0000026 + 100 17 0 0 0 0 29 000010000D0000027 + 100 0 0 1 0 0D0000028 + 124 18 0 0 0 0 0 000000000D0000029 + 124 0 0 2 0 0D0000030 +144,3,1,0,13; 0000001P0000001 +120,7,9,0.,6.283185307; 0000003P0000002 +124,0.707106781,0.5,0.5,0.,0.,0.707106781,-0.707106781,0., 0000005P0000003 +-0.707106781,0.5,0.5,0.; 0000005P0000004 +110,0.,0.,1.,0.,0.,0.; 0000007P0000005 +100,0.,0.,0.,6.123233996E-17,-1.,6.123233996E-17,1.; 0000009P0000006 +124,1.,0.,0.,0.,0.,0.,-1.,0.,0.,1.,-0.,0.; 0000011P0000007 +142,0,3,15,21,3; 0000013P0000008 +102,2,17,19; 0000015P0000009 +110,1.570796327,6.283185307,0.,-1.570796327,6.283185307,0.; 0000017P0000010 +110,-1.570796327,1.046360549E-15,0.,1.570796327,1.743934249E-15, 0000019P0000011 +0.; 0000019P0000012 +102,2,23,27; 0000021P0000013 +100,0.,0.,0.,5.551115123E-17,-1.,0.,1.; 0000023P0000014 +124,0.707106781,-0.5,0.5,0.,-2.220446049E-16,0.707106781, 0000025P0000015 +0.707106781,0.,-0.707106781,-0.5,0.5,0.; 0000025P0000016 +100,0.,0.,0.,-1.110223025E-16,-1.,2.775557562E-16,1.; 0000027P0000017 +124,0.707106781,0.5,-0.5,0.,-1.731912112E-16,-0.707106781, 0000029P0000018 +-0.707106781,0.,-0.707106781,0.5,-0.5,0.; 0000029P0000019 +S 1G 4D 30P 19 T0000001 diff --git a/samples/grids/cube2sphere_iges/Curve_1.iges b/samples/grids/cube2sphere_iges/Curve_1.iges new file mode 100644 index 00000000..3eac9b15 --- /dev/null +++ b/samples/grids/cube2sphere_iges/Curve_1.iges @@ -0,0 +1,13 @@ + S0000001 +,,31HOpen CASCADE IGES processor 7.4,13HFilename.iges, G0000001 +16HOpen CASCADE 7.4,31HOpen CASCADE IGES processor 7.4,32,308,15,308,15,G0000002 +,1.,6,1HM,1,0.01,15H20210725.221311,1E-07,0.711725,6Hyaevon,,11,0, G0000003 +15H20210725.221311,; G0000004 + 100 1 0 0 0 0 3 000000000D0000001 + 100 0 0 1 0 0D0000002 + 124 2 0 0 0 0 0 000000000D0000003 + 124 0 0 2 0 0D0000004 +100,0.,0.,0.,-0.8164962,0.57735,-0.8164962,-0.57735; 0000001P0000001 +124,0.707106781,0.,-0.707106781,0.,0.707106781,0.,0.707106781, 0000003P0000002 +0.,0.,-1.,0.,0.; 0000003P0000003 +S 1G 4D 4P 3 T0000001 diff --git a/samples/grids/cube2sphere_iges/Curve_10.iges b/samples/grids/cube2sphere_iges/Curve_10.iges new file mode 100644 index 00000000..f62174de --- /dev/null +++ b/samples/grids/cube2sphere_iges/Curve_10.iges @@ -0,0 +1,13 @@ + S0000001 +,,31HOpen CASCADE IGES processor 7.4,13HFilename.iges, G0000001 +16HOpen CASCADE 7.4,31HOpen CASCADE IGES processor 7.4,32,308,15,308,15,G0000002 +,1.,6,1HM,1,0.01,15H20210725.221311,1E-07,0.711725,6Hyaevon,,11,0, G0000003 +15H20210725.221311,; G0000004 + 100 1 0 0 0 0 3 000000000D0000001 + 100 0 0 1 0 0D0000002 + 124 2 0 0 0 0 0 000000000D0000003 + 124 0 0 2 0 0D0000004 +100,0.,0.,0.,-0.8164962,0.57735,-0.8164962,-0.57735; 0000001P0000001 +124,0.,-1.,0.,0.,0.707106781,0.,0.707106781,0.,-0.707106781,0., 0000003P0000002 +0.707106781,0.; 0000003P0000003 +S 1G 4D 4P 3 T0000001 diff --git a/samples/grids/cube2sphere_iges/Curve_11.iges b/samples/grids/cube2sphere_iges/Curve_11.iges new file mode 100644 index 00000000..d8d1464a --- /dev/null +++ b/samples/grids/cube2sphere_iges/Curve_11.iges @@ -0,0 +1,13 @@ + S0000001 +,,31HOpen CASCADE IGES processor 7.4,13HFilename.iges, G0000001 +16HOpen CASCADE 7.4,31HOpen CASCADE IGES processor 7.4,32,308,15,308,15,G0000002 +,1.,6,1HM,1,0.01,15H20210725.221311,1E-07,0.711725,6Hyaevon,,11,0, G0000003 +15H20210725.221311,; G0000004 + 100 1 0 0 0 0 3 000000000D0000001 + 100 0 0 1 0 0D0000002 + 124 2 0 0 0 0 0 000000000D0000003 + 124 0 0 2 0 0D0000004 +100,0.,0.,0.,-0.8164962,0.57735,-0.8164962,-0.57735; 0000001P0000001 +124,0.,-1.,0.,0.,-0.707106781,0.,-0.707106781,0.,0.707106781,0., 0000003P0000002 +-0.707106781,0.; 0000003P0000003 +S 1G 4D 4P 3 T0000001 diff --git a/samples/grids/cube2sphere_iges/Curve_12.iges b/samples/grids/cube2sphere_iges/Curve_12.iges new file mode 100644 index 00000000..3fc590f1 --- /dev/null +++ b/samples/grids/cube2sphere_iges/Curve_12.iges @@ -0,0 +1,13 @@ + S0000001 +,,31HOpen CASCADE IGES processor 7.4,13HFilename.iges, G0000001 +16HOpen CASCADE 7.4,31HOpen CASCADE IGES processor 7.4,32,308,15,308,15,G0000002 +,1.,6,1HM,1,0.01,15H20210725.221311,1E-07,0.711725,6Hyaevon,,11,0, G0000003 +15H20210725.221311,; G0000004 + 100 1 0 0 0 0 3 000000000D0000001 + 100 0 0 1 0 0D0000002 + 124 2 0 0 0 0 0 000000000D0000003 + 124 0 0 2 0 0D0000004 +100,0.,0.,0.,-0.8164962,0.57735,-0.8164962,-0.57735; 0000001P0000001 +124,0.,-1.,0.,0.,-0.707106781,0.,0.707106781,0.,-0.707106781,0., 0000003P0000002 +-0.707106781,0.; 0000003P0000003 +S 1G 4D 4P 3 T0000001 diff --git a/samples/grids/cube2sphere_iges/Curve_2.iges b/samples/grids/cube2sphere_iges/Curve_2.iges new file mode 100644 index 00000000..21cc3938 --- /dev/null +++ b/samples/grids/cube2sphere_iges/Curve_2.iges @@ -0,0 +1,13 @@ + S0000001 +,,31HOpen CASCADE IGES processor 7.4,13HFilename.iges, G0000001 +16HOpen CASCADE 7.4,31HOpen CASCADE IGES processor 7.4,32,308,15,308,15,G0000002 +,1.,6,1HM,1,0.01,15H20210725.221311,1E-07,0.711725,6Hyaevon,,11,0, G0000003 +15H20210725.221311,; G0000004 + 100 1 0 0 0 0 3 000000000D0000001 + 100 0 0 1 0 0D0000002 + 124 2 0 0 0 0 0 000000000D0000003 + 124 0 0 2 0 0D0000004 +100,0.,0.,0.,-0.8164962,0.57735,-0.8164962,-0.57735; 0000001P0000001 +124,0.707106781,0.,0.707106781,0.,-0.707106781,0.,0.707106781, 0000003P0000002 +0.,0.,-1.,0.,0.; 0000003P0000003 +S 1G 4D 4P 3 T0000001 diff --git a/samples/grids/cube2sphere_iges/Curve_3.iges b/samples/grids/cube2sphere_iges/Curve_3.iges new file mode 100644 index 00000000..f00e03b0 --- /dev/null +++ b/samples/grids/cube2sphere_iges/Curve_3.iges @@ -0,0 +1,13 @@ + S0000001 +,,31HOpen CASCADE IGES processor 7.4,13HFilename.iges, G0000001 +16HOpen CASCADE 7.4,31HOpen CASCADE IGES processor 7.4,32,308,15,308,15,G0000002 +,1.,6,1HM,1,0.01,15H20210725.221311,1E-07,0.711725,6Hyaevon,,11,0, G0000003 +15H20210725.221311,; G0000004 + 100 1 0 0 0 0 3 000000000D0000001 + 100 0 0 1 0 0D0000002 + 124 2 0 0 0 0 0 000000000D0000003 + 124 0 0 2 0 0D0000004 +100,0.,0.,0.,-0.8164962,0.57735,-0.8164962,-0.57735; 0000001P0000001 +124,-0.707106781,0.,-0.707106781,0.,0.707106781,0.,-0.707106781, 0000003P0000002 +0.,0.,-1.,0.,0.; 0000003P0000003 +S 1G 4D 4P 3 T0000001 diff --git a/samples/grids/cube2sphere_iges/Curve_4.iges b/samples/grids/cube2sphere_iges/Curve_4.iges new file mode 100644 index 00000000..a7c56494 --- /dev/null +++ b/samples/grids/cube2sphere_iges/Curve_4.iges @@ -0,0 +1,13 @@ + S0000001 +,,31HOpen CASCADE IGES processor 7.4,13HFilename.iges, G0000001 +16HOpen CASCADE 7.4,31HOpen CASCADE IGES processor 7.4,32,308,15,308,15,G0000002 +,1.,6,1HM,1,0.01,15H20210725.221311,1E-07,0.711725,6Hyaevon,,11,0, G0000003 +15H20210725.221311,; G0000004 + 100 1 0 0 0 0 3 000000000D0000001 + 100 0 0 1 0 0D0000002 + 124 2 0 0 0 0 0 000000000D0000003 + 124 0 0 2 0 0D0000004 +100,0.,0.,0.,-0.8164962,0.57735,-0.8164962,-0.57735; 0000001P0000001 +124,-0.707106781,0.,0.707106781,0.,-0.707106781,-0., 0000003P0000002 +-0.707106781,0.,0.,-1.,0.,0.; 0000003P0000003 +S 1G 4D 4P 3 T0000001 diff --git a/samples/grids/cube2sphere_iges/Curve_5.iges b/samples/grids/cube2sphere_iges/Curve_5.iges new file mode 100644 index 00000000..e8a0f035 --- /dev/null +++ b/samples/grids/cube2sphere_iges/Curve_5.iges @@ -0,0 +1,13 @@ + S0000001 +,,31HOpen CASCADE IGES processor 7.4,13HFilename.iges, G0000001 +16HOpen CASCADE 7.4,31HOpen CASCADE IGES processor 7.4,32,308,15,308,15,G0000002 +,1.,6,1HM,1,0.01,15H20210725.221311,1E-07,0.711725,6Hyaevon,,11,0, G0000003 +15H20210725.221311,; G0000004 + 100 1 0 0 0 0 3 000000000D0000001 + 100 0 0 1 0 0D0000002 + 124 2 0 0 0 0 0 000000000D0000003 + 124 0 0 2 0 0D0000004 +100,0.,0.,0.,0.8164962,-0.57735,0.8164962,0.57735; 0000001P0000001 +124,-0.707106781,0.,0.707106781,0.,0.,1.,0.,0.,-0.707106781,0., 0000003P0000002 +-0.707106781,0.; 0000003P0000003 +S 1G 4D 4P 3 T0000001 diff --git a/samples/grids/cube2sphere_iges/Curve_6.iges b/samples/grids/cube2sphere_iges/Curve_6.iges new file mode 100644 index 00000000..a52bfc8b --- /dev/null +++ b/samples/grids/cube2sphere_iges/Curve_6.iges @@ -0,0 +1,13 @@ + S0000001 +,,31HOpen CASCADE IGES processor 7.4,13HFilename.iges, G0000001 +16HOpen CASCADE 7.4,31HOpen CASCADE IGES processor 7.4,32,308,15,308,15,G0000002 +,1.,6,1HM,1,0.01,15H20210725.221311,1E-07,0.711725,6Hyaevon,,11,0, G0000003 +15H20210725.221311,; G0000004 + 100 1 0 0 0 0 3 000000000D0000001 + 100 0 0 1 0 0D0000002 + 124 2 0 0 0 0 0 000000000D0000003 + 124 0 0 2 0 0D0000004 +100,0.,0.,0.,0.8164962,-0.57735,0.8164962,0.57735; 0000001P0000001 +124,-0.707106781,0.,-0.707106781,0.,0.,1.,0.,0.,0.707106781,0., 0000003P0000002 +-0.707106781,0.; 0000003P0000003 +S 1G 4D 4P 3 T0000001 diff --git a/samples/grids/cube2sphere_iges/Curve_7.iges b/samples/grids/cube2sphere_iges/Curve_7.iges new file mode 100644 index 00000000..b490d706 --- /dev/null +++ b/samples/grids/cube2sphere_iges/Curve_7.iges @@ -0,0 +1,13 @@ + S0000001 +,,31HOpen CASCADE IGES processor 7.4,13HFilename.iges, G0000001 +16HOpen CASCADE 7.4,31HOpen CASCADE IGES processor 7.4,32,308,15,308,15,G0000002 +,1.,6,1HM,1,0.01,15H20210725.221311,1E-07,0.711725,6Hyaevon,,11,0, G0000003 +15H20210725.221311,; G0000004 + 100 1 0 0 0 0 3 000000000D0000001 + 100 0 0 1 0 0D0000002 + 124 2 0 0 0 0 0 000000000D0000003 + 124 0 0 2 0 0D0000004 +100,0.,0.,0.,-0.8164962,0.57735,-0.8164962,-0.57735; 0000001P0000001 +124,-0.707106781,0.,-0.707106781,0.,0.,1.,0.,0.,0.707106781,0., 0000003P0000002 +-0.707106781,0.; 0000003P0000003 +S 1G 4D 4P 3 T0000001 diff --git a/samples/grids/cube2sphere_iges/Curve_8.iges b/samples/grids/cube2sphere_iges/Curve_8.iges new file mode 100644 index 00000000..72429012 --- /dev/null +++ b/samples/grids/cube2sphere_iges/Curve_8.iges @@ -0,0 +1,13 @@ + S0000001 +,,31HOpen CASCADE IGES processor 7.4,13HFilename.iges, G0000001 +16HOpen CASCADE 7.4,31HOpen CASCADE IGES processor 7.4,32,308,15,308,15,G0000002 +,1.,6,1HM,1,0.01,15H20210725.221311,1E-07,0.711725,6Hyaevon,,11,0, G0000003 +15H20210725.221311,; G0000004 + 100 1 0 0 0 0 3 000000000D0000001 + 100 0 0 1 0 0D0000002 + 124 2 0 0 0 0 0 000000000D0000003 + 124 0 0 2 0 0D0000004 +100,0.,0.,0.,0.8164962,-0.57735,0.8164962,0.57735; 0000001P0000001 +124,0.707106781,0.,-0.707106781,0.,0.,1.,0.,0.,0.707106781,0., 0000003P0000002 +0.707106781,0.; 0000003P0000003 +S 1G 4D 4P 3 T0000001 diff --git a/samples/grids/cube2sphere_iges/Curve_9.iges b/samples/grids/cube2sphere_iges/Curve_9.iges new file mode 100644 index 00000000..7f5c2bcf --- /dev/null +++ b/samples/grids/cube2sphere_iges/Curve_9.iges @@ -0,0 +1,13 @@ + S0000001 +,,31HOpen CASCADE IGES processor 7.4,13HFilename.iges, G0000001 +16HOpen CASCADE 7.4,31HOpen CASCADE IGES processor 7.4,32,308,15,308,15,G0000002 +,1.,6,1HM,1,0.01,15H20210725.221311,1E-07,0.711725,6Hyaevon,,11,0, G0000003 +15H20210725.221311,; G0000004 + 100 1 0 0 0 0 3 000000000D0000001 + 100 0 0 1 0 0D0000002 + 124 2 0 0 0 0 0 000000000D0000003 + 124 0 0 2 0 0D0000004 +100,0.,0.,0.,-0.8164962,0.57735,-0.8164962,-0.57735; 0000001P0000001 +124,0.,-1.,0.,0.,0.707106781,0.,-0.707106781,0.,0.707106781,0., 0000003P0000002 +0.707106781,0.; 0000003P0000003 +S 1G 4D 4P 3 T0000001 diff --git a/samples/ref_params_sphere_complex.prm b/samples/ref_params_sphere_complex.prm new file mode 100644 index 00000000..d10c663b --- /dev/null +++ b/samples/ref_params_sphere_complex.prm @@ -0,0 +1,164 @@ +# Listing of Parameters +# --------------------- +subsection BEMFMA<3> + subsection FMA Params + set FMA Truncation Order = 6 + set Granularity for TBB simple for cycles = 10 + end + subsection Octree Params + set Maximum Number of Collocation Points per Childless Block = 20 + set Number of Octree Levels = 10 + end +end + + +subsection BEMProblem<3> + set Continuos gradient across edges = true + set Mapping Q Degree = 1 + set Mapping Type = FE + set Preconditioner = ILU + set Solution method = Direct + + subsection Quadrature rules + set Quadrature order = 4 + set Quadrature type = gauss + set Singular quadrature order = 5 + end + + subsection Solver + set Log frequency = 1 + set Log history = false + set Log result = true + set Max steps = 1000 + set Tolerance = 1.e-10 + end + + subsection Scalar Finite Element + set Finite Element type = FEQ + set Finite element order = 1 + end + + + subsection Vector Finite Element + set Finite Element type = FEQ + set Finite element order = 1 + end + +end + +subsection BoundaryConditions<3> + set Output file name = result + + subsection Potential 0 0 3d + set Function constants = + set Function expression = x+y+z+2 + set Variable names = x,y,z,t + end + + subsection Potential 0 1 3d + set Function constants = + set Function expression = x+y+z + set Variable names = x,y,z,t + end + + subsection Wind function 0 0 3d + set Function constants = + set Function expression = 1; 1; 1 + set Variable names = x,y,z,t + end + + subsection Wind function 0 1 3d + set Function constants = + set Function expression = 1; 1; 1 + set Variable names = x,y,z,t + end + + subsection Robin coefficients 0 0 3d + set Function constants = + set Function expression = 1/(2*(x+y+z+2)); 1; x+y+z+1 + set Variable names = x,y,z,t + end + + subsection Robin coefficients 0 1 3d + set Function constants = + set Function expression = 1/(2*(x+y+z+2)); 1; x+y+z+1 + set Variable names = x,y,z,t + end + + subsection Potential 1 0 3d + set Function constants = + set Function expression = -x-y-z-2 + set Variable names = x,y,z,t + end + + subsection Potential 1 1 3d + set Function constants = + set Function expression = -x-y-z-2 + set Variable names = x,y,z,t + end + + subsection Wind function 1 0 3d + set Function constants = + set Function expression = -1; -1; -1 + set Variable names = x,y,z,t + end + + subsection Wind function 1 1 3d + set Function constants = + set Function expression = -1; -1; -1 + set Variable names = x,y,z,t + end + + subsection Robin coefficients 1 0 3d + set Function constants = + set Function expression = 1/(2*(x+y+z+2)); 0; -x-y-z + set Variable names = x,y,z,t + end + + subsection Robin coefficients 1 1 3d + set Function constants = + set Function expression = 1/(2*(x+y+z+2)); 0; -x-y-z + set Variable names = x,y,z,t + end +end + + +subsection ComputationalDomain<3> + set Axis x dimension = 1. + set Axis y dimension = 1. + set Axis z dimension = 1. + set Cad tolerance to projectors tolerance ratio = 100 + set Cells per circle = 12 + set Input grid format = inp + set Input grid name = grids/cube2sphere_curves + set Input path to CAD files = grids/cube2sphere_iges/ + set Max aspect ratio = 3.5 + set Maximum number of curvature adaptive refinement cycles = 2 + set Number of cycles = 0 + set Number of global refinement to be executed before local refinement cycle = 0 + set Surface curvature adaptive refinement = true + set Use a spheroid = false + set Use iges surfaces and curves = true + + + subsection Boundary Conditions ID Numbers + set Dirichlet boundary ids = 1 + set Neumann boundary ids = 2 + set Robin boundary ids = + + # For each manifold, specify the boundary condition slot identifying the + # function to be used + set Manifold to boundary slot map = 0,0, 1,0, 2,0 + end + +end + + +subsection Driver<3> + set Potential components = 2 + set Set Global Refinement = true + set Complex components = 0 +end + + + diff --git a/samples/ref_params_sphere_complex_DN_direct.prm b/samples/ref_params_sphere_complex_DN_direct.prm new file mode 100644 index 00000000..4e418b72 --- /dev/null +++ b/samples/ref_params_sphere_complex_DN_direct.prm @@ -0,0 +1,162 @@ +subsection BEMFMA<3> + subsection FMA Params + set FMA Truncation Order = 6 + set Granularity for TBB simple for cycles = 10 + end + subsection Octree Params + set Maximum Number of Collocation Points per Childless Block = 20 + set Number of Octree Levels = 10 + end +end + + +subsection BEMProblem<3> + set Continuos gradient across edges = true + set Mapping Q Degree = 1 + set Mapping Type = FE + set Preconditioner = ILU + set Solution method = Direct + + subsection Quadrature rules + set Quadrature order = 4 + set Quadrature type = gauss + set Singular quadrature order = 5 + end + + subsection Solver + set Log frequency = 1 + set Log history = false + set Log result = true + set Max steps = 1000 + set Tolerance = 1.e-10 + end + + subsection Scalar Finite Element + set Finite Element type = FEQ + set Finite element order = 1 + end + + + subsection Vector Finite Element + set Finite Element type = FEQ + set Finite element order = 1 + end + +end + +subsection BoundaryConditions<3> + set Output file name = result + + subsection Potential 0 0 3d + set Function constants = + set Function expression = x+y+z+2 + set Variable names = x,y,z,t + end + + subsection Potential 0 1 3d + set Function constants = + set Function expression = x+y+z + set Variable names = x,y,z,t + end + + subsection Wind function 0 0 3d + set Function constants = + set Function expression = 1; 1; 1 + set Variable names = x,y,z,t + end + + subsection Wind function 0 1 3d + set Function constants = + set Function expression = 1; 1; 1 + set Variable names = x,y,z,t + end + + subsection Robin coefficients 0 0 3d + set Function constants = + set Function expression = 1/(2*(x+y+z+2)); 1; x+y+z+1 + set Variable names = x,y,z,t + end + + subsection Robin coefficients 0 1 3d + set Function constants = + set Function expression = 1/(2*(x+y+z+2)); 1; x+y+z+1 + set Variable names = x,y,z,t + end + + subsection Potential 1 0 3d + set Function constants = + set Function expression = -x-y-z-2 + set Variable names = x,y,z,t + end + + subsection Potential 1 1 3d + set Function constants = + set Function expression = -x-y-z-2 + set Variable names = x,y,z,t + end + + subsection Wind function 1 0 3d + set Function constants = + set Function expression = -1; -1; -1 + set Variable names = x,y,z,t + end + + subsection Wind function 1 1 3d + set Function constants = + set Function expression = -1; -1; -1 + set Variable names = x,y,z,t + end + + subsection Robin coefficients 1 0 3d + set Function constants = + set Function expression = 1/(2*(x+y+z+2)); 0; -x-y-z + set Variable names = x,y,z,t + end + + subsection Robin coefficients 1 1 3d + set Function constants = + set Function expression = 1/(2*(x+y+z+2)); 0; -x-y-z + set Variable names = x,y,z,t + end +end + + +subsection ComputationalDomain<3> + set Axis x dimension = 1. + set Axis y dimension = 1. + set Axis z dimension = 1. + set Cad tolerance to projectors tolerance ratio = 100 + set Cells per circle = 12 + set Input grid format = inp + set Input grid name = grids/cube2sphere_curves + set Input path to CAD files = grids/cube2sphere_iges/ + set Max aspect ratio = 3.5 + set Maximum number of curvature adaptive refinement cycles = 2 + set Number of cycles = 0 + set Number of global refinement to be executed before local refinement cycle = 0 + set Surface curvature adaptive refinement = true + set Use a spheroid = false + set Use iges surfaces and curves = true + + + subsection Boundary Conditions ID Numbers + set Dirichlet boundary ids = 1 + set Neumann boundary ids = 2 + set Robin boundary ids = + + # For each manifold, specify the boundary condition slot identifying the + # function to be used + set Manifold to boundary slot map = 0,0, 1,0, 2,0 + end + +end + + +subsection Driver<3> + set Potential components = 2 + set Set Global Refinement = true + set Complex components = 0 +end + + + diff --git a/samples/ref_params_sphere_complex_DN_fma.prm b/samples/ref_params_sphere_complex_DN_fma.prm new file mode 100644 index 00000000..22185270 --- /dev/null +++ b/samples/ref_params_sphere_complex_DN_fma.prm @@ -0,0 +1,163 @@ +# Listing of Parameters +# --------------------- +subsection BEMFMA<3> + subsection FMA Params + set FMA Truncation Order = 6 + set Granularity for TBB simple for cycles = 10 + end + subsection Octree Params + set Maximum Number of Collocation Points per Childless Block = 20 + set Number of Octree Levels = 10 + end +end + + +subsection BEMProblem<3> + set Continuos gradient across edges = true + set Mapping Q Degree = 1 + set Mapping Type = FE + set Preconditioner = ILU + set Solution method = FMA + + subsection Quadrature rules + set Quadrature order = 4 + set Quadrature type = gauss + set Singular quadrature order = 5 + end + + subsection Solver + set Log frequency = 1 + set Log history = false + set Log result = true + set Max steps = 1000 + set Tolerance = 1.e-10 + end + + subsection Scalar Finite Element + set Finite Element type = FEQ + set Finite element order = 1 + end + + + subsection Vector Finite Element + set Finite Element type = FEQ + set Finite element order = 1 + end + +end + +subsection BoundaryConditions<3> + set Output file name = result + + subsection Potential 0 0 3d + set Function constants = + set Function expression = x+y+z+2 + set Variable names = x,y,z,t + end + + subsection Potential 0 1 3d + set Function constants = + set Function expression = x+y+z + set Variable names = x,y,z,t + end + + subsection Wind function 0 0 3d + set Function constants = + set Function expression = 1; 1; 1 + set Variable names = x,y,z,t + end + + subsection Wind function 0 1 3d + set Function constants = + set Function expression = 1; 1; 1 + set Variable names = x,y,z,t + end + + subsection Robin coefficients 0 0 3d + set Function constants = + set Function expression = 1/(2*(x+y+z+2)); 1; x+y+z+1 + set Variable names = x,y,z,t + end + + subsection Robin coefficients 0 1 3d + set Function constants = + set Function expression = 1/(2*(x+y+z+2)); 1; x+y+z+1 + set Variable names = x,y,z,t + end + + subsection Potential 1 0 3d + set Function constants = + set Function expression = -x-y-z-2 + set Variable names = x,y,z,t + end + + subsection Potential 1 1 3d + set Function constants = + set Function expression = -x-y-z-2 + set Variable names = x,y,z,t + end + + subsection Wind function 1 0 3d + set Function constants = + set Function expression = -1; -1; -1 + set Variable names = x,y,z,t + end + + subsection Wind function 1 1 3d + set Function constants = + set Function expression = -1; -1; -1 + set Variable names = x,y,z,t + end + + subsection Robin coefficients 1 0 3d + set Function constants = + set Function expression = 1/(2*(x+y+z+2)); 0; -x-y-z + set Variable names = x,y,z,t + end + + subsection Robin coefficients 1 1 3d + set Function constants = + set Function expression = 1/(2*(x+y+z+2)); 0; -x-y-z + set Variable names = x,y,z,t + end +end + + +subsection ComputationalDomain<3> + set Axis x dimension = 1. + set Axis y dimension = 1. + set Axis z dimension = 1. + set Cad tolerance to projectors tolerance ratio = 100 + set Cells per circle = 12 + set Input grid format = inp + set Input grid name = grids/cube2sphere_curves + set Input path to CAD files = grids/cube2sphere_iges/ + set Max aspect ratio = 3.5 + set Maximum number of curvature adaptive refinement cycles = 2 + set Number of cycles = 0 + set Number of global refinement to be executed before local refinement cycle = 0 + set Surface curvature adaptive refinement = true + set Use a spheroid = false + set Use iges surfaces and curves = true + + + subsection Boundary Conditions ID Numbers + set Dirichlet boundary ids = 1 + set Neumann boundary ids = 2 + set Robin boundary ids = + + # For each manifold, specify the boundary condition slot identifying the + # function to be used + set Manifold to boundary slot map = 0,0, 1,0, 2,0 + end + +end + + +subsection Driver<3> + set Potential components = 2 + set Set Global Refinement = true + set Complex components = 0 +end + + diff --git a/samples/ref_params_sphere_complex_DR_direct.prm b/samples/ref_params_sphere_complex_DR_direct.prm new file mode 100644 index 00000000..41347266 --- /dev/null +++ b/samples/ref_params_sphere_complex_DR_direct.prm @@ -0,0 +1,164 @@ +# Listing of Parameters +# --------------------- +subsection BEMFMA<3> + subsection FMA Params + set FMA Truncation Order = 6 + set Granularity for TBB simple for cycles = 10 + end + subsection Octree Params + set Maximum Number of Collocation Points per Childless Block = 20 + set Number of Octree Levels = 10 + end +end + + +subsection BEMProblem<3> + set Continuos gradient across edges = true + set Mapping Q Degree = 1 + set Mapping Type = FE + set Preconditioner = ILU + set Solution method = Direct + + subsection Quadrature rules + set Quadrature order = 4 + set Quadrature type = gauss + set Singular quadrature order = 5 + end + + subsection Solver + set Log frequency = 1 + set Log history = false + set Log result = true + set Max steps = 1000 + set Tolerance = 1.e-10 + end + + subsection Scalar Finite Element + set Finite Element type = FEQ + set Finite element order = 1 + end + + + subsection Vector Finite Element + set Finite Element type = FEQ + set Finite element order = 1 + end + +end + +subsection BoundaryConditions<3> + set Output file name = result + + subsection Potential 0 0 3d + set Function constants = + set Function expression = x+y+z+2 + set Variable names = x,y,z,t + end + + subsection Potential 0 1 3d + set Function constants = + set Function expression = x+y+z + set Variable names = x,y,z,t + end + + subsection Wind function 0 0 3d + set Function constants = + set Function expression = 1; 1; 1 + set Variable names = x,y,z,t + end + + subsection Wind function 0 1 3d + set Function constants = + set Function expression = 1; 1; 1 + set Variable names = x,y,z,t + end + + subsection Robin coefficients 0 0 3d + set Function constants = + set Function expression = 1/(2*(x+y+z+2)); 1; x+y+z+1 + set Variable names = x,y,z,t + end + + subsection Robin coefficients 0 1 3d + set Function constants = + set Function expression = 1/(2*(x+y+z+2)); 1; x+y+z+1 + set Variable names = x,y,z,t + end + + subsection Potential 1 0 3d + set Function constants = + set Function expression = -x-y-z-2 + set Variable names = x,y,z,t + end + + subsection Potential 1 1 3d + set Function constants = + set Function expression = -x-y-z-2 + set Variable names = x,y,z,t + end + + subsection Wind function 1 0 3d + set Function constants = + set Function expression = -1; -1; -1 + set Variable names = x,y,z,t + end + + subsection Wind function 1 1 3d + set Function constants = + set Function expression = -1; -1; -1 + set Variable names = x,y,z,t + end + + subsection Robin coefficients 1 0 3d + set Function constants = + set Function expression = 1/(2*(x+y+z+2)); 0; -x-y-z + set Variable names = x,y,z,t + end + + subsection Robin coefficients 1 1 3d + set Function constants = + set Function expression = 1/(2*(x+y+z+2)); 0; -x-y-z + set Variable names = x,y,z,t + end +end + + +subsection ComputationalDomain<3> + set Axis x dimension = 1. + set Axis y dimension = 1. + set Axis z dimension = 1. + set Cad tolerance to projectors tolerance ratio = 100 + set Cells per circle = 12 + set Input grid format = inp + set Input grid name = grids/cube2sphere_curves + set Input path to CAD files = grids/cube2sphere_iges/ + set Max aspect ratio = 3.5 + set Maximum number of curvature adaptive refinement cycles = 2 + set Number of cycles = 0 + set Number of global refinement to be executed before local refinement cycle = 0 + set Surface curvature adaptive refinement = true + set Use a spheroid = false + set Use iges surfaces and curves = true + + + subsection Boundary Conditions ID Numbers + set Dirichlet boundary ids = 1 + set Neumann boundary ids = + set Robin boundary ids = 2 + + # For each manifold, specify the boundary condition slot identifying the + # function to be used + set Manifold to boundary slot map = 0,0, 1,0, 2,0 + end + +end + + +subsection Driver<3> + set Potential components = 2 + set Set Global Refinement = true + set Complex components = 0 +end + + + diff --git a/samples/ref_params_sphere_complex_DR_fma.prm b/samples/ref_params_sphere_complex_DR_fma.prm new file mode 100644 index 00000000..9653dd00 --- /dev/null +++ b/samples/ref_params_sphere_complex_DR_fma.prm @@ -0,0 +1,164 @@ +# Listing of Parameters +# --------------------- +subsection BEMFMA<3> + subsection FMA Params + set FMA Truncation Order = 6 + set Granularity for TBB simple for cycles = 10 + end + subsection Octree Params + set Maximum Number of Collocation Points per Childless Block = 20 + set Number of Octree Levels = 10 + end +end + + +subsection BEMProblem<3> + set Continuos gradient across edges = true + set Mapping Q Degree = 1 + set Mapping Type = FE + set Preconditioner = ILU + set Solution method = FMA + + subsection Quadrature rules + set Quadrature order = 4 + set Quadrature type = gauss + set Singular quadrature order = 5 + end + + subsection Solver + set Log frequency = 1 + set Log history = false + set Log result = true + set Max steps = 1000 + set Tolerance = 1.e-10 + end + + subsection Scalar Finite Element + set Finite Element type = FEQ + set Finite element order = 1 + end + + + subsection Vector Finite Element + set Finite Element type = FEQ + set Finite element order = 1 + end + +end + +subsection BoundaryConditions<3> + set Output file name = result + + subsection Potential 0 0 3d + set Function constants = + set Function expression = x+y+z+2 + set Variable names = x,y,z,t + end + + subsection Potential 0 1 3d + set Function constants = + set Function expression = x+y+z + set Variable names = x,y,z,t + end + + subsection Wind function 0 0 3d + set Function constants = + set Function expression = 1; 1; 1 + set Variable names = x,y,z,t + end + + subsection Wind function 0 1 3d + set Function constants = + set Function expression = 1; 1; 1 + set Variable names = x,y,z,t + end + + subsection Robin coefficients 0 0 3d + set Function constants = + set Function expression = 1/(2*(x+y+z+2)); 1; x+y+z+1 + set Variable names = x,y,z,t + end + + subsection Robin coefficients 0 1 3d + set Function constants = + set Function expression = 1/(2*(x+y+z+2)); 1; x+y+z+1 + set Variable names = x,y,z,t + end + + subsection Potential 1 0 3d + set Function constants = + set Function expression = -x-y-z-2 + set Variable names = x,y,z,t + end + + subsection Potential 1 1 3d + set Function constants = + set Function expression = -x-y-z-2 + set Variable names = x,y,z,t + end + + subsection Wind function 1 0 3d + set Function constants = + set Function expression = -1; -1; -1 + set Variable names = x,y,z,t + end + + subsection Wind function 1 1 3d + set Function constants = + set Function expression = -1; -1; -1 + set Variable names = x,y,z,t + end + + subsection Robin coefficients 1 0 3d + set Function constants = + set Function expression = 1/(2*(x+y+z+2)); 0; -x-y-z + set Variable names = x,y,z,t + end + + subsection Robin coefficients 1 1 3d + set Function constants = + set Function expression = 1/(2*(x+y+z+2)); 0; -x-y-z + set Variable names = x,y,z,t + end +end + + +subsection ComputationalDomain<3> + set Axis x dimension = 1. + set Axis y dimension = 1. + set Axis z dimension = 1. + set Cad tolerance to projectors tolerance ratio = 100 + set Cells per circle = 12 + set Input grid format = inp + set Input grid name = grids/cube2sphere_curves + set Input path to CAD files = grids/cube2sphere_iges/ + set Max aspect ratio = 3.5 + set Maximum number of curvature adaptive refinement cycles = 2 + set Number of cycles = 0 + set Number of global refinement to be executed before local refinement cycle = 0 + set Surface curvature adaptive refinement = true + set Use a spheroid = false + set Use iges surfaces and curves = true + + + subsection Boundary Conditions ID Numbers + set Dirichlet boundary ids = 1 + set Neumann boundary ids = + set Robin boundary ids = 2 + + # For each manifold, specify the boundary condition slot identifying the + # function to be used + set Manifold to boundary slot map = 0,0, 1,0, 2,0 + end + +end + + +subsection Driver<3> + set Potential components = 2 + set Set Global Refinement = true + set Complex components = 0 +end + + + diff --git a/samples/ref_params_sphere_complex_NR_direct.prm b/samples/ref_params_sphere_complex_NR_direct.prm new file mode 100644 index 00000000..83a52505 --- /dev/null +++ b/samples/ref_params_sphere_complex_NR_direct.prm @@ -0,0 +1,164 @@ +# Listing of Parameters +# --------------------- +subsection BEMFMA<3> + subsection FMA Params + set FMA Truncation Order = 6 + set Granularity for TBB simple for cycles = 10 + end + subsection Octree Params + set Maximum Number of Collocation Points per Childless Block = 20 + set Number of Octree Levels = 10 + end +end + + +subsection BEMProblem<3> + set Continuos gradient across edges = true + set Mapping Q Degree = 1 + set Mapping Type = FE + set Preconditioner = ILU + set Solution method = Direct + + subsection Quadrature rules + set Quadrature order = 4 + set Quadrature type = gauss + set Singular quadrature order = 5 + end + + subsection Solver + set Log frequency = 1 + set Log history = false + set Log result = true + set Max steps = 1000 + set Tolerance = 1.e-10 + end + + subsection Scalar Finite Element + set Finite Element type = FEQ + set Finite element order = 1 + end + + + subsection Vector Finite Element + set Finite Element type = FEQ + set Finite element order = 1 + end + +end + +subsection BoundaryConditions<3> + set Output file name = result + + subsection Potential 0 0 3d + set Function constants = + set Function expression = x+y+z+2 + set Variable names = x,y,z,t + end + + subsection Potential 0 1 3d + set Function constants = + set Function expression = x+y+z + set Variable names = x,y,z,t + end + + subsection Wind function 0 0 3d + set Function constants = + set Function expression = 1; 1; 1 + set Variable names = x,y,z,t + end + + subsection Wind function 0 1 3d + set Function constants = + set Function expression = 1; 1; 1 + set Variable names = x,y,z,t + end + + subsection Robin coefficients 0 0 3d + set Function constants = + set Function expression = 1/(2*(x+y+z+2)); 1; x+y+z+1 + set Variable names = x,y,z,t + end + + subsection Robin coefficients 0 1 3d + set Function constants = + set Function expression = 1/(2*(x+y+z+2)); 1; x+y+z+1 + set Variable names = x,y,z,t + end + + subsection Potential 1 0 3d + set Function constants = + set Function expression = -x-y-z-2 + set Variable names = x,y,z,t + end + + subsection Potential 1 1 3d + set Function constants = + set Function expression = -x-y-z-2 + set Variable names = x,y,z,t + end + + subsection Wind function 1 0 3d + set Function constants = + set Function expression = -1; -1; -1 + set Variable names = x,y,z,t + end + + subsection Wind function 1 1 3d + set Function constants = + set Function expression = -1; -1; -1 + set Variable names = x,y,z,t + end + + subsection Robin coefficients 1 0 3d + set Function constants = + set Function expression = 1/(2*(x+y+z+2)); 0; -x-y-z + set Variable names = x,y,z,t + end + + subsection Robin coefficients 1 1 3d + set Function constants = + set Function expression = 1/(2*(x+y+z+2)); 0; -x-y-z + set Variable names = x,y,z,t + end +end + + +subsection ComputationalDomain<3> + set Axis x dimension = 1. + set Axis y dimension = 1. + set Axis z dimension = 1. + set Cad tolerance to projectors tolerance ratio = 100 + set Cells per circle = 12 + set Input grid format = inp + set Input grid name = grids/cube2sphere_curves + set Input path to CAD files = grids/cube2sphere_iges/ + set Max aspect ratio = 3.5 + set Maximum number of curvature adaptive refinement cycles = 2 + set Number of cycles = 0 + set Number of global refinement to be executed before local refinement cycle = 0 + set Surface curvature adaptive refinement = true + set Use a spheroid = false + set Use iges surfaces and curves = true + + + subsection Boundary Conditions ID Numbers + set Dirichlet boundary ids = + set Neumann boundary ids = 1 + set Robin boundary ids = 2 + + # For each manifold, specify the boundary condition slot identifying the + # function to be used + set Manifold to boundary slot map = 0,0, 1,0, 2,0 + end + +end + + +subsection Driver<3> + set Potential components = 2 + set Set Global Refinement = true + set Complex components = 0 +end + + + diff --git a/samples/ref_params_sphere_complex_NR_fma.prm b/samples/ref_params_sphere_complex_NR_fma.prm new file mode 100644 index 00000000..fcbb125d --- /dev/null +++ b/samples/ref_params_sphere_complex_NR_fma.prm @@ -0,0 +1,164 @@ +# Listing of Parameters +# --------------------- +subsection BEMFMA<3> + subsection FMA Params + set FMA Truncation Order = 6 + set Granularity for TBB simple for cycles = 10 + end + subsection Octree Params + set Maximum Number of Collocation Points per Childless Block = 20 + set Number of Octree Levels = 10 + end +end + + +subsection BEMProblem<3> + set Continuos gradient across edges = true + set Mapping Q Degree = 1 + set Mapping Type = FE + set Preconditioner = ILU + set Solution method = FMA + + subsection Quadrature rules + set Quadrature order = 4 + set Quadrature type = gauss + set Singular quadrature order = 5 + end + + subsection Solver + set Log frequency = 1 + set Log history = false + set Log result = true + set Max steps = 1000 + set Tolerance = 1.e-10 + end + + subsection Scalar Finite Element + set Finite Element type = FEQ + set Finite element order = 1 + end + + + subsection Vector Finite Element + set Finite Element type = FEQ + set Finite element order = 1 + end + +end + +subsection BoundaryConditions<3> + set Output file name = result + + subsection Potential 0 0 3d + set Function constants = + set Function expression = x+y+z+2 + set Variable names = x,y,z,t + end + + subsection Potential 0 1 3d + set Function constants = + set Function expression = x+y+z + set Variable names = x,y,z,t + end + + subsection Wind function 0 0 3d + set Function constants = + set Function expression = 1; 1; 1 + set Variable names = x,y,z,t + end + + subsection Wind function 0 1 3d + set Function constants = + set Function expression = 1; 1; 1 + set Variable names = x,y,z,t + end + + subsection Robin coefficients 0 0 3d + set Function constants = + set Function expression = 1/(2*(x+y+z+2)); 1; x+y+z+1 + set Variable names = x,y,z,t + end + + subsection Robin coefficients 0 1 3d + set Function constants = + set Function expression = 1/(2*(x+y+z+2)); 1; x+y+z+1 + set Variable names = x,y,z,t + end + + subsection Potential 1 0 3d + set Function constants = + set Function expression = -x-y-z-2 + set Variable names = x,y,z,t + end + + subsection Potential 1 1 3d + set Function constants = + set Function expression = -x-y-z-2 + set Variable names = x,y,z,t + end + + subsection Wind function 1 0 3d + set Function constants = + set Function expression = -1; -1; -1 + set Variable names = x,y,z,t + end + + subsection Wind function 1 1 3d + set Function constants = + set Function expression = -1; -1; -1 + set Variable names = x,y,z,t + end + + subsection Robin coefficients 1 0 3d + set Function constants = + set Function expression = 1/(2*(x+y+z+2)); 0; -x-y-z + set Variable names = x,y,z,t + end + + subsection Robin coefficients 1 1 3d + set Function constants = + set Function expression = 1/(2*(x+y+z+2)); 0; -x-y-z + set Variable names = x,y,z,t + end +end + + +subsection ComputationalDomain<3> + set Axis x dimension = 1. + set Axis y dimension = 1. + set Axis z dimension = 1. + set Cad tolerance to projectors tolerance ratio = 100 + set Cells per circle = 12 + set Input grid format = inp + set Input grid name = grids/cube2sphere_curves + set Input path to CAD files = grids/cube2sphere_iges/ + set Max aspect ratio = 3.5 + set Maximum number of curvature adaptive refinement cycles = 2 + set Number of cycles = 0 + set Number of global refinement to be executed before local refinement cycle = 0 + set Surface curvature adaptive refinement = true + set Use a spheroid = false + set Use iges surfaces and curves = true + + + subsection Boundary Conditions ID Numbers + set Dirichlet boundary ids = + set Neumann boundary ids = 1 + set Robin boundary ids = 2 + + # For each manifold, specify the boundary condition slot identifying the + # function to be used + set Manifold to boundary slot map = 0,0, 1,0, 2,0 + end + +end + + +subsection Driver<3> + set Potential components = 2 + set Set Global Refinement = true + set Complex components = 0 +end + + + diff --git a/samples/ref_params_sphere_real.prm b/samples/ref_params_sphere_real.prm new file mode 100644 index 00000000..2cee1429 --- /dev/null +++ b/samples/ref_params_sphere_real.prm @@ -0,0 +1,130 @@ +# Listing of Parameters +# --------------------- +subsection BEMFMA<3> + subsection FMA Params + set FMA Truncation Order = 6 + set Granularity for TBB simple for cycles = 10 + end + subsection Octree Params + set Maximum Number of Collocation Points per Childless Block = 20 + set Number of Octree Levels = 10 + end +end + + +subsection BEMProblem<3> + set Continuos gradient across edges = true + set Mapping Q Degree = 1 + set Mapping Type = FE + set Preconditioner = ILU + set Solution method = Direct + + subsection Quadrature rules + set Quadrature order = 4 + set Quadrature type = gauss + set Singular quadrature order = 5 + end + + subsection Solver + set Log frequency = 1 + set Log history = false + set Log result = true + set Max steps = 1000 + set Tolerance = 1.e-10 + end + + subsection Scalar Finite Element + set Finite Element type = FEQ + set Finite element order = 1 + end + + + subsection Vector Finite Element + set Finite Element type = FEQ + set Finite element order = 1 + end + +end + +subsection BoundaryConditions<3> + set Output file name = result + + subsection Potential 0 0 3d + set Function constants = + set Function expression = x+y+z + set Variable names = x,y,z,t + end + + subsection Potential 0 1 3d + set Function constants = + set Function expression = x+y+z + set Variable names = x,y,z,t + end + + subsection Wind function 0 0 3d + set Function constants = + set Function expression = 1; 1; 1 + set Variable names = x,y,z,t + end + + subsection Wind function 0 1 3d + set Function constants = + set Function expression = 1; 1; 1 + set Variable names = x,y,z,t + end + + subsection Robin coefficients 0 0 3d + set Function constants = + set Function expression = 1; -1; 0 + set Variable names = x,y,z,t + end + + subsection Robin coefficients 0 1 3d + set Function constants = + set Function expression = 1; -1; 0 + set Variable names = x,y,z,t + end +end + + +subsection ComputationalDomain<3> + set Axis x dimension = 1. + set Axis y dimension = 1. + set Axis z dimension = 1. + set Cad tolerance to projectors tolerance ratio = 100 + set Cells per circle = 12 + set Input grid format = inp + set Input grid name = grids/cube2sphere_curves + set Input path to CAD files = grids/cube2sphere_iges/ + set Max aspect ratio = 3.5 + set Maximum number of curvature adaptive refinement cycles = 2 + set Number of cycles = 0 + set Number of global refinement to be executed before local refinement cycle = 0 + set Surface curvature adaptive refinement = true + set Use a spheroid = false + set Use iges surfaces and curves = true + + + subsection Boundary Conditions ID Numbers + set Dirichlet boundary ids = 1 + set Neumann boundary ids = 2 + set Robin boundary ids = + + # For each manifold, specify the boundary condition slot identifying the + # function to be used + set Manifold to boundary slot map = 0,0, 1,0, 2,0 + end + + + +end + + +subsection Driver<3> + set Potential components = 1 + set Set Global Refinement = true + set Complex components = +end + + + diff --git a/samples/ref_params_sphere_real_DN_direct.prm b/samples/ref_params_sphere_real_DN_direct.prm new file mode 100644 index 00000000..90244aca --- /dev/null +++ b/samples/ref_params_sphere_real_DN_direct.prm @@ -0,0 +1,128 @@ +# Listing of Parameters +# --------------------- +subsection BEMFMA<3> + subsection FMA Params + set FMA Truncation Order = 6 + set Granularity for TBB simple for cycles = 10 + end + subsection Octree Params + set Maximum Number of Collocation Points per Childless Block = 20 + set Number of Octree Levels = 10 + end +end + + +subsection BEMProblem<3> + set Continuos gradient across edges = true + set Mapping Q Degree = 1 + set Mapping Type = FE + set Preconditioner = ILU + set Solution method = Direct + + subsection Quadrature rules + set Quadrature order = 4 + set Quadrature type = gauss + set Singular quadrature order = 5 + end + + subsection Solver + set Log frequency = 1 + set Log history = false + set Log result = true + set Max steps = 1000 + set Tolerance = 1.e-10 + end + + subsection Scalar Finite Element + set Finite Element type = FEQ + set Finite element order = 1 + end + + + subsection Vector Finite Element + set Finite Element type = FEQ + set Finite element order = 1 + end + +end + +subsection BoundaryConditions<3> + set Output file name = result + + subsection Potential 0 0 3d + set Function constants = + set Function expression = x+y+z + set Variable names = x,y,z,t + end + + subsection Potential 0 1 3d + set Function constants = + set Function expression = x+y+z + set Variable names = x,y,z,t + end + + subsection Wind function 0 0 3d + set Function constants = + set Function expression = 1; 1; 1 + set Variable names = x,y,z,t + end + + subsection Wind function 0 1 3d + set Function constants = + set Function expression = 1; 1; 1 + set Variable names = x,y,z,t + end + + subsection Robin coefficients 0 0 3d + set Function constants = + set Function expression = 1; -1; 0 + set Variable names = x,y,z,t + end + + subsection Robin coefficients 0 1 3d + set Function constants = + set Function expression = 1; -1; 0 + set Variable names = x,y,z,t + end +end + + +subsection ComputationalDomain<3> + set Axis x dimension = 1. + set Axis y dimension = 1. + set Axis z dimension = 1. + set Cad tolerance to projectors tolerance ratio = 100 + set Cells per circle = 12 + set Input grid format = inp + set Input grid name = grids/cube2sphere_curves + set Input path to CAD files = grids/cube2sphere_iges/ + set Max aspect ratio = 3.5 + set Maximum number of curvature adaptive refinement cycles = 2 + set Number of cycles = 0 + set Number of global refinement to be executed before local refinement cycle = 0 + set Surface curvature adaptive refinement = true + set Use a spheroid = false + set Use iges surfaces and curves = true + + + subsection Boundary Conditions ID Numbers + set Dirichlet boundary ids = 1 + set Neumann boundary ids = 2 + set Robin boundary ids = + + # For each manifold, specify the boundary condition slot identifying the + # function to be used + set Manifold to boundary slot map = 0,0, 1,0, 2,0 + end + +end + + +subsection Driver<3> + set Potential components = 1 + set Set Global Refinement = true + set Complex components = +end + + + diff --git a/samples/ref_params_sphere_real_DN_fma.prm b/samples/ref_params_sphere_real_DN_fma.prm new file mode 100644 index 00000000..212e2815 --- /dev/null +++ b/samples/ref_params_sphere_real_DN_fma.prm @@ -0,0 +1,128 @@ +# Listing of Parameters +# --------------------- +subsection BEMFMA<3> + subsection FMA Params + set FMA Truncation Order = 6 + set Granularity for TBB simple for cycles = 10 + end + subsection Octree Params + set Maximum Number of Collocation Points per Childless Block = 20 + set Number of Octree Levels = 10 + end +end + + +subsection BEMProblem<3> + set Continuos gradient across edges = true + set Mapping Q Degree = 1 + set Mapping Type = FE + set Preconditioner = ILU + set Solution method = FMA + + subsection Quadrature rules + set Quadrature order = 4 + set Quadrature type = gauss + set Singular quadrature order = 5 + end + + subsection Solver + set Log frequency = 1 + set Log history = false + set Log result = true + set Max steps = 1000 + set Tolerance = 1.e-10 + end + + subsection Scalar Finite Element + set Finite Element type = FEQ + set Finite element order = 1 + end + + + subsection Vector Finite Element + set Finite Element type = FEQ + set Finite element order = 1 + end + +end + +subsection BoundaryConditions<3> + set Output file name = result + + subsection Potential 0 0 3d + set Function constants = + set Function expression = x+y+z + set Variable names = x,y,z,t + end + + subsection Potential 0 1 3d + set Function constants = + set Function expression = x+y+z + set Variable names = x,y,z,t + end + + subsection Wind function 0 0 3d + set Function constants = + set Function expression = 1; 1; 1 + set Variable names = x,y,z,t + end + + subsection Wind function 0 1 3d + set Function constants = + set Function expression = 1; 1; 1 + set Variable names = x,y,z,t + end + + subsection Robin coefficients 0 0 3d + set Function constants = + set Function expression = 1; -1; 0 + set Variable names = x,y,z,t + end + + subsection Robin coefficients 0 1 3d + set Function constants = + set Function expression = 1; -1; 0 + set Variable names = x,y,z,t + end +end + + +subsection ComputationalDomain<3> + set Axis x dimension = 1. + set Axis y dimension = 1. + set Axis z dimension = 1. + set Cad tolerance to projectors tolerance ratio = 100 + set Cells per circle = 12 + set Input grid format = inp + set Input grid name = grids/cube2sphere_curves + set Input path to CAD files = grids/cube2sphere_iges/ + set Max aspect ratio = 3.5 + set Maximum number of curvature adaptive refinement cycles = 2 + set Number of cycles = 0 + set Number of global refinement to be executed before local refinement cycle = 0 + set Surface curvature adaptive refinement = true + set Use a spheroid = false + set Use iges surfaces and curves = true + + + subsection Boundary Conditions ID Numbers + set Dirichlet boundary ids = 1 + set Neumann boundary ids = 2 + set Robin boundary ids = + + # For each manifold, specify the boundary condition slot identifying the + # function to be used + set Manifold to boundary slot map = 0,0, 1,0, 2,0 + end + +end + + +subsection Driver<3> + set Potential components = 1 + set Set Global Refinement = true + set Complex components = +end + + + diff --git a/samples/ref_params_sphere_real_DR_direct.prm b/samples/ref_params_sphere_real_DR_direct.prm new file mode 100644 index 00000000..e7225ff1 --- /dev/null +++ b/samples/ref_params_sphere_real_DR_direct.prm @@ -0,0 +1,128 @@ +# Listing of Parameters +# --------------------- +subsection BEMFMA<3> + subsection FMA Params + set FMA Truncation Order = 6 + set Granularity for TBB simple for cycles = 10 + end + subsection Octree Params + set Maximum Number of Collocation Points per Childless Block = 20 + set Number of Octree Levels = 10 + end +end + + +subsection BEMProblem<3> + set Continuos gradient across edges = true + set Mapping Q Degree = 1 + set Mapping Type = FE + set Preconditioner = ILU + set Solution method = Direct + + subsection Quadrature rules + set Quadrature order = 4 + set Quadrature type = gauss + set Singular quadrature order = 5 + end + + subsection Solver + set Log frequency = 1 + set Log history = false + set Log result = true + set Max steps = 1000 + set Tolerance = 1.e-10 + end + + subsection Scalar Finite Element + set Finite Element type = FEQ + set Finite element order = 1 + end + + + subsection Vector Finite Element + set Finite Element type = FEQ + set Finite element order = 1 + end + +end + +subsection BoundaryConditions<3> + set Output file name = result + + subsection Potential 0 0 3d + set Function constants = + set Function expression = x+y+z + set Variable names = x,y,z,t + end + + subsection Potential 0 1 3d + set Function constants = + set Function expression = x+y+z + set Variable names = x,y,z,t + end + + subsection Wind function 0 0 3d + set Function constants = + set Function expression = 1; 1; 1 + set Variable names = x,y,z,t + end + + subsection Wind function 0 1 3d + set Function constants = + set Function expression = 1; 1; 1 + set Variable names = x,y,z,t + end + + subsection Robin coefficients 0 0 3d + set Function constants = + set Function expression = 1; -1; 0 + set Variable names = x,y,z,t + end + + subsection Robin coefficients 0 1 3d + set Function constants = + set Function expression = 1; -1; 0 + set Variable names = x,y,z,t + end +end + + +subsection ComputationalDomain<3> + set Axis x dimension = 1. + set Axis y dimension = 1. + set Axis z dimension = 1. + set Cad tolerance to projectors tolerance ratio = 100 + set Cells per circle = 12 + set Input grid format = inp + set Input grid name = grids/cube2sphere_curves + set Input path to CAD files = grids/cube2sphere_iges/ + set Max aspect ratio = 3.5 + set Maximum number of curvature adaptive refinement cycles = 2 + set Number of cycles = 0 + set Number of global refinement to be executed before local refinement cycle = 0 + set Surface curvature adaptive refinement = true + set Use a spheroid = false + set Use iges surfaces and curves = true + + + subsection Boundary Conditions ID Numbers + set Dirichlet boundary ids = 1 + set Neumann boundary ids = + set Robin boundary ids = 2 + + # For each manifold, specify the boundary condition slot identifying the + # function to be used + set Manifold to boundary slot map = 0,0, 1,0, 2,0 + end + +end + + +subsection Driver<3> + set Potential components = 1 + set Set Global Refinement = true + set Complex components = +end + + + diff --git a/samples/ref_params_sphere_real_DR_fma.prm b/samples/ref_params_sphere_real_DR_fma.prm new file mode 100644 index 00000000..9f382a57 --- /dev/null +++ b/samples/ref_params_sphere_real_DR_fma.prm @@ -0,0 +1,128 @@ +# Listing of Parameters +# --------------------- +subsection BEMFMA<3> + subsection FMA Params + set FMA Truncation Order = 6 + set Granularity for TBB simple for cycles = 10 + end + subsection Octree Params + set Maximum Number of Collocation Points per Childless Block = 20 + set Number of Octree Levels = 10 + end +end + + +subsection BEMProblem<3> + set Continuos gradient across edges = true + set Mapping Q Degree = 1 + set Mapping Type = FE + set Preconditioner = ILU + set Solution method = FMA + + subsection Quadrature rules + set Quadrature order = 4 + set Quadrature type = gauss + set Singular quadrature order = 5 + end + + subsection Solver + set Log frequency = 1 + set Log history = false + set Log result = true + set Max steps = 1000 + set Tolerance = 1.e-10 + end + + subsection Scalar Finite Element + set Finite Element type = FEQ + set Finite element order = 1 + end + + + subsection Vector Finite Element + set Finite Element type = FEQ + set Finite element order = 1 + end + +end + +subsection BoundaryConditions<3> + set Output file name = result + + subsection Potential 0 0 3d + set Function constants = + set Function expression = x+y+z + set Variable names = x,y,z,t + end + + subsection Potential 0 1 3d + set Function constants = + set Function expression = x+y+z + set Variable names = x,y,z,t + end + + subsection Wind function 0 0 3d + set Function constants = + set Function expression = 1; 1; 1 + set Variable names = x,y,z,t + end + + subsection Wind function 0 1 3d + set Function constants = + set Function expression = 1; 1; 1 + set Variable names = x,y,z,t + end + + subsection Robin coefficients 0 0 3d + set Function constants = + set Function expression = 1; -1; 0 + set Variable names = x,y,z,t + end + + subsection Robin coefficients 0 1 3d + set Function constants = + set Function expression = 1; -1; 0 + set Variable names = x,y,z,t + end +end + + +subsection ComputationalDomain<3> + set Axis x dimension = 1. + set Axis y dimension = 1. + set Axis z dimension = 1. + set Cad tolerance to projectors tolerance ratio = 100 + set Cells per circle = 12 + set Input grid format = inp + set Input grid name = grids/cube2sphere_curves + set Input path to CAD files = grids/cube2sphere_iges/ + set Max aspect ratio = 3.5 + set Maximum number of curvature adaptive refinement cycles = 2 + set Number of cycles = 0 + set Number of global refinement to be executed before local refinement cycle = 0 + set Surface curvature adaptive refinement = true + set Use a spheroid = false + set Use iges surfaces and curves = true + + + subsection Boundary Conditions ID Numbers + set Dirichlet boundary ids = 1 + set Neumann boundary ids = + set Robin boundary ids = 2 + + # For each manifold, specify the boundary condition slot identifying the + # function to be used + set Manifold to boundary slot map = 0,0, 1,0, 2,0 + end + +end + + +subsection Driver<3> + set Potential components = 1 + set Set Global Refinement = true + set Complex components = +end + + + diff --git a/samples/ref_params_sphere_real_NR_direct.prm b/samples/ref_params_sphere_real_NR_direct.prm new file mode 100644 index 00000000..f9d82653 --- /dev/null +++ b/samples/ref_params_sphere_real_NR_direct.prm @@ -0,0 +1,128 @@ +# Listing of Parameters +# --------------------- +subsection BEMFMA<3> + subsection FMA Params + set FMA Truncation Order = 6 + set Granularity for TBB simple for cycles = 10 + end + subsection Octree Params + set Maximum Number of Collocation Points per Childless Block = 20 + set Number of Octree Levels = 10 + end +end + + +subsection BEMProblem<3> + set Continuos gradient across edges = true + set Mapping Q Degree = 1 + set Mapping Type = FE + set Preconditioner = ILU + set Solution method = Direct + + subsection Quadrature rules + set Quadrature order = 4 + set Quadrature type = gauss + set Singular quadrature order = 5 + end + + subsection Solver + set Log frequency = 1 + set Log history = false + set Log result = true + set Max steps = 1000 + set Tolerance = 1.e-10 + end + + subsection Scalar Finite Element + set Finite Element type = FEQ + set Finite element order = 1 + end + + + subsection Vector Finite Element + set Finite Element type = FEQ + set Finite element order = 1 + end + +end + +subsection BoundaryConditions<3> + set Output file name = result + + subsection Potential 0 0 3d + set Function constants = + set Function expression = x+y+z + set Variable names = x,y,z,t + end + + subsection Potential 0 1 3d + set Function constants = + set Function expression = x+y+z + set Variable names = x,y,z,t + end + + subsection Wind function 0 0 3d + set Function constants = + set Function expression = 1; 1; 1 + set Variable names = x,y,z,t + end + + subsection Wind function 0 1 3d + set Function constants = + set Function expression = 1; 1; 1 + set Variable names = x,y,z,t + end + + subsection Robin coefficients 0 0 3d + set Function constants = + set Function expression = 1; -1; 0 + set Variable names = x,y,z,t + end + + subsection Robin coefficients 0 1 3d + set Function constants = + set Function expression = 1; -1; 0 + set Variable names = x,y,z,t + end +end + + +subsection ComputationalDomain<3> + set Axis x dimension = 1. + set Axis y dimension = 1. + set Axis z dimension = 1. + set Cad tolerance to projectors tolerance ratio = 100 + set Cells per circle = 12 + set Input grid format = inp + set Input grid name = grids/cube2sphere_curves + set Input path to CAD files = grids/cube2sphere_iges/ + set Max aspect ratio = 3.5 + set Maximum number of curvature adaptive refinement cycles = 2 + set Number of cycles = 0 + set Number of global refinement to be executed before local refinement cycle = 0 + set Surface curvature adaptive refinement = true + set Use a spheroid = false + set Use iges surfaces and curves = true + + + subsection Boundary Conditions ID Numbers + set Dirichlet boundary ids = + set Neumann boundary ids = 1 + set Robin boundary ids = 2 + + # For each manifold, specify the boundary condition slot identifying the + # function to be used + set Manifold to boundary slot map = 0,0, 1,0, 2,0 + end + +end + + +subsection Driver<3> + set Potential components = 1 + set Set Global Refinement = true + set Complex components = +end + + + diff --git a/samples/ref_params_sphere_real_NR_fma.prm b/samples/ref_params_sphere_real_NR_fma.prm new file mode 100644 index 00000000..22e283e5 --- /dev/null +++ b/samples/ref_params_sphere_real_NR_fma.prm @@ -0,0 +1,128 @@ +# Listing of Parameters +# --------------------- +subsection BEMFMA<3> + subsection FMA Params + set FMA Truncation Order = 6 + set Granularity for TBB simple for cycles = 10 + end + subsection Octree Params + set Maximum Number of Collocation Points per Childless Block = 20 + set Number of Octree Levels = 10 + end +end + + +subsection BEMProblem<3> + set Continuos gradient across edges = true + set Mapping Q Degree = 1 + set Mapping Type = FE + set Preconditioner = ILU + set Solution method = FMA + + subsection Quadrature rules + set Quadrature order = 4 + set Quadrature type = gauss + set Singular quadrature order = 5 + end + + subsection Solver + set Log frequency = 1 + set Log history = false + set Log result = true + set Max steps = 1000 + set Tolerance = 1.e-10 + end + + subsection Scalar Finite Element + set Finite Element type = FEQ + set Finite element order = 1 + end + + + subsection Vector Finite Element + set Finite Element type = FEQ + set Finite element order = 1 + end + +end + +subsection BoundaryConditions<3> + set Output file name = result + + subsection Potential 0 0 3d + set Function constants = + set Function expression = x+y+z + set Variable names = x,y,z,t + end + + subsection Potential 0 1 3d + set Function constants = + set Function expression = x+y+z + set Variable names = x,y,z,t + end + + subsection Wind function 0 0 3d + set Function constants = + set Function expression = 1; 1; 1 + set Variable names = x,y,z,t + end + + subsection Wind function 0 1 3d + set Function constants = + set Function expression = 1; 1; 1 + set Variable names = x,y,z,t + end + + subsection Robin coefficients 0 0 3d + set Function constants = + set Function expression = 1; -1; 0 + set Variable names = x,y,z,t + end + + subsection Robin coefficients 0 1 3d + set Function constants = + set Function expression = 1; -1; 0 + set Variable names = x,y,z,t + end +end + + +subsection ComputationalDomain<3> + set Axis x dimension = 1. + set Axis y dimension = 1. + set Axis z dimension = 1. + set Cad tolerance to projectors tolerance ratio = 100 + set Cells per circle = 12 + set Input grid format = inp + set Input grid name = grids/cube2sphere_curves + set Input path to CAD files = grids/cube2sphere_iges/ + set Max aspect ratio = 3.5 + set Maximum number of curvature adaptive refinement cycles = 2 + set Number of cycles = 0 + set Number of global refinement to be executed before local refinement cycle = 0 + set Surface curvature adaptive refinement = true + set Use a spheroid = false + set Use iges surfaces and curves = true + + + subsection Boundary Conditions ID Numbers + set Dirichlet boundary ids = + set Neumann boundary ids = 1 + set Robin boundary ids = 2 + + # For each manifold, specify the boundary condition slot identifying the + # function to be used + set Manifold to boundary slot map = 0,0, 1,0, 2,0 + end + +end + + +subsection Driver<3> + set Potential components = 1 + set Set Global Refinement = true + set Complex components = +end + + + diff --git a/samples/run_sphere_problems.sh b/samples/run_sphere_problems.sh new file mode 100755 index 00000000..557e5139 --- /dev/null +++ b/samples/run_sphere_problems.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +mkdir -p logs + +cad_refine=2 + +export OMP_THREADS_NUM=4 + +for problem in real complex +do + for bconds in DN DR NR + do + for solver in direct fma + do + echo "problem ${problem} - boundaries ${bconds} - solver ${solver}" + cp ref_params_sphere_${problem}_${bconds}_${solver}.prm ./parameters_bem_3.prm + + #tune the number of refinements + set Number of cycles = 0 + sed -i "s/set Number of cycles = .*/set Number of cycles = ${cad_refine}/" parameters_bem_3.prm + + perf stat --detailed mpirun -np 10 ./bem_fma_3d > log 2>&1 + + mv log logs/sphere_${problem}_${bconds}_${solver}.log + + mkdir -p logs/sphere_${problem}_${bconds}_${solver} + mv meshResult.inp *.vtu logs/sphere_${problem}_${bconds}_${solver} + done + done +done diff --git a/source/ass_leg_function.cc b/source/ass_leg_function.cc index 0dec0438..699526e9 100644 --- a/source/ass_leg_function.cc +++ b/source/ass_leg_function.cc @@ -2,7 +2,6 @@ #include - AssLegFunction::AssLegFunction() { leg_pointers.resize(21); diff --git a/source/ass_leg_function_py.cpp b/source/ass_leg_function_py.cpp new file mode 100644 index 00000000..232ab7a7 --- /dev/null +++ b/source/ass_leg_function_py.cpp @@ -0,0 +1,4176 @@ + +#include + +#include "../include/ass_leg_function.h" + + +AssLegFunction::AssLegFunction() +{ + leg_pointers.resize(21); + for (unsigned int i = 0; i < 21; ++i) + { + leg_pointers[i].resize(i + 1); + } + + leg_pointers[0][0] = &AssLegFunction::P_0_0; + leg_pointers[1][0] = &AssLegFunction::P_1_0; + leg_pointers[1][1] = &AssLegFunction::P_1_1; + leg_pointers[2][0] = &AssLegFunction::P_2_0; + leg_pointers[2][1] = &AssLegFunction::P_2_1; + leg_pointers[2][2] = &AssLegFunction::P_2_2; + leg_pointers[3][0] = &AssLegFunction::P_3_0; + leg_pointers[3][1] = &AssLegFunction::P_3_1; + leg_pointers[3][2] = &AssLegFunction::P_3_2; + leg_pointers[3][3] = &AssLegFunction::P_3_3; + leg_pointers[4][0] = &AssLegFunction::P_4_0; + leg_pointers[4][1] = &AssLegFunction::P_4_1; + leg_pointers[4][2] = &AssLegFunction::P_4_2; + leg_pointers[4][3] = &AssLegFunction::P_4_3; + leg_pointers[4][4] = &AssLegFunction::P_4_4; + leg_pointers[5][0] = &AssLegFunction::P_5_0; + leg_pointers[5][1] = &AssLegFunction::P_5_1; + leg_pointers[5][2] = &AssLegFunction::P_5_2; + leg_pointers[5][3] = &AssLegFunction::P_5_3; + leg_pointers[5][4] = &AssLegFunction::P_5_4; + leg_pointers[5][5] = &AssLegFunction::P_5_5; + leg_pointers[6][0] = &AssLegFunction::P_6_0; + leg_pointers[6][1] = &AssLegFunction::P_6_1; + leg_pointers[6][2] = &AssLegFunction::P_6_2; + leg_pointers[6][3] = &AssLegFunction::P_6_3; + leg_pointers[6][4] = &AssLegFunction::P_6_4; + leg_pointers[6][5] = &AssLegFunction::P_6_5; + leg_pointers[6][6] = &AssLegFunction::P_6_6; + leg_pointers[7][0] = &AssLegFunction::P_7_0; + leg_pointers[7][1] = &AssLegFunction::P_7_1; + leg_pointers[7][2] = &AssLegFunction::P_7_2; + leg_pointers[7][3] = &AssLegFunction::P_7_3; + leg_pointers[7][4] = &AssLegFunction::P_7_4; + leg_pointers[7][5] = &AssLegFunction::P_7_5; + leg_pointers[7][6] = &AssLegFunction::P_7_6; + leg_pointers[7][7] = &AssLegFunction::P_7_7; + leg_pointers[8][0] = &AssLegFunction::P_8_0; + leg_pointers[8][1] = &AssLegFunction::P_8_1; + leg_pointers[8][2] = &AssLegFunction::P_8_2; + leg_pointers[8][3] = &AssLegFunction::P_8_3; + leg_pointers[8][4] = &AssLegFunction::P_8_4; + leg_pointers[8][5] = &AssLegFunction::P_8_5; + leg_pointers[8][6] = &AssLegFunction::P_8_6; + leg_pointers[8][7] = &AssLegFunction::P_8_7; + leg_pointers[8][8] = &AssLegFunction::P_8_8; + leg_pointers[9][0] = &AssLegFunction::P_9_0; + leg_pointers[9][1] = &AssLegFunction::P_9_1; + leg_pointers[9][2] = &AssLegFunction::P_9_2; + leg_pointers[9][3] = &AssLegFunction::P_9_3; + leg_pointers[9][4] = &AssLegFunction::P_9_4; + leg_pointers[9][5] = &AssLegFunction::P_9_5; + leg_pointers[9][6] = &AssLegFunction::P_9_6; + leg_pointers[9][7] = &AssLegFunction::P_9_7; + leg_pointers[9][8] = &AssLegFunction::P_9_8; + leg_pointers[9][9] = &AssLegFunction::P_9_9; + leg_pointers[10][0] = &AssLegFunction::P_10_0; + leg_pointers[10][1] = &AssLegFunction::P_10_1; + leg_pointers[10][2] = &AssLegFunction::P_10_2; + leg_pointers[10][3] = &AssLegFunction::P_10_3; + leg_pointers[10][4] = &AssLegFunction::P_10_4; + leg_pointers[10][5] = &AssLegFunction::P_10_5; + leg_pointers[10][6] = &AssLegFunction::P_10_6; + leg_pointers[10][7] = &AssLegFunction::P_10_7; + leg_pointers[10][8] = &AssLegFunction::P_10_8; + leg_pointers[10][9] = &AssLegFunction::P_10_9; + leg_pointers[10][10] = &AssLegFunction::P_10_10; + leg_pointers[11][0] = &AssLegFunction::P_11_0; + leg_pointers[11][1] = &AssLegFunction::P_11_1; + leg_pointers[11][2] = &AssLegFunction::P_11_2; + leg_pointers[11][3] = &AssLegFunction::P_11_3; + leg_pointers[11][4] = &AssLegFunction::P_11_4; + leg_pointers[11][5] = &AssLegFunction::P_11_5; + leg_pointers[11][6] = &AssLegFunction::P_11_6; + leg_pointers[11][7] = &AssLegFunction::P_11_7; + leg_pointers[11][8] = &AssLegFunction::P_11_8; + leg_pointers[11][9] = &AssLegFunction::P_11_9; + leg_pointers[11][10] = &AssLegFunction::P_11_10; + leg_pointers[11][11] = &AssLegFunction::P_11_11; + leg_pointers[12][0] = &AssLegFunction::P_12_0; + leg_pointers[12][1] = &AssLegFunction::P_12_1; + leg_pointers[12][2] = &AssLegFunction::P_12_2; + leg_pointers[12][3] = &AssLegFunction::P_12_3; + leg_pointers[12][4] = &AssLegFunction::P_12_4; + leg_pointers[12][5] = &AssLegFunction::P_12_5; + leg_pointers[12][6] = &AssLegFunction::P_12_6; + leg_pointers[12][7] = &AssLegFunction::P_12_7; + leg_pointers[12][8] = &AssLegFunction::P_12_8; + leg_pointers[12][9] = &AssLegFunction::P_12_9; + leg_pointers[12][10] = &AssLegFunction::P_12_10; + leg_pointers[12][11] = &AssLegFunction::P_12_11; + leg_pointers[12][12] = &AssLegFunction::P_12_12; + leg_pointers[13][0] = &AssLegFunction::P_13_0; + leg_pointers[13][1] = &AssLegFunction::P_13_1; + leg_pointers[13][2] = &AssLegFunction::P_13_2; + leg_pointers[13][3] = &AssLegFunction::P_13_3; + leg_pointers[13][4] = &AssLegFunction::P_13_4; + leg_pointers[13][5] = &AssLegFunction::P_13_5; + leg_pointers[13][6] = &AssLegFunction::P_13_6; + leg_pointers[13][7] = &AssLegFunction::P_13_7; + leg_pointers[13][8] = &AssLegFunction::P_13_8; + leg_pointers[13][9] = &AssLegFunction::P_13_9; + leg_pointers[13][10] = &AssLegFunction::P_13_10; + leg_pointers[13][11] = &AssLegFunction::P_13_11; + leg_pointers[13][12] = &AssLegFunction::P_13_12; + leg_pointers[13][13] = &AssLegFunction::P_13_13; + leg_pointers[14][0] = &AssLegFunction::P_14_0; + leg_pointers[14][1] = &AssLegFunction::P_14_1; + leg_pointers[14][2] = &AssLegFunction::P_14_2; + leg_pointers[14][3] = &AssLegFunction::P_14_3; + leg_pointers[14][4] = &AssLegFunction::P_14_4; + leg_pointers[14][5] = &AssLegFunction::P_14_5; + leg_pointers[14][6] = &AssLegFunction::P_14_6; + leg_pointers[14][7] = &AssLegFunction::P_14_7; + leg_pointers[14][8] = &AssLegFunction::P_14_8; + leg_pointers[14][9] = &AssLegFunction::P_14_9; + leg_pointers[14][10] = &AssLegFunction::P_14_10; + leg_pointers[14][11] = &AssLegFunction::P_14_11; + leg_pointers[14][12] = &AssLegFunction::P_14_12; + leg_pointers[14][13] = &AssLegFunction::P_14_13; + leg_pointers[14][14] = &AssLegFunction::P_14_14; + leg_pointers[15][0] = &AssLegFunction::P_15_0; + leg_pointers[15][1] = &AssLegFunction::P_15_1; + leg_pointers[15][2] = &AssLegFunction::P_15_2; + leg_pointers[15][3] = &AssLegFunction::P_15_3; + leg_pointers[15][4] = &AssLegFunction::P_15_4; + leg_pointers[15][5] = &AssLegFunction::P_15_5; + leg_pointers[15][6] = &AssLegFunction::P_15_6; + leg_pointers[15][7] = &AssLegFunction::P_15_7; + leg_pointers[15][8] = &AssLegFunction::P_15_8; + leg_pointers[15][9] = &AssLegFunction::P_15_9; + leg_pointers[15][10] = &AssLegFunction::P_15_10; + leg_pointers[15][11] = &AssLegFunction::P_15_11; + leg_pointers[15][12] = &AssLegFunction::P_15_12; + leg_pointers[15][13] = &AssLegFunction::P_15_13; + leg_pointers[15][14] = &AssLegFunction::P_15_14; + leg_pointers[15][15] = &AssLegFunction::P_15_15; + leg_pointers[16][0] = &AssLegFunction::P_16_0; + leg_pointers[16][1] = &AssLegFunction::P_16_1; + leg_pointers[16][2] = &AssLegFunction::P_16_2; + leg_pointers[16][3] = &AssLegFunction::P_16_3; + leg_pointers[16][4] = &AssLegFunction::P_16_4; + leg_pointers[16][5] = &AssLegFunction::P_16_5; + leg_pointers[16][6] = &AssLegFunction::P_16_6; + leg_pointers[16][7] = &AssLegFunction::P_16_7; + leg_pointers[16][8] = &AssLegFunction::P_16_8; + leg_pointers[16][9] = &AssLegFunction::P_16_9; + leg_pointers[16][10] = &AssLegFunction::P_16_10; + leg_pointers[16][11] = &AssLegFunction::P_16_11; + leg_pointers[16][12] = &AssLegFunction::P_16_12; + leg_pointers[16][13] = &AssLegFunction::P_16_13; + leg_pointers[16][14] = &AssLegFunction::P_16_14; + leg_pointers[16][15] = &AssLegFunction::P_16_15; + leg_pointers[16][16] = &AssLegFunction::P_16_16; + leg_pointers[17][0] = &AssLegFunction::P_17_0; + leg_pointers[17][1] = &AssLegFunction::P_17_1; + leg_pointers[17][2] = &AssLegFunction::P_17_2; + leg_pointers[17][3] = &AssLegFunction::P_17_3; + leg_pointers[17][4] = &AssLegFunction::P_17_4; + leg_pointers[17][5] = &AssLegFunction::P_17_5; + leg_pointers[17][6] = &AssLegFunction::P_17_6; + leg_pointers[17][7] = &AssLegFunction::P_17_7; + leg_pointers[17][8] = &AssLegFunction::P_17_8; + leg_pointers[17][9] = &AssLegFunction::P_17_9; + leg_pointers[17][10] = &AssLegFunction::P_17_10; + leg_pointers[17][11] = &AssLegFunction::P_17_11; + leg_pointers[17][12] = &AssLegFunction::P_17_12; + leg_pointers[17][13] = &AssLegFunction::P_17_13; + leg_pointers[17][14] = &AssLegFunction::P_17_14; + leg_pointers[17][15] = &AssLegFunction::P_17_15; + leg_pointers[17][16] = &AssLegFunction::P_17_16; + leg_pointers[17][17] = &AssLegFunction::P_17_17; + leg_pointers[18][0] = &AssLegFunction::P_18_0; + leg_pointers[18][1] = &AssLegFunction::P_18_1; + leg_pointers[18][2] = &AssLegFunction::P_18_2; + leg_pointers[18][3] = &AssLegFunction::P_18_3; + leg_pointers[18][4] = &AssLegFunction::P_18_4; + leg_pointers[18][5] = &AssLegFunction::P_18_5; + leg_pointers[18][6] = &AssLegFunction::P_18_6; + leg_pointers[18][7] = &AssLegFunction::P_18_7; + leg_pointers[18][8] = &AssLegFunction::P_18_8; + leg_pointers[18][9] = &AssLegFunction::P_18_9; + leg_pointers[18][10] = &AssLegFunction::P_18_10; + leg_pointers[18][11] = &AssLegFunction::P_18_11; + leg_pointers[18][12] = &AssLegFunction::P_18_12; + leg_pointers[18][13] = &AssLegFunction::P_18_13; + leg_pointers[18][14] = &AssLegFunction::P_18_14; + leg_pointers[18][15] = &AssLegFunction::P_18_15; + leg_pointers[18][16] = &AssLegFunction::P_18_16; + leg_pointers[18][17] = &AssLegFunction::P_18_17; + leg_pointers[18][18] = &AssLegFunction::P_18_18; + leg_pointers[19][0] = &AssLegFunction::P_19_0; + leg_pointers[19][1] = &AssLegFunction::P_19_1; + leg_pointers[19][2] = &AssLegFunction::P_19_2; + leg_pointers[19][3] = &AssLegFunction::P_19_3; + leg_pointers[19][4] = &AssLegFunction::P_19_4; + leg_pointers[19][5] = &AssLegFunction::P_19_5; + leg_pointers[19][6] = &AssLegFunction::P_19_6; + leg_pointers[19][7] = &AssLegFunction::P_19_7; + leg_pointers[19][8] = &AssLegFunction::P_19_8; + leg_pointers[19][9] = &AssLegFunction::P_19_9; + leg_pointers[19][10] = &AssLegFunction::P_19_10; + leg_pointers[19][11] = &AssLegFunction::P_19_11; + leg_pointers[19][12] = &AssLegFunction::P_19_12; + leg_pointers[19][13] = &AssLegFunction::P_19_13; + leg_pointers[19][14] = &AssLegFunction::P_19_14; + leg_pointers[19][15] = &AssLegFunction::P_19_15; + leg_pointers[19][16] = &AssLegFunction::P_19_16; + leg_pointers[19][17] = &AssLegFunction::P_19_17; + leg_pointers[19][18] = &AssLegFunction::P_19_18; + leg_pointers[19][19] = &AssLegFunction::P_19_19; + leg_pointers[20][0] = &AssLegFunction::P_20_0; + leg_pointers[20][1] = &AssLegFunction::P_20_1; + leg_pointers[20][2] = &AssLegFunction::P_20_2; + leg_pointers[20][3] = &AssLegFunction::P_20_3; + leg_pointers[20][4] = &AssLegFunction::P_20_4; + leg_pointers[20][5] = &AssLegFunction::P_20_5; + leg_pointers[20][6] = &AssLegFunction::P_20_6; + leg_pointers[20][7] = &AssLegFunction::P_20_7; + leg_pointers[20][8] = &AssLegFunction::P_20_8; + leg_pointers[20][9] = &AssLegFunction::P_20_9; + leg_pointers[20][10] = &AssLegFunction::P_20_10; + leg_pointers[20][11] = &AssLegFunction::P_20_11; + leg_pointers[20][12] = &AssLegFunction::P_20_12; + leg_pointers[20][13] = &AssLegFunction::P_20_13; + leg_pointers[20][14] = &AssLegFunction::P_20_14; + leg_pointers[20][15] = &AssLegFunction::P_20_15; + leg_pointers[20][16] = &AssLegFunction::P_20_16; + leg_pointers[20][17] = &AssLegFunction::P_20_17; + leg_pointers[20][18] = &AssLegFunction::P_20_18; + leg_pointers[20][19] = &AssLegFunction::P_20_19; + leg_pointers[20][20] = &AssLegFunction::P_20_20; + + leg_der_pointers.resize(21); + for (unsigned int i = 0; i < 21; ++i) + { + leg_der_pointers[i].resize(i + 1); + } + + leg_der_pointers[0][0] = &AssLegFunction::P_0_0_Deriv; + leg_der_pointers[1][0] = &AssLegFunction::P_1_0_Deriv; + leg_der_pointers[1][1] = &AssLegFunction::P_1_1_Deriv; + leg_der_pointers[2][0] = &AssLegFunction::P_2_0_Deriv; + leg_der_pointers[2][1] = &AssLegFunction::P_2_1_Deriv; + leg_der_pointers[2][2] = &AssLegFunction::P_2_2_Deriv; + leg_der_pointers[3][0] = &AssLegFunction::P_3_0_Deriv; + leg_der_pointers[3][1] = &AssLegFunction::P_3_1_Deriv; + leg_der_pointers[3][2] = &AssLegFunction::P_3_2_Deriv; + leg_der_pointers[3][3] = &AssLegFunction::P_3_3_Deriv; + leg_der_pointers[4][0] = &AssLegFunction::P_4_0_Deriv; + leg_der_pointers[4][1] = &AssLegFunction::P_4_1_Deriv; + leg_der_pointers[4][2] = &AssLegFunction::P_4_2_Deriv; + leg_der_pointers[4][3] = &AssLegFunction::P_4_3_Deriv; + leg_der_pointers[4][4] = &AssLegFunction::P_4_4_Deriv; + leg_der_pointers[5][0] = &AssLegFunction::P_5_0_Deriv; + leg_der_pointers[5][1] = &AssLegFunction::P_5_1_Deriv; + leg_der_pointers[5][2] = &AssLegFunction::P_5_2_Deriv; + leg_der_pointers[5][3] = &AssLegFunction::P_5_3_Deriv; + leg_der_pointers[5][4] = &AssLegFunction::P_5_4_Deriv; + leg_der_pointers[5][5] = &AssLegFunction::P_5_5_Deriv; + leg_der_pointers[6][0] = &AssLegFunction::P_6_0_Deriv; + leg_der_pointers[6][1] = &AssLegFunction::P_6_1_Deriv; + leg_der_pointers[6][2] = &AssLegFunction::P_6_2_Deriv; + leg_der_pointers[6][3] = &AssLegFunction::P_6_3_Deriv; + leg_der_pointers[6][4] = &AssLegFunction::P_6_4_Deriv; + leg_der_pointers[6][5] = &AssLegFunction::P_6_5_Deriv; + leg_der_pointers[6][6] = &AssLegFunction::P_6_6_Deriv; + leg_der_pointers[7][0] = &AssLegFunction::P_7_0_Deriv; + leg_der_pointers[7][1] = &AssLegFunction::P_7_1_Deriv; + leg_der_pointers[7][2] = &AssLegFunction::P_7_2_Deriv; + leg_der_pointers[7][3] = &AssLegFunction::P_7_3_Deriv; + leg_der_pointers[7][4] = &AssLegFunction::P_7_4_Deriv; + leg_der_pointers[7][5] = &AssLegFunction::P_7_5_Deriv; + leg_der_pointers[7][6] = &AssLegFunction::P_7_6_Deriv; + leg_der_pointers[7][7] = &AssLegFunction::P_7_7_Deriv; + leg_der_pointers[8][0] = &AssLegFunction::P_8_0_Deriv; + leg_der_pointers[8][1] = &AssLegFunction::P_8_1_Deriv; + leg_der_pointers[8][2] = &AssLegFunction::P_8_2_Deriv; + leg_der_pointers[8][3] = &AssLegFunction::P_8_3_Deriv; + leg_der_pointers[8][4] = &AssLegFunction::P_8_4_Deriv; + leg_der_pointers[8][5] = &AssLegFunction::P_8_5_Deriv; + leg_der_pointers[8][6] = &AssLegFunction::P_8_6_Deriv; + leg_der_pointers[8][7] = &AssLegFunction::P_8_7_Deriv; + leg_der_pointers[8][8] = &AssLegFunction::P_8_8_Deriv; + leg_der_pointers[9][0] = &AssLegFunction::P_9_0_Deriv; + leg_der_pointers[9][1] = &AssLegFunction::P_9_1_Deriv; + leg_der_pointers[9][2] = &AssLegFunction::P_9_2_Deriv; + leg_der_pointers[9][3] = &AssLegFunction::P_9_3_Deriv; + leg_der_pointers[9][4] = &AssLegFunction::P_9_4_Deriv; + leg_der_pointers[9][5] = &AssLegFunction::P_9_5_Deriv; + leg_der_pointers[9][6] = &AssLegFunction::P_9_6_Deriv; + leg_der_pointers[9][7] = &AssLegFunction::P_9_7_Deriv; + leg_der_pointers[9][8] = &AssLegFunction::P_9_8_Deriv; + leg_der_pointers[9][9] = &AssLegFunction::P_9_9_Deriv; + leg_der_pointers[10][0] = &AssLegFunction::P_10_0_Deriv; + leg_der_pointers[10][1] = &AssLegFunction::P_10_1_Deriv; + leg_der_pointers[10][2] = &AssLegFunction::P_10_2_Deriv; + leg_der_pointers[10][3] = &AssLegFunction::P_10_3_Deriv; + leg_der_pointers[10][4] = &AssLegFunction::P_10_4_Deriv; + leg_der_pointers[10][5] = &AssLegFunction::P_10_5_Deriv; + leg_der_pointers[10][6] = &AssLegFunction::P_10_6_Deriv; + leg_der_pointers[10][7] = &AssLegFunction::P_10_7_Deriv; + leg_der_pointers[10][8] = &AssLegFunction::P_10_8_Deriv; + leg_der_pointers[10][9] = &AssLegFunction::P_10_9_Deriv; + leg_der_pointers[10][10] = &AssLegFunction::P_10_10_Deriv; + leg_der_pointers[11][0] = &AssLegFunction::P_11_0_Deriv; + leg_der_pointers[11][1] = &AssLegFunction::P_11_1_Deriv; + leg_der_pointers[11][2] = &AssLegFunction::P_11_2_Deriv; + leg_der_pointers[11][3] = &AssLegFunction::P_11_3_Deriv; + leg_der_pointers[11][4] = &AssLegFunction::P_11_4_Deriv; + leg_der_pointers[11][5] = &AssLegFunction::P_11_5_Deriv; + leg_der_pointers[11][6] = &AssLegFunction::P_11_6_Deriv; + leg_der_pointers[11][7] = &AssLegFunction::P_11_7_Deriv; + leg_der_pointers[11][8] = &AssLegFunction::P_11_8_Deriv; + leg_der_pointers[11][9] = &AssLegFunction::P_11_9_Deriv; + leg_der_pointers[11][10] = &AssLegFunction::P_11_10_Deriv; + leg_der_pointers[11][11] = &AssLegFunction::P_11_11_Deriv; + leg_der_pointers[12][0] = &AssLegFunction::P_12_0_Deriv; + leg_der_pointers[12][1] = &AssLegFunction::P_12_1_Deriv; + leg_der_pointers[12][2] = &AssLegFunction::P_12_2_Deriv; + leg_der_pointers[12][3] = &AssLegFunction::P_12_3_Deriv; + leg_der_pointers[12][4] = &AssLegFunction::P_12_4_Deriv; + leg_der_pointers[12][5] = &AssLegFunction::P_12_5_Deriv; + leg_der_pointers[12][6] = &AssLegFunction::P_12_6_Deriv; + leg_der_pointers[12][7] = &AssLegFunction::P_12_7_Deriv; + leg_der_pointers[12][8] = &AssLegFunction::P_12_8_Deriv; + leg_der_pointers[12][9] = &AssLegFunction::P_12_9_Deriv; + leg_der_pointers[12][10] = &AssLegFunction::P_12_10_Deriv; + leg_der_pointers[12][11] = &AssLegFunction::P_12_11_Deriv; + leg_der_pointers[12][12] = &AssLegFunction::P_12_12_Deriv; + leg_der_pointers[13][0] = &AssLegFunction::P_13_0_Deriv; + leg_der_pointers[13][1] = &AssLegFunction::P_13_1_Deriv; + leg_der_pointers[13][2] = &AssLegFunction::P_13_2_Deriv; + leg_der_pointers[13][3] = &AssLegFunction::P_13_3_Deriv; + leg_der_pointers[13][4] = &AssLegFunction::P_13_4_Deriv; + leg_der_pointers[13][5] = &AssLegFunction::P_13_5_Deriv; + leg_der_pointers[13][6] = &AssLegFunction::P_13_6_Deriv; + leg_der_pointers[13][7] = &AssLegFunction::P_13_7_Deriv; + leg_der_pointers[13][8] = &AssLegFunction::P_13_8_Deriv; + leg_der_pointers[13][9] = &AssLegFunction::P_13_9_Deriv; + leg_der_pointers[13][10] = &AssLegFunction::P_13_10_Deriv; + leg_der_pointers[13][11] = &AssLegFunction::P_13_11_Deriv; + leg_der_pointers[13][12] = &AssLegFunction::P_13_12_Deriv; + leg_der_pointers[13][13] = &AssLegFunction::P_13_13_Deriv; + leg_der_pointers[14][0] = &AssLegFunction::P_14_0_Deriv; + leg_der_pointers[14][1] = &AssLegFunction::P_14_1_Deriv; + leg_der_pointers[14][2] = &AssLegFunction::P_14_2_Deriv; + leg_der_pointers[14][3] = &AssLegFunction::P_14_3_Deriv; + leg_der_pointers[14][4] = &AssLegFunction::P_14_4_Deriv; + leg_der_pointers[14][5] = &AssLegFunction::P_14_5_Deriv; + leg_der_pointers[14][6] = &AssLegFunction::P_14_6_Deriv; + leg_der_pointers[14][7] = &AssLegFunction::P_14_7_Deriv; + leg_der_pointers[14][8] = &AssLegFunction::P_14_8_Deriv; + leg_der_pointers[14][9] = &AssLegFunction::P_14_9_Deriv; + leg_der_pointers[14][10] = &AssLegFunction::P_14_10_Deriv; + leg_der_pointers[14][11] = &AssLegFunction::P_14_11_Deriv; + leg_der_pointers[14][12] = &AssLegFunction::P_14_12_Deriv; + leg_der_pointers[14][13] = &AssLegFunction::P_14_13_Deriv; + leg_der_pointers[14][14] = &AssLegFunction::P_14_14_Deriv; + leg_der_pointers[15][0] = &AssLegFunction::P_15_0_Deriv; + leg_der_pointers[15][1] = &AssLegFunction::P_15_1_Deriv; + leg_der_pointers[15][2] = &AssLegFunction::P_15_2_Deriv; + leg_der_pointers[15][3] = &AssLegFunction::P_15_3_Deriv; + leg_der_pointers[15][4] = &AssLegFunction::P_15_4_Deriv; + leg_der_pointers[15][5] = &AssLegFunction::P_15_5_Deriv; + leg_der_pointers[15][6] = &AssLegFunction::P_15_6_Deriv; + leg_der_pointers[15][7] = &AssLegFunction::P_15_7_Deriv; + leg_der_pointers[15][8] = &AssLegFunction::P_15_8_Deriv; + leg_der_pointers[15][9] = &AssLegFunction::P_15_9_Deriv; + leg_der_pointers[15][10] = &AssLegFunction::P_15_10_Deriv; + leg_der_pointers[15][11] = &AssLegFunction::P_15_11_Deriv; + leg_der_pointers[15][12] = &AssLegFunction::P_15_12_Deriv; + leg_der_pointers[15][13] = &AssLegFunction::P_15_13_Deriv; + leg_der_pointers[15][14] = &AssLegFunction::P_15_14_Deriv; + leg_der_pointers[15][15] = &AssLegFunction::P_15_15_Deriv; + leg_der_pointers[16][0] = &AssLegFunction::P_16_0_Deriv; + leg_der_pointers[16][1] = &AssLegFunction::P_16_1_Deriv; + leg_der_pointers[16][2] = &AssLegFunction::P_16_2_Deriv; + leg_der_pointers[16][3] = &AssLegFunction::P_16_3_Deriv; + leg_der_pointers[16][4] = &AssLegFunction::P_16_4_Deriv; + leg_der_pointers[16][5] = &AssLegFunction::P_16_5_Deriv; + leg_der_pointers[16][6] = &AssLegFunction::P_16_6_Deriv; + leg_der_pointers[16][7] = &AssLegFunction::P_16_7_Deriv; + leg_der_pointers[16][8] = &AssLegFunction::P_16_8_Deriv; + leg_der_pointers[16][9] = &AssLegFunction::P_16_9_Deriv; + leg_der_pointers[16][10] = &AssLegFunction::P_16_10_Deriv; + leg_der_pointers[16][11] = &AssLegFunction::P_16_11_Deriv; + leg_der_pointers[16][12] = &AssLegFunction::P_16_12_Deriv; + leg_der_pointers[16][13] = &AssLegFunction::P_16_13_Deriv; + leg_der_pointers[16][14] = &AssLegFunction::P_16_14_Deriv; + leg_der_pointers[16][15] = &AssLegFunction::P_16_15_Deriv; + leg_der_pointers[16][16] = &AssLegFunction::P_16_16_Deriv; + leg_der_pointers[17][0] = &AssLegFunction::P_17_0_Deriv; + leg_der_pointers[17][1] = &AssLegFunction::P_17_1_Deriv; + leg_der_pointers[17][2] = &AssLegFunction::P_17_2_Deriv; + leg_der_pointers[17][3] = &AssLegFunction::P_17_3_Deriv; + leg_der_pointers[17][4] = &AssLegFunction::P_17_4_Deriv; + leg_der_pointers[17][5] = &AssLegFunction::P_17_5_Deriv; + leg_der_pointers[17][6] = &AssLegFunction::P_17_6_Deriv; + leg_der_pointers[17][7] = &AssLegFunction::P_17_7_Deriv; + leg_der_pointers[17][8] = &AssLegFunction::P_17_8_Deriv; + leg_der_pointers[17][9] = &AssLegFunction::P_17_9_Deriv; + leg_der_pointers[17][10] = &AssLegFunction::P_17_10_Deriv; + leg_der_pointers[17][11] = &AssLegFunction::P_17_11_Deriv; + leg_der_pointers[17][12] = &AssLegFunction::P_17_12_Deriv; + leg_der_pointers[17][13] = &AssLegFunction::P_17_13_Deriv; + leg_der_pointers[17][14] = &AssLegFunction::P_17_14_Deriv; + leg_der_pointers[17][15] = &AssLegFunction::P_17_15_Deriv; + leg_der_pointers[17][16] = &AssLegFunction::P_17_16_Deriv; + leg_der_pointers[17][17] = &AssLegFunction::P_17_17_Deriv; + leg_der_pointers[18][0] = &AssLegFunction::P_18_0_Deriv; + leg_der_pointers[18][1] = &AssLegFunction::P_18_1_Deriv; + leg_der_pointers[18][2] = &AssLegFunction::P_18_2_Deriv; + leg_der_pointers[18][3] = &AssLegFunction::P_18_3_Deriv; + leg_der_pointers[18][4] = &AssLegFunction::P_18_4_Deriv; + leg_der_pointers[18][5] = &AssLegFunction::P_18_5_Deriv; + leg_der_pointers[18][6] = &AssLegFunction::P_18_6_Deriv; + leg_der_pointers[18][7] = &AssLegFunction::P_18_7_Deriv; + leg_der_pointers[18][8] = &AssLegFunction::P_18_8_Deriv; + leg_der_pointers[18][9] = &AssLegFunction::P_18_9_Deriv; + leg_der_pointers[18][10] = &AssLegFunction::P_18_10_Deriv; + leg_der_pointers[18][11] = &AssLegFunction::P_18_11_Deriv; + leg_der_pointers[18][12] = &AssLegFunction::P_18_12_Deriv; + leg_der_pointers[18][13] = &AssLegFunction::P_18_13_Deriv; + leg_der_pointers[18][14] = &AssLegFunction::P_18_14_Deriv; + leg_der_pointers[18][15] = &AssLegFunction::P_18_15_Deriv; + leg_der_pointers[18][16] = &AssLegFunction::P_18_16_Deriv; + leg_der_pointers[18][17] = &AssLegFunction::P_18_17_Deriv; + leg_der_pointers[18][18] = &AssLegFunction::P_18_18_Deriv; + leg_der_pointers[19][0] = &AssLegFunction::P_19_0_Deriv; + leg_der_pointers[19][1] = &AssLegFunction::P_19_1_Deriv; + leg_der_pointers[19][2] = &AssLegFunction::P_19_2_Deriv; + leg_der_pointers[19][3] = &AssLegFunction::P_19_3_Deriv; + leg_der_pointers[19][4] = &AssLegFunction::P_19_4_Deriv; + leg_der_pointers[19][5] = &AssLegFunction::P_19_5_Deriv; + leg_der_pointers[19][6] = &AssLegFunction::P_19_6_Deriv; + leg_der_pointers[19][7] = &AssLegFunction::P_19_7_Deriv; + leg_der_pointers[19][8] = &AssLegFunction::P_19_8_Deriv; + leg_der_pointers[19][9] = &AssLegFunction::P_19_9_Deriv; + leg_der_pointers[19][10] = &AssLegFunction::P_19_10_Deriv; + leg_der_pointers[19][11] = &AssLegFunction::P_19_11_Deriv; + leg_der_pointers[19][12] = &AssLegFunction::P_19_12_Deriv; + leg_der_pointers[19][13] = &AssLegFunction::P_19_13_Deriv; + leg_der_pointers[19][14] = &AssLegFunction::P_19_14_Deriv; + leg_der_pointers[19][15] = &AssLegFunction::P_19_15_Deriv; + leg_der_pointers[19][16] = &AssLegFunction::P_19_16_Deriv; + leg_der_pointers[19][17] = &AssLegFunction::P_19_17_Deriv; + leg_der_pointers[19][18] = &AssLegFunction::P_19_18_Deriv; + leg_der_pointers[19][19] = &AssLegFunction::P_19_19_Deriv; + leg_der_pointers[20][0] = &AssLegFunction::P_20_0_Deriv; + leg_der_pointers[20][1] = &AssLegFunction::P_20_1_Deriv; + leg_der_pointers[20][2] = &AssLegFunction::P_20_2_Deriv; + leg_der_pointers[20][3] = &AssLegFunction::P_20_3_Deriv; + leg_der_pointers[20][4] = &AssLegFunction::P_20_4_Deriv; + leg_der_pointers[20][5] = &AssLegFunction::P_20_5_Deriv; + leg_der_pointers[20][6] = &AssLegFunction::P_20_6_Deriv; + leg_der_pointers[20][7] = &AssLegFunction::P_20_7_Deriv; + leg_der_pointers[20][8] = &AssLegFunction::P_20_8_Deriv; + leg_der_pointers[20][9] = &AssLegFunction::P_20_9_Deriv; + leg_der_pointers[20][10] = &AssLegFunction::P_20_10_Deriv; + leg_der_pointers[20][11] = &AssLegFunction::P_20_11_Deriv; + leg_der_pointers[20][12] = &AssLegFunction::P_20_12_Deriv; + leg_der_pointers[20][13] = &AssLegFunction::P_20_13_Deriv; + leg_der_pointers[20][14] = &AssLegFunction::P_20_14_Deriv; + leg_der_pointers[20][15] = &AssLegFunction::P_20_15_Deriv; + leg_der_pointers[20][16] = &AssLegFunction::P_20_16_Deriv; + leg_der_pointers[20][17] = &AssLegFunction::P_20_17_Deriv; + leg_der_pointers[20][18] = &AssLegFunction::P_20_18_Deriv; + leg_der_pointers[20][19] = &AssLegFunction::P_20_19_Deriv; + leg_der_pointers[20][20] = &AssLegFunction::P_20_20_Deriv; +} + +AssLegFunction::~AssLegFunction() +{} + +void +AssLegFunction::AssLegFunSph(const unsigned int p, + const unsigned int m, + double x, + double y[]) +{ + for (unsigned int n = m; n < p + 1; n++) + { + y[n - m] = (this->*leg_pointers[n][m])(x); + } +} + +void +AssLegFunction::AssLegFunSphDeriv(const unsigned int p, + const unsigned int m, + double x, + double y[], + double dy[]) +{ + for (unsigned int n = m; n < p + 1; n++) + { + y[n - m] = (this->*leg_pointers[n][m])(x); + dy[n - m] = (this->*leg_der_pointers[n][m])(x); + } +} + +double +AssLegFunction::GetAssLegFunSph(const unsigned int n, + const unsigned int m, + double x) const +{ + return (this->*leg_pointers[n][m])(x); +} + +double +AssLegFunction::GetAssLegFunSphDeriv(const unsigned int n, + const unsigned int m, + double x) const +{ + return (this->*leg_der_pointers[n][m])(x); +} + +double +AssLegFunction::P_0_0(const double x) const +{ + return 1; +} + +double +AssLegFunction::P_0_0_Deriv(const double x) const +{ + return 0; +} + +double +AssLegFunction::P_1_0(const double x) const +{ + return x; +} + +double +AssLegFunction::P_1_0_Deriv(const double x) const +{ + return 1; +} + +double +AssLegFunction::P_1_1(const double x) const +{ + return -sqrt(1 - pow(x, 2)); +} + +double +AssLegFunction::P_1_1_Deriv(const double x) const +{ + return x / sqrt(1 - pow(x, 2)); +} + +double +AssLegFunction::P_2_0(const double x) const +{ + return (3.0 / 2.0) * pow(x, 2) - 1.0 / 2.0; +} + +double +AssLegFunction::P_2_0_Deriv(const double x) const +{ + return 3 * x; +} + +double +AssLegFunction::P_2_1(const double x) const +{ + return -3 * x * sqrt(1 - pow(x, 2)); +} + +double +AssLegFunction::P_2_1_Deriv(const double x) const +{ + return 3 * (2 * pow(x, 2) - 1) / sqrt(1 - pow(x, 2)); +} + +double +AssLegFunction::P_2_2(const double x) const +{ + return 3 - 3 * pow(x, 2); +} + +double +AssLegFunction::P_2_2_Deriv(const double x) const +{ + return -6 * x; +} + +double +AssLegFunction::P_3_0(const double x) const +{ + return (1.0 / 2.0) * x * (5 * pow(x, 2) - 3); +} + +double +AssLegFunction::P_3_0_Deriv(const double x) const +{ + return (15.0 / 2.0) * pow(x, 2) - 3.0 / 2.0; +} + +double +AssLegFunction::P_3_1(const double x) const +{ + return (3.0 / 2.0) * (1 - 5 * pow(x, 2)) * sqrt(1 - pow(x, 2)); +} + +double +AssLegFunction::P_3_1_Deriv(const double x) const +{ + return (1.0 / 2.0) * (45 * pow(x, 3) - 33 * x) / sqrt(1 - pow(x, 2)); +} + +double +AssLegFunction::P_3_2(const double x) const +{ + return 15 * x * (1 - pow(x, 2)); +} + +double +AssLegFunction::P_3_2_Deriv(const double x) const +{ + return 15 - 45 * pow(x, 2); +} + +double +AssLegFunction::P_3_3(const double x) const +{ + return -15 * pow(1 - pow(x, 2), 3.0 / 2.0); +} + +double +AssLegFunction::P_3_3_Deriv(const double x) const +{ + return 45 * x * sqrt(1 - pow(x, 2)); +} + +double +AssLegFunction::P_4_0(const double x) const +{ + return (35.0 / 8.0) * pow(x, 4) - 15.0 / 4.0 * pow(x, 2) + 3.0 / 8.0; +} + +double +AssLegFunction::P_4_0_Deriv(const double x) const +{ + return (5.0 / 2.0) * x * (7 * pow(x, 2) - 3); +} + +double +AssLegFunction::P_4_1(const double x) const +{ + return (5.0 / 2.0) * x * sqrt(1 - pow(x, 2)) * (3 - 7 * pow(x, 2)); +} + +double +AssLegFunction::P_4_1_Deriv(const double x) const +{ + return (5.0 / 2.0) * (28 * pow(x, 4) - 27 * pow(x, 2) + 3) / + sqrt(1 - pow(x, 2)); +} + +double +AssLegFunction::P_4_2(const double x) const +{ + return -105.0 / 2.0 * pow(x, 4) + 60 * pow(x, 2) - 15.0 / 2.0; +} + +double +AssLegFunction::P_4_2_Deriv(const double x) const +{ + return -210 * pow(x, 3) + 120 * x; +} + +double +AssLegFunction::P_4_3(const double x) const +{ + return -105 * x * pow(1 - pow(x, 2), 3.0 / 2.0); +} + +double +AssLegFunction::P_4_3_Deriv(const double x) const +{ + return sqrt(1 - pow(x, 2)) * (420 * pow(x, 2) - 105); +} + +double +AssLegFunction::P_4_4(const double x) const +{ + return 105 * pow(pow(x, 2) - 1, 2); +} + +double +AssLegFunction::P_4_4_Deriv(const double x) const +{ + return 420 * x * (pow(x, 2) - 1); +} + +double +AssLegFunction::P_5_0(const double x) const +{ + return (1.0 / 8.0) * x * (63 * pow(x, 4) - 70 * pow(x, 2) + 15); +} + +double +AssLegFunction::P_5_0_Deriv(const double x) const +{ + return (315.0 / 8.0) * pow(x, 4) - 105.0 / 4.0 * pow(x, 2) + 15.0 / 8.0; +} + +double +AssLegFunction::P_5_1(const double x) const +{ + return (15.0 / 8.0) * sqrt(1 - pow(x, 2)) * + (-21 * pow(x, 4) + 14 * pow(x, 2) - 1); +} + +double +AssLegFunction::P_5_1_Deriv(const double x) const +{ + return (1.0 / 8.0) * (1575 * pow(x, 5) - 1890 * pow(x, 3) + 435 * x) / + sqrt(1 - pow(x, 2)); +} + +double +AssLegFunction::P_5_2(const double x) const +{ + return (105.0 / 2.0) * x * (-3 * pow(x, 4) + 4 * pow(x, 2) - 1); +} + +double +AssLegFunction::P_5_2_Deriv(const double x) const +{ + return -1575.0 / 2.0 * pow(x, 4) + 630 * pow(x, 2) - 105.0 / 2.0; +} + +double +AssLegFunction::P_5_3(const double x) const +{ + return (105.0 / 2.0) * (1 - 9 * pow(x, 2)) * pow(1 - pow(x, 2), 3.0 / 2.0); +} + +double +AssLegFunction::P_5_3_Deriv(const double x) const +{ + return (315.0 / 2.0) * x * sqrt(1 - pow(x, 2)) * (15 * pow(x, 2) - 7); +} + +double +AssLegFunction::P_5_4(const double x) const +{ + return 945 * x * pow(pow(x, 2) - 1, 2); +} + +double +AssLegFunction::P_5_4_Deriv(const double x) const +{ + return 4725 * pow(x, 4) - 5670 * pow(x, 2) + 945; +} + +double +AssLegFunction::P_5_5(const double x) const +{ + return -945 * pow(1 - pow(x, 2), 5.0 / 2.0); +} + +double +AssLegFunction::P_5_5_Deriv(const double x) const +{ + return 4725 * x * pow(1 - pow(x, 2), 3.0 / 2.0); +} + +double +AssLegFunction::P_6_0(const double x) const +{ + return (231.0 / 16.0) * pow(x, 6) - 315.0 / 16.0 * pow(x, 4) + + (105.0 / 16.0) * pow(x, 2) - 5.0 / 16.0; +} + +double +AssLegFunction::P_6_0_Deriv(const double x) const +{ + return (21.0 / 8.0) * x * (33 * pow(x, 4) - 30 * pow(x, 2) + 5); +} + +double +AssLegFunction::P_6_1(const double x) const +{ + return (21.0 / 8.0) * x * sqrt(1 - pow(x, 2)) * + (-33 * pow(x, 4) + 30 * pow(x, 2) - 5); +} + +double +AssLegFunction::P_6_1_Deriv(const double x) const +{ + return (21.0 / 8.0) * + (198 * pow(x, 6) - 285 * pow(x, 4) + 100 * pow(x, 2) - 5) / + sqrt(1 - pow(x, 2)); +} + +double +AssLegFunction::P_6_2(const double x) const +{ + return -3465.0 / 8.0 * pow(x, 6) + (5355.0 / 8.0) * pow(x, 4) - + 1995.0 / 8.0 * pow(x, 2) + 105.0 / 8.0; +} + +double +AssLegFunction::P_6_2_Deriv(const double x) const +{ + return (105.0 / 4.0) * x * (-99 * pow(x, 4) + 102 * pow(x, 2) - 19); +} + +double +AssLegFunction::P_6_3(const double x) const +{ + return (315.0 / 2.0) * x * pow(1 - pow(x, 2), 3.0 / 2.0) * + (3 - 11 * pow(x, 2)); +} + +double +AssLegFunction::P_6_3_Deriv(const double x) const +{ + return (945.0 / 2.0) * sqrt(1 - pow(x, 2)) * + (22 * pow(x, 4) - 15 * pow(x, 2) + 1); +} + +double +AssLegFunction::P_6_4(const double x) const +{ + return (945.0 / 2.0) * pow(pow(x, 2) - 1, 2) * (11 * pow(x, 2) - 1); +} + +double +AssLegFunction::P_6_4_Deriv(const double x) const +{ + return 31185 * pow(x, 5) - 43470 * pow(x, 3) + 12285 * x; +} + +double +AssLegFunction::P_6_5(const double x) const +{ + return -10395 * x * pow(1 - pow(x, 2), 5.0 / 2.0); +} + +double +AssLegFunction::P_6_5_Deriv(const double x) const +{ + return pow(1 - pow(x, 2), 3.0 / 2.0) * (62370 * pow(x, 2) - 10395); +} + +double +AssLegFunction::P_6_6(const double x) const +{ + return -10395 * pow(pow(x, 2) - 1, 3); +} + +double +AssLegFunction::P_6_6_Deriv(const double x) const +{ + return -62370 * x * pow(pow(x, 2) - 1, 2); +} + +double +AssLegFunction::P_7_0(const double x) const +{ + return (1.0 / 16.0) * x * + (429 * pow(x, 6) - 693 * pow(x, 4) + 315 * pow(x, 2) - 35); +} + +double +AssLegFunction::P_7_0_Deriv(const double x) const +{ + return (3003.0 / 16.0) * pow(x, 6) - 3465.0 / 16.0 * pow(x, 4) + + (945.0 / 16.0) * pow(x, 2) - 35.0 / 16.0; +} + +double +AssLegFunction::P_7_1(const double x) const +{ + return (7.0 / 16.0) * sqrt(1 - pow(x, 2)) * + (-429 * pow(x, 6) + 495 * pow(x, 4) - 135 * pow(x, 2) + 5); +} + +double +AssLegFunction::P_7_1_Deriv(const double x) const +{ + return (1.0 / 16.0) * + (21021 * pow(x, 7) - 35343 * pow(x, 5) + 16695 * pow(x, 3) - + 1925 * x) / + sqrt(1 - pow(x, 2)); +} + +double +AssLegFunction::P_7_2(const double x) const +{ + return (63.0 / 8.0) * x * + (-143 * pow(x, 6) + 253 * pow(x, 4) - 125 * pow(x, 2) + 15); +} + +double +AssLegFunction::P_7_2_Deriv(const double x) const +{ + return -63063.0 / 8.0 * pow(x, 6) + (79695.0 / 8.0) * pow(x, 4) - + 23625.0 / 8.0 * pow(x, 2) + 945.0 / 8.0; +} + +double +AssLegFunction::P_7_3(const double x) const +{ + return (315.0 / 8.0) * pow(1 - pow(x, 2), 3.0 / 2.0) * + (-143 * pow(x, 4) + 66 * pow(x, 2) - 3); +} + +double +AssLegFunction::P_7_3_Deriv(const double x) const +{ + return (315.0 / 8.0) * x * sqrt(1 - pow(x, 2)) * + (1001 * pow(x, 4) - 902 * pow(x, 2) + 141); +} + +double +AssLegFunction::P_7_4(const double x) const +{ + return (3465.0 / 2.0) * x * pow(pow(x, 2) - 1, 2) * (13 * pow(x, 2) - 3); +} + +double +AssLegFunction::P_7_4_Deriv(const double x) const +{ + return (315315.0 / 2.0) * pow(x, 6) - 502425.0 / 2.0 * pow(x, 4) + + (197505.0 / 2.0) * pow(x, 2) - 10395.0 / 2.0; +} + +double +AssLegFunction::P_7_5(const double x) const +{ + return (10395.0 / 2.0) * (1 - 13 * pow(x, 2)) * pow(1 - pow(x, 2), 5.0 / 2.0); +} + +double +AssLegFunction::P_7_5_Deriv(const double x) const +{ + return (10395.0 / 2.0) * x * pow(1 - pow(x, 2), 3.0 / 2.0) * + (91 * pow(x, 2) - 31); +} + +double +AssLegFunction::P_7_6(const double x) const +{ + return -135135 * x * pow(pow(x, 2) - 1, 3); +} + +double +AssLegFunction::P_7_6_Deriv(const double x) const +{ + return (135135 - 945945 * pow(x, 2)) * pow(pow(x, 2) - 1, 2); +} + +double +AssLegFunction::P_7_7(const double x) const +{ + return -135135 * pow(1 - pow(x, 2), 7.0 / 2.0); +} + +double +AssLegFunction::P_7_7_Deriv(const double x) const +{ + return 945945 * x * pow(1 - pow(x, 2), 5.0 / 2.0); +} + +double +AssLegFunction::P_8_0(const double x) const +{ + return (6435.0 / 128.0) * pow(x, 8) - 3003.0 / 32.0 * pow(x, 6) + + (3465.0 / 64.0) * pow(x, 4) - 315.0 / 32.0 * pow(x, 2) + 35.0 / 128.0; +} + +double +AssLegFunction::P_8_0_Deriv(const double x) const +{ + return (9.0 / 16.0) * x * + (715 * pow(x, 6) - 1001 * pow(x, 4) + 385 * pow(x, 2) - 35); +} + +double +AssLegFunction::P_8_1(const double x) const +{ + return (9.0 / 16.0) * x * sqrt(1 - pow(x, 2)) * + (-715 * pow(x, 6) + 1001 * pow(x, 4) - 385 * pow(x, 2) + 35); +} + +double +AssLegFunction::P_8_1_Deriv(const double x) const +{ + return (9.0 / 16.0) * + (5720 * pow(x, 8) - 11011 * pow(x, 6) + 6545 * pow(x, 4) - + 1225 * pow(x, 2) + 35) / + sqrt(1 - pow(x, 2)); +} + +double +AssLegFunction::P_8_2(const double x) const +{ + return -45045.0 / 16.0 * pow(x, 8) + (45045.0 / 8.0) * pow(x, 6) - + 3465 * pow(x, 4) + (5355.0 / 8.0) * pow(x, 2) - 315.0 / 16.0; +} + +double +AssLegFunction::P_8_2_Deriv(const double x) const +{ + return (315.0 / 4.0) * x * + (-286 * pow(x, 6) + 429 * pow(x, 4) - 176 * pow(x, 2) + 17); +} + +double +AssLegFunction::P_8_3(const double x) const +{ + return (3465.0 / 8.0) * x * pow(1 - pow(x, 2), 3.0 / 2.0) * + (-39 * pow(x, 4) + 26 * pow(x, 2) - 3); +} + +double +AssLegFunction::P_8_3_Deriv(const double x) const +{ + return (10395.0 / 8.0) * sqrt(1 - pow(x, 2)) * + (104 * pow(x, 6) - 117 * pow(x, 4) + 30 * pow(x, 2) - 1); +} + +double +AssLegFunction::P_8_4(const double x) const +{ + return (10395.0 / 8.0) * pow(pow(x, 2) - 1, 2) * + (65 * pow(x, 4) - 26 * pow(x, 2) + 1); +} + +double +AssLegFunction::P_8_4_Deriv(const double x) const +{ + return 675675 * pow(x, 7) - 1216215 * pow(x, 5) + 613305 * pow(x, 3) - + 72765 * x; +} + +double +AssLegFunction::P_8_5(const double x) const +{ + return (135135.0 / 2.0) * x * (1 - 5 * pow(x, 2)) * + pow(1 - pow(x, 2), 5.0 / 2.0); +} + +double +AssLegFunction::P_8_5_Deriv(const double x) const +{ + return (135135.0 / 2.0) * sqrt(1 - pow(x, 2)) * + (-40 * pow(x, 6) + 61 * pow(x, 4) - 22 * pow(x, 2) + 1); +} + +double +AssLegFunction::P_8_6(const double x) const +{ + return (135135.0 / 2.0) * (1 - 15 * pow(x, 2)) * pow(pow(x, 2) - 1, 3); +} + +double +AssLegFunction::P_8_6_Deriv(const double x) const +{ + return 810810 * x * (3 - 10 * pow(x, 2)) * pow(pow(x, 2) - 1, 2); +} + +double +AssLegFunction::P_8_7(const double x) const +{ + return -2027025 * x * pow(1 - pow(x, 2), 7.0 / 2.0); +} + +double +AssLegFunction::P_8_7_Deriv(const double x) const +{ + return pow(1 - pow(x, 2), 5.0 / 2.0) * (16216200 * pow(x, 2) - 2027025); +} + +double +AssLegFunction::P_8_8(const double x) const +{ + return 2027025 * pow(pow(x, 2) - 1, 4); +} + +double +AssLegFunction::P_8_8_Deriv(const double x) const +{ + return 16216200 * x * pow(pow(x, 2) - 1, 3); +} + +double +AssLegFunction::P_9_0(const double x) const +{ + return (1.0 / 128.0) * x * + (12155 * pow(x, 8) - 25740 * pow(x, 6) + 18018 * pow(x, 4) - + 4620 * pow(x, 2) + 315); +} + +double +AssLegFunction::P_9_0_Deriv(const double x) const +{ + return (109395.0 / 128.0) * pow(x, 8) - 45045.0 / 32.0 * pow(x, 6) + + (45045.0 / 64.0) * pow(x, 4) - 3465.0 / 32.0 * pow(x, 2) + + 315.0 / 128.0; +} + +double +AssLegFunction::P_9_1(const double x) const +{ + return (45.0 / 128.0) * sqrt(1 - pow(x, 2)) * + (-2431 * pow(x, 8) + 4004 * pow(x, 6) - 2002 * pow(x, 4) + + 308 * pow(x, 2) - 7); +} + +double +AssLegFunction::P_9_1_Deriv(const double x) const +{ + return (1.0 / 128.0) * + (984555 * pow(x, 9) - 2136420 * pow(x, 7) + 1531530 * pow(x, 5) - + 401940 * pow(x, 3) + 28035 * x) / + sqrt(1 - pow(x, 2)); +} + +double +AssLegFunction::P_9_2(const double x) const +{ + return (495.0 / 16.0) * x * + (-221 * pow(x, 8) + 494 * pow(x, 6) - 364 * pow(x, 4) + + 98 * pow(x, 2) - 7); +} + +double +AssLegFunction::P_9_2_Deriv(const double x) const +{ + return -984555.0 / 16.0 * pow(x, 8) + (855855.0 / 8.0) * pow(x, 6) - + 225225.0 / 4.0 * pow(x, 4) + (72765.0 / 8.0) * pow(x, 2) - + 3465.0 / 16.0; +} + +double +AssLegFunction::P_9_3(const double x) const +{ + return (3465.0 / 16.0) * pow(1 - pow(x, 2), 3.0 / 2.0) * + (-221 * pow(x, 6) + 195 * pow(x, 4) - 39 * pow(x, 2) + 1); +} + +double +AssLegFunction::P_9_3_Deriv(const double x) const +{ + return (10395.0 / 16.0) * x * sqrt(1 - pow(x, 2)) * + (663 * pow(x, 6) - 897 * pow(x, 4) + 325 * pow(x, 2) - 27); +} + +double +AssLegFunction::P_9_4(const double x) const +{ + return (135135.0 / 8.0) * x * pow(pow(x, 2) - 1, 2) * + (17 * pow(x, 4) - 10 * pow(x, 2) + 1); +} + +double +AssLegFunction::P_9_4_Deriv(const double x) const +{ + return (20675655.0 / 8.0) * pow(x, 8) - 10405395.0 / 2.0 * pow(x, 6) + + (12837825.0 / 4.0) * pow(x, 4) - 1216215.0 / 2.0 * pow(x, 2) + + 135135.0 / 8.0; +} + +double +AssLegFunction::P_9_5(const double x) const +{ + return (135135.0 / 8.0) * pow(1 - pow(x, 2), 5.0 / 2.0) * + (-85 * pow(x, 4) + 30 * pow(x, 2) - 1); +} + +double +AssLegFunction::P_9_5_Deriv(const double x) const +{ + return (675675.0 / 8.0) * x * sqrt(1 - pow(x, 2)) * + (-153 * pow(x, 6) + 263 * pow(x, 4) - 123 * pow(x, 2) + 13); +} + +double +AssLegFunction::P_9_6(const double x) const +{ + return (675675.0 / 2.0) * x * (3 - 17 * pow(x, 2)) * pow(pow(x, 2) - 1, 3); +} + +double +AssLegFunction::P_9_6_Deriv(const double x) const +{ + return -103378275.0 / 2.0 * pow(x, 8) + 127702575.0 * pow(x, 6) - + 101351250.0 * pow(x, 4) + 26351325 * pow(x, 2) - 2027025.0 / 2.0; +} + +double +AssLegFunction::P_9_7(const double x) const +{ + return (2027025.0 / 2.0) * (1 - 17 * pow(x, 2)) * + pow(1 - pow(x, 2), 7.0 / 2.0); +} + +double +AssLegFunction::P_9_7_Deriv(const double x) const +{ + return (2027025.0 / 2.0) * x * pow(1 - pow(x, 2), 5.0 / 2.0) * + (153 * pow(x, 2) - 41); +} + +double +AssLegFunction::P_9_8(const double x) const +{ + return 34459425 * x * pow(pow(x, 2) - 1, 4); +} + +double +AssLegFunction::P_9_8_Deriv(const double x) const +{ + return pow(pow(x, 2) - 1, 3) * (310134825.0 * pow(x, 2) - 34459425); +} + +double +AssLegFunction::P_9_9(const double x) const +{ + return -34459425 * pow(1 - pow(x, 2), 9.0 / 2.0); +} + +double +AssLegFunction::P_9_9_Deriv(const double x) const +{ + return 310134825.0 * x * pow(1 - pow(x, 2), 7.0 / 2.0); +} + +double +AssLegFunction::P_10_0(const double x) const +{ + return (46189.0 / 256.0) * pow(x, 10) - 109395.0 / 256.0 * pow(x, 8) + + (45045.0 / 128.0) * pow(x, 6) - 15015.0 / 128.0 * pow(x, 4) + + (3465.0 / 256.0) * pow(x, 2) - 63.0 / 256.0; +} + +double +AssLegFunction::P_10_0_Deriv(const double x) const +{ + return (55.0 / 128.0) * x * + (4199 * pow(x, 8) - 7956 * pow(x, 6) + 4914 * pow(x, 4) - + 1092 * pow(x, 2) + 63); +} + +double +AssLegFunction::P_10_1(const double x) const +{ + return (55.0 / 128.0) * x * sqrt(1 - pow(x, 2)) * + (-4199 * pow(x, 8) + 7956 * pow(x, 6) - 4914 * pow(x, 4) + + 1092 * pow(x, 2) - 63); +} + +double +AssLegFunction::P_10_1_Deriv(const double x) const +{ + return (55.0 / 128.0) * + (41990 * pow(x, 10) - 101439 * pow(x, 8) + 85176 * pow(x, 6) - + 28938 * pow(x, 4) + 3402 * pow(x, 2) - 63) / + sqrt(1 - pow(x, 2)); +} + +double +AssLegFunction::P_10_2(const double x) const +{ + return -2078505.0 / 128.0 * pow(x, 10) + (5141565.0 / 128.0) * pow(x, 8) - + 2207205.0 / 64.0 * pow(x, 6) + (765765.0 / 64.0) * pow(x, 4) - + 183645.0 / 128.0 * pow(x, 2) + 3465.0 / 128.0; +} + +double +AssLegFunction::P_10_2_Deriv(const double x) const +{ + return (495.0 / 64.0) * x * + (-20995 * pow(x, 8) + 41548 * pow(x, 6) - 26754 * pow(x, 4) + + 6188 * pow(x, 2) - 371); +} + +double +AssLegFunction::P_10_3(const double x) const +{ + return (6435.0 / 16.0) * x * pow(1 - pow(x, 2), 3.0 / 2.0) * + (-323 * pow(x, 6) + 357 * pow(x, 4) - 105 * pow(x, 2) + 7); +} + +double +AssLegFunction::P_10_3_Deriv(const double x) const +{ + return (6435.0 / 16.0) * sqrt(1 - pow(x, 2)) * + (3230 * pow(x, 8) - 5117 * pow(x, 6) + 2415 * pow(x, 4) - + 343 * pow(x, 2) + 7); +} + +double +AssLegFunction::P_10_4(const double x) const +{ + return (45045.0 / 16.0) * pow(pow(x, 2) - 1, 2) * + (323 * pow(x, 6) - 255 * pow(x, 4) + 45 * pow(x, 2) - 1); +} + +double +AssLegFunction::P_10_4_Deriv(const double x) const +{ + return (45045.0 / 8.0) * x * + (1615 * pow(x, 8) - 3604 * pow(x, 6) + 2634 * pow(x, 4) - + 692 * pow(x, 2) + 47); +} + +double +AssLegFunction::P_10_5(const double x) const +{ + return (135135.0 / 8.0) * x * pow(1 - pow(x, 2), 5.0 / 2.0) * + (-323 * pow(x, 4) + 170 * pow(x, 2) - 15); +} + +double +AssLegFunction::P_10_5_Deriv(const double x) const +{ + return (675675.0 / 8.0) * sqrt(1 - pow(x, 2)) * + (-646 * pow(x, 8) + 1241 * pow(x, 6) - 715 * pow(x, 4) + + 123 * pow(x, 2) - 3); +} + +double +AssLegFunction::P_10_6(const double x) const +{ + return (675675.0 / 8.0) * pow(pow(x, 2) - 1, 3) * + (-323 * pow(x, 4) + 102 * pow(x, 2) - 3); +} + +double +AssLegFunction::P_10_6_Deriv(const double x) const +{ + return (675675.0 / 4.0) * x * + (-1615 * pow(x, 8) + 4284 * pow(x, 6) - 3834 * pow(x, 4) + + 1276 * pow(x, 2) - 111); +} + +double +AssLegFunction::P_10_7(const double x) const +{ + return (11486475.0 / 2.0) * x * pow(1 - pow(x, 2), 7.0 / 2.0) * + (3 - 19 * pow(x, 2)); +} + +double +AssLegFunction::P_10_7_Deriv(const double x) const +{ + return (11486475.0 / 2.0) * sqrt(1 - pow(x, 2)) * + (190 * pow(x, 8) - 461 * pow(x, 6) + 355 * pow(x, 4) - 87 * pow(x, 2) + + 3); +} + +double +AssLegFunction::P_10_8(const double x) const +{ + return (34459425.0 / 2.0) * pow(pow(x, 2) - 1, 4) * (19 * pow(x, 2) - 1); +} + +double +AssLegFunction::P_10_8_Deriv(const double x) const +{ + return 34459425 * x * pow(pow(x, 2) - 1, 3) * (95 * pow(x, 2) - 23); +} + +double +AssLegFunction::P_10_9(const double x) const +{ + return -654729075.0 * x * pow(1 - pow(x, 2), 9.0 / 2.0); +} + +double +AssLegFunction::P_10_9_Deriv(const double x) const +{ + return pow(1 - pow(x, 2), 7.0 / 2.0) * + (6547290750.0 * pow(x, 2) - 654729075.0); +} + +double +AssLegFunction::P_10_10(const double x) const +{ + return -654729075.0 * pow(pow(x, 2) - 1, 5); +} + +double +AssLegFunction::P_10_10_Deriv(const double x) const +{ + return -6547290750.0 * x * pow(pow(x, 2) - 1, 4); +} + +double +AssLegFunction::P_11_0(const double x) const +{ + return (1.0 / 256.0) * x * + (88179 * pow(x, 10) - 230945 * pow(x, 8) + 218790 * pow(x, 6) - + 90090 * pow(x, 4) + 15015 * pow(x, 2) - 693); +} + +double +AssLegFunction::P_11_0_Deriv(const double x) const +{ + return (969969.0 / 256.0) * pow(x, 10) - 2078505.0 / 256.0 * pow(x, 8) + + (765765.0 / 128.0) * pow(x, 6) - 225225.0 / 128.0 * pow(x, 4) + + (45045.0 / 256.0) * pow(x, 2) - 693.0 / 256.0; +} + +double +AssLegFunction::P_11_1(const double x) const +{ + return (33.0 / 256.0) * sqrt(1 - pow(x, 2)) * + (-29393 * pow(x, 10) + 62985 * pow(x, 8) - 46410 * pow(x, 6) + + 13650 * pow(x, 4) - 1365 * pow(x, 2) + 21); +} + +double +AssLegFunction::P_11_1_Deriv(const double x) const +{ + return (1.0 / 256.0) * + (10669659 * pow(x, 11) - 28406235 * pow(x, 9) + 27348750 * pow(x, 7) - + 11441430 * pow(x, 5) + 1936935 * pow(x, 3) - 90783 * x) / + sqrt(1 - pow(x, 2)); +} + +double +AssLegFunction::P_11_2(const double x) const +{ + return (2145.0 / 128.0) * x * + (-2261 * pow(x, 10) + 6137 * pow(x, 8) - 6018 * pow(x, 6) + + 2562 * pow(x, 4) - 441 * pow(x, 2) + 21); +} + +double +AssLegFunction::P_11_2_Deriv(const double x) const +{ + return -53348295.0 / 128.0 * pow(x, 10) + (118474785.0 / 128.0) * pow(x, 8) - + 45180135.0 / 64.0 * pow(x, 6) + (13738725.0 / 64.0) * pow(x, 4) - + 2837835.0 / 128.0 * pow(x, 2) + 45045.0 / 128.0; +} + +double +AssLegFunction::P_11_3(const double x) const +{ + return (45045.0 / 128.0) * pow(1 - pow(x, 2), 3.0 / 2.0) * + (-969 * pow(x, 8) + 1292 * pow(x, 6) - 510 * pow(x, 4) + + 60 * pow(x, 2) - 1); +} + +double +AssLegFunction::P_11_3_Deriv(const double x) const +{ + return (135135.0 / 128.0) * x * sqrt(1 - pow(x, 2)) * + (3553 * pow(x, 8) - 6460 * pow(x, 6) + 3774 * pow(x, 4) - + 780 * pow(x, 2) + 41); +} + +double +AssLegFunction::P_11_4(const double x) const +{ + return (135135.0 / 16.0) * x * pow(pow(x, 2) - 1, 2) * + (323 * pow(x, 6) - 323 * pow(x, 4) + 85 * pow(x, 2) - 5); +} + +double +AssLegFunction::P_11_4_Deriv(const double x) const +{ + return (480134655.0 / 16.0) * pow(x, 10) - 1178512335.0 / 16.0 * pow(x, 8) + + (498513015.0 / 8.0) * pow(x, 6) - 168243075.0 / 8.0 * pow(x, 4) + + (38513475.0 / 16.0) * pow(x, 2) - 675675.0 / 16.0; +} + +double +AssLegFunction::P_11_5(const double x) const +{ + return (135135.0 / 16.0) * pow(1 - pow(x, 2), 5.0 / 2.0) * + (-2261 * pow(x, 6) + 1615 * pow(x, 4) - 255 * pow(x, 2) + 5); +} + +double +AssLegFunction::P_11_5_Deriv(const double x) const +{ + return (135135.0 / 16.0) * x * sqrt(1 - pow(x, 2)) * + (-24871 * pow(x, 8) + 52972 * pow(x, 6) - 36346 * pow(x, 4) + + 8780 * pow(x, 2) - 535); +} + +double +AssLegFunction::P_11_6(const double x) const +{ + return (2297295.0 / 8.0) * x * pow(pow(x, 2) - 1, 3) * + (-399 * pow(x, 4) + 190 * pow(x, 2) - 15); +} + +double +AssLegFunction::P_11_6_Deriv(const double x) const +{ + return -10082827755.0 / 8.0 * pow(x, 10) + (28677133485.0 / 8.0) * pow(x, 8) - + 14328228915.0 / 4.0 * pow(x, 6) + (5823642825.0 / 4.0) * pow(x, 4) - + 1619592975.0 / 8.0 * pow(x, 2) + 34459425.0 / 8.0; +} + +double +AssLegFunction::P_11_7(const double x) const +{ + return (34459425.0 / 8.0) * pow(1 - pow(x, 2), 7.0 / 2.0) * + (-133 * pow(x, 4) + 38 * pow(x, 2) - 1); +} + +double +AssLegFunction::P_11_7_Deriv(const double x) const +{ + return (34459425.0 / 8.0) * x * sqrt(1 - pow(x, 2)) * + (1463 * pow(x, 8) - 3800 * pow(x, 6) + 3294 * pow(x, 4) - + 1040 * pow(x, 2) + 83); +} + +double +AssLegFunction::P_11_8(const double x) const +{ + return (654729075.0 / 2.0) * x * pow(pow(x, 2) - 1, 4) * (7 * pow(x, 2) - 1); +} + +double +AssLegFunction::P_11_8_Deriv(const double x) const +{ + return (50414138775.0 / 2.0) * pow(x, 10) - 170884288575.0 / 2.0 * pow(x, 8) + + 105411381075.0 * pow(x, 6) - 55651971375.0 * pow(x, 4) + + (21606059475.0 / 2.0) * pow(x, 2) - 654729075.0 / 2.0; +} + +double +AssLegFunction::P_11_9(const double x) const +{ + return (654729075.0 / 2.0) * (1 - 21 * pow(x, 2)) * + pow(1 - pow(x, 2), 9.0 / 2.0); +} + +double +AssLegFunction::P_11_9_Deriv(const double x) const +{ + return (1964187225.0 / 2.0) * x * pow(1 - pow(x, 2), 7.0 / 2.0) * + (77 * pow(x, 2) - 17); +} + +double +AssLegFunction::P_11_10(const double x) const +{ + return -13749310575.0 * x * pow(pow(x, 2) - 1, 5); +} + +double +AssLegFunction::P_11_10_Deriv(const double x) const +{ + return (13749310575.0 - 151242416325.0 * pow(x, 2)) * pow(pow(x, 2) - 1, 4); +} + +double +AssLegFunction::P_11_11(const double x) const +{ + return -13749310575.0 * pow(1 - pow(x, 2), 11.0 / 2.0); +} + +double +AssLegFunction::P_11_11_Deriv(const double x) const +{ + return 151242416325.0 * x * pow(1 - pow(x, 2), 9.0 / 2.0); +} + +double +AssLegFunction::P_12_0(const double x) const +{ + return (676039.0 / 1024.0) * pow(x, 12) - 969969.0 / 512.0 * pow(x, 10) + + (2078505.0 / 1024.0) * pow(x, 8) - 255255.0 / 256.0 * pow(x, 6) + + (225225.0 / 1024.0) * pow(x, 4) - 9009.0 / 512.0 * pow(x, 2) + + 231.0 / 1024.0; +} + +double +AssLegFunction::P_12_0_Deriv(const double x) const +{ + return (39.0 / 256.0) * x * + (52003 * pow(x, 10) - 124355 * pow(x, 8) + 106590 * pow(x, 6) - + 39270 * pow(x, 4) + 5775 * pow(x, 2) - 231); +} + +double +AssLegFunction::P_12_1(const double x) const +{ + return (39.0 / 256.0) * x * sqrt(1 - pow(x, 2)) * + (-52003 * pow(x, 10) + 124355 * pow(x, 8) - 106590 * pow(x, 6) + + 39270 * pow(x, 4) - 5775 * pow(x, 2) + 231); +} + +double +AssLegFunction::P_12_1_Deriv(const double x) const +{ + return (39.0 / 256.0) * + (624036 * pow(x, 12) - 1815583 * pow(x, 10) + 1971915 * pow(x, 8) - + 981750 * pow(x, 6) + 219450 * pow(x, 4) - 17787 * pow(x, 2) + 231) / + sqrt(1 - pow(x, 2)); +} + +double +AssLegFunction::P_12_2(const double x) const +{ + return -22309287.0 / 256.0 * pow(x, 12) + (16489473.0 / 64.0) * pow(x, 10) - + 72747675.0 / 256.0 * pow(x, 8) + (2297295.0 / 16.0) * pow(x, 6) - + 8333325.0 / 256.0 * pow(x, 4) + (171171.0 / 64.0) * pow(x, 2) - + 9009.0 / 256.0; +} + +double +AssLegFunction::P_12_2_Deriv(const double x) const +{ + return (3003.0 / 64.0) * x * + (-22287 * pow(x, 10) + 54910 * pow(x, 8) - 48450 * pow(x, 6) + + 18360 * pow(x, 4) - 2775 * pow(x, 2) + 114); +} + +double +AssLegFunction::P_12_3(const double x) const +{ + return (15015.0 / 128.0) * x * pow(1 - pow(x, 2), 3.0 / 2.0) * + (-7429 * pow(x, 8) + 11628 * pow(x, 6) - 5814 * pow(x, 4) + + 1020 * pow(x, 2) - 45); +} + +double +AssLegFunction::P_12_3_Deriv(const double x) const +{ + return (45045.0 / 128.0) * sqrt(1 - pow(x, 2)) * + (29716 * pow(x, 10) - 61047 * pow(x, 8) + 42636 * pow(x, 6) - + 11730 * pow(x, 4) + 1080 * pow(x, 2) - 15); +} + +double +AssLegFunction::P_12_4(const double x) const +{ + return (135135.0 / 128.0) * pow(pow(x, 2) - 1, 2) * + (7429 * pow(x, 8) - 9044 * pow(x, 6) + 3230 * pow(x, 4) - + 340 * pow(x, 2) + 5); +} + +double +AssLegFunction::P_12_4_Deriv(const double x) const +{ + return (135135.0 / 32.0) * x * + (22287 * pow(x, 10) - 59755 * pow(x, 8) + 57494 * pow(x, 6) - + 23766 * pow(x, 4) + 3915 * pow(x, 2) - 175); +} + +double +AssLegFunction::P_12_5(const double x) const +{ + return (2297295.0 / 16.0) * x * pow(1 - pow(x, 2), 5.0 / 2.0) * + (-437 * pow(x, 6) + 399 * pow(x, 4) - 95 * pow(x, 2) + 5); +} + +double +AssLegFunction::P_12_5_Deriv(const double x) const +{ + return (2297295.0 / 16.0) * sqrt(1 - pow(x, 2)) * + (-5244 * pow(x, 10) + 12293 * pow(x, 8) - 9804 * pow(x, 6) + + 3070 * pow(x, 4) - 320 * pow(x, 2) + 5); +} + +double +AssLegFunction::P_12_6(const double x) const +{ + return (2297295.0 / 16.0) * pow(pow(x, 2) - 1, 3) * + (-3059 * pow(x, 6) + 1995 * pow(x, 4) - 285 * pow(x, 2) + 5); +} + +double +AssLegFunction::P_12_6_Deriv(const double x) const +{ + return (6891885.0 / 4.0) * x * + (-3059 * pow(x, 10) + 9310 * pow(x, 8) - 10298 * pow(x, 6) + + 4952 * pow(x, 4) - 955 * pow(x, 2) + 50); +} + +double +AssLegFunction::P_12_7(const double x) const +{ + return (130945815.0 / 8.0) * x * pow(1 - pow(x, 2), 7.0 / 2.0) * + (-161 * pow(x, 4) + 70 * pow(x, 2) - 5); +} + +double +AssLegFunction::P_12_7_Deriv(const double x) const +{ + return (130945815.0 / 8.0) * sqrt(1 - pow(x, 2)) * + (1932 * pow(x, 10) - 5369 * pow(x, 8) + 5192 * pow(x, 6) - + 2010 * pow(x, 4) + 260 * pow(x, 2) - 5); +} + +double +AssLegFunction::P_12_8(const double x) const +{ + return (654729075.0 / 8.0) * pow(pow(x, 2) - 1, 4) * + (161 * pow(x, 4) - 42 * pow(x, 2) + 1); +} + +double +AssLegFunction::P_12_8_Deriv(const double x) const +{ + return (654729075.0 / 2.0) * x * + (483 * pow(x, 10) - 1715 * pow(x, 8) + 2270 * pow(x, 6) - + 1350 * pow(x, 4) + 335 * pow(x, 2) - 23); +} + +double +AssLegFunction::P_12_9(const double x) const +{ + return (4583103525.0 / 2.0) * x * pow(1 - pow(x, 2), 9.0 / 2.0) * + (3 - 23 * pow(x, 2)); +} + +double +AssLegFunction::P_12_9_Deriv(const double x) const +{ + return (13749310575.0 / 2.0) * pow(1 - pow(x, 2), 7.0 / 2.0) * + (3 * pow(x, 2) * (23 * pow(x, 2) - 3) + + (1 - 23 * pow(x, 2)) * (1 - pow(x, 2))); +} + +double +AssLegFunction::P_12_10(const double x) const +{ + return (13749310575.0 / 2.0) * (1 - 23 * pow(x, 2)) * pow(pow(x, 2) - 1, 5); +} + +double +AssLegFunction::P_12_10_Deriv(const double x) const +{ + return 27498621150.0 * x * (14 - 69 * pow(x, 2)) * pow(pow(x, 2) - 1, 4); +} + +double +AssLegFunction::P_12_11(const double x) const +{ + return -316234143225.0 * x * pow(1 - pow(x, 2), 11.0 / 2.0); +} + +double +AssLegFunction::P_12_11_Deriv(const double x) const +{ + return pow(1 - pow(x, 2), 9.0 / 2.0) * + (3794809718700.0 * pow(x, 2) - 316234143225.0); +} + +double +AssLegFunction::P_12_12(const double x) const +{ + return 316234143225.0 * pow(pow(x, 2) - 1, 6); +} + +double +AssLegFunction::P_12_12_Deriv(const double x) const +{ + return 3794809718700.0 * x * pow(pow(x, 2) - 1, 5); +} + +double +AssLegFunction::P_13_0(const double x) const +{ + return (1.0 / 1024.0) * x * + (1300075 * pow(x, 12) - 4056234 * pow(x, 10) + 4849845 * pow(x, 8) - + 2771340 * pow(x, 6) + 765765 * pow(x, 4) - 90090 * pow(x, 2) + 3003); +} + +double +AssLegFunction::P_13_0_Deriv(const double x) const +{ + return (16900975.0 / 1024.0) * pow(x, 12) - 22309287.0 / 512.0 * pow(x, 10) + + (43648605.0 / 1024.0) * pow(x, 8) - 4849845.0 / 256.0 * pow(x, 6) + + (3828825.0 / 1024.0) * pow(x, 4) - 135135.0 / 512.0 * pow(x, 2) + + 3003.0 / 1024.0; +} + +double +AssLegFunction::P_13_1(const double x) const +{ + return (91.0 / 1024.0) * sqrt(1 - pow(x, 2)) * + (-185725 * pow(x, 12) + 490314 * pow(x, 10) - 479655 * pow(x, 8) + + 213180 * pow(x, 6) - 42075 * pow(x, 4) + 2970 * pow(x, 2) - 33); +} + +double +AssLegFunction::P_13_1_Deriv(const double x) const +{ + return (1.0 / 1024.0) * + (219712675.0 * pow(x, 13) - 693616014.0 * pow(x, 11) + + 839023185.0 * pow(x, 9) - 484984500.0 * pow(x, 7) + + 135540405.0 * pow(x, 5) - 16126110 * pow(x, 3) + 543543 * x) / + sqrt(1 - pow(x, 2)); +} + +double +AssLegFunction::P_13_2(const double x) const +{ + return (1365.0 / 256.0) * x * + (-37145 * pow(x, 12) + 118864 * pow(x, 10) - 145673 * pow(x, 8) + + 85272 * pow(x, 6) - 24123 * pow(x, 4) + 2904 * pow(x, 2) - 99); +} + +double +AssLegFunction::P_13_2_Deriv(const double x) const +{ + return -659138025.0 / 256.0 * pow(x, 12) + (111546435.0 / 16.0) * pow(x, 10) - + 1789592805.0 / 256.0 * pow(x, 8) + (101846745.0 / 32.0) * pow(x, 6) - + 164639475.0 / 256.0 * pow(x, 4) + (1486485.0 / 32.0) * pow(x, 2) - + 135135.0 / 256.0; +} + +double +AssLegFunction::P_13_3(const double x) const +{ + return (15015.0 / 256.0) * pow(1 - pow(x, 2), 3.0 / 2.0) * + (-37145 * pow(x, 10) + 66861 * pow(x, 8) - 40698 * pow(x, 6) + + 9690 * pow(x, 4) - 765 * pow(x, 2) + 9); +} + +double +AssLegFunction::P_13_3_Deriv(const double x) const +{ + return (15015.0 / 256.0) * x * sqrt(1 - pow(x, 2)) * + (482885 * pow(x, 10) - 1106921 * pow(x, 8) + 901170 * pow(x, 6) - + 312018 * pow(x, 4) + 42585 * pow(x, 2) - 1557); +} + +double +AssLegFunction::P_13_4(const double x) const +{ + return (255255.0 / 128.0) * x * pow(pow(x, 2) - 1, 2) * + (10925 * pow(x, 8) - 15732 * pow(x, 6) + 7182 * pow(x, 4) - + 1140 * pow(x, 2) + 45); +} + +double +AssLegFunction::P_13_4_Deriv(const double x) const +{ + return (36252591375.0 / 128.0) * pow(x, 12) - + 52761463755.0 / 64.0 * pow(x, 10) + + (113879210445.0 / 128.0) * pow(x, 8) - + 13953004065.0 / 32.0 * pow(x, 6) + + (12133546425.0 / 128.0) * pow(x, 4) - 470945475.0 / 64.0 * pow(x, 2) + + 11486475.0 / 128.0; +} + +double +AssLegFunction::P_13_5(const double x) const +{ + return (2297295.0 / 128.0) * pow(1 - pow(x, 2), 5.0 / 2.0) * + (-10925 * pow(x, 8) + 12236 * pow(x, 6) - 3990 * pow(x, 4) + + 380 * pow(x, 2) - 5); +} + +double +AssLegFunction::P_13_5_Deriv(const double x) const +{ + return (2297295.0 / 128.0) * x * sqrt(1 - pow(x, 2)) * + (-142025 * pow(x, 10) + 364021 * pow(x, 8) - 331322 * pow(x, 6) + + 127946 * pow(x, 4) - 19405 * pow(x, 2) + 785); +} + +double +AssLegFunction::P_13_6(const double x) const +{ + return (43648605.0 / 16.0) * x * pow(pow(x, 2) - 1, 3) * + (-575 * pow(x, 6) + 483 * pow(x, 4) - 105 * pow(x, 2) + 5); +} + +double +AssLegFunction::P_13_6_Deriv(const double x) const +{ + return -326273322375.0 / 16.0 * pow(x, 12) + 66258582390.0 * pow(x, 10) - + 1288113982155.0 / 16.0 * pow(x, 8) + + (89523288855.0 / 2.0) * pow(x, 6) - 177431579325.0 / 16.0 * pow(x, 4) + + (1964187225.0 / 2.0) * pow(x, 2) - 218243025.0 / 16.0; +} + +double +AssLegFunction::P_13_7(const double x) const +{ + return (218243025.0 / 16.0) * pow(1 - pow(x, 2), 7.0 / 2.0) * + (-805 * pow(x, 6) + 483 * pow(x, 4) - 63 * pow(x, 2) + 1); +} + +double +AssLegFunction::P_13_7_Deriv(const double x) const +{ + return (1527701175.0 / 16.0) * x * sqrt(1 - pow(x, 2)) * + (1495 * pow(x, 10) - 4439 * pow(x, 8) + 4750 * pow(x, 6) - + 2182 * pow(x, 4) + 395 * pow(x, 2) - 19); +} + +double +AssLegFunction::P_13_8(const double x) const +{ + return (4583103525.0 / 8.0) * x * pow(pow(x, 2) - 1, 4) * + (115 * pow(x, 4) - 46 * pow(x, 2) + 3); +} + +double +AssLegFunction::P_13_8_Deriv(const double x) const +{ + return (6851739769875.0 / 8.0) * pow(x, 12) - + 12754777110075.0 / 4.0 * pow(x, 10) + + (36174436122825.0 / 8.0) * pow(x, 8) - + 5999282514225.0 / 2.0 * pow(x, 6) + + (7264219087125.0 / 8.0) * pow(x, 4) - + 398730006675.0 / 4.0 * pow(x, 2) + 13749310575.0 / 8.0; +} + +double +AssLegFunction::P_13_9(const double x) const +{ + return (4583103525.0 / 8.0) * pow(1 - pow(x, 2), 9.0 / 2.0) * + (-575 * pow(x, 4) + 138 * pow(x, 2) - 3); +} + +double +AssLegFunction::P_13_9_Deriv(const double x) const +{ + return (4583103525.0 / 8.0) * x * pow(1 - pow(x, 2), 7.0 / 2.0) * + (5175 * pow(x, 4) - 1242 * pow(x, 2) + + 92 * (1 - pow(x, 2)) * (3 - 25 * pow(x, 2)) + 27); +} + +double +AssLegFunction::P_13_10(const double x) const +{ + return (105411381075.0 / 2.0) * x * (3 - 25 * pow(x, 2)) * + pow(pow(x, 2) - 1, 5); +} + +double +AssLegFunction::P_13_10_Deriv(const double x) const +{ + return -34258698849375.0 / 2.0 * pow(x, 12) + 74209612276800.0 * pow(x, 10) - + 251406143863875.0 / 2.0 * pow(x, 8) + 103303153453500.0 * pow(x, 6) - + 81693820333125.0 / 2.0 * pow(x, 4) + 6324682864500.0 * pow(x, 2) - + 316234143225.0 / 2.0; +} + +double +AssLegFunction::P_13_11(const double x) const +{ + return (316234143225.0 / 2.0) * (1 - 25 * pow(x, 2)) * + pow(1 - pow(x, 2), 11.0 / 2.0); +} + +double +AssLegFunction::P_13_11_Deriv(const double x) const +{ + return (316234143225.0 / 2.0) * x * pow(1 - pow(x, 2), 9.0 / 2.0) * + (325 * pow(x, 2) - 61); +} + +double +AssLegFunction::P_13_12(const double x) const +{ + return 7905853580625.0 * x * pow(pow(x, 2) - 1, 6); +} + +double +AssLegFunction::P_13_12_Deriv(const double x) const +{ + return pow(pow(x, 2) - 1, 5) * + (102776096548125.0 * pow(x, 2) - 7905853580625.0); +} + +double +AssLegFunction::P_13_13(const double x) const +{ + return -7905853580625.0 * pow(1 - pow(x, 2), 13.0 / 2.0); +} + +double +AssLegFunction::P_13_13_Deriv(const double x) const +{ + return 102776096548125.0 * x * pow(1 - pow(x, 2), 11.0 / 2.0); +} + +double +AssLegFunction::P_14_0(const double x) const +{ + return (5014575.0 / 2048.0) * pow(x, 14) - 16900975.0 / 2048.0 * pow(x, 12) + + (22309287.0 / 2048.0) * pow(x, 10) - 14549535.0 / 2048.0 * pow(x, 8) + + (4849845.0 / 2048.0) * pow(x, 6) - 765765.0 / 2048.0 * pow(x, 4) + + (45045.0 / 2048.0) * pow(x, 2) - 429.0 / 2048.0; +} + +double +AssLegFunction::P_14_0_Deriv(const double x) const +{ + return (105.0 / 1024.0) * x * + (334305 * pow(x, 12) - 965770 * pow(x, 10) + 1062347 * pow(x, 8) - + 554268 * pow(x, 6) + 138567 * pow(x, 4) - 14586 * pow(x, 2) + 429); +} + +double +AssLegFunction::P_14_1(const double x) const +{ + return (105.0 / 1024.0) * x * sqrt(1 - pow(x, 2)) * + (-334305 * pow(x, 12) + 965770 * pow(x, 10) - 1062347 * pow(x, 8) + + 554268 * pow(x, 6) - 138567 * pow(x, 4) + 14586 * pow(x, 2) - 429); +} + +double +AssLegFunction::P_14_1_Deriv(const double x) const +{ + return (105.0 / 1024.0) * + (4680270 * pow(x, 14) - 15935205 * pow(x, 12) + 21246940 * pow(x, 10) - + 13995267 * pow(x, 8) + 4711278 * pow(x, 6) - 751179 * pow(x, 4) + + 44616 * pow(x, 2) - 429) / + sqrt(1 - pow(x, 2)); +} + +double +AssLegFunction::P_14_2(const double x) const +{ + return -456326325.0 / 1024.0 * pow(x, 14) + + (1571790675.0 / 1024.0) * pow(x, 12) - + 2119382265.0 / 1024.0 * pow(x, 10) + + (1411304895.0 / 1024.0) * pow(x, 8) - + 480134655.0 / 1024.0 * pow(x, 6) + (77342265.0 / 1024.0) * pow(x, 4) - + 4639635.0 / 1024.0 * pow(x, 2) + 45045.0 / 1024.0; +} + +double +AssLegFunction::P_14_2_Deriv(const double x) const +{ + return (1365.0 / 512.0) * x * + (-2340135 * pow(x, 12) + 6908970 * pow(x, 10) - 7763305 * pow(x, 8) + + 4135692 * pow(x, 6) - 1055241 * pow(x, 4) + 113322 * pow(x, 2) - + 3399); +} + +double +AssLegFunction::P_14_3(const double x) const +{ + return (23205.0 / 256.0) * x * pow(1 - pow(x, 2), 3.0 / 2.0) * + (-58995 * pow(x, 10) + 120175 * pow(x, 8) - 86526 * pow(x, 6) + + 26334 * pow(x, 4) - 3135 * pow(x, 2) + 99); +} + +double +AssLegFunction::P_14_3_Deriv(const double x) const +{ + return (69615.0 / 256.0) * sqrt(1 - pow(x, 2)) * + (275310 * pow(x, 12) - 697015 * pow(x, 10) + 648945 * pow(x, 8) - + 272118 * pow(x, 6) + 50160 * pow(x, 4) - 3267 * pow(x, 2) + 33); +} + +double +AssLegFunction::P_14_4(const double x) const +{ + return (2297295.0 / 256.0) * pow(pow(x, 2) - 1, 2) * + (6555 * pow(x, 10) - 10925 * pow(x, 8) + 6118 * pow(x, 6) - + 1330 * pow(x, 4) + 95 * pow(x, 2) - 1); +} + +double +AssLegFunction::P_14_4_Deriv(const double x) const +{ + return (2297295.0 / 128.0) * x * + (45885 * pow(x, 12) - 144210 * pow(x, 10) + 172615 * pow(x, 8) - + 97964 * pow(x, 6) + 26619 * pow(x, 4) - 3042 * pow(x, 2) + 97); +} + +double +AssLegFunction::P_14_5(const double x) const +{ + return (43648605.0 / 128.0) * x * pow(1 - pow(x, 2), 5.0 / 2.0) * + (-1725 * pow(x, 8) + 2300 * pow(x, 6) - 966 * pow(x, 4) + + 140 * pow(x, 2) - 5); +} + +double +AssLegFunction::P_14_5_Deriv(const double x) const +{ + return (218243025.0 / 128.0) * sqrt(1 - pow(x, 2)) * + (-4830 * pow(x, 12) + 13455 * pow(x, 10) - 13777 * pow(x, 8) + + 6342 * pow(x, 6) - 1280 * pow(x, 4) + 91 * pow(x, 2) - 1); +} + +double +AssLegFunction::P_14_6(const double x) const +{ + return (218243025.0 / 128.0) * pow(pow(x, 2) - 1, 3) * + (-3105 * pow(x, 8) + 3220 * pow(x, 6) - 966 * pow(x, 4) + + 84 * pow(x, 2) - 1); +} + +double +AssLegFunction::P_14_6_Deriv(const double x) const +{ + return (654729075.0 / 64.0) * x * + (-7245 * pow(x, 12) + 25070 * pow(x, 10) - 33235 * pow(x, 8) + + 20996 * pow(x, 6) - 6371 * pow(x, 4) + 814 * pow(x, 2) - 29); +} + +double +AssLegFunction::P_14_7(const double x) const +{ + return (654729075.0 / 16.0) * x * pow(1 - pow(x, 2), 7.0 / 2.0) * + (-1035 * pow(x, 6) + 805 * pow(x, 4) - 161 * pow(x, 2) + 7); +} + +double +AssLegFunction::P_14_7_Deriv(const double x) const +{ + return (4583103525.0 / 16.0) * sqrt(1 - pow(x, 2)) * + (2070 * pow(x, 12) - 6555 * pow(x, 10) + 7705 * pow(x, 8) - + 4102 * pow(x, 6) + 960 * pow(x, 4) - 79 * pow(x, 2) + 1); +} + +double +AssLegFunction::P_14_8(const double x) const +{ + return (4583103525.0 / 16.0) * pow(pow(x, 2) - 1, 4) * + (1035 * pow(x, 6) - 575 * pow(x, 4) + 69 * pow(x, 2) - 1); +} + +double +AssLegFunction::P_14_8_Deriv(const double x) const +{ + return (4583103525.0 / 8.0) * x * + (7245 * pow(x, 12) - 28290 * pow(x, 10) + 42895 * pow(x, 8) - + 31468 * pow(x, 6) + 11259 * pow(x, 4) - 1714 * pow(x, 2) + 73); +} + +double +AssLegFunction::P_14_9(const double x) const +{ + return (105411381075.0 / 8.0) * x * pow(1 - pow(x, 2), 9.0 / 2.0) * + (-135 * pow(x, 4) + 50 * pow(x, 2) - 3); +} + +double +AssLegFunction::P_14_9_Deriv(const double x) const +{ + return (316234143225.0 / 8.0) * sqrt(1 - pow(x, 2)) * + (-630 * pow(x, 12) + 2315 * pow(x, 10) - 3225 * pow(x, 8) + + 2086 * pow(x, 6) - 608 * pow(x, 4) + 63 * pow(x, 2) - 1); +} + +double +AssLegFunction::P_14_10(const double x) const +{ + return (316234143225.0 / 8.0) * pow(pow(x, 2) - 1, 5) * + (-225 * pow(x, 4) + 50 * pow(x, 2) - 1); +} + +double +AssLegFunction::P_14_10_Deriv(const double x) const +{ + return (1581170716125.0 / 4.0) * x * pow(pow(x, 2) - 1, 4) * + (-225 * pow(x, 4) + 50 * pow(x, 2) + + 10 * (1 - 9 * pow(x, 2)) * (pow(x, 2) - 1) - 1); +} + +double +AssLegFunction::P_14_11(const double x) const +{ + return (7905853580625.0 / 2.0) * x * (1 - 9 * pow(x, 2)) * + pow(1 - pow(x, 2), 11.0 / 2.0); +} + +double +AssLegFunction::P_14_11_Deriv(const double x) const +{ + return (7905853580625.0 / 2.0) * pow(1 - pow(x, 2), 9.0 / 2.0) * + (11 * pow(x, 2) * (9 * pow(x, 2) - 1) + + (1 - 27 * pow(x, 2)) * (1 - pow(x, 2))); +} + +double +AssLegFunction::P_14_12(const double x) const +{ + return (7905853580625.0 / 2.0) * pow(pow(x, 2) - 1, 6) * (27 * pow(x, 2) - 1); +} + +double +AssLegFunction::P_14_12_Deriv(const double x) const +{ + return 23717560741875.0 * x * pow(pow(x, 2) - 1, 5) * (63 * pow(x, 2) - 11); +} + +double +AssLegFunction::P_14_13(const double x) const +{ + return -213458046676875.0 * x * pow(1 - pow(x, 2), 13.0 / 2.0); +} + +double +AssLegFunction::P_14_13_Deriv(const double x) const +{ + return pow(1 - pow(x, 2), 11.0 / 2.0) * + (2988412653476250.0 * pow(x, 2) - 213458046676875.0); +} + +double +AssLegFunction::P_14_14(const double x) const +{ + return -213458046676875.0 * pow(pow(x, 2) - 1, 7); +} + +double +AssLegFunction::P_14_14_Deriv(const double x) const +{ + return -2988412653476250.0 * x * pow(pow(x, 2) - 1, 6); +} + +double +AssLegFunction::P_15_0(const double x) const +{ + return (1.0 / 2048.0) * x * + (9694845 * pow(x, 14) - 35102025 * pow(x, 12) + 50702925 * pow(x, 10) - + 37182145 * pow(x, 8) + 14549535 * pow(x, 6) - 2909907 * pow(x, 4) + + 255255 * pow(x, 2) - 6435); +} + +double +AssLegFunction::P_15_0_Deriv(const double x) const +{ + return (145422675.0 / 2048.0) * pow(x, 14) - + 456326325.0 / 2048.0 * pow(x, 12) + + (557732175.0 / 2048.0) * pow(x, 10) - + 334639305.0 / 2048.0 * pow(x, 8) + (101846745.0 / 2048.0) * pow(x, 6) - + 14549535.0 / 2048.0 * pow(x, 4) + (765765.0 / 2048.0) * pow(x, 2) - + 6435.0 / 2048.0; +} + +double +AssLegFunction::P_15_1(const double x) const +{ + return (15.0 / 2048.0) * sqrt(1 - pow(x, 2)) * + (-9694845 * pow(x, 14) + 30421755 * pow(x, 12) - + 37182145 * pow(x, 10) + 22309287 * pow(x, 8) - 6789783 * pow(x, 6) + + 969969 * pow(x, 4) - 51051 * pow(x, 2) + 429); +} + +double +AssLegFunction::P_15_1_Deriv(const double x) const +{ + return (1.0 / 2048.0) * + (2181340125.0 * pow(x, 15) - 7968159675.0 * pow(x, 13) + + 11610969825.0 * pow(x, 11) - 8589075495.0 * pow(x, 9) + + 3390041655.0 * pow(x, 7) - 683828145.0 * pow(x, 5) + + 60495435 * pow(x, 3) - 1537965 * x) / + sqrt(1 - pow(x, 2)); +} + +double +AssLegFunction::P_15_2(const double x) const +{ + return (1785.0 / 1024.0) * x * + (-570285 * pow(x, 14) + 2104155 * pow(x, 12) - 3096145 * pow(x, 10) + + 2312167 * pow(x, 8) - 921063 * pow(x, 6) + 187473 * pow(x, 4) - + 16731 * pow(x, 2) + 429); +} + +double +AssLegFunction::P_15_2_Deriv(const double x) const +{ + return -15269380875.0 / 1024.0 * pow(x, 14) + + (48826916775.0 / 1024.0) * pow(x, 12) - + 60792807075.0 / 1024.0 * pow(x, 10) + + (37144962855.0 / 1024.0) * pow(x, 8) - + 11508682185.0 / 1024.0 * pow(x, 6) + + (1673196525.0 / 1024.0) * pow(x, 4) - 89594505.0 / 1024.0 * pow(x, 2) + + 765765.0 / 1024.0; +} + +double +AssLegFunction::P_15_3(const double x) const +{ + return (69615.0 / 1024.0) * pow(1 - pow(x, 2), 3.0 / 2.0) * + (-190095 * pow(x, 12) + 432630 * pow(x, 10) - 360525 * pow(x, 8) + + 134596 * pow(x, 6) - 21945 * pow(x, 4) + 1254 * pow(x, 2) - 11); +} + +double +AssLegFunction::P_15_3_Deriv(const double x) const +{ + return (208845.0 / 1024.0) * x * sqrt(1 - pow(x, 2)) * + (950475 * pow(x, 12) - 2635110 * pow(x, 10) + 2764025 * pow(x, 8) - + 1365188 * pow(x, 6) + 320397 * pow(x, 4) - 31350 * pow(x, 2) + 847); +} + +double +AssLegFunction::P_15_4(const double x) const +{ + return (3968055.0 / 256.0) * x * pow(pow(x, 2) - 1, 2) * + (10005 * pow(x, 10) - 18975 * pow(x, 8) + 12650 * pow(x, 6) - + 3542 * pow(x, 4) + 385 * pow(x, 2) - 11); +} + +double +AssLegFunction::P_15_4_Deriv(const double x) const +{ + return (595505854125.0 / 256.0) * pow(x, 14) - + 2011030114275.0 / 256.0 * pow(x, 12) + + (2645323706025.0 / 256.0) * pow(x, 10) - + 1707664373415.0 / 256.0 * pow(x, 8) + + (558833089815.0 / 256.0) * pow(x, 6) - + 85769508825.0 / 256.0 * pow(x, 4) + + (4844995155.0 / 256.0) * pow(x, 2) - 43648605.0 / 256.0; +} + +double +AssLegFunction::P_15_5(const double x) const +{ + return (43648605.0 / 256.0) * pow(1 - pow(x, 2), 5.0 / 2.0) * + (-10005 * pow(x, 10) + 15525 * pow(x, 8) - 8050 * pow(x, 6) + + 1610 * pow(x, 4) - 105 * pow(x, 2) + 1); +} + +double +AssLegFunction::P_15_5_Deriv(const double x) const +{ + return (218243025.0 / 256.0) * x * sqrt(1 - pow(x, 2)) * + (-30015 * pow(x, 12) + 90390 * pow(x, 10) - 102925 * pow(x, 8) + + 55108 * pow(x, 6) - 13993 * pow(x, 4) + 1478 * pow(x, 2) - 43); +} + +double +AssLegFunction::P_15_6(const double x) const +{ + return (218243025.0 / 128.0) * x * pow(pow(x, 2) - 1, 3) * + (-10005 * pow(x, 8) + 12420 * pow(x, 6) - 4830 * pow(x, 4) + + 644 * pow(x, 2) - 21); +} + +double +AssLegFunction::P_15_6_Deriv(const double x) const +{ + return -32752821976875.0 / 128.0 * pow(x, 14) + + (120394855956375.0 / 128.0) * pow(x, 12) - + 173100546493875.0 / 128.0 * pow(x, 10) + + (122563318652775.0 / 128.0) * pow(x, 8) - + 44094039014025.0 / 128.0 * pow(x, 6) + + (7447543228125.0 / 128.0) * pow(x, 4) - + 462893456025.0 / 128.0 * pow(x, 2) + 4583103525.0 / 128.0; +} + +double +AssLegFunction::P_15_7(const double x) const +{ + return (654729075.0 / 128.0) * pow(1 - pow(x, 2), 7.0 / 2.0) * + (-30015 * pow(x, 8) + 28980 * pow(x, 6) - 8050 * pow(x, 4) + + 644 * pow(x, 2) - 7); +} + +double +AssLegFunction::P_15_7_Deriv(const double x) const +{ + return (654729075.0 / 128.0) * x * sqrt(1 - pow(x, 2)) * + (450225 * pow(x, 12) - 1517310 * pow(x, 10) + 1946375 * pow(x, 8) - + 1179716 * pow(x, 6) + 339759 * pow(x, 4) - 40670 * pow(x, 2) + 1337); +} + +double +AssLegFunction::P_15_8(const double x) const +{ + return (15058768725.0 / 16.0) * x * pow(pow(x, 2) - 1, 4) * + (1305 * pow(x, 6) - 945 * pow(x, 4) + 175 * pow(x, 2) - 7); +} + +double +AssLegFunction::P_15_8_Deriv(const double x) const +{ + return (294775397791875.0 / 16.0) * pow(x, 14) - + 1206885019465125.0 / 16.0 * pow(x, 12) + + (1952143483665375.0 / 16.0) * pow(x, 10) - + 1571728868134425.0 / 16.0 * pow(x, 8) + + (649650341565225.0 / 16.0) * pow(x, 6) - + 127020714195375.0 / 16.0 * pow(x, 4) + + (9170790153525.0 / 16.0) * pow(x, 2) - 105411381075.0 / 16.0; +} + +double +AssLegFunction::P_15_9(const double x) const +{ + return (105411381075.0 / 16.0) * pow(1 - pow(x, 2), 9.0 / 2.0) * + (-1305 * pow(x, 6) + 675 * pow(x, 4) - 75 * pow(x, 2) + 1); +} + +double +AssLegFunction::P_15_9_Deriv(const double x) const +{ + return (316234143225.0 / 16.0) * x * sqrt(1 - pow(x, 2)) * + (-6525 * pow(x, 12) + 25110 * pow(x, 10) - 37355 * pow(x, 8) + + 26708 * pow(x, 6) - 9219 * pow(x, 4) + 1334 * pow(x, 2) - 53); +} + +double +AssLegFunction::P_15_10(const double x) const +{ + return (1581170716125.0 / 8.0) * x * pow(pow(x, 2) - 1, 5) * + (-261 * pow(x, 4) + 90 * pow(x, 2) - 5); +} + +double +AssLegFunction::P_15_10_Deriv(const double x) const +{ + return -6190283353629375.0 / 8.0 * pow(x, 14) + + (28674530936926875.0 / 8.0) * pow(x, 12) - + 53309170694154375.0 / 8.0 * pow(x, 10) + + (50304946333516875.0 / 8.0) * pow(x, 8) - + 24958779754033125.0 / 8.0 * pow(x, 6) + + (6016354574855625.0 / 8.0) * pow(x, 4) - + 545503897063125.0 / 8.0 * pow(x, 2) + 7905853580625.0 / 8.0; +} + +double +AssLegFunction::P_15_11(const double x) const +{ + return (7905853580625.0 / 8.0) * pow(1 - pow(x, 2), 11.0 / 2.0) * + (-261 * pow(x, 4) + 54 * pow(x, 2) - 1); +} + +double +AssLegFunction::P_15_11_Deriv(const double x) const +{ + return (7905853580625.0 / 8.0) * x * pow(1 - pow(x, 2), 9.0 / 2.0) * + (2871 * pow(x, 4) - 594 * pow(x, 2) + + 36 * (1 - pow(x, 2)) * (3 - 29 * pow(x, 2)) + 11); +} + +double +AssLegFunction::P_15_12(const double x) const +{ + return (71152682225625.0 / 2.0) * x * pow(pow(x, 2) - 1, 6) * + (29 * pow(x, 2) - 3); +} + +double +AssLegFunction::P_15_12_Deriv(const double x) const +{ + return (213458046676875.0 / 2.0) * pow(pow(x, 2) - 1, 5) * + (4 * pow(x, 2) * (29 * pow(x, 2) - 3) + + (pow(x, 2) - 1) * (29 * pow(x, 2) - 1)); +} + +double +AssLegFunction::P_15_13(const double x) const +{ + return (213458046676875.0 / 2.0) * (1 - 29 * pow(x, 2)) * + pow(1 - pow(x, 2), 13.0 / 2.0); +} + +double +AssLegFunction::P_15_13_Deriv(const double x) const +{ + return (213458046676875.0 / 2.0) * x * pow(1 - pow(x, 2), 11.0 / 2.0) * + (435 * pow(x, 2) - 71); +} + +double +AssLegFunction::P_15_14(const double x) const +{ + return -6190283353629375.0 * x * pow(pow(x, 2) - 1, 7); +} + +double +AssLegFunction::P_15_14_Deriv(const double x) const +{ + return (6190283353629375.0 - 92854250304440625.0 * pow(x, 2)) * + pow(pow(x, 2) - 1, 6); +} + +double +AssLegFunction::P_15_15(const double x) const +{ + return -6190283353629375.0 * pow(1 - pow(x, 2), 15.0 / 2.0); +} + +double +AssLegFunction::P_15_15_Deriv(const double x) const +{ + return 92854250304440625.0 * x * pow(1 - pow(x, 2), 13.0 / 2.0); +} + +double +AssLegFunction::P_16_0(const double x) const +{ + return (300540195.0 / 32768.0) * pow(x, 16) - + 145422675.0 / 4096.0 * pow(x, 14) + + (456326325.0 / 8192.0) * pow(x, 12) - + 185910725.0 / 4096.0 * pow(x, 10) + + (334639305.0 / 16384.0) * pow(x, 8) - 20369349.0 / 4096.0 * pow(x, 6) + + (4849845.0 / 8192.0) * pow(x, 4) - 109395.0 / 4096.0 * pow(x, 2) + + 6435.0 / 32768.0; +} + +double +AssLegFunction::P_16_0_Deriv(const double x) const +{ + return (17.0 / 2048.0) * x * + (17678835 * pow(x, 14) - 59879925 * pow(x, 12) + + 80528175 * pow(x, 10) - 54679625 * pow(x, 8) + 19684665 * pow(x, 6) - + 3594591 * pow(x, 4) + 285285 * pow(x, 2) - 6435); +} + +double +AssLegFunction::P_16_1(const double x) const +{ + return (17.0 / 2048.0) * x * sqrt(1 - pow(x, 2)) * + (-17678835 * pow(x, 14) + 59879925 * pow(x, 12) - + 80528175 * pow(x, 10) + 54679625 * pow(x, 8) - 19684665 * pow(x, 6) + + 3594591 * pow(x, 4) - 285285 * pow(x, 2) + 6435); +} + +double +AssLegFunction::P_16_1_Deriv(const double x) const +{ + return (17.0 / 2048.0) * + (282861360.0 * pow(x, 16) - 1103501475.0 * pow(x, 14) + + 1744777125.0 * pow(x, 12) - 1432606175.0 * pow(x, 10) + + 649593945.0 * pow(x, 8) - 159360201.0 * pow(x, 6) + + 19114095 * pow(x, 4) - 868725 * pow(x, 2) + 6435) / + sqrt(1 - pow(x, 2)); +} + +double +AssLegFunction::P_16_2(const double x) const +{ + return -4508102925.0 / 2048.0 * pow(x, 16) + + (8870783175.0 / 1024.0) * pow(x, 14) - + 14146116075.0 / 1024.0 * pow(x, 12) + + (11712375675.0 / 1024.0) * pow(x, 10) - + 334639305.0 / 64.0 * pow(x, 8) + (1324007685.0 / 1024.0) * pow(x, 6) - + 160044885.0 / 1024.0 * pow(x, 4) + (7329465.0 / 1024.0) * pow(x, 2) - + 109395.0 / 2048.0; +} + +double +AssLegFunction::P_16_2_Deriv(const double x) const +{ + return (765.0 / 512.0) * x * + (-23571780 * pow(x, 14) + 81170565 * pow(x, 12) - + 110949930.0 * pow(x, 10) + 76551475 * pow(x, 8) - + 27995968 * pow(x, 6) + 5192187 * pow(x, 4) - 418418 * pow(x, 2) + + 9581); +} + +double +AssLegFunction::P_16_3(const double x) const +{ + return (101745.0 / 1024.0) * x * pow(1 - pow(x, 2), 3.0 / 2.0) * + (-310155 * pow(x, 12) + 780390 * pow(x, 10) - 740025 * pow(x, 8) + + 328900 * pow(x, 6) - 69069 * pow(x, 4) + 6006 * pow(x, 2) - 143); +} + +double +AssLegFunction::P_16_3_Deriv(const double x) const +{ + return (101745.0 / 1024.0) * sqrt(1 - pow(x, 2)) * + (4962480 * pow(x, 14) - 14957475 * pow(x, 12) + 17464590 * pow(x, 10) - + 9949225 * pow(x, 8) + 2854852 * pow(x, 6) - 381381 * pow(x, 4) + + 18590 * pow(x, 2) - 143); +} + +double +AssLegFunction::P_16_4(const double x) const +{ + return (1322685.0 / 1024.0) * pow(pow(x, 2) - 1, 2) * + (310155 * pow(x, 12) - 660330 * pow(x, 10) + 512325 * pow(x, 8) - + 177100 * pow(x, 6) + 26565 * pow(x, 4) - 1386 * pow(x, 2) + 11); +} + +double +AssLegFunction::P_16_4_Deriv(const double x) const +{ + return (1322685.0 / 64.0) * x * + (310155 * pow(x, 14) - 1120560 * pow(x, 12) + 1607355 * pow(x, 10) - + 1163800 * pow(x, 8) + 446545 * pow(x, 6) - 86856 * pow(x, 4) + + 7337 * pow(x, 2) - 176); +} + +double +AssLegFunction::P_16_5(const double x) const +{ + return (3968055.0 / 256.0) * x * pow(1 - pow(x, 2), 5.0 / 2.0) * + (-310155 * pow(x, 10) + 550275 * pow(x, 8) - 341550 * pow(x, 6) + + 88550 * pow(x, 4) - 8855 * pow(x, 2) + 231); +} + +double +AssLegFunction::P_16_5_Deriv(const double x) const +{ + return (3968055.0 / 256.0) * sqrt(1 - pow(x, 2)) * + (-4962480 * pow(x, 14) + 16078035 * pow(x, 12) - + 20166630 * pow(x, 10) + 12327425 * pow(x, 8) - 3789940 * pow(x, 6) + + 541541 * pow(x, 4) - 28182 * pow(x, 2) + 231); +} + +double +AssLegFunction::P_16_6(const double x) const +{ + return (43648605.0 / 256.0) * pow(pow(x, 2) - 1, 3) * + (-310155 * pow(x, 10) + 450225 * pow(x, 8) - 217350 * pow(x, 6) + + 40250 * pow(x, 4) - 2415 * pow(x, 2) + 21); +} + +double +AssLegFunction::P_16_6_Deriv(const double x) const +{ + return (43648605.0 / 64.0) * x * + (-1240620 * pow(x, 14) + 4832415 * pow(x, 12) - 7495470 * pow(x, 10) + + 5882825 * pow(x, 8) - 2450880 * pow(x, 6) + 518049 * pow(x, 4) - + 47558 * pow(x, 2) + 1239); +} + +double +AssLegFunction::P_16_7(const double x) const +{ + return (5019589575.0 / 128.0) * x * pow(1 - pow(x, 2), 7.0 / 2.0) * + (-13485 * pow(x, 8) + 15660 * pow(x, 6) - 5670 * pow(x, 4) + + 700 * pow(x, 2) - 21); +} + +double +AssLegFunction::P_16_7_Deriv(const double x) const +{ + return (5019589575.0 / 128.0) * sqrt(1 - pow(x, 2)) * + (215760 * pow(x, 14) - 772125 * pow(x, 12) + 1074630 * pow(x, 10) - + 731275 * pow(x, 8) + 250628 * pow(x, 6) - 39907 * pow(x, 4) + + 2310 * pow(x, 2) - 21); +} + +double +AssLegFunction::P_16_8(const double x) const +{ + return (15058768725.0 / 128.0) * pow(pow(x, 2) - 1, 4) * + (40455 * pow(x, 8) - 36540 * pow(x, 6) + 9450 * pow(x, 4) - + 700 * pow(x, 2) + 7); +} + +double +AssLegFunction::P_16_8_Deriv(const double x) const +{ + return (15058768725.0 / 8.0) * x * + (40455 * pow(x, 14) - 173565 * pow(x, 12) + 298755 * pow(x, 10) - + 262225 * pow(x, 8) + 123061 * pow(x, 6) - 29463 * pow(x, 4) + + 3073 * pow(x, 2) - 91); +} + +double +AssLegFunction::P_16_9(const double x) const +{ + return (75293843625.0 / 16.0) * x * pow(1 - pow(x, 2), 9.0 / 2.0) * + (-8091 * pow(x, 6) + 5481 * pow(x, 4) - 945 * pow(x, 2) + 35); +} + +double +AssLegFunction::P_16_9_Deriv(const double x) const +{ + return (75293843625.0 / 16.0) * sqrt(1 - pow(x, 2)) * + (-129456 * pow(x, 14) + 521739 * pow(x, 12) - 827226 * pow(x, 10) + + 648989 * pow(x, 8) - 259196 * pow(x, 6) + 48405 * pow(x, 4) - + 3290 * pow(x, 2) + 35); +} + +double +AssLegFunction::P_16_10(const double x) const +{ + return (527056905375.0 / 16.0) * pow(pow(x, 2) - 1, 5) * + (-8091 * pow(x, 6) + 3915 * pow(x, 4) - 405 * pow(x, 2) + 5); +} + +double +AssLegFunction::P_16_10_Deriv(const double x) const +{ + return (527056905375.0 / 4.0) * x * + (-32364 * pow(x, 14) + 155295 * pow(x, 12) - 302670 * pow(x, 10) + + 305225 * pow(x, 8) - 167360 * pow(x, 6) + 47649 * pow(x, 4) - + 5990 * pow(x, 2) + 215); +} + +double +AssLegFunction::P_16_11(const double x) const +{ + return (14230536445125.0 / 8.0) * x * pow(1 - pow(x, 2), 11.0 / 2.0) * + (-899 * pow(x, 4) + 290 * pow(x, 2) - 15); +} + +double +AssLegFunction::P_16_11_Deriv(const double x) const +{ + return (14230536445125.0 / 8.0) * pow(1 - pow(x, 2), 9.0 / 2.0) * + (11 * pow(x, 2) * (899 * pow(x, 4) - 290 * pow(x, 2) + 15) + + 5 * (1 - pow(x, 2)) * (-899 * pow(x, 4) + 174 * pow(x, 2) - 3)); +} + +double +AssLegFunction::P_16_12(const double x) const +{ + return (71152682225625.0 / 8.0) * pow(pow(x, 2) - 1, 6) * + (899 * pow(x, 4) - 174 * pow(x, 2) + 3); +} + +double +AssLegFunction::P_16_12_Deriv(const double x) const +{ + return 127932522641673750.0 * pow(x, 5) * pow(pow(x, 2) - 1, 5) - + 53649122398121250.0 * pow(x, 3) * pow(pow(x, 2) - 1, 5) + + 3415328746830000.0 * x * pow(pow(x, 2) - 1, 5); +} + +double +AssLegFunction::P_16_13(const double x) const +{ + return (2063427784543125.0 / 2.0) * x * pow(1 - pow(x, 2), 13.0 / 2.0) * + (3 - 31 * pow(x, 2)); +} + +double +AssLegFunction::P_16_13_Deriv(const double x) const +{ + return (2063427784543125.0 / 2.0) * pow(1 - pow(x, 2), 11.0 / 2.0) * + (13 * pow(x, 2) * (31 * pow(x, 2) - 3) + + 3 * (1 - 31 * pow(x, 2)) * (1 - pow(x, 2))); +} + +double +AssLegFunction::P_16_14(const double x) const +{ + return (6190283353629375.0 / 2.0) * (1 - 31 * pow(x, 2)) * + pow(pow(x, 2) - 1, 7); +} + +double +AssLegFunction::P_16_14_Deriv(const double x) const +{ + return 12380566707258750.0 * x * (19 - 124 * pow(x, 2)) * + pow(pow(x, 2) - 1, 6); +} + +double +AssLegFunction::P_16_15(const double x) const +{ + return -191898783962510625.0 * x * pow(1 - pow(x, 2), 15.0 / 2.0); +} + +double +AssLegFunction::P_16_15_Deriv(const double x) const +{ + return pow(1 - pow(x, 2), 13.0 / 2.0) * + (3070380543400170000.0 * pow(x, 2) - 191898783962510625.0); +} + +double +AssLegFunction::P_16_16(const double x) const +{ + return 191898783962510625.0 * pow(pow(x, 2) - 1, 8); +} + +double +AssLegFunction::P_16_16_Deriv(const double x) const +{ + return 3070380543400170000.0 * x * pow(pow(x, 2) - 1, 7); +} + +double +AssLegFunction::P_17_0(const double x) const +{ + return (1.0 / 32768.0) * x * + (583401555.0 * pow(x, 16) - 2404321560.0 * pow(x, 14) + + 4071834900.0 * pow(x, 12) - 3650610600.0 * pow(x, 10) + + 1859107250.0 * pow(x, 8) - 535422888.0 * pow(x, 6) + + 81477396 * pow(x, 4) - 5542680 * pow(x, 2) + 109395); +} + +double +AssLegFunction::P_17_0_Deriv(const double x) const +{ + return (9917826435.0 / 32768.0) * pow(x, 16) - + 4508102925.0 / 4096.0 * pow(x, 14) + + (13233463425.0 / 8192.0) * pow(x, 12) - + 5019589575.0 / 4096.0 * pow(x, 10) + + (8365982625.0 / 16384.0) * pow(x, 8) - + 468495027.0 / 4096.0 * pow(x, 6) + (101846745.0 / 8192.0) * pow(x, 4) - + 2078505.0 / 4096.0 * pow(x, 2) + 109395.0 / 32768.0; +} + +double +AssLegFunction::P_17_1(const double x) const +{ + return (153.0 / 32768.0) * sqrt(1 - pow(x, 2)) * + (-64822395 * pow(x, 16) + 235717800.0 * pow(x, 14) - + 345972900.0 * pow(x, 12) + 262462200.0 * pow(x, 10) - + 109359250.0 * pow(x, 8) + 24496472 * pow(x, 6) - 2662660 * pow(x, 4) + + 108680 * pow(x, 2) - 715); +} + +double +AssLegFunction::P_17_1_Deriv(const double x) const +{ + return (1.0 / 32768.0) * + (168603049395.0 * pow(x, 17) - 699657573960.0 * pow(x, 15) + + 1193047625700.0 * pow(x, 13) - 1076930127000.0 * pow(x, 11) + + 552154853250.0 * pow(x, 9) - 160091443512.0 * pow(x, 7) + + 24524696196.0 * pow(x, 5) - 1679432040.0 * pow(x, 3) + 33365475 * x) / + sqrt(1 - pow(x, 2)); +} + +double +AssLegFunction::P_17_2(const double x) const +{ + return (2907.0 / 2048.0) * x * + (-3411705 * pow(x, 16) + 14267130 * pow(x, 14) - + 24512250 * pow(x, 12) + 22290450 * pow(x, 10) - 11511500 * pow(x, 8) + + 3361358 * pow(x, 6) - 518518 * pow(x, 4) + 35750 * pow(x, 2) - 715); +} + +double +AssLegFunction::P_17_2_Deriv(const double x) const +{ + return -168603049395.0 / 2048.0 * pow(x, 16) + + (311059101825.0 / 1024.0) * pow(x, 14) - + 463171219875.0 / 1024.0 * pow(x, 12) + + (356390859825.0 / 1024.0) * pow(x, 10) - + 75293843625.0 / 512.0 * pow(x, 8) + + (34200136971.0 / 1024.0) * pow(x, 6) - + 3768329565.0 / 1024.0 * pow(x, 4) + + (155887875.0 / 1024.0) * pow(x, 2) - 2078505.0 / 2048.0; +} + +double +AssLegFunction::P_17_3(const double x) const +{ + return (14535.0 / 2048.0) * pow(1 - pow(x, 2), 3.0 / 2.0) * + (-10235115 * pow(x, 14) + 28224105 * pow(x, 12) - + 30045015 * pow(x, 10) + 15540525 * pow(x, 8) - 4029025 * pow(x, 6) + + 483483 * pow(x, 4) - 21021 * pow(x, 2) + 143); +} + +double +AssLegFunction::P_17_3_Deriv(const double x) const +{ + return (43605.0 / 2048.0) * x * sqrt(1 - pow(x, 2)) * + (57998985 * pow(x, 14) - 188884395.0 * pow(x, 12) + + 243091485.0 * pow(x, 10) - 157131975.0 * pow(x, 8) + + 53528475 * pow(x, 6) - 9186177 * pow(x, 4) + 679679 * pow(x, 2) - + 14157); +} + +double +AssLegFunction::P_17_4(const double x) const +{ + return (305235.0 / 1024.0) * x * pow(pow(x, 2) - 1, 2) * + (3411705 * pow(x, 12) - 8064030 * pow(x, 10) + 7153575 * pow(x, 8) - + 2960100 * pow(x, 6) + 575575 * pow(x, 4) - 46046 * pow(x, 2) + 1001); +} + +double +AssLegFunction::P_17_4_Deriv(const double x) const +{ + return (17703320186475.0 / 1024.0) * pow(x, 16) - + 4260157264125.0 / 64.0 * pow(x, 14) + + (26480160313425.0 / 256.0) * pow(x, 12) - + 5315745359925.0 / 64.0 * pow(x, 10) + + (18748167062625.0 / 512.0) * pow(x, 8) - + 555166606995.0 / 64.0 * pow(x, 6) + + (255126096225.0 / 256.0) * pow(x, 4) - + 2749862115.0 / 64.0 * pow(x, 2) + 305540235.0 / 1024.0; +} + +double +AssLegFunction::P_17_5(const double x) const +{ + return (43648605.0 / 1024.0) * pow(1 - pow(x, 2), 5.0 / 2.0) * + (-310155 * pow(x, 12) + 620310 * pow(x, 10) - 450225 * pow(x, 8) + + 144900 * pow(x, 6) - 20125 * pow(x, 4) + 966 * pow(x, 2) - 7); +} + +double +AssLegFunction::P_17_5_Deriv(const double x) const +{ + return (43648605.0 / 1024.0) * x * sqrt(1 - pow(x, 2)) * + (-5272635 * pow(x, 14) + 18299145 * pow(x, 12) - + 25082535 * pow(x, 10) + 17251725 * pow(x, 8) - 6246225 * pow(x, 6) + + 1137787 * pow(x, 4) - 89229 * pow(x, 2) + 1967); +} + +double +AssLegFunction::P_17_6(const double x) const +{ + return (1003917915.0 / 256.0) * x * pow(pow(x, 2) - 1, 3) * + (-40455 * pow(x, 10) + 67425 * pow(x, 8) - 39150 * pow(x, 6) + + 9450 * pow(x, 4) - 875 * pow(x, 2) + 21); +} + +double +AssLegFunction::P_17_6_Deriv(const double x) const +{ + return -690429487272525.0 / 256.0 * pow(x, 16) + + (1421472473796375.0 / 128.0) * pow(x, 14) - + 2367373972488525.0 / 128.0 * pow(x, 12) + + (2040929984067975.0 / 128.0) * pow(x, 10) - + 483612357603375.0 / 64.0 * pow(x, 8) + + (246472891229565.0 / 128.0) * pow(x, 6) - + 30463889130675.0 / 128.0 * pow(x, 4) + + (1412512506405.0 / 128.0) * pow(x, 2) - 21082276215.0 / 256.0; +} + +double +AssLegFunction::P_17_7(const double x) const +{ + return (3011753745.0 / 256.0) * pow(1 - pow(x, 2), 7.0 / 2.0) * + (-148335 * pow(x, 10) + 202275 * pow(x, 8) - 91350 * pow(x, 6) + + 15750 * pow(x, 4) - 875 * pow(x, 2) + 7); +} + +double +AssLegFunction::P_17_7_Deriv(const double x) const +{ + return (3011753745.0 / 256.0) * x * sqrt(1 - pow(x, 2)) * + (2521695 * pow(x, 14) - 9560865 * pow(x, 12) + 14362395 * pow(x, 10) - + 10850325 * pow(x, 8) + 4319325 * pow(x, 6) - 864899 * pow(x, 4) + + 74473 * pow(x, 2) - 1799); +} + +double +AssLegFunction::P_17_8(const double x) const +{ + return (75293843625.0 / 128.0) * x * pow(pow(x, 2) - 1, 4) * + (29667 * pow(x, 8) - 32364 * pow(x, 6) + 10962 * pow(x, 4) - + 1260 * pow(x, 2) + 35); +} + +double +AssLegFunction::P_17_8_Deriv(const double x) const +{ + return (37973621799988875.0 / 128.0) * pow(x, 16) - + 21322087106945625.0 / 16.0 * pow(x, 14) + + (77918963482985625.0 / 32.0) * pow(x, 12) - + 37059253363006875.0 / 16.0 * pow(x, 10) + + (77918963482985625.0 / 64.0) * pow(x, 8) - + 5528299880478375.0 / 16.0 * pow(x, 6) + + (1525829741060625.0 / 32.0) * pow(x, 4) - + 39529267903125.0 / 16.0 * pow(x, 2) + 2635284526875.0 / 128.0; +} + +double +AssLegFunction::P_17_9(const double x) const +{ + return (75293843625.0 / 128.0) * pow(1 - pow(x, 2), 9.0 / 2.0) * + (-267003 * pow(x, 8) + 226548 * pow(x, 6) - 54810 * pow(x, 4) + + 3780 * pow(x, 2) - 35); +} + +double +AssLegFunction::P_17_9_Deriv(const double x) const +{ + return (677644592625.0 / 128.0) * x * sqrt(1 - pow(x, 2)) * + (-504339 * pow(x, 14) + 2127933 * pow(x, 12) - 3587967 * pow(x, 10) + + 3068673 * pow(x, 8) - 1393337 * pow(x, 6) + 319767 * pow(x, 4) - + 31605 * pow(x, 2) + 875); +} + +double +AssLegFunction::P_17_10(const double x) const +{ + return (2032933777875.0 / 16.0) * x * pow(pow(x, 2) - 1, 5) * + (-9889 * pow(x, 6) + 6293 * pow(x, 4) - 1015 * pow(x, 2) + 35); +} + +double +AssLegFunction::P_17_10_Deriv(const double x) const +{ + return -341762596199899875.0 / 16.0 * pow(x, 16) + + (849837471833975625.0 / 8.0) * pow(x, 14) - + 1735932317596351875.0 / 8.0 * pow(x, 12) + + (1866466995473705625.0 / 8.0) * pow(x, 10) - + 561242192726840625.0 / 4.0 * pow(x, 8) + + (368955118412755875.0 / 8.0) * pow(x, 6) - + 59554795022848125.0 / 8.0 * pow(x, 4) + + (3628786793506875.0 / 8.0) * pow(x, 2) - 71152682225625.0 / 16.0; +} + +double +AssLegFunction::P_17_11(const double x) const +{ + return (14230536445125.0 / 16.0) * pow(1 - pow(x, 2), 11.0 / 2.0) * + (-9889 * pow(x, 6) + 4495 * pow(x, 4) - 435 * pow(x, 2) + 5); +} + +double +AssLegFunction::P_17_11_Deriv(const double x) const +{ + return (14230536445125.0 / 16.0) * x * pow(1 - pow(x, 2), 9.0 / 2.0) * + (108779 * pow(x, 6) - 49445 * pow(x, 4) + 4785 * pow(x, 2) + + 58 * (1 - pow(x, 2)) * (-1023 * pow(x, 4) + 310 * pow(x, 2) - 15) - + 55); +} + +double +AssLegFunction::P_17_12(const double x) const +{ + return (412685556908625.0 / 8.0) * x * pow(pow(x, 2) - 1, 6) * + (1023 * pow(x, 4) - 310 * pow(x, 2) + 15); +} + +double +AssLegFunction::P_17_12_Deriv(const double x) const +{ + return (7177014520197897375.0 / 8.0) * pow(x, 16) - + 4989368383025276250.0 * pow(x, 14) + + (23095947192391198125.0 / 2.0) * pow(x, 12) - + 14299554546883856250.0 * pow(x, 10) + + (40428740582553448125.0 / 4.0) * pow(x, 8) - + 4003875273127479750.0 * pow(x, 6) + + (1603283388590008125.0 / 2.0) * pow(x, 4) - + 61902833536293750.0 * pow(x, 2) + 6190283353629375.0 / 8.0; +} + +double +AssLegFunction::P_17_13(const double x) const +{ + return (6190283353629375.0 / 8.0) * pow(1 - pow(x, 2), 13.0 / 2.0) * + (-341 * pow(x, 4) + 62 * pow(x, 2) - 1); +} + +double +AssLegFunction::P_17_13_Deriv(const double x) const +{ + return (6190283353629375.0 / 8.0) * x * pow(1 - pow(x, 2), 11.0 / 2.0) * + (4433 * pow(x, 4) - 806 * pow(x, 2) + + 124 * (1 - 11 * pow(x, 2)) * (1 - pow(x, 2)) + 13); +} + +double +AssLegFunction::P_17_14(const double x) const +{ + return (191898783962510625.0 / 2.0) * x * (1 - 11 * pow(x, 2)) * + pow(pow(x, 2) - 1, 7); +} + +double +AssLegFunction::P_17_14_Deriv(const double x) const +{ + return (191898783962510625.0 / 2.0) * pow(pow(x, 2) - 1, 6) * + (-14 * pow(x, 2) * (11 * pow(x, 2) - 1) + + (1 - 33 * pow(x, 2)) * (pow(x, 2) - 1)); +} + +double +AssLegFunction::P_17_15(const double x) const +{ + return (191898783962510625.0 / 2.0) * (1 - 33 * pow(x, 2)) * + pow(1 - pow(x, 2), 15.0 / 2.0); +} + +double +AssLegFunction::P_17_15_Deriv(const double x) const +{ + return (575696351887531875.0 / 2.0) * x * pow(1 - pow(x, 2), 13.0 / 2.0) * + (187 * pow(x, 2) - 27); +} + +double +AssLegFunction::P_17_16(const double x) const +{ + return 6332659870762850625.0 * x * pow(pow(x, 2) - 1, 8); +} + +double +AssLegFunction::P_17_16_Deriv(const double x) const +{ + return pow(pow(x, 2) - 1, 7) * + (107655217802968460625.0 * pow(x, 2) - 6332659870762850625.0); +} + +double +AssLegFunction::P_17_17(const double x) const +{ + return -6332659870762850625.0 * pow(1 - pow(x, 2), 17.0 / 2.0); +} + +double +AssLegFunction::P_17_17_Deriv(const double x) const +{ + return 107655217802968460625.0 * x * pow(1 - pow(x, 2), 15.0 / 2.0); +} + +double +AssLegFunction::P_18_0(const double x) const +{ + return (2268783825.0 / 65536.0) * pow(x, 18) - + 9917826435.0 / 65536.0 * pow(x, 16) + + (4508102925.0 / 16384.0) * pow(x, 14) - + 4411154475.0 / 16384.0 * pow(x, 12) + + (5019589575.0 / 32768.0) * pow(x, 10) - + 1673196525.0 / 32768.0 * pow(x, 8) + + (156165009.0 / 16384.0) * pow(x, 6) - + 14549535.0 / 16384.0 * pow(x, 4) + (2078505.0 / 65536.0) * pow(x, 2) - + 12155.0 / 65536.0; +} + +double +AssLegFunction::P_18_0_Deriv(const double x) const +{ + return (171.0 / 32768.0) * x * + (119409675.0 * pow(x, 16) - 463991880.0 * pow(x, 14) + + 738168900.0 * pow(x, 12) - 619109400.0 * pow(x, 10) + + 293543250.0 * pow(x, 8) - 78278200 * pow(x, 6) + + 10958948 * pow(x, 4) - 680680 * pow(x, 2) + 12155); +} + +double +AssLegFunction::P_18_1(const double x) const +{ + return (171.0 / 32768.0) * x * sqrt(1 - pow(x, 2)) * + (-119409675.0 * pow(x, 16) + 463991880.0 * pow(x, 14) - + 738168900.0 * pow(x, 12) + 619109400.0 * pow(x, 10) - + 293543250.0 * pow(x, 8) + 78278200 * pow(x, 6) - + 10958948 * pow(x, 4) + 680680 * pow(x, 2) - 12155); +} + +double +AssLegFunction::P_18_1_Deriv(const double x) const +{ + return (171.0 / 32768.0) * + (2149374150.0 * pow(x, 18) - 9453834555.0 * pow(x, 16) + + 17294242800.0 * pow(x, 14) - 17025508500.0 * pow(x, 12) + + 9745635900.0 * pow(x, 10) - 3268114850.0 * pow(x, 8) + + 613701088.0 * pow(x, 6) - 57517460 * pow(x, 4) + 2066350 * pow(x, 2) - + 12155) / + sqrt(1 - pow(x, 2)); +} + +double +AssLegFunction::P_18_2(const double x) const +{ + return -347123925225.0 / 32768.0 * pow(x, 18) + + (1537263097425.0 / 32768.0) * pow(x, 16) - + 707772159225.0 / 8192.0 * pow(x, 14) + + (701373561525.0 / 8192.0) * pow(x, 12) - + 808153921575.0 / 16384.0 * pow(x, 10) + + (272731033575.0 / 16384.0) * pow(x, 8) - + 25767226485.0 / 8192.0 * pow(x, 6) + + (2429772345.0 / 8192.0) * pow(x, 4) - + 351267345.0 / 32768.0 * pow(x, 2) + 2078505.0 / 32768.0; +} + +double +AssLegFunction::P_18_2_Deriv(const double x) const +{ + return (14535.0 / 16384.0) * x * + (-214937415.0 * pow(x, 16) + 846102840.0 * pow(x, 14) - + 1363441380.0 * pow(x, 12) + 1158098760.0 * pow(x, 10) - + 556005450.0 * pow(x, 8) + 150109960.0 * pow(x, 6) - + 21273252 * pow(x, 4) + 1337336 * pow(x, 2) - 24167); +} + +double +AssLegFunction::P_18_3(const double x) const +{ + return (101745.0 / 2048.0) * x * pow(1 - pow(x, 2), 3.0 / 2.0) * + (-3411705 * pow(x, 14) + 10235115 * pow(x, 12) - + 12096045 * pow(x, 10) + 7153575 * pow(x, 8) - 2220075 * pow(x, 6) + + 345345 * pow(x, 4) - 23023 * pow(x, 2) + 429); +} + +double +AssLegFunction::P_18_3_Deriv(const double x) const +{ + return (305235.0 / 2048.0) * sqrt(1 - pow(x, 2)) * + (20470230 * pow(x, 16) - 71645805 * pow(x, 14) + + 100800375.0 * pow(x, 12) - 72966465 * pow(x, 10) + + 28860975 * pow(x, 8) - 6101095 * pow(x, 6) + 621621 * pow(x, 4) - + 23595 * pow(x, 2) + 143); +} + +double +AssLegFunction::P_18_4(const double x) const +{ + return (3357585.0 / 2048.0) * pow(pow(x, 2) - 1, 2) * + (1550775 * pow(x, 14) - 4032015 * pow(x, 12) + 4032015 * pow(x, 10) - + 1950975 * pow(x, 8) + 470925 * pow(x, 6) - 52325 * pow(x, 4) + + 2093 * pow(x, 2) - 13); +} + +double +AssLegFunction::P_18_4_Deriv(const double x) const +{ + return (3357585.0 / 1024.0) * x * + (13956975 * pow(x, 16) - 57068520 * pow(x, 14) + + 95527740 * pow(x, 12) - 84282120 * pow(x, 10) + 42024450 * pow(x, 8) - + 11780600 * pow(x, 6) + 1733004 * pow(x, 4) - 113048 * pow(x, 2) + + 2119); +} + +double +AssLegFunction::P_18_5(const double x) const +{ + return (77224455.0 / 1024.0) * x * pow(1 - pow(x, 2), 5.0 / 2.0) * + (-471975 * pow(x, 12) + 1051830 * pow(x, 10) - 876525 * pow(x, 8) + + 339300 * pow(x, 6) - 61425 * pow(x, 4) + 4550 * pow(x, 2) - 91); +} + +double +AssLegFunction::P_18_5_Deriv(const double x) const +{ + return (77224455.0 / 1024.0) * sqrt(1 - pow(x, 2)) * + (-8495550 * pow(x, 16) + 31460505 * pow(x, 14) - + 46806435 * pow(x, 12) + 35801805 * pow(x, 10) - 14949675 * pow(x, 8) + + 3332875 * pow(x, 6) - 357721 * pow(x, 4) + 14287 * pow(x, 2) - 91); +} + +double +AssLegFunction::P_18_6(const double x) const +{ + return (1003917915.0 / 1024.0) * pow(pow(x, 2) - 1, 3) * + (-471975 * pow(x, 12) + 890010 * pow(x, 10) - 606825 * pow(x, 8) + + 182700 * pow(x, 6) - 23625 * pow(x, 4) + 1050 * pow(x, 2) - 7); +} + +double +AssLegFunction::P_18_6_Deriv(const double x) const +{ + return (3011753745.0 / 512.0) * x * + (-1415925 * pow(x, 16) + 6149160 * pow(x, 14) - 10949820 * pow(x, 12) + + 10290360 * pow(x, 10) - 5470350 * pow(x, 8) + 1635800 * pow(x, 6) - + 256732 * pow(x, 4) + 17864 * pow(x, 2) - 357); +} + +double +AssLegFunction::P_18_7(const double x) const +{ + return (75293843625.0 / 256.0) * x * pow(1 - pow(x, 2), 7.0 / 2.0) * + (-18879 * pow(x, 10) + 29667 * pow(x, 8) - 16182 * pow(x, 6) + + 3654 * pow(x, 4) - 315 * pow(x, 2) + 7); +} + +double +AssLegFunction::P_18_7_Deriv(const double x) const +{ + return (75293843625.0 / 256.0) * sqrt(1 - pow(x, 2)) * + (339822 * pow(x, 16) - 1361985 * pow(x, 14) + 2198055 * pow(x, 12) - + 1826565 * pow(x, 10) + 829215 * pow(x, 8) - 200963 * pow(x, 6) + + 23429 * pow(x, 4) - 1015 * pow(x, 2) + 7); +} + +double +AssLegFunction::P_18_8(const double x) const +{ + return (75293843625.0 / 256.0) * pow(pow(x, 2) - 1, 4) * + (207669 * pow(x, 10) - 267003 * pow(x, 8) + 113274 * pow(x, 6) - + 18270 * pow(x, 4) + 945 * pow(x, 2) - 7); +} + +double +AssLegFunction::P_18_8_Deriv(const double x) const +{ + return (75293843625.0 / 128.0) * x * + (1869021 * pow(x, 16) - 8781432 * pow(x, 14) + 16991100 * pow(x, 12) - + 17424360 * pow(x, 10) + 10146750 * pow(x, 8) - 3334024 * pow(x, 6) + + 576156 * pow(x, 4) - 44184 * pow(x, 2) + 973); +} + +double +AssLegFunction::P_18_9(const double x) const +{ + return (225881530875.0 / 128.0) * x * pow(1 - pow(x, 2), 9.0 / 2.0) * + (-346115 * pow(x, 8) + 356004 * pow(x, 6) - 113274 * pow(x, 4) + + 12180 * pow(x, 2) - 315); +} + +double +AssLegFunction::P_18_9_Deriv(const double x) const +{ + return (2032933777875.0 / 128.0) * sqrt(1 - pow(x, 2)) * + (-692230 * pow(x, 16) + 3055701 * pow(x, 14) - 5466819 * pow(x, 12) + + 5067721 * pow(x, 10) - 2580219 * pow(x, 8) + 703871 * pow(x, 6) - + 92505 * pow(x, 4) + 4515 * pow(x, 2) - 35); +} + +double +AssLegFunction::P_18_10(const double x) const +{ + return (14230536445125.0 / 128.0) * pow(pow(x, 2) - 1, 5) * + (-49445 * pow(x, 8) + 39556 * pow(x, 6) - 8990 * pow(x, 4) + + 580 * pow(x, 2) - 5); +} + +double +AssLegFunction::P_18_10_Deriv(const double x) const +{ + return (14230536445125.0 / 64.0) * x * + (-445005 * pow(x, 16) + 2294248 * pow(x, 14) - 4908540 * pow(x, 12) + + 5613240 * pow(x, 10) - 3677950 * pow(x, 8) + 1371800 * pow(x, 6) - + 271068 * pow(x, 4) + 23880 * pow(x, 2) - 605); +} + +double +AssLegFunction::P_18_11(const double x) const +{ + return (412685556908625.0 / 16.0) * x * pow(1 - pow(x, 2), 11.0 / 2.0) * + (-1705 * pow(x, 6) + 1023 * pow(x, 4) - 155 * pow(x, 2) + 5); +} + +double +AssLegFunction::P_18_11_Deriv(const double x) const +{ + return (412685556908625.0 / 16.0) * sqrt(1 - pow(x, 2)) * + (30690 * pow(x, 16) - 151063 * pow(x, 14) + 304637 * pow(x, 12) - + 322243 * pow(x, 10) + 189717 * pow(x, 8) - 60613 * pow(x, 6) + + 9415 * pow(x, 4) - 545 * pow(x, 2) + 5); +} + +double +AssLegFunction::P_18_12(const double x) const +{ + return (2063427784543125.0 / 16.0) * pow(pow(x, 2) - 1, 6) * + (2387 * pow(x, 6) - 1023 * pow(x, 4) + 93 * pow(x, 2) - 1); +} + +double +AssLegFunction::P_18_12_Deriv(const double x) const +{ + return (6190283353629375.0 / 8.0) * x * pow(pow(x, 2) - 1, 5) * + (4774 * pow(x, 6) - 2046 * pow(x, 4) + 186 * pow(x, 2) + + 31 * (pow(x, 2) - 1) * (77 * pow(x, 4) - 22 * pow(x, 2) + 1) - 2); +} + +double +AssLegFunction::P_18_13(const double x) const +{ + return (191898783962510625.0 / 8.0) * x * pow(1 - pow(x, 2), 13.0 / 2.0) * + (-77 * pow(x, 4) + 22 * pow(x, 2) - 1); +} + +double +AssLegFunction::P_18_13_Deriv(const double x) const +{ + return (191898783962510625.0 / 8.0) * pow(1 - pow(x, 2), 11.0 / 2.0) * + (13 * pow(x, 2) * (77 * pow(x, 4) - 22 * pow(x, 2) + 1) + + (1 - pow(x, 2)) * (-385 * pow(x, 4) + 66 * pow(x, 2) - 1)); +} + +double +AssLegFunction::P_18_14(const double x) const +{ + return (191898783962510625.0 / 8.0) * pow(pow(x, 2) - 1, 7) * + (-385 * pow(x, 4) + 66 * pow(x, 2) - 1); +} + +double +AssLegFunction::P_18_14_Deriv(const double x) const +{ + return (191898783962510625.0 / 4.0) * x * pow(pow(x, 2) - 1, 6) * + (-2695 * pow(x, 4) + 462 * pow(x, 2) + + 22 * (3 - 35 * pow(x, 2)) * (pow(x, 2) - 1) - 7); +} + +double +AssLegFunction::P_18_15(const double x) const +{ + return (2110886623587616875.0 / 2.0) * x * pow(1 - pow(x, 2), 15.0 / 2.0) * + (3 - 35 * pow(x, 2)); +} + +double +AssLegFunction::P_18_15_Deriv(const double x) const +{ + return (6332659870762850625.0 / 2.0) * pow(1 - pow(x, 2), 13.0 / 2.0) * + (5 * pow(x, 2) * (35 * pow(x, 2) - 3) + + (1 - 35 * pow(x, 2)) * (1 - pow(x, 2))); +} + +double +AssLegFunction::P_18_16(const double x) const +{ + return (6332659870762850625.0 / 2.0) * pow(pow(x, 2) - 1, 8) * + (35 * pow(x, 2) - 1); +} + +double +AssLegFunction::P_18_16_Deriv(const double x) const +{ + return 6332659870762850625.0 * x * pow(pow(x, 2) - 1, 7) * + (315 * pow(x, 2) - 43); +} + +double +AssLegFunction::P_18_17(const double x) const +{ + return -221643095476699771875.0 * x * pow(1 - pow(x, 2), 17.0 / 2.0); +} + +double +AssLegFunction::P_18_17_Deriv(const double x) const +{ + return pow(1 - pow(x, 2), 15.0 / 2.0) * + (3989575718580595893750.0 * pow(x, 2) - 221643095476699771875.0); +} + +double +AssLegFunction::P_18_18(const double x) const +{ + return -221643095476699771875.0 * pow(pow(x, 2) - 1, 9); +} + +double +AssLegFunction::P_18_18_Deriv(const double x) const +{ + return -3989575718580595893750.0 * x * pow(pow(x, 2) - 1, 8); +} + +double +AssLegFunction::P_19_0(const double x) const +{ + return (1.0 / 65536.0) * x * + (4418157975.0 * pow(x, 18) - 20419054425.0 * pow(x, 16) + + 39671305740.0 * pow(x, 14) - 42075627300.0 * pow(x, 12) + + 26466926850.0 * pow(x, 10) - 10039179150.0 * pow(x, 8) + + 2230928700.0 * pow(x, 6) - 267711444.0 * pow(x, 4) + + 14549535 * pow(x, 2) - 230945); +} + +double +AssLegFunction::P_19_0_Deriv(const double x) const +{ + return (83945001525.0 / 65536.0) * pow(x, 18) - + 347123925225.0 / 65536.0 * pow(x, 16) + + (148767396525.0 / 16384.0) * pow(x, 14) - + 136745788725.0 / 16384.0 * pow(x, 12) + + (145568097675.0 / 32768.0) * pow(x, 10) - + 45176306175.0 / 32768.0 * pow(x, 8) + + (3904125225.0 / 16384.0) * pow(x, 6) - + 334639305.0 / 16384.0 * pow(x, 4) + + (43648605.0 / 65536.0) * pow(x, 2) - 230945.0 / 65536.0; +} + +double +AssLegFunction::P_19_1(const double x) const +{ + return (95.0 / 65536.0) * sqrt(1 - pow(x, 2)) * + (-883631595.0 * pow(x, 18) + 3653936055.0 * pow(x, 16) - + 6263890380.0 * pow(x, 14) + 5757717420.0 * pow(x, 12) - + 3064591530.0 * pow(x, 10) + 951080130.0 * pow(x, 8) - + 164384220.0 * pow(x, 6) + 14090076 * pow(x, 4) - 459459 * pow(x, 2) + + 2431); +} + +double +AssLegFunction::P_19_1_Deriv(const double x) const +{ + return (1.0 / 65536.0) * + (1594955028975.0 * pow(x, 19) - 7412116756275.0 * pow(x, 17) + + 14480026595100.0 * pow(x, 15) - 15441755219100.0 * pow(x, 13) + + 9766296007650.0 * pow(x, 11) - 3724535464650.0 * pow(x, 9) + + 832136405100.0 * pow(x, 7) - 100391791500.0 * pow(x, 5) + + 5485174695.0 * pow(x, 3) - 87528155 * x) / + sqrt(1 - pow(x, 2)); +} + +double +AssLegFunction::P_19_2(const double x) const +{ + return (5985.0 / 32768.0) * x * + (-126233085.0 * pow(x, 18) + 590224965.0 * pow(x, 16) - + 1159979700.0 * pow(x, 14) + 1244341860.0 * pow(x, 12) - + 791575590.0 * pow(x, 10) + 303607590.0 * pow(x, 8) - + 68213860 * pow(x, 6) + 8275124 * pow(x, 4) - 454597 * pow(x, 2) + + 7293); +} + +double +AssLegFunction::P_19_2_Deriv(const double x) const +{ + return -14354595260775.0 / 32768.0 * pow(x, 18) + + (60052439063925.0 / 32768.0) * pow(x, 16) - + 26034294391875.0 / 8192.0 * pow(x, 14) + + (24204004604325.0 / 8192.0) * pow(x, 12) - + 26056689483825.0 / 16384.0 * pow(x, 10) + + (8176911417675.0 / 16384.0) * pow(x, 8) - + 714454916175.0 / 8192.0 * pow(x, 6) + + (61908271425.0 / 8192.0) * pow(x, 4) - + 8162289135.0 / 32768.0 * pow(x, 2) + 43648605.0 / 32768.0; +} + +double +AssLegFunction::P_19_3(const double x) const +{ + return (1119195.0 / 32768.0) * pow(1 - pow(x, 2), 3.0 / 2.0) * + (-11475735 * pow(x, 16) + 37218600 * pow(x, 14) - + 48384180 * pow(x, 12) + 32256120 * pow(x, 10) - 11705850 * pow(x, 8) + + 2260440 * pow(x, 6) - 209300 * pow(x, 4) + 7176 * pow(x, 2) - 39); +} + +double +AssLegFunction::P_19_3_Deriv(const double x) const +{ + return (1119195.0 / 32768.0) * x * sqrt(1 - pow(x, 2)) * + (218038965.0 * pow(x, 16) - 816327960.0 * pow(x, 14) + + 1246823100.0 * pow(x, 12) - 999939720.0 * pow(x, 10) + + 451325550.0 * pow(x, 8) - 113990760.0 * pow(x, 6) + + 15027740 * pow(x, 4) - 873080 * pow(x, 2) + 14469); +} + +double +AssLegFunction::P_19_4(const double x) const +{ + return (25741485.0 / 2048.0) * x * pow(pow(x, 2) - 1, 2) * + (498945 * pow(x, 14) - 1415925 * pow(x, 12) + 1577745 * pow(x, 10) - + 876525 * pow(x, 8) + 254475 * pow(x, 6) - 36855 * pow(x, 4) + + 2275 * pow(x, 2) - 39); +} + +double +AssLegFunction::P_19_4_Deriv(const double x) const +{ + return (244028119433175.0 / 2048.0) * pow(x, 18) - + 1056298104459675.0 / 2048.0 * pow(x, 16) + + (473824157932125.0 / 512.0) * pow(x, 14) - + 455773713820425.0 / 512.0 * pow(x, 12) + + (507595956592725.0 / 1024.0) * pow(x, 10) - + 164757988620225.0 / 1024.0 * pow(x, 8) + + (14886429482925.0 / 512.0) * pow(x, 6) - + 1333537630425.0 / 512.0 * pow(x, 4) + + (181709142615.0 / 2048.0) * pow(x, 2) - 1003917915.0 / 2048.0; +} + +double +AssLegFunction::P_19_5(const double x) const +{ + return (77224455.0 / 2048.0) * pow(1 - pow(x, 2), 5.0 / 2.0) * + (-2494725 * pow(x, 14) + 6135675 * pow(x, 12) - 5785065 * pow(x, 10) + + 2629575 * pow(x, 8) - 593775 * pow(x, 6) + 61425 * pow(x, 4) - + 2275 * pow(x, 2) + 13); +} + +double +AssLegFunction::P_19_5_Deriv(const double x) const +{ + return (386122275.0 / 2048.0) * x * sqrt(1 - pow(x, 2)) * + (-9479955 * pow(x, 16) + 37326480 * pow(x, 14) - + 59927340 * pow(x, 12) + 50487840 * pow(x, 10) - 23920650 * pow(x, 8) + + 6336720 * pow(x, 6) - 875420 * pow(x, 4) + 53248 * pow(x, 2) - 923); +} + +double +AssLegFunction::P_19_6(const double x) const +{ + return (1930611375.0 / 1024.0) * x * pow(pow(x, 2) - 1, 3) * + (-698523 * pow(x, 12) + 1472562 * pow(x, 10) - 1157013 * pow(x, 8) + + 420732 * pow(x, 6) - 71253 * pow(x, 4) + 4914 * pow(x, 2) - 91); +} + +double +AssLegFunction::P_19_6_Deriv(const double x) const +{ + return -25622952540483375.0 / 1024.0 * pow(x, 18) + + (117107463033532125.0 / 1024.0) * pow(x, 16) - + 55531149937869375.0 / 256.0 * pow(x, 14) + + (56520453124760625.0 / 256.0) * pow(x, 12) - + 66651992722940625.0 / 512.0 * pow(x, 10) + + (22917262477984875.0 / 512.0) * pow(x, 8) - + 2193786525805875.0 / 256.0 * pow(x, 6) + + (208187477623125.0 / 256.0) * pow(x, 4) - + 30042243606375.0 / 1024.0 * pow(x, 2) + 175685635125.0 / 1024.0; +} + +double +AssLegFunction::P_19_7(const double x) const +{ + return (25097947875.0 / 1024.0) * pow(1 - pow(x, 2), 7.0 / 2.0) * + (-698523 * pow(x, 12) + 1246014 * pow(x, 10) - 801009 * pow(x, 8) + + 226548 * pow(x, 6) - 27405 * pow(x, 4) + 1134 * pow(x, 2) - 7); +} + +double +AssLegFunction::P_19_7_Deriv(const double x) const +{ + return (25097947875.0 / 1024.0) * x * sqrt(1 - pow(x, 2)) * + (13271937 * pow(x, 16) - 56108388 * pow(x, 14) + + 96876240 * pow(x, 12) - 87868260 * pow(x, 10) + 44842410 * pow(x, 8) - + 12794508 * pow(x, 6) + 1902712 * pow(x, 4) - 124460 * pow(x, 2) + + 2317); +} + +double +AssLegFunction::P_19_8(const double x) const +{ + return (225881530875.0 / 256.0) * x * pow(pow(x, 2) - 1, 4) * + (232841 * pow(x, 10) - 346115 * pow(x, 8) + 178002 * pow(x, 6) - + 37758 * pow(x, 4) + 3045 * pow(x, 2) - 63); +} + +double +AssLegFunction::P_19_8_Deriv(const double x) const +{ + return (999295149078851625.0 / 256.0) * pow(x, 18) - + 4905501507071290125.0 / 256.0 * pow(x, 16) + + (2506868241288035625.0 / 64.0) * pow(x, 14) - + 2758671936646250625.0 / 64.0 * pow(x, 12) + + (3527511679731414375.0 / 128.0) * pow(x, 10) - + 1318270138799488875.0 / 128.0 * pow(x, 8) + + (137386342353385125.0 / 64.0) * pow(x, 6) - + 14206818884383125.0 / 64.0 * pow(x, 4) + + (2234194221884625.0 / 256.0) * pow(x, 2) - 14230536445125.0 / 256.0; +} + +double +AssLegFunction::P_19_9(const double x) const +{ + return (1581170716125.0 / 256.0) * pow(1 - pow(x, 2), 9.0 / 2.0) * + (-365893 * pow(x, 10) + 445005 * pow(x, 8) - 178002 * pow(x, 6) + + 26970 * pow(x, 4) - 1305 * pow(x, 2) + 9); +} + +double +AssLegFunction::P_19_9_Deriv(const double x) const +{ + return (1581170716125.0 / 256.0) * x * sqrt(1 - pow(x, 2)) * + (-6951967 * pow(x, 16) + 32079916 * pow(x, 14) - + 60758016 * pow(x, 12) + 60732844 * pow(x, 10) - 34292326 * pow(x, 8) + + 10855332 * pow(x, 6) - 1793400 * pow(x, 4) + 130308 * pow(x, 2) - + 2691); +} + +double +AssLegFunction::P_19_10(const double x) const +{ + return (45853950767625.0 / 128.0) * x * pow(pow(x, 2) - 1, 5) * + (-63085 * pow(x, 8) + 61380 * pow(x, 6) - 18414 * pow(x, 4) + + 1860 * pow(x, 2) - 45); +} + +double +AssLegFunction::P_19_10_Deriv(const double x) const +{ + return -54961233199336839375.0 / 128.0 * pow(x, 18) + + (293725964622913948125.0 / 128.0) * pow(x, 16) - + 164414613681657714375.0 / 32.0 * pow(x, 14) + + (199482339610214285625.0 / 32.0) * pow(x, 12) - + 283143789864761450625.0 / 64.0 * pow(x, 10) + + (118224094915398346875.0 / 64.0) * pow(x, 8) - + 13842161387976796875.0 / 32.0 * pow(x, 6) + + (1614288336774238125.0 / 32.0) * pow(x, 4) - + 286816462051494375.0 / 128.0 * pow(x, 2) + 2063427784543125.0 / 128.0; +} + +double +AssLegFunction::P_19_11(const double x) const +{ + return (2063427784543125.0 / 128.0) * pow(1 - pow(x, 2), 11.0 / 2.0) * + (-12617 * pow(x, 8) + 9548 * pow(x, 6) - 2046 * pow(x, 4) + + 124 * pow(x, 2) - 1); +} + +double +AssLegFunction::P_19_11_Deriv(const double x) const +{ + return (2063427784543125.0 / 128.0) * x * sqrt(1 - pow(x, 2)) * + (239723 * pow(x, 16) - 1222144 * pow(x, 14) + 2579324 * pow(x, 12) - + 2900112 * pow(x, 10) + 1860042 * pow(x, 8) - 674976 * pow(x, 6) + + 128716 * pow(x, 4) - 10832 * pow(x, 2) + 259); +} + +double +AssLegFunction::P_19_12(const double x) const +{ + return (63966261320836875.0 / 16.0) * x * pow(pow(x, 2) - 1, 6) * + (407 * pow(x, 6) - 231 * pow(x, 4) + 33 * pow(x, 2) - 1); +} + +double +AssLegFunction::P_19_12_Deriv(const double x) const +{ + return (494651098794031554375.0 / 16.0) * pow(x, 18) - + 2906690880680148436875.0 / 16.0 * pow(x, 16) + + (1804808063167412428125.0 / 4.0) * pow(x, 14) - + 2453937683051265035625.0 / 4.0 * pow(x, 12) + + (3949468872732431173125.0 / 8.0) * pow(x, 10) - + 1894616694061867400625.0 / 8.0 * pow(x, 8) + + (258359729474860138125.0 / 4.0) * pow(x, 6) - + 35501275033064465625.0 / 4.0 * pow(x, 4) + + (7484052574537914375.0 / 16.0) * pow(x, 2) - + 63966261320836875.0 / 16.0; +} + +double +AssLegFunction::P_19_13(const double x) const +{ + return (63966261320836875.0 / 16.0) * pow(1 - pow(x, 2), 13.0 / 2.0) * + (-2849 * pow(x, 6) + 1155 * pow(x, 4) - 99 * pow(x, 2) + 1); +} + +double +AssLegFunction::P_19_13_Deriv(const double x) const +{ + return (63966261320836875.0 / 16.0) * x * pow(1 - pow(x, 2), 11.0 / 2.0) * + (37037 * pow(x, 6) - 15015 * pow(x, 4) + 1287 * pow(x, 2) + + 66 * (1 - pow(x, 2)) * (-259 * pow(x, 4) + 70 * pow(x, 2) - 3) - 13); +} + +double +AssLegFunction::P_19_14(const double x) const +{ + return (2110886623587616875.0 / 8.0) * x * pow(pow(x, 2) - 1, 7) * + (-259 * pow(x, 4) + 70 * pow(x, 2) - 3); +} + +double +AssLegFunction::P_19_14_Deriv(const double x) const +{ + return (2110886623587616875.0 / 8.0) * pow(pow(x, 2) - 1, 6) * + (-14 * pow(x, 2) * (259 * pow(x, 4) - 70 * pow(x, 2) + 3) + + (pow(x, 2) - 1) * (-1295 * pow(x, 4) + 210 * pow(x, 2) - 3)); +} + +double +AssLegFunction::P_19_15(const double x) const +{ + return (2110886623587616875.0 / 8.0) * pow(1 - pow(x, 2), 15.0 / 2.0) * + (-1295 * pow(x, 4) + 210 * pow(x, 2) - 3); +} + +double +AssLegFunction::P_19_15_Deriv(const double x) const +{ + return (10554433117938084375.0 / 8.0) * x * pow(1 - pow(x, 2), 13.0 / 2.0) * + (3885 * pow(x, 4) - 630 * pow(x, 2) + + 28 * (1 - pow(x, 2)) * (3 - 37 * pow(x, 2)) + 9); +} + +double +AssLegFunction::P_19_16(const double x) const +{ + return (73881031825566590625.0 / 2.0) * x * pow(pow(x, 2) - 1, 8) * + (37 * pow(x, 2) - 3); +} + +double +AssLegFunction::P_19_16_Deriv(const double x) const +{ + return (73881031825566590625.0 / 2.0) * pow(pow(x, 2) - 1, 7) * + (16 * pow(x, 2) * (37 * pow(x, 2) - 3) + + 3 * (pow(x, 2) - 1) * (37 * pow(x, 2) - 1)); +} + +double +AssLegFunction::P_19_17(const double x) const +{ + return (221643095476699771875.0 / 2.0) * (1 - 37 * pow(x, 2)) * + pow(1 - pow(x, 2), 17.0 / 2.0); +} + +double +AssLegFunction::P_19_17_Deriv(const double x) const +{ + return (221643095476699771875.0 / 2.0) * x * pow(1 - pow(x, 2), 15.0 / 2.0) * + (703 * pow(x, 2) - 91); +} + +double +AssLegFunction::P_19_18(const double x) const +{ + return -8200794532637891559375.0 * x * pow(pow(x, 2) - 1, 9); +} + +double +AssLegFunction::P_19_18_Deriv(const double x) const +{ + return (8200794532637891559375.0 - 155815096120119939628125.0 * pow(x, 2)) * + pow(pow(x, 2) - 1, 8); +} + +double +AssLegFunction::P_19_19(const double x) const +{ + return -8200794532637891559375.0 * pow(1 - pow(x, 2), 19.0 / 2.0); +} + +double +AssLegFunction::P_19_19_Deriv(const double x) const +{ + return 155815096120119939628125.0 * x * pow(1 - pow(x, 2), 17.0 / 2.0); +} + +double +AssLegFunction::P_20_0(const double x) const +{ + return (34461632205.0 / 262144.0) * pow(x, 20) - + 83945001525.0 / 131072.0 * pow(x, 18) + + (347123925225.0 / 262144.0) * pow(x, 16) - + 49589132175.0 / 32768.0 * pow(x, 14) + + (136745788725.0 / 131072.0) * pow(x, 12) - + 29113619535.0 / 65536.0 * pow(x, 10) + + (15058768725.0 / 131072.0) * pow(x, 8) - + 557732175.0 / 32768.0 * pow(x, 6) + + (334639305.0 / 262144.0) * pow(x, 4) - + 4849845.0 / 131072.0 * pow(x, 2) + 46189.0 / 262144.0; +} + +double +AssLegFunction::P_20_0_Deriv(const double x) const +{ + return (105.0 / 65536.0) * x * + (1641030105.0 * pow(x, 18) - 7195285845.0 * pow(x, 16) + + 13223768580.0 * pow(x, 14) - 13223768580.0 * pow(x, 12) + + 7814045070.0 * pow(x, 10) - 2772725670.0 * pow(x, 8) + + 573667380.0 * pow(x, 6) - 63740820 * pow(x, 4) + 3187041 * pow(x, 2) - + 46189); +} + +double +AssLegFunction::P_20_1(const double x) const +{ + return (105.0 / 65536.0) * x * sqrt(1 - pow(x, 2)) * + (-1641030105.0 * pow(x, 18) + 7195285845.0 * pow(x, 16) - + 13223768580.0 * pow(x, 14) + 13223768580.0 * pow(x, 12) - + 7814045070.0 * pow(x, 10) + 2772725670.0 * pow(x, 8) - + 573667380.0 * pow(x, 6) + 63740820 * pow(x, 4) - 3187041 * pow(x, 2) + + 46189); +} + +double +AssLegFunction::P_20_1_Deriv(const double x) const +{ + return (105.0 / 65536.0) * + (32820602100.0 * pow(x, 20) - 160694717205.0 * pow(x, 18) + + 333900156645.0 * pow(x, 16) - 383489288820.0 * pow(x, 14) + + 265677532380.0 * pow(x, 12) - 113681752470.0 * pow(x, 10) + + 29543870070.0 * pow(x, 8) - 4398116580.0 * pow(x, 6) + + 331452264.0 * pow(x, 4) - 9653501 * pow(x, 2) + 46189) / + sqrt(1 - pow(x, 2)); +} + +double +AssLegFunction::P_20_2(const double x) const +{ + return -3273855059475.0 / 65536.0 * pow(x, 20) + + (251835004575.0 / 1024.0) * pow(x, 18) - + 33671020746825.0 / 65536.0 * pow(x, 16) + + (2429867476575.0 / 4096.0) * pow(x, 14) - + 13537833083775.0 / 32768.0 * pow(x, 12) + + (727840488375.0 / 4096.0) * pow(x, 10) - + 1520935641225.0 / 32768.0 * pow(x, 8) + + (28444340925.0 / 4096.0) * pow(x, 6) - + 34467848415.0 / 65536.0 * pow(x, 4) + + (63047985.0 / 4096.0) * pow(x, 2) - 4849845.0 / 65536.0; +} + +double +AssLegFunction::P_20_2_Deriv(const double x) const +{ + return (21945.0 / 16384.0) * x * + (-745922775.0 * pow(x, 18) + 3305011680.0 * pow(x, 16) - + 6137347140.0 * pow(x, 14) + 6200618760.0 * pow(x, 12) - + 3701389770.0 * pow(x, 10) + 1326663000.0 * pow(x, 8) - + 277226820.0 * pow(x, 6) + 31107960 * pow(x, 4) - 1570647 * pow(x, 2) + + 22984); +} + +double +AssLegFunction::P_20_3(const double x) const +{ + return (1514205.0 / 32768.0) * x * pow(1 - pow(x, 2), 3.0 / 2.0) * + (-19458855 * pow(x, 16) + 67856520 * pow(x, 14) - + 96282900 * pow(x, 12) + 71524440 * pow(x, 10) - 29801850 * pow(x, 8) + + 6921720 * pow(x, 6) - 835380 * pow(x, 4) + 44200 * pow(x, 2) - 663); +} + +double +AssLegFunction::P_20_3_Deriv(const double x) const +{ + return (4542615.0 / 32768.0) * sqrt(1 - pow(x, 2)) * + (129725700.0 * pow(x, 18) - 517405965.0 * pow(x, 16) + + 852791400.0 * pow(x, 14) - 751006620.0 * pow(x, 12) + + 381463680.0 * pow(x, 10) - 112477950.0 * pow(x, 8) + + 18378360 * pow(x, 6) - 1480700 * pow(x, 4) + 45084 * pow(x, 2) - 221); +} + +double +AssLegFunction::P_20_4(const double x) const +{ + return (77224455.0 / 32768.0) * pow(pow(x, 2) - 1, 2) * + (6486285 * pow(x, 16) - 19957800 * pow(x, 14) + 24542700 * pow(x, 12) - + 15426840 * pow(x, 10) + 5259150 * pow(x, 8) - 950040 * pow(x, 6) + + 81900 * pow(x, 4) - 2600 * pow(x, 2) + 13); +} + +double +AssLegFunction::P_20_4_Deriv(const double x) const +{ + return (77224455.0 / 8192.0) * x * + (32431425 * pow(x, 18) - 148186665.0 * pow(x, 16) + + 283778340.0 * pow(x, 14) - 295645140.0 * pow(x, 12) + + 181966590.0 * pow(x, 10) - 67237950 * pow(x, 8) + + 14482260 * pow(x, 6) - 1674660 * pow(x, 4) + 87113 * pow(x, 2) - + 1313); +} + +double +AssLegFunction::P_20_5(const double x) const +{ + return (386122275.0 / 2048.0) * x * pow(1 - pow(x, 2), 5.0 / 2.0) * + (-1297257 * pow(x, 14) + 3492615 * pow(x, 12) - 3681405 * pow(x, 10) + + 1928355 * pow(x, 8) - 525915 * pow(x, 6) + 71253 * pow(x, 4) - + 4095 * pow(x, 2) + 65); +} + +double +AssLegFunction::P_20_5_Deriv(const double x) const +{ + return (1930611375.0 / 2048.0) * sqrt(1 - pow(x, 2)) * + (-5189028 * pow(x, 18) + 21654213 * pow(x, 16) - + 37326480 * pow(x, 14) + 34359780 * pow(x, 12) - + 18231720 * pow(x, 10) + 5612022 * pow(x, 8) - 956592 * pow(x, 6) + + 80340 * pow(x, 4) - 2548 * pow(x, 2) + 13); +} + +double +AssLegFunction::P_20_6(const double x) const +{ + return (25097947875.0 / 2048.0) * pow(pow(x, 2) - 1, 3) * + (-299367 * pow(x, 14) + 698523 * pow(x, 12) - 623007 * pow(x, 10) + + 267003 * pow(x, 8) - 56637 * pow(x, 6) + 5481 * pow(x, 4) - + 189 * pow(x, 2) + 1); +} + +double +AssLegFunction::P_20_6_Deriv(const double x) const +{ + return (75293843625.0 / 512.0) * x * + (-498945 * pow(x, 18) + 2394936 * pow(x, 16) - 4822236 * pow(x, 14) + + 5286120 * pow(x, 12) - 3425190 * pow(x, 10) + 1332840 * pow(x, 8) - + 302364 * pow(x, 6) + 36824 * pow(x, 4) - 2017 * pow(x, 2) + 32); +} + +double +AssLegFunction::P_20_7(const double x) const +{ + return (225881530875.0 / 1024.0) * x * pow(1 - pow(x, 2), 7.0 / 2.0) * + (-232841 * pow(x, 12) + 465682 * pow(x, 10) - 346115 * pow(x, 8) + + 118668 * pow(x, 6) - 18879 * pow(x, 4) + 1218 * pow(x, 2) - 21); +} + +double +AssLegFunction::P_20_7_Deriv(const double x) const +{ + return (1581170716125.0 / 1024.0) * sqrt(1 - pow(x, 2)) * + (665260 * pow(x, 18) - 2960407 * pow(x, 16) + 5447940 * pow(x, 14) - + 5358040 * pow(x, 12) + 3038620 * pow(x, 10) - 999630 * pow(x, 8) + + 182028 * pow(x, 6) - 16320 * pow(x, 4) + 552 * pow(x, 2) - 3); +} + +double +AssLegFunction::P_20_8(const double x) const +{ + return (1581170716125.0 / 1024.0) * pow(pow(x, 2) - 1, 4) * + (432419 * pow(x, 12) - 731786 * pow(x, 10) + 445005 * pow(x, 8) - + 118668 * pow(x, 6) + 13485 * pow(x, 4) - 522 * pow(x, 2) + 3); +} + +double +AssLegFunction::P_20_8_Deriv(const double x) const +{ + return (1581170716125.0 / 256.0) * x * + (2162095 * pow(x, 18) - 11076579 * pow(x, 16) + 23866652 * pow(x, 14) - + 28066780 * pow(x, 12) + 19553250 * pow(x, 10) - 8195690 * pow(x, 8) + + 2005356 * pow(x, 6) - 263628 * pow(x, 4) + 15591 * pow(x, 2) - 267); +} + +double +AssLegFunction::P_20_9(const double x) const +{ + return (45853950767625.0 / 256.0) * x * pow(1 - pow(x, 2), 9.0 / 2.0) * + (-44733 * pow(x, 10) + 63085 * pow(x, 8) - 30690 * pow(x, 6) + + 6138 * pow(x, 4) - 465 * pow(x, 2) + 9); +} + +double +AssLegFunction::P_20_9_Deriv(const double x) const +{ + return (137561852302875.0 / 256.0) * sqrt(1 - pow(x, 2)) * + (-298220 * pow(x, 18) + 1437191 * pow(x, 16) - 2875188 * pow(x, 14) + + 3084872 * pow(x, 12) - 1914188 * pow(x, 10) + 690462 * pow(x, 8) - + 138012 * pow(x, 6) + 13584 * pow(x, 4) - 504 * pow(x, 2) + 3); +} + +double +AssLegFunction::P_20_10(const double x) const +{ + return (137561852302875.0 / 256.0) * pow(pow(x, 2) - 1, 5) * + (-164021 * pow(x, 10) + 189255 * pow(x, 8) - 71610 * pow(x, 6) + + 10230 * pow(x, 4) - 465 * pow(x, 2) + 3); +} + +double +AssLegFunction::P_20_10_Deriv(const double x) const +{ + return (687809261514375.0 / 64.0) * x * + (-164021 * pow(x, 18) + 908424 * pow(x, 16) - 2126476 * pow(x, 14) + + 2730728 * pow(x, 12) - 2088222 * pow(x, 10) + 965512 * pow(x, 8) - + 261708 * pow(x, 6) + 38232 * pow(x, 4) - 2517 * pow(x, 2) + 48); +} + +double +AssLegFunction::P_20_11(const double x) const +{ + return (21322087106945625.0 / 128.0) * x * pow(1 - pow(x, 2), 11.0 / 2.0) * + (-5291 * pow(x, 8) + 4884 * pow(x, 6) - 1386 * pow(x, 4) + + 132 * pow(x, 2) - 3); +} + +double +AssLegFunction::P_20_11_Deriv(const double x) const +{ + return (21322087106945625.0 / 128.0) * sqrt(1 - pow(x, 2)) * + (105820 * pow(x, 18) - 558811 * pow(x, 16) + 1233408 * pow(x, 14) - + 1470700 * pow(x, 12) + 1021672 * pow(x, 10) - 415386 * pow(x, 8) + + 94080 * pow(x, 6) - 10524 * pow(x, 4) + 444 * pow(x, 2) - 3); +} + +double +AssLegFunction::P_20_12(const double x) const +{ + return (63966261320836875.0 / 128.0) * pow(pow(x, 2) - 1, 6) * + (15873 * pow(x, 8) - 11396 * pow(x, 6) + 2310 * pow(x, 4) - + 132 * pow(x, 2) + 1); +} + +double +AssLegFunction::P_20_12_Deriv(const double x) const +{ + return (191898783962510625.0 / 32.0) * x * + (26455 * pow(x, 18) - 159951 * pow(x, 16) + 411708 * pow(x, 14) - + 586124 * pow(x, 12) + 501458 * pow(x, 10) - 261970 * pow(x, 8) + + 81036 * pow(x, 6) - 13628 * pow(x, 4) + 1039 * pow(x, 2) - 23); +} + +double +AssLegFunction::P_20_13(const double x) const +{ + return (2110886623587616875.0 / 16.0) * x * pow(1 - pow(x, 2), 13.0 / 2.0) * + (-481 * pow(x, 6) + 259 * pow(x, 4) - 35 * pow(x, 2) + 1); +} + +double +AssLegFunction::P_20_13_Deriv(const double x) const +{ + return (2110886623587616875.0 / 16.0) * pow(1 - pow(x, 2), 11.0 / 2.0) * + (13 * pow(x, 2) * + (481 * pow(x, 6) - 259 * pow(x, 4) + 35 * pow(x, 2) - 1) + + (1 - pow(x, 2)) * + (-3367 * pow(x, 6) + 1295 * pow(x, 4) - 105 * pow(x, 2) + 1)); +} + +double +AssLegFunction::P_20_14(const double x) const +{ + return (2110886623587616875.0 / 16.0) * pow(pow(x, 2) - 1, 7) * + (-3367 * pow(x, 6) + 1295 * pow(x, 4) - 105 * pow(x, 2) + 1); +} + +double +AssLegFunction::P_20_14_Deriv(const double x) const +{ + return (14776206365113318125.0 / 8.0) * x * pow(pow(x, 2) - 1, 6) * + (-3367 * pow(x, 6) + 1295 * pow(x, 4) - 105 * pow(x, 2) + + (pow(x, 2) - 1) * (-1443 * pow(x, 4) + 370 * pow(x, 2) - 15) + 1); +} + +double +AssLegFunction::P_20_15(const double x) const +{ + return (14776206365113318125.0 / 8.0) * x * pow(1 - pow(x, 2), 15.0 / 2.0) * + (-1443 * pow(x, 4) + 370 * pow(x, 2) - 15); +} + +double +AssLegFunction::P_20_15_Deriv(const double x) const +{ + return (221643095476699771875.0 / 8.0) * pow(1 - pow(x, 2), 13.0 / 2.0) * + (pow(x, 2) * (1443 * pow(x, 4) - 370 * pow(x, 2) + 15) + + (1 - pow(x, 2)) * (-481 * pow(x, 4) + 74 * pow(x, 2) - 1)); +} + +double +AssLegFunction::P_20_16(const double x) const +{ + return (221643095476699771875.0 / 8.0) * pow(pow(x, 2) - 1, 8) * + (481 * pow(x, 4) - 74 * pow(x, 2) + 1); +} + +double +AssLegFunction::P_20_16_Deriv(const double x) const +{ + return (221643095476699771875.0 / 2.0) * x * pow(pow(x, 2) - 1, 7) * + (1924 * pow(x, 4) - 296 * pow(x, 2) + + 37 * (pow(x, 2) - 1) * (13 * pow(x, 2) - 1) + 4); +} + +double +AssLegFunction::P_20_17(const double x) const +{ + return (8200794532637891559375.0 / 2.0) * x * (1 - 13 * pow(x, 2)) * + pow(1 - pow(x, 2), 17.0 / 2.0); +} + +double +AssLegFunction::P_20_17_Deriv(const double x) const +{ + return (8200794532637891559375.0 / 2.0) * pow(1 - pow(x, 2), 15.0 / 2.0) * + (17 * pow(x, 2) * (13 * pow(x, 2) - 1) + + (1 - 39 * pow(x, 2)) * (1 - pow(x, 2))); +} + +double +AssLegFunction::P_20_18(const double x) const +{ + return (8200794532637891559375.0 / 2.0) * (1 - 39 * pow(x, 2)) * + pow(pow(x, 2) - 1, 9); +} + +double +AssLegFunction::P_20_18_Deriv(const double x) const +{ + return 49204767195827349356250.0 * x * (8 - 65 * pow(x, 2)) * + pow(pow(x, 2) - 1, 8); +} + +double +AssLegFunction::P_20_19(const double x) const +{ + return -319830986772877770815625.0 * x * pow(1 - pow(x, 2), 19.0 / 2.0); +} + +double +AssLegFunction::P_20_19_Deriv(const double x) const +{ + return pow(1 - pow(x, 2), 17.0 / 2.0) * + (6396619735457555416312500.0 * pow(x, 2) - 319830986772877770815625.0); +} + +double +AssLegFunction::P_20_20(const double x) const +{ + return 319830986772877770815625.0 * pow(pow(x, 2) - 1, 10); +} + +double +AssLegFunction::P_20_20_Deriv(const double x) const +{ + return 6396619735457555416312500.0 * x * pow(pow(x, 2) - 1, 9); +} diff --git a/source/bem_fma.cc b/source/bem_fma.cc index a584ee91..8078d023 100644 --- a/source/bem_fma.cc +++ b/source/bem_fma.cc @@ -1,10 +1,13 @@ #define TOLL 0.001 -// #define MAXELEMENTSPERBLOCK 1 -#include "../include/bem_fma.h" +#ifdef _OPENMP +# include +#endif + #include +#include "../include/bem_fma.h" #include "../include/laplace_kernel.h" #include "Teuchos_TimeMonitor.hpp" using Teuchos::RCP; @@ -13,17 +16,18 @@ using Teuchos::TimeMonitor; using namespace tbb; RCP